One month update

November 27, 2011
We have settled down quite well in Finland. Our rented flat in Myyrmäki is still a bit of a mess as we are about to paint walls and some furniture. Weather has been disappointing as there hasn't been any snow yet.

FinJUG - Finnish Java User Group has started nicely and we had our first meetup in Helsinki. Planning of the technical meetup is underway and the event will take place in January. The tiny problem is that there are plenty of Java devs in Finland but they aren't all in Helsinki. So we might set up regional meetups.

Major update

November 02, 2011
Since last update I have changed job and country. We decided to move to Finland and we relocated last Saturday. I am now working as a software consultant for Valuemotive.

So it has been quite busy but I am trying to find time to start Java User Group Finland as well.

Learning WebGL

April 24, 2011
WebGL is basically a way to display hardware accelerated 3d content on a browser. It is not yet mainstream so it is perfect time play around and experiment with it. At the moment only FF4 and Chrome support it, WebKit nightly build should have support as well.

WebGL uses OpenGL ES 2.0 which is a cut down version of OpenGL. Deprecated parts of the API have been cut off but there are some goodies like shader programmin language GLSL. It is more complicated than plain HTML5 Canvas to get started with but there are good examples and tutorials.

My starting point was to implement my audio waveform visualizer in WebGL. It uses SoundManager 2 to read the waveform data and the data is then drawn on the screen as a line. The first version simply drew a the waveform on the screen without any special tricks.

For the second version I wanted to try out writing my own shader code. The waveform is not rendered directly on the screen but it is drawn in a separate frame buffer. This buffer is then used to generate a texture on a quad. At the rendering time of this quad my shader code kicks in and does blurring post processing on the fragment level.

I am just getting started with WebGL and I have plenty of ideas...

Outer Hebrides Challenge

April 07, 2011
We are planning to do a little bit longer (around 200 miles) cycle trip this summer. It will cover Outer Hebrides and there is also a charity fundraising aspect. Read more about it in its own blog:

http://hebrides-challenge.blogspot.com/

www.momentumracer.com

December 03, 2010
I decided that it is high time to get own domain for this project. Far from complete but people have shown some interest so I think the dedicated domain is a good idea. Twitter mentions and Facebook likes will be then directing to the right page.

The URL is www.momentumracer.com. Have a look at the new splash screen :-)

Hobby game programming with JavaScript and Canvas

November 15, 2010
I just added some more functionalities for Momentum Racer. Now it handles different game states and can support numerous levels. The nice thing with programming with JavaScript is that the turnaround time is very short from an idea to the change in the game. Because I have other things to do as well I find it very appealing that I can achieve something in a half an hour.

My development setup is very simple. I use TextWrangler for the JavaScript code editing, Chrome for testing and local Git repository for the version control. Most likely I will replace TextWrangler at some point with some IDE, I got too used to Eclipse with my Java coding.

The todo list is pretty long but I think I should be able to finish most before end of 2010. Tweaking the gameplay and graphical FX can take forever. I'd rather get them just good enough and add some social media features like Facebook connectivity. That's what every online entertainment app seems to require, right?

HTML5 experiments

November 05, 2010
I have been playing around with Canvas and JavaScript. The side product is my new hobby project - a game called Momentum Racer. Go ahead and have a spin!

Apache Redirect Permanent and ProxyPass

July 02, 2010
You have a Apache running and you have a permanent redirect configured. For example;
Redirect permanent /subfolder/ /
This would redirect www.yoursite.com/subfolder to www.yoursite.com.

Then later on you to add proxy config:

ProxyPass / http://localhost:8080/site/
ProxyPassReverse / http://localhost:8080/site/
ProxyPassReverseCookiePath /site /


But after that your redirect fails. It turns out that ProxyPass config overrules Redirect. Add exclusion to the ProxyPass to fix this:


ProxyPass /subfolder !
ProxyPass / http://localhost:8080/site/
ProxyPassReverse / http://localhost:8080/site/
ProxyPassReverseCookiePath /site /


Note that the exclusion is before others.

Frame rate tool for OS X - ReelSnail

June 28, 2010
I have been experimenting with both DSRL video and Objective C. The result is a simple tool to modify the frame rate metadata in Quicktime h.264 files. This kind of tool is handy when I need to import 60fps file to 30fps or 25fps iMovie project. This results nice slow motion effect otherwise hard to achieve in iMovie.

The project is based on Python script that did the same in command line. But I wanted to add a OS X native front end and I also wanted learn Objective C so I decided to rewrite the whole thing in Objective C. I managed to get most of it working in a weekend. I had one old Cocoa book (Hillegass - Cococa Programming for Mac OS X) and Apple's online guides. XCode and Objective C were pretty different compared to Eclipse and Java but I managed to get my head around some of the concepts.

Another new experiment for me was to use Git for the project. I used GPLv3 for the project because the original Python version used that. Being open source project it was possible to set the repository to GitHub for free. Having gone through some nasty merges in SVN I wanted to try out distributed approach. In a one man project there is not too much to merge but I was curious to try out Git tooling. I ended up using both command line tools and GitX.

ReelSnail project wiki
ReelSnail downloads

Moved back to Edinburgh

May 07, 2010
We left Kirkcaldy a month or so ago and moved back to Edinburgh. The new flat is in Leith so the area is somewhat familiar. Quite many things changed though.

