« first day (1871 days earlier)      last day (3068 days later) » 

12:13 AM
@phenomnomnominal oh I already did
Infact I am using escodegen
I am just trying to make a VPL
 
Oh. Once I pulled in escodegen I had pretty much no need to actually refer to anything is the AST
 
for my VPL i do need an AST for myself :D
 
oh true
makes sense
 
12:29 AM
=)
 
Don't know if you guys remember me asking about a data import tool I was writing. I finally found the term for it: ETL (Extract Transform Load). Anyone ever use this github.com/agmen-hu/node-datapumps?
 
1:22 AM
@BenjaminGruenbaum I am not replying directly there because it might stir the topic, but usually it has worked pretty good for me across - like 100 files or so :/ I guess the other commentor is right, it depends on the project. Also, I guess you already know, but I don't have downvote privileges :)
 
@AwalGarg BenjaminGruenbaum is afk.
 
!!afk
 
1:53 AM
morning
 
morning~
 
2:39 AM
@rlemon is making shivs
 
fucking stripe; they don't have micropayments pricing...
like 5%+$0.5 under $10--like amazon and paypal have
I kind of need that lower price point for the personal project that I'm working on...
 
4:52 AM
@BadgerCat She gave me her phone number already!
 
5:16 AM
@AwalGarg That looks great!
 
@SomeGuy AwalGarg is afk.
 
@RahulDesai How can we close an answer by saying "read the friendly manual"? Or are we expected to quote every page of every single manual on SO?
I wish we can say "you are a vamp, overexchange". But apparently we can't.
 
5:38 AM
Hey guys, si gitter.im made by github?
is*
 
@feniixx define "made by".
 
they created it
 
You mean "Did GitHub team create gitter.im"? How do you think you can find the answer to this question?
 
@phenomnomnominal Can't tell for sure. It might help a bit, but I don't think CSS animations are particularly intensive
 
5:46 AM
@SomeGuy yeah neither
 
@phenomnomnominal JavaScript and ads are much much more likely to consume battery life than CSS animations
 
"@Sheepy Blur is a graphic effect? I didn't know that. What is the term radius in blur-radius and spread-radius? – overexchange 4 mins ago"
Yeah, right. Perhaps blur is something edible.
 
@MadaraUchiha yeah obviously. But we're going to do something like this for shitty phones, and I was reading about the battery API stuff and that got me thinking.
 
@phenomnomnominal Anything helps
And if you're sure that all of your animations/transitions are optional, then taking them out when battery is low is a good thing
But then again, I just disable JavaScript altogether when browsing from mobile.
 
It's an angular app, no JS isn't an option
No ads, might be
 
6:00 AM
Hello.
I have Q so specific.. needs an eye to eye.
Why i cant extend globals prototype from self invoked function ??
 
@Sheepy Yep, I hear you. He's a lazy SOB.
Someone is on a downvoting spree on the answers here: stackoverflow.com/questions/33987743/…
 
He used to hang around here asking questions after reading a few sentences from MDN, without bordering to try it in console or finish the MDN page.
 
That SOB is getting offensive. stackoverflow.com/questions/33991690/…
This conversation is getting interesting! :D
@RahulDesai You mean, the quality of question is very high? — overexchange 1 min ago
 
Can you make your latest comment a complete sentence? So that I can vote it up :D
 
6:15 AM
@Sheepy Done. LOL
OMG. I love StackOverflow :D
 
Closed. Personally, I think copying from some manual may be an acceptable answer. But I say I have spent enough time on him...
He does ask lots of basic questions that most would never thought of asking. That's how he got those reps.
 
6:33 AM
Phuc Dat Bich
;)
 
258 questions in 10 months, almost 1 question a day. Many are downvoted a lot, but one question with accepted answer is worth many dead questions.
 
Wow
Some SOB (like this guy) has downvoted all the answers here, even though they are correct. stackoverflow.com/questions/33987743/…
 
I just checked the question. What is wrong with the question
6 downvotes for someone who wants to know something
 
I downvote it for its broad scope, not describing real problem (apparently not understanding what is blur at all), didn't do research.
 
Yep, same here.
 
6:47 AM
The question itself is not too bad - you need to read comments to get a better picture. I think the comments may have attracted more votes than the question itself.
 
True.
It shows how lazy the OP is.
 
Ya I read those comments
 
I can only conclude that this is a classical help vamp. overexchange certainly has the intellect to learn his own questions, and his/her active reply make me think he/she just wants the attention.
 
But nobody would want attention by getting bunch of downvotes
 
Yep, and we gave attention with some downvotes.
 
6:52 AM
lol.
 
Grabbing attention is something that can be done if you are using a Breaking Bad reference in your code. LOL. stackoverflow.com/a/33987832/586051
 
no. coz you did the explanation part well.
variable name doesn't matter
 
Thank you, sir.
 
i'm not sir.
just 23
lol
 
Wow. I don't have any negatively voted answers. I am not answering enough.
 
6:57 AM
how should i prepare to get into google
any idea?
 
I do not mean to scare you but I was whooped badly at Google few months ago.
 
