Hari's Corner

Humour, comics, tech, law, software, reviews, essays, articles and HOWTOs intermingled with random philosophy now and then

Geeky and Meeky 6 - MCP

Filed under: Geeky and Meeky comic by Hari
Posted on Tue, May 29, 2007 at 17:40 IST (last updated: Thu, May 7, 2009 @ 21:24 IST)

My next Geeky and Meeky toon. I've entitled it MCP. :cool:

Geeky and Meeky - MCP
Comments (9)  

Crossword Challenge solution

Filed under: Bits and Bytes by Hari
Posted on Tue, May 29, 2007 at 10:27 IST (last updated: Thu, Oct 30, 2008 @ 07:45 IST)

Here is the solution to the crossword challenge.

Solution to CrossWord Challenge

Shrinidhi Hande posted the correct solution to this one and gets a special mention. I thank all those who tried to solve this puzzle.
Comments (0)  

Selected posts from July 2005

Filed under: Bits and Bytes by Hari
Posted on Mon, May 28, 2007 at 16:37 IST (last updated: Thu, May 7, 2009 @ 21:35 IST)

Time for another blast from the past while I go through a lean trot looking for inspiration. ;)

Python and Java - my take on these two highly dissimilar programming languages. I still think that the structure of Java makes it more suited for a formal software engineering course where development is formalized and the emphasis is on correct coding practices, while Python will remain a powerful, extensible scripting/programming language to get things done as fast and as easily as possible. Java can be a pain for coding smaller applications because it demands too much structure.

Unfair Criticism - some thoughts on how to criticize and do so in a constructive way. Too often, people find it easy to say that something is wrong, but have difficulty in pointing in the right direction.

Reverse Elitism and the Linux Community - my first real analysis of Linux flame wars and why they happen. The underlying issues are related more to human psychology than technology. I still like this article, although I think I would write it a bit differently if I had to do it now.

Choosing a web hosting solution - my first real HOWTO. Based on my own experience in searching for a host for literaryforums.org. The best web hosts are the ones who don't have anything to hide. Many web hosting providers hide a lot of stuff in their fine print and assume that people won't read. The lesson: be careful before you commit money.
Comments (0)  

Crossword Challenge

Filed under: Bits and Bytes by Hari
Posted on Thu, May 24, 2007 at 13:01 IST (last updated: Mon, Dec 6, 2010 @ 11:57 IST)

Here's a crossword puzzle I cooked up today. I have never created one before and I took up the challenge. The result is not too professional, but I wanted to see how my readers could solve this (print this image and the clues). I'll post the solution later. In the meantime, feel free to post individual answers and your feedback.

The first person to complete this puzzle and send me the answers by e-mail will be specially acknowledged when I post the solution. Sorry, no prizes though :P

Here it is:

Crossword puzzle

(Copyright © 2007 V.Harishankar)

Clues Across

1 – Famous and liked by all
4 – Not ordinary
7 – First
8 – Go off topic for a while
9 – Quality of compassion
10 – Perfect fit
14 – Undesired message
16 – Smooth speaking
17 – Pleasing quality of perfumes
19 – Liquid burn
20 – Huge task ahead (figuratively.)
21 – Made furious, infuriated
22 – A kind of aurochs
23 – Native inhabitant of the Americas
25 – A stream or water channel
26 – The major aspect of globalization
27 – Traditional source of mineral water

Clues Down

1 – Of immense value
2 – Final demand with threat of force
3 – Taking attendance of a group
4 – Sports arena
5 – Ester of common organic acid found in lemon
6 – Unit or portion of instruction
11 – Elaborate nonsensical procedure
12 – Stunning, stupefying
13 – Give up, leave behind
15 – Unusual, strange
16 – Completely destroyed by fire
17 – Move forward
18 – Root of, first cause
24 – Of the highest quality, first-rate
Comments (15)  

iPod video encoding guide for Linux users

Filed under: Tutorials and HOWTOs by Hari
Posted on Wed, May 23, 2007 at 17:54 IST (last updated: Wed, Oct 1, 2008 @ 22:15 IST)

