Aia @ Science Congress Leiden 2009

The Aia project has been nominated for participation at this year’s Science Congress of the University of Leiden. At June 12th 2009, me and my team, will hold a presentation about the Aia and its development. While it’s a Dutch event I figured it would be nice to share this information as it shows that the hard work behind the Aia project hasn’t gone unnoticed.

More information about the congress and participation can be found here.

Open Source Microsoft: The Good, the Bad and the Ugly

Microsoft has long been known for its anti-open-source. Most famous is maybe Microsoft’s CEO Steve Ballmer’s statement that “Linux is a cancer that attaches itself in an intellectual property sense to everything it touches”. But since November 2th 2006, with the controversial Microsoft-Novell agreement, Microsoft has been committing to open source development. At least, that’s what Microsoft says. Many people within the FOSS (Free Open Source Software) community are sceptical, though. And that isn’t particularly strange as Microsoft has been responsible for various actions which let you question their allegiance. The purpose of this article is to investigate Microsoft’s reputation as a wolf in sheep’s clothing.

The Good
Lets start with some recent news. Several days ago Microsoft released an open source alternative to Google’s BigTable. For those of you who don’t know what BigTable is. BigTable is a filesystem for storing large amounts of data distributed over a cluster of multiple computers. It’s one of the backbones of Google App Engine, which works quite well in my opinion. Still, Microsoft’s open source alternative is much welcome as BigTable is a proprietary database system. While this already pretty interesting, the most interesting part still has to come. Apparently, the development team of Kumo, Microsoft’s new search technology, looks at open source solutions by default, not proprietary software. And that’s quite something for a company which prefers to keep its code closed.

Now, lets look at some slightly older news. In July 2008 Microsoft announced that it would be joining and sponsoring the Apache Software Foundation. And when they joined the Apache Software Foundation they also submitted LGPL-licensed patches for ADOdb. Simultaneously they also announced that they would participate in the RubySpec project. A week later the could be heard, though. While I understand that Microsoft has only joined the Apache Software Foundation for its beneficial licensing conditions, I think we should first review their contributions before we judge them.

The Bad
An interesting Microsoft product is CodePlex. CodePlex is Microsoft’s answer to SourceForge. Just like SourceForge, CodePlex is an open source project hosting website. To promote shared development it offers various tools to developers such as wiki pages, SCMs, etc. Unfortunately, it looks like CodePlex isn’t exactly clean. According to The Register Microsoft taints open source CodePlex well, by using licenses and conditions that go against the very principles of open source.

But lets move to something more recent. You might have heard that Microsoft recently released Microsoft Office 2007 SP2 with ODF-support out of the box. It looks, however, like Microsoft has only achieved technical compliance but zero interoperability. Rob Weir is the chair for the OASIS ODF TC. I think it’s admirable that a chair of a committee actually spends time to check if everything works as it should. Maybe his checks aren’t as foolproof as that of a dedicated team, but it gives a good indication. To me it looks like Rob thinks that interoperability isn’t limited to the implementation of a standard. And that’s great news for end-users. Unfortunately, Microsoft doesn’t think so. Instead Microsoft calls Rob Weir biased and wants to remove him as chair for the OASIS ODF TC. I guess that Microsoft really wants to take over ODF, as it has tried before. It’s clear that only OOXML is on Microsoft’s mind. This list of the voting of the ODF 1.1 specification makes that also pretty clear: Microsoft didn’t vote, what a surprise. I rather have Rob Weir as chair, and the fact that he has ties with IBM makes me quite happy too. For those who don’t know, Big Blue is quite a big supporter of open source software.

The Ugly
You might remember this one. At the end of February Microsoft sued TomTom over Linux and various patent claims. After all of Microsoft’s claims that they’re committed to open source, they finally sued a company that used the world’s biggest open source project: Linux. They did that while they promised not to sue on FAT patents. About a month later TomTom and Microsoft settled, but to the FOSS community it was clear that Microsoft is not to be trusted. This also had some interesting consequences: The Open Invention Network announced that it would strike back at Microsoft with prior-art; A patch has been submitted to Linux to prevent creation of files with long filenames on FAT; People have begun to port software from Mono (based upon Microsoft technology) to other languages.

Finally, lets end with something from three days ago. Microsoft lobbyists are criticizing Amsterdam for moving to open source software. According to the article “Amsterdam wants to lead the way in the introduction of open source software”. Further in the article you can read that a Microsoft spokesperson has said “that the company is critical of governments that only want open source software”. That isn’t that strange if you consider the fact that unneeded software subscriptions can cost a municipality about €800.000,-.

All in all, Microsoft did things which were good for open source, but it’s still to early to tell whether Microsoft is really changing. Sometimes I get the idea that one part of Microsoft really wants to change, while another refuses to. I guess we should stay sceptical till Microsoft has figured how to deal with their split personality.

