Motorcycle Adventures and Free Software

Weblog: Archive

2008-03-01 - 2008-03-31

On Finnish Internet censorship

Posted on 2008-03-04 16:50:58 UTC in 60° 10.524 N 24° 55.146 E Helsinki, FI to . 0 comments.

Since late 2006 Finland has been quietly enacting its own form of Internet censorship, a practice more typically connected with various oppressive regimes, and not with a democratic country.

The Finnish variation is a DNS blocking system ostensibly targeted at child porn. The system is however very dubiously implemented using secret block lists maintained by the police, and it blocks access to many sites that contain fully legal content. A well-known case is the police blocking access to the website of Matti Nikki, an anti-censorship activist.

There has been also discussion of expanding the system to block access to other internet resources, like gambling or file-sharing sites.

As is usual, this kind of faulty, and easy to circumvent system is the product of decision makers being ignorant of technology, even in the age of the information society. There was a demonstration today at the Finnish parliament house with about 500 attendees:

Internet censorship demonstration on March 4th, picture: Helsingin Sanomat

(picture source: Helsingin Sanomat)

To fight this, please support Electronic Frontier Finland (EFFi) and the efforts of MP Jyrki J. Kasvi.

Technorati Tags: finland, censorship

Sponsored links

Microsoft Certification Exams โนเกีย Nokia มือถือ Online Project Management save money using, phone card
Reviews มือถือ Mobile All Apps

Yahoo! Fire Eagle knows where my phone moves

Posted on 2008-03-07 18:30:24 UTC in 60° 10.524 N 24° 55.146 E Helsinki, FI to . 0 comments.

I've been a happy user of the Jaiku S60 client for a while now. It not only allows me to coordinate things with my friends on the move, but also positions my phone using cell IDs.

So far I've used the WiFi positioning based Plazes client for updating location on my site, but the thought of also using Jaiku has crossed my mind a few times, as it updates my location a lot more often (even if less accurately) than my N810 does.

To make things even more interesting, Yahoo! recently launched their Fire Eagle positioning service that can use multiple location sources, and distribute the data to multiple clients. This means that if I make my Midgard track Fire Eagle instead, I can easily combine both Plazes and Jaiku location data.

However, as for now Fire Eagle only provides a set of APIs, and no tools to work with the various services. So in order to get familiar with their API and to enable Jaiku location I whipped up a quick PHP script for keeping Fire Eagle updated on my location.

Now in my server's cron I have the line:

*/20 * * * *   /usr/bin/php /home/bergie/bin/jaiku2fireeagle.php bergie <fire eagle access key> <fire eagle access secret>

And this seems to give quite decent results:

Fire Eagle location from Jaiku

In this case my Jaiku location string was Etu-Töölö, Helsinki, Finland. I passed the neighborhood name through GeoNames search, and that mapped the Helsinki district of Etu-Töölö to coordinates to only some hundred meters from my home. Not bad!

Next up: make Fire Eagle a Midgard position source as well. Also, figure out how to tell Fire Eagle that even though I'm providing it coordinates I got from GeoNames, the position is only approximate and not exact.

Technorati Tags: geonames, jaiku, php, fireeagle

Weekend of Haedong Kumdo

Posted on 2008-03-12 14:26:50 UTC in 60° 10.524 N 24° 55.146 E Helsinki, FI to . 0 comments.

Grand Master Kim Jeong Seong of the United World Haedong Kumdo Federation visited Helsinki last weekend to hold a seminar on Korean traditional swordmanship.

Helsinki Haedong Kumdo seminar 2008 participants

The weekend was a very interesting combination of various sword forms, two sword sparring and cutting and control exercises. We also held examinations for various belt levels, where I attained 1st keub (red-black). Our instructors Jose and Mika reached the 2nd dan in the art.

Jose and Mika displaying Jedo Gumbup

Photos by me and Vilja are available online. Those interested in Haedong Kumdo can see more and try it in our next demonstration on March 17th in Ressu school in Helsinki. Here is a small teaser.

Technorati Tags: haedongkumdo, hdgd, swords

Some Midgard roadmapping

Posted on 2008-03-13 13:54:35 UTC in 60° 10.212 N 24° 56.004 E Helsinki, FI to . 0 comments.

