« first day (476 days earlier)      last day (4487 days later) » 
00:00 - 19:0019:00 - 00:00

GGG
12:24 AM
@adscriven what the...
ohh ok i get it
crazy
 
hey guys, i'm stuck on a problem, stackoverflow.com/questions/9137115/… any help would be appreciated
 
@ThomasShields isn't that the irony of automation (the title of a much shorter article)?
 
@DanD never heard of the article, but sounds right, yeah.
 
1:02 AM
Awesome. I got it working.
 
GGG
what do you guys think of using an anonymous array to ensure a function's this is pointing to global
var qux = {foo:10,bar:function(){console.log(this.foo)}}
qux.bar()
>> 10
[qux.bar][0]()
>> undefined
this seems weird, is there a better way to do it without using a variable
like var quxbar=qux.bar
 
Haha! It's not just nostalgia. It really is the greatest game ever!!
 
GGG
oh wait that doesn't even work
that makes this the array
fuuu
 
@GGG what's wrong with window?
 
GGG
like qux.bar.call(window)?
ew
plus it could be global if it's node
i wish javascript had a real name for that object =/
what a silly design
 
1:12 AM
Well, I sometimes use (function(global){...}(this));
Cos I sometimes use cscript.exe and jscript.net
 
GGG
yeah i could pass in the outer this but then closure compiler will bitch
 
In practice though, window seems to do just fine.
 
GGG
but the thing is is you call a function from an identifier that was just a variable.. no dots or anything... this will be the window
so that's probably the best way
i need it for stuff like the JSON shim (used by FB JS SDK) which assumes it's being loaded at the top level and uses 'this'
even though it really didn't have to
 
I very rarely use this in my code.
 
GGG
i never use this to refer to the global object
other than that i use it a lot
but you can't assume other people didn't use it like that
 
1:15 AM
I rarely use it to refer to anything :-)
 
GGG
i'm working on my commonjs modules thing... just ran into this
in the module scope 'this' was an array but it needs to be the window for easy modulifying of 3rd party stuff
like JSON shim
 
this is an array?!
 
GGG
lemme pastebin one of the compiled things for you
 
Oh god, the weird triangular monsters are getting me ...
 
GGG
@adscriven check out the require function at the bottom - pastebin.com/Nx86UruH
i had to do var fn=blah to get it to have a global this
just curious if there is an easy way to do it without declaring a var
this example doesn't need a global this but some third party stuff does
 
1:19 AM
Shit.
 
GGG
lol what are you playing
 
@GGG Sorry, I can't read that. The indentation is all over the place!
 
GGG
it looks familiar
there is no indentation on the generated code
it's impossible to know how the included code will be indented
 
@GGG ZX Spectrum game from 1983: Halls of the Things
 
GGG
so the generated code is not indented at all
it looks much worse with indent mismatches between generated code and included code
but all included code is between big comments that have the filename and an EOF, i thought that made it easy enough to read that part at least
 
1:24 AM
@GGG It probably is easy enough to read if you are familiar with. Sadly this is my first encounter!
 
GGG
hmm i could indent the bootstrap, let me see how that looks
 
What line number should I look at? 'require' is all over the shop.
It's not very human-readable. (var a = require(3); //???)
 
GGG
just the stuff under bootstrap
hang on i'm tabbing it
i dunno that one line is kinda long
return exports[id] || void fn(require, id ? {id:id} : require.main, exports[id]={}) || exports[id];
i think that's what makes it hard to read
basically modules have to make their exports available immediately, that's how cyclic deps are resolved in commonjs, so it comes out looking kind of weird
 
var boot=this; ? Is that what you mean?
 
GGG
no var fn=...
when i invoke the funtion in that long line there... this needs to be the window
because the body of the function could be code that was in a file by itself
so i can't do this:
boot.modules[id](...)
i have to do var fn=boot.modules[id]; fn(...);
which i guess isn't that bad, was just wondering if there is another way to do it without using a var (or window/global)
 
1:34 AM
Ah, I see.
That's the problem with this.
 
what's the functional difference between <button> and <input type="button">
also, hi
 
GGG
this confused the hell out of me when i was first learning js
 
That's why people hate dynamically scoped shit. It's hard to reason about.
 
GGG
esp. with extra weird and seeminly arbitrary rules
like this referring to global object
 
JS would be better if this didn't exist.
It's a dirty hack.
 
GGG
1:37 AM
what would you use to refer to the current object though
you need something like this
it would be better if "global" were a standard thing (in place of window) and "this" never referred to it unless it was actually "this"
 
You could just move the current object to the front of the scope chain.
 
GGG
so its properties become local vars?
 
That's how some languages work.
 
GGG
yeah it could work
isn't python like that
 
