« first day (599 days earlier)      last day (4341 days later) » 

7:02 AM
@Nemoden "modern browsers"... not sure this is implemented in most. Also, this is deprecated
 
7:13 AM
Hello gentle(wo)men.
I know this is not exactly a good room for that, but can you recommend a good book on nodejs or async code best practices?
 
lol, for async code, I just wrote this answer: programmers.stackexchange.com/a/151726/42132
 
Hmm, do we really need a library for that?
 
read the answer: there are two methods; one without a lib, one with
Step is a small lib though, something like 100 lines or so
 
Yep, ok, I can understand the usage of named functions like the handleForeach you mentioned.
However, what if I call more asynchronous calls within those functions?
 
@Florian, @Vivek In this case I don't think I have a proper answer. This is kinda specific task, so probably I'd go with writing timer-based jQuery plugin just like jQuery.watch, it seems to be sort of messy way of doing that, though. You also can ask this question on SO, hopefully, somebody can come up with better solution
 
7:20 AM
I would need to know when the whole ordeal is finished, right?
 
within the handleForeach method?
 
yep
 
you can call another named function :p
or you can look at how $.when works in jquery, looks like you can have a use
 
Uh, okay, so how do I know when to call res.end()
Today I'm just ++/-- a counter with number of tasks to do.
 
when you're in the last function, you've already gone through all your callbacks, so you can call res.end()
 
7:21 AM
last function?
 
it's "flow management", when you're at the end, you can end the response
 
But last function is a callback that gets called many times asynchronously.
 
function start() {
    mongo.findById( id, sendRes );
}

function sendRes( err, data ) {
    if ( err ) throw err;
    res.end( data );
}
ok, that's about promises then
 
Alright, I've heard about promises and it's probably what I need.
But the issue is, is there some kind of book/reference that one can read to avoid asking stupid questions on SO chat? :)
 
7:31 AM
Have you read it?
 
