Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
wbhart
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
66 ms
·
631.
▲
by
wbhart
16y ago
The trick with such questions is finding an interpretation which is neither over nor underspecified and for which the answer is not obvious. The question only supposes that 144 is a digit in the base. We might also write the fibonacci seque
632.
▲
by
wbhart
16y ago
Interesting problem: for what base (if any) is this actually true. Now there's an actual interview question!
633.
▲
by
wbhart
16y ago
I recently wrote an interpreter in C for a made up language. As a test of its performance, I coded up a powmod function, powmod(a, e, n) = a^e mod n (where ^ is power not xor). The program contained the lines: if (n % 2 == 0) return (p
634.
▲
by
wbhart
16y ago
I recently used a regexp library in Scheme for lexing. The result was O(n^2) on the number of tokens in the input stream. I searched for ages to find where I had gone wrong and finally realised it was the regexp library itself. I switched t
635.
▲
by
wbhart
16y ago
#include <stdio.h> #include <stdlib.h> void main(int j) { printf("%d\n", j); (main + (exit - main)*(j/1000))(++j); } Somehow the solutions that crash on exit are cheating too much. The above doesn't (o
636.
▲
by
wbhart
16y ago
I'm stunned. I've spent a year looking for a language with that set of features, and I mean, I really tried! There's a few odd choices. The use of some fairly bizarre operators for unsigned integer arithmetic is slightly weird (a bit like *
637.
▲
by
wbhart
16y ago
There's a scheme described in this paper: http://gmplib.org/~tege/division-paper.pdf which will work in practice for 2^b bit divisors (e.g. 2^b = 32 or 64). It's trivial to implement and amazingly doing a precomputation plus division actu
638.
▲
by
wbhart
16y ago
What is wrong with 64 bit integers? Maybe they've been indicted on war crimes or something. The number of languages that appear and don't support them.... And what about interfacing with C? I can count the languages on one hand that have a