Better HN
topnewbestaskshowjobs
Log inSign up

bytex64

36 karma · joined Mar 30, 2010 (16y ago) · 17 submissions

Submissions

comment 5y ago · link · parent

Hey guys! Glad (and a little panicked) to see this get some more attention. I've shut down signups/logins because I don't have time to moderate, and right now you really have to moderate. :|

So long and thanks for all the barfs. :)

comment 5y ago · link · parent

Despite my ex-roommate's well-intentioned defense, I was probably sober for most of it. It was also a decade ago and I'm somewhat wiser now. As mentioned elsewhere, I learned a lot about making such bold claims to the Choir of Ultimate Pedants. But it was something I had fun with, and I think the world needs more of that. :)

comment 5y ago · link · parent

Sorry about that! Should be working now.

Here's something I never thought I'd say: Perl made breaking changes. My guess is additional strict things broke the gitweb CGI script (which was hopelessly out of date anyway).

comment 12y ago · link · parent

> I can't be the only one who refuses to use their service because of it

Certainly not, but the vast majority of people seem to be willing to trust them and pay for service, so I can understand why it's not a priority. I'm not trying to say you're wrong -- I'd like to see source for SpiderOak, too -- I'm just saying that I understand why it hasn't happened.

comment 13y ago · link · parent

I tend to trust in incompetence over conspiracy. With Kim Dotcom, though, who knows?

comment 13y ago · link · parent

Without real privacy, it doesn't protect him or his users.

comment 13y ago · link · parent

Release early, release often works pretty well when the whole world is waiting for you to make a mistake. They are certainly getting a lot of valuable advice for free.

It would have been better for their users, however, if they'd tried to get this right before releasing. Mega smells very much like marketing over technology.

comment 14y ago · link · parent

Yep, that was an accident. I've removed the parameter entirely. Nice catch!

comment 14y ago · link · parent

I've merged in your changes and made a few improvements, too. I streamlined the timeout handling so that it uses setTimeout instead of clearing and resetting setInterval. I also used color literals instead of CSS rgb(). I removed the reset to black in I() since recreating the canvas context does that automatically.

Thanks, biot, you are officially awesome!

comment 14y ago · link · parent

Sure thing. What was ww=0; trying to do? It seems to be the only place ww is referenced.

comment 14y ago · link · parent

I thought the same thing until I watched a talk a few weeks ago about HTML5, and the guy demonstrated the world's smallest text editor:

  data:text/html,<pre contenteditable>

comment 14y ago · link · parent

Ah, I used 11.60. It just came out a few days ago, and it may have added bind(). I seem to recall they added some ES5 features in this release. Go upgrade! :]

comment 14y ago · link · parent

Very nice. I also see you got a few other tricks that I missed, like factoring out the random number generator. I am impressed.

comment 14y ago · link · parent

I read somewhere that most browsers have a practical limit to what you can paste in. What I should have written was that it would fit in an address bar. shrug

comment 14y ago · link · parent

I thought about it. It's been so long since I've played Nokia snake that I didn't remember whether it queued inputs or not. I decided not to bother since it would make input handling more complicated.

comment 14y ago · link · parent

If you're curious, the "readable" version is here: http://bytex64.net/code/datasnake/snake.html

I started out writing it as straightforward as possible, then applied functional tricks to slim it down. That was a lot of fun. I'm not sure how to post a code snippet here, but I'll try to illustrate one of my favorite portions.

In the original, I did key input with a switch statement. That got replaced by:

    { 37: P(-1,0), 38: P(0,-1), 39: P(1,0), 40: P(0,1) }[e.keyCode]
"But wait!" you're thinking, "What happens when e.keyCode is less than 37 or more than 40?" What happens is it evaluates to undefined, and it errors out in the M() function, effectively short-circuiting it. If you look in your browser's error log, it'll spew an error every time you hit another key. It's lazy, but it works. :]

comment 14y ago · link · parent

That's weird. I developed it in Opera.