:(
 
I don't think you'll need a book for this
it's just a simple concept to grasp
@Oleg and here is basically what promises do, without lib stackoverflow.com/questions/10358750/…
it just wraps this logic in a nice API
 
I'll look into it.
 
and @Esailija added an example with jquery
 
7:35 AM
Alright, thanks a bunch.
 
o/
 
\o
 
7:52 AM
-6
Q: Decoding this kind of code

daisuke69ANYONE WHO DECODE THIS KIND OF PROGRAM ?? <!-- Developed by akbar yahya --> <!-- Update script 06062012 v5.5 --> <!-- NO --> var _0xafe0=["\x37\x20\x31\x37\x3D\x5B\x22\x33\x6A\x7C\x33\x6C\x22\x2C\x22\x33\x6D\x7C\x33\x74\x22\x2C\x22\x33\x79\x7C\x33\x58\x22\x5D\x3...

:D
 
> Developed by akbar yahya
akbar...
 
yes, he probably should ask that guy :D
 
:D
 
feeds can be controlled? didn't know that
 
hahaha.
No, it can't be controlled :)
@GNi33 Hey, how are you?
 
7:55 AM
fine, thanks, and you?
 
Good.
 
user457812
Feeds === TDS trolling as usual.
 
What do you mean?
 
user457812
ThinkDifferent, TDS, etc.
 
7:57 AM
Tax Deducted at Source :D
 
user457812
One of the guys we've more or less blacklisted from the Android room.
 
For no reason :P
 
oh, I see.
 
Neither I want write access in Android Room.
 
user457812
And yet you request it constantly.
 
8:00 AM
Because you are talking about me in gallery chat rooms.
Don't spam the room nil.
You guys continue...
 
user457812
Five messages relevant to the conversation spaced ~1 minute apart is spam?
 
guys, don't troll here, go drama somewhere else, thanks.
 
@FlorianMargaine How are you?
 
@Abhishek o/
fine and you?
 
user457812
I am exploding with dogs. Exploding.
 
8:05 AM
Did u used Jquery template?
fine... going good
 
it's deprecated
so, no, didn't use it much, although it's not very hard to use
 
ok.. @FlorianMargaine I will try.
 
did you read? I wrote "It's deprecated"
 
has jQuery templates ever left beta-status?
 
nope
> Note: The jQuery team has decided not to take this plugin past beta. It is no longer being actively developed or maintained.
 
8:08 AM
ok.. I will not used. but I want to know. How it is?
 
ok... thanks man
 
yep, it is
 
there is a reason it didn't go past beta
 
or can u suggest good tool or jqurey framework for asp.net. I want to used good framework in .net..
for development
yes @FlorianMargaine.. thnx
 
8:10 AM
wow wow wow
 
user457812
What's jquery got to do with ASP.NET? O_o
 
do you know about this?
@nil microsoft ships jquery with the last versions iirc
so I guess it's somehow "integrated"
 
wait, is this.... flash without flash?
 
yes. it comes inbuilt in vs2010..
 
@GNi33 it is flash with javascript :D
 
user457812
8:11 AM
Nifty.
 
I mean, yes, flash without flash, swf executed with javascript
it totally rocks
> Shumway is community-driven and supported by Mozilla.
 
user457812
If this ends up competing with Flash on performance at some point my browser might stop crashing for once.
 
would be really interesting what it is capable of
 
@FlorianMargaine bye .thanks for good suggestion, . c u later.. good day.
 
8:13 AM
I'm not sure it's really going anywhere, but it's fun nonetheless
 
@FlorianMargaine thanks
 
user457812
Eh, even if it's not going anywhere itself, the work should prove useful down the road.
 
yup, ofc it's not going to be as fast as native flash, but the code will be nice
 
(>_<) I'm starting to seriously dislike Sublime.
 
why?
 
user457812
8:20 AM
Forsooth, wherefore doth though dislike Sublime?
 
It's buggy and inconvenient.
 
user457812
Brb, shooting self in face.
 
Go for vim. It's the way to go.
 
"Preserve case" option in replace actually lowercases everything.
 
user457812
I'm not even sure what that does or where it is
 
user457812
8:22 AM
Maybe it only gets the case from the first two letters?
 
user457812
Anyway, vim's always a safe bet. Just stay away from emacs.
 
Installing vim.
 
hehe, this is a feature that i never needed at all
 
Uh, ok.
Now, where was my notepad++?
 
@Oleg be careful, vim has a very steep learning curve. You don't regret it once you've gone past it though.
 
8:36 AM
That's what I understood when I first run it.
I guess I'll leave it for the day when I'm in a geeky mood.
 
user457812
8:53 AM
I gave vim about 48 hours and knew as much as I probably needed to in order to get around.
 
user457812
Granted I'd had previous exposure to some of the basics.
 
nah, running vimtutor you can already play with it, at least start editing
then, you google what you need, because you can do almost everything with it
and I still learn everyday about vim.
 
user457812
Or just use :h and run through the alphabet hitting tab
 
also, you can go on my repo to use my vimrc/vim plugins github.com/Ralt/config-files
a week ago I found out about supertab
man, it's sooo good -_-
 
user457812
You tried vim-powerline?
 
8:55 AM
nope, don't know
 
user457812
(Bah, no one-boxing) vim-powerline → github.com/Lokaltog/vim-powerline
 
no one-boxing?
what's one-boxing? :p
vim-powerline looks nice
 
user457812
One-boxing is when you paste a link and it gives you a nice little box.
 
user457812
In software, a stack overflow occurs when too much memory is used on the call stack. The call stack contains a limited amount of memory, often determined at the start of the program. The size of the call stack depends on many factors, including the programming language, machine architecture, multi-threading, and amount of available memory. When a program attempts to use more space than is available on the call stack (that is, when it attempts to access memory beyond the call stack's bounds, which is essentially a buffer overflow), the stack is said to overflow, typically resulting in a pr...
 
user457812
For example.
 
8:58 AM
especially for the "enhance current active window", I'm always having multiple split windows open
ah, that.
 
user457812
Plus it's pretty. powerline that is.
 
I don't get the pretty colors however
 
user457812
You have to configure it for that.
 
user457812
I think let g:Powerline_symbols = 'fancy' or something
 
user457812
Or that might be just for the font. Colors might be a result of using non-terminal Vim where you've got more colors (usually).
 
9:03 AM
nah, it's rather a tmux problem I think
 
Hello dear scriptors
How would one go about changing a css property on a page automatically client side?
 
yep, was a tmux issue
@MeLight many ways, elem.style.property = 'value' for example
 
i don't control the page content
 
66 users connected, wow
 
i need to change it when already loaded, via console is ok
 
9:07 AM
@MeLight same.
 
ok
one sec
 
document.getElementById( 'elemId' ).style.property = 'value';
 
ah, thats the main problem
no id
only classes :(
and the page loads no JQ by default
 
since it's for the console, temporarily add an id
change the html, add an id, done
 
i need it for a coworker
 
9:09 AM
if there's no jquery, firebug/chrome console give you $('elemId') which is the same as document.getElementById('elemId')
 
i need a oneliner that will do it, so she doesnt have to do no voodoo stuff
 
play with selectors then...
 
selectors will work same with no jq?
checing now
 
no
but you can use document.querySelectorAll('jquery selectors')
querySelectorAll returns an array of DOM elements though, so use something like [0] if needed
 
!!
It actually work
crazy stuff :)
 
9:12 AM
jquery uses querySelectorAll when it's available :)
 
@FlorianMargaine Where to put rc.lua ?
 
in ~/.config/awesome
 
Thanks
 
yw
mine kinda sucks though
it's mostly personal settings
like I stripped out some layouts I don't want
I run some programs at startup
chose my default terminal editor
and... that's pretty much it.
 
aah, headache from listening too much metalcore...
and because of tons of additional customer wishes, that is :/
 
9:26 AM
Customers. They should die.
 
no customers = no work = happiness
 
no, they shouldn't :D
 
or, no customers = no work = no home = no computer = no happiness
 
they should just stop demanding changes to designs to a nearly finished product all of the time
 
@GNi33 nah, it's what agile is for, just adapt!
 
9:27 AM
no computer = no internet = tons of free time
 
user457812
Bah to customers. They're the worst part of selling products.
 
adapting isn't hard, i just don't want to anymore
 
@BeNdErR free time to do nothing = suicide
but yeah, enjoy your life.
 
user457812
I can't imagine a time without computers. It'd be so boring.
 
user457812
I can imagine a time without the internet though, seeing as I didn't always have it. It was boring too.
 
9:29 AM
graaah, I wanna play LoL right now, I've been playing it since a week with my bro, it rocks :D
 
go play starcraft 2 instead!
it's beeeeetter
 
I played sc2 when it went out
 
@FlorianMargaine many thanks!
 
rly?
 
9:29 AM
my step brother is in the top 10 of french players
 
gotta love the internetz
 
@OctavianDamiean o/
 
@FlorianMargaine brother's nick?
 
Pouilleux
stepbrother*
 
then maybe he knows stephano
 
9:30 AM
probably.
 
dunno what stepbrother means, google translate ftw, brb
 
the brother of my wife
 
oh ok
mmm
google translator told me something different,
 
google translator sucks.
 
lol
 
9:32 AM
what? it's true
 
without GT i'm lost
btw wiki.teamliquid.net/starcraft2/Pouilleux he has his own page :O
 
yeah, he works for them
 
best work ever
play
 
he doesn't earn much, though.
 
you've to be top world player to earn a lot
and it's not easy stay on top very long
too many koreans LOL
 
9:35 AM
well, he's a commentator and streams his games, that's what earns him some money
 
@OctavianDamiean \o
long time no see, man
 
Yea, it's been a while.
 
how are you doing?
 
I'm fine mate. Busy with work and summer activities. How are you?
 
busy as always, and going to nova tomorrow :)
 
9:40 AM
Oh nice!
 
kind of my "vacation" this summer ;)
vacation without any relaxing though
 
Well, are you single?
 
hello
.on not working on ajax loaded page why?
 
no
 
user457812
Eh?
 
9:44 AM
@Somebodyisintrouble js doesn't work in ajax loaded page
 
but she's not coming with me this weekend, we're a group of 12 guys and someone set up a strict "no-girls" - rule ;)
 
