11 April 2010

Wikipedia Path extension for my browser?

Dear Lazyweb,

On this partly-cloudy day of April, I’ve thrown myself at Wikipedia seeking mercy upon my insatiable need to know more about diverse subjects such as the International Phonetic Alphabet.  But, as with any visit to Wikipedia, I ended up reading about even more diverse subjects such as the Mortgage word (from Law French), the Arabic loanword Orange and the Merovingian dynasty.

This was all great to read upon (thanks Wikipedians!).  But I’d like an easy way to find my way back to the original piece.  I’d like a nice Firefox extension to draw for me the threads of articles I’ve read.  Each time I’d open a new tab it would create a new branch from this article.  When an article links to an already open tab, it should be identified with a dashed line.

I’ve drawn an example of what it could look like (click for more details):

My path through Wikipedia today

So please, tell me someone already wrote that piece of software? (It took me quite too long to draw this funny diagram).



NB: An attentive reader will realize that I like reading on History, Languages and History of Languages.

9 April 2010

Comment mettre fin aux invitations et pourriels

Malos humos, el / Bad Fumes, Him

Malos humos, el / Bad Fumes, Him. CC By-NC Heart Industry

Voici quelques petits trucs pour savoir si un groupe/chaîne de lettres est illégitime (comme “10 voitures OFFERTES à 10 membres FACEBOOK”):

  1. Si le titre inclus des mots en majuscule;
  2. Si on y parle de faire de gros cadeaux mais qu’on en a pas entendu parlé dans les nouvelles;
  3. Si tout ce qu’on doit faire pour participer est ridiculement simple (joindre un groupe, envoyer à tous tes amis); en plus au Québec, il faudrait répondre à une question d’habileté mathématique ;-)
  4. S’il est impossible de corroborer l’information (ça veut dire de trouver d’autres sources d’information qui confirme les faits);
  5. S’il est impossible de trouver les règlements officiels du concours;
  6. Si vous n’avez pas été contacté directement pour ce concours: les gens de chez Facebook et MSN savent encore comment contacter leurs utilisateurs.

Merci d’appliquer ses règles simples avant de m’envoyer invitations/chaînes de lettres et autres choses qui pollue la vie en ligne.

2 March 2010

The rumors of our extinction have been greatly exaggerated

This is a public announcement to everyone who have seen the opening and closing ceremonies of the 2010 Winter Olympics in Vancouver: Canada is still inhabited by French speakers.

Despite all the criticism the Vancouver Organizing Committee received after the opening ceremonies, little changed in the closing one.  Yes, the VANOC’s CEO made an effort to speak in French but that’s about the only change you could see.  That and the fact that Canada’s Olympic Broadcast Media Consortium added a live translator on French TV so that the less “fortunate” can understand the ceremonies in their own country.

Would have it been too much to ask for one of the monologues to have been in French? After all, I am sure there are Francophones outside Québec ready to do such a creed for Canada.  They probably just didn’t try to find one but I personally believe finding one could also have been a hard job, considering that doing such a creed, even if it’s a caricature, could mean professional suicide for a Québec comedian in Québec’s French market (where such creeds on any side isn’t popular these days).

In short, we still exist.  What you have witnessed is a sad image for a country with 2 official languages.  It is reminiscent of old English-French frictions which we all would like to believe were long gone.  As it has been pointed out on this blog (a post worth reading) and in the professional press (in French!), denying French Canadians such visibility has done more for the sovereignty movement of Québec than the current leaders of the movement themselves. And that’s quite a job, considering the health of the movement at the moment (the leading party not being the ruling government for 7 years now).

This is also reminiscent of West-East frictions.  The (mostly English) West feels bilingualism is being wrongly imposed on them. They feel too much power is given to the central provinces (where 60 % of the population lives).  They probably also feel (rightfully) they are paying for our social wealth services considering the thriving west economy of tar sands and, I have to admit, their just efficient administrations.  Those frictions may never disappear, after all British Colombia was almost part of the United States of America if it were not of the Canadian rails built in 1870s.  My point of view on the subject is that parts of Canada and United States are being unnecessarily separated on political reasons.  Vancouver’s economy is probably more active with Seattle’s than the rest of Canada.  The same applies with the province of Québec and state of New York.  Politically enforcing an horizontal relationship where the natural flow of business is vertical.  This argument has been mentioned in the latest High Speed Trains plans of Québec–Windsor and Montréal–New York.  I am going to stop here but this could lead to interesting debates on history and politics. :)

