I'm grateful for the ideas provided in the comments on my last post. I didn't have enough time to thoroughly consider them all by today, so I'm just going to discuss where GDom is at now.
I've used the Vala tutorial to acquaint myself with some of its finer points. I welcome recommendations for other best practises when writing code in Vala, though.
I've also played with the older libgeexml recently to observe an example of libxml2 getting wrapped and abstracted in Vala. This entailed a lot of changes to get it to compile again (a lot in Vala has changed over a few years), which are currently available at a gitorious repo. I'll check if there's still interest in the project before polishing a patch set and sending it to git.gnome.org.
After this past week, we can now load an XML file and traverse its node structure. I went about creating a bunch of stub classes, and trying to implement the Document and Node DOM interfaces to start. Again, since GDom is initially relying on libxml2 (concerns about its memory consumption have been noted) for its back-end functionality, a lot of the work involved simply transforming data into user-friendly GObjects.
The code right now is available at the GDom gitorious repository. The initial commits have been large lumps, and the code base still requires a lot of massaging and stub-filling.
I encountered some issues having GDom's Attributes implement the same Node interface as all the other nodes, like the DOM API wants. Mostly because libxml2 treats its attributes as slightly distinct from its nodes. I also had a headache in trying to keep the attributes synchronised for a node between the GDom and the libxml2 representations, since the DOM API wants us to provide something like a HashTable (a NamedNodeMap) to users, but I want to keep that and the backing libxml2 structure in sync. I had originally hoped there would be easy signals to catch, but now I just have to be careful to sync them at the right time. I also have to take some care to avoid creating multiple distinct GDom Nodes for the same libxml2 node. I'd like a 1-1 relationship here.
The wonderful Alberto Ruiz has provided good guidance on all my questions so far, though, helping ensure GDom and I can continue to move forward :)
Try to get Document and Node much more complete. This involves implementing more of other classes, too. The Document interface defines a bunch of methods for creating other elements, for example, so even if they don't function perfectly, I still want to have a dumb version for Document to handle.
Also, quite importantly, I'm going to create tests for Document and Node to start. Right now, I have a simple main () function that uses them to load an XML file and navigate it. I would like to have a more complete test package available to guide GDom's progress, though.
Also, finish considering and addressing comments left on my last post. I've read them all, and some of them warrant replies. Thank you for the feed back already. (I'll note that I'm busy this weekend, and won't get back to it until Monday, though.)
Also, I need to fill out more of http://live.gnome.org/XML. It's still a little sparse.
Have a good week.
Good day. GNOME has many beautiful APIs. For manipulating XML, many projects use the powerful libxml2. However, its API is not consistent with GNOME conventions. It uses different data types, and does not benefit from good integration with GLib, missing out on libraries like GIO.
- GObject API and GLib integration
- All objects, such as Nodes, Documents, and Attributes, will be GObjects. They'll use GErrors for exception handling, handle GIO's GInputStreams, etc.
- Functionality via libxml2
- We are not implementing the API from scratch. In fact, almost all its functionality is coming from libxml2, which is already robust and has good performance.
- GDOM will be implemented in Vala which should help minimise the work necessary to complete the API.
I really want to hear your thoughts on XML and GNOME. I am at a disadvantage of never having had to write anything too large or intensive that used XML, just parsing and building simple files for my own projects. If you're involved with a project that already uses libxml2 (or another XML API), let me know. I'd like to see how you use it and how GDOM might make life better for you.
GSoC and Me
This is a Google Summer of Code 2011 project, and my mentor is Alberto Ruiz. Me? I'm a Masters student at the University of Guelph. I fell in love with GNOME about 7 years ago, but never got around to writing much code until 2009. My Masters has kept me busy recently, but thanks to Google, I can justify focusing on GNOME for a while :)
I wrote a love letter to WIND Mobile today. I've been looking at Canadian cellular carriers that cover Guelph that could enable me to talk to my girlfriend (Guelph number) while she's away in Algonquin (not long distance given her plan). All available carriers are evil and must be handled like pirates.
I fear I won't get to go with WIND before I next leave Guelph. Sigh! The future will be better (until we destroy ourselves).
Worked on campus today. It was deserted as usual. I'd rather it was desserted. :) There were still lots of people outside around town, despite the rain. A highlight was running down a hill and seeing a guy running up it while the rain was soaking everything.
When it was cooler in the evening, and I went outside for some air, I got to see some stray fireworks. I can still here them. I wish that the town had coordinated something, though. I'm finally feeling a lot better now. Last night was somewhat bad, but in the morning (an unintentional 12 hours of sleep!) things were great. I sometimes wish I could have more control in my dreams so that all that time could be better spent :)
Today I asked a dumb question (that is, filed a bug in GNOME's bugzilla) and got a quick response, which helped me realise the cognitive mistake I had made. Sigh.
Anyway, finally solved my issues getting some bitrotted code to compile, though it has some useless stubs. The tests don't seem to use them, though. It's been a good exercise in vala and autofoo.
One aspect of responsibility, promptness, I see as keeping tennis balls out of your court. Usually, when something arrives that requires my attention, I want to address it and send it back as soon as possible. The worst case scenario is when I take too long, and I have to get reminded. When that happens, there's usually something going on, like I've been traveling, or fell ill, or was overwhelmed with some more pressing responsibility.
Feeling better today, I was catching up on my e-mail and in the midst of it I received a reminder e-mail. Sigh! :)
I've been feeling quite sick the past few days. It's left me unable to concentrate or focus for long periods of time, so school and GSoC have stagnated a little now. I'm not feeling too much better today, but I've migrated to campus, since I need to escape the isolation of my apartment right now.
I wish I could better plan these things.
My post about phones yesterday came from my intent (a resolve!) to compromise and subscribe for 3 months, so I can talk to my girlfriend while she's away doing field work for the summer. I have a Google Nexus One intended for WIND Mobile's 3G in Canada, but can go with 2G GSM with Rogers or Fido, so I'm limited to those two if I want to avoid getting a new phone.
My goal was just to achieve effectively unlimited calling with one other person in Canada. After talking to both of them, I've concluded that they're insane. From activation fees to nickle-and-diming of basic features to complex long distance incoming/outgoing systems to weird calling zones to fine print additional regulatory fees to wow. Just wow. Ultimately, it would cost me almost $50 a month for the simplest plans that would let me talk to my girlfriend this summer, and her phone's number would even be local!
At home, we have a Vonage home phone-type plan, which for $30 gives me effectively unlimited long distance across North America, most of Europe, and most other developed countries, including call display, voice mail, and basically everything I can think of. Last summer, I worked in Toronto and I went with WIND Mobile, and for flat rates I had a healthy amount of data and unlimited calling and features and, wow. Such glee.
For now, I will just try to schedule myself to be around during good periods for calling (evenings, be at home a little for lunch). It will require more discipline, and I do want to talk with my girlfriend, but money is quite tight and I don't deal with extortionists. I eagrely look forward to the expansion of VoIP services on smart phones. I'm looking forward to Google Voice eventually coming to Canada (hahaha), or to Vonage providing a carrier-and-facebook-independent voice app (over wifi), or to the expansion of WIND to the Guelph area (probably not before at least mid-2012, soon before I finish). Rogers and Fido have left me feeling ill. I remember my girlfriend finding Koodo better, but really, how do so many of you tolerate cell phone companies? "I need it" is not true. Stop pretending it is and stop wasting your money. I wish consumers could be effectively mobilised to boycott this insanity. Ah well. The future will be better until we destroy ourselves :D
Now with the major carriers offering better plans limited to major cities, to try to counter the rise of WIND Mobile and Mobilicity with their superior plans, perhaps now would be a good time for more rural subscribers to scream bloody murder and discrimination. The "I live in one of the major cities that the new entrants can afford to come out!" plans from Bell, Rogers, and Telus's brands seem very unfair to those who live outside those cities :)
I guess I've been hoping that either WIND Mobile and Mobilicity thrived, and expanded to cover the country, with their humanity. Or that they would pressure Bell/Rogers/Telus to reform and mend their ways (or at least their pricing :|). There is concern that the new in-city plans by them are only intended to last as long as the new entrants last, with the incumbents hoping they can starve them. (Lots of people haven't been able to switch even if they wanted to due to evil contracts.) I'm annoyed that, indeed, the attempts for the incumbents to compete remains localised and focused only on the markets the new entrants are in. So much for general reform across the country.
I suppose I hope to be optimistic for WIND, that eventually they'll cover most of Canada. Though by that time, I might have moved ;)
If you use Firefox 4, there's a new feature called tabbed groups. Basically, people are bad at managing their Internet lives and end up opening too many tabs at one type, and can't keep them sorted/straight, so Firefox now lets you cluster different tabs together, and show one cluster at a time, hiding the rest. Here are my four, new groups:
- Development: mostly Google Summer of Code right now
- Education: school pages, a diverse set
- Friends and Fun: the epitome of procrastination, all Facebook and LiveJournal pages go here
- Long Term: these are tabs that I've carried for two years or more. They require a lot of time and effort to handle (e.g. interacting with the real world to accomplish something important)
I often get up near 100 tabs in a session, and usually get as low as 20. (Wikipedia and Google Reader are great sources for transient, short-lived pages that balloon a session.) Tab Groups will only make this worse, by making me forget just how many I have open in other groups. This will really slow down your computer! I have two other tricks to manage the abundance.
- I use the Bar Tab extension. This prevents pages from actually loading and thus taking up memory and CPU. They still appear in your tab bar, with the title and icon, but loading is delayed until you actually go to read it. Right now, I have it set so I have to actually refresh the page to get it to load (since I often end up on tabs I don't mean to open by closing some other one). This means that, often, I might have 5 out of 50 tabs actually weighing down my browser. Before this, I had to switch to Google Chrome (which has a task manager that tells you which tabs are slowing me down most). I am really grateful for Bar Tab, and it's on-demand style.
- I also use the Tree Style tab view extension. I use it to make my tab bar a vertical list on the side of my browser, rather than a strip across the top. This is nice, because the tabs remain a fixed width forever, and they stack upon one another. Because they build in their thinnest direction (tabs are shorter than they are wide), it's harder for them to disappear off my screen (as with the default top tab bar, tabs would disappear off to the left and right). I wonder why it's just not the default? Its second benefit is that it's a tree of tabs, so if you open new tabs from one, they appear as indented children to that tab in the list. It's great.
Oh, and finally, something I enjoy about Firefox 4 is the ability to pin a particular tab to your browser so that it will always be there and won't go away. The pinned tabs appear at the start of your tab list, and usually just show the icon. I can't accidentally close them carelessly using ctrl w either. They're intended for web apps that you often use, and I use a pure Google set:
- Google Reader
- Google Calender
- Google Docs
- Blogger (wow, something that doesn't start with a G!)
Good day to you.
For maybe 5 years I enjoyed the pleasure of a black Swiss Army (now Victorinox) shoulder bag. It replaced a decayed Point Zero red, cream and black bag, but now it also has decayed. In February, after taking my girlfriend to a delightful Valentine's lunch, I went to Zellers and fell in love (Happy Valentine's!) with an eggplant purple VIA Rail tote.
Landau Sacamoto makes luggage, and in particular my VIA Rail tote. However, it's easy to sometimes make a bad decision when designing something that won't reveal itself in early testing, such as the durability of the metal (if you will call this that) in a shoulder strap's clips.
I e-mailed Landau Sacamoto, who warrants my tote for 10 years against defects in material or workmanship, with a photo of the damage, asking if this was covered, and they phoned me back and offered to send me a new strap! I am delighted. While I already loved the bag (it's the perfect size, and colour, and design (compartment-wise)), I am glad that they care about their clips! Yay!
I use PicasaWeb for photo sharing. Today I uploaded a photo that was rather dark and reddish in colour temperature. I thought about modifying it in the Gimp (a desktop image editor), but then I recalled that PicasaWeb offered editing through a web service, Picnik, that Google bought last year. I hadn't tried it yet, so I clicked the obvious edit button and and was initially a bit put off when it didn't work in Firefox. Fine, I still want to try it, so I went to Chrome. This time, I saw a pretty splash screen while it loaded. Then I was put a little more off as I came to a busy (but beautiful) home page that wanted me to register or log in. If Google acquired it over a year ago, why does it still not recognise? Why do I need create a separate account? I googled around, and discovered that apparently Google is planning to fix that, but hasn't gotten around to it. Alright, whatever. Let's hope there aren't any issues when they finally get to it and, oops, my e-mail address is already in use. So, I create it, and get logged in and... I'm still at the home page, and I don't know how to pick the photo from PicasaWeb from here. Ugh. OK, close the frame and go to my photo and click edit again and...
It was so wonderful. The image editor was simple, smooth, and fast. It used the photographic term 'exposure' when I wanted to increase the 'brightness' of the photo, which will baffle some, but I'm fine with that. Their Auto-fix, a presumptuous name, as though there could be anything wrong with my work! :O, fixed the colour temperature easily. Then I chose to save it back to my album (it knew of my album :D), and even asked if I wanted to create a new copy or replace my old one! :D
So, the integration with Google's account system is sorely lacking, but I can see why Google bought it, and the integration with PicasaWeb (once I got an account) seems great. I approve.
from Vesak Day at the Big Picture
Have you heard of The Big Picture? It's a regular photo essay feature from the Boston Globe. Journalists and news outlets have access to a stunningly beautiful array of photos capturing a lot that goes on in the world in a medium much more vivid than most text-based reporting. It's great at bringing to life other cultures, the effect of tragedies, and some of our great achievements. Each photo in the essay benefits from the context of the photos that join it, increasing the impact over a lone, singular shot I might normally encounter on the web. I don't always enjoy what I see: there's little to enjoy when tougher topics such as victims of war and flooding look me directly in the eye, but I need to see it occasionally to maintain a relevant sense of reality.
My favourite way to enjoy the Big Picture is with my girlfriend. Going through 30-40 pictures per essay can take a little time, especially when we've let multiple essays accumulate, so we don't always have a convenient moment to both sit down. But when we do, I get to enjoy the beauty of the world with her, I get to hear some of her reactions, I get to commiserate over sadness, I get to co-babble over the amazing, and I get to learn something new with her. It can give us a rich, new piece of context that we can share.
There are some experiences a lot of us have in common. Generations that grow up together in front of TVs can bond over My Little Pony or (almost universally) the Simpsons. I like the idea of having The Big Picture in common. I mean, those cranberry fields around Thanksgiving, they're amazing to see!
Sintel, the result of the Durian Open Movie Project, is quite a beautiful animated short (12 minutes excluding credits) demonstrating what the open source Blender 3D studio can do. That said, I am not fond of the short's ending.
You can watch it here.
Another mobile post.
Google is annoying. Their new Android apps, and Netflix's, are not supported in Canada.
I have uploaded hundreds of photos. I will eventually get around to writing a post about them.
I have organised my dad's dishes. This is a historic feat for kitchen usability.
I have rearranged my room again and sorted lots of paper, finding receipts and letters from years ago, even ones I never posted or opened.
I have realised mynseven year old camera does produce better photos than my phone, but just barely.
Over the last week, I watched another anime series: Blassreiter. I ultimately liked it, but I didn't for the first while. (It was just something to play in the background.) The second half had a few great episodes though, and the story in general came together. Hooray.
In the last few hours, I've also managed to finish preparing a bunch of stuff for the week to come. I enjoy approaching life problems as concrete, definite problems that can be broken up and organised.
- ► 2016 (24)
- ► 2015 (32)
- ► 2014 (179)
- ► 2013 (218)
- ► 2012 (439)
- "I understand"
- Lessons on Sewing
- GDom Progress
- Hello GNOME. Meet GDOM.
- Wrote a Love Letter
- Timeliness and Responsibility
- Passing Thought
- Passing Thought
- Phone Carriers Are Evil
- Passing Thought
- Passing Thought
- Tab Groups in Firefox 4
- Passing Thought
- I like Landau Sacamoto
- Having a Picnik
- Passing Thought
- Understanding the world around me
- Passing Thought
- eMusic losing artists :(
- Sintel: at least it's pretty
- Life is grand
- Blassreiter and Progress
- Good work
- ▼ May (31)
- ► 2010 (70)
- ► 2009 (69)