Decimal to binary convertion in Perl

This is a simple thing, but when you need it – you need it. There is no need in implementing a function that does or looking for a module at CPAN. All you are looking for is already there.

#!/usr/bin/perl -w

use strict;

# Get the number from the command line or use default.
my $number = shift || 42;

printf "%b\n", $number;

You might want to refresh you memory of printf or sprintf by flipping though the manual pages.

P.S.: 42 decimal = 101010 binary. Is it cool or what?

Tip for Mozilla Firefox and the middle button

While Firefox suits me pretty good, it has a couple of issues that annoy a great deal out of me. The first one doesn’t happen all that often, but when it does, it annoys the big Jz out of me. The click with the middle mouse button anywhere on the page, except for the link. Usually, I use the middle button to open the link in a new tab. But if I miss the link, then Firefox uses whatever text was in the buffer as a new link for the current tab. I really hate that one, you know.

Today I accidentally discovered a fix. Simple, as usual. Navigate your browser to about:config and make sure that middlemouse.contentLoadURL is set to false. Tada! All done.

Daily del.icio.us bookmarks

Shared bookmarks for del.icio.us user tvset on 2005-10-10

Web search shortcut in Mozilla Firefox

If you have been wondering how to switch to that nice little web search field in Mozilla Firefox using only the keyboard, I’ve got an answer for you. Ctrl+K. It’s that simple.

By the way, in Mozilla Firefox 1.5 which is due to be released in the nearest future, this shortcut will be bringing out a web search dialog even if the web search toolbar is hidden.

The sweet del.icio.us inbox

This time I am one of the last people to discover the new feature – Delicious inbox. And I will write about here anyway, because new people are born every day and eventually they will grow up old enough to need to know about it. And when they do, there is a chance that they will read about it here and not on every other page on the web.

So, Delicious inbox is a sweet feature that allows you, as a user, to subscribe to bookmarks made by certain other users, or marked by certain tags, or both. From now on, you don’t have to subscribe one billion RSS feeds to find out what’s hot in “photography”, or “parenting”, or what your wife has been bookmarking, or what your sysadmin has learned about Linux. You can get all these in one nice RSS feed from your Delicious inbox.

It’s easy to ignore the rest.