Category Archives: Computer Science

Ruby script to get a list of all mp3 files in a directory sorted durationwise.

Here is some ruby practice…

def mp3len(dirname)
require ‘mp3info’
summary=[]
Dir[dirname].each do |f|
Mp3Info.open(f) do |info|
summary.push([f,info.length])
end
end
summary
end
puts “Enter directory containing mp3 files”
dirname=gets.chomp
dirname = File.expand_path(dirname)
puts “Searching #{dirname}”
dirname += “/**/*.mp3″
s=mp3len(dirname).sort {|a,b| a[1] < => b[1]}
s.each{|q| puts “#{q[0]} => #{q[1]} [...]

Unicode entry

This entry has some unicode characters (devanagari), let’s see if they are visible correctly…
मराठीमद्ध्ये लिहिणे आता बरेच सोपे झाले आहे. यासाठी युनीकोडला धन्यवाद दिले पाहिजेत

Lateral Thinking…

How will you write a program to find jumbled words ?
The shotgun approach is the first one anyone is bound to follow at first. i.e. For all permutations of the letters, find if there is a match in the dictionary of words. You might do some optimizations to ignore repetitions etc. But this is O(n^2) [...]

An Interview with Brian Kernighan

An Interview with Brian Kernighan
by Mihai Budiu
http://www.cs.cmu.edu/~mihaib/kernighan-interview
Spanish translation by Leonardo Boshell
July 2000

Nifty Windoze utilities

Mike Lin software downloads