« first day (897 days earlier)      last day (4276 days later) » 

18:02
@alex-shesterov Welcome to the JavaScript chat! Please review the room pseudo-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.
@tereško The question is, when you have a document fragment that contains multiple children, and you append them to the DOM with elem.appendChild( fragment ), will the browser make sure that only one page reflow occurs.
Oh yea, in other news I'm probably going to start to train Krav Maga. :)
Should be fun.
@ŠimeVidas I'm pretty sure web-kit does, no idea about other browsers.
@ŠimeVidas that's kinda the purpose of documentFragments
cya later. watching tv now.
18:05
@ŠimeVidas also, you can easily test it, in Chrome you can watch reflows in the web inspector, and firefox has an addon that monitors reflows
@OctavianDamiean Trying to figure out what god damn thing is hugging the NT Kernel with 80% CPU usage. Gotta download a couple of gigabytes of SDKs just because MS isn't capable of distributung a 300kb program standalone
@JanDvorak Ensuring only one reflow is more like a bonus. Document fragments weren't created for that reason.
@OctavianDamiean I did for a while, everyone here has to, all the instructors are crazy
@IvoWetzel I'd just get rid of Windows. :D
18:06
@OctavianDamiean Tell that to my mom then
@ŠimeVidas weren't they? Resource pls
@BenjaminGruenbaum I heard that it is taught in schools in Israel.
@IvoWetzel She isn't a hardcore gamer or design engineer by any chance?
@OctavianDamiean Not in schools, in the army, but conscription is mandatory which sucks because I really hate the concept of army.
@JanDvorak Their purpose is to enable working with offline DOM trees.
@OctavianDamiean She's playing WoW casually with friends
and some strange driver hugging the CPU + 25 people raid don't mix to well on her machine
18:08
@BenjaminGruenbaum Ah, well I knew that it was taught in the army (mainly because it was developed for the army). :D
@IvoWetzel Oh, well then it sucks.
@OctavianDamiean It's the only martial art that says run away. It's a bunch of really dirty sophisticated tricks to get out of really close combat and to a point you can fire your gun.
@BenjaminGruenbaum Its reputation is much better than you describe it here
Yea, I'm actually kinda familiar with the concept, read about it and saw a documentary about it.
@copy That's really what it is, it was designed from the ground up for that
Though, it is not really a martial art.
It is more like a very specialized and sophisticated self-defense system.
18:12
@copy They teach you to beat people up, but only to get to a point where you can get back to a firing position. A lot of the moves are done with your gun, and are series' of moves that evolve you loading and locking your gun while beating the other person up. That said, I dislike violence
@ŠimeVidas It's a pretty interesting question though, maybe you should ask it
@BenjaminGruenbaum Where? Stack Overflow would be off topic I think
@ŠimeVidas Why? It's a specific programming question about an issue you're facing. I think it's very on topic
@BenjaminGruenbaum I haven't looked into it, but it could have been an option for me. But now, tennis
@BenjaminGruenbaum Yea but it evolved a bit! They branched off from pure military taught Krav Maga and made a civil version of it. The basic principle being the same.
@ŠimeVidas a lot more interesting than "how do I check the width of an element with jQuery, didn't read the manual, lolz"
@copy Tennis sounds better :)
18:14
Just without getting back into firing position.
@OctavianDamiean The instructors are crazy, all they do is shout at you for hours, that terrorists are coming for you, how they can take 10 bullets without falling, that they take really powerful painkillers and drugs, that sort of stuff.
I'm sure that's how it is in the military, no doubt, however I'm talking about the civilian version taught at Krav Maga clubs here in Europe. :)
@OctavianDamiean Oh lol, well, you could try it out :) Martial Arts are fun sports
Oh I know that, had several years of martial arts experience. :)
@Jan-StefanJanetzky first power ... slow-down - time :D
18:17
Oh, in that case I'm glad I didn't call European Krav Maga pussies, since probably you can beat me up and not the other way around :P
Taekwondo for three years, some Karate (only a year though) and my father teaching me something similar to Krav Maga but not centered around defense but about offense.
@Darkyen how shall it trigger?
@OctavianDamiean But have you mastered jQuery?
@ŠimeVidas If you won't ask it I'm willing to (probably as community wiki since I don't want to take credit for the question idea)
18:18
I love transparent&white PNGs :-)
@BenjaminGruenbaum CW forces all answers to become CW, IIRC
@BenjaminGruenbaum No man just ask I don't mind
@Jan-StefanJanetzky r
its basically just implementing actual timer in the game
@kabuto178 Welcome to the JavaScript chat! Please review the room pseudo-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.
0
Q: How many Reflows does attaching a DocumentFragment Cause?

