Just wanted to post an interview question I came across which might help those in need.

The task was : Use the language of your choice to write a program that reads a CSV file and outputs the contents of the file sorted by the “age” column.  Missing data should sort to the end.  Output should show all columns of data and may be sent to the console, an output file or a graphical interface at your discretion.

The csv file:  [download id=”28″]

My answer to this question was to write a Python script that used Spinx as a document generator.

The code went something like this:

You can find all the files in a neat little rar in the link following; [download id=”29″]

Anyway hope you have fun with it!

My business trip marathon has started. I will be traveling these next couple of months. I just simply wish that I had bought my ticket with a “Sky Miles Card” really. Would have gotten a free ticket to China or something.

My first leg of my business travel is to Ireland the “Emerald Isle” at first I thought the saying was mostly exaggerated. However as our plane approached the Dublin airport I could clearly see it was actually an understatement. For some reason I remembered the quote from the film “Death at a Funeral” (http://www.imdb.com/title/tt0795368/)

Uncle Alfie: Everythings so fucking green.

If you haven’t watched the movie (the 2007 version) you should!

(more…)

Have been writing a Turkish Django app for the past couple of days. The problem is that the Turkish language best works with UTF-8. If you are using MySQL you must make sure that your encoding is utf8_turkish_ci .

You should notice couple of important points here. The most important one being the

This is important so that Python can understand UTF-8 strings within the model.

I hope this solves couple of questions you might have.

Wanted to create backups at certain intervals for a very important server. And what’s more  I wanted to make sure that the backups were in couple of places. Including my e-mail. So, I bash script was created!

Now you may notice you will need to install couple of packages to your server. These are ;

  • Mutt : Setting mutt is very easy. Simply search gmail mutt configuration in google. Who knows. May be you will find me in the process.
  • lftp : You don’t need to set this. And the packages for this is readily available for ubuntu and fedora distros.

Now all you need is to save this little script and call it from cron in periods of your wish.

For those wondering what message2.txt contains. It is a daily usage report that is created by a python script I wrote. However you can simply create a simple txt file of your choosing. That way mutt will include that text in to your e-mail.

 

Hi, there. I know it has been a long time. But no worries I am back with a small project. I got my hands on a KSR10 . The KSR10 is a simple robotic arm that any 13 year old (or 13 year old at heart) can put together. The great part of it though is even though the manual says it has no support 64-bit computers you can easily find a Python library that does. Now you know all know how much I love writing in Python. Even a broken down computer and coming home tired from work could not stop me work on the project!

I strapped a simple web-cam on the robotic arm to make it 100 times cooler. Now the robotic arm follows faces and big red squares!! I used the OpenCV library for the project. Below you can find a nice little video;

The KSR10 doing awesome motion

(more…)