Archive for January, 2010

Reading interesting magazines

Saturday, 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

Sunday, 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

Sunday, 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

Friday, 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

Thursday, 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

Sunday, 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.