Benjamin GruenbaumUsing DocumentFramgment allows us to attach DOM elements to each other without causing a browser reflow. A lot of libraries like jQuery use document fragments to improve performance. The document fragment can have a complicated structure. For example, let's say it represents something like: <...

@ŠimeVidas Feel free to edit it in whatever way you'd like
<a href='asd' />asd</a>
@BenjaminGruenbaum ^?
18:29
@Nile where? :P
@BenjaminGruenbaum psh, must've been my silly eyes
@BenjaminGruenbaum Cool. Looks fine.
@ŠimeVidas edited in your actual question from the room
@BenjaminGruenbaum Isn't the point of them that they only make the page reflow once?
that's what I thought
24 mins ago, by Šime Vidas
@JanDvorak Their purpose is to enable working with offline DOM trees.
18:33
24 mins ago, by Šime Vidas
@JanDvorak Their purpose is to enable working with offline DOM trees.
!!/Ninjad
@BenjaminGruenbaum Command ninjad does not exist.
@Zirak the bot is broken :(
!!/slidepoop
@BenjaminGruenbaum Command slidepoop does not exist.
18:33
> Since the document fragment is in memory and not part of the main DOM tree, appending children to it does not cause page reflow (computation of element's position and geometry).
!!/info
@JanDvorak I awoke on Sun, 31 Mar 2013 13:14:57 GMT (that's about 8 hours ago), got invoked 32 times, learned 1 commands
so when appending it to the page, it should only force 1 reflow
@Nile the quote doesn't claim that
at least that'd be my intuition
18:34
@Nile I can't see how you deduced that
It's still what I think
@Nile Right, we all think that's what should happen but can't find any evidence to support our intuition. This is what makes it a good question imho
No. That's what makes us officially too lazy to google.
> DocumentFragment DOM Generation This pattern lets us create multiple elements and insert them into the DOM triggering a single reflow. It uses something called a DocumentFragment. We create a DocumentFragment outside of the DOM (so it is out-of-the-flow). We then create and add multiple elements to this. Finally, we move all elements in the DocumentFragment to DOM but trigger a single reflow.
18:37
@Nile that's what google (and us) thinks. I would like to see a W3C link
@Nile In chrome you can actually see that since it lets you monitor reflows in the dev console. Is it consistent across browsers?
@Nile Also, a fiddle or perf might be interesting
@UchihaObito Welcome to the JavaScript chat! Please review the room pseudo-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.
@UchihaObito nice gravatar
@racetrack Welcome to the JavaScript chat! Please review the room pseudo-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.
$$('div').addEvents({
	'mouseenter': function() { this.addClass('hoverCss'); },
	'mouseleave': function() { this.removeClass('hoverCss'); }
});

I have .hoverCss which should change the background of the div on event, why this doesnt work? :/
class="hoverCss" is begin added, but the background doesnt change
18:40
@UchihaObito Format your code! (control+k)
Thanks, can you create a fiddle on jsfiddle.net or jsbin.com or codepen.io ?
what's a fiddle?
@UchihaObito what is $$?
@UchihaObito It's a reduced test case that illustrates your issue
@JanDvorak all elements in mootools
18:41
@JanDvorak addEvents looks like mootools
@UchihaObito you can go on jsfiddle.net, from the left you can import mootools, add only a small part of your code (preferably under 20 lines) that illustrates the problem, that we can debug
ok
thanks
@UchihaObito No problem. Also, what you're trying doesn't require JavaScript at all, there's a :hover CSS event that works like a charm
If the class doesn't affect the rendering, it's not the Javascript's fault
Also, that ^^
@Benjamin I'm trying to make a game tic-tac-toe
@OctavianDamiean Great, in the end it was mcaffee running amok
18:44
@BenjaminGruenbaum for now, I'm trying to learn events
Anti Virus Sucks
@IvoWetzel Don't install an anti-virus, it's not 1996 any-more
@IvoWetzel Oy! McAfee!? Go with Avira
@Nile That would be a good answer for the question on Stack Overflow.
@ForbiddenOverseer Welcome to the JavaScript chat! Please review the room pseudo-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.
18:44
I use MSE
@ŠimeVidas I posted the link to the quote in a comment, though it seems that @BenjaminGruenbaum wants some standards that back it up
@Nile I don't think that standards exist that define reflows.
@BenjaminGruenbaum I don't have aynthing on my Linux box here, but you know... it's my Mom's Windows Laptop who knows what she installs... apparently she had mc affee, but removed it, except that it's updater didn't get removed and then (I guess) was blocked from calling home by the new Anti Virus
@ŠimeVidas I'm aware =/
@Nile This is purely a practical question about what browsers actually do.
18:47
^ I have this, and my class is not being displayed :(
@UchihaObito Your code is working, a class called 'hoverCss' is indeed being added. The problem is with how CSS works
@UchihaObito Your _div_s have a style attribute, that takes precedence over classes
ahh, okay
thanks
posted on March 31, 2013

Over a year ago I released Sonic, a JavaScript Canvas utility for making loading spinners. I’ve used it in a couple of my own projects and was pleased with the result but I quickly became aware that others may not be happy to: Include a…

@UchihaObito here is a bad fix jsfiddle.net/M8fcx
Ewww, inline styles.
18:49
@UchihaObito Don't use !important thought, it's just to illustrate a point
wow, thx
alright, I'll fix the styles
You're welcome :)
user1125394
!!> document.getElementById("test");
@crl "ReferenceError: document is not defined"
@crl It runs in a web worker, you don't have any DOM access
user1125394
18:51
doesn't, yes
@shytikov Welcome to the JavaScript chat! Please review the room pseudo-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.
@nol Welcome to the JavaScript chat! Please review the room pseudo-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.
php is bad
@AustinScribner Welcome to the JavaScript chat! Please review the room pseudo-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.
> Document tree modification will trigger reflow. Adding new elements to the DOM, changing the value of text nodes, or changing various attributes will all be enough to cause a reflow. Making several changes one after the other, may trigger more than one reflow, so in general, it is best to make multiple changes in a non-displayed DOM tree fragment. The changes can then be made to the live document's DOM in one single operation:
@BenjaminGruenbaum More potentially helpful info dev.opera.com/articles/view/efficient-javascript/#modifyingtree
@jcolebrand Welcome to the JavaScript chat! Please review the room pseudo-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.
@SOChatBot so who set you up?
I need to punch someone in the face for not having me on the list of "auto-ignore-join"
19:07
!!/tell jcolebrand help
@jcolebrand don't worry, he loves me too
@Nile If you feel like answering this question, preferably by actually checking the number of re-flows in all major browsers go ahead. I think an empirical answer along with "it is not defined in the spec" would be great
@Nile The answer I'm accepting is what @ŠimeVidas chooses since it was his question, he just didn't want to ask it in SO
@BenjaminGruenbaum I may do some tests later or something. I wish the browsers gave us a way of detecting reflows/repaints
@Nile They do. In the beginning of the discussion I mentioned you can do this in Chrome and Safari easily using the dev tools. Also you can do this in Firefox, IE I'm not sure but probably as well. Opera also probably
19:13
@BenjaminGruenbaum With a function, not with dev tools
@Nile Of course the best answer would involve the actual logic that does this in the source code of those browsers, but that's hard
@SarabjeetSingh Welcome to the JavaScript chat! Please review the room pseudo-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.
@SamiullahKittur Welcome to the JavaScript chat! Please review the room pseudo-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.
!!/mustache sarabjeetsingh
@JanDvorak Command mustachify does not exist. Did you mean: mustache
@JanDvorak User -1 was not found.
!!/undo
@JanDvorak I'm afraid I can't let you do that, Jan Dvorak
@Mose Welcome to the JavaScript chat! Please review the room pseudo-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.
!!/mustache mose
0
Q: How should I execute my php code using AJAX?

colourthewebI've written the conditions down in JavaScript and if it's a down arrow then I want to update the database whereas currently it's not falling into the javascript condition and updating the database at server level. Any help will be appreciated. Code: <script language="javascript"> $(d...

fail
ure
another fail
-4
Q: Javascript regex with variable in pattern

rdantasI'm trying to use a variable in my regex pattern, but it doesn't work. var pattern = "\["+myvar+"\]\[\\w\]\[\\w\]"; var pattern_regex = new RegExp(pattern); alert(pattern_regex.test(form_content_html)); What is wrong with my pattern?

ure
afk again. watching tv :D
19:34
@Jan-StefanJanetzky his question actually makes some sense, he probably wants to escape the variable name. Sadly, he fails at communicating
@Jan-StefanJanetzky i think turbo c's graphic.h is way too slow
@Darkyen -_-'
and flikery this shall be completed in GCC :D , the thing is when i added time based moment and shit the game became very less playable :-(
@BenjaminGruenbaum hey we atleast tried :D
NetTuts+ is a GREAT SITE!
20:01
0
Q: Why does JSON.stringify not serialize non-enumerable properties?

Benjamin GruenbaumI'm serializing objects to JSON strings with JavaScript, I noticed only enumerable object properties get serialized: var a = Object.create(null,{ x: { writable:true, configurable:true, value: "hello",enumerable:false }, y: { writable:true, configurable:true, value: "hello",enumerable:true ...

Answers appreciated
@cnpjenn Welcome to the JavaScript chat! Please review the room pseudo-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.
i'm trying to get fancybox to work on my wordpress site and i'm having some issues with it... i am using some javascript that is working on another site, but it will not work on a second site and i cannot figure out why
Wow, turns out that JSON.stringify is actually part of the spec
I made my first game in JS ! tic-tac-toe is ready ! yeeah :D
net-enabled?
AI?
20:14
@UchihaObito congrats :) This room has regular users like SimonSarris and Loktar who have written very good stuff about to work with the canvas and make games in JS.
@Benjamin cool
@JanDvorak the AI is in progress :/
this way is impossible to loose, computer selects random (and not selected) fields
but I'm on it
user1125394
you can do it with all states
@UchihaObito What will you use for the AI?
!!/define loose
@JanDvorak loose: Not taut, fixed, or rigid: a loose anchor line; a loose chair leg. (source)
20:17
!!/define lose
@JanDvorak lose: To be unsuccessful in retaining possession of; mislay: He's always losing his car keys. (source)
user1125394
3^9 states, but there are some removales
@user2230079 Welcome to the JavaScript chat! Please review the room pseudo-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.
@BadgerGirl constants, I have no idea how to make AI automatic
@UchihaObito Minimax :)
20:19
@BadgerGirl I'm new with JS :P I don't think I'll be able to use it for now
AI for tic-tac-toe is very simple, if you start place in the center, otherwise, place in some diagonal (otherwise you lose)... it goes on like this for a little while but it's very easy to map
Even a simple naive backtracking approach will work, mapping all the cases, it's less than a billion options
user1125394
making a good en.wikipedia.org/wiki/Connect_Four would be hard
@UchihaObito, to make it a bit trickier, try 4x4x4 Tic Tac Toe
I really wonder what the firefox devs smoked when creating the "persona" theme system.
Apparently it just stores the URLs for the images and thus you can't use a theme anymore once it gets deleted from their them database (unless you saved the images of course)
@ThiefMaster Probably weed.
20:24
    Question:

    var fibonacci = function(n) {
    return n < 2 ? n : fibonacci(n - 1) + fibbonacci(n - 2);
    };

what does the ? n : do in that line?
!!/tell XCritics google javascript ternary
@phenomnomnominal thanks, reading the good parts, so it's basically a short little 1 line if else statement
(expression)?<return this part if trueish>:<return this part if falsy>
@XCritics It's a ternary operator
20:27
@BenjaminGruenbaum so in the line I posted, if n else is ? n :?
@XCritics It's like:
if(n<2){
    return n;
}
return fib(n-1)+fib(n-2);
cool I understand now :D
0
Q: Replacement for ActiveX

user2230076AutoDesk Inventor 2013 has a Browser Pane (NOT web related, just the name they have given it) which uses an ActiveX control. To design a Browser Pane addin, you MUST supply an ActiveX control. Only AutoDesk can change the need for an ActiveX control in the addin for the Browser Pane and they have...

lol
Love rant questions, so stupid
@Darkyen om nom nom
afk. watching tv again
have read and edited my answer :D
thanks
Peggy had many valentine cards while I only had one. Peggy is a whore
@JohanLarsson Welcome to the JavaScript chat! Please review the room pseudo-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.
@BenjaminGruenbaum (temporarily disabled)
!!/learn gayclubs chat.stackoverflow.com/transcript/message/8333542#8333542
@BenjaminGruenbaum (temporarily disabled)
@cept0 Welcome to the JavaScript chat! Please review the room pseudo-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.
20:52
is there "exit" in Javascript like there is in PHP?
user365265
@UchihaObito return ?
hmm, ok. thanks
document.write('</script><script>/*')
@copy huh, nasty.
And does not work :(
20:59
Well, what did you expect?
document.write('</script><script type=text/foo>')
fixed
good night everyone :D
@copy Uhm, do these instructions make any sense to you? From point 4 onward.
Actually, only point four.
Do they want me to pull that file from a running Raspbian system?
Not really. Could be rpi specific
No, why?
I don't quite get that point.
21:08
@geek_guy Welcome to the JavaScript chat! Please review the room pseudo-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.
That seems to be needed for something. The file is part of the rpi compiler (whatever that is)
I want to implement dropdown select feature like the one they have in facebook search. Any suggestion
At the moment that point could mean anything to me, from sacrificing a goat to tickling a grizzly bear's belly.
“ Any fool can write code that a computer can understand. Good programmers write code that humans can understand. ” - Martin Fowler
^ Hence Python.
I think I ate too many eggs ... just ate three in one go.
21:16
var win = ('1,2,3', '4,5,6', '7,8,9', '1,5,9', '3,5,7', '2,5,8', '3,6,9', '1,4,7');

how to display first element of the array? win[0] doesnt work
I feel funny now.
@UchihaObito that's not an array...
That's not even valid JS.
ok, that explains a lot
just changed () to []. Thanks
It is valid isn't it?
21:17
Oh wait, that's parentheses.
!!> var win = ('1,2,3', '4,5,6', '7,8,9', '1,5,9', '3,5,7', '2,5,8', '3,6,9', '1,4,7'); console.log(win);
@phenomnomnominal "undefined"
Looked like braces at first.
@phenomnomnominal "undefined" Logged: 1,4,7
Increased zoom level to 125%. Way better now.
Old Octavian is getting old (or blind).
I'm at season four now by the way. :D
I so hope that they'll never stop filming.
21:25
If you can watch it live, you have to
Everyone needs to watch it or it'll get cancelled :(
Sadly I have no way to do that. :(
Me either :(
Wait, I just read they planned six seasons and a movie!
POP POP!
POP POP!
I just want maybe 4 more seasons.
Seen this one already? :D
21:29
Yeah man haha!
WHAT
She's 30??
hey beautiful peeps
@phenomnomnominal So hilarious, there is a 1 hour-and-something outtakes compilation!
@phenomnomnominal Not only is she 30, she is smoking hot too.
Yeah I'm watching it now!
There are no words.
21:32
I know.
It's from GQ (or so the video says so)
It is.
Let's ask @KirstyHarris. Alison Brie, hot or not?
Can I ask you a question I always wanted to ask the real Batman?
Why can't you get Community in HD on Bluray :(
Surely the money from that would fund at least another season.
21:37
Once it is in the stores I'll totally buy it.
Me too
It's mental that it's not out?
So awesome! :D
She actually good too!
Yeah it's so good aye haha
Not as good as Donald Glover
Of course not.
> One of Brie's first television roles was the minor character Nina, a novice hairdresser, on Hannah Montana.
> 2009 Hot Sluts Amber 5 episodes
What?
21:41
o_O
Can you believe that? Danny Pudi is a father already.
It's so sick how young he appears to be in Community. :D
@codercube Welcome to the JavaScript chat! Please review the room pseudo-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.
He would be a good dad
What the hell? Joel McHale played in Spider Man 2!?
21:57
HE'S 41??!?!?!?!?!??!?!?!?!?
Well, Chevy is 70.
very hot :)

« first day (897 days earlier)      last day (4276 days later) »