« first day (1389 days earlier)      last day (3550 days later) » 

12:01 AM
var createConstructor = function () {
    return function Constructor () { };
};

console.log(new createConstructor());
console.log(new (createConstructor()));
@thedayturns ^ read that
 
lol
i was hoping for some intuition
 
It's to do with operator precedence
 
right
 
In the first instance it presumes that you're trying to call createConstructor as a constructor
in the second case, you're first evaluating createConstructor() which returns the actual Constructor function, then creating a new one of that
 
are you saying that the first one is equivalent to (new createConstructor)()
i mean clearly not because that's not true
 
12:07 AM
no, it's equivalent to new createConstructor
 
ah
but what about the () ???
 
Is there a way to "query" an array like a SQL query?
Like the SELECT * FROM arrayname WHERE array.name="beans"
 
var createConstructor = function (word) {
    var Constructor = function Constructor () { };
    Constructor.prototype.word = word;
    return Constructor;
};

console.log(new createConstructor('hello').word);
console.log((new (createConstructor('hello'))).word);
 
Hey guys, if I told you I have NTRUcrypt in the browser, would you think that's cool?
 
12:25 AM
@copy I'm hungry
 
I'll be there soon
 
@deadbeef You can use the filter method on arrays. Your query would be arrayname.filter(function (item) { item.name === 'beans' }).
 
@doingweb 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.
 
@doingweb Thanks!
"Perfect client-side security since 1995"
is this supposed to be a joke I don't get or is it serious?
 
It's a joke, apparently. But I don't get it either
 
12:35 AM
Where will we eat?
 
@copy i want to insert my floppy into her disk drive
 
@deadbeef you have erectile dysfunction problems? Sorry to hear that.
 
12:55 AM
@BadgerGirl I'm leaving now, should we meet at Albertsons?
 
@copy Yeah, leaving now :)
 
 
2 hours later…
3:22 AM
0
Q: Bluebird Promisfy.each reference error?

