Today I'm a Freelancer!

The decision was made in May and is now finally reality, the 30th of June was my official leaving date from my morning job at Internet21 and I’ve now become a fully fledged freelancer!

I’ve been working with the company since I first arrived in Madrid just over two years ago, and its been a great launch pad for discovering Madrid and the Ruby on Rails scene, and I thank everyone in the office for the great time I spent there. But now I think the right time to move onto something I’ve wanted to do for a while; free myself from timetables and work schedules decided by others and jump into the freelance bandwagon.

As part of the new lifestyle, and as a substitute from walking to an office, I’ve even started running in the mornings… a bit of a shock to the system I must say as its been 3 years since the last time I was in the habit of running in the morning. I’m optimistic the effort will pay off though.

Planetaki:http://www.planetaki.com is still my main project in the afternoons, and no doubt will continue be a for a while to come, but my focus for the mornings will be taking on smaller short-term objectives. I’ve outlined some of my intentions in the [[Profile]] section of this site.

Finally, now that I’m open for bookings, please get in touch if you think your project could benefit from a skilled Ruby on Rails developer and information architect in Madrid.

Madrid, Freelance, work.
2008-07-01 12:15 one comment

Rails: NilClass no longer extended with a < method in Rails 2.1

I discovered a strange change in Rails 2.1 today when I found a bit of faulty code that used to work in Rails 2.0. Rather than try to describe it, here’s a quick example:

planetaki@Planetaki1:/Planetaki$ ./script/console 
Loading production environment (Rails 2.0.2)
>> @x < 10
=> false

And in Rails 2.1:

sam@dell-desktop:/workspace/Planetaki$ ./script/console 
Loading development environment (Rails 2.1.0)
>> @x < 10
NoMethodError: You have a nil object when you didn't expect it!
The error occurred while evaluating nil.<
      from (irb):1

After a quick search I’ve not managed to find anything specific that would cause this in the Rails libraries, and on both systems performing the test on the standard irb console will cause an exception as expected. Very strange. Let me know if you have any ideas!

Rails, bugs, code.
2008-06-11 15:57 no comments

Big Update to Planetaki!

We’ve just made a major release for Planetaki! Its taken a lot of effort to get here and there are quite a few changes, the major two being Badge support and internationalisation support!

Click the following badge to see what happens!

I would go into more detail, but I’m rather tired after spending all afternoon getting it to work, and tomorrow we’re off to startup2.eu in Barcelona to strut Planetaki’s stuff with a few other European Startups… expect more info soon!

Finally, just in case I don’t get chance to comment beforehand, if you’re in Spain, don’t forget to acquire a copy of “El País” on Thursday. It should have a technology supplement in it and mention Planetaki!

All good stuff!

planetaki.
2008-05-20 23:14 no comments

BBC HD Free-to-air Satellite TV Service Starting

News today that the BBC and ITV has started a free-to-air satellite TV service for UK residents. According to the article:

It broadcasts 80 digital TV and radio channels including the main ones, and will rise to 200 by the end of 2008.

Users make a one-off payment for a dish, set-top box and installation, but will not pay a monthly subscription.

A quick google suggests that the service is provided by Freesat although their website still says things like “once freesat launches” so its clearly still pretty new. There is no mention yet as to which Satellite cluster they are using (although I’m guessing it will be the Astra 2D service), with a bit of luck the signal might just be strong enough to reach Spain and Madrid! (Although clearly illegal by ridiculous, outdated distribution rights.)

This is a great step for HD TV and for lessening the strong-arm of Rupert Murdock and Sky. An example for many of the other over-priced European satellite TV providers.

Satellite, TV, HD.
2008-05-06 11:04 no comments

Free Flash = Open Screen Project

A really astounding peice of news came up on my planet this morning; Adobe lifts SWF/FLV restrictions and creates Open Screen Project

Indeed, the main objectives of Adobe’s Open Screen Project appear to include the opening up of the Flash standard, and the removal of all licensing in order to support the use of Flash in set-top boxes and mobiles. The official press release clearly states their intentions.

Wow. If they go ahead with this it will really put the nail in the coffin for Microsoft’s Silverlight. My vision of Adobe finally releasing their suite of products for Linux is just a little bit closer.

flash, linux, News.
2008-05-01 10:48 no comments

When Ruby doesn't clean up after itself: tempfile leftovers

Today, Planetaki went down for a few minutes as the master reaper server ran out of hard drive space. The first thing you do when you run out of space is remain calm and try to find out whats using it all up. In this particular case where the database is the only real space user (and its not that bad) everything was fine and the log files where all within limits. It didn’t take long to figure out that the temporary directory had turned into a 30GB monster and was locking up the system.

