« first day (2045 days earlier)      last day (2896 days later) » 
00:00 - 13:0013:00 - 00:00

1:16 PM
How can I compile an arrow function instead of a regular function?
cc @BenjaminGruenbaum ^ know of a way?
 
@AwalGarg eval it?
 
@BenjaminGruenbaum JIT :(
 
@Abhishrek that's a bad idea
@AwalGarg what about it?
 
@BenjaminGruenbaum eval code is not JITted, is it?
 
ur not JITd
>:(
 
1:23 PM
@BenjaminGruenbaum I know which is why I am not using a linked List
 
Well, code containing the eval function (directly or indirectly) is not optimized. The code inside the eval is fair game for later.
 
I was just trying to get karel to see the difference LinkedList made on performance
 
@BenjaminGruenbaum Why would it not be optimized in the indirect case?
 
@BenjaminGruenbaum happen to know if the Function constructor exposed to userland is self-hosted in v8?
function compileArrowLikeFunction(body, ...args) {
  let oBody = body.trim();
  if (oBody.startsWith('{') && oBody.endsWith('}')) {
    oBody = body;
  } else {
    oBody = `return ${body};`;
  };
  return Function(...args, oBody);
}

assert(compileArrowLikeFunction('1')() === 1);
assert(compileArrowLikeFunction('{ return foo(); function foo () { return \'a\'; } }')() === 'a');

function assert(t) {
  if (!t) throw Error('assertion failed');
}
I think this will do for now
@BenjaminGruenbaum @copy ^ can haz sanity check? ignore lack of this binding
 
try { return new Function(...args, `return ${body};`) } catch(e) { return new Function(...args, body) }
Maybe
 
1:33 PM
wait nvm
 
@copy because it contains an eval call, it's not just a syntactic opt out - you know that.
@AwalGarg what do you mean self hosted?
 
@BenjaminGruenbaum like array.forEach etc. are. implemented in JS (with native syntax) and not cpp
 
@AwalGarg how would the function constructor be implemented in JS if the engine isn't?
 
@BenjaminGruenbaum just the construction of dynamic function part, I mean. so eval would be in cpp and then function construction could use eval
actually that sounds stupid so probably v8 doesn't do that
 
@AwalGarg in that case no - it is not. It would also be insanely hard to do that.
Because of scoping
@AwalGarg you realize there is a bunch of other stuff that arrow functions do differently right?
 
1:41 PM
@BenjaminGruenbaum yes, ignore all that. I just need auto-returning
because DSL
 
@AwalGarg you can probably just .bind for that, it takes care of most of the annoying stuff like not using as a constructor but it takes away toString
 
yeah I thought of bind too but I need toString later on
 
You can .bind and then reinstate .toString, probably. Or just allow arrow functions.
 
> ...whose implementation provides a powerful, easy-to-use means of communicating with other applications .... Due to its combination of ease-of-use, general extendibility ...
in a fucking single paragraph
@_@
 
@AwalGarg PING PONG
 
1:51 PM
@BenjaminGruenbaum Ah, right. I thought there could be a difference
 
How do you guys debug Node.JS apps?
Node-debugger? (something else?)
 
iron-node
 
Neat
 
I rarely use the debugger tbh, I rely on stack traces a lot - when I do use the debugger then I also use iron-node
 
@Abhishrek I am fighting with cavemen. what do you need?
If it is a pitchfork, then no
 
1:58 PM
@AwalGarg passes a bazooka to you
 
script tags should be garbage collected from the dom :(
 
2:13 PM
we should request a new JS framework there
 
Hi all. jspref is still down. Are there alternatives? I need some help in choosing between some lines of code
 
@GitaarLAB I smell premature optimization
 
good lord that repo is full of gems
 
@MadaraUchiha Sad that that is usually the default response. It is a utility-function that is used the most in my app.
 
@GitaarLAB Fair enough, this is usually the default response because it's usually correct, by the way.
Post your two options here, we'll try our best.
 
2:23 PM
@MadaraUchiha In most cases you are right :)
@MadaraUchiha I actually have some more optimized candidates and like to (once again) perform such tests myself. Here is just one example: n-=s=n%60; n/=60; vs n=(n-(s=n%60))/60 vs s=n%60;n-=s; n/=60; vs s=n%60;n=(n-s)/60
 
@MadaraUchiha Can I set up a local version of it? Would you happen to know some tutorial that explains how to set it up?
 
@GitaarLAB Last time I tried to use it, I remember it not being too much of a pain to set up
The documentation is pretty good
 
@MadaraUchiha can I run it (locally) without server or database?
 
2:40 PM
@GitaarLAB Yes
 
@MadaraUchiha I'll go fiddle around with it a bit, thanks. (uh and thanks for all the other great stuff you do !)
@MadaraUchiha I just found github.com/albertxing/stool Perhaps it might be a better start?
 
vOv
Not familiar with it
 
@MadaraUchiha I'll check it out and rapport back. thanks!
 
Any people with experience with asynchronous?
 
@sofboy Welcome to the JavaScript chat! Please review the room rules. Please don'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.
 
2:49 PM
@sofboy You mean "people who program in JavaScript"? Yeah, there are a few here.
 
Guys, how can I convert this new Date(myDate); to only output numbers?
I tried passing a JSON object to javascript, and when I outputted the date via javascript, it gave me this weird format: 2016-05-13T17:15:53.587Z
So, I put that in the "new Date" function, but then it gave me a complete string with days, instead of a date format like yyyy-mm-dd
It is supposed to be UTC
I have no idea why I get the "T" and "Z" in the date
 
There's no such thing as a JSON object
 
@tomSurge check out the MDN page on Date, it gives all of the available methods with examples.
 
Date without new gives you a number
 
I get this after only doing Date: Sun May 22 2016 16:55:43 GMT+0200 (W. Europe Daylight Time)
 
2:55 PM
!!tell tomSurge mdn date
 
@tomSurge Something went on fire; status 403
 
Oh come on...
 
lmao
 
Anyone know how to get closest element by position (like an array with x and y) ?
 
3:02 PM
@AndrewL Eh?
 
out of?
 
I've got this thing where I've got draggables. I want to get the closest <li> element to their stop drag position
Is there a way to get the closest element by position?
 
I wouldn't be surprised if jQueryUI had that built in
 
It doesn't. I've got an idea. Can I just trigger the .closest() function in the stop function ?
That will return the closest relative draggable's position right?
 
read the docs
 
3:13 PM
When using .closest() can I use two selectors?
such as two classes
.closest('.class_1 .class_2")
 
That's a valid syntax
 
ok
 
3:32 PM
hmm
 
@AndrewL the closest class_2 that is a descendant of class_1?
closest means, if this node doesnt match selector, go to my parent and try again, until you find a match
you need to do hit testing if you want to tell whether points are inside another box
@AndrewL use .filter to eliminate the ones that dont overlap
 
:/
 
3:52 PM
Avg 45ms to encode 200ms of audio
 
4:05 PM
vs C++ encoding the same in 0.2ms
I must be doing something terribly wrong
 
Not that big of a difference
I never thought I would say that, but it's just one order of magnitude.
 
225 times slower is not big ?
the first one is with Js right?
 
Against C++?
 
abi was busy with developing it in Js if i recall it right
 
Byte manipulation in a language that doesn't even have a concept of a byte?
 
4:12 PM
@JanDvorak I am not even using simd in C++
+ C++ isn't blocking my event queue Node is
@KarelG It works wonderfully now
I just need to fix my controlStream to emit at a correct rate
 
that's more important (that it works)
i recall my mini project that i have screwed up after doing optimizations. Invested 3 hours and the fuck didn't pass my unit tests.
 
it works wonderfully :P
Infact my UI is remote :D I love that about this
person can open browser mess up the stream
then close browser
then open again not a single problem :P
 
@KarelG That's why we have Git.
 
(The black magic is Redux stores piped to server)
 
:P was too lazy to use git
ah well, i just moved on and tried something else
 
4:16 PM
i'm too lazy to not use git.
 
4:27 PM
weird
 
Not really
 
Anybody sees something wrong with this?
    setInterval(this._tick.bind(this), opts.resolution);
To perform 1 tick per resolution ms?
i handle it
 
it is working!
 
  _tick(){
    const now = Date.now();
    const dt = now - this.lastReadAt;
    const howMany = Math.floor(dt / this.opts.resolution);
    console.timeEnd('tick');
    for(let i = 0; i < howMany; i++ ){
      this._generateFrame();
      this._emitFrame();
      this.lastReadAt = now;
    }
    console.time('tick');
  }
Slower than it should :P
tick is always > 250ms
the generateFrame and emitFrame mantain a queue of frames
that entire operation takes about 10ms
the mixing takes ~45ms
I don't understand why isn't my interval firing at the right time
as a result though mixing happens ~ 20% slower than it should
Changed the .floor to .round to compensate
read how setInterval works, ugh
 
5:24 PM
I am trying to render a VUeJS output in my browser but it's not showing: pastery.net/habzfp Someone an idea what could be the issue?
The data = in the google inspector so it's being passed the right way from my API. I see only the column headers rendering not the data.
 
 
ughhh... APIs which throw SyntaxError for malformed input string are the, fucking, WORST.
And ofcourse we have an example from whatwg for everything terrible which can be done... websocket.
new WebSocket('./') is a syntaxerror. sigh
 
Wrong URL protocol
 
I know that. But it shouldn't be throwing a fucking syntax error because It is not a fucking syntax error.
 
The URL has a wrong syntax
 
5:37 PM
your face has the wrong syntax
 
!!> /[a-Z]/
 
@JanDvorak "SyntaxError: invalid range in character class"
 
That's not the best but still acceptable because that is parse time
 
!!> if(Math.random() > 0.5) new RegExp("[a-Z]")
 
@JanDvorak "SyntaxError: invalid range in character class"
 
5:38 PM
Now that's terrible
 
@JanDvorak "undefined"
 
Today's forecast: useless code with a 50% chance of syntax errors
in C#, 53 secs ago, by Jan Dvorak
OK, I'm totally confused now. What the hell is a program state?
 
6:13 PM
@JanDvorak lolz
 
Be sure to read the thread
 
I wasn't actually replying to you. just testing something :P
 
6:37 PM
:(
 
user5797159
yawn
 
fart
 
user5797159
 
7:05 PM
Will it gif?!?
Things are shaping up nicely for the next edition of Hacking Calculords https://t.co/NCR8DivlJ3
nope
drat, technically mp4
 
Hello
 
@Polygon Welcome to the JavaScript chat! Please review the room rules. Please don'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.
 
Is there a way to change what operators like + and - do for certain types of objects
Obvousely, "+" does acts completely differently depending on if it is being applied to two numbers or two strings.
 
No, you can't overload operators in the general case
 
7:09 PM
Dang
 
might be something in ES6
@Polygon what are you trying to do?
 
So if I was making a library that adds complex number support, I add two complex numbers with the + operator?
Wow I just realized that my grammar was really terrible there, but I think you understand what I would like to do.
 
Yeah, I understand but I don't think it's possible without some crazy hacking
(not that I'm against crazy hacking, mind you!)
 
That's all I wanted to know.
Thanks!
 
Hey look I'm not dead
 
7:22 PM
Hi levy
Does anyone know how to make a div that its transparantly gray everywhere exept the stuff inside the div?
So, basically, like, a menu wrapped inside a div, and I want the menu to show properly, but everything behind the menu is gray
Sort of like the agar.io menu
Not gray, just darkened
 
@AndrewL k.
@SomeKittens what's that
back to work i go
 
Hi Jasmin!
 
7:50 PM
@taco My computer playing Calculords
 
If I have a <li> element with a few classes but no inner HTML will it still be 'visible
as in they are still considered elements on the page and can .closest find them?
 
@SomeKittens Proxy?
 
@MadaraUchiha Never tried it, might work
 
Hmmm, no doesn't seem to be a trap for arithmetic operators.
 
 
2 hours later…
9:35 PM
ugh, updating to babel 6 is a pain because my code uses babel 5's incorrect import behavior.
It needs to be done, though.
 
10:15 PM
how do I use etags
it happens automatically with script tags, but not XHR
 
alias nom=npm install --save
 
Hmm.. Why is jslint complaining of unexpected 'for' and unexpected 'var'
var paragraphs = document.getElementsByTagName(elementTag);
for (var i = 0; i < paragraphs.length; i++){
 
Can anyone let me know exactly what data would be posted to the ajax post request file as in this code :
 
1 message moved to Trash can
@UmairShahYousafzai Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. For posting large code blocks, use a paste site like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
 
function uploadFormData(formData) {
$.ajax({
url: "sfm",
type: "POST",
data: { "formData" : formData, "dir" : <?php echo $dir; ?> },
contentType:false,
cache: false,
processData: false,
success: function(data){
$('#drop-area').append(data);
}
});
}
Can anyone let me know exactly what data would be posted to the ajax post request file as in the above code?
 
10:29 PM
what's an "ajax post request file"?
 
Sorry may be I said it wrong..I mean what array I will be getting at Ajax URL??
Seems like no one is doing here exactly they should be doing..! :D
Why bother to post messages in chat if you people are not willing to help out others..!
 
what?
 
Or may be you can't..! :D
 
I had a paragraph written out for you but I just deleted it after reading that.
nm
 
Sorry for that No hard feelings...!
 
10:36 PM
your sense of entitlement made me cringe
10/10
 
jElement.closest('li.hex:not(.hexOccupied)') is this right syntax :?
 
@Shea : yes,Please what will be the output $_POST at the URL???
 
@AndrewL looks like a valid selector to me, but idk what jElement is
 
A jquery object
 
@Shea : Should I be expecting anything friend??
 
10:39 PM
Weird. The selector is returning undefined even though there is one that falls into 'li.hex:not(hexOccupied)'
 
@AndrewL looks find
 
ok
I'll just debug
 
closest might not be the thing you want
 
Why not?
Well, it might not be what I want because I want the closest element that falls into those filters by POSITION on screen because jElement is a draggable on screen and the code is run after drag stops
 
so there's li.hex nested within li.hex?
 
10:43 PM
no
I have draggables (li elements) with hex and some with hex hexOccupied as classes. I don't want the ones with hexOccupied, but the ones with only hex
 
make sure jElement isn't empty, that might save you some trouble
again, kinda just shooting in the dark here
 
So .closest() finds children?
I thought it found parents, children, etc that were just closest
 
honestly, it's been so long since I touched jQuery, but I would use .children or .find
 
mk :)
Nowadays I don't know why I use jQuery to be honest.
The $ is >.<
 
@Shea : Looks like brother you are not interested at all to help out another friend..!
 
10:51 PM
I mean it's partly my fault too :P
My God awful code doesn't work. What a surprise
 
@UmairShahYousafzai put echo '<pre>'.print_r($_POST, 1).'</pre>'; in your endpoint
that's all you get from me
 
If you were to try to animate an li to move to the nearest li that doesn't have a class, would you use closest() to get closest by position?
 
@Shea : Reall...May be I am stupid to ask about something in here then..! If I was going to do it practically why bother here to ask here..I was just asking if you people can give me a direct output of the array but seems like you are going to do the same as what I was thinking about..! :D
 
@Shea fatal error
 
LOL
 
10:57 PM
@Shea : Exactly my friend that's what I was thinking..!
 
:30699006 ugly
 
illiterate
 
@Shea : May be I think asking about something here especially to ask from you so instead console would help me alot better than that :D See I just made a joke..!
 
 
@Shea : Also I can see you are not a pretty much popular guy at stackoverflow see your rep is just 1.3 K so I should consider higher rep guys to expect to help..! :D
@Shea : No hard feelings..! Seems like chat.stackoverflow.com really doesn't care for your stackoverflow profile privacy here..! :D
 
11:06 PM
you went from 10/10 to 1/10
 
LOL
I feel the pain Shea
My heart goes out to you :')
 
@Shea : It's OK Brother...I really like to make some serious jokes.!
 
Now I really feel bad
 
@AndrewL : You must quite a pain feeling type person..! :D
 
TLDR @UmairShahYousafzai would suck a penis for SO rep
 
11:09 PM
True
 
or fuck a goat
 
@taco : Seems like you also needs some manners friend..! :D
 
@UmairShahYousafzai seems like you're the one who needs some manners, ass. Trying to hide behind your bad jokes.
 
@taco : You just went like from 0 to 10 scale on stupidity..! :D
 
I'm having flash backs to elementary school
 
11:11 PM
Holy shit taco savage
!!!
 
@taco : It seems you are also not the famous person at Stack Over Flow..! So may be you are too much over reacting friend..! :D
 
Maybe go fuck yourself.
And blocked before I get muted. Sorry :d
 
@taco : Dude..You want me to become a gay..! that's really harsh...I like you..! I like the spirit..! :D
 
If this guy isn't a troll, I will shoot myself
 
That's what happens when you can't get laid until you are married
 
11:14 PM
lol
 
@taco : I like you buddy...I wonder how would you look like cuz I am interested in seeing you..! :D
 
Anyhow, what's up guys
 
Not much. Contemplating ending my suffering for the 3rd time in 2.349 minutes
just the usual
 
Just hopped on a video encoder to restart a live web stream. Need to learn more about live web streams. Don't hear many people ever talk about them in IT
@AndrewL Don't do it. I will get bored in here.
 
@taco : Ahaa..I got you buddy...Let me help you with that..
 
11:19 PM
Hahaha
Don't worry taco, I'm already dead because of the 'situation' preceding
 
I think these encoders format video for different device types, too, but I'm kind of new to them
@AndrewL lol
 
@taco : well buddy that's not difficult do that..! but you are ignoring to let others to help you..! :D
 
Taco, did you block your dear brother umair
 
I did :)
 
@AndrewL : That's harsh..!
You people hurt me..!
Really that much short term relationship..
 
11:23 PM
Nah, I just changed my underwear to get rid of that shit stain
I just found out Uncharted 4 is PS4 only... looked good....
 
Good morning guys!
 
Oh man
UC4?
Hey there sting
 
Morning
 
I still have the lowest rep :(
 
I'ver never played Uncharted, but it looks cool
 
11:32 PM
It does
I've gotten 3/4 of my rep from the past 5 days lol
how did that happen
Maybe I sucked too much if ya know what I mean
 
Anyone interested in a bounty of 100 :- stackoverflow.com/questions/35520658/…
 
Oh meee
nevermind, too lazy
gotta do my own stuff
 
so you got like half my rep in 5 days
 
Yea
 
I have to monitor this stream for my job
 
11:38 PM
I got 100 for no reason
 
my life is so hard
 
Watching steph curry and hot blondes is so hard!11! :((
 
downright sucks sometimes :(
It makes me wonder what the people in the front row who are rich as hell are doing right now
 
I have an answer there too which I think perfectly answers the question. But the OP did not bother to accept or comment on it. So Strange! Any advice for what to do???
 
Man I feel so bad for you :(
Kill the OP
and forcibly take his rep
 
11:40 PM
I wish I could!
....Did you upvote now????
 
I did
 
Let's help a brotha out
 
@Sting kick him in the balls
 
Euthanize him?
 
OP hasn't posted since your answer, I think
 
11:44 PM
@taco But on OP's profile, it says that he is last seen 3 hours ago! I've commented on his question so many times but he does not reply... :(
 
indeed
Not sure man
        var html = jElement.html(),
             nearestHtml = nearest.html(),
             temp = jElement.html();

             html = nearestHtml;
             nearestHtml = temp;


Not sure if this even legal lmao
 
no need to be all stalkery about it >:d
 
Just got another 10 rep lmao
 
From me....on one of your high voted answer!
 
Thanks :)
I've been on the site for a few years now but decided to register in 2015
pretty stupid of me
 
11:49 PM
Same with me. :p
 
I think taco's dead. Probably got eaten by a cat-taco loving mexican
 
lol
 
Nah, I'm just shitposting on the Twitter feed
 
Who the fuck said dat boi
Dead meme sir
 
lmao
 
11:53 PM
Died a few million years ago
 
It's like a week old
 
'oh shit waddup'
Ok, so when moving from an old position to a new position, to calculate the pixels I need to move its oldX - newX and oldY - newY right?
 
I'm not very dank with my memes
 
I don't want to dig into my brain for the algebra
 
Neither do I
Drink some coffee and get over it
 
11:56 PM
@taco What do you do in the JavaScript Team?
 
No, my options are starbucks overrated piece of shit and my own horrid coffee
 
00:00 - 13:0013:00 - 00:00

« first day (2045 days earlier)      last day (2896 days later) »