Archive for June, 2012

Challenged to write a quine

Friday, June 22nd, 2012

A what? A quine! What on earth is a quine? Well, a quine is simply a program that takes no input and outputs its own source code. That way, if the output is itself recompiled and executed, it outputs again the original source code. Interestingly, the guy who prompted me to write one in C related the story of a friend of his who was asked to come up with a solution to this problem within one hour during an interview! Under pressure, the guy came up with the solution within 45 minutes, most of which went into thinking, the last 10 minutes of which went into a quick implementation. He was hired. As for the guy telling me the story, he solved it in 65 minutes. It took several hours of thinking and implementation in C (My C skills were relatively rusty since I did not code in this language since 1991). Anyway, I eventually came up with this code after battling to escape a large piece of C code within a string. Note that such an exercise would be trivial in homoiconic languages such as LISP or interestingly in machine language where there is absolutely no difference between data and code (although Executable space protection has somewhat changed the matter).

Problem installing itunes

Thursday, June 7th, 2012

There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your support personnel or package vendor.


Create a folder, say c:\somefolder
Launch the command prompt in administrator more, then issue the following command:
iTunes64Setup.exe /q TARGETDIR=”c:\somefolder”