This new flat is reasonably new, it has some modern comforts like dishwasher and double glazing. Hmm... I must have spent long enough in UK because I am mentioning double glazing as an extra. Anyways, nice and modern flat with some sea view. I think I should write down an article about flat hunting and related matters. At least I have experience from three different occasions.

Otherwise life is pretty much same here, I am still working in the same company developing open source Java CMS. It will be published soon but the exact date is still unclear at least for me.

Hacking Canon IXUS 60

March 27, 2010
I got some nice features like time lapse shooting and it wasn't even difficult with CHDK. Full story at Apertoire blog.

Experimenting with analog technology

March 14, 2010
I wrote some thoughts down after photographing couple days with Asahi Pentax Spotmatic F. That is a film SLR camera from the 70s. Read it from my photography blog.

Media convergence, publishers and Apple iPad

January 27, 2010
Today I checked what is the Apple's new iPad all about. A very nice looking tablet as expected but I was more curious how the content available for iPad will look like. This device comes with browser so normal web content is available as usually. Books, tunes and videos are sold via Apple's own stores. But the announcement featured 'The New York Times' app and that shows where the progress is taking us.

Traditional web or mobile optimised version of the print publications wont cut anymore. Some publishers have announced their own iPhone application but many of them are simple page flipping applications. Not much difference to PDF reader. Seamlessly embedded videos and photo galleries are not that common as one would expect. Especially when new devices like iPad support much larger screen and computing power than previously so they should be able to handle them easily.

At the moment many of those magazine or newspaper reader applications are free with their content but paid content will definitely become more popular. Instead of subscribing or buying physical printed magazine you would receive an access to the extra content - all edited and formatted in a single package. Simple 'subscribers only' area with content snippets lying around might have been the way to do previously but now users are expecting much more elegant presentation. I see iPad and similar devices as premium content platforms and their users are already used to pay for applications, videos and music.

There are two sides of the iPad publishing - a CMS and a reader. Recent development on digital photography has enabled photo reporters to shoot both stills and video - actually they expected to do so now. Presenting this variety of media formats is not straightforward. Publishers had to find way to add all this content in to their sites and I can imagine how their CMSs are being pushed against the limits. Publishers need to have highly flexible content management system that handles vast amount of different media formats and is able to transform them to another (i.e. downscaling videos). The same content needs to be available for normal web, lightweight mobile devices, smart phones and now also for tablet. The extra effort and cost required for each platform version should be minimal.

The content reader can be either the standard web browser or a custom reader application. Publishing content for specific application allows much more freedom for layout and media formats. is an example of how a digital magazine would look like in the future. Developing such reader application is not trivial task but I assume iPad SDK has some new features supporting this. Unfortunately the documentation is available only for members of the iPhone Developer Program.

As Apple did not announce their own de facto reader for rich content there is now an open space for iPad developers to conquer. The solution offering the intuitive user interface on iPad, excellent performance and seamless integration with content management systems will be a winner.

Some file organizing with Python

December 09, 2009
It has been a while since my last Python session but couple days ago I had a perfect opportunity for some Python scripting. The initial situation was that we had tons of files in a single directory. File names were UUIDs so the idea was to create subdirectories and move each file in right directory. We planned to have three levels of directories based on the first characters of the filename. So something starting with 4c14 would go under 4/c/1/.

I implemented this in two parts. The first part created the required directory structure:

import os

workPath = "/tmp/test/"
for a in range (0, 16):
   os.mkdir(workPath+hex(a)[2:])
   for b in range (0, 16):
      os.mkdir(workPath+"/"+hex(a)[2:]+"/"+hex(b)[2:])
      for c in range (0, 16):
         os.mkdir(workPath+"/"+hex(a)[2:]+"/"+hex(b)[2:]+"/"+hex(c)[2:])


The next part was to move files to the corresponding directories. This was also quite straightforward but I had problem with os.rename and I had to replace it with shutil.move. The original script worked fine on my home computer but the development server had the source and destination directories in different filesystems. Here is the final version:

import os
import shutil

sourceDir = "/tmp/files/"
destDir = "/tmp/test/"

filenames = os.listdir(sourceDir)
for filename in filenames:
   sourceFile = sourceDir+filename
   print(sourceFile)
   destFile = destDir+filename[0]+"/"+filename[1]+"/"+filename[2]+"/"+filename
   print(destFile)
   shutil.move(sourceFile, destFile)

These did not take too long to make and most likely someone who remembers Python libraries better would have done it in a fraction of time.

What I have been busy with lately...

November 20, 2009
We made a nice and busy trip to Belgium. We spent most of the time in Brussels but we also visited Antwerpen and Bruges. Tasty beer, rude museum staff, sore feet and tons of photos to sort. Plenty of things to see and especially Antwerpen railway station was pretty impressive.

At work I am busy the soon to be released open source CMS. The content management UI is built on Ext GWT aka GXT so it looks pretty nice and it was quite pleasant to develop. The server side is usual EJB3, JPA/Hibernate etc... there is some REST API, website templates can written in Velocity and there is even possibility to add extra functionality with server side JavaScript. So bunch of cool technologies and it has been great learning experience.

Meanwhile we have been enjoying Scottish autumn weather and I have been trying out Android SDK. Tomorrow I will visit Scottish Open Source Awards - this time just as a spectator.