<vigs>
I was just reviewing an assignment and I was stupid
<vigs>
don't mind me
<vigs>
what's up?
<devyn>
ahhahaha
<devyn>
wait
<devyn>
dude why would you even
<devyn>
like
<devyn>
why this.seed;
<devyn>
on its own
<devyn>
that
<devyn>
to the best of my knowledge
<devyn>
does nothing
<devyn>
unless JS is weird
<vigs>
what I don't need that line either
<vigs>
whoa
<vigs>
holy shit
<devyn>
how much
<devyn>
have you drank
<devyn>
tonight
<devyn>
lol
<vigs>
NONE
<vigs>
I'm taking two courses in JS this quarter, okay?
<devyn>
also that's kind of a bad rand() function, since it allows you to very easily get the seed from the number it returns and therefore predict the next number
<devyn>
lol
<vigs>
how so?
<devyn>
Math.random() * 8192 == Math.seed
<vigs>
ah
<vigs>
we were given that equation
<vigs>
It's so the automatic grader can check everyone's code for the same answer
<devyn>
ok
<devyn>
additionally
<devyn>
replace
<devyn>
if(arguments[0])
<devyn>
with
<devyn>
if(typeof arguments[0] !== 'undefined')_
<devyn>
s/_$//
<devyn>
oops
<vigs>
so it can seed it with 0?
<devyn>
yeah
<devyn>
you should probably also do
<vigs>
well, alright. It had to pass a pretty rough character limit, so I guess I was lucky it didn't check that case
<devyn>
this.seed = +arguments[0];
<vigs>
why's that?
<devyn>
well,
<devyn>
it's probably fine actually
<devyn>
never mind
<devyn>
but basically
<vigs>
what's the + doing there?
<devyn>
that would be to make sure it gets converted to a number
<vigs>
ahh
<devyn>
-test
<devyn>
purr?
<devyn>
damn it
<devyn>
ok
<vigs>
lol
<devyn>
> +"2";
<devyn>
2
<devyn>
> +"-2";
<devyn>
> +"-2.3";
<devyn>
-2
<devyn>
-2.3
<devyn>
see
<SwooshyCueb>
ELLIOTTCABLE JOIN USSSSSSSSSSS
<devyn>
it's like parseFloat but more cryptic
<devyn>
;)
<devyn>
hahaha
<vigs>
devyn: whoa, neat!
<devyn>
and if you want to make sure it's a 32-bit signed integer
<devyn>
you can do | 0
<devyn>
> "3209302.3298392" | 0
<devyn>
3209302
<devyn>
> Math.pow(2,32)
<devyn>
4294967296
<devyn>
0
<devyn>
> 4294967296 | 0
<devyn>
xD
<vigs>
rad
<vigs>
This is awesome
<devyn>
yeah 'cuz bitwise operations automatically make them 32-bit signed ints
<devyn>
internally
<devyn>
any bitwise operation does, but | 0 is easy and doesn't do anything obviously
<devyn>
heh
<devyn>
unfortunately it also really sucks. you really shouldn't be able to coerce types like that
<vigs>
yeah, that too
<devyn>
it leads to so many bugs
<devyn>
easily
<devyn>
lol
<vigs>
I'm both mindblown and angered by js :P
<vigs>
I think the defining moment (so far) of that sentiment was when I learned what happens when you do this:
<vigs>
> var x = 0;
<vigs>
> x.property = 42;
<vigs>
> print(x.property);
<vigs>
undefined
<devyn>
yep, numbers are unboxed
<jesusabdullah>
YOU're unboxed!
<vigs>
yeah, when that clicked, I literally recoiled :D
<devyn>
same with strings
<vigs>
yeah
<devyn>
JS primitives are unboxed
<devyn>
unlike Ruby haha
<vigs>
apparently they're known as elementals, not primitives
<devyn>
although I think primitives like numbers are kinda unboxed
<ELLIOTTCABLE>
SwooshyCueb: too bad I missed you >:
<ELLIOTTCABLE>
devyn: THANK YOU
<ELLIOTTCABLE>
devyn: THAAAAAAT
<devyn>
yeah, I always kind of dismissed it but honestly it's gotten pretty good
<devyn>
I just miss one of my chrome extensions
<devyn>
:/
<devyn>
in a way it's good probably
<devyn>
because
<devyn>
I think I was relying on it too much
<devyn>
and not really learning
<devyn>
words
<devyn>
haha
<ELLIOTTCABLE>
devyn: which one?
PragCypher has quit [Quit: Leaving]
<devyn>
lol, rikai-kun
<devyn>
I use it to talk to Mai
<devyn>
it's easier to have a conversation
<devyn>
if you can look up words you don't know
<devyn>
by hovering over them
<ELLIOTTCABLE>
devyn: what?
<devyn>
ELLIOTTCABLE: for talking to cute Japanese girl >_<
<devyn>
:p
<ELLIOTTCABLE>
oh lol
<devyn>
meh, she's kinda old for me, and, you know, lives in Kyoto. but at least I've seen her IRL, unlike you
<devyn>
hell she's even been to my house
<devyn>
xD
<devyn>
I met her under kind of odd circumstances, and, somehow, 5 years later, we're still friends
<ELLIOTTCABLE>
wat really
prophile has joined #elliottcable
yorick has joined #elliottcable
vil has quit [Ping timeout: 252 seconds]
vil has joined #elliottcable
Sorella has joined #elliottcable
prophile has quit [Quit: The Game]
<devyn>
ELLIOTTCABLE: yeah. started talking to her a lot lately, dunno why. I usually check in on her every three months or so and we chat for a few hours but I guess I'm more fun to talk to now haha
<devyn>
I made her laugh on the train o.o
<devyn>
lol
<devyn>
basically my high school takes japanese students for a tour for a week every second year, and they assign each of them to a student
<devyn>
I got picked for her
<devyn>
so
<devyn>
and I guess she really enjoyed hanging out with me
<devyn>
because we emailed a lot still even after
<devyn>
and now, of course, she has Facebook
alexgordon has joined #elliottcable
<fwg_>
soooooo guys
<fwg_>
I've been away for more than half a year
<fwg_>
ANY GRAND DEVELOPMENTS?
fwg_ is now known as fwg
fwg has quit [Changing host]
fwg has joined #elliottcable
Sgeo has quit [Read error: Connection reset by peer]
<vigs>
mornin
Sorella has quit [Quit: Ex-Chat]
trolling has joined #elliottcable
trolling has quit [Quit: Lost terminal]
Willox has quit [Remote host closed the connection]
sharkbot has quit [Remote host closed the connection]
sharkbot has joined #elliottcable
Willox has joined #elliottcable
prophile has joined #elliottcable
bradleymeck has joined #elliottcable
gozala has joined #elliottcable
eligrey has joined #elliottcable
prophile has quit [Quit: The Game]
prophile has joined #elliottcable
prophile has quit [Quit: The Game]
prophile has joined #elliottcable
PragCypher has joined #elliottcable
fwg has quit [Ping timeout: 276 seconds]
fwg has joined #elliottcable
cloudhead has joined #elliottcable
prophile has quit [Quit: The Game]
<devyn>
fwg: no nothing really. I think there's a Paws implementation that actually runs stuff now though