Tuesday, January 31, 2012

TED Talks Download

I am a big fan of TED talks. Usually I like to listen to them while traveling. So far I have been downloading using the "download" button in their website. Today I found a very interesting website which gives links to all TED talks in Metalink standard file format. This can be used directly to search and download videos in high quality using any downloader that supports metalink.

The Metalink file format is an XML file which can be parsed by any xml parser. I use a Python library for parsing the xml and then use good old wget to get the file directly from TED.

Here is a link to the website for getting the metalink file: http://metated.petarmaric.com/

Wednesday, January 18, 2012

Opening vi and command line in same window

One thing I have always liked about emacs is its ability to open a terminal within it. This makes writing programs a lot easier as you can both compile/debug and write a program without leaving your editor. There exists a few plugins to achieve the same in vi, but none of them are stable and platform independent.

Yesterday while going through the gnu screen man page, I found that it supported splitting the screen. Using that functionality, its easy to open vi and terminal in the same window. Here is a screenshot of what I managed to get:


Here is the step by step guide on how to get this:
  1. Open vi in a screen : screen vi
  2. Split the screen by : ctrl+a S remember that the S is in caps, so you might have to press shift+s
  3. Go to the bottom screen by ctrl+a Tab
  4. Create a new screen by ctrl+a ctrl+c
  5. To switch between the split screens, use ctrl+a Tab
Look up the man page on screen in your system for further cool things that you can do. Here is a stort list of commands which I use everyday (other than the ones in top):
  • list all screens : ctrl+a "
  • disconnect a screen : ctrl+a d 
  • reconnect a screen : screen -r screenNumber 
  • list all the running screens from terminal : screen -ls
  • split screen vertically :  ctrl+a |

 

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.