We use the ruby open-uri library to download content from the web which stores everything it downloads in temporary files. Normally, these are supposed to be destroyed as soon as the object that is using the temp file is removed. It turns out however that these files are not destroyed correctly if the Garbage collector does not get chance to run before the program terminates.

In the case of our Planetaki backend, we are opening new sites constantly and downloading files and use forking to download from lots of feeds at the same time. The tempfile library it seems has a problem with forking, and will not correctly remove the tempory files when each instance terminates.

The solution, take the garbage out before going to bed:

spawn do
  open('http://website.com') do | f |
    # do stuff with data
  end
  GC.start
end

The “GC.start” at the end there is vital it seems to ensure your temp files don’t cause you system to run out of hard disk space.

Rails.
2008-04-15 23:16 no comments

Migrating a MySQL database from one character set to another with the same data.

My previous post on the issue of MySQL character sets addressed the problem when the data in the database has been stored incorrectly by the encoding of the connection. This time, I’d like to cover what to do when the connections are okay, but the table definitions are wrong.

Normally, this isn’t a problem, by the “rubbish in, same rubbish out” principal, whereby even though the database doesn’t understand the data as long as goes in and comes out the same there will not be a problem. This has worked for me in the past, but it turns out it doesn’t work when you start dealing with Cyrillic and symbolic languages such as Russian and Chinese. (I have yet to discover exactly why, but I suspect it has something to do with the range of the bits in UTF-8 encoding.)

Continue reading for my solution.

continue reading...

mysql, fixing.
2008-03-17 13:24 no comments

Planetaki.com - ready for thrashing

Its official, Planetaki.com is now officially ready to be broken by more than just javier and myself (amongst others)! Clearly, we are still in early Beta, and most people who glimpse at this blog probably already know about it, but this milestone nonetheless deserves recognition for the amount of effort taken to get here.

The startup wasn’t without its setbacks, indeed, there was a short period this afternoon where the site dropped to modem speed as the Ruby on Rails Mongrel servers began to gobble up all the memory and the swap space (causing thrashing). As soon as I figured out what was going on (with the help of the very helpful slicehost.com people) the server returned to acceptable response levels though I expect we’ll be doing some upgrades soon!

My Planet can be found here and you may also find this one amusing.

If you haven’t looked already, please check it out and let us know how it goes!

2008-03-06 01:20 no comments

Pixmania: Need help in Spain? Call England!

Last June we bought a 42” Toshiba LCD television from the seemingly popular online store PIXmania.com. Last November it stopped working. Initially, we made the mistake of using the guarantee with Toshiba, they picked up the TV, made us wait two months, we complained, then told us they wouldn’t repair it because we bought it from Pixmania in France and they have no legal obligation to complete the warranty. Thanks Toshiba you incompetent losers!

So, after calling Pixmania they told us to send it to their local store in Madrid, and they’ll sort it out. One month later we tried to contact them to find out what the status is. Trying to call their expensive Spanish support line resulted futile, they either just hung-up or a message came on saying they were closed. With my patience wearing thin, I decided “these guys are in France, what difference does it make what country I call from!”, so I grabbed my internet phone and proceeded to call far cheaper UK support line. They answered instantly, explained the problem precisely, and guaranteed within three weeks we’ll have the TV. They even blamed Toshiba for the delay and apologised.

There are several morals to the story here when buying over the internet:

  • Always call the store first, despite what their website says
  • Be prepared to wait
  • If the Spanish support line sucks, call the English one

At least the weathers nice here!

Spain, support, rant.
2008-03-03 17:46 no comments

The Pacman Christmas Tree

Finally, I’ve managed to find the allusive pacman christmas tree right next to the Torre Picasso here in the business district of Madrid.

Its rather cool!

(Picture taken with my mobile, so quality not so hot.)

2007-12-22 00:57 no comments

Indignation: The New Website for Mariano Rajoy

There are so many things wrong with Mariano Rajoy’s (Spanish president candidate) new website I just don’t know where to begin. Firstly though, as many readers may already know, I’ve had a lot of involvement with the PP website although not directly through one of my client companies (out of chance rather than political bias) and I can safely say we had nothing to do with this disastrous piece of work. I’d be long gone if that was the case!

As if the site couldn’t be worse, it seems the creators even forgot to protect the administration area, just insane for one of Spain’s largest political parties, and a clear sign of complete incompetence, you can almost smell the nepotism in the air.

Here’s a quick run down of what made me so sad about it:

  • Accessibility – simply not there, not even a style sheet! There is no way a visually disabled person could navigate this site. Frankly, I don’t think this should even be legal for public site of this scale.
  • Doesn’t show correctly in Firefox – layers are all messed up, and the flash uses up 100% of the CPU (due to poor looping.)
  • Dreamweaver code – see also accessibility and a sign of lazy authors.
  • Links as pop-ups – rule 101 of web programming, no pop-ups to access other parts of the same site, ever! Especially not from a Flash animation that causes Firefox to block access!

