Mobile Dev Camp 2010 in Helsinki

March 1st, 2010

I have attended Mobile Dev Camp. It was an event that included presentations from all major mobile vendors as well as workshops. To me it looks like it was targeted to younger developers as the level of the presentations was introductory. The funny thing was that organizers announced a development contest 48 hours before the conference. The topic of this application contest was outdoors. I did not participate because I thought I could not create a usable application within such short time. But in one category the winner has created an application while he was sitting in the conference. This means that there was almost no competition but the prizes were quite good. In each vendor category a new phone was offered as the prize. For example in the Apple category an iPad was awarded.

The conference started with a Nokia presentation in which Qt framework was described. This is a cross-platform development framework. A number of new features was described including Smart installer for Symbian that allows to add dependencies from your applications similar to debian packaging. Also changes were promised to Ovi Store which is now open for contribution only if you are a company. Obviously, it will become possible for individual developers to upload their apps to Ovi Store soon. It was recommended that developers take a close look at WebKit because it makes porting applications easy. However, later during the day the participants of a panel described the difficulties involved in porting WebKit applications because of lack of standards. But WebKit makes it possible to use native APIs from your web pages. For example if you want to find a pizza restaurant near YOU then you need to ask your device what is your current location and then use Ovi Maps API with those coordinates to display a map in the browser.

Another interesting presentation was that of Jürgen Scheible, the author of Mobile Python book. He described a number of tools such as Pluthon – python using Eclipse. It turns out that Python is available on touch devices nowadays. Jurgen mentioned that during his 3-5 day workshops people learn to program games involving touch gestures and animation. That’s a great achievement as teaching people to program is a challenging task.

There was a presentation dedicated to Microsoft Phone 7 system. As always, Microsoft has impressed the attendees of the conference with a game console available in its workshop room. I remember that when I attended another conference dedicated to Microsoft Mobile OS there was a whole Formula-1 simulator in that building! The new mobile OS looks quite impressive. They are saying that their goal is to add a 3rd dimension to the 2D screen of a mobile phone. That 3rd dimension comes from animations and effects, and therefore the new Microsoft Phone OS has lots of those.

In the Ericsson presentation the importance of a web browser was stressed. In particular, this company is developing web background service which allows the browser to perform tasks while in the background. They have also implemented a notification system as part of the browser. I guess they are moving in the direction of implementing a whole browser-based OS.

To summarize, the attendees of Mobile Dev Camp had an opportunity to meet with representatives of all major mobile vendors and listen to their ideas on the future of mobile technology. It is surprising that each company has its own view on this subject, thus we can expect lots of competition and interesting ideas implemented in the next generation of mobile devices.

2800 kilometers in 24 hours

February 24th, 2010

I have completed a long trip. But not using skates or skies or just bare feet. I went on a short trip to Russia for a number of personal reasons.

It is funny that a plane ticket costs less than train ticket nowadays. So I left Saturday morning on a Finnair flight to Moscow. I arrived at 1PM and went to pick up a car that I booked at Sixt. I was driving an almost new Ford Focus and I liked it a lot. The weather in Moscow was quite nice, around -10 centigrade and clear. But I had to spend lots of time in a traffic jam near Moscow. In total, it takes 12 hours to get from Helsinki to my home town Dzerzhinsk out of which I have to spend 4 hours or 1/3 of the time in a traffic jam.

In total, it takes 12 hours to get from Helsinki to my home town out of which I have to spend 1/3 of the time in a traffic jam.

I was surprised to find out that the highway is in a good shape and quite clean. But the surrounding areas look a bit deserted. Obviously, the financial downturn had a negative impact on Russian economy. It just occurred to me that in Russia there is no network of restaurants located along a road. There are smaller cafes here and there but they do not belong to a single owner. For example, in Europe there are lots of McDonalds along major highways, they are easy to spot because of their masts up in the sky.

I arrived to my home at around 8PM. On Sunday we were visiting various relatives and supermarkets where I got a few history books:

Photobucket

Photobucket

Photobucket

Then on Monday at 3AM I drove back to Sheremetyevo airport. It was a chilly morning with temperatures around -20 centigrade. There were a few police patrols near Moscow but I was lucky to not get caught because I had plenty of time and thus was driving slowly. Another funny thing was that when I got to the final stretch of my journey a snowstorm began. It would increase my travel time dramatically if I got into a snowstorm at least half an hour earlier. After I dropped off the car I realized that flights will get delayed because of the snowstorm. It was partially true because the boarding delay was only half an hour and then we spent another hour on a tarmac.

