New Toy!

5800This summer, just a week before going to Brasil, I received a new gadget (I prefer to call them Toy’s). The Nokia 5800 Xpress Music.

I love it! Really, it joins together the kind of functionality you’d like in a mobile device. It has a few drawbacks which I can imagine more advanced and experienced smart-phone users miss. However for me, as the first phone with a camera on it (..!!..) I love it!

PRO’s

  • WiFi
  • GPS
  • 3.2 mp Camera + Low res camera for video calls (if you do any ?)
  • position sensor (screen rotates as you rotate the phone)
  • Easy to extend, make your own apps and widgets
  • Quite long battery life

CON’s

  • No keyboard (on screen keyboard works fine though)
  • GPS is slow, assisted GPS uses a GPRS carrier making it very expensive (believe me! I was roaming in Brasil and forgot to switch that off :S )
  • 3.2 mp Camera is considered low res for some people nowadays’
  • Not too many free applications to download
  • Menu’s too static, no real (android) desktop feeling

Im really impressed! I have seen the iPhone, and thought it was too big. The blackberries…, I simply find they have too much of the “Business Flavour” and are just boring (sorry!?). The only phone I actually had in my hand and can be seen as serious competition, is the HTC Touch running the Android OS. I liked the Desktop idea I miss a bit on the 5800. This all, looking at the low cost range of course!

I already built a small application for it, a rip of the iPhone mosquito repellant. If you’re interested, drop me a comment, and I can send you a copy.

La Quiniela – Excel Data Import

Football (yes, soccer in countries where it is hardly played ;) is big in Barcelona. Really big! I have always enjoyed watching football games, but nothing like I’m now, here with FC Barcelona! Especially this season is spectacular. I also started, together with my girlfriend placing bets or “doing the quiniela”.

The quiniela you play by predicting the outcome of 15 games played, mixing 1st and second division games. You either bet on 1, X or 2. hometeam losing, equalled or lost. this is how the form looks like:

quiniela1I wont explain how it works, it is far too complex, and even after many years here, I have still not discovered them all.The idea is that I play with my girlfriend(who luckily likes football too) and this gives us a tiny bit of football thrill in the weekend. A few weeks ago I started to look and see if I could make this in an excel sheet, so I can have a view on how the games are going on each goal scored.

This excel sheet started out very simple. I would manually copy my bets, and enter the scores every time I heard “gooooooool” on tv, or checked using teletext(a technology with no reason to exist). Then, after a while, basically because one weekend we where late, filled in the sheet, and did not get to the betting office on time, I filed my bets on line.

Sometimes, when you live in spain, you expect certain things to either not work, or not work well. This was not the case,  and I found the spanish betting website to be very practical. It lets me fill in the exact same form, by ticking the boxes.

(If the Internet was not partly blocked here I would have had a screen shot…. Somehow they do not see betting as a work related activity…)

After validating the bet you get your bet presented on your screen like the ticket you get in the Betting office. a text overly on the image of the ticket, basically like this:

1    1    1    1    X     X
2    2    X     2    1    2
3    1    1    1    1    2
4    1    1    1    1    1
5    X     X     1    1    1
6    1    X     1    X     X
7    X     1    1    1    1
8    1    X     1    X     X
9    2    2    X     1    2
10    1    X     1    2    2
11    1    2    2    2    1
12    2    X     2    X     X
13    X     2    2    1    1
14    1    1    1    1    1
15    X

I copy pasted this in excel and one part of my excel sheet was already a bit automated (there was no more need to manually get the bets in) This made me think about a fully automated one, that would display the live scores and display the cells with the bets color-coded, and at the bottom the total amount of winning bets. Here is where the problems started. The color coding was pretty easy with excels’ conditional formatting. With a few IF functions this was starting to look good:myquini

The yellow column is the game status changing when I started entering the results. The blue cells are my bets, changing colour when games are playing according to the live result.

I use Office 2007 at work, and at home. When I browsed around in excel, I found how easy they made the data import! getting the data from a text file where I saved my bets was a 2 minute job.

