HNHacker News
TopNewBestAskShowJobs

elitheeli

236 karma · joined September 3, 2010

submissionscomments
elitheeli··on How We Beat C++ STL Binary Search
If you take version 4, stop the first while loop once the size is at most 32, and then do linear search from there, it's faster (on my machine). For example, version 4 is 102ms and this tweak puts it at 83ms. (On clang x64.)
elitheeli··on Cyclic Tag System: 1 Line of Turing-Complete Code
Almost a year ago I tried to see how short of a cyclic tag system I could make in Ruby. The result: https://github.com/elitheeli/stupid-machines/blob/master/sho...
elitheeli··on Conway's Game of Life in 140 bytes Ruby
I really should have refreshed the comments page before shortening... seems like we think similarly: https://gist.github.com/1803557
elitheeli··on One-hour Project: really fast timer
Hadn't seen that. Doesn't show up when searching for "timer" or "countdown". If I'd seen these, probably wouldn't have wasted an hour.
elitheeli··on One-hour Project: really fast timer
I didn't bother to test in anything besides Chrome on Mac. I was going to put in an audio alarm, but then I'd have to put in a button to disable audio, then I'd have to make it look pretty, and find a good alarm sound.

That feature is on my todo list, as well as email notification, persistent countdowns (you go to /23h and it'll redirect you to a permalink for that timer), email/SMS notification. Next time I have an hour to dedicate to this, I'll them done.

I always have a browser open, so being able to see the countdown status in the titlebar was sufficient for my needs. If I really wanted something to alert me, I'd use my phone in case I step away from my computer.

EDIT: Yeah, looks like Firefox performs awfully with this.

EDIT2: seems to be fixed on FF now.

elitheeli··on HTML + CSS3 is Turing complete
I should have phrased as "what is the minimum number of characters that need to be seen by a Ruby parser in order to have something Turing equivalent to Ruby without a limited character set?"
elitheeli··on HTML + CSS3 is Turing complete
But what's in that string? That still counts. What I should have done was put an additional restriction on what IO is available. Otherwise, something like "eval `cat f`" or something could be all powerful.

My first attempt shows Ruby simulating a cyclic tag system with only 15 unique characters including newlines and spaces: https://github.com/elitheeli/oddities/raw/master/only_a_few_...

EDIT: down to 14 characters.

elitheeli··on HTML + CSS3 is Turing complete
Sorry, you're totally right. My bad.
elitheeli··on HTML + CSS3 is Turing complete
When I say "Turing complete", I mean Turing equivalent to a Turing machine. Since there are infinitely many Turing machines but I'm pretty sure humanity has access to a finite amount of state. I mean it strictly in the theoretical sense.
elitheeli··on HTML + CSS3 is Turing complete
TeX is very Turing complete. As is Java sans semicolons, C macros, and many other things that probably shouldn't be. Right now, I'm trying to figure out what the minimum number of characters you need in Ruby is to make it Turing complete. I'm pretty sure that if you restrict yourself to under 12 characters, it's still possible.
elitheeli··on HTML + CSS3 is Turing complete
I tried to do a little bit better of a job explaining it above. I was caught off guard... I intended to post this in a few days with a proper explanation.
elitheeli··on HTML + CSS3 is Turing complete
Is my MacBook Pro any more Turing complete? All of the memory came with it. There's no way to expand the memory as it's running.
elitheeli··on HTML + CSS3 is Turing complete
Way to steal my karma.... :)

As the original author of this, I was going to put it into a much more presentable state before showing it off here.

For those confused, here's a proper explanation. No real-world thing can actually be Turing complete (able to express basically any computation that we might want to perform of any size). That's because there are finitely many atoms in the universe, so we can only construct machines of finite size.

It's well known that Rule 110 (Google it) is Turing Compete.

What I've done is made an implementation of Rule 110 in HTML and CSS. Since CSS can't actually really manipulate state, some user interaction is required to "drive" it. In the one that bgruber linked to, it's clicking.

Here's a bigger version that doesn't require the user to know where to put his mouse. The tab-space combo is just as legitimate as requiring that you plug a computer into a wall to power it in order to run a Java program. http://elilies.com/rule110-full.html

Also, I haven't tested it on anything besides the latest Chrome on Mac.

elitheeli··on Stop relying on your ORM and learn SQL
ActiveRecord (Rails) provides counter caches for this instance. There are also gems that will analyze the queries your ORM performs to tell you which ones you should optimize.

I tend to stick with "premature optimization is the root of all evil".

elitheeli··on Ask HN: Review my winter break project (statusdot - hosted website status pages)
Thanks, we'll try to get these fixed ASAP.
elitheeli··on Ask HN: Review my winter break project (statusdot - hosted website status pages)
I'd also like to thank everyone in advance for feedback. In exchange, here's a clickable link: http://statusdot.com