T(w)inkering

Sunday 2009-06-07

Now that the twitter hype is cooling down, and companies tart to realize that it is, in fact, just CB radio in a new asynchronous form, only the “true tweeps” still hang around. And now, it’s time to t(w)inker with it.

Read the rest of this entry »


Javascript Window Shake

Thursday 2009-03-12

This evening I came accross the window.moveBy() JavaScript function and thought it would be cool to shake the browser window when a user fails to log in. It turns out that I was not the only one thinking this, but none of the examples worked for me. Some had no proper delays, others only worked from the page header, and some were plain unreadable.

I’m no Javascript guru, but I hacked this together which is working pretty nicely. It is in fact almost undistinguishable from the Apple login window shake at a login failure:

<script type="text/javascript">
if (window.moveBy) {
	delay = 70;
	shakes = 3;
	window.moveBy(-10, 0);
	for (j = shakes; j > 0; j--) {
		setTimeout( "window.moveBy(20, 0)", j*delay );
		setTimeout( "window.moveBy(-20, 0)",
					j*delay+(delay/2));
	}
	setTimeout( "window.moveBy(10, 0)", (shakes+1)*delay );
}
</script>

In my case, I surrounded this code with a Tapestry @Conditional and made it into a reusable Tapestry component so that I can make any window shake as soon as it contains an error.

The code will work anywhere on your page, but I advise you to put it at the bottom of the HTML. This will make sure that the content is shown in the browser before you shake it.

It’s visually much stronger than just adding an errortext to the page. If people log in a couple of times a day, they don’t even notice extra text on the screen. This will “shake” them awake :-)

Have fun!


Tweet Week

Sunday 2009-02-15

TwitterAbout a week ago, I was a bit bored and decided to see what Twitter is all about. I created an account, and I Tweeted for a week. I tried to keep to the original idea, where a Tweet should answer the question “What are you doing”? Looking back, my tweets include CoffeePodcastsGlobal frustrationSmall joysSmall irritationsRe-tweets, and Replies

Read the rest of this entry »


Care vs Careless

Tuesday 2009-02-03

 

simplicity

 

It’s frightening to realize how close to the truth Eric Burke is.


Programmer Quotes

Friday 2008-12-19

On StackOverflow, there is a question asking for the greatest programmer quotes you know. In the top 3 quotes are the following two quotes which I think hold much truth:

“Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.” – Rick Osborne

“Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.” - Brian Kernighan

These two quotes are briliantly summing up the usual rant I always use. “if my phone rings at 3 a.m. for a prio 1 production issue, I want to be able to easily read the code. And I’m not going to be awake or cheerful at that time of night.” I guess at that time of night, it’s easy to awaken the violent psychopath in me, and so it better not be “smart” code. CVS blame support anybody?