STF Utility (updated!)

The SSS STF (a cool new format for storing data with multiple levels but still > XML, more info here) parser is almost finished. I’m trying to simplify it up as we speak. C++ Templates sure can be frustrating! “/me twitches with his eyes.”

So the parser was working, but it didn’t utilize C++ all the way. I’m trying to reduce the code and thus ease further development and maintainability.

Some hours later…

It is finished! As far as I can tell anyway.  It has a nice example app with it, here’s a (now already dated) sneak peek:

    prettyprint("Welcome to the SSS example app");
cout
< < "This application shows how easy it is to use SSS.\n"
<< "STF is a \"new\" way to store leveled data, just as XML can do, for example.\n"
<< "The format looks like a C(++) struct, which we think is easier to read than XML.\n"
<< "Each :{ is a node, a node has other nodes and values. The first node is unnamed.\n"
<< endl;

So what are you waiting for? Grab the source with example app from the SourceForge page (either checkout from the SVN or select “Browse SVN” -> “Download GNU tarball” (all the way down) ), and use this neat alternative to XML! More information after the break.

Read the rest of this entry »

Component Oriented Entities – Updated (and some more…)

The code I posted in the article Component Oriented Entities has been updated. The code in that article contained some documentation mistakes. Thanks to Nick these mistakes have been corrected. Besides that I’ve also added some new methods (Entity::remove*) which were somehow forgotten in the first implementation. And of course the code has also been slightly improved. Unfortunately the Event Management part of the implementation still hasn’t been included. Still I would like to encourage people who are using the code or parts of it to update their own code.

Also, a sneak peek on what I’m currently working on.

Read the rest of this entry »

SSS > XML

Title says it all.

Maurice and I were thinking of how to circumvent XML one more time, and Maurice came up with this format:

ideayaybox:{
  author:"nick overdijk"
  author:"maurice bos"
  description:
"blabla
   blabla"
  link:{
      file:       "blah"
      tag: "something"
      tag:"something"
  }
}

So, basically we have 2 types, values and lists (which can be seen as values). Values are between quotation marks, if you want a quotation mark inside a value, you need double quotation marks! A list starts with ‘{‘, and ends with ‘}’.

In the above example, ideayaybox consists of 2 authors, 1 description, and a list of links. Simple enough right?

Simple String Structures, taking over the world!

Component Oriented Entities

Recently I started working at a game framework. The idea is to create a reusable framework that can be used across multiple platforms and libraries (I.e. Irrlicht, OGRE, SDL). Myself, I already have some experience with game programming (Entwined Worlds). However, all my previous game implementations were based upon the traditional deep hierarchy approach. At first sight this seems like a good idea, but I noticed that this approach always leads to very specialized entities. The true problem with this is that those entities often share various functionalities. And in order to prevent rewriting the same code over and over again, these functionalities are often put in a derived class from the base entity class. And the specialized entities then inherit from that class. The problem should become clear now: for every set of shared functionalities the programmer has to inherit from the base class (or maybe even an derived class). This can result in a gigantic unmaintainable tree of entities. Luckily, there is another approach called Component Oriented Entities.

The idea behind Component Oriented Entities is to make entities data-driven. In order to do this the functionalities are split in various individual components. As a result an entity is in fact nothing more than a collection of components. An added advantage is the ability to describe these components (and thus the entities) in XML or a similar mark-up language.

Yesterday I actually had a discussion with Nick about Component Oriented Entities. Initially he disagreed with me as I had some trouble explaining the “dangers” of the blob anti-pattern (a huge single class with a large amount of complex functionality). Later on, he agreed with me, but he also pointed out some things to keep in mind. One of those things was the implementation. And I really agree with that as these kind of things stand or fall based upon the implementation. Which brings me to my own implementation of Component Oriented Entities. Please note that all of the following code has been placed in the public domain and that I’ll take no responsibility or liability of any kind for any use that you may make of this code.

Read the rest of this entry »

Idea Designer: Pt. 2 Example Usage

Fast File Finder – Ideayay Example Usage

User wants to create a local file search program.

User already has worked out a GUI in a file.

User creates idea: “Fast File Finder”
Ideayay creates a folder “Fast File Finder” and sets its status to “Just started”

User creates question: “What GUI?” and links earlier mentioned file to this as answer.
Ideayay asks if that completely answers the question, user says yes, Ideayay marks this question as answered.

User creates the problem: “How to index all files on a PC?”.
Then goes on the internet to look it up and stores some links as attachments to that problem.
Then writes code using the attachments and links that (the sourcecode file) as solution for the problem.
Ideayay asks if that completely solves the problem, user says yes, Ideayay marks this problem solved.

