Motorcycle Adventures and Free Software

Weblog: Archive

2007-08-01 - 2007-08-31

On motorcycling

Posted on 2007-08-10 12:31:10 UTC in 60° 9.234 N 24° 52.782 E Helsinki, FI to . 0 comments.

My good friend Skoll recently wrote of the motorcycling life:

One of me favourite bands Manowar one sang "Riding horses made of steel". What kind of mental image does that provoke? Riding a Harley Davidson to sunset on an empty hightway, a beautiful young girl on your back seat? What a load of bullcrap! Motorcycling is about rain, it's about being soaking wet and freezing your ass off. It's about losing your friends in the traffic because you can see shit in the rain. It's about jams, about highways full of trucks and mobile homes and passing them being scared your ass off because there's no traction. It's about acheing shoulders, acheing back and numb ass. It's about water finally reaching your balls through your so called waterproof gear (yeah, I know, my pants are only water resistant). It's about waking at 6:30 am and driving 800 km.

Now, there have been times when the things above have been very true. But there have also been times when the biker's life has been closer to the initial mental image, including the nice ride to Porvoo yesterday.

Everybody is invited to make their own decisions on which view is more correct...

540763800_c5143baf1e_s.jpg 153040280_b6987a5e97_s.jpg 988753226_b542f68e3c_s.jpg 988695780_fb82586c9c_s.jpg 231697694_e0852ffdfe_s.jpg 987926197_73a7107500_s.jpg 231704621_0ad9e8bdb7_s.jpg

thumbnail_1026465122--helmetless-freedom thumbnail_IMG_4278 thumbnail_IMG_3175 thumbnail_1027727783--entering-the-dolomites thumbnail_1032208206--on-the-box-hill thumbnail_1028045618--bergie-on-the-col-d-san-bernardo

FTW!

Technorati Tags: ,

Sponsored links

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

Maemo Social News launched

Posted on 2007-08-14 15:20:59 UTC in 60° 10.524 N 24° 55.146 E Helsinki, FI to . 0 comments.

Today has been a big day for maemo.org: not only was the Maemo Community Calendar released for beta testing, but we also launched the new Social News section on the site. Social news is an area where users can easily with one glance see all interesting things happening at the moment in the maemo world.

Maemo-Socialnews

We syndicate data from a lot of sources: official Nokia announcements, Garage project news, Tableteer, Flickr maemo group, YouTube maemo tag, Application Catalog updates, community blogs from Planet maemo and possibly in the future also ITT threads. However, Social News is not your ordinary aggregator. Instead of just showing everything in a single stream, we do some interesting relevancy calculation to determine what items are important at the moment and give those more prominence. Older and less prominent items slowly fall out of the news listing as time passes.

Relevancy-based display gives us a place where everybody can see the current topics. Social media is used for promoting items on the list. Here are some methods users can utilize the promote an item:

  • Comment it on the maemo.org site (applies only to Application Catalog and Announcements)
  • Add it to favorites on the site (by clicking the heart icon)
  • Digg it or comment it on digg
  • Blog about it and ensure the blog is listed by Technorati
  • Bookmark it on del.icio.us

The more work-intensive methods like commenting and blogging are given the greatest value.

In addition to the "current news highlights" list, we also keep track of all-time favorites (starting from about two weeks ago), which can be seen in the Best Of list:

Maemo-Socialnews-Bestof

Social News is currently being beta tested as we tune the relevancy algorithms. Feedback is obviously welcome.

Thanks to Lasse Larvanko and Andreas Nilsson for the design!

Updated 2007-08-17: Lasse has a very good write-up of the service in Finnish.

Technorati Tags: , , ,

Join the MidCOM Performance Sprint on August 30th

Posted on 2007-08-20 14:24:45 UTC in 60° 10.524 N 24° 55.146 E Helsinki, FI to . 0 comments.

MidCOM is the PHP-level framework of Midgard CMS. With its nearly 500K lines of code, it every now and then is good to sit down and focus on performance optimization.

MidCOM has again gathered some heft, and so this year we have to do more:

Midcom-Performance-Sprint-Beforeafter

Lots of MidCOM code is still from the old Midgard 1.x API and PHP4 times. In MidCOM 3 we can build everything around modern Midgard API and PHP 5.2, which will make performance a lot easier. Some of the focus areas will be:

I have created bug #102 for keeping track of all performance-related commits originating from the sprint.

