[JSMentors] Re: $('body') vs $(document) in Pub/Sub pattern

2011-02-04 Thread MRoderick
Hi Fran shameless-self-promotion You could go for completely independent PubSub implementatations as well, I wrote one: https://github.com/mroderick/PubSubJS http://roderick.dk/blog/2010/10/12/introducing-pubsubjs-a-library-for-doing-publish-subscribe-in-javascript/

Re: [JSMentors] Re: $('body') vs $(document) in Pub/Sub pattern

2011-02-04 Thread Fran
Looks great MRoderick, light and much quicker than jQuery... I'm doing some test with it. Thanks On 04/02/11 10:03, MRoderick wrote: Hi Fran shameless-self-promotion You could go for completely independent PubSub implementatations as well, I wrote one: https://github.com/mroderick/PubSubJS

[JSMentors] Re: $('body') vs $(document) in Pub/Sub pattern

2011-02-04 Thread Diego Perini
On Feb 4, 11:03 am, MRoderick mor...@roderick.dk wrote: Hi Fran shameless-self-promotion You could go for completely independent PubSub implementatations as well, I wrote one:

[JSMentors] Re: $('body') vs $(document) in Pub/Sub pattern

2011-02-04 Thread Diego Perini
On Feb 3, 1:38 pm, Fran m...@fran.ie wrote: I like this really tiny but clever plugin. I'll definitely keep it in mine, but still I have the question whether using $(document) or $('body') makes any different. Any idea ? Thanks On 03/02/11 12:12, Mads Erik Forberg wrote: Den 03.02.2011

[JSMentors] Re: What do you think of my implementation of HATEOAS?

2011-02-04 Thread Jason Mulligan
I cut the 1.0 branch of the lib last night. On DELETE or POST an ETag header will be returned to the Server. There's before and after events for all HTTP actions, as well as undocumented beforeXHR and afterXHR for specific developer use cases, e.g. if you need to track when a resource is accessed

[JSMentors] new Number(...) use case

2011-02-04 Thread jemptymethod
I'm setting ExtJS form values in one of their ubiquitous config objects based on JSON data from an Ajax call. For currency fields I am calling toFixed(2) on the numbers such as: jsonObj.shippingAndHandling.toFixed(2) jsonObj.totalDueToday.toFixed(2) Etcetera But I have a requirement to default

[JSMentors] Re: JavaScript is the next C

2011-02-04 Thread jemptymethod
On Feb 4, 10:37 am, Acaz Souza Pereira acazso...@gmail.com wrote: JavaScript is the next SNIP I consider this spam -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/jsmentors@jsmentors.com/ To search via a non-Google archive, visit here:

[JSMentors] When might links to blog posts be considered spam

2011-02-04 Thread jemptymethod
I think that links to blog posts such as Web Development Sucks, Javascript Must Die, and Javascript is the Next C are spams or troll posts. -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/jsmentors@jsmentors.com/ To search via a non-Google

Re: [JSMentors] new Number(...) use case

2011-02-04 Thread Poetro
2011/2/4 jemptymethod jemptymet...@gmail.com: I'm setting ExtJS form values in one of their ubiquitous config objects based on JSON data from an Ajax call. For currency fields I am calling toFixed(2) on the numbers such as: jsonObj.shippingAndHandling.toFixed(2)

[JSMentors] Re: new Number(...) use case

2011-02-04 Thread Angus Croll
Actually you can just say (0).toFixed(2); Primitives get temporarily coerced to their object wrappers when faced with attribute or function calls. I've never yet had to use new Number() but there may yet be a scenario On Feb 4, 7:51 am, jemptymethod jemptymet...@gmail.com wrote: I'm setting

Re: [JSMentors] JavaScript is the next C

2011-02-04 Thread Dmitry A. Soshnikov
Languages constantly evolve; new languages appear based on previous levels of abstraction. As engineers we /control complexity/ - that's the main purpose of programming. Solving a task we should have the ability (techniques) to solve it in the /easy manner/. Until our current languages are

[JSMentors] Re: Today, Web Development Sucks

2011-02-04 Thread Rey Bango
I'm closing this topic because it's not productive at all. Please everyone, let's focus on solving real problems, not bickering over personal feelings about libraries. Rey -- To view archived discussions from the original JSMentors Mailman list:

[JSMentors] Re: When might links to blog posts be considered spam