I arrived back to Helsinki at 2PM and went straight to office. Then I did a bit of coding and went home later than usual. However, on Tuesday I left office as usual only to fall asleep at 6PM. I slept a whopping 12 hours and woke up 6AM Wednesday and finally unpacked my luggage.

Weekends in the winter: swimming, ice skating, movies, and reading

February 14th, 2010

I would like to describe what I am doing on weekends in Helsinki. Life in a city is certainly different from the life in a smaller town or a countryside. One of the challenges of this life is to do outdoors activities or at least some kind of sports to stay in shape.

This is why I start my weekend from attending a swimming pool, or in fact a Roman bath at Yrjonkatu. The definition of start of the day is quite relative because I am going there typically at 2PM. Earlier during the morning I am reading magazines mostly Communications of ACM or listening to radio. Not so long ago I have discovered Radio Freedom which features prominent journalists such as Vladimir Kara-Murza as well as lots of independent analysts. They often express interesting opinions. One thing that I have noticed is their use of references to literature or books that they have read recently. They are trying to apply the lessons learned from those books to modern life. This definitely characterizes this radio as that of intellectuals.

Anyway, in the swimming pool I am practicing fsreestyle wimming. I am swimming 500-1,000 meters depending on further plans. As of now, I can swim arbitrary long distances but not very fast, pretty much as fast as I could do it in breast stroke. However, the idea of swimming freestyle is to swim faster. But my body is experiencing tough resistance of water I am basically making my way through it. Instead I guess I need to flow through it, integrate with the water. But that takes lots of practice. Anyway, I have bought a 10-time ticket that allows me to get to any swimming pool in Helsinki for 36 Euros.

Then after the swimming pool I spend a few hours reading. For example, last weekend I was reading Economist magazine which I like quite a lot. I have bought another issue because of the funny cover image. There was a special report on social networks. Its main points are:

  • MySpace was most visited social network until last year Facebook attracted more visitors. This is because MySpace was focusing on music and movies, whereas Facebook built a platform for content sharing. As broadband Internet spread through the world people got more interested in their own content.
  • Twitter is very different from other social networks because it is like a broadcasting framework, not content sharing. The latter always assumes a certain degree of privacy, for example only your friends can see your pictures. In Twitter everybody can subscribe to your tweets.
  • So far social networks have been barely profitable because advertisers don’t think that people will click on ads placed on social networks. This is because people are concentrated on their or their friends’ content, not on ads. But the special report argues that people trust their friends’ recommendations most, thus an ad saying that your friend has bought product X will likely influence your decision.
  • Many smaller enterprises are using Twitter to advertise themselves. For example one bakery was tweeting upcoming donut sales and soon got over 50,000 followers. Another example is using Facebook as a game distribution platform. A classical Cafe World game has attracted over 10 million players in just a week. This is because of Facebook’s status updates. When your friend says that (s)he has become a Pizza Tycoon you think you should also become one. The network effect takes over. Gaming industry has never seen such growth rates before.
  • People are increasingly using mobile devices to access social networks. Most of these devices are GPS-enabled. This opens another avenue for advertisers: location-aware ads.

On Sunday I am going to a lake to skate. I am preparing for a ice-skating marathon which will take place in the end of February in Kuopio. It is a funny thing which I will definitely describe in another post if I take part in it. The idea is that you have to skate as much as 200 km! But of course there are smaller distances such as 100km, 50km, 25km, and 12km. I will try to skate 25km. Because I am using traditional skates, not speed-skating type of gear my speed is not that great. A speed skater can maintain a 30km/h speed during the whole 200km race. Last weekend I skated 15km on a lake at Munkkiniemi and my speed was less than 10km/h.

Last but not least, I got used to going to movies. There is a gorgeous movie theater near my home in Tennispalatsi. I have bought a group ticket that gives access to 5 movies, each priced at 8.5 Euros. This is quite a big discount, as a single 3D movie is priced at 13 Euros. So far I have watched Avatar 3D, Up in the Air, and Sherlock Holmes. All are gorgeous movies.

Optimizing web pages

February 7th, 2010

While working on Timeline Builder I noticed that loading a timeline takes a while. This is because Timeline is implemented as lots and lots of Javascript and even though it is minified and all files are concatenated into one the result is still quite big.

Compressing your scripts is a low-hanging fruit in optimizing the size of your web pages. But popular hosting providers don’t implement this feature by default, quite surprisingly.

One low-hanging fruit is to use compression when delivering the files from your web site. Quite surprisingly, this feature is not available by default if you host your web site on popular hosting service such as GoDaddy. But searching on the Internet allows one find out how to do it. OpensourceTutor is a blog with lots of interesting content.

This post describes how to use Apache for our purposes. Basically, it depends on the version of Apache. For 2.x version you have to implement the following .htaccess:


