« first day (1527 days earlier)      last day (3408 days later) » 

1:00 PM
Oh make a JS object
 
Object.keys() is a static method on Object.
 
@SecondRikudo o.keys(data).(forEach|map|whatever) what you were thinking?
oh
@SecondRikudo so Object.keys(data).(forEach|map|whatever) is the foundation of this code snippet?
 
It takes an object as an argument, and returns an array of the keys of that object.
 
@SecondRikudo so is that right so far?
 
@TejasManohar It's not meant to be copy/paste code... please read on Array#forEach and Array#map, as well as Object.keys().
 
1:01 PM
sure
 
Kinda weird keys is not in the prototype of Object.
 
@AwalGarg var obj = undefined; obj.keys() // Oops
 
It was added in es5, so they didn't want to break bc
 
Also this ^
 
The reason that a lot of methods are static like freeze etc
 
1:03 PM
@SecondRikudo k... it can just raise an error that obj is not a proper object or whatever...
 
Yeah, @SecondRikudo's argument sucks
 
Object.prototype.keys = function() { return Object.keys(this) } xD
 
@Mosho just as ew :P
 
data.forEach(function(obj) { console.log(obj.path.key); })
@SecondRikudo whipped that up, works for me
 
What argument?
 
1:10 PM
@TejasManohar Great :)
You can do some interesting things with these array methods
 
Don't put keys on object, there are good reasons it's a static method and not on Object.prototype
 
For example
var keysArray = data.map(function(obj) { return obj.path.key; });
After this, keysArray has an array of just the keys
 
Poll: Which is your favorite array method?
 
@AwalGarg .map .reduce and .filter and .forEach all have equal usefulness for me
 
@FlorianMargaine that's not it, it's not about BC at all..
What BC would it break anyway?
 
1:12 PM
wait @BenjaminGruenbaum what would u rather me do
 
@BenjaminGruenbaum none that I see.
 
@BenjaminGruenbaum Lots of shit people do with assigning .keys I guess?
@TejasManohar He wasn't talking to you.
5 mins ago, by Awal Garg
Object.prototype.keys = function() { return Object.keys(this) } xD
 
@TejasManohar what are you trying to do here?
 
He was referring to that
 
"Don't put keys on object, there are good reasons it's a static method and not on Object.prototype"
 
1:12 PM
The method is called "the case for static methods on objects in ES5" or something like that
 
oh I know @BenjaminGruenbaum, was just kidding.
@SecondRikudo but .filter is just so awesome!
 
Lemme look for it.
 
@AwalGarg You can do pretty awesome things with all of them.
 
@SecondRikudo NO. .FILTER IS THE DA BEST.
:p
 
1:14 PM
@BenjaminGruenbaum anyone using a keys method/property would have a broken app.
 
function pluck(field) {
    return function(el) {
        return el[field];
    }
}

var names = arr.map(pluck('name'));
 
@FlorianMargaine then "anyone" would already have other broken things.
 
@FlorianMargaine no, they wouldn't, they'd just be unable to use keys without indirection.
 
@FlorianMargaine Because they wrote their code in such a way, that a prototype property could interfere with their object.
 
1:16 PM
Ah, right
 
function unique(el, index, array) {
    return array.indexOf(el) === index;
}
var uniqueArray = arr.filter(unique);
Is pretty awesome too though ^
 
.filter(Boolean) // is beaten by nothing!
 
.map(Number)
 
.map(eval)
xD
 
!!> [1,2,3,4].reduce(Math.imul)
 
1:18 PM
@BenjaminGruenbaum [0,2,6,12]
 
@BenjaminGruenbaum 24
 
Factorial?
 
!!mdn imul
 
1:18 PM
It multiplies every element in the array with the next
 
o_O
TIL imul
 
.map(parseInt); // oops
 
@FlorianMargaine lol
 
But I think that promiseArray = valueArray.map(somePromiseFn) is the most mind blowing.
@FlorianMargaine That would be funny XD
 