StackThisAm new to promisification and am not quite sure if .then and .each carry variables across the entire promise. Also, I clearly define docReplies in the fourth line, yet the console logs: Possibly unhandled ReferenceError: docReplies is not defined Am looking to loop over each element (reply...

 
3:46 AM
!!live
 
@monners I'm not dead! Honest!
 
That's what the last hooker said...
 
4:02 AM
this thing on
 
@rancho 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.
 
hmm
closures
 
4:18 AM
Hi all
can anybody help?
0
Q: Trim textboxes and texareas on submit prevent form to submit

DH__I am trimming all textboxes and textareas on submit. It does not work for all view pages. I have taken simple html inputs + kendo DropDownList + kendo AutoComplete in my form. Below is my submit method which doesn't work when there are Kendo UI control on my form. $('input[type="submit"]').click...

 
@DH__ can u put up a demo page
and do you know how to use the js console ?
jQuery is known for silent errors.
 
5:11 AM
Hi all
 
@IGRACH 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: Bluebird Promisfy.each [TypeError: fn must be a function]?

StackThisThis promisification logs two of these: [TypeError: fn must be a function] And then a total of four (4) error chains that each start with: Possibly unhandled TypeError: fn must be a function Am looking to loop over each element (replyID) in the repliesIDsArray and findOneAsync the message...

 
Hola
 
5:35 AM
I like EventEmitter
 
I do too
 
6:02 AM
What else would I like?
 
elem.animate
 
0
Q: Using Q promises in HTTP requests with NodeJs

mickaelb91I'm trying to make a chain of promises functions which use HTTP requests in NodeJS with Kraken framework. My code could work in 90% of cases, but if the distant requested server takes time to respond, the code will return an error with undefined values. So I think Q is a good solution to prevent...

 
6:26 AM
Hello Everyone
 
@Ashmah 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.
 
6:46 AM
Zit
 
@AlnDvs 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.
 
7:06 AM
I have something like this:
function Example(){
};

Example.prototype.Function1=function(){
};

var example = new Example();
example.Function1();
and I face with this error:
TypeError: example is undefined
why?!!!
 
shouldn't happen in that code
perhaps example resides in a different scope than you think?
 
Yes, @Jan is correct. Your code is right.
 
@JanDvorak -> no. it's in the same scope.
 
fiddle pls
typo? Homoglyphs? different code order?
 
7:27 AM
!!> function Example(){}; Example.prototype.Function1 = function() { return true; }; var example = new Example(); example.Function1();
 
@monners true
 
Maybe because Function1 has no return value?
 
@monners doesn't make example undefined
 
True...
Dunno. But, as you can see @MRS1367, it does work as you've shown us
 
7:50 AM
for example, I access to:
Example.Case1 = {
};

Example.Function2 = function() {
};
 
@MRS1367 jsfiddle.net
Put together an example and we'll be able to see what's going on
 
@Daedalus Please Calm Down for Pro users
 
well, seems I was wrong about the english
 
Maybe you're just not 1337 enough
 
7:59 AM
lol
 
@monners, this one is even better:
http://stackoverflow.com/questions/25133500/prevent-using-javascript-code-to-not-accessing-from-iframe#comment39120874_25133500
"ALL of u are Oposite of Knowledge :|\"
 
yeah, saw that.
All you're knowledge are Oposite to us!
 
But yea, CV'd
 
thanks guys
 
Lol, OP edited the post
"THANKS FOR ALL -1 :|"
 
8:10 AM
Anyone here familiar with d3 and help me understand selections and data?
 
2
Q: Node.js promises, async, or just callbacks

Amanda MerlaCan you advice a beginner the difference between promises, async and callbacks. While I am learning, shall I just bang my head against callbacks, or make my life easier and use a supporting library? Finally, what is the difference between promises and async, which one shall I choose if any?

 
lol
Ninja'd by feeds
@BenjaminGruenbaum doesn't look OB to me
 
@SecondRikudo data? That's, like, 1s and 0s and shit, right?
 
@SecondRikudo wat? It's 100% opinion based. "Which should I use?"?
> While I am learning, shall I just bang my head against callbacks, or make my life easier and use a supporting library?
 
8:11 AM
!!weather johannesburg
 
Should I use a library?
> Finally, what is the difference between promises and async, which one shall I choose if any?
Which library should I use?
 
@BenjaminGruenbaum It can be easily edited to remove those parts out
The core of the question is good
"What is the difference between promises, async or just callbacks"?
 
@AlnDvs [object Event]
2
 
hello holy people
 
@SecondRikudo which is a duplicate. Which is even worse.
 
8:13 AM
@BenjaminGruenbaum Why is that worse?
 
Without the "give me advice" part it's just a dupe, with it it's OB.
 
Closing it as a duplicates makes the original easier to find, plus OP gets an answer
 
Because it's a duplicate of 3 questions.
I'd also accept "too broad"
 
so you can tell Jon Skeet to answer it, and then close it for being answered by Jon Skeet.
oh btw, where do I put feature requests from chrome dev tools?
I want it to allow me see two tabs side by side together...
 
@MRS1367 just link me to a fiddle
 
8:18 AM
in javascript, we get the html code of a DOM element using element.parent.innerHTML, if the element is itself the only child of parent. But how to get the html code of the element itself? Is there something like element.asHTML?
 
So anyone for my original question?
8 mins ago, by Second Rikudo
Anyone here familiar with d3 and help me understand selections and data?
 
!!tell rahul mdn outerhtml
 
@CapricaSix thanks!!
@JanDvorak thanks!!
 
!!tel rahul You're welcome honey
 
8:19 AM
@rahul You're welcome honey
 
Well I work for money :P
BTW what is this !!tel ?
special jargon for this chat room?
 
!!tell rahul help tel
 
@rahul tel: User-taught command: <>@$0
 
@rahulserver it is the dark way to interact to caprica, the mistress of all evil bots. only gods like second rikudo can use it.
 
I wonder...
 
8:23 AM
@CapricaSix another jargon! It think the name of this room should be jargonScript :P
 
!!tell Cerbrus !!tell Cerbrus test
 
@Cerbrus Command !!tell does not exist. Did you mean: tell (note that /tell works on commands, it's not an echo.)
 
or perhaps I have to change my compiler
 
Oh duh
 
8:23 AM
!!tell Cerbrus tell Cerbrus test
 
@Cerbrus Command tell cannot be used in /tell.
 
Excellent :3
 
code.google.com/p/chromium/issues/list <-- guys there is no option to add a feature request here. any ideas?
 
@AwalGarg but first, read the comments on this issue.
JESUS ANSWERED
 
It was edited, and this guy already started writing an answer.
 
8:32 AM
@FlorianMargaine "there will be false christs"
 
@BenjaminGruenbaum done
 
@SecondRikudo you'd be satisfied.
 
:P
@BenjaminGruenbaum Although I don't really care much, that D3 thing is driving me insane!
 
@SecondRikudo why? d3 is cool
 
@Oleg I'm struggling to understand data binding to selections
Are you familiar with it?
 
8:41 AM
More or less.
You create a selection of elements. Then add data to it. Then perform add/update/remove operations.
That's it.
 
The answer he posted is pretty bad.
 
> I think the chromium-discuss mailing list would be a better forum for this kind of discussion.
^what to do?
 
When has a mailing list ever been a good forum for discussions more meaningful than workplace lunch plans?
 
@monners so where to submit the feature request?
 
No idea
 
8:54 AM
how on earth is this open source if we can't submit feature requests???????
 
@AwalGarg submit a pull request ;-)
 
@JanDvorak as if I can write code which can be pulled...
 
@AwalGarg send a mail
 
@FlorianMargaine writing one right now, but don't know where to send.
 
Apparently there are other persons that agree with me (hence the minuses) I don't see the point of arguing on something which is my subjective opinion. — Liviu M. 2 mins ago
Her opinion being:
@Donovant: Nooo, it was not obvious. -1 — Liviu M. 12 mins ago
So, now that user's telling others not to comment on it's cryptic "Bad question -1" comment...
 
9:05 AM
Can you explain this to me? ^
 
@FlorianMargaine @JanDvorak @anyOneInterested code.google.com/p/chromium/issues/detail?id=400664 bam!
 
How do I upvote that? That'd be sweet
 
@Cerbrus star it, and confirm it. :D optionally add a comment abusing the devs.
 
confirm as in comment?
 
@SecondRikudo sure, we create a selection of a certain element and assign [4, 5, 18, 23, 42] data to it.
 
9:08 AM
@Cerbrus yep, add a comment too.
 
@Oleg But how does the ordering work? The key function?
 
"Each comment triggers notification emails. So, please do not post "+1 Me too!". Instead, click the star icon."
Darnit ... How does text formatting work here
 
@Cerbrus who cares? add the comment. :P
@Cerbrus you posted a multiline message. thats why :D
 
@SecondRikudo The key function is the element identifier. The id.
By default it's the index of an element in the data array.
 
laaaame :P
 
9:10 AM
@Oleg The key function works on the data elements, right? (The "datnum")
But where do I take the information to match against the DOM elements in the selection?
 
hi guys, can anyone tell me why I'm getting a "undefined property" error on this code: http://jsbin.com/wuyaqome/1/ (it's small)?
note that if i use `bsolutions.EASI.conf.url` I get the same error
 
