« first day (2457 days earlier)      last day (2713 days later) » 
00:00 - 18:0018:00 - 00:00

18:29
!!>(data ={},data.onlyNumbers = [ 'AAAA', '2.5', 'CCCc', '3', 'dDdDD' ],data.onlyNumbers= data.onlyNumbers.filter(x=> !Number.isNaN(+ x)))
@Arrow ["2.5","3"]
Number.isNaN(+ x) seems odd
don't I need a unary
holy
i just realized i have a ton of food
1200 meat and 1200 rice
.filter(Number.isNaN)
Oh wait, that's opposite
18:42
ohnoes, it's snowing
ya that wont work
lol
.filter(Number) (but it would fail on 0)
!!>(data ={},data.onlyNumbers = [ 'AAAA', '2.5', 'CCCc', '3', 'dDdDD', '0' ],data.onlyNumbers= data.onlyNumbers.filter(Number))
@Shmiddty ["2.5","3"]
!!>(data ={},data.onlyNumbers = [ 'AAAA', '2.5', 'CCCc', '3', '0' ],data.onlyNumbers= data.onlyNumbers.filter(x=>!Number.isNaN(+ x)))
@Arrow ["2.5","3","0"]
18:47
!!>Number("3").isNaN
@Shmiddty That didn't make much sense. Use the !!/help command to learn more.
@Shmiddty "undefined"
it will only fail on empty strings
That why I should probably use trim
!!>(data ={},data.onlyNumbers = [ 'AAAA', '2.5', 'CCCc', '3', '0','',' ' ],data.onlyNumbers= data.onlyNumbers.filter(x=> x.trim() && !Number.isNaN(+ x)))
@Arrow ["2.5","3","0"]
Why ever use Number when you have Unary
18:55
why ever use Unary when you have Number
O, snap... where did you get all that food
because Unary can convert string representations of integers and floats including non-string values to true, false and null. Integers into decimal and hexadecimal and even negative numbers
and if it can't parse it evaluates to NaN
!!>Array(55).join(+'Kevin B') + ' Batman!'
@Arrow "NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN‌​NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN‌​NaN Batman!"
i killed a giant pack of beavers
and pigs
and killed a few male muffalos
that's good, but beavers are good for the environment. they preserve wetlands. you did not serve humanity by killing beavers
hi there
there is this function to bind the key 'p' for taking screenshots of the canvas
THREEx.Screenshot.bindKey(renderer);
how can I disable this function?
unbind doesnt work
should I just change the original code with a boolean? (screenshotEnabled === true...)
19:08
Yay for OS
you can just remove the bindKey call
@Shrek hehe .. I want to be able to activate and deactivate it
because in my threejs app the user should be able to write a text, and when P = screenshot...
it returns and unbind function
that should owrk
yeah I saw that
let listener = THREEx.Screenshot.bindKey(renderer);
listener.unbind();
19:12
aha
return {
			unbind	: function(){
				document.removeEventListener('keypress', onKeyPress, false);
			}
		};
aha that was it
thx
i haven't been attacked in a loooooong time
expecting a devastating raid soon
@KevinB nice, take a screenshot when it arrives
hmm the unbind function is on the callback, that means it is not immediately available
glad i had so much food... it's winter
gonna go through a lot of it
I have a button, which on click displays a texbox for writing.. and unbinds the screenshot function
I need something like a delegated unbinding
19:25
hopefully i don't have to start eating human meat
OK forget it
it was an error..
thx all
and enjoy the human meat
glad i could help
yeah I mean you help just with your presence
eh, not a too difficult raid
2 ranged 2 melee
19:43
why won't my api request query work.
any idea ..
https://codepen.io/iamrkcheers/pen/QgZLep

