Posts

Showing posts from June, 2010

Facebook Puzzle (liarliar) Test-cases

Below are some of the test cases I picked (and tested against) from the liarliar Facebook discussion forum.

Test-case 1
http://paste2.org/p/870660
$ javac LLTest.java $ java LLTest 100000 20090727 >1.in $ java liarliar 1.in 50091 49909
Test-case 4
http://paste2.org/p/870663
$ java -Xmx512m LLTest4 1000000 1 >4.1.in $ md5sum 4.1.in b91b728927d43da2c745f4ff2a57953b 4.1.in $ java liarliar 4.1.in 500112 499888
Test-case 5
http://paste2.org/p/870666
$ java -Xmx512m LLTest4 1000000 1 >4.1.in $ md5sum 4.1.in b91b728927d43da2c745f4ff2a57953b 4.1.in $ java liarliar 4.1.in 500112 499888
Above test-cases are not created by me. Credits to David Eisenstat.

How to get Eclipse source files unix compatible.

Unlike Unix, which uses a bare line feed (\n) to denote the end of a line, Windows uses a carriage return followed by a line feed (\r\n). When present in an interpreter specification, this extra carriage return is a problem, as the robot reads #!/usr/bin/python\r\n, for example, and can’t find the interpreter /usr/bin/python\r ! If your program has an interpreter specification, make sure you convert it to Unix text before submitting. Alternatively, put your code in a file called (for example) hoppity.py and also send a file called hoppity with the contents.
[source]Discovered the unpleasant Windows new line characters in my source code and wanted to remove the extra \r carriage return at the end of file in order to submit the source code to Facebook Puzzlebot.

Below are the steps to make your source code Puzzlebot compatible.

To set file encoding to UTF-8 and line-endings for new files to Unix, so that text files are saved in a format that is not specific to the Windows OS and most e…