To make all of this happen, a group of Midgard hackers will gather on August 30th to Ingels in the Finnish countryside. Anybody interested is welcome to join us either on-site or over IRC. Obviously some PHP5 hacking skills will be required :-)

Everybody attending the sprint will get a cool Midgard t-shirt designed by Andreas Nilsson.

Technorati Tags: ,

Photos and "interestingness"

Posted on 2007-08-21 06:52:53 UTC in 60° 12.552 N 24° 56.778 E Helsinki, FI to . 0 comments.

I've been working on determining relevancy of news items recently. Something similar can be done to photos using the various metrics Flickr provides for interestingness, and not surprisingly, there is a service that enables you to do exactly this: Dopiaza's Flickr Set Manager.

I used the tool to generate a set of my most interesting pictures, but also a set of the least interesting. Usually a "top" list perpetuates the interestingness of the items, and I'm eager to find out whether the least interesting pictures are affected the same way.

Since my top photos are all geotagged, we can also see where my most interesting pictures come from:

Flickr-Top-Pictures-Map-20070818

Via Boing Boing.

Technorati Tags: , , ,

Speaking in FrOSCon PHP room

Posted on 2007-08-22 13:38:01 UTC in 60° 10.566 N 24° 55.338 E Helsinki, FI to . 0 comments.

FrOSCon 2007

This weekend I will be speaking in the PHP at Froscon track in FrOSCon conference in Sankt Augustin, Germany about managing your personal information space with Midgard:

Social web services like Flickr and del.icio.us provide new ways to work and share data with others. However, they also mean that your data is spread around dozens of services, companies and servers.

Midgard can be set up to act as your personal information hub, synchronizing your content with the various Web 2.0 services and displaying them in your own style as a mashup. This means your content can also be secure in a server you control.

You can connect the data from different services together and enrich it with data produced with Midgard's own components. Consider for example having the following play nicely together:

  • Blog entries coming from an external blog service or Midgard itself
  • Bookmarks coming from del.icio.us
  • Photos coming from Flickr
  • Videos coming from Youtube
  • Status messages coming from Twitter and Jaiku
  • ...all connected with geolocation data coming from Plazes and shared via RSS feeds and Microformats

In this session we look at how such a personal information space can be set up with Midgard, and how new functionalities or data connections can be developed for it.

While I'm using Midgard's Web 2.0 integration features as an example, many ideas should be of interest to developers of other CMSs as well.

Catch the talk at 15:15 this Saturday in the PHP room!

Technorati Tags: , , , , , ,

Introduction to Midgard's database abstraction system

Posted on 2007-08-26 15:18:43 UTC in 50° 46.848 N 7° 10.898 E Sankt Augustin, DE to . 0 comments.

I've noticed this is something I end up showing to people in every conference, and therefore probably makes sense to blog it.

Midgard abstracts database storage on C library level, and provides a set of classes and interfaces for accessing it on PHP extension level. PHP scripts cannot bypass the C-level abstraction and don't get information about the database connection or passwords being used. While this sacrifices some flexibility, it also helps a lot with consistency and security.

Defining database structure

Developers can define database structures to Midgard as MgdSchema files. Midgard ships with some pre-defined types like Articles and Persons, and others can be shipped in component packages.

MgdSchema files are XML:

<type name="org_routamc_statusmessage_message" table="org_routamc_statusmessage_message" parent="midgard_person" parentfield="person">
    <property name="id" type="integer" primaryfield="id"/>
    <property name="status" type="text" />
    <property name="person" link="midgard_person:id" reverse="no" type="integer" parentfield="person"/>
    <property name="source" type="string" />
    <property name="externalid" type="string" />
</type>

Actual MySQL database tables are generated from these files by the midgard-schema tool:

