Posts Tagged ‘programming’

Ubuntu running Windows in VMware Player

Wednesday, January 31st, 2007

I managed to destroy my Windows XP partition a few weeks ago while trying to resize it. Fortunately I made a backup. I decided to try to run Windows inside a virtual machine. After removing the broken NTFS partition, I reused the free space to create a new /home partition.

I created a disk image with QEMU, and ran a Windows XP installation on it through VMware Player. And I must say, it works perfectly. I am even able to connect to USB devices such as a PocketPC.

In the picture below I am debugging a Compact .NET Hello World application in Visual Studio in Windows in VMware. The application is running on the PDA that is attached to the PC.

Debugging a PDA with Windows running in VMware on Ubuntu

Here is a screenshot of Visual Studio running the PocketPC emulator:

The Visual Studio PocketPC emulator in VMware Player

Speed is not an issue: the image runs almost at native speed thanks to the kernel modules. Whenever I need Windows (I rarely do), I just fire up VMware Player, and I am able to dig right in because it saved the previous state. And when I’m finished I just suspend the virtual machine.

I don’t think I’ll go back to a dual-boot system soon.

XML sit-ups with .NET

Tuesday, November 14th, 2006

I’m currently writing some C# code that outputs RDF/XML from a set of classes, and came across some annoyances regarding .NET’s support for XML namespaces (or the lack thereof).

First of all, .NET has only explicit support for one namespace per element. Additional namespaces must be specified by adding an extra xmlns attribute yourself. Well, that’s not so bad, but it adds to the code bloat.

When you want to use namespaces to create new elements (e.g. rdf:Description), you have to explicitly pass the namespace URI again. Otherwise the prefix (in this case rdf) will be ignored. It would be helpful if .NET could check to see if the prefix corresponds to any namespace previously specified in the document root.

Okay, I could have used an RDF library, but this was supposed to be a quick hack, so I didn’t have time to learn another library.

I can’t help but think that if I would have just used strings instead of the System.Xml classes, the program would have been finished sooner. Come to think of it, I should have known better and just used N3 or Turtle.

When using .NET’s XML classes, it seems like half of my code is redundant. Man, do I miss Ruby’s XML Builder.

I’ll end with a great graphic by Why the Lucky Stiff, in which he compares using XML to doing annoying sit-ups:

XML situps

The term XML sit-ups also appeared on the Ruby on Rails homepage:

Rails is a full-stack, open-source web framework in Ruby for writing real-world applications with joy and less code than most frameworks spend doing XML sit-ups.

The common idiom with dynamic languages is to write configuration scripts or domain-specific languages in the language itself, instead of using XML. Compared to e.g. Java, XML is more agile and flexible, but that is not the case with dynamic languages such as Ruby or Python. XML.com has an interesting article about this issue.

Dynamic Languages Day

Friday, February 17th, 2006

I almost forgot to blog about it, but I went to the Dynamic Languages day at the VUB on Monday, together with Yves.

I was always interested in learning new programming languages, and getting to know their unique features and viewpoints. After learning Python and Ruby, I became curious after the roots of these languages (being amongst others Lisp and Smalltalk). Since there were introductions and tutorials for these languages at the DLD, it was too good to miss.

The day started with a nice introduction to Scheme by Viviane Jonckers, explaining why they used it as a first programming language for their students.

Then there was a introduction to and demo of Smalltalk by Roel Wuyts and Johan Brichau. The afternoon ended with an Self tutorial by Ellen Van Paesschen.

In the afternoon Pascal Costanza delved into the internals of CLOS, the Common Lisp Object System.

Afterwards at the reception, I had a nice chat with the other attendants and organizers. I also met someone who I had seen before at the anti-software patents manifestations.

All in all, it was a interesting day, and I learned a lot about the presented languages. The list of Lisp links in my del.icio.us account also keeps growing. The organizers said they were planning to upload videos of the presentations at the website, so I’ll keep an eye on the website for updates.


Edit: the movies are now available at the event’s website