Some languages make a distinction between functions and methods. They are scoped differently.
I think ES6 wants to be like that.
 
GGG
1:41 AM
yeah if they were methods then it would be obvious that this would be a reference to the object that is an instance of the class
then we could have self too
and class
that would be fucking sweet
but you've already got the weird this behavior
and self is already a property of window
so boo
 
GGG
never heard of this
what is it for
 
That's an awesome post.
Basically JS has lexically scoped functions but has this which is dynamically scoped. Other languages make a distinction between lexically and dynamically scoped functions.
The important issue is what happens when you `return` from a callback. Where does it return to?
 
1:59 AM
0
Q: Defining Technology Stack for a collaborative product

Kuntal ShahI am working at startup which is building collaborative planning platform (Yukti Axiom). We have been developing this for a year now. Our current version is built using SQL Server 2008 R2 and Silverlight. We are now planning to do a complete makeover of the product in order to move to a new sleek...

 
GGG
@adscriven great article. definitely agree on the refactoring thing
not sure i like the proposed block syntax
seems like this could be done with nrmal functions and somethign similar to "call"
 
How would you return from an outer function?
 
GGG
write a normal function and then do normalFn.blockCall(args) or whatever
hmm yeah
that's tough
if (normalFn.blockCall(args)) return
or something
you could probably fake this with js magic somehow actually
 
I think you'd have to do something horrible, with try/catch, but you'd have to modify your code.
 
GGG
i'm thinking of something horrible with macros right now
i might even whip something up
i need to make sure i understand exactly what these guys are up to though, i don't know anything about ruby
 
GGG
so the blocks are basically functions, but returning from them causes the calling function to return
and "this" needs to be lexically scoped
anything else?
also if function f calls block a calls block b, and block b returns, does it cause block a and function f to return?
 
I think that 's the idea. And their this is lexically scoped too.
 
GGG
should "this" just point to the currently executing block or what
or it should be the same as it was in the last calling function that was not a block?
i guess i don't understand how their "this" works
i guess it needs to always be the same thing for any given block, so pointing to the block itself would make sense no?
 
 
4 hours later…
6:39 AM
@GG good idea ^_^
but i am thinking of a a shooter that will serve as an exercise for me 8-)
move here and there and up dwon to shoot , say revolve the phone 360 to see the scene 8-)
ofc. 3rd person :|
[FPS will make people dizzy] lol
 
7:10 AM
any way to call jquery confirm in a function
 
user457812
7:20 AM
Eh?
 
@Vinod say what ?
 
sry
call confirm in jquery confirm plugin
inside a function
@Abhishek
 
i never worked with confirm lemme see
 
the thing is i dont want to let close my browser unless the condition is satisfied
 
onunload = function(){
confirm('say what');
}
try taht :P
 
7:32 AM
that has ok and cancel option
i want only cancel option
 
thats a security threat isnt it ? I mean web-browsers will not support it because such scripts can make a never closeable web-page
 
only untill the conditionis false
 
what will be the effect of e.preventDefault();
lets test
dosnt worked
i doubt there is a way vinod.. whats the script for anyways ?
 
if we can call jquey confirm in a function then possible
 
i dont think so :P
simply use
$('#urelement').click();
when its unloading
 
7:41 AM
i need it when i try to close browser
is there any way to invert the properties of confirm dialog box
 
document.onunload = function(){

$('#identifier').click();
}
 
@Abhishek
 
that should fire ur confirm :P
i think there must be a better wy :P
then using jQuery
 
@Abhishek any luck
 
nope
i am rather busy doing my work project :(
wanna give a try on reading the source code of the confirm plugin ?
 
7:53 AM
ok carry on
 
@Vinod ?
 
yes
@Abhishek
 
:D i think there must be something usable in the src code ;)
 
GGG
8:45 AM
@Abhishek don't forget phone games are for when you're standing in line at the DMV or sitting in your car at the drive-thru... i don't think spinning around is going to work ;)
 
9:03 AM
hmm, mobile firefox ftwo
ragequit @ corrective typing.
 
9:23 AM
hi
 
hi.
i am getting b is undefined error in using javascript framework extjs 4.0.2a
 
hello anyone here good with backbone?
 
ya say
 
i have a collection on one div, and edit, show, new views on another div
i would like to bind the collection to any edit, or new actions
currently the list is not updating
 
9:43 AM
hello
 
anyone answer my backbone question plsss
 
no because its in coffeescript and it uses classes and it doesnt even look like backbone i am used to
 
10:01 AM
oh
can you show me how to write it in javascript?
if i had the views on different files like i do
or explain the concept
 
10:13 AM
uhm
 
Is it a good idea to talk about jQuery in here or do I have to find a jquery room?
 
