Battle of the virtual machines
by Alexander on Dec.19, 2008, under Reviews, Tech, Web, linux, programming

During the history of computing, there’s always been competition within classes of software. Like the one between operating systems, browsers or text editors. The outcome of these struggles matters a lot to both companies and users. Try debating Emacs vs Vi or Safari/IE/Firefox/Opera, anywhere on the web, and you’ll easily start a brightly lit flamewar.
Many of these battles hasn’t always been visible until some time has passed. Microsoft anticipated “the information highway” well in advance, but didn’t recognize today’s Internet for what it was until Netscape had the majority of web-users. According to Dataquest, Netscape had 80.1% of the market in 1995, while Internet Explorer only had a measly 2.9%. Today, Netscape has only 0.46% of the market, and falling.
Microsoft put their full weight behind promoting Internet Explorer and used highly controversial tactics. They spent a huge amount of resources on winning late in the game, at all cost. This is one example of how important it is for companies to control the key pieces of software that users use every day.
In fact, I think that’s one of the underestimated strengths of Microsoft; to recognize these battles and try to win them at all cost, even if they play dirty. They recognized it with DOS, Windows, Internet Explorer, Xbox, Visual Studio and many more. I’m sure a whole library of books can be written about all the intrigues they have been involved in for each of these technologies. I think the main difficulty about technology is that companies doesn’t always “get it” until it is too late. I think Microsoft still doesn’t fully understand the mindset that has driven Google to success, but I do think that Microsoft has recognized one of the latest battlegrounds, which is the battle of rich content (within browsers).
It’s been a while since we passed the threshold where the cost of programmers were higher than the cost of hardware, and with that change came the popularity of scripts, dynamic languages, garbage collection and bytecode compiled applications. While virtual machines have been around for a while (IBM had CP-40 in 1967) including them in the browser is comparatively new, from 1995, when Sun introduced Java Applets. This was the start of “rich content”.
Virtual machines in the browser is not just a technical sidenote. We could be talking about the future of the majority of applications that most of the users use. Some users already use applications within their browser for everything. The browser was originally meant for viewing documents, not being the interface to full applications. However, there are web applications that do all the hackery they muster to transform a document viewer into a somewhat usable GUI. Gmail and AJAX in general has succeeded surprisingly well, following this awkward path. Let’s face that this is not the most beautiful swan in the pond, but a hack. Browsers were not really meant to do this. Virtual machines in the browser, on the other hand, lays the groundwork for proper applications with the advantages of web-based applications. I mean “virtual machines in the browser” in a broad sense, and also think of related technologies like JavaScript, Adobe Air and Java Webstart.
So, this is the exciting battle that is going on right now, and the main contenders so far are Microsoft, Sun, Adobe and Google.
Microsoft launched Silverlight in 2007. My impression is that’s it’s slicker than the Java-based alternatives, better suited for accelerated graphics (there will supposedly be 3D support next year) and with a subset of the cross-language development platform .Net, which is good stuff for developers. However, it’s Windows-only, and in the tight grip of Microsoft’s claw, which history has proved to be directly hostile to competition. There is an open source version of .Net called Mono, and an open source version of Silverlight under development, which is Moonlight. However, this is developed by Novell, which has been cozy with Microsoft more than once. One can only assume that Moonlight is part of Microsoft’s plan, and that plan does not involve other players what so ever. I think Silverlight will be somewhat of a hit in Windows-only circles, but fail when it comes to Mac OS X and Linux users. While one can argue that most users use Internet Explorer, I don’t think any sane developer wishes to exclude a large percentage of the audience, especially the ones that are often either developers or have enough money to spare. It’s not like they don’t have any good alternatives to Silverlight, quite the opposite. Microsoft needs to make Silverlight truly cross platform if it’s not going to turn into another Microsoft Bob.
Adobe Flash has been around since 1996, then called Macromedia Flash. After Microsoft included the Flash player in Internet Explorer 5 in 1999, the plug-in reached an audience of over 100 million users. That is probably the reason why Flash is almost a standard on the web these days. While Flash started out appealing mostly to designers, over time Adobe (which acquired Macromedia in 2005), has gradually made the transition to a worthy virtual machine that appeals to developers as well. A good example of this is the release of Adobe Flex and Air in 2007, which really appeals to developers and is for running Flash-based applications outside of the browser. Flash Player has improved too, with the release for 64-bit Linux in 2008, showing that Adobe wants to play on a strength that Silverlight does not currently have, which is being more cross platform. It seems to be a trend for all of the competitors to support applications running on their virtual machine both within and outside of a browser, and try to appeal to developers. Since Flash Player 9, Adobe also started including support for somewhat accelerated graphics, which suddenly makes 3D in the browser feasible. Take a look at Papervision3D, for example. I think Flash Player has come to stay, both because of the enormous amount of users they have right now and because it’s quite good. It’s not open source, though, but a few alternative implementations are coming along nicely, like Swfdec. (Why they selected that name is beyond me, even though I know that it stands for Shockwave Flash Decoder).
Sun is the oldest player in this game, but also the slowest moving. While Java-applets have been around for a long while, it’s seldom I see a Java-applet that is more impressive design-wise than content-wise. A common sight is watching a gray box where the applet should be, waiting for the applet to load and being rewarded with pixelated fonts and design that looks two decades old. Much due to Flash having a tradition of being appealing to designers, most of the Flash content is a lot better than what I’ve seen in applets. I think Sun realized this, which is why they released JavaFX in 2007. While Sun is a fantastic company when it comes to catering to the needs of developers, I think they have failed completely when it comes to making JavaFX appealing to designers. “JavaFX SDK is Available Now” does not appeal to designers. Period. However, Java Webstart is superb. It makes starting real applications easy for regular users on almost any platform. I think Java Applets will become obsolete, JavaFX will fail, unless they make designers interested and that Java Webstart will succeed over time. One thing that really proves how well Sun connects with developers, is that they released Java as open source. I’m pretty sure Java in general has a future.