mysql> describe org_routamc_statusmessage_message;
+-------------------------+--------------+------+-----+---------------------+----------------+
| Field                   | Type         | Null | Key | Default             | Extra          |
+-------------------------+--------------+------+-----+---------------------+----------------+
| id                      | int(11)      | NO   | PRI | NULL                | auto_increment | 
| status                  | longtext     | NO   |     |                     |                | 
| externalid              | varchar(255) | NO   |     |                     |                | 
| source                  | varchar(255) | NO   |     |                     |                | 
| guid                    | varchar(80)  | NO   | MUL |                     |                | 
| sitegroup               | int(11)      | NO   | MUL |                     |                | 
| metadata_creator        | varchar(80)  | NO   |     |                     |                | 
| metadata_created        | datetime     | NO   |     | 0000-00-00 00:00:00 |                | 
| metadata_revisor        | varchar(80)  | NO   |     |                     |                | 
| metadata_revised        | datetime     | NO   |     | 0000-00-00 00:00:00 |                | 
| metadata_revision       | int(11)      | NO   |     | 0                   |                | 
| metadata_locker         | varchar(80)  | NO   |     |                     |                | 
| metadata_locked         | datetime     | NO   |     | 0000-00-00 00:00:00 |                | 
| metadata_approver       | varchar(80)  | NO   |     |                     |                | 
| metadata_approved       | datetime     | NO   |     | 0000-00-00 00:00:00 |                | 
| metadata_authors        | longtext     | NO   |     |                     |                | 
| metadata_owner          | varchar(80)  | NO   |     |                     |                | 
| metadata_schedule_start | datetime     | NO   |     | 0000-00-00 00:00:00 |                | 
| metadata_schedule_end   | datetime     | NO   |     | 0000-00-00 00:00:00 |                | 
| metadata_hidden         | tinyint(1)   | YES  |     | 0                   |                | 
| metadata_nav_noentry    | tinyint(1)   | YES  |     | 0                   |                | 
| metadata_size           | int(11)      | NO   |     | 0                   |                | 
| metadata_published      | datetime     | NO   |     | 0000-00-00 00:00:00 |                | 
| metadata_score          | int(11)      | NO   |     | 0                   |                | 
| metadata_imported       | datetime     | NO   |     | 0000-00-00 00:00:00 |                | 
| metadata_exported       | datetime     | NO   |     | 0000-00-00 00:00:00 |                | 
| metadata_deleted        | tinyint(1)   | YES  |     | 0                   |                | 
| person                  | int(11)      | NO   | MUL | 0                   |                | 
+-------------------------+--------------+------+-----+---------------------+----------------+
28 rows in set (0.03 sec)

As you can see, lots of metadata columns get added to the definition we made in XML. In addition to metadata, there is also a GUID field and a sitegroup field. Sitegroups are used for controlling access to content in different "virtual databases" in same Midgard instance.

Accessing storage in PHP

When Apache is started Midgard generates PHP classes for all installed MgdSchema types. The class provides the needed I/O functionality.

Here is some example code using the Article object that ships with Midgard. It is hopefully understandable by itself:

<?php
// Get empty article instance
$article = new midgard_article();

// Set some data into it
$article->title = 'Headline';
$article->content = '<p>This is my interesting article</p>';

// Store it in database
if (!$article->create())
{
    echo "Failed storing the article \"{$article->title}\", reason " . mgd_errstr();
    // Note: Midgard 2 raises exceptions in these situations
}

// Extend the object. This will be stored in the record_extension table
$article->set_parameter('domain', 'name', 'value');

// Switch language context, IDs point to midgard_language records
mgd_set_lang(58);

// Set translated data
$article->title = 'Otsikko';
$article->content = '<p>Tämä on mielenkiintoinen artikkelini</p>';

// Store it in database
if (!$article->update())
{
    echo "Failed updating the article \"{$article->title}\" in language {$_MIDGARD['lang']}, reason " . mgd_errstr();
    // Note: Midgard 2 raises exceptions in these situations
}

// Then get rid of the article translation of language 58 that we just made
$article->delete();

// Switch back to default language context
mgd_set_lang(0);

// Delete also the default article translation, therefore deleting the whole article
$article->delete();
?>

Making queries

Midgard provides two classes for making queries in the database: Query Builder and Collector. Both classes have same query features, but differ in that midgard_query_builder returns full MgdSchema objects and midgard_collector returns array of values requested by the user.

Here is a simple example:

<?php
// Query for full midgard_article objects
$qb = new midgard_query_builder('midgard_article');

// WHERE title LIKE 'Midgard sucks%'
$qb->add_constraint('title', 'LIKE', 'Midgard sucks%');

// ORDER BY metadata_published
$qb->set_order('metadata.published');

// Run the query, return matching articles
$articles = $qb->execute();

// Iterate through the article objects
foreach ($articles as $article)
{
    // These are full MgdSchema objects so we can do things with them
    $article->delete();
}
?>

More complex things like querying by linked information is also possible.