2011-02-04 Thread Rey Bango
I agree with you 100% which is why I've closed out the topic. It's digressed into an unproductive sinkhole of comments and we need to focus on solving problems on JSMentors. I'm also going to be on the lookout for this type of trolling going forward. Rey... On Feb 4, 10:54 am, jemptymethod

[JSMentors] Re: new Number(...) use case

2011-02-04 Thread Jason Mulligan
only for iteration would you be concerned with the casting; almost always for strings and ops like 'indexOf()'. On Feb 4, 11:06 am, Angus Croll anguscr...@gmail.com wrote: Actually you can just say (0).toFixed(2); Primitives get temporarily coerced to their object wrappers when faced with

Re: [JSMentors] new Number(...) use case

2011-02-04 Thread Bryan Forbes
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 2/4/11 9:51 AM, jemptymethod wrote: I'm setting ExtJS form values in one of their ubiquitous config objects based on JSON data from an Ajax call. For currency fields I am calling toFixed(2) on the numbers such as:

[JSMentors] Re: new Number(...) use case

2011-02-04 Thread Michael Haufe (TNO)
On Feb 4, 10:06 am, Angus Croll anguscr...@gmail.com wrote: [...] I've never yet had to use new Number() but there may yet be a scenario [...] If you want a consistent way to evaluate and enforce the type of individual values through the instanceof operator, this would be the approach to

Re: [JSMentors] Re: JavaScript is the next C

2011-02-04 Thread Balázs Galambosi
On Fri, Feb 4, 2011 at 5:47 PM, Rey Bango reyba...@gmail.com wrote: Please, let's focus on technical discussions here and stop with the posting to links that only spark up non-productive debates and add no value to JSMentors.. You mean stick to the everlasting flow of questions about jQuery

Re: [JSMentors] Re: JavaScript is the next C

2011-02-04 Thread Acaz Souza Pereira
Agree! 2011/2/4 Balázs Galambosi galambal...@gmail.com On Fri, Feb 4, 2011 at 5:47 PM, Rey Bango reyba...@gmail.com wrote: Please, let's focus on technical discussions here and stop with the posting to links that only spark up non-productive debates and add no value to JSMentors.. You

[JSMentors] Re: JavaScript is the next C

2011-02-04 Thread jemptymethod
On Feb 4, 1:24 pm, Balázs Galambosi galambal...@gmail.com wrote: On Fri, Feb 4, 2011 at 5:47 PM, Rey Bango reyba...@gmail.com wrote: Please, let's focus on technical discussions here and stop with the posting to links that only spark up non-productive debates and add no value to JSMentors..

Re: [JSMentors] Re: JavaScript is the next C

2011-02-04 Thread Andrew Hedges
On Sat, February 5, 2011 7:51 am, jemptymethod wrote: Between the spam and your (yes, you) trolling JSMentors risks devolving into the noise-to-signal festival that is comp.lang.javascript A great way to not have this happen is not to respond to trolls. If you're in it for attention and you

[JSMentors] Cannot delete object property if that would leave a reference dangling?

2011-02-04 Thread jemptymethod
I want to delete a couple of object properties, but first save those properties, then add them back after I'm done processing the object *without* those properties. But I can't do the following, when I log the object to the console, it's apparent the properties didn't get deleted, presumably

[JSMentors] Re: JavaScript is the next C

2011-02-04 Thread Rey Bango
Hi Balazs. Yes, Dmitry's reply was great which is why I didn't remove it. What I don't want is to have every post turn into an op-ed piece that then degrades into useless debates. I've seen that happen on too many other forums and since Asen and I *created* this group, we're going to be extra

Re: [JSMentors] Re: JavaScript is the next C

2011-02-04 Thread Peter van der Zee
On Fri, Feb 4, 2011 at 8:40 PM, jemptymethod jemptymet...@gmail.com wrote: All well and good. But here's the thing. I don't *need* this group: my Javascript chops already get managers of frameworks like ExtJS and YUI interested in hiring me. Here's the thing. This list is about helping

[JSMentors] (no subject)

2011-02-04 Thread nalioth
unsubsribe -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/jsmentors@jsmentors.com/ To search via a non-Google archive, visit here: http://www.mail-archive.com/jsmentors@googlegroups.com/ To unsubscribe from this group, send email to

Re: [JSMentors] Re: JavaScript is the next C

