HNHacker News
TopNewBestAskShowJobs

qntm

625 karma · joined September 8, 2010

submissionscomments
qntm··on Is there a winning strategy in Tetris?
Yes, a strategy does exist which can force at least one line in a well of width 10 (and different strategies for 4, 6 and 8). I did a tedious brute-force calculation which demonstrated this a few years back. The code is not particularly presentable and the calculation takes about 11 days on a modern machine (it runs in a single thread), but here: https://github.com/qntm/tetris

The limiting factor is headroom (the depth of the well). For wells of depth 0, 1 and 2, the AI clearly wins, but once the depth increases enough a strategy becomes possible. My belief is that such a strategy exists for all even well widths, although proving this is annoyingly hard.

qntm··on 'Escape Rooms' Challenge Players To Solve Puzzles To Get Out
I find one of the most fascinating questions about constructing an escape room is how exactly you calibrate the difficulty for different groups of people. Some people will finish the room in 30 minutes like you, but others will be totally stumped after 50 minutes despite it being the exact same room.

Both of the rooms I've done had a hints system so a staff member overseeing the game through cameras could send a hint any time we dropped significantly behind schedule.

One of them had a two-room system where you had to solve the first room to get to the second room, and in the second room I believe one or two of the locks had been unlocked ahead of time manually by a staff member, based on how quickly we solved the first room.

Of course every time anybody takes the challenge you acquire more data, and keeping an eye on the emerging patterns must be absolutely critical to engineer an enjoyable challenge for the maximum number of different people. Metrics!

qntm··on Time zone news
Actually you'd need December to have one extra day every year and a second extra day every 4 years.

And the months still wouldn't sync up with the synodic month, because the synodic month doesn't evenly divide the solar year no matter what you do.

qntm··on Closing a door
Better question, does Linus ever say extremely nice, encouraging, generous things and make the front page of HN for doing so?
qntm··on Flash is dying a death by 1,000 cuts, and that's a good thing
Who are you to decide what on my computer is crap?
qntm··on UK surveillance “worse than 1984” says new UN privacy chief
> just download all of the geotagged, timestamped and facially profiled photos of me in the place I went

Or where someone else went...

qntm··on 1980s computer controls Grand Rapids Public School heat and AC
Whether or not they realise it, I think people are building brand new systems right now, using cutting-edge technology, which will survive until 2045.
qntm··on The Hardest Logic Puzzle Ever
If you're puzzled about the implementation, I invite you to inspect the JavaScript code! And if you disagree with my implementation, I'd be interested to know what you would do differently.
qntm··on The Hardest Logic Puzzle Ever
This is a question of implementation, and answering it was part of the reason why I implemented this problem in the form of a computer program in the first place. In this implementation, the True and False gods simply pose the question to Random and take Random's answer - which is random. If you then ask the same question of Random again, of course you may not get the same answer.
qntm··on I Can’t Write My Name in Unicode
So, this person thinks there are 229 languages in India, but actually there's a minimum of 325, possibly twice that?
qntm··on I Can’t Write My Name in Unicode
> He proudly announces that there are ‘no fewer than 147 Indian dialects’ – a pathetically inaccurate count. (Today, India has 57 non-endangered and 172 endangered languages, each with multiple dialects – not even counting the many more that have died out in the century since My Fair Lady took place)

So, how many were there really? At the time, I mean.

qntm··on ASCIIFlow Infinity – ASCII diagrams with export
Those tools could use tooltips...
qntm··on The rise of fake engine noise
It would be good to have a rigid specification for this kind of thing, same as for the colour and blink frequency of signal lights, road sign designs and number plate fonts. Predictability and standardisation is super valuable on the road.

However, I see no reason why the specification can't specify a particular electronic burbling noise from The Jetsons.

qntm··on An experimental real world adblock
Are you aware that "this reminds me of Black Mirror" is a really, really bad thing? Like, did you miss the whole point of the show?
qntm··on Mark Cuban: If Your Company Is Moving For Tax Reasons, I'm Selling Your Stock
And that's not worth hating?
qntm··on Harry Potter and the Methods of Rationality
In the context of the story, information is a substance that you can almost shovel around like snow. Brain-uploading isn't an inevitability in the real world but in Fine Structure it's a (relatively) simple application of informational plumbing.
qntm··on Famo.us open to everyone
> A scroller at is essential is a mathematical set with a curser and that all scrolling does (whether by mouse or keyboard)

Well, by mouse anyway

qntm··on Learn regular expressions in about 55 minutes
Done.
qntm··on Npm's Self-Signed Certificate is No More
Why don't you just stop recommending Node.js?
qntm··on I don't know, Timmy, being God is a big responsibility
> An infinite loop does not end, even in an infinitely powerful computer

Sure it does! Run one processor instruction, then run the next one in half the time, then the next one in half as much time again...

