Planet Midgard
Using Yahoo! Fire Eagle with Midgard
Posted on 2008-08-20 14:56:34 GMT.
Yahoo! Fire Eagle, kind of "GeoClue for the Web" was released last week. It acts as a central hub collection position information from services like Plazes and Dopplr, and with a simple PHP script, Jaiku. Services needing user's location can then ask it from Fire Eagle instead of having to support all the services separately.
Midgard's positioning framework has been Fire Eagle compatible since March this year. Now that the service is open for a wider audience, I though it would be useful to tell how to activate it with your Midgard-powered site.
You need to authorize Midgard with your Fire Eagle account. To do this, go to:
http://www.example.net/midcom-exec-org.routamc.positioning/test-fireeagle.php
and follow the authorization instructions. This is due to Fire Eagle using the nice OAuth protocol.
Once this is done MidCOM cron will start tracking your Fire Eagle location. All objects you have created (photos, blogs, comments, etc) will then be automatically tagged with where you made them.
Finding out available MidCOM routes
Posted on 2008-08-20 14:26:43 GMT.
MidCOM is a PHP MVC framework where you create a site by building a tree structure and assigning components for the various folders. Each component is its own PHP application that can handle all URL requests under that folder using a set of configured routes.
In addition to making normal requests to the various routes available, routes provided by other folders can be loaded dynamically anywhere on the site. This is useful for instance for loading five latest news items to front page.
To make life easier, I now added a new feature to midcom.admin.help, the online help component. Each folder will automatically list their documentation and available routes when you access their URL __ais/help:
To get this feature you only need to upgrade the help component:
# pear upgrade midcom/midcom_admin_help
How much more torque MidCOM 3 really gives?
Posted on 2008-08-20 12:23:12 GMT.
So how well does it perform? So far there are some optimizations to the web applications code to be made that I'm currently doing. But I still decided to make a little benchmark MidCOM 2.8 (content cache + memcached + bytecodecache) versus MidCOM 3.0 (no cache. Even Midgard page cache is disabled)
I did not have time or a suitable machine available this time to test MidCOM 2.9 with autoloading. So that part remains in the dark at this point.
Both test machine has same CPU power available. Only difference is that MidCOM 3 is run only with 256MB of RAM. Another machine has over 2GB. Both machines have somewhat similar background load.
Results
First in order to make worst possible MidCOM 2.8 run I made several independed requests with ab to get one single page after midcom-cache-invalidate.Average request time with options ab -c 1 -n 1 done 10 times
MidCOM 2.8: 5.516 seconds
MidCOM 3.0: 0.270 seconds
Results with ab -c 1 -n 10. With this options MidCOM 2.8's caches can truly kick in.
MidCOM 2.8:
Requests per second: 3.28 [#/sec] (mean)
Time per request: 305.20 [ms] (mean)
MidCOM 3.0:
Requests per second: 3.59 [#/sec] (mean)
Time per request: 278.70 [ms] (mean)
Quite impressive. The page I loaded has 3 dynamic loads. So when MidCOM 3 has its caching engine up and running and some bytecode caching it _is_ going to fly.
The MidCOM 3 itself should not get much more functionality to be run on every request with sufficent planning, implementation and taking leverage of intelligent autoloading.
As the Midgard 2 and MidCOM 3 release comes nearer I'll take more look of the results. So far, looking very good.
Micro-blogging as alternative corporate announcement channel
Posted on 2008-08-18 08:10:16 GMT.
Today our ISP is having major power failures, and therefore many of our web services are down. For situations like this, it is good to establish an alternative channel of communications, and for us that is the micro-blogging platform Jaiku:
http://jaiku.com/channel/Nemein
If you are a Jaiku user, feel free to join the channel. Others can follow it via the RSS feed.
Why Finland is different
Posted on 2008-08-16 21:58:43 GMT.
It is not only sauna, cold winters and Koskenkorva that sets us Finns apart, apparently:
The map also identifies the existence of two genetic barriers within Europe. One is between the Finns (light blue, upper right) and other Europeans. It arose because the Finnish population was at one time very small and then expanded, bearing the atypical genetics of its few founders.
New York Times: The Genetic Map of Europe (via Slashdot)
How to run Midgard 8.9.0
Posted on 2008-08-13 18:22:13 GMT.
Midgard 8.9.0 (1.9beta1) will be released soon. I have planned to make this today, but there are still small issues and bugs which must be fixed to have very nice beta version. If you feel impatient, follow me.
How to install it? It's quite simple. You can get fresh SVN checkout or install binary packages.
Build
SVN checkout
I assume you have svn client installed.
svn co https://svn.midgard-project.org/midgard/branches/branch-1-9 midgard
cd midgard
./makedist
Now you should have all tarballs. Untar all packages and build. In most cases simple build rules should be enough:
./configure
make
sudo make install
In case of any problems you can always get help:
./configure --help
Installing binary packages
The easiest way. Download packages from repository. We have debian, ubuntu and opensuse ones. Unfortunately, debian or ubuntu users have to download packages and install them via dpkg. I already reported apt-get way problems and let's hope guys from Opensuse will fix it soon.
Configure and install
Once Midgard package are installed. You can install new database or upgrade existing installation.
Installing new database
Just run datagard.
datagard
In this case, you will be asked few questions and datagard will:
- create new database
- install MidCOM from pear channel
- create new sitegroup ( Midgard Domain )
- create new Midgard host
- create new Apache virtual host
If you fell, you would like to enjoy your coffee, try this:
datagard -t q
'q' or 'quick' is quick and simple mode and 'w' or 'wizard' is the mode when you are need to answer the questions.
In this mode, datagard will try to be smart as much as possible and probably will not ask you any question.
In both cases, datagard will try to use default 'midgard' unified configuration. If you would like to use different configuration, specify it:
datagard -c myconfig
Upgrade exsiting installation
Create configuration which describes your setup best, and run datagard with 'upgrade' action.
datagard -c myconfig -a upgrade
This will remove MidCOM 2.8 ( if exists ) and install new MidCOM 2.9 from new pear channel. Also database will be updated.
Running simple action
Install pear packages.
datagard -a pear
Upgrade database only
datagard -a dbupdate
Install new sitegroup
datagard -a sitegroup
Install new Midgard host
datagard -a vhost
What are the keypoints of business value generation with long term support?
Posted on 2008-08-12 12:59:47 GMT.
Because we are dealing up with an open source product the business itself is totally service oriented since no license fees are collected. Nowadays mixed business models have emerged that contain both licence and service fees. But with both cases there are more or less unexpected expenses that just occur.
Basically in the long term most of the software service expenses come from repeating tasks like installing, upgrading, bug tracking etc. With coming Midgard LTS version installation part has been quite well tested. Upgrading and bug tracking should be reviewed and discussed. How do we do software configuration management? And what are the expectations that LTS version should fullfill?
Git and OBS are good starting point for the improvement. However there still some important keypoins to address like Configuration control, status accounting, reviewing of the components and the very LTS process management as a whole. This is the way now and in the future to make better value when providing consultancy services or web services built on Midgard LTS. Try and minimize the probability that something unexpected happens. That should provide us better chance to focus on relevant matters instead just trying to put out acute flames somewhere.
Georgia without Russian troops
Posted on 2008-08-11 21:13:28 GMT.
Feature branches in Midgard development with git
Posted on 2008-08-11 16:15:52 GMT.
The release synchronicity plan was accepted, and therefore Midgard will be switching from SVN to git, and the concept of feature branches.
With feature branches the idea is that each feature or bug fix is being developed in its own branch, and only landed to trunk (master in git terminology) when ready. This keeps the trunk clean and easy to test.
While the SVN migration will only happen in next developer meeting, you can already start using git for Midgard development thanks to git-svn. Once you have a working checkout, here is how you work with feature branches:
Ensure you have the latest stuff:
git svn rebase
Create a new branch:
git branch mynewfeature
Go to the new branch:
git checkout mynewfeature
Hack, add files, commit, test
Ensure the diff looks correct:
git diff master..HEAD
Go back to master:
git checkout master
Merge your feature branch:
git merge mynewfeature
Commit to SVN:
git svn dcommit
If you want to also work with other Midgard or MidCOM versions from SVN, check out the how to track multiple svn branches in git tutorial.
Some notes from aKademy 2008
Posted on 2008-08-10 13:19:04 GMT.
I'm currently in aKademy, the KDE conference, talking about adding the geographical context into the Linux desktop. GeoClue, our solution to this problem is built to be desktop-agnostic service, and therefore the same talk has been held in both GUADEC and aKademy.
Here are some notes from the conference:
- There was quite a good amount of interest in GeoClue. Both Plasma and Marble teams were talking with me, and I also gave an interview for Linux-Magazin Online
- Plasma is interesting tool for integrating widgets into the desktop. Being able to add widgets to the screensaver is also a great idea
- Another interesting Plasma idea is offering user widgets that are relevant for the current location coming from GeoClue. This means that when you land in London, you could be offered an Underground route planner app
- In general it seems the desktops are moving to a more service-oriented paradigm. With D-Bus your instant messaging functionality for instance can be part of any or all applications. This enables making much thinner and experimental applications that still integrate well with the desktop
- Marble is cool! With it, Qt developers can integrate a map widget into any application, making geo-aware tools much more visual
- openSUSE build service is about to get new features that will help generating virtual machine images
- The beer evening in the Het Anker brewery was a lot of fun. Thanks, Nokia!
- Speaking of Nokia, they are here really in force. They are the main event sponsor, and have a big bunch of people attending. Their acquisition of TrollTech has really changed the situation. Hopefully they'll do the right thing about GeoClue and Maemo
More stuff in my Jaiku notes. My GeoClue slides are also available.
Neutron Protocol: Separating UI from the CMS
Posted on 2008-08-09 09:26:58 GMT.
At the moment the prevailing wisdom is that each CMS should have its own user interface, and that user interface should be web-based. But there is also another way: separating the user interface from the CMS using a CMS-neutral protocol called Neutron.
According to Sir Tim Berners-Lee, the earliest web browser was also an editor. And the late 90s Netscape Communicator followed this ideal by including a HTML editor that could publish changes to pages using the HTTP PUT method. But then the idea of editing via the web browser transformed to clunky forms and Java applet -based WYSIWYG editors, brought about by the rise of content management systems.
The problems of the user interface being part of the web page were multiple: it cluttered the produced HTML, it was possible to break by layout changes, sometimes the login and editing options were hard to find. It also meant that each and every CMS would have a completely different user interface. A problem made especially difficult if you had to use multiple systems. For example:
If you are Quim Gil, working for Nokia's maemo.org, you're living in a world of many, many CMSs. The marketing and community parts of the website are run by Midgard, the documentation wiki by MediaWiki, your own blog by WordPress, and the list goes on. While in this kind of corporate setup it has been possible to mostly unify usernames and passwords, it still means each part of your work runs with different UIs, and different usage logic. Back in 2003, I named this syndrome Frankenstein CMS.
In addition to consistency and usability, offline editing has been a big issue with most CMSs. In typical situation, it simply doesn't exist, making copy-and-paste way of taking documents with you to edit on a laptop while traveling.
There have been several initiatives in solving these problems. A quite limited, but so far successful example is the Universal Edit Button specification, making rounds earlier this summer. The idea is that CMSs would include metadata on where the editing view of a particular page was in the page itself, and then browsers would display a button leading to it. The approach has been adopted by several big players, including Wikipedia, and we also made it a part of the new CMS that will be built on Midgard 2:

Another, also somewhat limited example is the MetaWeblog API provided by most blogging platforms. It has enabled vendors to produce great offline blogging software like Ecto and MarsEdit that provide offline editing and work with almost any blogging system out there. As I write this, I'm using Ecto on my MacBook Air, and will later use it to publish this entry to my Midgard server. The Atom Publishing Protocol will likely be the successor of MetaWeblog, but appears to still keep the blog-only focus.
Back in the earlier days of OSCOM we had another initiative called Twingle. It was a XUL-based desktop CMS client that utilized WebDAV and some XML introspection files to edit and publish data on different CMSs. After a March 2003 OSCOM Sprint in Zurich we were able to demo the same client browsing and editing resources on three CMSs, including Zope and Midgard. Unfortunately, then CMS market became so hot that vendors were simply too busy to pick this up and the project died.
Luckily Michael Wechner, of OSCOM and Apache Lenya fame didn't let the idea die. He worked it onwards, naming the protocol used for conversation between the client and the server Neutron Publishing Protocol, a play on Atom. He also built a new client, Yulup, as a Firefox extension that could manage content on compatible servers.
In summer 2007 I saw a demo of Yulup and discussed Neutron with Michi and was impressed. But was back then too depressed by the Czech episode and other personal issues to press on with the idea. Having watched another year of the directions the community is taking Midgard CMS to, and how clients view CMS deployments, I'm starting to think the time would be ripe for going full forward with Neutron.
In nutshell Neutron is a metadata layer that allows a CMS to specify the actions user can take, and the methods provided for those actions. The methods can either be full-blown WebDAV, or simpler GET-and-POST that more limited CMSs can support. Neutron also provides its own authentication mechanism, though I would gladly see that overtaken by a more secure and widely supported standard like OAuth.
Widely-supported Neutron would provide huge advantages: letting the developers of a CMS to focus on the actual management and presentation layers of the system, and allowing more innovation to happen in the client end due to combined efforts from multiple CMS projects. It would allow building of different content management interfaces for different audiences or usage scenarios. Simple editing and publishing clients that could run fully in browser's AJAX space for casual bloggers or wiki editors, workflow tools for gatekeepers of corporate publishing processes, and full-blown desktop content management tools for site editors. Other special cases like mobile content management could also be provided for.
So what is needed for this future to become reality? First of all, we need to make CMS developers aware of the possibility. Then we need a killer client that every CMS provider would want to support. And then we can expand the protocol, and build additional clients to cater for special needs.
The big question is how this will happen. Industry groups in CMS space are loose or non-existing, and so they lack the muscle to push any standards. Effort by single CMS vendor would probably stay partisan, as developers of different systems are quite suspicious or ignorant of each other. But maybe a combination of the two would work: industry group, such as OSCOM organizing some compatibility hacking events for the developer community, and a company dedicated at building a killer client application. It warrants serious consideration if Nemein should be that company.
This manifesto on transforming how CMSs are used was written in an Eurostar London-Brussels train, sipping Dourthe's Bordeaux white and listening to the Karelia cycle by Sibelius.
Midgard Textmate bundle
Posted on 2008-08-07 18:01:38 GMT.
For quite a while Joonas and I have planned to do a Textmate bundle for Midgard CMS to fasten and ease the code development and work as a reference to the thousands of methods MidCOM and Midgard has.
Finally last night we just decided to put the project on properly and uploaded it to GitHub.
Today I added (and adding right now) quite alot of the basic methods.
Here's a screenshot of shortcuts for the Query Builder.
with these methods even complex queries can be built lightning fast. We will be adding more stuff as time goes by.
ididwork.com: Simple workstreaming solution
Posted on 2008-08-07 12:24:18 GMT.
ididwork.com, a simple workstreaming service has launched this week. Workstreaming means utilizing micro-blogging services to keep your colleagues aware of what you're doing. This helps with coordinating geographically dispersed teams of web workers.
As part of redesigning our processes, our company has been looking for a workstreaming solution. While private channels support in Jaiku would probably be the best option, we will now be testing ididwork.com for our needs.
Here is a quick overview of the first launched version of ididwork.com:
The good:
- Simple, pleasant user interface
- Tagging support (including machine tags), which means we can connect entries with Ajatus tags
- Email reminders for managerial review of entries
- Excel export of work reports
The bad:
- Users can be either managers or employees, not both. Managers don't have work to report?
- User's own log entries and log entries of colleagues are shown separately
- User can only belong to one organization. No multiple teams or projects
The ugly:
- No API
- No RSS feeds
- No XMPP support
ETech 2009 CFP: Building the peer-to-peer business network
Posted on 2008-08-06 16:59:04 GMT.
ETech 2009, the O'Reilly conference on emerging technologies now has a call for papers. Here is my proposal for the "Nomadism & Shedworking" track:
The recent direction of business applications has been centralization to web-based systems, easing deployment, upgrades and management of application security. However, at same time centralization provides new risks like the introduction of a single point of failure for application usage and in most cases inability to work offline.
At the same time, working culture has started so shift more towards networked individuals, or "web workers" forming ad-hoc coalitions to work on various projects. For them, centralized applications might not be desirable due to data ownership and infrastructure requirements.
Moving the applications from centralized web servers to a peer-to-peer network allows web workers to be in control of their own data, stay productive even in unstable connectivity situations, and collaborate easily with their colleagues in an ad-hoc way.
This talk outlines some ways to move forward in building peer-to-peer networked business applications. There are many open source frameworks targeting the problem, including replicated databases like CouchDb and Prophet, and application-oriented P2P networks like Swallow/DBE. These will be discussed together with some real-world examples of business applications built with them:
Ajatus - a "Personal CRM" built on top of CouchDb, a RESTful replicated object database
OpenPsa - project management system doing resourcing over the DBE P2P network
Simple Defects - a P2P bug tracking system built on top of the Prophet replicated database
The first phase of P2P business applications will likely be services operating in closed networks of users' social networking or instant messaging contacts. But the P2P model can also provide opportunities for wider networking, making it possible to find new project partners or collaborators anywhere in the world. This wider-ranging business network will introduce new challenges like security and reputation management. Some ideas related to this will also be discussed.
Other interesting projects in this sphere I did not mention are Telepathy Tubes and F2F. We have also had some ideas for how Midgard could do this...
PHP5 xmlObject
Posted on 2008-08-05 15:37:23 GMT.
UPDATE [08/06/2008]: Version update. Did some fixing and made it work better with larger structures.
Here's another simple little helper I developed for Duct framework.
I use this one to convert my arrays to XML. As Duct automatically scaffolds objects from XML/YAML to database
and uses the same methods to render the database objects to html forms for editing I needed some quick way to
transform this data to and from XML. Class end examples are here
Usage example:
<?php
$resource = new xmlObjectItem();
$resource->items = array(
'id' => 100,
'name' => "Jerry Jalava",
'person_id' => 1
);
$resource->attributes = array(
'person_id' => array(
'is_assoc' => true,
'foreign_model' => 'person',
'foreign_key' => 'id'
)
);
$resource_set = new xmlObjectSet();
$resource_set->wrapper_id = 'resource';
$resource_set->items[] = $resource;
$projects = array();
for ($i=1; $i <= 1; $i++)
{
$object = new xmlObjectItem();
$object->items = array(
'id' => $i,
'name' => "Project {$i}",
'manager_id' => $i+1,
'resources' => $resource_set
);
$projects[] = $object;
}
$project_set = new xmlObjectSet();
$project_set->wrapper_id = 'project';
$project_set->items = $projects;
$clients = array();
for ($i=1; $i <= 1; $i++)
{
$client = new xmlObjectItem();
$client->items = array(
'id' => $i,
'name' => "Client {$i}",
'contact_id' => $i+1,
'team-leader' => null,
'projects' => $project_set
);
$client->attributes = array(
'contact_id' => array(
'is_assoc' => true,
'foreign_model' => 'person',
'foreign_key' => 'id'
)
);
$clients[] = $client;
}
$client_set = new xmlObjectSet();
$client_set->wrapper_id = 'client';
$client_set->items = $clients;
echo "complex set:\n";
var_dump($client_set);
echo "\n--------toXml---------\n";
$xmlSet_clients = xmlObjects::toXml($client_set, 'clients');
echo "complex:\n";
echo $xmlSet_clients;
echo "\n--------fromXml---------\n";
$client_set = xmlObjects::fromXml($xmlSet_clients);
echo "client_set root: {$client_set->root}\n";
var_dump($client_set);
echo "\n--------back toXml---------\n";
$xmlSet_clients2 = xmlObjects::toXml($client_set);
echo "complex:\n";
echo $xmlSet_clients2;
if ($xmlSet_clients == $xmlSet_clients2) {
echo "\n\nVALID SET CONVERSION\n\n";
}
?>
Black belt
Posted on 2008-08-05 12:12:22 GMT.
On Saturday I was in Ballina, Ireland, and a bit nervous: there was a Haedong Kumdo seminar in town, and I was scheduled to test for black belt. Behind this was years of different sword arts, like viking swordfighting, Iaido, Kendo, sabre fencing, and two years of quite intense Haedong Kumdo practice.
We tested together with two Swedes who already held black belt in the other federation. All three passed.
So what is Haedong Kumdo?
Haedong Kumdo is a Korean martial art based on the use of the Korean curved single edged sword. It is a modern system compiled from the ancient traditional sword techniques of Korea.
The movements are primarily circular and derive their power from centrifugal force of the body. Training develops strength, coordination, balance, focus, stamina, speed and flexibility.
Haedong in old Chinese language means Korea (Hae - sea or sun, Dong - east). Kumdo translates to way of life through the art of sword (kum - sword, do - way of life through martial art).
The Way of the Eastern Sword, Haedong Kumdo, is an exciting and dynamic martial art.
This important step done, the practice will intensify. Next I will need to focus on two-sword techniques and the Yedo series of forms. There will also be more cutting practice. In September we will go to Korea...









