Re: [JSMentors] Request for code review: noodles - Async/non-blocking/CPS versions of the higher order functions on `Array.prototype`

2011-01-08 Thread Nicholas C. Zakas
Hi Nick, I took a quick look at your code. Your comments already point out a few things you want to fix, so I’ve not mentioned any of those. My comments are: 1. Lines 34 and 36 can be combined (could be var slice = Array.prototype.slice, noodles;). 2. On line 47 – I typically like to put the p

[JSMentors] Donations

2011-01-08 Thread Garrett Smith
Greetings to all. Anyone finding my answers helpful may donate via paypal to dhtmlkitc...@gmail.com. Any amount is appreciated. I am also available for private projects or personal assistance regarding javascript and accept email at the aforementioned email address. Thank you, Garrett -- To v

Re: [JSMentors] Re: Internet Explorer event handler leaks

2011-01-08 Thread Garrett Smith
On 1/8/11, Bryan Forbes wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 1/8/11 2:47 AM, Garrett Smith wrote: >> On 1/7/11, Bryan Forbes wrote: >>> -BEGIN PGP SIGNED MESSAGE- >>> Hash: SHA1 >>> >>> On 1/6/11 5:04 PM, Garrett Smith wrote: AFAIK MSIE closure based memory

Re: [JSMentors] Re: Internet Explorer event handler leaks

2011-01-08 Thread Bryan Forbes
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 1/8/11 2:47 AM, Garrett Smith wrote: > On 1/7/11, Bryan Forbes wrote: >> -BEGIN PGP SIGNED MESSAGE- >> Hash: SHA1 >> >> On 1/6/11 5:04 PM, Garrett Smith wrote: >>> AFAIK MSIE closure based memory leaks was addressed in IE6 sp2. >> >> Except

Re: [JSMentors] How to reference to each drawing in the canvas ?

2011-01-08 Thread porneL
On Sat, 08 Jan 2011 18:24:29 -, Jeremie Patonnier wrote: @ porneL, Andraž Kos : you are right. SVG is truly an effective support for the graphics on the web, but I feel it difficult to become a web standard such as canvas. SVG is already a web standard and it is support by every brow

[JSMentors] Re: Creating new var in global scope; use `var` or not?

2011-01-08 Thread Diego Perini
On Jan 7, 8:46 am, Mathias Bynens wrote: > You’re in the global scope, and you want to create a new global var. > There are different options. What is the difference between them? > > 1) This will work because the current scope happens to be the global > scope: > >     var foo = 42; > > Obviousl

Re: [JSMentors] How to reference to each drawing in the canvas ?

2011-01-08 Thread Miller Medeiros
You don't need to create SVG or DOM nodes to manipulate the shapes individually.. or use multiple canvas for each "layer". The simplest way of doing it is using a library that already provides a "scene graph" structure ( http://en.wikipedia.org/wiki/Scene_graph ) like: http://guryjs.org/ https:

Re: [JSMentors] select text from an element and insert into another element

2011-01-08 Thread Tim Down
On 7 January 2011 23:40, Garrett Smith wrote: > On 1/7/11, Rey Bango wrote: >> On Fri, Jan 7, 2011 at 5:58 PM, Garrett Smith wrote: >> >>> I am asking a question. And you're replying with a negative >>> accusation. Don't do that. And please don't top post. >>> >>> >> LOL! You have a weird sense o

Re: [JSMentors] How to reference to each drawing in the canvas ?

2011-01-08 Thread Jeremie Patonnier
Hello > @ porneL, Andraž Kos : you are right. SVG is truly an effective support for > the graphics on the web, but I feel it difficult to become a web standard > such as canvas. SVG is already a web standard and it is support by every browsers that support Canvas (that include IE9) There is n

Re: [JSMentors] How to reference to each drawing in the canvas ?

2011-01-08 Thread Gycoder
Thanks for all your replies, @ twilsoncom : I also think to your solution, but using the hidden DIV tags to map position of every shape was created. Those DIV shows only when "fill" mode is active. They are transparent to users, but Gypaint can track mouse events to know which is underlying elemen

[JSMentors] Re: select text from an element and insert into another element

2011-01-08 Thread Daniel Donaldson
Great point, Nick. I'll be sure to clarify in the future. Thanks! On Jan 8, 11:40 am, Nick Morgan wrote: > Hey Daniel, don't stress, and welcome to the group :) > > OTOH (for future reference), if you're asking a question about jQuery, it > *is* helpful to clarify that, even if it's obvious to m

[JSMentors] Re: Internet Explorer event handler leaks

