Pidgin Plugins for peace of mind

January 21, 2010 by

I guess the title says it all 😛

1) Group Blocker

This plugin allows you to block an entire group in plugin. Nice if you have a group of Irritating people in your chat list.

An Arch package for this is available on AUR here.

2) Away on Lock

Pidgin has a feature to set your status to away after a while if idle. However, this feature is known to be quite buggy especially on the Windows version of Pidgin.

The following plugins can be used for the same —

For Linux – Away on Lock. An arch package for the same can be found on the AUR here.

For Windows – Lock ‘n’ Roll

Lock ‘n’ Roll does not change the status if it is busy, invisible or already away. I see this as a bug in the busy case. The code is quite simple to understand and edit and also has documentation. If anyone has a pidgin windows devel environment, that can be changed easily.

Other Third Party Pidgin Plugins.

Since this is my first post of this year, Happy New Year people 🙂

Fibonacci Numbers

January 21, 2010 by

I’m guessing that all my blog readers know what the Fibonacci sequence is. For the uninitiated, it is:

0, 1, 1, 2, 3, 5, 8, 13, 21, 34…. ad infinitum.

Each number is the sum of the preceding 2 numbers. That is,

F(n) = F(n-1) + F(n-2)

where,
F(0) = 0
F(1) = 1

A Neat Trick:
————-
How can you easily convert miles to kilometers? You can use Fibonacci numbers: 5 miles is 8 kilometers (actually 8.045 km). 8 miles is 13 kilometers (12.87 km). 13 miles is, yes you guessed it, 21 kilometers (20.917 km). “But hey, this will only work for Fibonacci numbers!”. Well, I’m not done yet! Say you want to convert 20 miles to kilometers. Simply express 20 as the sum of Fibonacci numbers:

20 = 13 + 5 + 2.

Convert each number according to our mile-kilometer rule:

= 21 + 8 + 3
= 32

Voila! In actuality, 20 miles comes to 32.18 km. Neat huh?

Can you guess the logic behind this? The reason this works is as follows:
To convert from miles to kilometers, we have to multiply by a factor of 1.609. Now, the Fibonacci sequence has an extremely interesting property – the ratio of two consecutive Fibonacci numbers approaches the Golden Ratio: 1.618. Mystery solved!

A Puzzle:
———
Now here is a question I was once asked:

“For a flight of stairs with n steps, write a program to print the number of ways you can climb it if you can only move either one or two steps forward at any point.”

I couldn’t figure it out in time, but understood the approach later (I think Prajwalit was the one who told me the answer). Since this post is about Fibonacci numbers, it’s a given that they make an appearance in this puzzle. The challenge is to explain why the Fibonacci numbers show up.

Finally, for a tougher programmatic challenge, modify the problem as follows:

“For a flight of stairs with n steps, write a program to print all the combinations of ways you can climb it if you can only move either one or two steps forward at any point. If n is entered as 3, your program should show the following output –
n = 3
1 1 1
1 2
2 1”

UBI/UBIFS on NANDSIM

January 20, 2010 by

NAND simulator (NANDSIM) is an extremely useful debugging and development tool which simulates NAND flashes in RAM or a file. NANDSIM can emulate various errors and report wear statistics, which is extremely useful when testing how flash software handles errors.
Steps involved in the working of NANDSIM :

1 ) We perform all the following steps as a super-user.

$ sudo su

2) Now we mount the NANDSIM module. That is,we create a virtual raw flash device.
The parameters are as follows :

first_id_byte : The first byte returned by NAND Flash ‘read ID’ command (manufacturer ID)

econd_id_byte : The second byte returned by NAND Flash ‘read ID’ command (chip ID).The entire table of chip ids is given in the file nand_ids.c in the source code given here.

third_id_byte and fourth_id_byte are optional parameters which are initialized to 0xff (empty) by the system if not specified by the user. They are the third and fourth ID returned by the READ ID command.

By default NANDSIM uses RAM but if you do not have enough RAM, you can make it emulate the flash on top of a file using the cache_file nandsim module parameter.

Read the rest of this entry »

Hashbang #! and amarok1 on Arch

December 7, 2009 by

The #! at the start of bash, ruby, python scripts is called the hashbang. Its use with the Amarok install —

One or two days after writing the article about amarok1 installation on Arch, a new version of amarok1 with ruby1.9 support was uploaded. As most of the ruby scripts for amarok1 still work only with ruby1.8, I decided to keep my old version. Today, while I was looking through a few bash scripts, I realized that using #! in the needed ruby scripts was a better option. So, now I use the  AUR package and just change the hashbang lines in my scripts to point to ruby1.8 exec. If only I had realized this earlier 😛 😛

Anyways, more info about hashbang here.

wget : Add progress bar to non verbose mode

November 26, 2009 by

Check this bug report for the problem I had with default mode.

wget has four levels of verbosity which are described as below in its man page —

-d --debug
Turn on debug output, meaning various information important to the developers of Wget if it does not work properly. Your system administrator may have chosen to compile Wget without debug support, in which case -d will not work. Please note that compiling with debug support is always safe---Wget compiled with the debug support will not print any debug info unless requested with -d.

-q --quiet
Turn off Wget's output.

-v --verbose
Turn on verbose output, with all the available data. The default output is verbose.

-nv –no-verbose

Turn off verbose without being completely quiet (use -q for that), which means that error messages and basic information still get
printed.

The problem with these is that the verbose mode prints too much info, quiet prints nothing and non-verbose prints info which is not useful in any way.

Read the rest of this entry »