News for hackers. Stuff that matters.
Re:Ask HN: Who's hiring? (September 2010) by tocomment on Saturday September 04, 2010 @09:33AM (#1662655)
I understand. How long did it take you to solve it?
Re:Ask HN: Who's hiring? (September 2010) by berntb on Saturday September 04, 2010 @11:39AM (#1662858)
Less than 40 lines total for the subproblems, including white space. Less than an hour (if you don't count checking email in the middle).

Would have been slightly faster if I had thought less and brute forced a bit more. A crazy old friend used to say "Don't underestimate brute force and ignorance"! :-)

Re:Ask HN: Who's hiring? (September 2010) by dschobel on Sunday September 05, 2010 @02:30AM (#1664129)
I had about the same LoC for my ruby solution. Time was way longer because I had to read at least three wikipedia articles on various aspects of modulo arithmetic after I was so ashamed of my brute force solutions.

Wonder if anyone tried frequency analysis since that should work well on an affine transform...

Re:Ask HN: Who's hiring? (September 2010) by ratsbane on Monday September 06, 2010 @01:56AM (#1666013)
I thought about that inverse modulo thing too, and then I remembered what Falken said...

I hope yummyfajitas posts some of the answers.

Re:Ask HN: Who's hiring? (September 2010) by ratsbane on Saturday September 04, 2010 @12:07PM (#1662900)
I though about a more elegant approach and then just brute-forced it too when I realized a brute-force solution wasn't really very expensive. cloc shows 7 lines of perl code for my part 1 solution and 22 lines for part two.

[edit] time for my part 1 solution was 7.8 seconds on an old Dell 2650

Re:Ask HN: Who's hiring? (September 2010) by berntb on Saturday September 04, 2010 @01:58PM (#1663067)
Totally different number of lines. Also Perl. 24 lines part 1 (OK, with some diagnosis printing) and 15 for part 2. (That includes use strict;/use warnings; and a few empty lines for both.)

For part 1, with 'time' got real 0m2.865s, user 0m2.780s on a T60 Lenovo/"IBM". I used a few minutes to think about the brute force, which probably saved me half the execution time.

In pure percentage of loss/earn, those minutes for three seconds was probably the worst business of my life... :-) You can take the C/C++ compiler from the old nerd, but you can't stop him from doing premature optimization. :-)