In conclusion, just don’t forget we still exist.  We have a thriving musical culture (among other) as you can see here, here, here and here (my personal favourite local artists these years).  Its absence from the Olympics is an anecdotal abnormality.

3 February 2010

My upcoming talks at Confoo.ca

After touring FOSS events all around the world, I decided to see what’s happening on the local software scene.  I met with the guys from Montreal-Python, the Ubuntu Québec local team guys (after all Montréal is the home of Canonical’s Global Support Services) and the local start-ups at DemoCamp.

confoo.ca Web Techno ConferenceThey convinced me I should give a talk at Confoo.ca.  In fact I decided to submit 2 talks and both were accepted.  Confoo.ca is a new conference building on the famous PhpQuébec conferences but gathering much more communities together: .Net, Python, Ruby and Web developers. The conference will cover technical topics as well as project management, marketing and social medias.

Based on my personal knowledge and the experiments I’ve been doing lately with Web + Desktop apps combinations, I’ve submitted the following talks.

Django + RESTful APIs as an application server

Application servers are the central part of data applications. They are responsible for mission critical activities of businesses and yet have to be cost effective. Django offers a lot of flexibility by providing rapid application development. Django-piston makes it easy to add RESTful APIs to existing Django apps. Web servers are very common and rather cheap to rent or host in house.

Once your application has a RESTful API, nothing is keeping desktop applications to access your web services. For example, using librest on the desktop, Emerillon accesses on-line databases such as Geonames. Librest simplifies accessing RESTful web services and makes parsing XML fun again (that’s a Robert Bradford quote if I am not mistaken).

Introduction to OpenStreetMap and how to use it

When thinking of online maps, Google Maps is often mentioned as a reference. But you can’t use their data in all the exciting ways you could ever imagine. Enters OpenStreetMap: community built openly licensed map data. You are virtually free to do anything with the data, short of not giving proper attribution of its origins.

With this gained freedom, you can explore and create unique maps adjusted to your needs. You can also simply reuse the default one available on OpenStreetMap.org, in some locations it is way more complete than any other maps anyway.

Come and attend Confoo.ca!

29 January 2010

MapBuddy 0.2, libchamplain 0.4.4 and 0.5

What a big release week!

First, a quick update to MapBuddy:

  • Translations (French, Spanish, German, Swedish, Polish, Slovak)
  • A “Add to addressbook” button on merchant’s window (with the help of Jonathon Jongsma)
  • A precision circle is drawn around your position
  • Kinetic scrolling is turned on

Then, a bigger update for libchamplain 0.4.4:

  • API clean up (with API backward compatibility): champlain_view_set_size should have never existed
  • Fix to make Python bindings work out of the tarballs!
  • Use shared paths by all tiles consumers on Maemo devices to store tiles (saves bandwidth)
  • Load tiles in a spiral manner from the centre (thanks to Jason Woofenden)
  • Optimizations resulting in
    • Faster start-up
    • Smoother scrolling
    • Energy savings (by doing less computations)

Then, a huge update for libchamplain 0.5:

  • First development release with new APIs:
    • Local map rendering (Google Summer of Code of Simon Wenner)
    • New Map Source mechanism à la Pipe and Filter (Jiří Techet)
20 January 2010

J’ai invité Clutter pour Noël

C’est maintenant une tradition établie pour les réveillons de Noël du côté de ma mère: on se rassemble tous pour un bon repas de mets traditionnels, on échange les cadeaux et on joue à un jeu. Mais pas n’importe quel jeu, un jeu fait maison créé pour cette occasion unique. Par exemple, ces 2 dernières années nous avons joué à une version de Serpent et échelles géante et une adaptation du Banquier.

