Cast for two

Sunday, August 02, 2009

Set all links target to _blank on a XHTML 1.0 Strict using jquery

As explained here, opening links in a new window is no longer possible via target=_blank in XHTML 1.0 strict. This code is a workaround using Javascript:


function externalLinks() {
if (!document.getElementsByTagName) return;
var anchors = document.getElementsByTagName("a");
for (var i=0; i<anchors.length; i++) {
var anchor = anchors[i];
if (anchor.getAttribute("href") &&
anchor.getAttribute("rel") == "external")
anchor.target = "_blank";
}
}
window.onload = externalLinks;

A link with attribute rel set to external will open in a new window:

<a rel="external" href="http://castfortwo.blogpspot.com/">cast42</a>

On the Friendfeed realtime embed code, I saw they use jquery to do the job:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.js">
<script type="text/javascript">
$("body").mousedown(function(e) {
for (var target = e.target; target; target = target.parentNode) {
if (target.tagName == "A") {
if ((document.location.href.split("#")[0] + "#") == target.href) {
return;
}
target.target = "_blank";
return;
}
}
});
</script>

The advantage is that all links will open in a new window, except if the refere to an anchor in the page. Hence there's no need to add the attribute rel to each anchor.

Tuesday, July 28, 2009

Urbain Airship: a webhook based service for Iphone 3.0 Push Notification

picture about fast internet infrastructure
This morning I discovered a new recipe on Google App Engine Cookbook to send out Iphone 3.0 Push notifications via Google App Engine. In fact, the recipe makes use of a service called Urban Airship. They provide a free service that allows to send upto 5000 Push notifications a month. For larger volumes, the price seems reasonable. Image now that all content producers become pubsubhubbub (the pseudo realtime webhook based enabled publish/subscribe protocol proposed by two Googlers) enabled and maybe we scratch the surface of the future internet architecture that will drive the realtime web. Who knows?

Monday, July 20, 2009

Pubsubhubbub: a webhook based publish/subscribe

On Friday 9 July 2009, Google engineers Brad Fitzpatrick and Brett Slatkin showed a demo of a new realtime protocol called pubsubhubbub. This new technology could lead to a more reactive, pseudo realtime web. I my humble opinion, this might be much bigger news from Google then the announcement of Chrome OS. Of course, only the latter made a big splash in the mainstream news.

The issue of messaging is a topic addressed already many times in the course of computer science. Common wisdom is that the publish-subscribe pattern is a sound solution to this. The problem is that due to all kinds of practicalities it often regresses into a polling solution. Even with pubhubsubbub, the website that want to display realtime updates has to poll the hub to check if an update has happened. So there's still a nut to crack! In the example of a subscriber, a Javascript polls the hub to check for an update.

If anybody would know an implementation of the client that does not poll, please let me know.

In the demo at Techcrunch, updates made by blogger appeared almost realtime in google reader. Currenlty, not all blogger accounts support pubsubhubbub.

To be ready when your blogger account is updated, do not forget to add your feed to Feedburner and to activate Pingshot:
enable pingshot in feedburner
A pubsubhubbub plugin for wordpress exists and the Drupal community is probably already working on it. Check the overview of publisher code for clients on the pubsubhubbub project page.

Pushed on publish post on monday 20 Juli 2009, at 10:41. Updated at 11u17

Tuesday, June 23, 2009

Spore Galactic Adventure Released in Europe, today 23 June 2009

IMG_0791
Spore Ruimteavonturen (Galactic Adventures) Picture 2
This afternoon i received a SMS that my preordered expention kit, called Galactic Adventures for the EA Spore game, was available. I picked it up for 30 euros and installed it. Everything went smooth.
IMG_0794
After a succesfull installation, we clicked on the Spore icon in the dock of the mac and prepared for the new fun....that we didn't find. Looking up the documentation and calling the EA helpdesk brought no prevail. I tried a second install. Nothing helped. Until I went looking in the installation directory Spore in the Applications directory. I saw that a new executable was there called "Spore Ruimteavonturen" (dutch for Spore Galactic Adventures). Dubbel click this new executable and of we go:
IMG_0795

Saturday, May 02, 2009

links to JPEG images in ATOM feed entries must be typed image/jpeg

After some debugging, I found a nasty bug in an ATOM feed that validated by the W3C validator service. I was trying to parse image url's out of an ATOM feed. ATOM 1.0 feeds are defined by the RFC 4287. In paragraph "4.2.7.3. The "type" Attribute" it is defined that the type must conform to the syntax of a MIME media type. The MIME media type is in turn defined by RFC 4288. Media type registrations are listed by the IANA at: http://www.iana.org/assignments/media-types/
If we look up the media subtypes of image/ we find that JPEG images have MIME type image/jpeg . The feed I was parsing had images with MIME type image/jpg instead of image/jpeg as it should have been. Apparently the W3C validator does not validate the type of links. I reported the bug/unconformence. Hopely it will be fixed soon.
A handy list with all MIME types to be used as reference is also provided by w3cschools.

