The writings of Peter Stuifzand

Archive for January 2010

It seems a few people wrote that they wouldn't have learned to program as a kid on an iPad instead of a real computer.

The things is that no one thought this was a problem with the iPhone or the iPod Touch. People think of those as a computer, but not, as a real one. The conclusion could be this: for a device to be a computer, it needs to be programmable on the device itself.

The cool thing about a blog is, that I can publish anything that I want. If I want to favorite a video on a video sharing website, it needs to implement that for me. On my weblog I can post it just as easy.

I just read something that seems really nice. It's even strange that it isn't already used like that. Use an email address-like identifier as pointer to an account. Let me explain.

Email addresses consist of two parts seperated by an @-sign. The first part is the username, the second part is the domain name of your email provider. For example, my email address is The username is peter and the domain name is

By taking this approach of username@domain we can dream all kinds of other combinations that could work.

You see? And these could all point to all kinds of user accounts. This doesn't mean that all these addresses should be email addresses. I also don't say that they shouldn't be. For some things I would make sense, for others it maybe doesn't.

Alex Payne wrote:

If I had an iPad rather than a real computer as a kid, I'd never be a programmer today.

A ChangeThis Manifesto by Seth Godin: Brainwashed: Seven Ways to Reinvent Yourself. Interesting. Also there is an interview between Merlin and Seth on 43 Folders.

This week I'm working on an application that needs to get a list of email addresses from another application. It has the following requirements.

Requirement #1: Only HTTP+URL+HTML. No SOAP, SQL or other technologies.

Requirement #2: The list can't be cached. It needs to be updated on the moment that the information is used.

Requirement #3: Just one URL.

Requirement #4: Authentication is very important. Only programs, that are authenticated can read this information.

So, how can we create this, while keeping these requirements in mind. First I will explain what I did. Then I will show how these requirements are met.

The first program has an interface that starts a process. This process needs to have the information of the other program. So I created a place to configure an url. This url can be anything you want. The moment the first process starts, a GET request for this url is started. It parses the information on moves on to its main task.

The second program is a web application that responds on the url with a carefully selected list of information and sends it in XML format to the requester. The other thing this program does, is authenticate the request with the HTTP authentication.

Requirement #1 is the only one that I didn't quite follow, but I'm not yet happy with how this works. It could just as easy be an HTML file.

The other requirements are all met without problems. The easiest way to authenticate the client is with HTTP authentication. This is also session-less, which is great for integrating two applications.

The only thing I will probably change is the format of the response.

Pushing the boundary of Real Time Web with Twitter and XFactor:

I am glad that I was able to show how exciting node.js and WebSockets are to make real time web application.

This is a really cool realtime web application demo. Watch the video.

Mike Shaver wrote in HTML5 video and codecs:

We want to make sure that the Web experience is good for all users, present and future. I want to make sure that when a child in India or Brazil or Kenya discovers the internet, there isn’t a big piece of it (video) that they can’t afford to participate in. I want to make sure that there are no toll-booth barriers to entry for someone building a whole new browser, or bringing a browser to a whole new device or OS, or making and using tools for creating standard web content. And I want that not only altruistically, but also because I want the crazy awesome video (animation, peer-to-peer, security, etc.) ideas that will come from having more people, with more perspectives, fully participating in the internet.

Using open formats that aren't patent-encumbered is the only way to keep the web open in the past, present and future. Playing video on the web should work now and in the future. It shouldn't be the case that an organization will at some point charge money for people showing videos on the web. For example, when the current license expires at the end of 2010. That would be the GIF problem all over again. Why don't we do this the right way from the start.

A few days ago I had to create list of email addresses sorted on the domainname. All addresses with the same name should clump together. Being a Perl programmer, I quickly wanted to write a Perl script to sort this list of data. Then I tought, why not use Vim to look at the intermediate steps and do it with filtering. The following is the result.

:%!perl -pe 'm/\@([-\w]+)\./; $_="$1\#$_";'
:%!cut -d\# -f2

The first line parsed the domain from the data and pastes it in front of the orignal, seperating it with a '#'. The second line obviously sorts the new list. The final line removes the domain that I put in front. This leaves a list of the originals.

:%!perl -pe 'm/\@([-\w]+)\./; $_="$1\#$_";' | sort | cut -d\# -f2

This will do it in one line.

This article takes a look at the history of the web to find out what we need to do about video codecs.

HTML5 video and H.264 – what history tells us and why we’re standing with the web.

It seems that I can copy formatted text (including urls) from a webpage to Google Wave and the formatting doesn't change. This happened in Google Chrome.

Is this a Google Chrome feature? Or is this a Google Wave feature? Or is this jkust supposed to happen and did this already work a long time?

It's that time of year again. Some applications come and others go. This time it's gnome-terminal that goes.

The thing with rxvt-unicode is that you need to configure it to be pretty. Luckely I found a page containing nice colors and settings.

At the moment I have only tried it for a few minutes, but I already like it. Let's see how this goes.

I just realized what the big advantage is, that microformats have over other formats.

I was working on implementing the vevent microformat in my social concert calender. This was really easy. All I had to do was add some classes and some tags in special formats (most notably the ISO8601 date format).

You could say that the big advantage of this is that I only have to change a bit of markup and that it's really easy. But that is not the biggest advantage.

The advantage is that I only have to create one place with this information: one page, one url or one controller in a web application. Bots and users can both get the same page and pull the same information. Adding API support is as easy as changing the markup to match specification.

I really like the way this works.

Perl 5.11.4 is released:

This is the fifth DEVELOPMENT release in the 5.11.x series leading to a stable release of Perl 5.12.0. You can find a list of high-profile changes in this release in the file perl5114delta.pod inside the distribution.

Plack is a Perl Web Server:

Plack is the superglue interface between perl web application frameworks and web servers, just like Perl is the duct tape of the internet.

This is interesting and maybe useful in my webshop platform.

Firefox 3.6 released

If you're a developer you should take a look at the Firefox 3.6 for developers page.

Today I created this simple script that will find your local IP address or you Linux machine.

# Shows ip address of eth0
/sbin/ifconfig | awk '/^eth0/,/^$/' | awk '/inet addr/ { print $2 }' | cut -d: -f2

It uses the output of ifconfig. First it finds the part that contains the information for eth0. Then it find the line with the inet addr, which contains your IP address. At the end it cuts the line in two parts and only prints the second part.

If you want to print the IP address of another interface, then you need to change the name eth0 to that interface name.

My hypothesis is that people who are comparing iPhone to Android, actually don't want to switch. They have to find some problem, so they don't have to.

And why should they switch? I don't know. If you're happy with your phone and the way it works, you shouldn't switch. It seems they want the Android phone to be an iPhone. But it isn't. And it shouldn't try to be. It's something different.

Let's say I have this line of code

my $numbers = [ 1, 2, 3, 4, 5, 6 ];

and I want to reverse the items in the list. In Perl 5 there is this useful builtin function which does just that. There problem is, it only works on lists, not arrayrefs. If you use it on an arrayref, you will reverse the string representation of the arrayref. Which will return something like this:


This is not very useful. I think, the only way to reverse a arrayref is by dereferencing it to an array, then reverse it, and then make it an arrayref again. Something like this:

my $newarray = [ reverse @$numbers ];

This line contains synthetic code. It should be easier to reverse arrays.