Google is the newcomer here. While Java seems to be close to their heart, with Android supporting the Java language and also brilliant projects like GWT, it seems like they prefer to stay away from virtual machines in the browser and stick with AJAX, except for the occational use of Flash. I think Google choosing to use Flash instead of Java applets, while being as Java-friendly as they are, says a lot about how well Flash is doing these days. What is still pretty fresh news, is that Google has released their own client for the browser, called Native Client. While it’s not a virtual machine, it covers the same uses. It compiles code in a special way (a modified version of gcc), tries to ensure that the code is safe, is cross platform and runs in a browser. I would say it targets the same use as Flash and the others, while doing things just a bit differently. The really cool thing about Native Client is that high-performance applications, like 3D-games and video editing software, suddenly is possible to use right in the browser. Also, it’s an impressive leap for cross-platform applications to compile the same application in a way that makes it run natively, not byte-compiled, on both Windows, Mac OS X and Linux. Not that it’s been impossible before, but this seems, to me, like a better way to do it. I think Native Client has a future too.
Some think JavaScript might fill this niche as well, but I’ve yet to see any impressive demonstrations. Quick JavaScript execution is all the rage these days, with V8 in Chrome, TraceMonkey in Firefox and Squirrelfish in Webkit. Also, there’s the new Canvas feature in Firefox, which is promising. Who knows if JavaScript will replace Flash in the far future. I know many people are hoping for this, since it’s an open standard.
To sum up my extremely subjective predictions, I think JavaFX, Silverlight, Moonlight and Adobe Air won’t really take off, while Flash will grow stronger, Java Webstart will pick up speed slowly and Native Client may become a surprise hit. I think JavaScript is a bit early to judge.
Please share your insights, corrections and opinions by leaving a comment.
How to paint directly on UV-textures in Blender (in 15 steps)
by Alexander on Jul.09, 2008, under blender, linux
Here’s one way of doing just that:
-
Learn the basis of the Blender user interface. There’s a nice introduction at blender.org. The introduction uses the term “window” for the 3D-view and other views. I will call them “views” and refer to the content as “panels”.
Quick version of the introduction:
- Right click the borders between views to join and split them
- Middle-click/drag to move the contents of a view around
- Scoll the mouse-wheel to zoom in or out from the contents of a view
- Start out with a 3D-view, the UV/Image view and a buttons view, as shown here:
- Select the cube, press Tab for edit mode and u to unwrap.
Select the bottom choice: Unwrap (smart projections).
(If you have complicated 3D-object you might want to mark seams and unwrap with another method).
Click ok.
- In the UV/Image view, select Image->New and click ok.
Scroll the mousewheel down to zoom out, if needed.
- Press F6 and select texture type Image.
- With the tiny button in front of Load, select the
image you created in step 4 (Untitled) - Press F5 and in Map input click the litte UV-button
(lower right of the screenshot)
- In the 3D-view select Texture paint instead of Edit mode
- Press F9 and select a color in the Paint panel
- Now, just paint directly on the cube! Notice how the image that is the UV-texture also updates when you paint. The cube can be rotated with the middle mousebutton.
- In the UV/Image view, enable painting. Now you can draw directly in the UV/Image-view too.
- It is possible to turn off the grid and axes in the 3D-view with View->View properties.
- If you switch the 3D-view back to edit mode with Tab, you can paint in the UV/Image view while also seeing the lines of
the UV-map. Switch back to Texture Paint with Tab if you want to change the brush or color. - Press F12 to render.
- That’s it!
Now you know how to paint directly on your 3D-models in Blender.
Life is not a road
by Alexander on May.03, 2008, under Mushy, Personal, Uncategorized