2011-02-04 Thread Balázs Galambosi
On Fri, Feb 4, 2011 at 7:51 PM, jemptymethod jemptymet...@gmail.com wrote: And the trollish insinuation behind your remark is that I am not intelligent.  But if you read between the lines you'd realize I'm trying to open a discussion as to whether these posts are spam. I'm sorry I've only

Re: [JSMentors] Re: Cannot delete object property if that would leave a reference dangling?

2011-02-04 Thread Michael Geary
On Fri, Feb 4, 2011 at 11:47 AM, jemptymethod jemptymet...@gmail.comwrote: On Feb 4, 2:10 pm, jemptymethod jemptymet...@gmail.com wrote: I want to delete a couple of object properties, but first save those properties, then add them back after I'm done processing the object *without* those

Re: [JSMentors] Cannot delete object property if that would leave a reference dangling?

2011-02-04 Thread Lasse Reichstein
On Fri, 04 Feb 2011 20:10:05 +0100, jemptymethod jemptymet...@gmail.com wrote: I want to delete a couple of object properties, but first save those properties, then add them back after I'm done processing the object *without* those properties. Seems reasonable. But I can't do the

Re: [JSMentors] new Number(...) use case

2011-02-04 Thread Lasse Reichstein
On Fri, Feb 4, 2011 at 4:51 PM, jemptymethod jemptymet...@gmail.com wrote: I'm setting ExtJS form values in one of their ubiquitous config objects based on JSON data from an Ajax call. For currency fields I am calling toFixed(2) on the numbers such as: jsonObj.shippingAndHandling.toFixed(2)

Re: [JSMentors] Re: new Number(...) use case

2011-02-04 Thread Lasse Reichstein
On Fri, Feb 4, 2011 at 7:13 PM, Michael Haufe (TNO) t...@thenewobjective.com wrote: If you want a consistent way to evaluate and enforce the type of individual values through the instanceof operator, this would be the approach to use. In that case, you'll rarely have a meaningful class

Re: [JSMentors] Re: new Number(...) use case

2011-02-04 Thread Garrett Smith
On 2/4/11, Lasse Reichstein reichsteinatw...@gmail.com wrote: On Fri, Feb 4, 2011 at 7:13 PM, Michael Haufe (TNO) t...@thenewobjective.com wrote: [...] It's generally faster to access the characters directly on the primitive string value, e.g., var s = myString; alert(s[2]); // 'S'

Re: [JSMentors] global object property access

2011-02-04 Thread Jason Persampieri
On Fri, Feb 4, 2011 at 4:07 PM, Michael Geary m...@mg.to wrote: The first two cases are identical to each other, because window === this when your code runs in the global scope. And as you noted, it is not an error to attempt to dereference a nonexistent property of an object - you simply get

[JSMentors] Re: global object property access

2011-02-04 Thread Angus Croll
http://javascriptweblog.wordpress.com/2010/08/16/understanding-undefined-and-preventing-referenceerrors/ On Feb 4, 4:16 pm, Jason Persampieri ja...@persampieri.net wrote: On Fri, Feb 4, 2011 at 4:07 PM, Michael Geary m...@mg.to wrote: The first two cases are identical to each other, because

[JSMentors] Re: global object property access

2011-02-04 Thread mcot
Hi. I am still reading up on this but here are some more tests I have run: console.log(typeof(foo) === 'undefined'); // true -- doesn't raise reference error. foo;// reference error even without the call to console.log -- To

[JSMentors] Re: global object property access

2011-02-04 Thread mcot
By the way I am running these tests in the spidermonkey shell and in chrome using the dev tools. I substitute console.log for print() in the spidermonkey shell. On Feb 4, 10:54 pm, mcot atm1...@gmail.com wrote: Hi.  I am still reading up on this but here are some more tests I have run:

Re: [JSMentors] Re: global object property access

2011-02-04 Thread Michael Geary
Yes, that's correct. The typeof operator does not require its operand to be defined. When its operand is not defined, typeof returns the string 'undefined'. All correct, expected behavior. On Fri, Feb 4, 2011 at 7:54 PM, mcot atm1...@gmail.com wrote: Hi. I am still reading up on this but here

Re: [JSMentors] Re: global object property access

2011-02-04 Thread Juriy Zaytsev
On Fri, Feb 4, 2011 at 10:54 PM, mcot atm1...@gmail.com wrote: Hi. I am still reading up on this but here are some more tests I have run: console.log(typeof(foo) === 'undefined'); // true -- doesn't raise reference error. foo;