Whoops! Something went wrong. Please try refreshing the page.

If you’re a Twitter user then chances are you’ve seen this message. Here’s a rant based on it.

The Twitter web interface allows you to take a look at older tweets in bunches of about a twenty each. And every time you want to fetch a new batch you have to click on the large “more” button. Which in turn often brings up the message features in this blog post’s title.

I’m annoyed as hell by this of course, but it also gives me the opportunity for a little analysis that will end in the conclusion: Twitter will fail (unless they take some spoons of Tech Clue and change radically, that is).

What’s behind the little error message? You can’t really say for sure what happened, but since these errors occur pretty randomly it’s probably just that their servers are very busy right now.

Plus Twitter is notoriously known for having problems with scalability. For roughly the last two years, in fact. If you ask me they must be pretty clueless about scalability issues. To my knowledge their last action to solve this was to switch to another programming language (Scala). This approach seems to be motivated more by the name of the language than the actual benefit derived from switching to it. I don’t know if they have made the switch yet or whether they changed their strategy, but chances are their scalability problems won’t be solved at all with this.

The only thing that could cure their scalability worries would be a proper protocol for distributed twittering. There are suitable and proven distributed protocols like XMPP. You know, that’s the thing the Jabber instant messaging network is built on. And Google Wave too. This is quite a clue on the ability of Wave to supersede Twitter. Instead the latter ones are wasting their time with fruitless efforts. Come on!

This is made worse by the sheer simplicity of their application. I mean, in one of my projects I’m the sole developer of a complex game application. It’s understandable that I can’t be all things for all people, and scalability is just one of many problems. But what the hell are they doing all day at Twitter? They have 29 employees right now (source: TechCrunch)! Are they all busy keeping the list of top tweets fresh, or making Excel diagrams to please their VCs?

What’s your opinion on Twitter, scalability and the future of micro-blogging?

Pianist Marcus Loeber sells rights for his new album

Pianist and composer Marcus Loeber is collecting money for the release of his album “At the very moment”.

Here’s how it works:

First you choose how much you commit to pay while listening to excerpts from Marcus’ album.

If the target price total is reached by the end of 26 December 2008, the album is released under Creative Commons BY-NC-ND and you will be charged the fee you committed to pay before.

If the price is not reached then either Marcus will release the album nevertheless or he will decide to try something else. In the latter case you won’t be charged any money.

This album is definitely worth the money not only because of the music itself but also because it’s one of the new ways to get paid for digital content.

Remember? This is one of the new ways of selling music that the music industry refuses to take serious.

Let’s show them.

And while you’re at it, grab some free music at Jamendo, too. :)

Weird release policies in PEAR land

I’m not very fond of PHP, but it’s hard to dodge it.

Fortunately the PEAR project has a set of excellent (well, as close to excellency as PHP lets you get…) libraries for all sorts of purposes.

The only thing with them is that they have problems managing their releases. The main site of the popular HTML Quickform library sports a fat warning sign, claiming that this package had been superseded by the aptly named HTML QuickForm 2 package.

That’s funny, because most if not all other packages depending on QuickForm are still built for the old version. Even more funny is what a vanilla install of the PEAR package tool will throws at anyone attempting to install QuickForm2:

% sudo pear install HTML_QuickForm2
Failed to download pear/HTML_QuickForm2 within preferred state "stable", latest release is version 0.2.0, stability "alpha", use "channel://pear.php.net/HTML_QuickForm2-0.2.0" to install
Cannot initialize 'channel://pear.php.net/HTML_QuickForm2', invalid or missing package file
Package "channel://pear.php.net/HTML_QuickForm2" is not valid
install failed

Now take into account that this situation has been in place for at least one year. Not really a role model for a sane software development release process.

Evidence B: Structures_Datagrid and a bunch of other packages are also marked “beta” but have been used by the majority (I daresay) of developers without any problems over the course of the last dekamonths.

What gives, PEAR?

HTML tables and exploratory programming

Today (or yesterday, depending on your time zone) Paul Graham has released Arc, his very own successor to Common Lisp and Scheme. I don’t care much about it, at least not in its presents state, but the article that accompanied its release is very interesting in its statements on exploratory programming.

What particularly struck me was his comparison of HTML tables with Lisp’s untyped lists.

First, Paul talks about the evolution of his opinion on untyped lists:

“I went through a stage, after I’d been programming in Lisp for 2 or 3 years, where I thought the old way of using lists to represent everything was just a hack. If you needed to represent points, surely it was better to declare a proper structure with x and y fields than to use a list of two numbers. Lists could contain anything. They might even have varying numbers of elements.

I was wrong. Those are the advantages of using lists to represent points.

Over the years my appreciation for lists has increased. In exploratory programming, the fact that it’s unclear what a list represents is an advantage, because you yourself are unclear about what type of program you’re trying to write. The most important thing is not to constrain the evolution of your ideas. So the less you commit yourself in writing to what your data structures represent, the better.”

