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.
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
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.
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'".
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.
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".
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.
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.
http://webcache.googleusercontent.com/search?q=cache:zlciYW0...