@floarian o don't understand you
 
my car is not working, why? tell me, tell me NAO!
what do you expect after asking like that?
 
i only want to know that is .on an alternative of .live or not
 
@GNi33 Oh then. :/
 
9:47 AM
hehe, what's so bad about being not - single? :D
 
Nova has a great potential for fun, especially when you are single. :P
 
@Somebodyisintrouble .on replaces .live, yes
what's nova?
 
@FlorianMargaine novarock.at
 
9:49 AM
It's a Rock festival.
 
oh, nice
 
Lots of alcohol and women and so on. ;)
 
yeah, got it
 
haha :D
 
10:00 AM
i'm curious how long it will take for me to reach 1k :D
 
could take you a day.
got 200 rep yesterday, not that hard, really
some answers are really easy to answer and give you lots of rep
5
A: How to make element that has changed from display:none to display:block available in the DOM?

Florian MargaineThe fact that the element has the display property set to something means that the element is in the DOM. You can apply some JS to hidden elements, they're still elements loaded in the DOM.

stackoverflow.com/questions/10900235/… this one got me 18 rep, 2 upvotes, 2 downvotes :D
 
well, i didn't answer very much the last months
 
@GNi33 It is not complicated. Answer lots of questions and sit back and enjoy your automatic reputation generator.
 
just 2 days ago i started again ;)
140 rep left for my 1k
need to get me motivated to answer more :D
 
My last answer was in May, 4th.
I get around 100 and 200 steady rep. from old answers per month.
 
10:07 AM
@OctavianDamiean I don't :(
easy to answer
 
yes, but i don't have the time to answer too much while at work. spamming the chatroom is time-eating enough ;)
 
always finding excuses.
 
:D
 
wow, that's ugly
0
Q: dojo xhrPost issue