I also discovered the get data from web functionality. I started playing with to find out if I could get the live results from some website, and use this to refresh my sheet each minute. This was not as easy as I thought. It would be, if the websites would update their data each minute, but I guess it is hard to find a volunteer to go to the office on Sunday morning to cover just 1 second division game. The only Live source I found was … TVE Teletext:(

If you check the link, you’ll see their page has exactly what I needed, and on top of that it is updated almost by the minute. The only but… is that they present it as an image!!

That made me have a more thorough look at the page. after looking at the source code, I saw that the alt tag of the image contains all the data. Ready to be extracted!

<img id=“FABTTXImage” src=“210_0001.png” width=480 height=336 usemap=“#210_0001″ border=0 alt=“210.1 Q U I N I E L A tve Jornada 40 22 MAR 2009 1 Getafe C F -Rec Huelva 1 FINAL 2 Sevilla -Valladolid 1 FINAL 3 Barcelona -Málaga 1 FINAL 4 Real Madrid-Almería 1 FINAL 5 Villarreal -Athletic 1 FINAL 6 Mallorca -At. Madrid 1 FINAL 7 Osasuna -Espanyol 1 FINAL 8 Deportivo -Betis X FINAL 9 Numancia -Sp de Gijon 1 FINAL 10 Elche -Hércules X FINAL 11 Murcia -Alavés 1 FINAL 12 R.Sociedad -Girona 1 FINAL 13 Salamanca -Tenerife 2 FINAL 14 Albacete -Huesca 2 FINAL 15 Racing -Valencia 2 FINAL 15 25 55.295,44 12 23,31 14 88 18.850,72 11 3,60 13 3874 285,47 10 1,00 CUENTA NARANJA 3,5% TAE 4 MESES.553″>

Great I thought. I am still playing with my Google maps page, and was already learning quite a lot of javascript with that, so this was a perfect chance to keep learning. I used the PHP include to get all the pages code, and then made a small (java)script that reads the HTML code, then with a few regular expressions, it displays an html table with the live results.

<html><head>
<script type=”text/javascript” src=”jquery-1.3.2.js”></script>
</head>
<body>

<?php Include (“http://www.rtve.es/tve/teletexto/200/210_0001.htm”);?>

<TABLE border =”1″>

<TR><TD>Results</TD></TR>

<script type=”text/javascript”>

var page210, page210New, page210Res;

// get the alt text of the image in a variable

var page210 = document.getElementById(“FABTTXImage”).getAttribute(“alt”);

// remove first part

remove = “210.1 Q U I N I E L A tve Jornada “;

page210noIntro = page210.replace(remove, “”);

// Take date off

page210noYear = page210noIntro.replace(/\d{2}\s\d{2}\s\w{3}\s\d{4}\s/,”");

// should be the line to extract score and status

page210Res = page210noYear.match(/(\s(-|1|X|2)\s(FINAL|-)\s)/g);

// Build the table

// start a for loop to run through the elemnts of the array

for (i=0;i<page210Res.length;i++){

// write a row for each entry

document.write(‘<TR><TD>’ + page210Res[i] + ‘</TD></TR>’)}

</script></TABLE></body></html>

This did the job fine, If you like have a look.

When I tried to import this into excel, all went pear-shaped! Excel could only read the first line of the table and nothing else. AAARRGHHH!!! was my first reaction, until I thought about it. Excel might have problems with client side javascript. Don’t ask me why, but that was my first thought.

(It could have been anything to be honest, maybe even some security setting in Excel!)

Again, I was sat back a bit. The next and last thing I wanted to try, I sto do the same thing completely in PHP. As this is a server-side language, I thought that excel must be able to render its contents.

This is the PHP script I wrote:

$page = “http://www.rtve.es/tve/teletexto/200/210_0001.htm”;

// read from where to where

$start = ‘alt=”210′;

$end = ‘>’;

// open the page

$fp = fopen( $page, ‘r’ );

$cont = “”;

// read the contents

while( !feof( $fp ) ) {

$buf = trim( fgets( $fp, 4096 ) );

$cont .= $buf;

}

// get html contents

preg_match( “/$start(.*)$end/s”, $cont, $match );


// tag contents

$contents = $match[ 1 ];

//Start stripping text
$remove = ‘/.1 Q U I N I E L A tve Jornada /’;
$replacement = ”;
$contents = preg_replace($remove, $replacement, $contents);
$remDate = ‘/\d{2}\s\d{2}\s\w{3}\s\d{4}\s/’;
$contents = preg_replace($remDate, $replacement, $contents);
$addBR = ‘/\s(-|1|X|2)\s(FINAL|-|1ºT|2ºT|DES)\s/’;
preg_match_all($addBR, $contents, $array, PREG_SET_ORDER);
$count = count($array);

echo “<font face=’arial’ size=’8′>”;
echo “<table border=’1′ width=’250′>”;
echo “<tr><td width=’125′><B>Resultado</B></td><td width=’125′><B>Status</B></td></TR>”;
for($i = 0; $i <= $count; $i = $i + 1)
{
echo “<tr><td>{$array[$i][1]}</td><td>{$array[$i][2]}</td></TR>”;
}
echo “</table>”;

I’m sure that I can reduce a lot of code here and merge a few regular expressions. Maybe, Maybe not.

To my big surprise it did. It rendered the table very nicely, without the ugly include I needed with the previous solution. And best of all, I could import the data directly in excel!

Job Done, Mission accomplished. Last weekend was the first test and we both enjoyed watching the “minuto y resultado“  television show, with the excel sheet on the side updating itself every minute, and showing us how each goal influences our bets. Really nice.

(by the way, I play now for over 6 years , and managed to win 20€ once!)

EDIT: I believe that I can automate the import of my bets a little bit more. Maybe a button in firefox, that saves the bets to the text file…. To be continued…

Google Maps – My First Map-App Part 2

Well, after a few days of playing with the Google map code, I really started to understand how it worked. I have managed to add most of the things I wanted and I am now at the stage of removing some errors or mistakes I made. Also I am wondering how I can add a layer on which users can plot their own bicycle routes. This would be very nice, because this way it will have different uses for different visitors.

The to do list from the previous post tuned into:

  • Change the icons. Especially the one that locates me.
  • See if it is possible to obtain the xml stream from Bicing, and add all the stations to my map.
  • Add info balloons for the Bicing stations, showing information about the free slots, and remaining bicycles.
  • Add an overlay with all Barcelona cycling lanes. (you can only find big PDF maps with them, since there are only a few cycling lanes in Barcelona I decided to make my own overlay for that.
  • Add an overlay with nice (touristic) cycling routes.
  • Add user layer, I would like all visitors with a Google account to be able to add and save their routes to this map.
  • load general map when location is not found (now showing grey screen)
  • add message when (part of the) page is loading

I have had quite some positive reactions on this idea. People who have seen it generally like it a lot. As soon as I’m done Ill make sure the link is available!

Killer Game

producto_pobrefredThe last couple of months, I was involved in a violent spree of killing in my office. We launched a cluedo-type killing game with about 90 employees and with an Asus 4G 701 eee-pc as the main prize.

To be very honest, it was a lot of fun. Also quite some paranoia, and in general I believe this game caused an increase in productivity (as your desk was one of the few places you could not be killed).

I teamed up with a  friend, and we made a deal. She really needed the eee pc, as her laptop was broken. Because she’d use it mainly for watching m0vies, and facebooking I offered her a deal. I would fix and upgrade her laptop, and I’d get the eee pc. She took the deal (’cause she’s my friend, or ’cause its a good deal) and we started the game.

This is the Story:

clip_image001ISC KILLER – The Santiago Nasar Story


The nickname I used in the game explains how my expectations where set:

El día en que lo iban a matar, Santiago Nasar se levantó a las 5:30 de la mañana para esperar…

Since I did not expect to stay a live much more than one day, I decided to take the name from Santiago Nasar, the main character from a book. The book he’s from (Crónica de una Muerte Anunciada – Gabriel García Márquez) starts with the above phrase. “Appropriate“, I thought.

The first round went smooth…. My first kill did not take too long; she fell on the second day of the game. What I did not know by then, is the importance of my next action (or the lack of it).

The plan was good. I would let my victim alive and watch how people start dying (as I knew she was good) and on the last day of the first round I would finish her off.

As I said, the plan was good, but even a perfect assassin makes mistakes. The Friday the first round ended, I went to work a bit early (I know, strange, but then again, there is a reward at the end) and had my weapon (a balloon prepared. What I did not knew is that my victim would be in a training the whole morning!

It was obvious I was unable to kill twice in the first round, which left me with the idea I was removed from the game.

Right after the first round, I went for a two week Christmas holiday. Relaxed and without any fear when turning corners.

When I came back from my days off, I was convinced I was not in the game anymore, and I was quite happy to find out I still was. This made me decide to take it a bit more seriously and start killing…

I used my twitter feed (http://twitter.com/alexkbcn) to log the rest of the game, this would help me to talk less about it (which is helpful in this game) and have people follow what’s going on. Resuming:

clip_image001ISC Killer game, a assassination Game we play in our office just entered the second round!…. guess what.. I’m still in! Santiago Nasar 1:44 AM Jan 13th.

clip_image001 One victim down! 1:44 AM Jan 13th.

clip_image001ok second victim just dropped….. 15 to go! 11:16 PM Jan 13th.

clip_image001received name of next victim. Don’t know the guy and I’m not sure if that makes it easier or more difficult 1:40 AM Jan 14th.

clip_image001ok, found a picture of the guy 5:42 AM Jan 19th.

clip_image001got a spy on him now, hope to get him today!! 4:02 AM Jan 20th.

clip_image001got tipped that he was leaving… followed the poor guy down, and … Paf! Dead by a Beach-Towel! 5:42 AM Jan 20th.

clip_image001 aiaiai! got my next victim… he/she is a bit too close and I’m not sure whether  to use a spy in this case. 6:46 AM Jan 20th.

clip_image001… kill someone with a Santa Claus hat??!! 6:48 AM Jan 20th.

clip_image001 looking around the office for a Santa hat.. 6:52 AM Jan 20th.

clip_image001 Santa hat located 12:41 AM Jan 21st.

clip_image001 Santa hat in the bag, and awaiting my chance. 5:43 AM Jan 21st.

clip_image001where is my victims’ schedule? 12:35 AM Jan 22nd.

clip_image001almost got killed yesterday! almost!! :) Yesterday evening, about to leave, I found a guy waiting suspiciously at the door of the office 12:36 AM Jan 22nd.

clip_image001Monday! 3 people left in the game 9:11 PM Feb 1st.

clip_image001almost got killed yesterday! almost!! :) Yesterday evening, about to leave, I found a guy waiting suspiciously at the door of the office 12:36 AM Jan 22nd.

clip_image001so we called that one… “doing overtime” 12:37 AM Jan 22nd.

clip_image001followed my victim out for a cigarette yesterday evening…. when leaving the room… Bang!! number 4 down. 10:50 PM Jan 22nd.

clip_image001 awaiting message with new victim. 10:50 PM Jan 22nd.

clip_image001 new victim received…. Have to kill him/her on a different floor, with a BIBLE!! 12:35 AM Jan 23rd.

clip_image001new victim! couldn’t get any worse… it’s the guy sitting next to me!?! 10:59 PM Jan 27th.

clip_image001weapon to use: A monopoly Board! that will be tough, as none of the expats I work with brought their monopoly boards along to Spain! 11:00 PM Jan 27th.

clip_image001cutting pasting a printed monopoly board now. 12:36 AM Jan 28th.

clip_image001where can I get a Monopoly Board?? (without paying for it obviously)… after all, I’m still Dutch! 5:54 AM Jan 29th.

clip_image001 ok monopoly board located… I LOVE TWITTER!!! 6:52 AM Jan 29th.

clip_image001Monday! 3 people left in the game 9:11 PM Feb 1st.

clip_image001 ok 2 people left! Waited for my victim in the staircase for over an hour!! Worth the wile though! 1:42 AM Feb 2nd.

clip_image001 managed to agree on a cease-fire for today… both me, and the last killer left need a break! 1:43 AM Feb 2nd.

clip_image001soooo nice when there is no need to worry! 6:27 AM Feb 2nd.

clip_image001 ok, tomorrow the game will end.. (I hope) 7:13 AM Feb 2nd.

clip_image001 spent my morning waiting in a staircase, only to find out my victim already passed-by. Better luck next time 10:29 PM Feb 2nd.

clip_image001 arghh, my victim came in 3 minutes before me!! all the waiting for nothing 4:27 AM Feb 3rd.

clip_image001 now working from a different floor, as my killer is posting in front of my office. 4:27 AM Feb 3rd.

clip_image001 jeeez, she’s patient 4:31 AM Feb 3rd.

clip_image001 had a long wait this morning! after one hour she came in and escaped me through the stairs…. Bad luck again! 12:22 AM Feb 4th.

clip_image001Yesterday, my absence at my desk, even though everyone knew where I was, caused a huge problem!! 12:24 AM Feb 4th.

clip_image001 ..and this problem yesterday made me decide to give up. After my long wait this morning, I asked my killer if she could make an end to it. 12:25 AM Feb 4th.

clip_image001and she just did. 12:25 AM Feb 4th.

clip_image001Último momento, Santiago Nasar a muerto” 12:26 AM Feb 4th.

Fon-Tastic! – update

unfonnedWell, today (actually my last day before x-mas leave… ;) ) in the office we did quite a lot of testing (since we also did quite a lot of drinking afterwards, I will not be able to tell what we exactly did;)

I found however, that the DD-WRT firmeware for the fonera (now using V 24 SP1) is a bit different then DD_WRT for other routers. My friend MF who uses DD-WRT on a netgear router saw that with the fonera it is not possible to put the router in repeater mode. (this is what he uses to make the router act as a repeater… duh!!).

This made us think it would be impossible to make the router repeat the wireless signal to wireless and the we would need to be physically connected (cable) to the router to be able to connect to our “distant” accesspoint”.

We then did some tests using the different modes to be able to make the router repeat the signal of the access point it was connected to, while we where both connected though a wireless virtual interface.

This works now and I have set this up at home. It works great! My router connects to a router closeby, but not close enough for my laptop IPW3945 Wireless card to pick it up. I have attached a windsurfer homemade antenna pointing to the accesspoint which increased signal quality by allmost 20%!!!

freeantennaAs this was my end objective, Ill leave things as they are now. At least untill my friendly neighbour (offering his open ADSL connection and router access) makes a change on his router*.

Ill post some pictures of my setup soon! (…)

* He should be very thankfull, as his router would disconnect from the ISP very frequently, leaving him/us without internet for hours or sometimes days. This has been sorted now, thanks to a small script that runs on my router, pings google, and if the ping fails, runs the connect command.

Fon-Tastic! II

unfonnedWell, after a lot of experiments and configuration changes, Ive managed to bridge an open network I have close by. I’m still experimenting some issues..

Most importantly, when Bridged, I cannot find a way to connect back to the Fonera. This is a bit of a problem, as I will probably have to bridge to different access points around because they are not available all the time.(I have read about a script that automatically connects to an open access point. This, when everything is working as expected, would be a nice option).

I will now look into bridging it using a cabled connection. This way, I believe, I should be able to access both my Fonera and the Access point router.

Fon-Tastic

UPDATE: After flashing the Fon Router with the new firmware (V24 SP1) It is a lot more stable. I now have a 2.5hrs Uptime.

ddwrt11

un-fonned

unfonnedLast week, Ive been looking into the whole idea of using the La Fonera Router to extend my wireless coverage. I have changed the plan a bit, as I started learning about the new possibilities of my new La Fonera router

Since the FON hot-spot I have close by, does not reach me I have been looking into alternative solutions.

ddwrt-logo2 I found the DD-WRT firmware. Supposedly after flashing the router with this firmware, the very limited FON router turns into a highly configurable router, able to act as a wireless bridge or a repeater.

However when I started reading I quickly found that the whole subject is quite extended, not to say complex. There are many many versions of the dd-wrt firmware available, and an equally amount of way’s to “brick” your fon router. (leave it unusable… as a brick2). Consider this a warning, as I believe to have bricked it twice, and was just plain lucky to get it back again.

There are many websites that explain how to upgrade your firmware, and I wont explain the whole process here, as I think it differs a lot depending on the type of fonera router you’ve got.

I recieved a La Fonera 2201 router (fon+) and managed to upgarde the firmware finally with the explanation given here: [LINK] (I also used the firmware linked to on that site. This however, is an older version. Use the link below to get the same with SP1 included)

I managed flashing it with the the V24 firmware, and the router booted fine. Opening The DD-WRT router configuration menu gave me the feeling my laptop reconnected to a different access-point! completely different, and it actually looked like a real full-blown router.

dd-wrt

However, (not sure its due to the treatment the router received, or the old version of the firmware Ive put on) after a couple of hours of use (and after making about a thousand of undocumented configuration changes), the router keeps resetting and therefore it is not fit yet for a connection.

I have downloaded the newer version of the firmware(V24-SP1) here, and will give it a try tonight, hoping the SP 1 will fix the restart issue.

The second part of my plan did not change. When i am able to set the router up as a repeater, I am sure that with a stronger antenna, (I will probably modify my satellite dish with a can-tenna, Bas… if you’re reading this…. send me some pictures of your “vergiet-tenne”) I can repeat one of the very weak open wifi signals I receive.

For the moment, I did some tests (while the flashed router was still working fine) and the EZ12 Windsurfer, a small reflector on top of the FON router already gave me some surprising results: I could connect to the double amount of access points, and the signal of the ones I used to receive with my laptop wifi card has increased allmost a 20%! Ans that is still just inside my appartment.

I’m a fonero!

El Movimiento FonAt home, my on line experience differs by the day. I purely depend on my neighbours who have an unencrypted connection to be able to connect to the Internet.

As I am living abroad, Internet is something kind of indispensable, keeping in touch with friends, watching some dutch TV shows etc. However, the prices for Internet access are ridiculous, as is the quality.

When I first heard about FON, I decided not to sign on, and first have a look at how the project was evolving in Spain. Mainly because this country is sometimes a difficult technology adopter. However, I now checked back, after almost a year and found a lot of fon wireless hot-spots in my neighbourhood.

Since I’m a bit of a techie, and like playing/experimenting, I have now signed up. The main idea behind this is to build an antenna which Ill put up on the roof of my building. with this, I hope to be able to access the 3 hot-spots I have around my house. However, since I do not pick up the signals from within my apartment, I will try to build a directional antenna. (I could just go out and buy one … but then … where is the fun?).

When I succeed, and manage to have an always on Internet connection, I will put up a secondary antenna (omni) to share with a much larger area. This I believe is just how the fon mentality should work; Have connected people share their connection.

I have been experimenting with home build antennas a bit, and found that in an easy way you can build a pretty string antenna, or make an omnidirectional a directional antenna. With the help of Mathias, a equally techie friend, have successfully made an amplifier for my wifi USB-Stick, which increases signal by almost 10%. This gave me the confidence I needed to start this home-project.

If anyone has a good experience with a specific antenna mod, please let me know!

UPDATE: although I signed up for fon only last Friday, today my router was delivered!! this was completely unexpected as the delivery was supposed to take 3 weeks!

Some more information about fon:

http://www.fon.com/en/info/whatsFon

Check if you have hot-spots close-by:

http://maps.fon.com/

That’s all for now, more updates to follow!

movimiento fon!

Vista VS Freecom DVB-T – Part 2… The end!

Well, just to leave a quick note regarding the post about my Freecom DVB-T USB stick, I tried installing in Vista. The truth is that I have had little time to spend experimenting with this. My windows now throws an error every time I open a folder with media files (avi/mp3/etc.) But aside from that allows me to work fine. I therefore suspect that there is either a wrong dll or driver (Yakumo?) somewhere.

I believe this error is the cause of the problems I have with Windows Media Center. Ill attach the error message whe Im back home and manage to get a screen capture.

For the moment, I watch and record TV fine with the DVB-Viewer, and dont feel like troublshooting this any more.