Monthly Archives: August 2009

Hotel Room Problem

Three men decided to split the cost of a hotel room. The hotel manager gave them a price of $30. The men split the bill evenly, each paying $10, and went to their room. However, the hotel manager realized that … Continue reading

Posted in Problems | 1 Comment

How To Redirect STDERR to STDOUT in Perl

Redirecting STDERR to STDOUT in Perl: open STDERR, ‘>&STDOUT’; Reassign raw file handles: *STDERR = *STDOUT; Redirect all output to a logfile: open(LOG,”>/tmp/foo.log”); *STDERR = *LOG; *STDOUT = *LOG; Example: #!/usr/bin/perl use strict; use warnings; warn “regular error”; open STDERR, … Continue reading

1 Comment

Failure: The Secret to Success

Posted in Everything Else | Leave a comment

How to Fix an Empty Bash Shell Prompt

If you bash shell prompt is empty when logging in, here’s how to fix it. Create a ~/.bashrc file: if [ -f /etc/bashrc ]; then . /etc/bashrc fi Create a ~/.bash_profile file: if [ -f ~/.bashrc ]; then . ~/.bashrc … Continue reading

Posted in Linux | Leave a comment

Burning Rope Problem

You have two ropes that each burn for 1 hour end to end, but at varying rates. You have a lighter. You cannot cut the ropes (and doing so wouldn’t help, since they burn at unknown rates and you only … Continue reading

Posted in Problems | 1 Comment

8 Bricks Problem

You have 8 bricks, but one of them is lighter than the rest.

You have a balance you can only use twice.

How do you find the lighter brick? Continue reading

Posted in Problems | 1 Comment

Monty Hall Problem

There are 3 doors. There is a prize behind one door. You pick one at random. Then, a single wrong door is eliminated. Should you switch your answer to the other door?

Posted in Problems | 1 Comment

How To Know If You Have a 64-bit Capable Processor

How to find out if you have a 64bit processor: uname # uname -p x86_64 You can also try: $ uname -m i686 i686 (or any garbage) = 32-bit x86_64 = 64-bit cpuinfo # cat /proc/cpuinfo flags : fpu vme … Continue reading

Posted in Hardware, Linux | Leave a comment

How to Fix Ugly Sidebar in WordPress iNove Theme

The iNove theme gives your wordpress blog a Mac-ish look and feel. However, the sidebar has some ugly built-in widgets. Here’s how to remove them. In themes/inove/sidebar.php, remove everything between these lines: <!– sidebar north END –> … delete everything … Continue reading

Posted in Wordpress | 1 Comment