yay! 5 stars already... :D
 
So, for [4, 5, 18, 23, 42] and an empty initial page, D3 will understand that you need to create 5 new elements identified by keys: '0', '1', '2', '3', and '4'
The key function is just a function, you can return whatever you want from it.
 
@Oleg Yes, I understand that, but it's expected to return the key of the element of which this data is supposed to go to, am I wrong?
 
But ideally you'd have the following data: [{id: 0, value: 4}, {id: 1, value: 5}, ... ]
@SecondRikudo If you have a list of users you obtain from your database, you would use the user's id as the key.
 
9:16 AM
@Oleg And how would that be represented in the DOM elements?
With the id= attribute?
 
@SecondRikudo It's not really the "key of the element". It's the key of the entry in your data array.
 
@Oleg The tutorial gives this
Can you explain that to me?
 
@SecondRikudo All elements get a property assigned of them called __data__.
 
Yes, I know that one
 
For example, a __data__ could be equal to {id: 1, value: 5}. Given the key function: function (d) {return d.id;}, D3 would use this id accessor to find the correct element by looking into the __data__ object.
 
9:23 AM
@Oleg But isn't the point of .data() to bind this __data__ to the element? What if the element doesn't have it yet?
 
@Cerbrus and anybody else. ok I myself just got that "+1 me too" notification email and that is really annoying. please don't do that again... (and ignore what I said about it earlier :P)
 