<ifmodule mod_deflate.c>
SetOutputFilter DEFLATE
</ifmodule>

This approach works with hosting provider Logol where I have one of my test sites. However, GoDaddy uses a different version of Apache and another approach is needed. I have tried replacing mod_deflate with mod_gzip but this did not work out.

The approach suggested at OpensourceTutor is to use the Apache rewrite engine. When an HTTP request arrives Apache will check whether a file with the same name but with a postfix .gz exists and if yes then it will serve the compressed file. Therefore, the web developer needs to upload the compressed version of each file that he wants to optimize. The .htaccess code looks as follows:


RewriteEngine on
RewriteCond %{REQUEST_FILENAME}.gz -f
RewriteRule ^(.+) $1.gz [QSA,L]

There is a third approach explained here in detail. It works for pages written in PHP. The basic idea is to prepend <? ob_start("ob_gzhandler"); ?> to your pages and that will turn on compression.

These are only few ideas on how to improve your web pages. There are automatic tools that analyze your web pages and make suggestions, most notably YSlow from Yahoo and Page Speed from Google. After reading their reports I learned that there are lots of ways in which I can improve my web site, including

  • Adding expires headers
  • Using entity tags
  • Minifying CSS and Javascript

These ideas mean that I need to maintain two versions of my web site – one which is publicly visible and optimized with compressed and minified scripts and another with uncompressed content which is convenient for development. Then I will need a script that converts the development version into production version. Even though such development configuration seems natural I have not found any tools that facilitate its implementation on popular hosting sites.

Page Speed can generate nice graphs as the one shown above. Each track represents one HTTP request. After I added compression the length of the tracks has been reduced, therefore the results of your efforts are easily measurable.

These two extensions demonstrate the flexibility of Firefox. I have noticed that people achieve glory these days not through a large software development effort such as an operating system or a word processor but through a little application such as a plugin. Typically, plugin runs on a bigger platform along with thousands of other plugins. I have read in Economist that last fall a pizza-tycoon kind of game running on Facebook has attracted several million gamers in a couple of month – an unimaginable rate for the gaming industry alone. But social network makes it possible.

Anyway, there are plugins that are so successful that people build their plugins on top of them. PageSpeed and YSlow are examples of this type of plugin because they are built on top of another Firefox plugin Firebug. Another example of plugin used to develop other plugins is Greasemonkey.

Reading interesting magazines

January 30th, 2010

I have been reading mostly Communications of ACM recently. However, I also like Wired magazine and Technology Review but it so happens that if I don’t have a print edition in front of me then I am not going to read it.

In the local supermarket there is a wide selection of magazines. While waiting for the cashier to process your stuff one can choose something interesting. Even though I never intended to read those magazines but this is exactly how I bought TIME magazine and Economist. Btw., there is Newsweek available as well but I thought it was basically the same as the other two magazines.

Because I bought both magazines near New Year they were summarizing the year 2009 and of course their main concern was the global financial crisis. However, the magazines dealt with the issue in two different ways.

Time magazine has traditionally selected the Person of the Year which is Ben Bernanke. Then the magazine explained how US Federal Reserve works and interviewed Ben Bernanke. To do this Time magazine gathered its best writers and editors. Quite traditionally, the magazine attributes each article to a particular author or a number of them.

I bought The Economist magazine because earlier I learned that it is one of the favorite publications of George W. Bush. The articles in this magazine have no authors. The articles themselves are quite short which is more typical for a newspaper. However, their difference is that they do not deal with just one event but rather describe a trend or a development of a news story over the period that the magazine spans or even longer. The coverage of the topics is also quite wide – from Europe to the US to China but surprisingly no mentioning of Russia whatsoever. The Economist explained that the excess of cash that the Fed generated makes another bubble possible. But there are no immediate signs yet.

Thus, both magazines are examples of analytical reading but Time is more into people and organizations, the big players which define what is going on in the world. The Economist describes how people live in various parts of the world thus it is more like a long tail magazine. It is an open question who defines the world history, either the few top guys or ordinary people.

Adding features to SIMILE Timeline

January 24th, 2010

I have become interested in adding features to the original implementation of SIMILE Timeline. I have a feeling that it has great potential but despite the years it is been available it did not become widely accepted. In fact, it appeared on a number of cool websites including those of educational institutions, government, etc. However, these are more like showcases of a cool technology whereas I think timeline is something that everybody could use on a daily basis. Given the amount of adoption of social networks one could try to put a timeline there to display your friends activity. In fact, Timeline is available as a plugin for Wordpress and I should say it is a very cool thing with lots of bells and whistles but for example there is no such thing as Timeline Google gadget.