Midgard2
There has been some discussion on how the different items in the Midgard roadmap fit together. Here is my company's view on how we see ourselves proceeding.

Baseline: Midgard 1.8, MidCOM 2.8 and PHP 5.2

At least in our company we're trying to consolidate all customers to these version numbers. MidCOM 2.8 is a very capable (if heavy) platform that we will be able to support for a long time. It is also important, as...

Next step: Midgard 1.9, MidCOM 2.9 and PHP 5.2

Having consolidated sites to MidCOM 2.8 and PHP 5.2, it will be very easy to migrate to Midgard 1.9 (PHP4 not supported). While Midgard API changes somewhat (Exceptions, Midgard_Connection) between 1.8 and 1.9, MidCOM 2.9 (currently called "trunk") is able to hide that from site builders.

Mid-term: Midgard 1.9, MidCOM 3.0 and PHP 5.2

The main reasons to switch from Midgard 1.8 to Midgard 1.9 are performance, new installer and the ability to run MidCOM 3 alongside MidCOM 2.8. While MidCOM 3 requires complete site rewrite from 2.8/2.9, this phase makes migrations and running sites with both versions on same server possible.

Long-term: Midgard 2.0, MidCOM 3.0 and PHP 6

Once a server has completely migrated from MidCOM 2.x sites onwards, it will be possible to make the final jump to the full new generation Midgard platform.

Technorati Tags: midcom, midgard, php

Semantic web is here: Yahoo! and microformats

Posted on 2008-03-14 08:57:34 UTC in 60° 10.458 N 24° 55.980 E Helsinki, FI to . 0 comments.

Microformats

Semantic web, the platform that could enable new businesses to rival the likes of Google has for a long time been a distant promise. Much of this has been because the standardization bodies have focused on too difficult and impractical technologies instead of building it on top of existing web implementations.

Microformats are a more pragmatic approach: by using simple naming and mark-up conventions the semantic information can easily be added into web pages that will then suddenly become readable by both humans and computers. Microformats have been around for a while now, but have so far remained quite exclusive to a small group of web geeks.

This is about to change, though: Yahoo! has announced that its search service will utilize Microformats to present much more useful results to end-users. And Google will likely follow. This means that suddenly search engines will understand about addresses of companies, product reviews, event scheduling and many other things, and will make these easily accessible to consumers.

At the same time, Firefox 3 is nearing release and will support Microformats directly, so extensions for doing it may not be necessary. With both browsers and search engines covered, Microformats should quickly become very easy to find and utilize.

So now our users and customers will start to reap benefits from the fact that we've been seeding Midgard CMS default templates and customer implementations with Microformats since summer 2005.

Technorati Tags: microformats, search

MidCOM 3 at a glance

Posted on 2008-03-18 12:21:18 UTC in 60° 9.762 N 24° 44.310 E 7km S of Espoo, FI to . 0 comments.

This document has been written as a quick Midgardized version of the nice "Django at a glance" tutorial, in order to explain how the new and upcoming MidCOM 3 framework works. In addition publishing this as a blog post, this document will be maintained in the MidCOM 3 version control tree.

MidCOM 3 has been designed to be an extensible and highly configurable CMS development environment. It provides several basic building blocks like toolbars, access controls and management of static content pages out-of-the-box.

MidCOM applications are built as "components" with Java-like namespacing. This means that a "news" component designed by company named Nemein could be called net_nemein_news. Components are run on a Midgard site by setting a folder of the site to use that component.

Design your model

MidCOM uses Midgard's MgdSchema object-relational mapping system for providing easy object-oriented API for database storage. Models are described using XML syntax, and Midgard then provides OOP APIs to them for C, PHP and Python languages.

Here is a simple example MdgSchema:

<?xml version="1.0" encoding="UTF-8"?>
<Schema xmlns="http://www.midgard-project.org/repligard/1.4">
  <type name="net_nemein_news_article" table="net_nemein_news_article">
    <property name="id" type="integer" primaryfield="id" />
    <property name="name" type="string"/> 
    <property name="title" type="string" multilang="yes" table="net_nemein_news_article_i" />
    <property name="content" type="longtext" multilang="yes" table="net_nemein_news_article_i" />
  </type>    