Oh, how?
 
ya. share your experiience
 
You gotta know the basics.
 
in which domain?
 
6:59 AM
I was not good at closures that time. I learned it the hard way. :(
 
only coding?
 
@nickB I mean, Javascript.
 
okay
then what happened?
 
Is that why you come to the JS chatroom? :D
 
lol
 
7:00 AM
Yes, it was a telephonic interview and they asked me to write code in a portal shared online.
@Sheepy Yep :D
Ask me anything about closures now. #overConfidence
 
/me gladly takes out a mop labelled "ES2015"
 
so you got stuck only with closures?
 
Yes.
 
and what other questions were asked, if you don't mind
 
It happened this way - The guy presented me with a technical problem and the actual soution to it which he was expecting was closures.
And I was going way out of scope. :(
 
7:02 AM
for ( let i = 0 ; i < 2 ; i++ ) setTimeout( function(){ alert( i ); }, 100 ) // What are the alerts?
 
And that kids, is how I learned closures.
 
XD
 
lol
it's es6 i see
the let part though
 
Yup. Many regulars here use ES6. Including me.
 
I think there will be just 1 alert with the text as "1".
 
7:05 AM
It's "0" and "1". If you are not running IE, you can try it in the console.
 
Funtions inside for loops are messy. Gotta use IIFE.
 
And if I had used "var" - standard ES5 - it would be two alerts both saying "2".
 
@Sheepy With var, it is giving me 2 alerts saying "2".
 
Still some way to go ;)
 
I am on Chrome.
 
7:07 AM
Sorry, yes, should be 2 with var.
/me fencepost error Q.Q
Do you understand why?
 
fencepost error?
 
tick tock
 
I dint get any error.
@rism tock tick ;)
 
No, by fencepost I mean my mistake of saying it will alert 1 instead of 2.
 
some cultural misunderstandings are funny
 
7:11 AM
I mean do you understand why it is two alerts both saying "2"?
(I think rism was looking forward to your explaination - tick tock is clock sound :)
 
yeah Google boy tell us ;) tick tock is also a hint.
 
Right :D
 
lol
I dont know why it is "2". Lets debug.
And ofcourse I know tick tock is clock sound, lol
When I do console.log(i) before the setTimeout, it gives me 0,1 but not 2!
Try this in your console: for ( var i = 0 ; i < 2 ; i++ ){ console.log(i); setTimeout( function(){ alert( i ); }, 100 );}
 
Indeed. Curious, isn't it? :)
 
Using var: The loop runs,t he variable i gets incremented to 2. then the alerts are being called, both using i
i the variable, not i the value
Which, at that time, is 2.
 
7:19 AM
Makes sense.
 
And let's scoping differences probably cause the "current" value of i to be passed to the alert
 
Hi, Cerbrus~ We were hoping Rahul can find it out on his own @_@
 
Looks like I wont make it to Google anytime soon.
 
@Sheepy Oh right
Good morning
 
@BenjaminGruenbaum heh, that is one reason I still have ubuntu 10.04's ISO. Old firefoxes don't work on recent distros anymore, and E4X was entirely removed in v18 :P
 
7:21 AM
@AwalGarg BenjaminGruenbaum is afk.
 
People like Cerbrus deserve such opportunity. :)
 
@RahulDesai Well, at least you are at the right place!
This pattern usually appears when newbie first attempt to associate event handlers - effectivelly setTimeout - in a loop.
And it is usually & easily solved by...... closure.
 
I wouldn't get in
 
@Abhishrek yes, this is it.
 
@Sheepy OMG
 
7:22 AM
Cerbrus: I am in Alphabet. I am above Google. Bow before me, you low rep mortals!
 
@Sheepy Dint I mention IIFE for this in one of my previous comments?
I believe IIFE is a closure too.
 
It is
 
@Cerbrus And why wouldnt you get in? :)
 
Lack of experience, I'd say.
There'd be plenty of candidates that are better than me
 
Same here.
 
7:27 AM
@RahulDesai Closure is a pretty general term. So general, that you won't find it in JS spec. IIFE helps you by creating a new variable and copying the value.
 
i still didn't understand why it's alerting 2 twice. what will happen to me :/
 
@nickB Hmm. How should I explain it. It's a loop. It run twice. It settimeout twice. Let's just say there is a long way to go @_@
 
@nickB: What scope is i on, in: for(var i = 0; i < 2; i++)?
 
I'd start with an explaination of the for loop and when i++ is executed.
 
We'll get to that... If @nickB answers
 
7:31 AM
the sync/async thing stumps more programmers, I swear
took me a while to get it myself
i mean I think I understood it, but I don't think I really got it until later
 
for me i=0 , it should alert, then i = 1, it should alert
?
 
A lot of programming tends to be that way, I think. That's why people are told to actually write the code themselves instead of copying and pasting it
 
4 mins ago, by Cerbrus
@nickB: What scope is i on, in: for(var i = 0; i < 2; i++)?
 
You think you understand it, but you don't know until you've written it
 