Life is not like a road.
On a road, you can go back.
On a road, you’re happy to get to the end of it.
On a road, you can stop for a while.
Specifically, there are no crossroads in life.
The road metaphor is silly, and it makes people unhappy.
Life is more like a pink rubber jumpingball.
Sometimes you might fall off, but if you’re not hurt,
it’s easy to get back on.
It’s often fun, but requires a good deal of energy.
It goes up and down and you don’t really get anywhere.
Judging programming languages by the results
by Alexander on Jan.11, 2008, under Reviews, Tech, linux, programming

There is much to be said about programming languages. If I mention any language, someone will always have something bad to say. The syntax might be ugly, a feature may be missing or the executables might run too slow. Even if you benchmark languages, you can adjust what’s important to you to make almost any language win the benchmark. The really troubling thing is that even if you found your perfect language, that was theoretically brilliant, you still might not be able to become productive with it. Even if it had all the features and the nicest syntax in the world, it still might not be efficient for developing a real-world program.
About six years ago, I started programming with Python. It’s wonderful in so many ways. And if you create a real executable that is optimized to native code with Psyco, you can’t just dismiss it just for being a scripting language either, like some people do, since it won’t matter for all practical situations. However, any Python-program above a certain size get to feel the downside of the dynamic nature of the language. Parts of a Python-program can be totally wrong, but go unnoticed if it’s in a rarely used part of the program. In small programs, this isn’t a problem, since most of the code is tested every time it’s run. But for larger projects, the code hidden in exotic branches quickly can get out of hand. To compensate for this, all companies I know of uses testing-frameworks to test as much of the program as possible with small specially made tests. I’ve worked for a company like this, where the flagship-program was written in Python and we used as much time writing tests as writing the actual program. This doesn’t make Python bad, I still love it, I’m just saying that for programs over a certain size, a lot of testing is required. This problem is also in place for Ruby and all other dynamic languages.
So, after my encounter with Python (and several other languages), I tried searching for a solid language. A language that would give me the feeling of robustness and completeness – a language that would compile executables I could really trust. I learned Scheme at the university, Haskell in my spare time, went through an Erlang tutorial and took a second look at Lisp. Scheme and Lisp are just so much writing. Erlang looks great, but Haskell is the language that really convinced me. Haskell has a strong background from academia, which really shows if you visit #haskell at irc.freenode.net – it’s filled with phd’s and whatnot. So, off I went to learn Haskell. I read tutorials, bought a book, asked questions at IRC and wrote small programs. And indeed – Haskell feels incredibly solid. When you’ve written a program, then you really know that you can trust it. It may take a few attempts to make it compile in the first place, but the result is pure rocket science.
Python and Haskell are opposites, in many ways. Python is a dynamic and object oriented scripting language, while Haskell is static, functional and easy to compile to native executables. Python is like a young dolphin while Haskell is like a big white rhino.
Then I discovered Pixel, a program like Photoshop, written by a single Slovakian guy named Pavel Kanzelsberger, which rivals Paintshop and The Gimp. And unlike Photoshop, it runs on Linux and many exotic platforms like BeOS, QNX and SkyOS. I wonder if it runs on Haiku, please let me know if you find out! I downloaded the demo a few hours ago, and it looks great. The interface is smooth and responsive, and it’s at least as comfortable to work with as Photoshop, Krita, The Gimp, Paintshop and the like. Since it’s uncommon that a program runs on so many platforms – especially programs made by a single guy – I did some research and found out that it was made in Pascal. Pascal! The language of my childhood, right after I learned QBASIC.
While I was first surprised by this, another great program written in Pascal came to mind: Fast Tracker II. It’s a brilliant program for making music with samples, still to see its equal on Linux. Soundtracker is functional, but ugly and Cheesetracker is an Impulsetracker clone. Milkytracker looks great, though, but I wish it was open source. Why select the lukewarm “freeware” instead of trying to earn money like “Pixel” or going the full way with open source? I bet FT2 would be open source if it was written today.
Anyway, to get back on track. My point is that some of the applications I’ve seen written in Pascal are absolutely brilliant! Even though there are good programs written in other languages too, of course, there is something special about FT2 and Pixel that just seems to be harder to achieve with other languages. This might just be my very subjective feeling, but it is my heartfelt impression so far. Besides, the free pascal compiler is really good! It’s mature, compiles quickly, is more cross platform than the average program written in C (not many C-programs are as cross platform as Pixel). It’s object oriented, has templates and is a modern, up-to-date language, unlike the old dialects of Pascal. And Lazarus, an IDE that looks a bit like Delphi, is a lot more responsive then say Eclipse, while having many of the same features. The screenshots of Lazarus looks a bit dated since they compiled Lazarus with the old Gtk. Gtk2 with nice fonts is now possible. FPGUI looks promising too.
Judging by the actual results, in form of applications, Pascal might be the thing! For sure, I’ll give the Free Pascal Compiler a shot next time I’ll write a full fledged GUI-program. What would you choose for your next project?
Android – it works
by Alexander on Nov.13, 2007, under Reviews, Tech, linux