I have a 30GB video iPod and I have to say that it is one of the most finicky music and video playing devices you can ever own. I've managed to corrupt the ever-so-delicate darling (the iTunes DB) several times as a result of which I've had to remove and recreate the music database from scratch and getting your videos to the exact format required by the video player is a real pain in the rear. All in all, I must say that I regret purchasing an iPod and would have bought any other player in the market if only I had known whether those would work under Linux or not. This is probably the last Apple product I ever purchase. It's truly a shoddy, hyped overpriced product.

Having said that, I've struggled with guides on the internet telling me how to encode videos for the iPod and most of them have not worked for me. After a lot of tweaking around I wrote a simple script using ffmpeg to get the precise format recognized by the iPod. If you have DVDs, you need to rip them first. I suggest acidrip, as it's quite a simple GUI to mencoder. However, the videos produced by mencoder will *not* work with the iPod. I have tried with several options, but it won't work at all.

So here's how I encode DVDs to iPod format in Linux.
  1. Rip the DVD chapter by chapter, using acidrip. It's the most convenient way of doing it. I generally scale the video to the iPod size (320x240) at this stage since ripping becomes less time consuming. Other parameters don't matter much since you won't be using this format anyway. I also set the audio to MP3 using LAME (you need liblame for this) and bit rate to 64. You can set other parameters if you wish.
  2. Convert the resulting mpeg file(s) one by one to mp4 (with h264 codec) using the script (see below).
  3. Take a long coffee break ;)
  4. Use a tool like gtkpod to transfer the mp4 file to your iPod. Hopefully it should play properly now.

The script is very simple. It's just a wrapper for ffmpeg with all the options you need to get the correct iPod-compliant format. Copy this code, save it to a text file (say ipodenc.sh) and make it executable using the command chmod +x ipodenc.sh.
#!/bin/bash
#Encode iPod Video

input_file=$1 output_file=$2

ffmpeg -i "${input_file}" -vcodec h264 -b 150k -bufsize 244 -maxrate 768k -s 320x240 -bf 0 -level 13 -f mp4 -acodec aac -ar 48000 -ab 64 "${output_file}"

The script's usage is (from the command line):

./ipodenc.sh inputfile.mpg outputfile.m4v

You can alter some of those ffmpeg settings if you want to. I deliberately kept the bit rate low because the encoder will always choose higher bit rates. But you need the -bf 0 and the -level 13 parameters if you want the video to play (with the h264 format). I found this obscure bit of information on a mailing list archive. Earlier, when I encoded with h264 without those flags, it refused to play on the iPod.

This is more like a reminder to myself, but I hope you find this useful anyway. :)
Comments (4)  

On programming

Filed under: Software and Technology by Hari
Posted on Mon, May 21, 2007 at 08:35 IST (last updated: Wed, Jul 16, 2008 @ 20:40 IST)

If you are a programmer in C++ and you think you're fairly advanced, you should take a course of this book which my brother bought recently: Modern C++ Design: Generic Programming and Design Patterns Applied (full review here). I read a few chapters and came away with my head swirling in the clouds. This book is essentially about generic programming using C++ templates and illustrates and implements concepts that would truly challenge even the most advanced programmers because it talks about some of the most difficult theoritical concepts you would ever have come across - namely meta meta-programming (even understanding this term might require considerable effort). If you thought basic template programming in C++ was hard enough to grasp, then this pushes even templates to the limit. In short it is revolutionary in thought simply because it requires one to completely rethink the whole idea of traditional OOP.

Nevertheless, it really made me understand how much programming has advanced of late - particularly conceptual programming. In today's context, the term "programming" itself might become irrelevant simply because it's too broad a term to encapsulate all the different methods and paradigms of software design and engineering. In fact, I would classify software design itself on the following broad levels.

We've come a long way from the traditional idea of programming - that much is sure.

Apart from this, I would also classify complexity in programming into two distinct categories.

Often new programming paradigms are introduced so that practical complexity can be reduced as much as possible. But in introducing new paradigms, theoritical complexity is increased a hundred-fold which requires a complete re-learning of skills and techniques. It's like changing the whole grammar of a well-known language like English. But the time invested in learning a new paradigm might actually be worth it as it can help solve future problems of the same kind much more productively. That's why there are two kinds of programmers in this world - those who love exploring new theories to solve problems and those who just want to get the job done as quickly as possible. I can see merit in both sides.

Truly, when you go in-depth into these issues, you realize how little you actually know. If nothing else, exploring these ideas made me realize how little I know and understand in the vast field of software application development.
Comments (3)