I’m sure most Lisp programmers will agree to this.

Now, what about HTML tables?

“Tables are the lists of html. The W3C doesn’t like you to use tables to do more than display tabular data because then it’s unclear what a table cell means. But this sort of ambiguity is not always an error. It might be an accurate reflection of the programmer’s state of mind. In exploratory programming, the programmer is by definition unsure what the program represents.”

And yes, CSS still can’t do more than three columns, and even for three I would have to look it up.

Kalman filtering

Engineering reality often confronts us with systems that can’t be modelled very well with fixed formulas.
Sometimes we don’t even know some of the system equation’s variables; think of signal noise, for example.

Enter the Kalman filtering algorithm. Given a number of observable and non-observable states, a Kalman filter tries to predict the non-observables ones.

Normally the state vectors have a dimension greater than 1, so you have to fiddle around with matrices. We once implemented the filter in Java; it was astonishingly simple, but the Java idiosyncrasy of making even the most simple code look complicated diminished this simplicity considerably. Here’s the core of it, i.e. the code minus the various “object-oriented” boilerplate methods:

public void filter(State state) throws MatrixException {
 
    setStateTransitionMatrix(delta, state.getAcceleration());
 
    x = lastX;
 
    y.setValue(0, 0, state.getPosition().getX());
    y.setValue(1, 0, state.getPosition().getY());
    y.setValue(2, 0, state.getPosition().getZ());
 
    /* PREDICT */
    x = A.multiply(x);
 
    if ((!E.isZeroMatrix()) && (R != null) && (!R.isZeroMatrix())) {
        E = ((A.multiply(E)).multiply(A.transpose())).add(Q);
        Matrix K = null;
 
        /* CORRECT */
        K = (E.multiply(B.transpose())).multiply(((B.multiply(E))
                .multiply(B.transpose()).add(R)).invert());
 
        if (!K.isZeroMatrix()) {
            x = x.add(K.multiply(y.subtract(B.multiply(x))));
            E = (I.subtract(K.multiply(B))).multiply(E);
        }
 
    }
    lastX = x;
    setState(state);
}

And now you may leave the torture chamber and take a look at an implementation in q. Beautiful!

CSS doesn’t scale

While customizing a CMS for a client, I was forced to confront an old enemy of mine: CSS.
“What”, you say, “but surely you must be convinced that CSS is the latest and greatest in the separation of style from content?”

Well, latest, yes. Greatest? Far from it.

The good points: CSS is the only standardized tool that lets you separate content. The cascading model is well-designed and most often well-implemented. The set of selectors and attributes is as well.

But now let’s face two glaring problems of CSS. And no, cross-browser compatibility hacks are not among them.

  1. dynamic layout: show me a CSS multi-column layout without at least one column fixed in width. With the scourge called
    I can specify percentages and they work nicely, adapting themselves to the screen estate of the client. Why this omission? It feels like stone age in a world full of handheld devices and lots of different resolutions.Most web designers seem fine with specifying pixels all around. But then again a lot of web designers have Macromedia Dreamweaver, Adobe Illustrator and Adobe Photoshop among their favourite tools. I’m always tempted to use tables instead, which gives me the additional boon of a working vertical alignment.
  2. arithmetic expressions: it’s not possible to do even the most simple of calculations like 2em + 50px. Also, wouldn’t it be badly needed to be able to say: 2em + (SCREEN-WIDTH / 2), especially with absolute positioning? In this case, I can actually see why CSS don’t has this, though: Microsoft Internet Explorer often messes up even with only one value.

What makes it really bad is that CSS3 doesn’t attempt to solve those, to my knowledge. But let’s see whether HTML5 with its semantic additions can help here.

What are your experiences with CSS?

PHP array “functions”: a nightmare for functional programmers

Well, I used to think PHP itself was. But the language as a whole (no closures, no packages or namespaces, poor man’s single dispatch OO, could come up with a bunch of more things) is nothing compared to its low-level array API.

Walking an array on a low level, i.e. getting at the previous and next elements in natural array order, is done with the prev() and next() functions. The problem is that those only work as a function in that they return the corresponding array value ($val = next($array)). Besides that they act as procedures modifying internal array state. Read that again: those things have more side-effects than you can twist around in your brain, and their very core functionality relies on them.

Here’s some closely associated brain damage for you to witness:

$a = array(1,2);
reset($a); # make sure we're starting with a clean array pointer
var_dump(pos($a)); # integer, value 1, as expected
var_dump(prev($a)); # FALSE, to be expected
var_dump(next($a)); # FALSE!!

So the assertion that making one step backwards and one forward leaves you where you started is a no-go here.
Talk about common sense semantics…

And this is harmless in comparison, but still:

Note: You won’t be able to distinguish the end of an array from a boolean FALSE element. To properly traverse an array which may contain FALSE elements, see the each() function.

Oh, do I need to remind you they are at major version FIVE of their language?