Le jeu de Serpents et échelles de 2008 (notez que l'échelle fait 20 cm!)

Le jeu de Serpents et échelles de 2008 (notez que l'échelle fait 20 cm!)

Mais 2009 était une année spéciale, j’allais être l’hôte du réveillon. J’allais avoir à bâtir un jeu pour l’occasion. Ma mère est créative et aime bricoler mais ce n’est pas tant mon cas. J’ai donc décidé de créer un jeu à l’ordinateur. Noël de fortune était né.

Écran de démarrage du jeu

Écran de démarrage du jeu

Après consultation avec mon cohôte, nous avons établi les règles de base du jeu: ce serait un jeu avec tours où chaque joueur doit deviner une expression. Le joueur pourra nommer des lettres et elles seront révélées dans l’expression. Si la lettre n’est pas dans l’expression, il perd un point et c’est au prochain joueur de jouer. Le joueur peut également essayer de résoudre, mais s’il échoue il perdra 5 points. Chaque joueur a sa propre expression à deviner. Lorsqu’un joueur trouve son expression, il a droit à un cadeau. Il y aura 3 manches. Pour aider les joueurs, l’alphabet sera affiché en haut de l’écran et les lettres déjà nommées seront identifiées pendant la première manche, seulement les lettres nommées seront affichées pendant la 2e manche alors que rien ne sera affiché pour la dernière manche. C’est une augmentation du niveau de difficulté. Le joueur qui aura trouvé ses expressions avec le moins d’essais aura un cadeau supplémentaire à la fin du jeu. Ces règles vous rappellent peut-être La roue de fortune ou le bonhomme pendu.

Pendant le jeu

Pendant le jeu

Nous avons trouvé plus de 400 expressions pour le jeu afin que nous puissions prendre part au jeu avec toute la famille. Il y a eu 3 thèmes, un par manche: Noël, Chose à faire, Personnalités connues. Sans surprise, le premier thème a été très facile mais les 2 derniers plus difficiles.

Pour créer le jeu, j’ai décidé d’y aller avec Python puisque je voulais un langage de programmation avec des structures de base de haut niveau comme des ensembles, listes et dictionnaires. Ces dernières se sont avérées très utiles pour l’implémentation. Un jeu doit être excitant visuellement et puisque je m’y connais déjà en Clutter, ça aurait été un choix qui va de soi. Le graphisme est plutôt simple: tout est une image (à l’exception du texte!) qui est animée avec Clutter. Lorsqu’un joueur nomme une lettre, toutes les cartes sont animées comme si quelque chose passait sous elles et elles tournent si la lettre correspond. Un son magique est aussi entendu! S’il y a une erreur (lettre déjà nommée, lettre pas dans le mot), une boîte de dialogue s’affiche. Lorsque la manche est terminée, le pointage est affiché tel un diagramme à bandes qui s’affichent une à une (pour ajouter de la tension).

L'écran de solution

L'écran de solution

L'écran de solution erronée

L'écran de solution erronée

L'écran de pointage (données simulées ;-)

L'écran de pointage (données simulées ;-)

Cela m’aura pris bien au delà de 80 heures pour créer le jeu. En tout et partout, ça aura été un grand succès :) Nos invités l’ont trouvé original et la partie a duré des heures.

Gabriel explique les règles. Vous pouvez voir les cadeaux dans les bibliothèques.

Gabriel explique les règles. Vous pouvez voir les cadeaux dans les bibliothèques.

Je ne rendrai pas le code de ce jeu libre. Pour être franc, le code n’est pas exemplaire: c’était mon premier jeu, ma première application Python à partir de rien et à la fin, je ne faisais que corriger bêtement les bugs sans corriger les problèmes de fond. Mais bon, il fonctionne. Je suis sûr qu’il y a des applications fermées pire que ça.

La plupart des images proviennent d’images disponibles sous licence Creative Commons comme le fond d’écran. Malheureusement, j’ai mal fait mon travail et je n’ai pas gardé le nom de l’auteur ou le lien de la page où j’ai trouvé les bordures utilisées partout dans le jeu. Si vous le trouvez, je le lierai!

Ah! En passant, puisque ma mère avait beaucoup de temps libre (n’ayant pas à créer un jeu cette année), elle s’est investie dans l’emballage des cadeaux. Avez-vous déjà reçu un cadeau emballé comme une bûche de Noël? ou dans le tambourin de l’enfant au tambour? :)

