Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
psykotic
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
55 ms
·
451.
▲
by
psykotic
15y ago
The master theorem is a blight on the teaching of analysis of algorithms. The main reason is that few students understand what makes it work and end up treating it as a piece of plug-and-chug equipment. The second reason is that it is not v
452.
▲
by
psykotic
15y ago
> I think you're discounting the other benefits of working at a startup vs. a larger company False dichotomy. There are plenty of smaller non-startup companies that pay well and offer everything else you mention without asking you to ga
453.
▲
by
psykotic
15y ago
Hey, sorry for the late reply. It seems pretty obvious to me, so I'm not sure what is confusing you. class Monad m => ChoiceMonad m where choice :: [a] -> m a For the list monad, choice is just the identity function
454.
▲
by
psykotic
15y ago
Thanks to you and others for jumping in and pointing this out! There's nothing better than being corrected when it means learning something new and solving a long-standing problem.
455.
▲
by
psykotic
15y ago
The bloating can be extraordinary. When you're shipping libraries to discerning customers (programmers, not end users), perception really does matter. A related issue which is more about the compiler than the operating system is that PDBs w
456.
▲
by
psykotic
15y ago
While we're complaining about the sorry state of Linux, something it's desperately lacking (for those of us who ship binary-only libraries and executables) is an equivalent of Windows's PDBs or OS X's dSYMs for post-mortem debugging without
457.
▲
by
psykotic
15y ago
IANAL. But I've been told that an abstract color scheme like this isn't covered by IP laws, while a color scheme in a specific context may be considered part of a trademark or trade dress. In either case it would not be covered by copyright
458.
▲
by
psykotic
15y ago
Yeah, aside from the swap trick, there's very little to the Fisher-Yates-Knuth shuffle. It's just following the standard recursive recipe for generating permutations: to generate all permutations on n distinct elements, try every element in
459.
▲
by
psykotic
15y ago
I can't say it qualifies as the absolute minimum everyone should know, but I highly recommend reading the book Unicode Demystified if you're the kind of programmer who wants to understand how everything works.
460.
▲
by
psykotic
15y ago
Yet another approach: Translate the regular expression for the disjunction of the search terms into a DFA. Then traverse each document with the DFA to find all matches. Traversing a string of length n with a DFA takes O(n) time regardless o
461.
▲
by
psykotic
15y ago
You left out Berkeley's annual programming contest: http://www.cs.berkeley.edu/~hilfingr/programming-contest/ The bottom of the page also has links to problem sets from a bunch of other contests.
462.
▲
by
psykotic
15y ago
> Better still to find an opportunity that has a chance of making it to $100mm if everything goes perfectly, but might end up at $2mm on a bad run. If you know of a business where even a bad run nets you $2mm, I'm sure everyone here wou
463.
▲
by
psykotic
15y ago
Thanks for catching that!
464.
▲
by
psykotic
15y ago
Yeah, that works. My left-to-right traversal would be also a little nicer if C had parallel assignments as in Python: for i in range(n): p = 0 for j in range(i): buf[j], p = buf[j] + p, buf[j] buf[i
465.
▲
by
psykotic
15y ago
Happy fun time: pascal = iterate (\xs -> zipWith (+) ([0] ++ xs) (xs ++ [0])) [1] Bread and butter: void pascal(int n, int *buf) { for (int row = 0; row < n; row++) { for (int prev = 0, col = 0
466.
▲
by
psykotic
15y ago
This idiom is even more useful in functional programming where the last step is an inverse of the first step in the applicative sense rather than in the side-effects sense. Mathematicians call it conjugation, and it can be usefully thought
467.
▲
by
psykotic
15y ago
> One caveat with EVERY “end users maintain this” system is that workflow rules, tables, DSLs, and everything else they “maintain” is CODE. It may not look like code, but if it drives the behaviour of the system, is code. In some ways t
468.
▲
by
psykotic
15y ago
This is just bad technical writing. He is unable or unwilling or simply too lazy to produce a single concrete real-world example of the object of his high praise. He says he has found applications ranging from real-time embedded systems to
469.
▲
by
psykotic
15y ago
Incidentally, I ran into a nasty x64 __asm__ codegen bug with exactly the same compiler version that this blog post covers. It was in lockless multithreaded code, so you can imagine how much fun that was to debug. Rather than work around it
470.
▲
by
psykotic
15y ago
You can generate the Sierpinski pattern in a lot less code than posted: iterate (\xs -> zipWith xor ([0] ++ xs) (xs ++ [0])) [1]
471.
▲
by
psykotic
15y ago
Well, alloca is not specified in any formal standard, so you won't find an official ruling on whether it's undefined, unspecified or well-defined. By itself, that state of affairs should strongly discourage its use in portable code.
472.
▲
by
psykotic
15y ago
This is a fun puzzle. Here's my take on it. I stopped reading the article after the introduction so I could attack the problem fresh, so hopefully this isn't the same as what the author did. The trick is working backwards. We want to quickl
473.
▲
by
psykotic
15y ago
I'm not sure of the purpose of spending the first article on something as irrelevant as parsing when he could just be using Ruby's rich support for data literals. One mildly interesting aspect of simulating a Turing machine is how you deal
474.
▲
by
psykotic
15y ago
That's an easy but in my opinion wrong conclusion to draw. The magic of lambda calculus is that unlike Turing machines it supports building abstractions that let you hoist yourself out of the tarpit and present a usable programming interfac
475.
▲
by
psykotic
15y ago
No, iterate is just a helper function to convert a Haskell integer to a Church numeral. If the inputs were directly represented as Church numerals, it wouldn't be needed and you'd just replace every instance of iterate n with n itself. I th
476.
▲
by
psykotic
15y ago
Gorgeous piece of writing! You don't actually need the Y combinator for any of the cases presented like mod, range, etc. Church numeral iterators are more than sufficient for the task. I'll use Haskell to illustrate, but you could easily tr
477.
▲
by
psykotic
15y ago
For the view-source impaired, the direct URL is http://traffic.libsyn.com/wtfpod/WTF_-_EPISODE_111_LOUIS_CK....
478.
▲
by
psykotic
15y ago
He said non-cryptographic.
479.
▲
by
psykotic
15y ago
Charles's blog is basically a stream-of-consciousness brain dump. He's not trying to convince you or anyone else, trust me.
480.
▲
by
psykotic
15y ago
More fundamental than Bayes's theorem is the probabilistic counterpart of modus ponens: P(A/\B) = P(B|A) P(A). This corresponds to the logical rule of inference A, A->B |- A/\B. Note that modus ponens is usually stated in the form A, A-
More ›