@SecondRikudo If the element doesn't exist yet, it will be created as a result of operations on the entering selection. If it exists, but doesn't have the __data__ yet, it will be assigned as a result of operations on the updating selection.
@SecondRikudo In this case five elements were created out of .data([B, A, D, C, E], byLetter). If you call it with .data([A, B, C, D, E], byLetter) D3 will know that some elements changed their order because it knows how to identify and match the new data to the old data on the elements.
Contrast it to the case where the key function is not specified: D3 will think that the order remains the same! And so instead of moving the elements around, it will update their contents instead.
 
@Oleg So the key function is there to match with existing data, only to append more data onto it?
So basically it expects that the .letter property to be there on both the element's and the new data?
 
@SecondRikudo The key function is the identifier.
It helps D3 find the DOM element corresponding to a given data array item.
If the element is not found - it will be created (with .enter().append(...)...).
 
@AwalGarg: so, you want me to post more comments? :3
 
9:36 AM
lol nope...
 
Only because you're telling me to... comments some more to spam Awal's email
 
hahaha
 
@Oleg .enter is used to enter into the current selection, right? So the currently selected elements now all become groups?
 
@SecondRikudo Yeah. It returns what they call the "entering selection" which is a subselection of the base selection.
 
9:40 AM
It's a bit misleading perhaps. Because the "entering selection" doesn't have any elements in it yet.
You use append() to populate the entering selection with real DOM elements.
!!are DOM elements real?
 
@Oleg Of course not
 
:(
!!is jQuery awesome?
 
@Oleg No
 
^ Caprica's never wrong
 
!!have you ever been wrong?
how many stars would it take to mark that issue as confirmed? 6 stars as of now but no confirmation, what might be the possible reasons?
 
Jes
9:46 AM
hello
good evening
 
Hi, good morning
 
Ok. I figured out my flaw on the previous link. Now only one thing left to fix:
My `object.property.init();` that's attached to `$(document).ready()` is getting called (and its functions inside executed) every milisecond - how can I make it not do that? :| [it's like .. the second time i'm using object/namespaces to make js]
 
@AwalGarg Stars aren't an indication for confirmation I think
 
Jes
I got the text input and a button inside a div. when i m inside the text box want to get the id of the button on enter key press
 
I do love how universities publish their textbook course requirements. Thanks for saving me $30K University of Melbourne
 
Jes
9:48 AM
var id = $(event.target).attr("id")
gives me the textbox id
how to get the button id?
 
> Vote for this issue and get email change notifications (from the sidetext of the star)
^what does that mean?
 
> Weeks of programming can save you hours of planning.
2
@AwalGarg It means that once you star you get email notifications for anything that happens on the post./
 
@SecondRikudo so, how do they get the confirmed mark?
 
@AwalGarg Not sure?
 
@SecondRikudo no, I am not sure. Thats why I am asking you...
 
9:50 AM
I'm not sure either
 
Maybe that's done manually
 
@Cerbrus oh really? I thought unicorns mark them confirmed!
@SecondRikudo but you are the god! you can create and destroy anything! can't you destroy the unconfirmed mark and create a confirmed one in its place?
 
@AwalGarg I'm not gonna waste my Chakra on you.
 
@SecondRikudo you are a pathetic and useless god... you are better as a human :P
 
The only time the word "incorrectly" isn't spelled incorrectly is when it's spelled incorrectly.
and also
if you go and see a bald eagle at the zoo, you are looking at the american symbol of freedom in captivity
 

« first day (1389 days earlier)      last day (3550 days later) »