Live data from Hacker News

You Can't JavaScript Under Pressure

toys.usvsth3m.com

21–30 of 110 posts

Re: You Can't JavaScript Under Pressure

#21
post #16

Fun little puzzles. First 4 went pretty quickly (~8:00) and then the last one took ~7 minutes Googling around for this so I could test if a variable was an integer... n===+n && n===(n|0) Wish I could see my answers after the fact though! Edit: Read the initial requirements of the puzzle, it says sum all the integers , not all the numbers . People using (typeof i[x] == 'number') just got lucky because the test-cases d…

typeof n === 'number' It didn't actually require differentiating between integers and floats, just numbers and other types.

    > typeof 5.4
      "number"

Re: You Can't JavaScript Under Pressure

#22
post #15

Earlier quoted context omitted.

Because of your comment, HN will have a dozen "I am so disappointed in all of you" posts in the coming week declaring how mean everyone here is, and how it is no longer like it "once was". I hope you are happy.

I'd be happier if this page hadn't blasted music into my conference call.

Hehe. I wish OSX had individual program volume controls... On Windows 7 I usually have flash process volume on 'off', unless I'm specifically watching something.

Re: You Can't JavaScript Under Pressure

#23
post #2

Oh! Hello. This is my thing I made for usvsth3m.com. Hope y'all like it. HTML5 Webworkers made it possible - sandboxing user-submitted JavaScript so an accidental while(1) or document.write can't kill everything. Do have a look at the source code. Oh, and try turning up your speakers and typing in the Konami code...

If you alert() something inside an infinite loop it doesn't seem to be able to detect it (nor does it show an alert box!)

Re: You Can't JavaScript Under Pressure

#26
Fun distraction. For me it was:

30% figuring out the answer, 20% not having my editor shortcuts available, 50% figuring out how to check if a value is a certain type.

Am I the only one that gives their functions preconditions that the input is good? To me, throwing up when you're passed a non-number to a sum method is correct behavior.

Re: You Can't JavaScript Under Pressure

#28
post #16

Fun little puzzles. First 4 went pretty quickly (~8:00) and then the last one took ~7 minutes Googling around for this so I could test if a variable was an integer... n===+n && n===(n|0) Wish I could see my answers after the fact though! Edit: Read the initial requirements of the puzzle, it says sum all the integers , not all the numbers . People using (typeof i[x] == 'number') just got lucky because the test-cases d…

typeof n === 'number' It didn't actually require differentiating between integers and floats, just numbers and other types.

This typeof stuff (and having number instead of integer, string, etc) was the hardest part of this for me.

Normally javascript function inputs aren't this messy.

Re: You Can't JavaScript Under Pressure

#29
post #15

Earlier quoted context omitted.

Because of your comment, HN will have a dozen "I am so disappointed in all of you" posts in the coming week declaring how mean everyone here is, and how it is no longer like it "once was". I hope you are happy.

I'd be happier if this page hadn't blasted music into my conference call.

Your fault for not paying attention during a conference call...
Post reply on HN