Mon cadeau était emballé à la manière d'une bûche de Noël.  Je l'ai mérité pour avoir trouvé le mot Ragoût de boulettes.

Mon cadeau était emballé à la manière d'une bûche de Noël. Je l'ai mérité pour avoir trouvé le mot Ragoût de boulettes.

I invited Clutter for Christmas

It’s now an established tradition at my mother’s Christmas Eve party, we all gather for a good meal, exchange gifts and then play a game. Not any game, an home made game built for this occasion only. For example, in the last 2 years, we played a giant Snakes and ladders game on my mom’s wall and an adaptation of Deal or No Deal. During the game, each player wins little gifts. Usually the games include special rules so that everyone finishes with the same amount of gifts.

The Snakes and Lader game of 2008

The Snakes and Ladders game of 2008 (the ladder is 20 cm long)

But 2009 was special. I was going to host the party. I was going to be the one to build a game for this occasion. My mother is creative and resourceful when comes the time to use whatever materials are at hand, but I am not. I decided to build a computer game instead! Noël de fortune was born.

Splash Screen of the game

Splash screen of the game

After consulting with my co-host, we elaborated the basic rules of the game: a turn-based game where players have to guess an expression. They would be able to give letters that would then be revealed. If the letter is not in the expression, the player loses one point and it is then to the next player to play. The players can try to solve but if they fail it costs them 5 points. Each player have their own expression to find. When he finds his expression, he wins a gift. There should be 3 rounds. To help the players, during the first round the whole alphabet is displayed with the letters he already said highlighted. During the second round, only the given letters are displayed, and nothing during the last round. It makes it harder :) The player who finds his expression with the less tries wins an extra gift at the end of the game. These rules probably remind you of The Wheel of Fortune without the wheel, or of Hangman.

During the game

During the game

We built a list of 400 possible expressions for the game so that we could also play with everyone. There were 3 themes, one per round: Christmas, Things to do and Famous People. Not unexpectedly, the first theme was quite easy to guess, but the 2 others were more challenging.

To create the game, I decided to go with Python as I wanted to have a language with rich built-in types such as lists, sets and dictionaries. They came handy in the implementation. A game has to be exciting to the eye and considering I already had a fair amount of experience with Clutter, it was an obvious choice. The graphics are simple: everything is an image (except text!) and is animated using Clutter. When the player says a letter, all the cards bounce as if something passed under to read them and they turn around if the letter matches. A nice magic sound is played out. There are error dialogs (the letter was previously given or the letter is not found) and solution dialogs too! When the turn is over, the score is displayed using vertical bars that show up one by one (adding a little stress hehe).

The solution dialog

The solution dialog

The bad solution dialog

The bad solution dialog

The points screen

The score screen (not actual game scores ;-)

It took quite over 80 hours to create the game. Overall, it was a great success :) Our guests liked it and fun lasted for hours!

Gabriel explaining the rules

Gabriel explaining the rules. You can see all the gifts surrounding the LCD screen.

I will not be releasing the game. Quite honestly, the code is a mess: it was my first game, my first Python application from scratch and in the end I was just fixing bugs without fixing core issues. But hey it works: I am sure there are worst proprietary apps out there :)

Some of the graphics are composed of images available under Creative Common such as the background. Unfortunately, I did a lazy job keeping track of my sources and I lost the link/name of the author of the nice graphics I used. If you find it, I’ll link it!

Oh by the way, since my mom got her hands free of creating a game, she invested herself in the packaging of the gifts. Has anyone of your ever received a gift wrapped like a Bûche de Noël or a drummer boy’s drum? :)