User creates the problem: “How to quickly search through strings?”.
He posts the problem to a forum and links the URL as attachment to the problem.
The solution is found on the forum and he copies the text containing the solution as “Solution” to the problem.
Ideayay creates a file: problemname.answer.txt and metadata.
Ideayay asks if that completely solves the problem, user says yes, Ideayay marks this problem solved.

User links final source files to the idea itself and marks the idea finished.

Where is the horizontal rule when you need it?jaskldfjlkasjflkajsfkljaslkjflajslfjalsjfjaslkfjalksjfsal

That’ll do. The program’s name is. Ideayay. It was the worst name I could think of that’d surely piss off my partner. I was not wrong. Hehe.

We are going FAST with this one. Our SVN server definitely has an headache trying to keep up with the commits and updates and merges.

Idea Designer

I wondered if there was any software for working out ideas. I couldn’t find any, so I decided to try and create my own. The software will act as an idea dump. Say I have this idea, but don’t have the time to work it out. I used to have a small document with the name and a small description, but when I found something related to that idea say, on the internet, I could only paste the link inside that file and later on I’d forget about it anyway. I want one central place for all my ideas! And it’s coming pretty soon.

Less ideas in the mind makes room for more new ideas! Woeii.

You’ll the the software draft up here in a few days.

-Nick

Experiment: Django Distributed BitTorrent Tracker (DDBTT)

After publishing my previous post about Django I decided to try something more complex. The idea was to create a Django Distributed BitTorrent Tracker.

The BitTorrent protocol is a peer-to-peer file sharing protocol. The main advantage of the BitTorrent protocol over plain HTTP is that when a file is downloaded by multiple people, the downloaders will upload the data to each other. As a result hardware and bandwidth loads are significantly reduced. One of the main components of this protocol is the BitTorrent tracker. The tracker is responsible for coordinating the file distribution. To achieve this the tracker collects data of torrents and their seeders (uploaders) and leechers (downloaders). This data is then shared with BitTorrent clients that connect with the tracker. From there on the clients are on their own when it comes to making decisions.

One of the features of the BitTorrent tracker is the ability to add new torrents at any given time. But what if you want your tracker to keep track of only your torrents? What if you don’t want to become the next Pirate Bay? The answer is quite simple. You would have to disable the tracker’s ability to add external torrents. But by doing so, you too won’t be able to add torrents. This means that you would have to implement an interface to add torrents internally. If your tracker is database-driven this shouldn’t be very hard to do; you only have to add a new entry (assuming you’ve a table of torrents) to your database.

Okay, so your tracker only accepts internal torrents. Lets move on to the next problem. What if there aren’t any seeders available to distribute my file? Again, the answer is simple. You would have to implement HTTP seeding. HTTP seeding allows BitTorrent clients to download torrent pieces from an HTTP source in addition to the peers. Even though HTTP seeding is a client affair, I think the server can play a significant role. After all, the HTTP torrent pieces have to hosted somewhere.

If you combine these two ideas you get something along lines of this:

  • Uploading:
    • File is uploaded to the webserver;
    • Torrent meta data file (.torrent) is generated;
      • Don’t forget to generate a 20 byte sha1 hash for the torrent.
    • Torrent is exposed to the webserver;
  • Downloading:
    • Peer downloads the torrent meta data file;
    • Peer’s BitTorrent client downloads data from peers and webserver;

As you can see the concept is fairly easy. The implementation should be too hard either. The BitTorrent protocol is largely based upon plain HTTP. Clients send data to the tracker with HTTP GET variables and trackers send data back by outputting data (bencoded). Having said that, I didn’t finish my implementation of the Django Distributed BitTorrent Tracker. The reason for this is that I came across some bugs. Normally I would take my time to get rid of them, but currently I’m a bit short on time. Not only am I involved in multiple projects, but I also have to practice for my final examinations.

Even though I didn’t finish the implementation of the concept I’m content with this project. I really enjoyed working on this project. I’ve learned a lot about peer-to-peer (P2P). I was really amazed by the simplicity of the BitTorrent protocol.

If you would like to implement your own BitTorrent tracker or if you just want to know more about it then check out these sites:
Wikipedia – BitTorrent (protocol)
Official BitTorrent specification

Django

Lately I’ve been experimenting with Django. Django is a web framework written in the popular Python language. Python wasn’t exactly written with web development in mind as far as I know. As a result web development with Django is different than with something like PHP or ASP. That isn’t a bad thing, though. Lets say that I’ve never developed web applications as fast as I’m doing now.

The main reason why web development with Django is so quick, is because Django takes care of some annoying jobs. It’s a case of the DRY (Don’t Repeat Yourself) principle:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

Read the rest of this entry »