I hope the Spanish public bring attention to how unacceptable this is, it saddens me greatly.

2007-12-21 00:57 no comments

Yet Another Stupid Web 2.0 Video

I wouldn’t normally post web 2.0 video on my blog, oh no, not I, but I’m making an exception. This one is too good not to watch a couple of times!

(I’m also after some embedded flash video for testing Planetaki. ;-)

Update: Seems there were some copyright issues with the last video but it should work now hopefully.

video, web2.0.
2007-12-04 18:35 one comment

Sam Inside

Check out the cool photo! The area highlighted in red is Acute Bronchitus (as opposed to chronic), the white stuff around it, is me. Bugger.

Looks like I’ll be staying at home for a few days to come. At least I’m fortunate enough to have a job that I can do from my nice warm home without problem!

The waiting areas and general internal appearance of the “Hospital de la Paz” in Madrid leaves a lot to be desired, but the equipment they have for making these photos is very modern and seriously impressive!

medical.
2007-11-28 12:10 3 comments

Git!

Finally, I’ve given up with subversion and moved to a distributed revision control system, git. Developed initially by Linus Torvalds (who apparently named it after himself!?), git does not depend on a central location for managing changes, and instead relies on a distributed model where each “clone” of the repository is completely independent.

The reason for my move away from subversion which I’ve been using now for several years is pretty much based on frustration. I’ve found myself wanting to do more and more with revision control and subversion just started getting in the way far too much. The final straw was when I wanted to merge two separate repositories for a project with a shared base, turns out its impossible with subversion without some serious messing about.

There are several other distributed version control systems out there, some of the most popular open source versions being bizaar or Mercurial. They both look really great and have some important backers, but I decided on git on the end with its C back-end and simplicity. It really does just work and gets out your way! The only possible disadvantage is that getting it to work in Windows is complicated to say the least, but after a bit of thought I decided this is probably a benefit :-)

Version Control, git, subversion.
2007-11-26 18:46 one comment

Conferencia Rails 2007 Ponente

Apparently, I’m supposed to stick this on my blog with pride, so I have:

The title, for the less astute, means “Rails Conference 2007 Speaker”.

Badges for attendees and speakers

Rails, Conferences.
2007-11-20 10:29 one comment

Shops to buy from to fill geek play areas

After reading Javier Cañada’s interesting comments on spaces to play in (Spanish) it made me realise that having a space to chuck stuff around and invent in while you’re growing up is probably quite essential to developing those inquisitive and inventive tendencies used for the rest of your life.

I was always lucky enough while growing up to have such spaces in abundance, from huge cold garages to my father’s Motor-home factory, and large bedrooms with my first electronics do-it-yourself kits and computers. Although I don’t get to play as much any more, I still yearn to open things up and learn how they work and continue using the same inventive tendencies in my programming.

There is another factor that I think is worth mentioning, and that is culture.

I was raised in middle-class England (like most English!) where personal space is far more precious and any thoughts of living in a flat are thrown very quickly out the window. The exceptions are of course students and living in large cities where space is a premium. Spain however, is different. Here they build Russian communist style building estates in the blink of eye. I have no idea why either, its certainly not for a lack of space! I guess they’re just so used to it that its not worth building houses if the punters will buy a flat without complaining, either way, the result of this cultural difference is less-space and less independence, and it shows.

The other missing link in Spain, is the lack of what I’d call enthusiast stores. In England, we have stores like Maplin that provide for every English experimenter’s itch. Indeed, from very young I had the Maplin Catalogue close by and frequently made orders for the odd resistor or soldering iron that I need to get my project to work. I loved it.

In Spain I’ve not managed to find anything even remotely similar. There is the odd corner shop with a few bits and pieces, but nothing on the same scale, and no catalogues to flick through for the latest gadgets. Just the other week in-fact I was looking for a magnifying glass for some soldering work, Maplin of course had the perfect product, a 60W Swing Arm Magnifying Lamp, brilliant and not too expensive. My search still continues to find something similar here…

Spain, geekness, shopping.
2007-11-15 15:00 no comments

How much does a firewall rule cost?

If your answer to this question is something along the lines of “probably the time it takes to set it up, if anything” you’re probably on the same wavelength as I am. You wouldn’t however even be on the same planet as Arsys! Please allow me to explain the frustrating day I’ve had with this popular and IMHO overrated Spanish web hosting company.

At my morning job, we decided to set up our own internal Jabber server. MSN was on the blink and moving away from Microsoft is something I’m always eager to promote at any time. So, as I’ve done several times before, I began the process of configuring our dedicated server so that Ejabberd was working fine and tested using the joys of SSH port forwarding.

