Wednesday, December 15, 2010

Waltz with Bashir: The Movie

Waltz with Bashir (Hebrew: ואלס עם באשיר‎ - Vals Im Bashir) is a 2008 Golden Globe, NSFC and IDA award-winning, Academy Award, BAFTA and Annie award-nominated Israeli animated documentary film written and directed by Ari Folman.


In 1982, Ari Folman was a 19-year-old infantry soldier in the Israel Defense Forces. In 2006, he meets with a friend from his army service period, who tells him of the nightmares connected to his experiences from the 1982 Lebanon War. Folman is surprised to find out that he does not remember a thing from the same period. Later that night he has a vision from the night of the Sabra and Shatila massacre, the reality of which he is unable to tell. …

Friday, March 12, 2010

Interview Question: Unique string for any integer

Problem: Given any integer value, return a sequence using capital alphabets which are unique. For example, 0 changes to A, 1 changes to B, 25 changes to Z, 26 changes to BA, 676 changes to BAA, 17576 changes to BAAA. This could be useful for example if you need to generate short unique names for files.

Question: Will AAA sequence ever be returned? If yes, will ZAA sequence ever be returned? (The answer to one of the questions should be No. If "Yes", ask how will 0 be represented?)

Question: What are the maximum characters needed to support full range for 4 byte long integer, i.e. how long will be the sequence for 2^31-1=2,147,483,647? (The answer should be a small algorithm or quick calculation to evaluate this. Exact answer is 6 characters.)

Solution for numbers up to 25 (1 character). Marks: 10/100
Solution for numbers up to 675 (2 character). Marks: 25/100
Solution for numbers up to 17575 (3 character). Marks: 80/100
Solution for any number. Marks: 100/100

Solution for any number, plus valid answers to both the question. Why are you still continuing the interview? Offer him or her the position. :-)

(Mathematically, the problem is analogous to converting a number from base 10 to base 26. The solution is simpler if thought that way.)

Tuesday, January 12, 2010

Google Quick Search Box

For Mac lovers and Spotlight haters, try Google Quick Search Box for Mac only.

You can download it from the homepage or the Google Code page.

Looks like Google learnt something from QuickSilver, at last.

Monday, November 16, 2009

Surveillance is so easy!

India has approved installation of NarusInsight machines at ISPs, so it is anybody's guess how prevalent these are here.

A single NarusInsight machine can monitor traffic equal to the maximum capacity (10 Gbit/s) of around 39,000 DSL lines or 195,000 telephone modems. But, in practical terms, since individual internet connections are not continually filled to capacity, the 10 Gbit/s capacity of one NarusInsight installation enables it to monitor the combined traffic of several million broadband users.

According to a company press release, the latest version of NarusInsight Intercept Suite (NIS) is "the industry's only network traffic intelligence system that supports real-time precision targeting, capturing and reconstruction of webmail traffic... including Google Gmail, MSN Hotmail, Yahoo! Mail, and Gawab Mail (English and Arabic versions)."

It can also perform semantic analysis of the same traffic as it is happening, in other words analyze the content, meaning, structure and significance of this entire traffic, as it is happening.

More:

Saturday, September 26, 2009

Update Modified Timestamp on Windows | Equivalent of Unix touch command

This is a common operation, and there should be a straightforward way to do it. Well, there is one. Suppose myfile.txt is the file in question, you can update its last modified date and time using this in command prompt:
copy /b myfile.txt +,,
The operation may be slow on very large files. There are other ways to do it as well but I find this the simplest one.

More on this is discussed at Stack Overflow.

I came across this by reading Alex Pinsker's blog so many thanks to him for the tip.

Wednesday, April 15, 2009

Pakistan starts Daylight Saving Time April 15, 2009

We are lucky that there are not many critical software being used in Pakistan that have to automatically adjust to DST settings (or may be there are but nobody cares!) Otherwise I could see many a software programmers pulling their hair out and yelling into their screens …

"Oh man! … you change Daylight Saving settings and that too on short notice. On top of that you change the clocks in the middle of the week on a business day ... and you are not even certain when the clock will shift back …"

Monday, February 09, 2009

Some Interview Questions

Here are some links to some interview questions related to programming:

(1) FizzBuzz Test:
Write a program that prints the numbers from 1 to 100.
But for multiples of three print "Fizz" instead of the number and for
the multiples of five print "Buzz".
For numbers which are multiples of both three and five print "FizzBuzz"

(Source)


(2) TopCoders

(3) This is interesting. There has been some recent research that proposes a way to separate programming sheep from non-programming goats in computer science classes - long before the students have ever touched a program or a programming language.
Discussion about the paper: http://www.codinghorror.com/blog/archives/000635.html
Link to original research: http://www.cs.mdx.ac.uk/research/PhDArea/saeed/
See this document for the list of questions: http://www.cs.mdx.ac.uk/research/PhDArea/saeed/test(week-0).doc

(4) How might you design a program that lets people play Monopoly with
each other over the internet?

http://weblog.raganwald.com/2006/06/my-favourite-interview-question.html