Don't skip ahead, @nickB. Try to answer that question first
 
IIFE fixed it.
for ( var i = 0 ; i < 2 ; i++ ){ (function(i){ setTimeout( function(){ alert( i ); }, 100 ); })(i);}
 
You know what, just today someone who claim to work in MS (he is indeed quite good) tell me javascript can do producer / consumer problem with promise.
I answered, no, that is not what producer/consumer problem is about. Having producer and consumer does not give you *the* producer/consumer problem.
 
@Cerbrus idk . i'm confused. local?
 
Let's put it this way: It the var i accessible outside of the for?
 
nope
 
7:36 AM
It is.
 
ya?? :o
i didn't know that.
 
Functional scope.
 
Try this:

function test(){
  for(var i = 0; i < 10; i++){}
  alert(i)
}
You'll see it alert 10
So, what's happening in for ( var i = 0 ; i < 2 ; i++ ) setTimeout( function(){ alert( i ); }, 100 ):
 
But this settimeout thing is within for loop
 
The for loop starts. i equals 0, and it starts a timeout that will call some function. Then i is incremented.
Then, for the next iteration, i equals 1, and it starts a timeout that will call some function. Then i is incremented.
The next iteration, i is 2, so the loop ends
Makes sense so far, right?
 
7:41 AM
ya
 
Okay. So, the loop has ended, but there are still 2 timeouts ticking away
Meanwhile, i equals 2 already
 
tick tock ;)
 
tick tock ;)
 
So, when those 2 functions finally get called, and they look at the value of i, they will see 2.
 
I thought on each iteration it will print. I didn't know it will print in the end
 
7:43 AM
That's because of the timouts
the loop is faster
 
Wohoooo! Math.random() is finally fixed! codereview.chromium.org/1467133006
 
@Cerbus well, don't forget the closure
 
Now, when using an IIFE in the for loop,
 
Timout always go to the event queue. It is in the standard now. (I think)
 
Got it.
 
7:44 AM
@rism: shush ;-)
 
alright, i'm shushing.
 
When using an IIFE, for every iteration of the loop, a "copy" of the variable i is made
The function in the timeout references that unique copy.
 
a very interesting thing I learned today XD
 
@Sheepy Right, if it's on the same thread, there is no problem
 
@rism: un-shush :P
 
7:46 AM
tick tock
@nickB If you're used to server side programming with say C# then it's entirely reasonable that you would be confused as many of those languages do have block level scope.
 
And JavaScript doesn't.
 
hmm
 
Well, up until recently that is
let variables are scoped to the nearest block
 
Well, they are so outdated. ES6 is much finer than block scope :D
for ( let i = 0 ; i <= 1 ; i++ ) let i = 0; // SyntaxError
for ( let i = 0 ; i <= 1 ; i++ ) { let i = 0; } // No error
 
Morning
 
7:49 AM
@MadaraUchiha _o_
 
Morning~
 
but i really like javascript. it's like a foal always growing.
 
@Sheepy Hm, that syntax error is lame
The block should be implicit
 
@nickB Only recently. During the dark age of IE6 you can't write any decent app with JS. Too slow.
 
ya. those were bad times
 
7:51 AM
{ let i; for ( let i = 0 ; i <= 1 ; i++ ) { let i = 0; } } // No error. How many blocks do we have? ;)
 
recently it's growing rapidly
 
@BenjaminGruenbaum Can't you do it like this: move the index.html route to something like spa.html. User hits index.html, checks client side if cookie is present or not, and loads content from landing.html or spa.html accordingly, dynamically? codementor does this, it is written with angular though, not sure if that matters.
 
@nickB Language-wise. But the speed improvement has stagnated.
 
crl
Nov 24 at 18:53, by crl
let x=6;
if (true) {
  let [a,x]= [2,1];
  console.log(x);
}
console.log(x); // ah es6 I love you
 
the if (true) part is redundant. Just do { let ... }
 
7:54 AM
@AwalGarg Using angular, that kind of routing is trivial
Without angular... Not a clue
@crl Uncaught SyntaxError: Unexpected token [
 
Pass in --harmony-destructuring
 
@AwalGarg The point is the block scoping
 
@MadaraUchiha { /* block scope here */ }
 
@BenjaminGruenbaum if it's an SPA, wouldn't the thing to do be have the app launch from landing.html, and only pull in the rest of the application once they route to another route?
 
@AwalGarg Doesn't look like a block to me.. more like a squiggly thing
 
7:56 AM
-_-
 
@Neil it's clearly an object literal :P
 
It's an drunk array. "Mr. A. ray, please walk in a square line for me." "Sure, officer... { }"
 
it should be called sponge scope
 
Object literal +1 :p
 
crl
@AwalGarg just to illustrate scopes
 
7:58 AM
You don't need the if part to do that, is what I am saying...
 
@AwalGarg that's introducing another round trip to a landing page.
@phenomnomnominal what if they want to go directly to a route and they're a returning visitor?
 
@BenjaminGruenbaum yes, that's one drawback :/
 

« first day (1871 days earlier)      last day (3068 days later) »