My new favorite javascript function from last night is createTreeWalker :D
I should create a 1000x faster version of querySelector with createTreeWalker
 
1:22 PM
Lol, go ahead and try to :P
 
why lol?
 
I don't think you'll be able to make a faster version that's all.
 
2
Q: TypeError: Cannot read property 'childNodes' of undefined angular

SajeetharanI am stuck with this error, am having a custom directive for creating a bar chart, which gets generated from a json file. Here is my code, I have a Index.Html page, where one view is routed inside based on the navigation here is the Index.Html <html lang="en"><head> <title>DiginRt</title>...

please help me on this
 
@BenjaminGruenbaum createTreeWalker is faster than pretty much every getElement(s)By function... and is far far far more extensible.
 
It's barely isolated - how did it get two upvotes o_0?
@AwalGarg lol, looks like someone drank the @Zirak juice :P
 
1:30 PM
-_-
Y U TROLLIN?
 
any angular experts?
 
@AwalGarg I'm not trolling, there are several books written on selector engines :P
 
@Sajeetharan @BenjaminGruenbaum is an angular and jquery expert.
 
@AwalGarg Oh, so this is how it's going to be :P?
 
@BenjaminGruenbaum hi bro, please help me on that question
 
1:32 PM
xD
now, enjoy :D
 
I actually have code in both Angular and jQuery
Sorta
 
@Sajeetharan he won't answer properly until you ping him about 3-4 times.
 
That's true.
 
@BenjaminGruenbaum There is a bounty for that question, consider pls
 
1:33 PM
Is it urgent? @Sajeetharan
 
roflmao!
 
@BenjaminGruenbaum yes am stuck with it for 4 days
 
Well, I want big butts and I cannot lie — Nicholas 1 min ago
can you give me some suggestions — Harsha 28 secs ago
lol
 
lol
 
@IanClark hai Ian!
lol
 
1:33 PM
@Sajeetharan Is it for work and your boss is expecting results?
 
Oh hai dere @Awal!
You well? :)
 
yeah, yourself?
 
@SecondRikudo "butts"
 
@BenjaminGruenbaum yes, am from c# backgrund , but this is very new to me, my deadline is on 19th
 
Yeh not bad TY, anxiously waiting for a week off :D
 
1:35 PM
downvote? :)
 
@Sajeetharan oh wow, so it's past the deadline (it's urgent) and your boss is expecting results. The first thing you want to do is isolate the issue as much as possible.
I want you to create a plunkr with the issue, only much much more isolated, it should be under 20 lines of code.
 
@BenjaminGruenbaum The code works when we separate, problem comes only when its get embeded inside a view
 
@Sajeetharan Isolate it, remove every bit you can while reproducing the issue.
 
!!afk - @BenjaminGruenbaum is offering unlimited free help on jQuery and Angular issues, if you ping him 5 times. Offer valid for limited time only!
 
Yeh @Sajeetharan that's a hell of a lot of code to read through
Does he have a hot-line?
 
1:38 PM
@AwalGarg you know I can pin stuff... right?
@AwalGarg is working on a new PHP Wordpress + jQuery plugin book, he is interested in answering all your questions to help make it better. Please help him by pinging him with yout questions by appending @AwalGarg to all your messages.
 
Awaits the jQuery horde
 
in JavaScript , 2 mins ago, by Benjamin Gruenbaum
@AwalGarg is working on a new PHP Wordpress + jQuery plugin book, he is interested in answering all your questions to help make it better. Please help him by pinging him with yout questions by appending @AwalGarg to all your messages.
in JavaScript , 2 mins ago, by Benjamin Gruenbaum
@AwalGarg is working on a new PHP Wordpress + jQuery plugin book, he is interested in answering all your questions to help make it better. Please help him by pinging him with yout questions by appending @AwalGarg to all your messages.
 
1:52 PM
shit
well, @BenjaminGruenbaum's offer is now over!
 
I'm glad we could come to a reasonable agreement :D
 
xD
 
Also, it was an old joke anyway :D
 
