Hacker News new | past | comments | ask | show | jobs | submit | more dschoon's comments login

The original post has disappeared. Here's the google cache:

http://webcache.googleusercontent.com/search?q=cache:zlciYW0...


I don't think trivializing the combinations with Python's builtins, looking up the fib primes with OEIS, or computing factors with Alpha is cheating. I hope, in fact, it's the whole point of the exercise: choose the right tools for the job. If you're writing code to test primeness or generate Fibonacci numbers, I sure as hell don't want to hire you.


If you're writing code to test primeness or generate Fibonacci numbers, I sure as hell don't want to hire you.

Maybe you should have called it the "Greplin Challenge," then, instead of the "Greplin Programming Challenge." It's not a real task, after all; the reward comes from accepting a completely artificial challenge. I'm going to do the challenge before dinner tonight, and before I leave work I could get source code for the solutions from the guy down the hall from me who did the challenge as soon as it was posted -- and you certainly don't want to hire a guy who recodes other people's work for no reason, right?


Maybe we have a different hiring mindset than dschoon - we're equally happy with people who find the answers or create the answers. In a production system, we certainly wouldn't want hand-rolled primeness checking. But in a programming challenge, we think it's fun to write it for yourself.


Oops; I wrote my comment under the assumption that dschoon was with greplin, and in retrospect I'm not sure why. Sorry about that.


Code to generate fibs is literally one line. Remember eigenvalues :)?


Sorry, couldn't help myself!! That approach is just so damn elegant.

int((1/math.sqrt(5))*(math.pow(((1+math.sqrt(5))/2),fibonacci)-math.pow(((1-math.sqrt(5))/2),fibonacci)))

Reference here: http://mathproofs.blogspot.com/2005/04/nth-term-of-fibonacci...


Elegant, but inefficient if you want to get exact values for large n. You're much better off using doubling operations. If you forget those, you can remember them from the matrix version. If fib(0) = 0. fib(1) = 1. etc. Then

       n
  [0 1]  = [fib(n)   fib(n+1)]
  [1 1]    [fib(n+1) fib(n+2)]
With repeated squarings, you can efficiently generate any Fibonacci number you want.


Here (where you have to search through Fibonacci numbers) I suspect memoization is rather the way to go:

  # memoized fibonacci function
  fibtable = {1:1, 0:1}

  def fib (n):
      global fibtable
      if n in fibtable.keys():
          return fibtable [n]
      val = fib (n-1) + fib (n-2)
      fibtable [n] = val
      return val


There is no need to keep track of all previous values.

  last_fib = 0
  fib = 1
  while fib < 225000 or not is_prime(fib):
    last_fib, fib = fib, last_fib + fib


I wrote extremely naive Ruby algos from scratch that solved the problems in a couple seconds, or in the case of the last problem, a couple of minutes. I'm sure the whole challenge would have taken longer if I tried to use any dependencies.


I tend to agree with dkarl here because if it was for real, I would just have looked here to find all the answers and maybe the passwords.

It was way more fun to do it from scratch :D

Thanks grepplin

p.s. the csv was copied in my [] python list :)


David Gelernter is a CS professor at Yale, an author, and as far as I can tell, not really a scumbag. But who knows, he did name his coordination language Linda, because "'Ada' is to 'Ada Lovelace' as 'Linda' is to 'Linda Lovelace'".

http://en.wikipedia.org/wiki/Linda_%28coordination_language%...

He's got quite a few essays on edge.org of some repute, including this one from 2000 in which he eerily and in detail predicts the move to event stream-based information presentation. Quantity, not quality, he says.

http://news.ycombinator.com/item?id=1759763

In any case, all the Mirror Worlds patent trial documents are available here:

http://news.ycombinator.com/item?id=1759843

From the summary there:

The document display lawsuit involved Apple's Cover Flow, Time Machine, and Spotlight displays. Plaintiff Mirror Worlds LLC alleges that Defendant Apple, Inc. infringed on U.S. Patent Nos. 6,006,227 and 6,638,313 B1 entitled "Document Stream Operating System" and 6,725,427 B2 entitled "Document Stream Operating System with Document Organizing and Display Facilities," 6,768,999 B2 entitled "Enterprise, Stream-Based Information Management System".


I built and tried this out. I'm rather shocked to see speed and compression ratio better than gzip -9.

The results of my unscientific test (compression only):

   Compressor  Size  Ratio  Time
   gzip -1     23MB  88%     1.18s
   gzip -2     23MB  87%     1.38s
   bzip2       23MB  87%     5.57s
   xz -1       23MB  87%     5.35s
   xz -9       11MB  43%    10.58s
   bmz         13MB  45%     0.95s


It really depends on the data. For highly redundant data like web pages with lots of boilerplate header/footer, it can compress better because the bm_pack (first pass of bmz) looks for large common patterns over all the input. For typical text, it should be a little worse than gzip but faster.

BMZ = bmpack + lzo by default and can be combined with lzma if necessary. It's not really a BMDiff and Zippy clone, as I've never had a chance to see Google's implementation. It's based on the original Bentley & McIlroy paper: "Data Compression Using Long Common Strings", 1999. Even the two pass idea is from that paper. It was really a wacky experimental implementation (with a lot of room for improvement) to satisfy my curiosity. I'm a little surprised that the 0.1 version has been stable for quite a few people compressing TBs of data through it.


Looking at the code, the hooks are DOM listeners that intercept the click to do the redirect. They don't modify the anchor tag, so there's no reason anyone should see them on mouseover or right-click-copy.


Fish shell (http://fishshell.org) performs essentially the same sort of completion for many classes of files based on context. I've found the complete subsystem to be quite pleasant compared to bash, and I recommend it to anyone interested in trying out this sort of thing.


While lightning can handle classes of files, it's more aimed at abstracting full paths to their basenames. If you can give an example where fish shell do this efficiently, I'd be interested to know. FYI, here's a previous comparison on writing shell functions vs lightning functions: http://www.reddit.com/r/programming/comments/bpodn/lightning...


Related: I've often wondered why no one has found a successful way to brand opt-in ad targeting. You'd have to be big enough for it to matter (Google?), but it would have a tremendously positive effect on both the end-user experience, and on ad revenues.


Because people would just opt-out (or not opt-in at all), therefore leaving you with an Internet with no ads, and Google with no revenue.

That's probably why.


Related, I think, to OP's point: Smart People Can Rationalize Anything: http://habitatchronicles.com/2006/12/smart-people-can-ration...


...

I am actually saddened I now know that. I kind of wish I could have had that same experience.


Maybe you should just take up http://en.wikipedia.org/wiki/BASE_jumping instead


I wondered the same thing, so I did a little extra footwork.

Berkeley Professor David Wagner conducted basically the same research as this dude: http://www.cs.berkeley.edu/~daw/faa/

He came to similar findings regarding selectees: http://www.cs.berkeley.edu/~daw/faa/noid.html

Neither of those pages are dated, though, so it's still possible things have changed in the past three years. Even so, it's worth noting that both these sites are reporting post-9/11 information.

I'm curious and a bit adventurous, so perhaps I'll give it a shot. I bought the jetBlue pass, so I'll have plenty of opportunities. http://jetblue.com/deals/all-you-can-jet/?intcmp=HPHero1Eng_...


According to the HTTP headers, noid.html was last modified on Fri, 20 Oct 2000 05:54:16 GMT


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: