« first day (971 days earlier)      last day (3977 days later) » 

2:07 AM
1 message moved to Trash can
 
You're a moron. Over.
 
Yes. Over.
 
@O0oO0oOO0ooO, you. Over.
@copy, do you copy? Over.
4
 
2:08 AM
nice weather today
 
@phenomnomnominal I do. Over and out.
 
Erlang is a fascinating language for me
 
so i never took the time to read up on ALL of the features in ECMA6, and it looks like they added some nice stuff...too bad it SHOULD have been invented a decade ago so I could use it today...instead i'll just wait another decade before I can use it (or 3-5 years realistically until MSIE 11 (i hope implements it) and it becomes a normal browser)
 
Copy that @copy. Over.
 
2:12 AM
@redline but no one reads ECMA6 documentation because it's just a text mountain unless you love hiking
 
i mean, look at the history: JS 1.1 - 1997, JS 1.5 - 1999, JS 2.0 - IN PROGRESS ...so did they like sit there for TWO DECADES with their thumbs up their asses?
or did they live in a dream world where everyone uses FF
 
it's a hard problem, nobody wants to write code with new unshimmable features because people could be using older browser with no support
 
@redline you have unrealistic expectations of the time it takes to overcome the complexities of coming to an agreement for a standard. Over.
 
oh i understand completely what that entails, i am not SURPRISED it took this long
but i also highly doubt it needed to take this long
i know there was a lot of controversy in the spec, but that still shouldn't make it take that long
that's poor leadership, period.
 
I love standards. There are so many to choose from.
 
2:18 AM
does he really need to display 20000 rows at the same time, who can look at all of them once
 
yea well in this case your condescending quote doesn't apply since i realistically have only 1 spec to choose from
 
Hey gugs
hey guys
 
@Esailija i didn't see him say display, did he?
@Esailija he might mean total loaded in the table cache
 
ok
 
IE8 + a ton of rows in a table sounds exactly like my job
 
2:21 AM
@KitHo ye?
 
I cannot edit the cells at all in the demo
 
feeling bored just say hi to all u guys
 
and see if there is interesting things in here
 
hai
right
 
2:23 AM
@Esailija i did an interesting test after we talked
 
Can't sleep :/
@Esailija Yeah saw that, I wasn't sure if he was serious or just trolling.
 
I am imagining some super man processing hundreds of tabular data per second
just flashing through
 
@redline ECMAScript is at version 5, just so you know :P
 
@redline awesome, can you present your findings?
 
@Esailija i had a global function that had a large percentage of use cases have the same first argument, so i created two different tests, one where the first argument was also a global variable and always passed in as the first, and then a second where I used .bind instead
.bind was significantly slower
 
2:26 AM
native .bind sucks ass and is not representative of closure perf
 
yea that's what i learned
 
it needs to do shit ton of convoluted spec stuff
 
i was going to try and use my own closures but i was hungry so i gave up and got dinner
i'll try it again tomorrow
 
what people want? `this` to work with callbacks.
what people get? http://www.ecma-international.org/ecma-262/5.1/#sec-15.3.4.5
 
but yea, .bind was just aweful
 
2:27 AM
@Esailija I think coffeescript has nice syntax for it.
`->` this is a lambda
`=>` this is a lambda that preserves `this`
 
just saying though that it is specified to do shit ton of stuff that nobody needs bind for
which is
function bind( fn, ctx ) {
    return function() {
        return fn.apply( ctx, arguments );
    }
}
 
yea i was testing it because i THOUGHT it had the potentially to be faster, being native
but noooooooooooooooooo
 
@Esailija Quiz, where does that implementation break :)?
 
yes pretty much every built-in can be outperformed by custom implementation, v8 is just that good
built-ins have to implement convoluted spec logic
so it's only natural that optimized userland js is faster
but not if the engine is shit
@BenjaminGruenbaum couldn't say :P
 
i tried Object.create vs .prototype (at run-time, not like we did yesterday), and Object.create was just a little faster but negligible with margin of error
 
2:31 AM
you mean
 
no, not proto
 
Markdown is hard
 
HOW DO I DO IT
 
var f = function(){};
f.prototype = base;
base.constructor = f;
return new f();
 
__proto__
 
2:32 AM
performed about the same
 
@redline yay for beget
 
@BenjaminGruenbaum huh?
 
you know you don't have to keep re-creating a function for it
 
Come on, you all read Crockford :P
 
@Esailija no no no, i specifically wanted to create a new one, this isn't the same as yesterday
@Esailija this was for a run-time Object.create
 
2:33 AM
@copy HOW
this is some dark magic
 
USE THE DARK SIDE, LUKE
 
Guys, I have a question
 
@Esailija and btw, you told me how to use code when i have a large block, but not how to have a code fragment in my messages...that would be useful to know
 
@BenjaminGruenbaum If it's about passing incorrect type of arguments or abusive usage in general then I'm not interested in it breaking in that siutation :P
 
@BenjaminGruenbaum i'm curious to know the answer
 
2:35 AM
what is an umbrella term for things like "System A" "System B", "System F" ?
 
if you want inline code just use back ticks like `inline code`
 
function object(o) {
    function F() {}
    F.prototype = o;
    return new F();
}
 
@O0oO0oOO0ooO systems
blah test blah
 
@redline To what? Where bind fails?
 
YES!
that works
 
2:36 AM
What?
 
Oh, there are a bunch of reasons on the MDN page
For example
> The partial implementation creates functions that have a prototype property. (Proper bound functions have none.)
> The partial implementation creates bound functions whose length property does not agree with that mandated by ECMA-262: it creates functions with length 0, while a full implementation, depending on the length of the target function and the number of pre-specified arguments, may return a non-zero length.
 
var objectCreate = (function() {
    function MinimizingGarbageCreated() {}
    return function( proto )
        MinimizingGarbageCreated.prototype = proto;
        return new MinimizingGarbageCreated();
    }
})()
 
I think .length was the one I've had in mind.
 
I wasn't trying to shim bind
I was showing what people actually use bind for
 
@Esailija ooooooooooooooooooooooooooooo
 
2:37 AM
Yeah, I know. I'm not saying it's bad or anything either.
 
@Esailija that's a way better test, damn you always think of those things!
@Esailija i wasn't even paying attention to f being thrown away
@BenjaminGruenbaum yea too bad .bind sucks performance-wise...a closure does a better job, that's sad
 
why cannot functions just have a hidden isBound property
instead of creating closure for this in the first place
you would have first-class support for fixating the context
 
Stop that, just because closures are expensive because people haven't figured how to JIT them well enough doesn't mean closures are a problem.
:P
 
oh right then you couldn't share that function anyway
 
I'd like V8 to figure that sort of stuff. I like closures.
 
2:43 AM
Is it bad that I only worry about performance when it becomes an issue?, Over.
 
@phenomnomnominal no. It is not.
Premature optimization is the. Over.
 
0
Q: How come javascript, being a prototype based language, doesn't have an easy way to access the prototype?

opensasMay be this is a stupid question, but I'm kind of intrigued. Being JavaScript a prototype based language, with its pseudo-class function constructors sort of half baked (remember JavaScript, the good parts..) I wonder how is it possible that it didn't have, right form the start some easy way to ...

 
it can't exactly be an after thought either
 
> For what I know, the Object.getPrototypeOf(obj) was just added in late 2008, almost 13 years after JavaScript was launched.
 
if you completely ignore it until it becomes a problem then it can be hard to solve
 
2:45 AM
exactly
 
@Esailija, no, but in the general case for what JS is used for, it's not usually going to be a huge problem? Over.
 
form validation? yeah ok
:P
games, audio/video processing, server side? eventually it becomes a problem in all of these
if you ignore it
 
If you go in to solve a problem where you know there can be performance issues, e.g. games or graphics stuff or audio/video stuff, then you should be paying attention to it for sure. Over.
Yeah exactly, Over.
 
@Esailija using a common constructor function made it a little faster than Object.create when it was cold, otherwise it was pretty much the same as before, but now even more negligible, since it doesn't have to create that function each time
 
I see
how about just
var objectCreate = function( proto ) {
    return {__proto__: proto }
}
 
2:53 AM
how can i stop the id value from being the "last" value of the iteration when using event listeners like this:

for(var i in mail){
//other stuff
parent.addEventListener("click",function(){read__msg(mail[i].id);},false); //always the last id in the loop for all the divs in question
}
They always end up being the value of the last one in the loop.
 
does IE 9 or 10 support __proto__?
i didn't think it did
but that's an interesting test to say the least, i still want to try that
 
no but you can feature detect
in my stableSort I feature detect if the built in Array#sort is stable already
 
162
Q: Javascript closure inside loops - simple practical example

nickfClosures are one of those things which has been discussed a lot on SO, but this situation pops up a lot for me and I'm always left scratching my head what to do. var funcs = {}; for (var i = 0; i < 3; i++) { // let's create 3 functions funcs[i] = function() { // and store...

 
so it's only 25% slower than builtin .sort in chrome
and same speed in firefox because firefox's sort is already stable
 
so i have to make a function that assigns the event handler from outside the loop @rlemon
 
3:00 AM
@Dave you have to use with( {i:i} )
 
for(var i in mail){
    parent.addEventListener("click",(function (i) { return function(){read__msg(mail[i].id);})(i),false); }
}
 
damn - thats alot of functions in functions xD
 
eval( code );
 
I don't even know, I'm too tired
 
@Esailija ok that was faster, just a little bit
 
3:01 AM
don't use in
 
but interesting to say the least
 
var supportsProto = (function() {
    return {__proto__: {k:3}}.k === 3;
})();
 
@Esailija what is wrong with chrome's array sort?
 
it's idiotic for a general purpose sort
 
really?
 
3:02 AM
for(var i in mail){
    parent.addEventListener("click", (function(){read__msg(mail[this].id).bind(i);}),false);
}
 
i can't edit "really?" to "really?"
:P
 
the sort used in chrome is unstable, it means that if items in the array are equal, there are no guarantees in what order they will be in the result
where as in a stable sort they are in the same order as they were in the original array
 
@phenomnomnominal are you sure i should use "this" as that seems to give me cannot read property
 
which is like what you want for normal applications like 99% of the time
 
@Dave, no you shouldn't use that. Over
 
3:05 AM
@Esailija ok, but that's the only different right? so if i'm using a unique array, i don't need to worry?
 
oh :P
 
if no items are equal then it doesn't matter
 
@Dave, just Google, It's a common problem. Over.
 
changing it to [i] i get Cannot call method 'bind' of undefined
thinking its a scope issue
 
Of course it's a scope issue.
 
3:05 AM
but when sorting objects by some criteria, very likely there is something same and then the results are random is really annoying
 
Doesn't help that I wrote it wrong.
 
like sort people by age, and jack and john with age 25 come up with random order in the table
 
(function(){read__msg(mail[this].id)}).bind(i);
 
@Esailija i'll keep your sort in mind then for when i'm not sorting a unique array
 
sometimes jack is first and sometimes john is
 
3:06 AM
@Esailija, but you're sorting by age so why does it matter? Over.
 
because it looks annoying in the ui
that the positions swap
it's a bad example I guess.. I'm sure you'll run into it some day
 
Hmm yeah fair enough. Over.
 
@phenomnomnominal thanks that works :)
 
@Dave, do you understand why, and that it isn't a very good solution? Over.
 
it is definitely a desired quality to have the equal items remain in their original order, no doubt
 
3:08 AM
not really its quite confusing
 
yeah and when you don't need that quicksort gains some speed
it sacrifices stability and worst-case guarantees
 
@Dave, Go Google your problem and use a solution you understand. Over.
 
i shall - are you referring to using bind as a bad solution ?
 
Yes. Over.
 
ok
 
haha
 
@phenomnomnominal is .bind because of browser compatibility?
 
javascript's identity operator (===) is better than erlang's identity operator (=:=)
 
!!> Object.is( (0/-1), 0)
 
@Esailija "TypeError: Object.is is not a function"
 
3:20 AM
oh no you didnt
 
@Dave possibly, but you can easily shim it. Over.
 
ES6 silly
 
var is = Object.is || (Object.is = function (x, y) {
    return x === y ? x !== 0 || 1 / x === 1 / y : x !== x && y !== y;
});
 
do people really like trying to break if-statements down into as few lines as possible?
is that really fun for people?
why use a minifier...
why would anyone want readable code >_<
 
@redline - I didn't use a minifier, and the above function is pretty readable.
 
3:23 AM
minifier - fast loading times
 
@AaditMShah i know you didn't that's the problem
 
course i only do that once i actually finished xD not when im actually working on a script
 
@redline - How so?
 
@AaditMShah it's not a big deal don't worry about it
 
3:25 AM
w00 got 100% for page speed tests
 
Is there any piece of code that you reuse in almost every project? Like a few lines of code that you love to use?
 
100% speed?!? that's really impressive
 
its taken ages to do all the suggested tweaks
 
no I rewrite everything actually
 
one day i hope i can achieve 100% speed
 
3:26 AM
var bind = Function.bind;
var call = Function.call;
var bindable = bind.bind(bind);
var callable = bindable(call);
 
@redline do you not use speed test tool in chrome?
 
when it's faster than finding the code and copypasting it
 
