June 21, 2008

Weekly Report #3: Recipe for the perfect disaster

Posted in GSoC tagged , , , , , , , , , , , at 1:29 am by fadinlight

First of all the GSoC weekly report news:

Yes, I know this is not kinda “weekly report”, but, as I’ve already told to my mentor, I’m quite busy in these days because I’ve an exam on June 25. However, step by step, I’m solving the main “behind-the-scenes” difficulties of the project.

SVG markers and patterns

As you can see in the image above, now, when a class is selected, if it contains a reference to an SVG marker contained in the rule file, the marker is shown on the right. Not quite beautiful yet, but it works. The following is another example, even if more difficult to read:

Because I’ve not already upgraded my Linux box to Firefox 3, I couldn’t take a snapshot showing SVG patterns (which are supported by my code as well), because SVG patterns aren’t supported in Firefox 2, as also stated in MDC. However it works smoothly on Firefox 3 for Windows.

Rules Modeling

Beyond SVG markers and patterns, I’ve got progress in rules handling too. Now quite all rules are parsed (think only “tag” elements inside “text” elements aren’t handled yet; same for selectors too), and class/mask-class parse-to-arrays is working.

As you can see in the above picture, if we search in the rules for “tunnel-core” class, the correct rule is shown even if tunnel-core is a mask-class and not a real class in the rule file.

Else elements are handled as well:

So what about the recipe for a perfect disaster?

That’s simple:

  • Take a laptop computer, Windows XP/Kubuntu 8.04 dual boot
  • Edit three critical GSoC project files in the Windows XP FAT32 partition for a while with Aptana
  • Go to dentist without powering off the computer
  • Return at home, find the pc powered off, power on it, go to Kubuntu and edit three critical GSoC project files in the Windows XP FAT32 partition for a while with KWrite
  • The day after, boot to Windows XP to read some notes rapidly
  • Find it was suspended, see Aptana still open with that three files.
  • Close Aptana without closing the three most critical files of the project before
  • Power off the PC and, during the evening, boot to Kubuntu
  • Find the wireless is not working, so reboot Kubuntu again
  • Leave the laptop booting, and find after a while the dosfsck has run and fixed automatically something in the FAT32 partition
  • Open Dolphin and, finally, cry looking at the following screen

Obviously I had a backup, but several hours of work got wasted however… Sic!


June 1, 2008

Weekly Report #1: How to obtain the ugliest map ever

Posted in GSoC tagged , , , , , , at 11:32 pm by fadinlight

(To see the screencast, visit this link and download 20080601_osmarender_frontend_screencast.zip file – 14 Mb)

Despite my weekly report’s title, this week I’ve obtained the first successful step of my project!

New features

These are the new features:

  • I’ve seen that my application is now compatible with Firefox 3 RC1 for Windows (worked in beta 4 but didn’t in beta 5)
  • Don’t really know what’s happened (perhaps some issues with my previous Kubuntu installation? perhaps some Firefox 3 module kept when downgrading in my 8.04?), but I’ve seen that the application seems to be compatible even with Firefox for Linux
  • Can load a predefined rule file or a custom rule file, giving its name in an input box
  • Thanks to this CSS Parser, with some modifications, the application will parse the CSS section of the rule file
  • A combo box will appear in the application, and selecting a CSS class, you can modify any preset
  • I’ve written a little function for CSS Writing, so the application will automatically store in memory any new value
  • I’ve found a little trick for saving to disk the edited XML file, and successfully reloading it.


So what about the title? As I’ve done during application phase, I’ve produced a little screencast to show those features. In the screencast you’ll see the real meaning of this weekly report’s title 🙂

So, if you have time (it’s 10 minutes long, but I’ve spent 3-4 hours to produce it, so give me some satisfaction 😉 ), you can download and view this SWF screencast! (download the 20080601_osmarender_frontend_screencast.zip file, about 14 Mb) After downloading, unzip it in a directory of your choice and point your browser at 20080601_Osmarender_frontend_screencast.html, playing it in full screen mode (F11).

Next steps

During next week I hope to achieve the following tasks:

  • Refactoring of all my code (now it’s a mess)
  • Begin using JSDoc for documentation
  • Create new CSS properties/classes or delete them
  • If time helps, I would like to enrich the internal CSS data model to let the frontend know how to edit single properties with a proper widget. To do this I’ll try to encapsulate some existing JS libraries in the future.