qntm··on FiOS customer discovers the limits of “unlimited” data: 77 TB a month
If I was in charge of an advertising standards authority I would make it outright illegal to use the words "unlimited" or "infinite" in a commercial context.
qntm··on Why I still love Perl
The "There's more than one way to do it" sucks for trying to teach Perl too. You can't just teach one way; you need to teach every way, so that students can understand what they're seeing in the wild. This makes it take three times as long to explain the basics of Perl, simply because there are, essentially, three times as many basics.
qntm··on The $5000 Compression Challenge
Suppose the random file is 3,000,000 bytes long and happens to contain 135 bytes "X". Split the file on the letter "X" into 136 smaller files, each with no X in it. Then, return the files along with a "decompressor" script which says something like:

    return(join("X", files 1 to 136))
Since the script takes up fewer bytes than the 136 "X" bytes would, the total size of the 136 files + decompressor script is less than the size of the original file.
qntm··on Thoughts on being a programmer
Maybe I haven't read K&R carefully enough but how can you have a function declaration like

    sleep(chan, pri)
without any data types?
qntm··on Why I Use Perl: Testing
Perl is also good for creating testing frameworks for other software. Portable supercharged shell scripting.
qntm··on Microsoft sticks to its guns, keeps Do Not Track on by default in IE10
> Ask everyone in the world if they "don't want to be tracked, understanding that is the economic foundation for almost all of the content they enjoy and thus they will either need to directly pay or go without" and somewhere approaching 0% will say yes.

No, something approaching 100% of users will still say yes, adding that robust economic foundation is the content providers' problem, not the users'.

The content providers will then close down or find alternative business models.

qntm··on Microsoft sticks to its guns, keeps Do Not Track on by default in IE10
This is the W3C's problem. "An ordinary user agent MUST NOT send a Tracking Preference signal without a user’s explicit consent"? How, exactly, are they intending to detect the user's explicit consent via the medium of HTTP headers? Why introduce a header which almost everybody in the world would probably want to use by default in every one of their HTTP requests and then say that you can't do that? What if I chose my browser specifically because it has DNT by default? Why introduce a header which doesn't do anything unless you really really want it to?

The Explicit Consent Requirement is nonsensical. But then the DNT header itself is also nonsensical, because there's no legislation or tangible benefit to make request handlers respect it.

Nobody should be tracked unless they've explicitly asked for it.

qntm··on Company withdrawing from Facebook as analytics show 80% of ad clicks from bots
Hey, you show me a performance problem, I show you a solution. Preferably one involving finite state machines.
qntm··on Company withdrawing from Facebook as analytics show 80% of ad clicks from bots
> How about we just make a "blacklist" of these known bots, look up every user agent, and compare against the blacklist? So now every single request to your site has to do a substring match against every single term in this list. Depending on your site's implementation, this is probably not trivial to do without taking some sort of performance hit.

Build a finite state machine which only accepts the terms in the blacklist. That should be a one-time operation.

Then feed each request into the FSM and see if you get a match. Execution time is linear in the length of the request, regardless of the number of terms in the blacklist.

qntm··on Divide a number by 3 without using * / + - % operators
I had the same idea. The problem is that shifting the bits to the right results in decimal points falling off the end, which is actually a big deal because they add up to something substantial (i.e. more than 1) by the end of the sum.

If N = 15692343, the result should be 5230781. Using "N /= 2", you get:

    0
     + 3923085.75 = 3923085.75
     + 980771.4375 = 4903857.1875
     + 245192.859375 = 5149050.046875
     + 61298.21484375 = 5210348.26171875
     + 15324.5537109375 = 5225672.81542969
     + 3831.13842773438 = 5229503.95385742
     + 957.784606933594 = 5230461.73846436
     + 239.446151733398 = 5230701.18461609
     + 59.8615379333496 = 5230761.04615402
     + 14.9653844833374 = 5230776.01153851
     + 3.74134612083435 = 5230779.75288463
     + 0.935336530208588 = 5230780.68822116
     + 0.233834132552147 = 5230780.92205529
     + 0.0584585331380367 = 5230780.98051382
     + 0.0146146332845092 = 5230780.99512846
     + 0.0036536583211273 = 5230780.99878211
     + 0.000913414580281824 = 5230780.99969553
     + 0.000228353645070456 = 5230780.99992388
    ...
which eventually reaches the correct answer for any desired degree of accuracy. But using "N >>= 2", you get:

    0
     + 3923085 = 3923085
     + 980771 = 4903856
     + 245192 = 5149048
     + 61298 = 5210346
     + 15324 = 5225670
     + 3831 = 5229501
     + 957 = 5230458
     + 239 = 5230697
     + 59 = 5230756
     + 14 = 5230770
     + 3 = 5230773
     + 0 = 5230773
which is out by 8.
Page 1 of 9Next →