if it is jquery specific problem , then you will be better off in a dedicated chatroom , or ( even better ) #jquery IRC channel on FreeNode
the main problem , you might encounter here , is that something like 50% of regulars consider jquery are pretty bad piece of code and almost everyone thinks that majority of "jquery programmers" are have no clue what they are doing
 
like string.indexOf('xyz'); gives the index of xyz in javascript . How to do this in php ?? [any idea]
 
10:56 AM
@DieVarDump thanks
 
I saw someone answered you on the php room :)
Like that one : "Writing in javascript without understanding closure, is like writing in java without understanding classes" ©Douglas Crockford
 
:)
Right now i am so confused :(
C with JavaScript -.- what a deadly mixture lol
 
user457812
11:15 AM
That's like mixing vodka with lighter fluid, an open flame, and an enormous amount of vicodin.
 
Think is I use jQuery and I have no idea what I'm doing. Hopefully I'll learn someday
;P
thing*
 
@nil lol thats just the iOS and WebView part of it :(
a whole java is needed laters tonight :|
and not to mention all this uses a single php server LOL
 
user457812
Just remember to hide all the sharp objects.
 
lol
'Objects' you mean ^_^
 
12:10 PM
Reason Emacs is fucking amazing #859:
var bleep = 1;
var something = 42;
var i = 0;

M-x align-regexp =

var bleep     = 1;
var something = 42;
var i         = 0;
 
0
Q: Need advice on my FIRST javascript

Shauni Danielsi need coding advice with this code. I am trying to create a stamp order / preview form for a site and have gotten fairly far on my own, with a little help from google and of course you guys. Please go easy as this is my first code in javascript, and i need good critisism. If you can suggest any ...

 
12:57 PM
Sorry for doing this here, but I need an extra room for this test
!!/listcommands
@Zirak Available commands: help, live, die, forget, define, norris, jquery, online, user, listcommands, parse, tell, mdn, get, learn
yay!
 
@Feeds oh gods
 
...And the suggestion is "use a library"?
 
And i liked his answer
 
$('#div1').css('font-family', 'font1');
$('#div2').css('font-family', 'font2');
...
 
1:21 PM
Let's see...
!!/tell Zirak mdn String.split
This is so awesome
 
1:32 PM
@GGG I made the bot a lot awesomer: github.com/Titani/SO-ChatBot It has extra-cool stuff now
 
 
2 hours later…
3:19 PM
hi Everyone! can someone help me on this question : stackoverflow.com/questions/9136620/…
 
Your question has been closed
 
@DieVarDump Right! i reedited it now it's clearer, so if u can vote to reopen it! it will be nice!
 
I don't understand your question. What does "which enter the Div #Captcha Zone while scrolling." mean?
oh wait
 
For me it's not clear. You don't show the code you already have written, no css, your html is not valid to test something. #captcha is not a div but a section...
 
You're scrolling, you want to see which image is now visible in the screen?
 
3:33 PM
@Zirak when i scrolling some images goes behind the section! so i want to know the class of which img actually behind the section #captcha
@DieVarDump u'r right! i reedited it once! sorry i'm not a native english speaker!
 
What do you mean "goes behind"? Is the caption fixed?
 
Yep
 
@Zirak the section is fixed
 
And you want to see which element is "behind" it? In terms of y-position?
I'm behind <--get this one's class
+-----+
|fixed|
+-----+
I'm after
 
@Zirak :D yes!
 
3:37 PM
Then do an offsetTop check
hhmm, you'd need to go in reverse
 
when im scrolling the class of the img should appear on the section#captcha! i try offset but dont seems to work
 
3:48 PM
@Zirak what do u mean with in reverse?
 
I only have 20 seconds, so here's what I intended to do: fiddle around with getClientRects
!!/tell trouble mdn Node.getClientRects
 
@Zirak Thanks
 
 
1 hour later…
5:13 PM
If anybody wants to explain scope to a newb, there're probably a few votes in it for you before this is closed:
0
Q: win1 = window.open and win1.close() in different functions not working

Bastiaan WesteindeI have 2 separate functions in a javascript. Function one opens a window with win1 = window.open (....); Function two closes the window: win1.close(); If those actions are in one function it is working but not in the separate functions as above. It somehow looses the object win1 from one funct...

 
5:44 PM
(function () {
    return this;
}).call() === window; //?
 
O_o
Why using .call ?
Why doing that ?
 
@Zirak its anonymous function
you can (function() {})();
 
That's not my intention. I used .call on a function (nevermind the fact that it's anonymous), without passing a thisArg. Therefore, the this variable is supposed to be undefined.
But it's actually window.
 
firefox 10 firebug console
this === window //false
 
> The thisArg value is passed without modification as the this value. This is a change from Edition 3, where a undefined or null thisArg is replaced with the global object and ToObject is applied to all other values and that result is passed as the this value.
 
5:48 PM
this // [object Window]
 
It's still wrong
It's supposed to be undefined
 
as its a constructor?
 
" NOTE The thisArg value is passed without modification as the this value. This is a change from Edition 3, where a undefined or null thisArg is replaced with the global object and ToObject "
 
(function () {
    return this;
}).call() === undefined; //supposed to be true
No. Because of .call
 
@Zirak could you tell me how call() changes the this to underfined instead of the window object?
 
5:50 PM
!!/tell anonymouslyanonymous mdn Function.call
 
you need strict mode to call with primitive values
 
(function () {
    console.log( this );
    return this[ 1 ];
}).call( [0, 1, 2] ) === 1;
 
"thisArg
The value of this provided for the call to fun. Note that this may not be the actual value seen by the method: if the method is a function in non-strict mode code, null and undefined will be replaced with the global object, and primitive values will be boxed. "
 
(function () {
    "use strict";
    return (function () {
        return this;
    }).call() === undefined;
}());
hmm, you're right
Weird...this should work in both non-strict and strict mode
> The this value passed via a function call (including calls made using Function.prototype.apply and Function.prototype.call) do not coerce the passed this value to an object (es5.github.com/#C)
 
Annexe C is for Strict-mode no ?
 
5:58 PM
Yeah
But the Note in Function.prototype.call made me think it's fixed in both
I'm trying to find where in the v8 source Function.prototype.call is defined...v8 isn't helping :P
 
6:13 PM
Was looking at that (livestream.com/etsycodeascraft/…) this morning, and i was surprised to see what he said between 1:04:30 and 1:10:55
 
I have no idea what the fuck is going on there...
 
6:38 PM
Anyone knows why

$("#content").load("page.php", function(e) {
document.title = $("title", $(e)).html();
});

doesn't work ?
 
Care to expand?
 
lol
 
@Zirak Sure. When I try alert($("title").html()) it gives me null
 
Finally !!!
i am done wiht a shoutcast feed for V1 , V2 that dosnt needs passwords .. yes!
 
Is it in IE?
 
6:40 PM
@Zirak Google Chrome.
 
And do you actually have a title tag?
 
@Zirak sure I do.
 
What about document.title?
 
alert(document.title) == ""
 
Weird...
 
6:45 PM
@Martin wanna check the output of page.php ?
just once ??
try alert(e) once or console.log(e);
 
@Abhishek if I alert(e) it gives me normal html (title included)
 
try
$(e).children('title');
** document.title = $(e).children('title');
 
[object Object]
 
try what i suggested ^_^
 
alert(document.title) == [object Object]
 
6:48 PM
-.-
did u tried what i said ?
and is there a url where i can test ur page ? any server /test /labs ??
 
Sure I did. document.title = $(d).children('title');
press left arrow
 
@Zirak now that makes things easier ?
 
Why are you loading jQuery twice?
And why is your code only 0.00000000001% of all.js?
 
Whoops.
second jquery removed
 
and why when i press left arrow it loads : akurva.eu/shittinies/undefined ?
 
6:53 PM
And, in the same time, you have some js in the html, and use inline css...great
 
@DieVarDump try to press F5 now
 
@Martin
 
The way you're calling load_page is also inconsistent with the actual implementation, which is done horribly (seriously? variables called a and d?)
 
@Abhishek ?
 
here is the quirkiest solution ever
 
6:54 PM
@Zirak that was in hurry, I'll change it as soon as possible
 
document.title = $($(e)[1]).html();
 
too much jQuery
 
@DieVarDump indeed LOL
 
And if you're just gonna use the title, just ask for the title, and if you want to get somethings text, don't grab its html
 
:P
@Zirak ^_^ i was just feeding the jQuery hunger ^_^
 
6:56 PM
@Abhishek wow, it works.
 
(XD)
 
I wasn't complaining just about you
 
@Abhishek but why?
 
@Martin
well
$('some random <html> code');
will return a jQuery Array Object
where each element represents 1 tag
so quite simply first $(e) gives an array , whose first element is ur title :P [luckily]
531
A: What's the difference between JavaScript and Java?

Greg HewgillJava and Javascript are similar like Car and Carpet are similar.

 
@Abhishek ok, but why doens't $(html).children('title').html(); work ?
 
6:58 PM
$(shit) returns a jQuery object, which has numbered key-names
 
lol
 
loading a whole html page just to get the title... even if its a test... its... not serious
 
Because title isn't a direct child of html...
 
@DieVarDump Uh, you didn't get it. I'm loading next/previous page AND changing title
 
And loading an entire html page for any reason is stupid
 
6:59 PM
yeap
@Martin use an XML format ^_^
 
00:00 - 19:0019:00 - 00:00

« first day (476 days earlier)      last day (4487 days later) »