</Schema>

Other fields like author or publication date do not need to be defined in the MgdSchema as Midgard automatically extends all records with a set of metadata properties.

Install it

Place the MgdSchema XML file to /usr/share/midgard/schema, and then create the database tables based on it by running:

$ midgard-schema midgard

Where midgard is the name of your Midgard conf.d file that defines the database access parameters like database type and password.

Enjoy the free API

These steps are all you need to do to have new Midgard objects at your disposal. Now you can access and manipulate them using for example Python or PHP. With PHP, the API looks like this:

<?php
// Create a new person
$reporter = new midgard_person();
$reporter->firstname = 'John';
$reporter->lastname = 'Smith';

// Save it to the database
$reporter->create();

// Now it has an UUID
echo $reporter->guid;

// And it can be fetched from the database
$qb = midgard_person::new_query_builder();
print_r($qb->execute());
// This would print an array of midgard_person objects containing "John Smith"

// We have multiple ways to query objects
$qb->add_constraint('lastname', 'LIKE', 'Smi%');
print_r($qb->execute());

// Create a new article
$article = new net_nemein_news_article();
$article->title = 'MidCOM is cool';
$article->metadata->authors = $reporter->guid;
$article->create();

// Extend the article with new properties
$article->parameter('namespace', 'key', 'value');

// Localize the article to Finnish
mgd_set_lang('fi');
$article->title = 'MidCOM on ältsin magee';
$article->update();

// Delete the Finnish translation
$article->delete();

/// etc
?>

A dynamic admin interface

Midgard comes with Asgard, an automated administrative interface which provides a full editing tool to all our installed MgdSchemas. If your define a tree model for your storage, it will even provide a nice navigation tree for them. For example:

<?xml version="1.0" encoding="UTF-8"?>
<Schema xmlns="http://www.midgard-project.org/repligard/1.4">
  <type name="net_nemein_news_article" table="net_nemein_news_article" parent="midgard_topic">
    <property name="id" type="integer" primaryfield="id" />    
    <property name="name" type="string"/>
    <property name="title" type="string" multilang="yes" table="net_nemein_news_article_i" />
    <property name="content" type="longtext" multilang="yes" table="net_nemein_news_article_i" />
    <property name="topic" type="integer" link="midgard_topic:id" parentfield="topic"/>
  </type>    
</Schema>

After this the net_nemein_news_article objects would be stored under topics, and could be browsed in the topic tree hierarchy.

Asgard understands linked properties, datetime fields, and other MgdSchema field types and provides appropriate editing tools for them. For example, linked fields automatically become search-based choosers.

At this point you can already start entering content to your new application using the Asgard tool.

Design your URLs

A clean URL space is important in a modern web framework, and with Midgard clean URLs have been the norm even since the 90s.

In MidCOM your application URL space is set up as something called "routes". They are entered in YAML format to the component's configuration file, in this case net_nemein_news/configuration/defaults.yml. The routes follow the IETF URI template draft format.

For example, a route for displaying a particular article could be defined as:

show:
    controller: net_nemein_news_controllers_article
    action: show
    route: /{$name}/
    content_entry_point: nnn-show-article

In this case, the URL to a news article would be /foldername/articlename.

The routes define many things about what MidCOM should do with the request. First of all, they define which controller PHP class, and which action method in it will deal with the request. Additionally the route can define a template_entry_point or content_entry_point to choose which template files will be used for displaying the page. Other things like templating language and MIME type can also be defined in the configuration file.

Routes are stored in configuration file so that they can be easily overridden on per-site, or even per-folder basis. This means that migration from some other CMS system is quite easy as the site can be configured to retain the old URL formats.

Write your controllers

Each controller is responsible for doing one of two things: Populating a data array with content of the requested page, or raising an exception like midcom_exception_notfound.

The controller class in this case would be stored to net_nemein_news/controllers/article.php and could look like the following:

public function action_show($route_id, &$data, $args)
{
    $qb = net_nemein_news_article::new_query_builder();
    $qb->add_constraint('name', '=', $args['name']);        
    $articles = $qb->execute();        
    if (count($articles) == 0)
    {
        throw new midcom_exception_notfound("Article {$args['name']} not found.");
    }
    $data['article'] = $articles[0];
}

