Renaissance of the Command Line
Recently I noticed some odd stuff. Launchy – an open source keystroke launcher for windows. Start++, a Vista tool that enables users to launch programs, open websites and play music by typing simple commands into a textbox.
Are they reinventing the unix shell? Well, not exactly but by some means yes, they are. That’s no surprise. Interacting with a computer via the keyboard is much faster than using the mouse. Especially when your hands reside on the keyboard, e.g. while writing text or during a chat conversation. I think it’s great that people are rediscovering this advantage. Creators of IRC clients for example have been including this feature for a long time.
For the very same reason I prefer the VIM editor and use the bash even on my Windows Systems with the help of Cygwin.
The Future of Desktop Environments
Lately quite a lot of videos presenting future desktop environments emerged. All of them are really cool so I’d like to summarize and share them.
A very popular one is a TED talk by Jefferson Han given in February 2006. Mr. Han presents a “multi-touch-sensing” screen which is basically a touchscreen which “recognizes multiple simultaneous touch points” and even pressure. Sounds boring? It’s not. Watch the video and see for yourself.
This however are still dreams of the future. A not so far away and really cool desktop environment is the BumpTop Prototype. It’s a project that aims to “enrich the desktop metaphor with expressive, lightweight techniques found in the real world”. A very cool video is available here.
But one can enjoy fancy new desktop environments today. The Beryl Project is an OpenGL accelerated desktop for the Linux operating system. And boy does it look pretty! There are two videos available here and here.
Browser Games and Software Engineering
I recently started writing (yet another) browser based massively multiplayer online game (MMOG) engine. Nothing to fancy, very basic and simple stuff. And I’m of course nowhere near finished. However I spent a considerable amount of time thinking about the fundamental design from the standpoint of a software engineer. This article describes what I came up with.
The very basic design pattern
As all well coded modern applications implement the model-view-controller design pattern I tried to adapt this princible. The pattern facilitates splitting the application into three layers: the model, the view and the controller.
The view (or user interface) represents the data in a convenient way for the user and enables him to trigger certain actions, request data and so on.
The controller (or in my case the game logic) embodies the actual game logic. It is capable of processing and responding to user requests or events in general. A ticker object (a piece of code that updates the game regularly) would also fit into this layer. Additionally it contains a data-link, to connect the controller and the model layer.
Finally the model layer. It represents the game data. In browser games this is often a database of some sort. In my case it’s a shiny PostgreSQL 8.2 database.
The advantage of this pattern is obvious: by decoupling data presentation, business logic and data access/storage the layers may be altered independently. It also simplifies development by reducing the complexity of the engine. Additionally it allows developers to work on different problems, e.g. say a web designer develops the user interface whereas the PHP developer creates the game logic. The developers simply have to define the interfaces between their layers. That’s all they need to know of each other.
Decoupling of the presentation layer nowadays is often achieved by using some sort of template engine. A really cool thing! A detailed description of the mvc design pattern can be found on here.
Controller and Model Design
So far I have designed the controller and the model layers. The following pseudo class-diagram visualizes the concept:
The view layer is not yet implemented. However I plan to allow the user interface to send REST requests to the controller layer. There the received data is validated and the user is authenticated. Then the business logic processes the event, requests some data from the database via the data link, compiles the data together and triggers an output class (XML) to return the data to the user interface. Very straight forward. The user interface hopefully knows what to do with this data and represents it accordingly.
Implementation Consideration
I have already implemented the classes in the diagram shown above. I had to make several choices:
Error handling is a difficult and vital point of the design. I followed one basic principle: only the main class (the business logic class) is allowed to handle errors. Errors occurring in other modules are passed through to the business logic class. This is, in my opinion, vital to maintaining a clearly arranged engine. To return errors I used simple function return values and exceptions. PHP supports a very cool and straight forward exception system (with cool try and catch blocks). Exceptions are also a great way to report errors that occur in a class constructor. However I did not stick with exceptions exclusively because sometimes return values are much easier and faster to implement.
Data validation is a two layer task: first I check if the user tries to foist bogus data on the engine. This can be done with regular expressions and preg or ereg. The second layer ensures that the user does not try to do anything he is not allowed to, like reading someone else’s messages or building more soldiers than he can pay for.
Free Stuff
In case you are interested, the images are created with the ingenious 0.45 version of Inkspace. It’s totally free and really cool. A ZIP file containing the source of the images can be downloaded here. The gorgeous icons are taken from the Tango Desktop Project. A larger version of the second image can be found here. As soon as I finish parts of the game I will put the source code online.
Wallpaper Roundup
Here’s a quick roundup of wallpapers or images that are so cool you must use them as wallpapers. Almost all of them can be found at deviantart.com. Included are some nice freehand drawing pieces, somewhat girlish but beautiful vector art, photos and manipulated photos and nice science fiction space stuff.
Furthermore, cool high-resolution wide screen wallpapers can be found here. A wallpaper search tool that searches the best photo sharing service in the world is wallpapr. A good resource when looking for nice wallpapers is also this page. However, nothing beats deviantart.com.
Visualization of Social Network
Update: I created a tool to convert CSV files to Walrus compatible LibSea files. Check out walruscvs here You can find additional social network visualizations here.
For a long time now I have been a great admirer of Matthew Hurst’s work and I’m continuously impressed by the works posted at visualcomplexity.com. So I decided it was time for me to try something like this myself.
What I did is write a program that is able to log in to a very popular German Social Networking website and grab some data from it. I grabbed the friends of my profile (only 2) their friends (about 100) and the friends of their friends (about 5000). I used PHP with cURL for that and saved the data to a MySQL database.
Then I looked for tools to visualize the data. Turns out it’s quite hard to find something suitable. Here’s an (incomplete) list of tools one can choose from. Ultimately I ended up using Pajek and Walrus.
The results I got from Pajek were a bit disappointing as the network creation algorithm does not seem to work that well on very large (>5000) nodes and it is unable to render images that emphasize a 3D feeling (so no eye candy):
However I was able to create two videos of the networks I rendered. Check out video1 here, a visualization of a very small network, and video2, which shows the entire network.
The results I got with Walrus where definitely better. It was quite complicated to get Walrus to accept my data as it heavily relies on a spanning tree, but I managed to get it to work:
I also was able to create a video of the network I rendered with Walrus, check it out here.
My work of course is not as sophisticated as the items mentioned at the beginning but I still like some of my graphs.
Google – the data octopus
Although this post shall be mainly about Google, I will start with another example: Amazon. If you bought a few times at Amazon, you will notice something when you visit their website. They give you recommendations on what to buy next. And most of the time this recommendations are pretty good, most of the time you would really like to own one of the products they recommend.
And probably everyone nowadays knows how they do it. They track everything a user does, from simple browsing, over searches to purchases and put together a profile of each customer or visitor. They compile a really huge database out of this pieces of information. And then they link this pieces together. The process is called “Data Mining“.
An Example: with the help of fancy algorithms and statistical analysis techniques they discover: 100 people bought the latest album by “The Killers”. 15% of those people also bought the latest album by “The Strokes”. So they reason if you bought the latest Storkes album you might also be interested in the Killers album.
This is of course only a very simple example as it only includes 2 features. Considering how many visitors, purchases and products Amazon has.. well. The data they have at their disposal should be quite good. By now they have probably a profile of every single one of us. Although you never bought anything at Amazon, your profile might just be in their database. Humans are not so different.
And what about Google? Do they create profiles of their users too? Hell yes. And the data they can gather from their users might be even better. Here’s a (incomplete) list of services Google offers and my ideas of what data they could gather from that.
- Search:
They analyse the keywords you type in, the search results you click and the sponsored links (ads) you click upon. They get a really huge profile of your search habits if you use the Personalized Search Service. Also if you have a personalized homepage all keywords may be tracked back to you. - Gmail:
Obviously: they scan your e-mails for keywords to put together ads. They can get a pretty good idea of what you’re interested in and of what you’re doing by reading your e-mail. - Personalized Homepage:
They know what gadgets you include in your personalized homepage. This also gives them a pointer on what you are interested in. Are you a software developer, politically interested, interested in finances, are you a democrat or a conservative? They may find that out. - Google Reader:
They know: what feeds you like, how regularly you read the feeds, what feeds you read most, how much time you spend reading newsfeeds. And they make no secret of it: Check out this article from their blog. - Google Talk:
That in conjunction with Gmail is their greatest source for social information. They know who you’re friends with! They also know how much time you spend in front of your computer. - Google Groups and Blogger:
They know what topics you’re interested in in terms of newsgroup discussions or blog comments (if the blog you comment on is hosted by Blogger).
Now don’t get me wrong. I’m not a fanatic Google hater. As a matter of fact I use some of the mentioned products myself (including Gmail which is probably the worst in terms of privacy) however I think it’s important for people to be aware of what can be done with their data. And yes, I’m aware of the irony that this blog is powered by Blogger.
Flickr Photostream Plugin
Finally there was time to complete the Flickr photostream plugin for the blog. It’s a script that fetches the three most recently added images from a special flickr photoset.
It makes use of the ingenious script.aculo.us Javascript library, which is based upon the fantastic Prototype framework. For the XML parsing of the Flickr output I used this tutorial here. Quick and dirty but working. To create the shaded borders I heavily depended on this nice tutorial.
As I feel like sharing, the PHP file can be found here. It will not work for you out of the box as I am making heavy use of CSS in the output. For the script to work correctly the script.aculo.us library also has to be included into the webpage.
New Input Devices
As news about the new Nintento Wii and especially the Wii remote resound through the land I decided it is time to put together a roundup of fancy input devices available or in development.
The first one to mention would be of course the Ninento Wii remote. It allows the user to interact with the console by means of phyisical gestures. So you can play baseball and literally be the batter or play golf and actually stroke the ball (or at least pretend to do so with the remote in your hand). This video explains the Wii remote’s concept. And here’s another very funny (and sexy) Wii comercial that disses the PS3 quite badly.
And somebody already hacked the Wii remote and is now able to control his Roomba. Check it out.
Furthermore, three researchers at Microsoft “have created an innovative handheld pointing device that works in mid-air” called Soap. There’s a video on how it works and how a Soap can be built here.
Researchers from Switzerland, Italy, Germany, France and the UK have developed a system that makes surfaces of any kind interactive with the help of acoustic sensors. For more information check out this article and the demonstration video.
The most intriguing concept however is a direct connection between computer and brain. There exists a very good wikipedia article about that topic. Of course ethical questions are to consider when those devices are not only used for treating disabilities but to enhance human function. Tough but very interesting topic.
Free Music
A Free Music page was added to the echelon blog. It’s a site to satisfy my need for posting songs I personally like very much to the blog.
All songs so far are from the Bavarian Open Source website. A very cool page where one can download songs from many known and unknown bands. Among the known being “Adam Green”, “The Kaiser Chiefs”, “Mediengruppe Telekomander” and “Deichkind”. Among the unknown being for example “Miwon” and “Lagoon”. It’s a very cool page and a very cool idea. They also have a Top20 list.
On another note, the complete Mozart works are now freely available on the Internet. The International Mozart Foundation apparently “aquired the right to publish the prestigious New Mozart Edition of every Mozart work” (from slashdot). Cool!
Defcon – Everybody Dies
A Telepolis article “Atomkrieg am Bildschirm” recently introduced the game Defcon by Introversion Software. It’s “the worlds first Genocide ’em up”. I played the demo and liked it very much.
It’s a strategy game where up to 6 players try to kill each other by means of nuclear weapons. To do this they may plant nuclear silos, radar stations, airports and fleets on a minimalistic but aesthetic world map. They can move their fleets, launch fighters and bombers and after some time of dancing arround each other, players may launch vast amounts of nuclear missiles to blow the opponents back to the stone age. The player killing the most enemy people wins. Fun! A picutre of the nuclear exchange:
A fully playable demo is available (50MB) and the full version can be obtained for only 14EUR. All strategy fans and genocide lovers should really check it out.