My gift was wrapped like a Bûche de Noël. I won this gift by finding the word "meat ball stew".

13 January 2010

OpenStreetMap mappers band to improve Haiti’s map

In order to help people, free and widely available maps are a good tool to rescue parties.  Many users of OpenStreetMap have organized a wiki page to manage the work that needs to be done to quickly improve OpenStreetMap for this part of the world. Thankfully, Yahoo has high resolution imagery of the region making it possible to trace the streets.  Note: remember that only Yahoo imagery can be used, as OpenStreetMap has a signed derivative work permission with Yahoo.

If you know how to edit maps, maybe you can land a hand! CrisisCommon also has other resources.

Follow-up: Mikel Maron has before and after images along with more info.

Slippy Map

12 January 2010

One more map app for the N900

Well, I finaly got my hands on a N900 (given as a Christmas gift by Collabora to Gabriel).  This gave me the occasion to observe first hand that the Ovi Maps, while having a lot of features, is slow and that the Hildon Emerillon port is less than perfect.  It is hard to use with fingers and feels alien to the platform.

To solve this, I created Map Buddy: a map application specifically designed for Maemo 5.  It is quite simple to use and works out of the box (no configuration or selection of plug-ins required!).  It also has something other apps don’t: it uses web-services to provide business search capabilities.

Here’s the use case I built Map Buddy upon: you just arrived in Montréal and want to find a sushi restaurant.

  1. You start Map Buddy, it will be centred on the place you closed Map Buddy on.  You can click on the “Center on me” icon on the bottom left, and it will centre the map on Montréal ‒ remember you are in Montréal for this example! By the way, your position is marked by a blue dot. Later version will display the precision too.
  2. To search for businesses, you have to switch in business search mode, tap on the magnifying glass to do so.
  3. Enter sushi in the search bar and press enter! The map will be populated with markers representing the places tagged with sushi (powered by Praized Media, a Montréal start-up).
  4. To get the name of the place, tap once on the marker.
  5. To get the complete details about a place, tap once on the name: a new window will be opened with the business’ address, phone number and web site if available.  Map Buddy even provides a call button!
  6. To clear the search results, tap on the trash can in the search bar or do a new search.

It’s that simple!

Map Buddy includes a place search so that if you are looking for Pizza in New York, you don’t have to scroll from San Francisco to New York to get there.  Select the Place search mode, enter New York in the search field and press enter.  A picker dialog will be opened to let you select the correct New York.

To switch to other maps, click on the layer icon, it will bring up the list of possible maps to display.

I hope you like it!  Try it today! WARNING: Installing Map Buddy in this early stage requires adding the extras-devel repository which might install unstable software on your device.  Try it at your own risk or if you are a professional ;-)

NB: Praized Media only has strong data sets for Canada and United States.  They plan to sign business partnerships to get data for Europe in 2010.  In the mean time, you can directly add businesses using this form.

NB: Help is appreciated to translate it!

4 January 2010

Can you spot what’s new?

Yes! Libchamplain now has a scale! It was long overdue. In fact, I first started to work on it way before libchamplain 0.2.2 was even released (1.25 year ago). It got impeded by more important features and bug fixes. Two or three months ago Tollef Fog Heen took over the branch and added the magic required maths to compute the scale. I then took over his work (as he was quite busy and I wanted this too) to provide the final result.

Since all the changes are backward compatible, I’ll soon release a libchamplain 0.4.3 with the scale disabled by default (to ensure the same visual behaviour as before upgrade). To display a scale, an application just has to change the show-scale property to TRUE.

g_object_set (champlain_view, "show-scale", TRUE, NULL);

The scale also supports other exotic units than the SI/metric ones. It can display miles and feet, if you’re into that. :) By the way, the scale will automatically switch from kilometres to metres when it makes more sense. That was quite more complex to do with miles and feet as they are not simply a power of 10. Set the scale-unit property to CHAMPLAIN_UNIT_MILES to get miles.

You can limit the width (in pixels) of the scale with the max-scale-width property.  If you watch closely, the scale will adjust itself right away when you move the map.