2011-01-08 Thread geoffreyk
On Jan 8, 12:47 am, Garrett Smith wrote: > On 1/7/11, Bryan Forbes wrote:> -BEGIN PGP > SIGNED MESSAGE- > > Hash: SHA1 > > You are using a meta refresh as a test to see if more memory is > consumed on each refresh? A test for a memory leak must navigate > between two or more pages. > >

Re: [JSMentors] Re: select text from an element and insert into another element

2011-01-08 Thread Nick Morgan
Hey Daniel, don't stress, and welcome to the group :) OTOH (for future reference), if you're asking a question about jQuery, it *is* helpful to clarify that, even if it's obvious to most people. (some JavaScripters get a bit narked because there are others who can't tell the difference between jQu

Re: [JSMentors] Re: Creating new var in global scope; use `var` or not?

2011-01-08 Thread Dmitry Soshnikov
On Sat, Jan 8, 2011 at 4:18 PM, Dmitry Soshnikov wrote: > _regardless_ its [[Enumerable]] flag > Typo. [[Configurable]] of course. Dmitry. -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/jsmentors@jsmentors.com/ To search via a non-Goog

[JSMentors] Re: select text from an element and insert into another element

2011-01-08 Thread Daniel Donaldson
Thanks, jdalton! cool technique, also thanks for pointing me to 'delegate', gonna play with this today. this was my first topic in this group, and i was feeling like i created a monster due to some of the unpleasantries that ensued. sorry to everyone if i sowed the seeds of discord, i hope we're

Re: [JSMentors] Re: Creating new var in global scope; use `var` or not?

2011-01-08 Thread Dmitry Soshnikov
On Fri, Jan 7, 2011 at 10:38 PM, Angus Croll wrote: > Just wanted to add a couple of things to Dmitry's answer. > > There are at least 2 differences between variables and properties in > the global scope: > > 1) Property references are deletable but by default variables are not. > > window.foo =

Re: [JSMentors] Creating new var in global scope; use `var` or not?

2011-01-08 Thread Dmitry Soshnikov
On Sat, Jan 8, 2011 at 12:36 PM, Peter van der Zee wrote: Hm. Hey, in non-strict mode you could probably do something like `var global > = (function(){return this;}())` to get global. In strict mode, I'm not even > sure whether it'd be that easy. > Hm, maybe there are some issues with the delive

Re: [JSMentors] Creating new var in global scope; use `var` or not?

2011-01-08 Thread Dmitry Soshnikov
On Fri, Jan 7, 2011 at 10:27 PM, Garrett Smith wrote: > On 1/7/11, Dmitry Soshnikov wrote: > > On Fri, Jan 7, 2011 at 10:46 AM, Mathias Bynens wrote: > > > >> > >> > >> Let’s assume you’re working in the global scope already and you want > >> to create a new global variable. What do you guys rec

Re: [JSMentors] Creating new var in global scope; use `var` or not?

2011-01-08 Thread Peter van der Zee
On Sat, Jan 8, 2011 at 10:22 AM, Miller Medeiros wrote: > On Fri, Jan 7, 2011 at 5:41 PM, Nick Morgan wrote: > >> >> to create a global variable. If I thought my code would be run outside of >> a browser then I'd create a global object as Dmitry P suggested. >> >> > If you want to run it outsid

Re: [JSMentors] Creating new var in global scope; use `var` or not?

2011-01-08 Thread Miller Medeiros
On Fri, Jan 7, 2011 at 5:41 PM, Nick Morgan wrote: > > to create a global variable. If I thought my code would be run outside of a > browser then I'd create a global object as Dmitry P suggested. > > If you want to run it outside the browser you can always create a `window` variable that points t

Re: [JSMentors] Re: Creating new var in global scope; use `var` or not?

2011-01-08 Thread Miller Medeiros
On Fri, Jan 7, 2011 at 2:38 PM, Angus Croll wrote: > > 1) Property references are deletable but by default variables are not. > > window.foo = 42; > delete foo; //true > foo; //undefined > Reminder.. this causes an error on IE 6-8 since for IE the window (global) object isn't considered a "regul

Re: [JSMentors] Re: Internet Explorer event handler leaks

2011-01-08 Thread Garrett Smith
On 1/7/11, Bryan Forbes wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 1/6/11 5:04 PM, Garrett Smith wrote: >> AFAIK MSIE closure based memory leaks was addressed in IE6 sp2. > > Except that IE8 can still leak with ActiveXObjects: > > http://www.reigndropsfall.net/demos/ie_leak/le