I downloaded the Android SDK from Google and also the latest version of Eclipse. The documentation for Android is better than expected, with an API that gives a good overview, a tutorial that works flawlessly and even a short video presentation.
Eclipse Europa (3.3) starts up real slow compared to my other desktop programs, but it is stable and has an abundance of features. My experience with Java-programs for the desktop (not for the server) is that they always use a lot more time to start up compared to other desktop programs.
I needed to change the PATH in my environment to set up the SDK, but this is well documented and was easy to do. The example worked straight away, and the emulated Android (mobile OS) was fun to try out and looked polished.
Compared to my ordinary Desktop experience, Android is cumbersome to use (the screen is small and you use the arrow-keys a lot), but it’s on par with Opera Mini 4 which I have on my cellphone.
Due to the openness of Android, the cleverness of the Google employees and the simple design that we are starting to take for granted, I have no doubt that Android will become widespread real quick. Compared to what I’ve seen of the interface for iPhone, Android is not as smooth yet. But, Android has several huge advantages:
- It’s easy to get started to develop for Android
- Developers like the Android SDK, since it is incredibly well thought out and open
- The standard GUI on Android can and will be improved by the hordes of developers out there
- Everything is ready for innovation to happen on the Android platform, expect at least one killerapp
- The GUI and the applications are likely to improve at a rapid rate
- Google is offering a cache price for developers
- Many mobile phone companies can unite instead of developing crappy systems on their own
If the API is as well thought out as it looks, the libraries as stable as they should and Google as open and non-evil as it can be, this is bound to be a winner.
My first .deb
by Alexander on Nov.06, 2007, under Tech, linux