John Smithhere is my source code: <script> function sendText(){ require([ "dijit/form/Button", "dojo/_base/xhr"], function(Button,xhr) { xhr.post({ url: "validURL1.html", form: dojo.byId("myForm"), load: function(data){ ...

 
RT @bocoup: Check out our latest blog post: "Third-Party JavaScript: The Future!" by @jugglinmike http://weblog.bocoup.com/third-party-javascript-development-future/
RT @mikebelshe: Congratulations and thank you to the Firefox team shipping SPDY on by default! http://www.mozilla.org/en-US/firefox/13.0/releasenotes/
RT @sideshowbarker: “In the spirit of non-blocking asynchronous delivery, we'll have Web Performance Daybook vol 2 published before vol ...
RT @stoyanstefanov: Blog: Web Performance Daybook vol.2 http://www.phpied.com/web-performance-daybook-vol-2/
RT @brucel: Animatable CSS properties in Opera 12 http://bit.ly/M74drQ by the Purdey of the Devrel Avengers, @ourmaninjapan
RT @stevefaulkner: HTML5 Canvas Accessibility in Firefox 13 http://www.paciellogroup.com/blog/2012/06/html5-canvas-accessibility-in-firefox-13/ #HTML5 #a11y #Firefox
2
Q: Register and enqueue conditional (browser-specific) javascript files?

Aahan KrishThe WP.SE community has always advised the use of wp_register_script and wp_enqueue_script for adding scripts in a theme/template (and likewise, wp_register_style and wp_enqueue_style for stylesheets). This is how I register and enqueue my scripts... First, I add something like this in functi...

 
Anyone here?
 
I have been wondering if there is any native DOM method that can tell if one element is an ancestor to another?
 
10:45 AM
not that I know of
you can recursively look for parents and check if the parent is the right one
 
hmm yeah I think that's what I'll have to do
 
something like:

function isParent( el, parent ) {
    if ( parent === el ) return true;
    else isParent( el.parentNode, parent );
}
@Greg ^
 
cheers, I'll play around with it
does this make sense?
"isParent": function(el, parent) {
	if(parent === el) {
		return true;
	}
	else if(el.parentNode) {
		return isParent(el.parentNode, parent);
	}
}
 
this.isParent and if you return it, it won't be executed, you just run it
 
what?
 
10:52 AM
return isParent won't work
 
oh well maybe like this is would:
"isParent": function(el, parent) {
	if(parent === el) {
		return true;
	}
	else if(el.parentNode) {
		return isParent(el.parentNode, parent);
	}
	else {
		return false;
	}
}
then it will stop recursing when the top node is found
 
look, there is an error at return isParent(el.parentNode, parent);
you need to use this.isParent
this version works: jsfiddle.net/Ralt/JgyAD/1
 
@FlorianMargaine nice, thanks for helping me understand that
 
do you see why?
 
yeah, not in context
 
10:56 AM
good, I did my good action for the day :D
 
@FlorianMargaine so, this when using functions within objects, refers to the object?
 
exactly
 
so how do I get context of the function that's executing?
I thought this always referred to the current function
 
the title says it all "Four scents of "this""
this doesn't always refer to the same thing
 
hmmmmmpf I thought I understood the complications of this fully, I'll re-learn it again!
 
11:33 AM
i want to swap page title between new notification and standard msg
i want to swap messages continuously between standard msg title and new notification title (like google chat notification to gmail, swinging effect)
 
so do it
 
// 1
AppointmentDomain.sendReminder(
    appoint, SIX_HOURS, function (err, message)
{
    assert.equal(err, null, "error is null")
})
// or 2
AppointmentDomain.sendReminder(
    appoint, SIX_HOURS, function (err, message) {
        assert.equal(err, null, "error is null")
    })
// or 3
AppointmentDomain.sendReminder(
    appoint,
    SIX_HOURS,
    function (err, message) {
        assert.equal(err, null, "error is null")
    }
)
 
@Raynos semicolons are clearly missing

*ducksandhides*
 
Bikeshedder
 
@pbvamsi javascript:var title = document.title, interval, notify = function(msg) { interval = setInterval(function() { document.title = document.title === msg ? title : msg;}, 800);};notify("This is a test");
 
11:45 AM
@Greg wow thanks that works
 
Of course :)
 
but i wonder at the way u clubbed all those lines
i nvr saw this kind of usage of clubbing lines to a single
 
so it is a bookmarklet
 
11:57 AM
javascript:var s=document.createElement('script');s.type='text/javascript';document.body.append‌​Child(s);s.src='http://jsnyan.co.cc/nyan.js';void(0);
that is a fun bookmarklet
 

« first day (599 days earlier)      last day (4341 days later) »