After the controller has produced the data it will then be passed to the MidCOM templating system according to the entry points defined for the route.

Design your templates

MidCOM uses the Template Abstraction Language (TAL) for its templating purposes. TAL is a very powerful templating system in the sense that it allows designers to build the site XML or XHTML templates and fill them with example data that will then be replaced with the real data when TAL is run.

In this case our template would be placed in net_nemein_news/templates/nnn-show-article.php. It could contain something like:

<div class="hentry">
    <h1 tal:content="net_nemein_news/article/title" class="entry-title">Headline</h1>

    <div tal:content="net_nemein_news/article/metadata/published" class="published">2007-08-01</div>

    <div tal:content="structure net_nemein_news/article/content" class="entry-content">
        Content
    </div>
</div>

The XHTML attributes in the tal namespace contain the rules used by TAL for replacing the example data with the real data from the controller. The data array of the controller is exposed to tal using the component name, in this case net_nemein_news.

The default template supplied by the component can be overridden by placing an element named nnn-show-article to either the site main style, or as an element of the current folder.

This is just the surface

This has been a very quick overview of the MidCOM framework. The third version framework is still very much evolving, but the earlier versions are already very rich with existing tools and features.

However, in near future MidCOM 3 will feature rich signal-based I/O event handling, Access Control Lists, caching and many other things useful to web developers.

Everybody interested in MidCOM 3 is welcome to install a Midgard 1.9 nightly, get a git checkout of MidCOM 3 and start playing.

GeoClue status update

Posted on 2008-03-19 15:16:22 UTC in 24° 39.894 N 60° 12.648 E 82km SW of Chābahār, IR to . 0 comments.

GeoClue
I sat down with GeoClue maintainer (and my former SoC student) Jussi Kukkonen to discuss how the project has been moving forward, and the situation is looking quite good. To those unfamiliar with GeoClue, here is a quick intro:

GeoClue is a modular geoinformation service built on top of the D-Bus messaging system. The goal of the GeoClue project is to make creating location-aware applications for mobile Linux devices as simple as possible.

Last summer with the Summer of Code we were able to make a first full implementation of GeoClue and release it for the maemo platform. There were also GeoClue sessions held in the State of the Map and GUADEC conferences.

However, as that implementation did not provide a master provider to abstract away the different position sources, it was still a bit cumbersome to develop GeoClue-powered applications. So when Jussi got hired by OpenedHand, a decision was made to change the API.

Now finally the API change work starts to be complete, and a new release of GeoClue should appear pretty soon. There are lots of ideas for location-aware applications floating around, and at least Mauku and Telepathy developers have expressed interest in using GeoClue in their apps.

If you're developing a mobile Linux application, GeoClue might be a good thing to take a look at. Location is a powerful piece of contextual information that can make your application more usable.

In the Age of Ajax, Java applets are obsolete

Posted on 2008-03-26 14:17:23 UTC in 60° 9.954 N 24° 56.544 E Helsinki, FI to . 0 comments.

Sampo Pankki, the bank that was formerly known as Postipankki, Leonia and just Sampo was recently bought by the Danish Danske Bank. As part of the merger they switched their IT systems to Danske Bank infrastructure in a huge EUR 200 million operation over the Easter. The switch had a lot of issues, causing website downtime, faulty account data and non-functioning credit cards.

However, the downtimes were not the only big issue with the switch: in the process Sampo also switched from a reputedly very functional HTML-based web banking interface into a Java Applet that is doing some quite dubious snooping on user's computer. And of course they didn't do much cross-browser testing. Here is what I see with Firefox 3 beta:

Sampo verkkopankki broken with Firefox 3

I remember when our former accounting software SaaS vendor Procountor did a switch from HTML to Java Applet. Suddenly a very fast and easy UI was changed to slow and unusable semi-desktop-ish application. Needless to say, my company dumped them immediately. Java Applets may have had advantages in 90s, but in the Age of Ajax they are mostly obsolete.

Update: Apparently the Sampo service also has a Cross-Site Scripting vulnerability. All this bungling makes me remain quite a happy Nordea customer.

Technorati Tags: ajax, java, security, sampopankki

Back