What about MidCOM DBA?

MidCOM adds an abstraction layer on top of the regular MgdSchema and query classes by extending them on PHP level. This is where lots of additional functionality happens:

  • ACL checks are done on every I/O step
  • Metadata datetime properties are translated to timestamps (in future DateTimes) for easier PHP usage
  • Content changes are versioned in RCS

To make MidCOM DBA aware of new MgdSchema types, a component has to define a midcom_dba_classes configuration file, and refer to it in the manifest:

array(
    'table' => 'org_routamc_statusmessage_message',
    'old_class_name' => null,
    'new_class_name' => 'org_routamc_statusmessage_message',
    'midcom_class_name' => 'org_routamc_statusmessage_message_dba'
),

When MidCOM refreshes its cache, it will create a new MidCOM DBA class __org_routamc_statusmessage_message_dba that will extend the org_routamc_statusmessage_message MgdSchema class.

If a component developer wants to add additional business logic to the object, he can then define his own org_routamc_statusmessage_message_dba class in the component that will extend the __org_routamc_statusmessage_message_dba class.

Midgard supports OpenID

Posted on 2007-08-28 12:44:43 UTC in 60° 9.840 N 24° 44.190 E 7km S of Espoo, FI to . 0 comments.

OpenID Inspired by a talk in FrOSCon on Sunday, I went and implemented OpenID support into Midgard on the flight back. OpenID is a quite cool system for cross-site single sign-on and auto-registration. With OpenID your user identity is tied to a web address you control, for example http://bergie.iki.fi/. Every time I want to log in to an OpenID-enabled website, that site will ask my authentication status from my site and let me in. The way this works is the following:

I go to a page that requires authentication, or to MidCOM's login URL and I get a login form allowing me to either input a local username/password combination or my OpenID:

Midgard-Openid-Login-Initial-1

(yes, I know this screen still needs some CSS love)

If this is the first time I'm using OpenID for this particular site, or I haven't yet logged in to my OpenID provider, it will next ask me for confirmation:

Mylid-Login

(this step is skipped if I already have authorized login for the site and am logged in)

After this a MidCOM login session is generated for the OpenID identity and I'm logged in to the Midgard site. I even get a nice notice about this:

Midgard-Openid-Success-1

The OpenID implementation is now available in MidCOM SVN. It should be reasonably useful already now, but I will still make some improvements to it, including:

  • Adding the OpenID user to a group specified in component configuration
  • Using Simple Registration Extension together with Midgard's account registration schema to pull in more information about the OpenID user if available

It would also be nice to enable using Midgard as an OpenID provider, but for now URL delegation is needed.

Technorati Tags: , , , ,

Greg Stein got mugged :-(

Posted on 2007-08-28 14:05:59 UTC in 60° 9.840 N 24° 44.190 E 7km S of Espoo, FI to . 0 comments.

Michael Wechner and Greg SteinGreg Stein, of WebDAV, SVN and ASF fame, got violently mugged last Friday in Mountain View:

They gave Greg a black eye and a serious laceration to the head which required numerous stiches. Apparently, he was bleeding profusely when the ambulance came.

The doctors were worried about his head wound and he spent the entire night under observation and went through numerous CAT scans.

A few weeks prior, he broke one of his legs and had been on crutches when these guys decided to beat the hell out of him.

What did they get? One hundred dollars and a credit card.

Ouch.

When I got drugged and robbed in Czech Republic last June, I was quite down because of it for weeks. I'm sure getting mugged is even worse. So, to cheer him up, some people have started a PayPal fundraiser to send him on a holiday. Overflow will be donated to Apache Software Foundation.

I know Greg from the OSCOM circles, and it really sucks that this happened to him.

Technorati Tags: , , ,

Some notes from MidCOM performance workshop

Posted on 2007-08-30 19:47:11 UTC in 60° 8.868 N 24° 25.182 E Kirkkonummi, FI to . 0 comments.

Today we've been hacking in the woods as part of the MidCOM Performance Sprint. Together with yesterday's bug day this has resulted in quite a few commits.

While results obviously were not as dramatic as the last time due to better overall status of the code, we still scored about 20% reduction in database I/O and debug log lines dropping from over 700 to a more readable 103 per regular, fully debugged request. Memory usage should be much better now as well.

Jerry and bug-free Macbook Pro

Focus areas today were:

Thanks to everybody involved!

Back