Re: [nodejs] ReadStream supported encodings

2012-03-11 Thread Ben Noordhuis
On Sun, Mar 11, 2012 at 22:03, Mark Volkmann wrote: > The documentation for the ReadStream setEncoding method at > http://nodejs.org/docs/latest/api/stream.html says the encoding can be > 'utf8', 'ascii' or 'base64'. Buffers support these additional > encodings: 'ucs2', 'binary' and 'hex'. In look

[nodejs] ReadStream supported encodings

2012-03-11 Thread Mark Volkmann
The documentation for the ReadStream setEncoding method at http://nodejs.org/docs/latest/api/stream.html says the encoding can be 'utf8', 'ascii' or 'base64'. Buffers support these additional encodings: 'ucs2', 'binary' and 'hex'. In looking through the source, I don't see where ReadStreams are lim

[nodejs] ANN: blog post on fibers and threads

2012-03-11 Thread Bruno Jouhier
Since this week node has both threads and fibers. Fibers have been available for more than a year (https://github.com/laverdet/node-fibers) and threads landed this week with Jorge's thread a gogo module (https://github.com/xk/node-threads-a-gogo). I just wrote a blog post on fibers and threads,

Re: [nodejs] util is functions

2012-03-11 Thread Nathan Rajlich
It's a generally known problem is JavaScript that "instanceof" doesn't work across contexts (not just the vm module). This is even a problem in the web browser. So JS devs have had to come up with a sure-fire way to determine if you have a Date object by checking the internal [[Class]] property, wh

Re: [nodejs] util is functions

2012-03-11 Thread Mark Volkmann
On Sun, Mar 11, 2012 at 11:39 AM, Jann Horn wrote: > Am Sonntag, den 11.03.2012, 11:10 -0500 schrieb Mark Volkmann: >> util.isDate(obj) >> >> obj instanceof Date > >> new Date() instanceof Date > true >> require('vm').runInNewContext('new Date()') instanceof Date > false >> require('util').isDate(

Re: [nodejs] util is functions

2012-03-11 Thread Jann Horn
Am Sonntag, den 11.03.2012, 11:10 -0500 schrieb Mark Volkmann: > util.isDate(obj) > > obj instanceof Date > new Date() instanceof Date true > require('vm').runInNewContext('new Date()') instanceof Date false > require('util').isDate(new Date()) true > require('util').isDate(require('vm').runInNew

Re: [nodejs] Re: garbage collection, patterns: classical/prototypal inheritance and ValueObject

2012-03-11 Thread Phoscur
> I suggest you look at how util.inherits is implemented, then use that > for inheritance. I know that is a better idea, which keeps constructor and super_ properties, but it hides the fact that in JavaScript you use Object.create() even for classical inheritance. > With regards to your code, th

Re: [nodejs] Re: NodeConf Reverse Call for Speakers

2012-03-11 Thread Matt
I know that the guys at Craigslist are itching to talk at a conference about their use of Haraka, if anyone is interested in that. (I'd propose a talk myself, but I don't have the time to take off for travel right now, with my day job). On Sun, Mar 11, 2012 at 3:20 AM, Mikeal Rogers wrote: > HAH

[nodejs] util is functions

2012-03-11 Thread Mark Volkmann
I'm sure there's a reason I don't yet appreciate, but why do we need the util module functions isArray, isDate, isError and isRegExp? When do the result of these expressions differ? util.isDate(obj) obj instanceof Date -- R. Mark Volkmann Object Computing, Inc. -- Job Board: http://jobs.nodej

[nodejs] Re: Cannot use my own native binding (built with node-gyp)

2012-03-11 Thread Andi
My mistake was that I didn't know that "binding" in NODE_MODULE(binding, init) must be the target name, defined in the gyp file. On Sunday, March 11, 2012 4:52:14 PM UTC+1, Andi wrote: > > I have created my own native binding like this: > http://pastebin.com/pEujzNfc > I have created the correct

[nodejs] Cannot use my own native binding (built with node-gyp)

2012-03-11 Thread Andi
I have created my own native binding like this: http://pastebin.com/pEujzNfc I have created the correct binding.gyp file, and installed node-gyp. I use node v0.6.12. $ node-gyp configure info it worked if it ends with ok spawn python [ '/Users/andi/.node-gyp/0.6.12/tools/gyp_addon', 'binding.g

[nodejs] Cannot use own native binding (built with node-gyp)

2012-03-11 Thread Andi
#include #include using namespace node; using namespace v8; class HelloWorld: ObjectWrap { private: int m_count; public: static void Init(Handle target) { HandleScope scope; Local t = FunctionTemplate::New(New); Persistent s_ct = Persistent::New(t); s_ct

Re: [nodejs] npm star

2012-03-11 Thread Jann Horn
Am Sonntag, den 11.03.2012, 08:00 -0500 schrieb Mark Volkmann: > I know how to star and unstar a module in npm, but is there a way to > get a list of the modules I have starred? Afaik only by cloning the entire registry and running a custom view. signature.asc Description: This is a digitally si

[nodejs] npm star

2012-03-11 Thread Mark Volkmann
I know how to star and unstar a module in npm, but is there a way to get a list of the modules I have starred? -- R. Mark Volkmann Object Computing, Inc. -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received t

[nodejs] Re: How do you test code which communicates with a database?

2012-03-11 Thread Lothar Pfeiler
I think "only mock what you own" relates to the data you own, not the database client library. On Mar 11, 10:42 am, Lothar Pfeiler wrote: > I prefer to have 3 databases. A sandbox database with some sample > data, the production system with the real data and a QA database, > which is a copy of th

[nodejs] Re: How do you test code which communicates with a database?

2012-03-11 Thread Lothar Pfeiler
I prefer to have 3 databases. A sandbox database with some sample data, the production system with the real data and a QA database, which is a copy of the production system. This is how I have developed since 12 years and I didn't find a better solution. On Mar 11, 8:50 am, Roly Fentanes wrote: >