Thanks.
@iamrkcheers Welcome to the JavaScript chat! Please review the room rules. Pleasedon't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
19:58
why can i return context.Items to my angular $http.get(url) call, but when i do context.Items.Include("SubItemA").Include("SubItemB") I get "Possibly unhandled rejection: {"data":null,"status":-1,"config":{"method":"GET","transformRequest":[null],"tra‌​nsformResponse":[null],"jsonpCallbackParam":"callback","url":"/api/Samples","head‌​ers":{"Accept":"application/json, text/plain, /"}},"statusText":""}" error message? context is EntityFrameworkCore.
nevermind... figured it out. wasn't a javascript issue, aspnetcore issue
20:44
@rlemon some place around me just started serving poutine. gravy cheese fries are nothing special, but it's the first time someone said poutine. I have no idea how 'authentic' it is.
> blended cheese
not a poutine
poutines are specifically cheese curds
ah
liars
21:25
I like to sprinkle sugar on my fries
I like to sprinkle fries on my sugar
I like to fry my sugar
!!> true - false
@Arrow 1
!!>true - true
@Arrow 0
21:51
0
:) got to be faster than that
A K
A K
22:07
I like to sugar my sprinkles
I like to cook bacon, throw it away, and use the grease as salad dressing
A K
A K
hmm so why is reducer faster than map?
just curious
someone brought it up yesterday
are you in a situation where it matters?
A K
A K
let's say i have an array of 100 elements, and i'm iterating through all the elements
a few people ran performances test to show that reduce is faster
i mean
you could also use a for loop
A K
A K
22:20
well its obviously fastests no matter what
what's more important is what tool was the correct tool for the task
A K
A K
but i'm more curious on why reduce is faster on a low level
!!> (option1= [12, 8, 5, 9, 6, 10],option1 = option1.sort((a,b)=>option1[0]===a?0:b>option1[0]? 1:a<option1[0]?a-b:null))
@Arrow [12,5,6,8,9,10]
or
A K
A K
22:21
is it because mapping, the system allocates a certain memory whereas reducing, the system doesn't know so it doenst take any steps?
!!>(option2=[12, 8, 5, 9, 6, 10], first=option2[0], option2.sort((a,b)=> (a<first)-(b<first)||a-b ))
@Arrow [12,5,6,8,9,10]
A K
A K
ah, nvm, i think i got it
I know option2 is supper impressive
I think it was written by an alien or a genetically modified human being like in the movie children of the corn.
23:05
reduce is faster than what? Are you having a performance problem? What's the total time as-is (roughly)?
you would not use reduce if speed was your bottleneck.
you missed my point.
also, reduce is just a loop. the speed difference shouldn't be that great.
I have noticed significant performance increases by simply using a while(--var){}
@Luggage are you having this discussion again? :)
However, none of this really makes sense unless
you have context for what is being attempted right?
23:14
just trying to prevent noobs from pointlessly optimizing
speed differences between reduce and map are rarely people's problem. while can be faster because it's not calling a function each iteration, but that's still rarely the problem for a loop of only 100 iterations.
that makes sense. Because real performance bottlenecks should probably be written in C anyway. Unless you are dealing with a stream of data, in which case optimization would make sense.
...
I think you mean 'performance critical code' should be written in C and.. maybe.
yes performance critical, like a pacemaker
C isn't the only option and many common tasks you would do in node are really just pulling the strings of native code already.
...
a pacemaker doesn't need to be performance critical
23:21
I know, javascript hashing are simply C dictionaries pulling the strings
it needs to be dependable
so, use forever.js. :)
yarn was broken for a couple of hours because a dep-of-a-dep-of-a-dep-of-a-dep sent out a new release that broke everything
the JS world is anything but dependable :P
A watchdog timer. If your heart doesn't beat for 5 minutes, reboot.
Ced
Ced
anyone familiar with typescript ? How do I make changes to an existing td file ? I can't possibly clone their whole repo
23:23
You would use a $timeout for that
@Ced you can try just 'merging' your definitions on top.
or promise with a $timeout for better dependability
The timer thing was a joke..
> If your heart doesn't beat for 5 minutes
@Ced what library and what do you want to change?
Ced
Ced
@types/sockjs-client
I'd like to export all the interfaces
but I'm lost in how to do so.
even after your comment, so I might have to ask a question on SO instead
!!>setTimeout(()=>'restart',300)
23:27
@Arrow "undefined"
dam it,it broke
stupid pacemaker
don't worry I got some backup code to handle that error
Ced
Ced
@Luggage
@Loktar wtf man?
@Luggage foo.isClean ?
@Shrek something in the .d.ts files that Ced is asking about
23:33
innuendos
@Ced ohh. nevermind.. i am getting another CloseEvent that's similar.
Ced
Ced
@Luggage I've never seen imports being directly done on type definition files.
That was from lib.dom.d.ts. It jst looked similar.
I was trying to import the @types directly to see if it made a difference. You are right that you don't need to.
Ced
Ced
Yeah but it works regardless though with what I tried :
 `import { SockJSClass } from "@types/sockjs-client";` But I've never seen imports of typedefinitions
23:36
You probably never saw it because it's wrong. :)
Ced
Ced
That was my guess :D
I thought maybe i could get that whole namespace..
That's pretty badass
!!fo4 or ksp
23:45
@KevinB fo4
!!js or php
@ndugger s js
@ndugger php
rip
!!power armor or power fist
@KevinB power armor
23:47
I prefer a good power fisting, myself
2
!!online dating or anime
@ndugger online dating
anime dating
good idea
just add a beard, and that's basically me right now
A K
A K
23:57
i'm back baby
i think arrow ran a jsperf on reduce vs map and reduce came out on top
so i was curious on a low level to why reduce was faster than map
coulda been flawed
A K
A K
on chrome, reduce is faster than map
firefox, map is faster than reduce
obviosuly, fastest looping is while(--i)
still don't see why it matters
it's not worth investigating
A K
A K
it doesnt really matter, but i was curious
any case where reduce is the right tool, map isn't
00:00 - 18:0018:00 - 00:00

« first day (2457 days earlier)      last day (2713 days later) »