Arsys on all their dedicated servers provide a firewall by default, this I know, so I set the gears marching for them to open the necessary ports to allow our Jabber conversations to flow freely.

1st problem. Turns out it costs 30 euros per month for them to open these ports as they are non-standard (eh?). Its not much in relative terms, but we’re talking a single change for a few minutes of work on an already existing firewall which ends up costing a total of 324 euros over 12 months. My reaction was of course; ditch the firewall, I’ll add my own using Linux and iptables!

2nd problem. Turns out it costs 30 euros per month to deactivate the firewall! (EH?) This is really quite annoying, how is it turning something like this off has a monthly cost?! Crazy. We do have contacts in Arsys who might have been able to help us by-pass this, but for 30 euros we might look a bit silly calling the CEO. In the end we decided to swallow deeply and go with the already present firewall.

3rd problem. Turns out it costs 30 euros per month per 10 rules! (WTF!!!) Jabber needs three open ports, all incoming and outgoing, and for convenience I’d said TCP and UDP; that’s 12 rules in total. They wanted 60 euros per month for the privilege! Totally unbelievable. In the end I removed the UDP rules and stuck with 9. Clearly if we want anything else, its cheaper to ditch the firewall and as a consequence loose any slim chance of security it offers.

Poorly thought out customer support policies like this, only serve to annoy, especially when dealing with someone clue-full enough to know what a firewall really is. Lets also not forget the amount of time we spent sending emails back and forth to sort this out, and all for a few minutes of their time to make the necessary change. I feel abused.

Update: 11:54pm, Changed some of the wording and links

Arsys hate, firewalls, bad business, rant.
2007-11-14 19:54 no comments

Internationalisation is Possible!

Its official, I’m proud to announce that my talk on internationalisation in Rails has been accepted and in just under a month I’ll be on stage trying to explain some of the ways that web applications can be translated into other languages.

The approach I’m aiming for with the talk will not be too technical, and I’d like to concentrate more on the design and practical issues that need to be understood to create an internationalised application of any type. These decisions need to be made by everyone, so I’m hoping designers and developers alike will find the talk interesting.

I’m also going for a more positive approach to handling this difficult subject and convince everyone that i18n is a cause worthy of a bit of time and dedication.

Lastly, Its worth mentioning that I do not think Rails should include support for internationalisation out of the box, and I’ll explain why.

... I’d best get on and write it!

2007-10-31 13:01 2 comments

Ruby: Dates in Gettext

My contribution to supporting dates, at least half decently, in Ruby on rails using Gettext.

http://www.ruby-forum.com/topic/129944

The approach I’ve taken is designed to act as a drop-in transparent replacement for the current standard date methods. The end result is that there is no need to change any of the existing date calls as they will automatically be internationalised. There are still a few extra bits to support, such as the Rails date_select methods, which I intend to add to a GettextDate plugin as soon as possible, and after a bit more testing of this approach.

Previously, I rather naively thought that dates would be easy to support in Gettext, but it turned out that it was a bit of a black spot with no clear solution. I expect most people just ended up using Globalite, Globalize, or just used name-less strings to get around the problem.

Ruby on Rails, Internationalisation, Gettext.
2007-10-31 12:46 no comments

Skypes in Trouble!

I don’t take enjoyment from other peoples missfortunes, but I’m making an exception for this one. It looks like Ebay haven’t had quite the success they’d hoped for with Skype and have admitted to paying too much,. Not much of a surprise really, and I’d like to think that having a non-globally sustainable business model (charging for calls to a legacy system, but the new being completely free) has been part of the problem.

Why am I happy? Because I’m hopeful that this is the beginning of the end of the Skype monopoly, its closed protocol, and customer lock-in. The skype outage was just a warning sign of what happens when you depend on one single provider; 220 million people left without a phone connection, and is likely to have set many an alarm bell ringing. Who’s to say how they’ll try and make up for the losses, maybe a subscription fee? That would be popular!

Of course, this begs the question, if Skype is so rubbish, why do millions of people use it everyday? Convenience. Skype was indeed one of the first VoIP services that “just-worked”. No need to worry about cheap broadband modems or tightly controlled company networks, skype’s secret language will barge its way through all but the most stubborn of networks, tunnelling its traffic through ports normally only open to normal web page traffic and by searching for other users computers to redirect the data through.

Its an impressive hack, but is certainly not a long term solution. In the end it just hinders the development of more open, standard protocols, and the real ways the world can become better connected. The way I see it, there are two possible roads for skype; everyone accepts that skype has the market control and pay-up, or it fizzles out as the open standards become easier and better.

VoIP, Skype, Standards, Trouble.
2007-10-03 01:03 no comments