Tuesday, March 17, 2009

First experiment with Imovie '09

This weekend I bought Ilife '09 for the mac. The software packet has four components : Iphoto, Imovie, Garageband and Iweb. So I played around with Imovie '09 and made a small project with my ski trip movies I shot with an Panasonic DMC-FS3. The movies are 640x480 and come in a .mov file container. The video tracks are encoded in Photo Jpeg and the audio tracks are in 8-bit unsigned mono 8KHz. The resulting movie project is uploaded to Youtube by Imovie's built in share function. Here's the result:

The soundtrack is from World of Goo. The track is "Brave Adventure" by Kyle Gabler.

I really enjoyed using Imovie'09 for this task. I works fast and intuitive. It proves that the choice to abandon the timeline is really working out for consumer oriented movie editing. Time will tell if this will also hold for professional editing. Imovie'09 has an export to Final Cut Pro (Apple professional editing program). Hence an escaped path is on board.

Thursday, March 05, 2009

Back from ski trip

Back from a skitrip in Nassfeld, Austria in Hotel Berghof with the Sporty organisation. Enjoyed good things in life.

Sunday, February 15, 2009

Sync Nokia 6124 Classic contacts with Google Sync via SyncML


I own a Nokia 6124 Classic since a few months. It's the entry model employees get from my employer. Since I work on mac, I could not sync the contacts because there is no free Isync plugin available yet. Recently, Google Sync was announced. It worked very good to sync my contactc on my Iphone with my Google contacts. I use Google Contact as my main database. Hence, I begun to wonder if I could sync my Nokia using Google Sync. Based upon the instructions from Google for another type of Nokia phone, I was able to derive a working setup. Here are the instructions:

  1. From the main menu, go to the "Settings" folder and select "Connectivity".
  2. From the Sync screen, select "Options"->"New sync profile" and enter the following:
  3. Sync profile name: Google Sync
  4. Select "Applications" then "Contacts"
  5. Include in sync: Yes
  6. Remote database: contacts
  7. Synchronisation type: Both Ways
  8. Select "Back" then "Back" then "Connection settings"
  9. Server version: 1.2
  10. Server ID: Google
  11. Data bearer: Internet
  12. Access point: Always ask
  13. Host address: https://m.google.com/syncml
  14. Port: 80
  15. Username: username@gmail.com (fill in your own username)
  16. Password: the password of your Google Account
  17. Allow sync requests: Yes
  18. Accept all sync requests: No
  19. Network authentication: No
  20. Select "Back", "Back" and then "Exit" to save the settings
  21. You have now finished the setup
To perform the sync operation, take the following steps:
  1. From the main Settings menu, select "Connectivity".
  2. From the Connectivity menu, select "Sync"'
  3. Highlight your Google Sync Profile.
  4. Select "Options" and click "Synchronise".
  5. Select your access point: Px Live (depends on your configuration)
  6. That's it. Your 6124 Classic will now connect and sync its phonebook with your Google Contacts. The contacts on your phone will appear in your google contacts and all your Google contact are stored into your phone. If you don't want this, change the value for the synchronization type set in step 7 of the setup
The synchronisation goes via Internet over the air (OTA). The next I would like to find out if i could pair the phone to my mac via Bluetooth and use the internet connection of my mac to do the synchronisation. I don't now if that possible. On the other hand, the synchronisation of my 800 contacts or so only took a few minutes, so I don't know its worth the hassle.

Sunday, January 04, 2009

Login failed for EA Spore : solution on Mac OSX

I bought the galactic version of Spore when it was released in Europe on 5 september 2008. Since then, me and my two kids of 8 and 10 years old, enjoyed playing it offline. Due to some strange reason, I could not get Spore online. The error messages were different over time but last month I got a message something was wrong with privileges. I tried to change my password but that did not help. Finally, I found "What do I do if I get the error: 'Login failed: You do not have the proper spore.com privileges'?" on the support site of EA. Unfortunately, the explanation is windows only. But after some sniffing around I found the login.prop file on OSX :
You can find the file as follows:

  1. Go to your home directory
  2. Double click on Library
  3. Double click on Preferences
  4. Double click on SPORE Preferences
  5. Double click on p_drive
  6. Double click on User
  7. Double click on Application Data
  8. Double click on Spore
  9. Double click on Preferences
  10. In this folder there will be a file login.prop, right click and delete this file and try Spore once again.
After the login.prop file was deleted, Spore asked for a new email/password/nickname combination (or you can login with you EA account). You can find our Spore creatures under the name losesi.

Happy sporing