One reason of the lack of adoption is the difficulty of sharing. The original implementation of Timeline provides a JavaScript API. In order to use Timeline on your website you have to write approximately 100 lines of JavaScript code which is an unacceptable barrier in many cases. Even if this code is generated automatically and you offer it as copy-and-paste to a user, the code snippet which is 100 lines long is just too much. What is needed is a short solution in a form <script>bla-bla-bla</script> and this is one of the features that I have added.

But there is another, more difficult problem. If you want to visualize RSS feeds that do not belong to your website then you’d run into Ajax same domain policy issue. In fact, I have been running into this problem earlier but then the solution was to implement a PHP proxy that would read the desired RSS feed from another web site and forward it to you. This approach worked fine as long as Timeline stayed exclusively on my site but now we need to share it. Therefore, if a user puts Javascript code on his/her website and this code tries to access an RSS feed through Ajax then it would also need to use a PHP proxy. But PHP is a server-side technology. It is not possible to upload a PHP file to a social network or your iGoogle home page. Therefore, another solution is needed.

I have searched Internet and found a few interesting approaches to the same domain policy problem. One of them is to use AJAX through Flash because apparently Flash is less restrictive. But I was unable to get this approach to work, obviously due to security issues. It looks like the destination site of your AJAX request needs some sort of modifications whereas in my case the location of RSS feed that I want to fetch is totally arbitrary.

In the script tag you do not have to specify actual .js source. You can use any source, for example a PHP script! Just make sure that it outputs Javascript. In other words, if it looks like a duck, quacks like a duck, then it is a duck!

This problem looks totally intractable. But the power of Javascript always amazed me. This time <script> tag came to rescue. Typically, when you specify the URL of the script it is ending with .js, for example <script src="myscript.js"></script> but the funny thing is that you don’t have to! In the src attribute you can specify anything, for example a PHP script that outputs Javascript like this

<script src="myscript.php"></script>

Just make sure that your PHP script outputs Javascript code. The rest is fairly simple: think of the PHP proxy that reads an arbitrary RSS feed and wraps it into Javascript. The PHP script should output a Javascript variable assignment with the RSS feed at the right-hand side of the assignment expression. Then we can use another extremely useful feature of Javascript which is its built-in XML parser:


var xmlDoc=document.implementation.createDocument("","",null);
xmlDoc.load(myrss);

The details of this approach are descried in this OReilly article.

With this technique taken into use it is possible to share a Timeline with arbitrary RSS feeds! The next step is to build a number of plugins, widgets, and gadgets for all kinds of social web sites! Such a bright prospective for the Timeline!

Donate to Haiti recovery effort

January 17th, 2010

On January 12, a magnitude 7.0 earthquake struck Haiti just outside the capital city of Port-au-Prince. The devastation – in lives lost, property destroyed, and families displaced – is immense.

Our immediate priority is to save lives. The critical needs in Haiti are great, but they are also simple: food, water, shelter, and first-aid supplies. The best way concerned citizens can help is to donate funds that will go directly to supplying these material needs. The Clinton Bush Haiti Fund will work to provide immediate relief and long-term support to earthquake survivors.

DONATE NOW!

Reading a few Communications of ACM articles

January 8th, 2010

During the holidays I have read a number of ACM articles from the issues I received earlier as well as from December 2009 issues that I received a few days ago. The most interesting articles are:

Ready for Web OS? Mentions Sam King, tablet crunch pad.
A Smart Cyberinfrastructure for Research. Microformats, data portability, codeplex, mit breadcrumbs, zune social, livelabs entity extraction.
An Interview with Ping Fu
You Don’t Know a Jack about Software Maintenance
Scratch: Programming for All
Sound Index: Charts For the People, By the People
What Intellectual Property Law Should Learn from Software
The Status of the P versus NP Problem
Just for You. Greg Linden ran personalized news site Findory
The Pathologies of Big Data
CTO Roundtable: Cloud Computing. Animoto on Facebook
Hard-Disk Drives: The Good, the Bad, and the Ugly
Database and Information Retrieval Methods for Knowledge Discovery. MSR Libra, Cimple DBLife, KnowItAll/TextRunner, YAGO WordNet NAGA

Driving in Helsinki in the winter

January 7th, 2010

Cities are notorious for their limited number of parking places. But during the winter things get even more complicated. The main problem is not finding a place to park your car but actually getting out of the parking. Here is a video that illustrates these words. In fact, this is not the toughest case that I saw out of my window. A couple of days ago a few guys spent half an hour trying to free up their entrenched friend.

New Year 2010 Fireworks

January 3rd, 2010

I have celebrated New Year 2010 in Helsinki just as last year. But this time I was able to record a better video of the fireworks. Here it is.