thought that was the guy from Running Man that just entered chat then xD
 
is there a good js library for making cross origin resource sharing requests?
hi everyone
 
kim have you heard of running man tv show?
 
3:28 AM
yes? I think it's a South Korean variety show
 
thats the one!
i thought your name was same as sparta guy :P
 
I don't know that reference, I don't watch Korean tv.
 
oh i watch the streams with english sub - funnier than any tv show in the west imo :P
 
what's it about?
I've been looking for good korean tv shows to watch.
 
@AaditMShah bind.bind(bind) srsly
 
3:29 AM
one team are chasers the other are runners chasters have bells on the runners have to survive the time limit without being caught
@KimJongWoo kshowonline.com/category/2/10/10 start from ep 1 :)
they 90 min eps tho so ull need spare time xD
 
sweet
thanks!
 
np
 
How did you find out about this show?
Are you Korean?
 
no im british
i just found it randomly and gave it a try
 
@KimJongWoo You must configure your server for that.
No JS libraries can do it
 
3:40 AM
anyone realize that one of the tags in the room is 6 seasons and a movie?
 
thats community!
 
I need a server as well?
how is this different than just having a reverse http proxy
what the hell is the point of CORS if you need a server
 
@TrevorRudolph no shit, over.
 
I should be able to make cross domain ajax requests from browser
 
3:41 AM
cross domain ? pretty sure thats security issue ?
 
@phenomnomnominal wlle you dont have to be an ass about it?
 
or do you mean subdomains?
 
@TrevorRudolph, I don't have to do anything, over.
 
Node.js is a server-side software
 
3:42 AM
damn I'm hungry
yes I realize that now
I missed that part omg
 
:P
 
I love that animation on the side just now
when a user joins, the avatar slowly slides into place
 
yeh tis funky
 
It's better at Christmas. Over.
 
alright so CORS still requires a server....
 
3:44 AM
@KimJongWoo Why are you stuck with CORS?
 
ugh I Was excited about it this morning
rushed home to start working with CORS
stuck? what do you mean
 
What are you trying to do with CORS?
 
@phenomnomnominal i know it hurts but if you need help prying the rod out of your ass i'll help
 
I thought you were asking a question.
 
hes looking for a library
fraid i cannot help there :P
 
3:46 AM
sorry that was rude
 
@TrevorRudolph, I have no such rod, sorry about that, can't help you fulfill your little gay fantasy. Over.
 
i havent slept in 2 days i have finals
i dont mean to be rude
 
me too but i dont have finals...ever
 
Meh, wasn't really rude, and I don't really care.
 
@TrevorRudolph if this doesn't explain: New User? Read rules.javascriptroom.com | "But you probably won't... Banana."

Basically don't take things seriously ;)
 
3:47 AM
@Dave thanks hahah
 
I'm cranky because someone is playing Vengaboys on our work media server.
 
i've been studying and coding a chrome plugin for a week and i cant find any way to store data between the runtime environment and my options page
 
@KimJongWoo I cannot suggest you a library to work with in Javascript for CORS but you can learn about things like Facebook API or Twitter API
 
and i dread trying cookies, i tried jstorage, only it uses localsotrage, i tried localsotrage directly and it didnt work
then i tried to send messages between the two pages but that requires the chrome api to use a background.html page and i only want to use a content script
any thoughts?
 
@O0oO0oOO0ooO why the hell would I need Facebook API or Twitter API? I haven't even mentioned building anything, it was just your assumption that I was building something.
with html5 localstorage, does it persist even if the browser close, restarts computer?
how does it uniquely identify the person's data
 
3:53 AM
if parent div has event listener as well as the child - for a mouse click - will it register both if u click the child div?
 
I think so
 
damn
 
doesn't it bubble up?
e.stopPropagation();
alright dinner is cooking
finallly I will be able to have 2 meals a day
for a month I think I was eating almost 1 meal a day
 
who was here earlier when we talked about the "going deep" javascript????
and @KimJongWoo its local storage it is saved by the browser, most browsers dont delete it unless you tell it to
 
@Esailija - bind.bind(bind) is a very useful function.
 
3:57 AM
what does it do
 
it binds
 
@Esailija - It takes a function func and returns a function equivalent to func.bind.
 
so I can do bind(fn)(ctx) instead of fn.bind(ctx) like normal people
 
For example if you wanted to create an array from an arguments object:
You would do Array.prototype.slice.call(arguments);.
Instead you can use:
 

« first day (971 days earlier)      last day (3977 days later) »