After finding out how to use my mobile phone for controlling the cursor on my PC, I decided to make it easy for others by making my first Ubuntu package.
Here’s how you do it if you’re using Ubuntu Gutsy and your cellphone supports it:
- Install Remote v.0.1 by clicking the link, selecting “GDebi” and clicking “Install”.
- Turn on bluetooth on your phone
- Press alt+f2 and type in
remote - Select your phone from the list
- If needed, the cellphone and PC will ask for a pin-code. Make one up or type in 1234
- Answer “yes” when the cellphone asks if you want to control your PC
- Use the arrows to control the mouse-cursor
Enjoy the smooth and relaxing experience of mobile browsing – the other way around!
A solution for your calendar
by Alexander on Nov.03, 2007, under Reviews, Web, linux
I’ve tried various ways of keeping track of my own calendar: a plain little notebook, several palm pilots, the hipster pda and a Moleskine. Most of them worked perfectly fine, for a period of time.
However, what I really want is to synchronize a web calendar, a calendar desktop program, my palm pilot (over bluetooth) and my cellphone (over bluetooth), all in glorious open source under *nux. Yesterday I researched this possibility, but we just aren’t there yet. Opensync is in the making, but it’s cumbersome to use, and even after browsing the web for hours after a way to do it, I was unable to synchronize either my palm or my phone. Bluetooth works perfectly fine, the mechanisms are in place in both gadgets, it’s the software for synchronization and communication with specific devices that just isn’t there yet. (For the record, I’m good friends with regular serial/usb palm synchronization and the commandline-tools for bluetooth in general).
So anyways; I gave up on synchronization-nirvana and decided to settle for a calendar on the web that would synchronize with my desktop. Sunbird is the new cool program on the block here, so I decided to give it a try. First I tried the 0.5 version that is in the repositories for my distro, but then I found out that the extension that synchronizes with Google Calendar needs version 0.7. (Google Calendar is a very usable calendar, just make sure that your calendar is not public). After installing Sunbird 0.7 manually, including the “Provider for Google Calendar” extension, I’m a happy chap. The synchronization works perfectly fine in both directions, I can work comfortably with the calendar at home and on any computer with a browser. Great.
Click the little article-image (created with the brilliant Liquid Rescale plugin) to see a large version of the screenshot.
Gate 88
by Alexander on Sep.27, 2007, under Reviews, linux
About a weak ago, I discovered a great little game, Gate 88. You control this little ship and can speed around in what seems like infinite space. However, you can also build stuff, research, shoot stuff and bump into things. Gate88 is like a colorful combination of the action of Asteroids, the strategy of Starcraft and the flow of …Flow.
The amazingly fitting old-school music, smooth animated vector graphics and hypnotizing scrolling backgrounds makes the game quite enjoyable. The gameplay is refreshing and unlike anything I’ve ever played before. I’ve only tried the single-player mode yet, but I’ve heard that the multiplayer-mode is supposed to be even better. I recommend giving it a try, it even has a built in IRC-client.
I’ve recently read an article advocating links describing actions like “click here”, so it’s not old-fashioned to do so anymore:
Click here for the webpage of Gate 88
Haxe is wonderful
by Alexander on Jan.04, 2007, under Tech, Web
![]()
Using the open source combination of neko (a virtual machine) and haxe (a language + swf-compiler), you can create wonderful things! I wouldn’t be surprised if haxe shows up in the Debian repositories any day now. Here’s a little test I made. Paint with fire!
Four programs and a shortcut
by Alexander on Nov.03, 2006, under Personal, Tech, Web, linux
- Freemind – mindmapping
- Vimoutliner – text outliner
- Thinkingrock – self management
- Vym – mindmapping
Firefox 2.0: press [ctrl]+[shift]+[t] to undo closing a tab











