Thursday, October 06, 2011

Subho Bijoya

ঢাকের উপর ছিল কাঠি,
পুজো হল জমজমাটি,
আজকে মায়ের ফেরার পালা
জানাই তাই এবেলা

শুভ বিজয়া

Saturday, October 01, 2011

Counting unique values in Open Office

The spreadsheet program, Calc (equivalent of MS Excel) in Open Office does not have a function to count the number of unique numbers in a range. Here is a quick hack that I have been using for quite sometime for doing the same:
SUMPRODUCT((Data<>"")/(COUNTIF(Data;Data)+(Data="")))
When using this hack, replace "Data" by the range of values from which you want the number of unique values like "A2:A10". This applies to Libre Office too, which is itself a fork of Open Office.

I would be very happy of Open Office or Libre Office developers took a note of this and implemented a simple COUNTUNIQUE(range) function in some next release.

Saturday, September 24, 2011

Bengali font on Max OS X 10.6

Mac OS X 10.6 does not come with default support for Indian languages. Being a Bengali, I want to read and write in my mother tongue. Here is a step by step procedure to get Bengali support in Mac OS X 10.6.
  1. Get bengali fonts in a format supported by Mac OS
  2. Installing the font in your Mac
    • Open the application called "Font Book". It comes by default with OS X 10.6.
    • Drag and drop the saved TTF font file to the Fonts column of Font Book
    • The font will get installed within 5-10 seconds
  3. Using the bengali fonts
    • Usually the font should be used immediately by applications like Firefox and Safari, so you should be able to see any bengali text like "বিজ্ঞান ভড়"
    • In case you cannot see bengali text, just restart the system for the fonts to load
Please note that basically this is a technique for adding fonts to the OS, as default support for Unicode is already present. So in essence this same methodology should also work work with other languages.

More fonts for Mac can be found using a variety of online resources. Bangla Onkur a project that converts Open Type format fonts to TTF format for Mac.

Saturday, August 06, 2011

Organizing clothes using Data Structure

Due to lack of hanger space in my present wardrobe, I have to keep my clothes folded. I usually pick up something from the top of the pile for wearing. Which means I keep wearing the a small subset of my clothes repeatedly. Ideally I would have liked to wear all the clothes. But its too much trouble to take a tshirt out from middle of a pile; the entire pile gets disheveled.

The solution is actually quite simple. Think of the tshirt pile as a stack. What I want is basically a queue. So all that is left to do is to somehow "implement a queue using a stack". The CS grads have already faced this problem in their Algorithm and Data Structure courses. I applied the same technique.

I used two stacks, one for putting the washed clothes in (enqueue) and another for taking out the clothes for wearing (dequeue). If the pile for wearing is empty, [and here comes the important step] then turn the washed clothes pile upside down and keep it in place for the wearing pile.

Its good to know that Data Structure knowledge is useful beyond computers too !!

Saturday, July 16, 2011

Confessions of an Ebook Pirate

Today I found this article, titled "Confessions of a Book Pirate". Its an email interview with a bibliophile who is also a book pirate. The person in question has a name "The Real Caterpillar" in one of the many book sharing communities that he participates. He makes quite a few points which seemed logical and worth noting. The article is a definite recommend from me for anybody who loves books and is aware of ebooks and piracy.

However, some of the arguments seem feeble. Like "I would probably still grab a book if I stumbled across the file and thought it might interest me – or if I wanted to check it out before buying a paper copy". Well both of these can be very well accomplished in Google Books (partial book) or in the local bookstore (full book).

Personally, some of my interests fall into pretty much the tail end of the curve; and often finding books on some of these topics are quite difficult. Sometimes the books themselves are out of print. But I guess the ebook industry is moving towards the correct direction. With ebook readers flooding the market and big players like amazon coming in, bibliophiles like me are having a good time. Still it will take quite sometime till the entire spectrum is covered.