haha nice
 
-2
Q: Javascript scroll page to a position after 1000ms of page load

user3342747Title is kind of self explanatory, Need to know a javascript command to make the page scroll to a certain after 1000 ms of page load.

Fail
 
How can I force a line break in a flexbox?
 
@AwalGarg Eh?
 
@SecondRikudo I want the last item of the flex-box to be on it's own line, no matter space is available or not.
Possible?
 
2:32 PM
lol
@rlemon that post is seriously lacking on the jQuery field.
 
@BenjaminGruenbaum you!
 
@AwalGarg :D
 
lol
1 message moved from [HTML / CSS / WebDesign ](chat.stackoverflow.com/rooms/29074/html-css-webdesign)
 
o...k
 
Keep looking :D
 
I kicked SpringLearner by the way, and then gave him an inspirational speech about how much he's not cool for refusing free jQuery and php help :D
@AwalGarg :D
 
Wait what?
 
He's a meanie.
 
Without using eval or any similar method, write something that accepts definition of variables in javascript syntax, (var a = 3; var b =4;) and allows basic arithematic operations on them.
Originally a question in the compiler assignment. the variable declration was a := 3
@copy @shmiddity can we write it like reallllly small?
 
in recycle bin, 5 mins ago, by Benjamin Gruenbaum
You offer people help and this is what you get in return... :(
@BenjaminGruenbaum ...
#troll
 
2:41 PM
:D
 
@BenjaminGruenbaum lol
I wrote one but i am stucck with AST
 
@darkyen00 write a parser, you don't even need an AST phase here.
Read the dragon book :D
You can do with a very basic recursive descent parser.
 
@darkyen00 I guess writing a parser for it won't take long?
 
You can also use a parser generator
 
like lex. ?
 
2:46 PM
@SecondRikudo jsfiddle.net/ep2td7ub this. (I am not allowed to increase the width of the elements, or move the last div element outside the parent). Possible?
 
Unlikely, but ask in the HTML/CSS room, people there know flexbox better than me.
 
shit
I thought this was the css room
-_-
 
what language is that ?
 
Erlang
 
3:03 PM
o/
I've got a decent build system workflow set up for my engine now.
Anyone happen to have a nice JSDoc theme I could use?
 
@copy damn.
 
Why am I the only person to vote to close this +38 unanswered question which was asked yesterday? stackoverflow.com/q/27568249/1317805
 
That's... wow, Haven't seen something like that in a while now...
 
@JamesDonnelly Because everybody disagrees with you that it should be closed
+1
That is, vote and person who disagrees with you
 
But it's nothing more than a bug report which asks for an opinion-based answer.
 
3:09 PM
It's interesting
 
That doesn't make it relevant, though.
 
In what sense is it opinion-based?
 
The question asks: "Is this known behavior that should be avoided? Is it fair to consider this a performance defect?"
Are those not questions which could only ever generate opinion-based answers?
 
@JamesDonnelly It does just because of the fact that some objective facts can be learned from an answer
 
Any1 know how to theme JSDoc??
 
3:15 PM
Valid answers might be:
- We didn't think of that
- We did think of that, but it's too difficult to implement for [reasons]
- The spec says it's allowed, given [interpretation]
 
I need to make a full template, don't I?? Ok, here goes nothing
 
Suppose a dev on that browser posts one of those answers, it's their 'opinion', but it's the opinion of someone who's authoritative
 
@TomW but wouldn't those answers most likely come from a relevant bug tracker?
 
What does that have to do with anything?
 
I get the feeling the only answer this question will receive will be one posted once the issue (raised in comments) has been answered by the JavaScriptCore devs.
Are bug reports not off-topic on SO?
 
3:21 PM
They are.
 
It's not just a bug report, it's also asking why this performance behaviour is emerging
 
@copy Because it's a bug?
 
@copy but the performance issue is the bug.
 
3:23 PM
Meh, I don't even care
 
@darkyen00 @copy ^ :P
 
lol
 
@SecondRikudo Copy cat is primitive to none.
 
@AwalGarg A second beaver is second to none.
 
@SecondRikudo Second Rikudo
 
3:36 PM
I'm no beaver
 
css should allow :after:after:after:after
 
yeah, but how do you use content: attr(data-content) on the second after ?
 
@dievardump from the original parent element only.
 
JSDoc is weird
 
That was a "yo mama" joke call.
 
3:41 PM
someone raped the star queue again.
 
exposes.init documentation is not generated.. pastebin.com/bvdwja0D
 
wth is that
 
That's my just started JS game engine code
 
50% done
 
Da fuck, why can't I access pastebin :(
@SomeGuy @darkyen00 can you access pastebin?
 
3:45 PM
!!tell AwalGarg echo doj.me
 
@AwalGarg doj.me
 
!!doj
 
@darkyen00 That didn't make much sense. Use the !!/help command to learn more.
 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html><head<title></title></head><body> <!--This is a comment. Comments are not displayed in the browser--> </body></html>
this is the markup I recieve from pastebin
tried accessing it in a VM, same issue
 
@Makerimages Then I think you should not go further for the moment
 
3:47 PM
much better
and made by the mightyy @FlorianMargaine
 
@darkyen00 I have to see the ones other people post...
 
Look at things like Browserify or requirejs so you won't have to deal with this horrible var Eloo = window.Eloo || {};
and forget about the "expose" pattern
 
HTTP/1.1 200 OK
Content-Type: text/html; charset="utf-8"
Content-Length: 175
Connection: Close
da fuck is wrong ;'(
 
paste.ubuntu.com/9589109 @AwalGarg , so you could see it too.
 
but... that is not the issue.
 
3:49 PM
@dievardump It's okay, in my opinion
 
I want to fucking access pastebin!!!
 
Nothing for a beginner to worry about
 
@dievardump WHat namespacing pattern you'd reccomend then??
 
@AwalGarg host pastebin.com
 
Anyways, I think I'll be dumping JSDoc if it can't doc me that....
 
3:50 PM
@Makerimages it can doc you that, but you need to use the @namespace I think.
 
pastebin.com has address 141.101.112.16
pastebin.com has address 190.93.241.15
pastebin.com has address 190.93.243.15
pastebin.com has address 190.93.240.15
pastebin.com has address 190.93.242.15
pastebin.com mail is handled by 10 aspmx.l.google.com.
pastebin.com mail is handled by 30 aspmx5.googlemail.com.
pastebin.com mail is handled by 30 aspmx2.googlemail.com.
pastebin.com mail is handled by 30 aspmx4.googlemail.com.
pastebin.com mail is handled by 20 alt1.aspmx.l.google.com.
pastebin.com mail is handled by 20 alt2.aspmx.l.google.com.
 
There is no way the JSDoc understand that expose is the Eloo.Game object
Since it's not obvious and pretty weird (for me)
 
@copy ^
 
@AwalGarg Cloudflare issue
 
@copy so problem is on pastebin's side?
 
3:52 PM
Yeah
 
Though so... that is why asked @darkyen00 and someguy
@darkyen00 can you access pastebin or not?
 
@dievardump, so a @namespace for the var exposes or what?
 
yeap
> ^ I can just to verify this ... in your face @Awal
 
fml
 
3:56 PM
maybe you can also do something with @link
 
@dievardump No success on @namespace
grrr
 
@AwalGarg JUST USE @FlorianMargaine site god damnit
 
16 mins ago, by Awal Garg
@darkyen00 I have to see the ones other people post...
@darkyen00 why
 
I'll just give this a kick into the garbage.. might make one myself
 
@darkyen00 you
@darkyen00 no
@darkyen00 understand?
 
4:03 PM
@AwalGarg ask them to use florin ?
or just use some proxy site, froooooooooooooooooooooooooooooooooooooooooooooooooooooooooooob
 
@darkyen00 which is what I am doing, noob.
But it is just a workaround.
 
@AwalGarg its not... if you have vpn like me, noob
 
I don't have a VPN :(
 
Oct 31 '12 at 19:57, by Zirak
@dievardump Are you some sort of random internet-ian cesspool?
 
the vpn helps me a lot.
 
4:05 PM
Oh man, I just found that, that burnt so hard
 
@Zirak You use Zsh?
 
4:28 PM
Here again with something to ask...
How would you guys go about defining environment-specific configuration on a node-app?
Basically, I've been spoiled by Laravel which makes it super easy to use environment variables.
Not sure how to achieve same kind of setup with node.
 
Hello guys
i have an issue with bootstrap select if any one can help me out
here is the demo
the issue is that on IE you can not select an item
because they are all selected by default ??
 
does anyone know how to create a checkbox area and set variables to different amounts based on checks? I can use jQuery.
 
$('checkbox:checked').length ?
 
how would I create the checkbox in html?
 
@MarttiLaine you mean process environment variables?
 
4:38 PM
<input type="checkbox" />
 
ok
thanks
 
@AwalGarg Yeah. I'm figuring it out though.
 
$('checkbox:checked').length will check for all checkboxes in the page
 
and then how do I process them?
 
make sure to use a selector to target a groupe of items
 
4:40 PM
What does that mean? Im new to this jQuery stuff
 
@MarttiLaine you can set environment variables in the config block of your package.json
 
@AwalGarg Didn't know that. However I'm looking for a way to not sync them to git.
 
what would a selector be?
 
And I'm doing that by simply getting the hostname in Node and then loading a config-file based on that.
...and the config-files are listed on .gitignore
 
@AwalGarg As required, here's a ping for you, Anthracite is ready ( dystroy.org/miaou/409?Tribo_World_Cup_One#713985 )
 
4:44 PM
@MarttiLaine in that case, create a bash script which starts the node server for you, and start it as follows: varName=value node app.js. Now varName would be available everywhere with its value set to value.
@dystroy \o/
 
@AwalGarg Yes, that was my initial idea but simply loading a configuration-file based on os.hostname() works nicer IMO.
 
@MarttiLaine yeah
 
no one could help for the bootstrap select js bug ?
still does not work on IE when i add the search live attribute
;(
 
It's now clear, Anthracite, not me, will win the TWC...
 
I am terrible :(
 
4:51 PM
No, she plays very very smart...
 
@dystroy I suspect she made the game, not you xD
...
 
No, no, I invented the game, but that doesn't prevent her to be smarter than me ^^
 
@dystroy /me played seriously xD
 
5:10 PM
And she made big errors...
 
I am a terrible player
 
This game is surprisingly like Go. xD
 
@dystroy yeah, and it was still very close lol. I suck.
 
I'm so ashamed of code I just wrote because I answered and it was incorrect so I answered correctly and it's horrible and __proto__ :D
 
5:31 PM
t
yay my wifi came back
 
Yay for wifi!
 
You're in so many rooms...
 
@AwalGarg I slept
it was a tiring sleep, I saw a lot of dreams, which has no meaning, like I am being eaten by a girl with a bald head.
I got annoyed and woke up.
 
@BenjaminGruenbaum Who me? :P
 
5:46 PM
Yeah
 
(box = own)
Hmm, maybe.
Oh well.
 
gist.github.com/tejasmanohar/9892f3f21e5fe2a109a6 - return [item.title, item.link]; on line 35 doesn't return anything meaningful since it's in the .end(function(err, res) { and not function getTopPost() { directly
would someone help me chain this up w/ callbacks
 
Need some help guys. Implemented some utility functions for DOM manipulation, and wanna make a caching system. Problem is, if one of the element in the cache is removed from DOM, it would cause a memory-leak. How do you deal with such situation?
 
LRU cache
Mutation events
More the latter
 
Mutation events are not cross browser :(
 
5:57 PM
anyone knows about cps
 
Redirect all other browsers to goatse
 
haivng trouble above
 
@copy -_-
 

« first day (1527 days earlier)      last day (3408 days later) »