Skip to content

www.rolfje.com

Category: Fun

Javascript Window Shake

Posted on 2009-03-12 By rolfje 2 Comments on Javascript Window Shake

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!

Fun, Software

Bill’s Mosquitoes

Posted on 2009-02-06 By rolfje 1 Comment on Bill’s Mosquitoes

Bill Gates Releases MusquitoesBill Gates found a very good way to get the news reporters to pay attention to the malaria problem. In his talk at the TED conference, he released a few mosquitoes, stating that malaria should not be just for poor people to experience. People who did not see the whole performance may react shocked, because when placed out of context it sounds like an outrageous thing to do.

If you think that’s the case, you should maybe have a look at his talk, available (for free, without registering) at TED.com. You’ll see that the audience is actually laughing when he releases the mosquitoes, and at the end of the talk Bill gets a standing ovation.

In addition to the malaria problem, Bill also makes a very good case about how important good teachers are, and what we can do to help teachers become just that.

Fun, Microsoft

Care vs Careless

Posted on 2009-02-03 By rolfje No Comments on Care vs Careless

 

simplicity

 

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

Fun

Wiimote Whiteboard

Posted on 2008-12-12 By rolfje 7 Comments on Wiimote Whiteboard

WiimoteWhiteboardFor people wanting to have an interactive whiteboard but don’t have the money, Johnny Chung Lee has found the solution. Using a Wiimote, he can track an infrared lightsource (like an LED) and use that to control the mousecursor. I tried some software on the Mac and the PC, and I actually got both to work without too much trouble.

Read More “Wiimote Whiteboard” »

Apple, Fun, Hardware, Microsoft

Brilliant TV

Posted on 2008-12-08 By rolfje No Comments on Brilliant TV

People who know me know that I’m not a big fan of commercial TV. It hasn’t got any depth, it usually underproduced, overmarketed and makes an insulting assumption on the viewer’s intelligence. (Wow, all in one sentence 🙂 )

So I usually get my information elsewhere. Most of the stuff I find interesting is provided through RSS feeds. Some of it is made available through audio podcasts, which is brilliant when commuting. As for video, youtube looked promising, but the messy interface and sheer overload of people making silly movies with their mobile phones has made it hard for me to find actual interesting video there. The rating system with YouTube did improve the past week, but it’s still hard to find stuff that interests me.

Enter the TED talks. These are brilliant video’s mostly of a presentation, or sometimes music. But generally, the TED talks are just that tiny bit more interesting than TV, without commercials, and with real contents.

Just now I finished watching Mena Trott’s entertaining presentation on how blogs are building a friendlier world. The TED.com site is really clean, easy to browse and contains tons of video’s about remarkable people with very interesting stories to tell. If my TV died, the only way I’d notice is when I switch on my PS3 to play a video game.

Fun

Monkeys: How to get rich.

Posted on 2008-11-23 By rolfje No Comments on Monkeys: How to get rich.

I recently got an email with a brilliant little fairytale about how to trick people into happily giving you all their money. I wanted to share with you, but it was in Dutch, and the origin was cleary not the original author.

Today I was rummaging around the internet to see if I could find the original author, and I did. I found out that the Dutch story was freely translated from an English source. Here’s the original story from that English source, unaltered (and with reference):

Read More “Monkeys: How to get rich.” »

Fun

Let Me Google That For You

Posted on 2008-11-20 By rolfje No Comments on Let Me Google That For You

We’ve probably all had it. Just when you thought you found the right number of Palindromic Square Sums, you receive a mail from somewhere up the chain of command with a cry for help. The rather lengthy mail contains 3 paragraphs on why this mail was so important, why it was sent to you and why you need to reply “immediately”. At the end of the mail, there is a fairly trivial question like “How many pounds is in one kilogram”?

So you search Google and find out that 1 kilogram is 2.20462262 pounds. Depending on your irritation, you mail the information, or a link to the google results (because it is a top hit). For people not taking the hint of your Google url, there’s now another nice option, called “Let Me Google That For You”. 

It’s a bit more obvious to the hard hearing, and less blunt than a similar service I used a few years ago. Here’s the empty link so you can roll your own: letmegooglethatforyou.com

Fun

You are a pirate!

Posted on 2008-10-25 By rolfje No Comments on You are a pirate!

A briliant post on xkcd.com today explains in one single cartoon why DRM is bad:

Steal This Comic
Steal This Comic

I couldn’t have made it simpler (although I tried).

Fun

The Three Great Virtues of a Programmer

Posted on 2008-10-05 By rolfje 1 Comment on The Three Great Virtues of a Programmer

I ran across this wiki page which has a nice piece on the virtues of a good programmer. I found it so recognizable that I decided to copy it over for you to enjoy:

“We will encourage you to develop the three great virtues of a programmer: laziness, impatience, and hubris.” — Larry Wall, Programming Perl (1st edition), O’Reilly and Associates

Laziness
The quality that makes you go to great effort to reduce overall energy expenditure. It makes you write labor-saving programs that other people will find useful, and document what you wrote so you don’t have to answer so many questions about it. Hence, the first great virtue of a programmer. Also hence, this book. See also impatience and hubris. (p.609)

Impatience
The anger you feel when the computer is being lazy. This makes you write programs that don’t just react to your needs, but actually anticipate them. Or at least pretend to. Hence, the second great virtue of a programmer. See also laziness and hubris. (p.608)

Hubris
Excessive pride, the sort of thing Zeus zaps you for. Also the quality that makes you write (and maintain) programs that other people won’t want to say bad things about. Hence, the third great virtue of a programmer. See also laziness and impatience. (p.607)

(The original context can be found at
http://c2.com/cgi/wiki?LazinessImpatienceHubris)

Fun, Software

A Weekend of Crashes

Posted on 2008-08-31 By rolfje No Comments on A Weekend of Crashes

This weekend was a lot of fun. Saturday night I got to fly Leo’s Walkera 60B electric helicopter. That’s one piece of impressive (and scary) machinery. Although it feels easier to fly than my 4#3B, I still “managed” to crash it. Luckaly the blades can be easily replaced, and after tightening a bunch of screws and replacing a pin in the main gear, it was good to fly again. We flew 3 times, and had to repair the helicopter after each flight 🙂 I hope I can treat you with good shots of the Walkera 60B next time, there are not many high-quality images of it online.

Read More “A Weekend of Crashes” »

Fun, Hardware

Posts navigation

Previous 1 2 3 … 6 Next
           

Recent Comments

  • rolfje on Methode Buijs uitgelegd
  • LinkedIn is at Peak Enshittifaction – Will Chatham's Blog on Linked-In not really Opt-in?
  • Hans j on 1N4148 diode as RF switch
  • Roaming Rhonda on DLNA on OSX, done right
  • Frans on How to fix a Krups XN2001 Nespresso machine

Tags

Anonimatron Apple backup design DIY DRM eclipse environment Fun gmail google hacking hamradio Hardware helicopter iphone ipod iTunes Java Keynote maven modelling motorcycle music news opinion oracle osx photo photography programming repair review security Software Steve Jobs T-Mobile technology Time Machine Ubuntu usability Utilities vacation windows Workshop

Categories

  • Apple (105)
  • Divorce (1)
  • Electronics (3)
  • Fun (57)
  • Games (7)
  • Hardware (72)
  • Microsoft (18)
  • Racing (14)
  • Software (134)
  • Uncategorized (65)
  • Workshop (20)

Archives

Copyright © 2025 www.rolfje.com.

Powered by PressBook WordPress theme