Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
qntm
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
15 ms
·
121.
▲
by
qntm
15y ago
This is the entire answer. It amazes me that people can write so much about this question without managing to get to this statement.
122.
▲
by
qntm
15y ago
I wrote a thing about my exceptionally short urls a little while ago: http://qntm.org/urls
123.
▲
by
qntm
15y ago
Ooh. That's actually cleverer. It reduces the space of possible wells quite substantially. It does make detecting a horizontal line more difficult, though. I will think about this.
124.
▲
by
qntm
15y ago
Alpha-beta pruning sounds like a reasonable route forward. In this case, each "well" is a state in the game and placing a new piece in the well constitutes a move to a new state. Since the "heuristic value" of a move is absolute (player win
125.
▲
by
qntm
15y ago
You're suggesting using 2 bits to store the height of the column, plus 3 bits to store the presence of holes, for a total of 5 bits per column. Exactly how you got from that to a figure of "2^23" I don't know. That's actually (2^5)^10 = 2^5
126.
▲
by
qntm
15y ago
I'm afraid the game tree for W10xH5 is over 2 gigabytes and I'm pretty sure the number of possibilities increases faster than exponentially in H!
127.
▲
by
qntm
15y ago
You are correct. I updated it to this: who_wins(well W) { for each piece P { for each landing state of piece P in well W { well W2 = result if(that_makes_a_line(W2)) { next piece
128.
▲
by
qntm
15y ago
Because the cheater gets out the other end of the degree course with a degree they didn't earn. And then they start competing for the same jobs as me.
129.
▲
by
qntm
15y ago
MySQL queries constitute a signification proportion of SQL queries, and PHP's MySQL extension is responsible for a significant proportion of MySQL queries. It's not a problem of MySQL and it's not even a problem of how the PHP code that use
130.
▲
by
qntm
15y ago
Will this result in more people using the prepared statements provided in PDO etc.? Then this could reduce the global number of MySQL injection attacks by a noticeable percentage.
131.
▲
by
qntm
15y ago
For arbitrary messages: sub escape { my $arg = shift; $arg =~ s/([^a-zA-Z0-9_])/\\$1/g; return $arg; }
132.
▲
by
qntm
15y ago
I instinctively distrust code that works first time. I advocate error-driven development.
133.
▲
by
qntm
15y ago
What are the advantages of instantiating the Singleton object in multiple different locations rather than, for example, using the Singleton class itself as an object with various static attributes and methods?
134.
▲
by
qntm
15y ago
I didn't know that a grammar featuring recursion can still be called a "regular" grammar if the language it describes is regular. However, no regular grammar (not even a recursive regular grammar) can describe a recursive language.
135.
▲
by
qntm
15y ago
Negative, a regular grammar which describes a regular language cannot be recursive. For recursion you need to be context-free at least. Of course, most modern "regex" engines provide features which go beyond the strictly regular languages.
136.
▲
by
qntm
15y ago
This seems like it would cause more problems than it solves. "It's 10:00 here in London. I need to call someone in New York, what time is it there?" "10:00, same as it is everywhere in the world." "So... is now a good time to call them?" "I
137.
▲
by
qntm
15y ago
Isn't ".bak" a fairly logical file extension for a cron job intended to, e.g., perform backups?
138.
▲
by
qntm
15y ago
I'm still not 100% sure what the answer to the second question is. I think a more compelling example is needed.
139.
▲
by
qntm
15y ago
The worst part is, if you are a mathematician and you expect the modulus operator to behave exactly as it does in mathematics then it can be maddeningly difficult to track down why your program isn't working correctly. You just don't expect
140.
▲
by
qntm
15y ago
Of course it isn't an argument against powerful text editors. It's an argument against obtuse text editors.
141.
▲
by
qntm
15y ago
> A novice tool never makes anything but the most trivial task easy I disagree with this statement in the strongest terms.
142.
▲
by
qntm
15y ago
I'm saying that the meaning of the text - be it prose, poetry or code - is all that is important. Text editors are tools, like paintbrushes and screwdrivers. They only important or valuable to the extent that they enable us to create stuf
143.
▲
by
qntm
15y ago
This essay was evidently written in 1997. I don't know what the competitors to Emacs were in 1997 other than Vi, but these days there are extremely powerful text editors which are exceedingly easy for a novice to pick up and use right out
144.
▲
by
qntm
15y ago
Maybe wide acceptance isn't the use case! It's okay to intend a tool for a specific purpose! It's okay to do one thing well .
145.
▲
by
qntm
15y ago
SQL injection problems are trivially preventable.
146.
▲
by
qntm
15y ago
Socrates was wrong. We are wrong now, as well. But to say that we are as wrong as Socrates is ridiculous. We are much, much, much closer to the truth now than we have ever been.
147.
▲
by
qntm
15y ago
The good parts of PHP, just off the top of my head: Extremely forgiving syntax which makes it quick and easy to bash together something that just works, implicit type conversion, a vast array of built-in functions, readability, near-ubiquit
148.
▲
by
qntm
15y ago
I learned Perl by reading Learning Perl, but even trying to use Programming Perl as a reference since then has been difficult for me. The book is conversational and humorous in its tone, which makes it extremely verbose and irritating to
149.
▲
by
qntm
15y ago
Programming Perl is definitely guilty of this.
150.
▲
by
qntm
15y ago
That's because in Python the line break is the statement terminator.
More ›