Re: [nodejs] Question about buffers

2012-05-17 Thread Dean Mao
So is data concat'ed via buffertools (a SlowBuffer) exempt from this issue? myslowbuffer.toString() won't have the split byte issue? On Thu, May 17, 2012 at 11:22 PM, Tim Caswell wrote: > My understanding is it takes care of reconstructing unicode characters > that had their bytes split across

Re: [nodejs] Question about buffers

2012-05-17 Thread Tim Caswell
My understanding is it takes care of reconstructing unicode characters that had their bytes split across multiple buffers. The toString() function on a buffer can't see other buffers. On Fri, May 18, 2012 at 12:18 AM, Dean Mao wrote: > So what is the purpose of StringDecoder exactly? The curre

Re: [nodejs] Question about buffers

2012-05-17 Thread Dean Mao
So what is the purpose of StringDecoder exactly? The current docs for it appear to be empty. http://nodejs.org/api/string_decoder.html How is it different than doing buffer.toString('utf8')? On Thu, May 17, 2012 at 3:36 PM, Ben Noordhuis wrote: > On Thu, May 17, 2012 at 9:56 PM, Mattias Erne

[nodejs] Re: Suggestions on how to print from node.js

2012-05-17 Thread mscdex
On May 18, 12:13 am, mscdex wrote: > Maybe I misunderstand the need, but why not just use something like > CUPS? If you need to have programmatic access to it, they at least > have an HTTP interface. Otherwise in the worst case you'd just need to > write some kind of binding to the CUPS API. Anot

Re: [nodejs] Re: Suggestions on how to print from node.js

2012-05-17 Thread Tim Caswell
On Thu, May 17, 2012 at 10:13 PM, mscdex wrote: > On May 17, 11:51 pm, Tauren Mills wrote: > > I'd like to build a print server that receives jobs over the network and > > can print them to an attached printer. We were thinking about utilizing > > websockets to notify the print server that a job

[nodejs] Re: Suggestions on how to print from node.js

2012-05-17 Thread mscdex
On May 17, 11:51 pm, Tauren Mills wrote: > I'd like to build a print server that receives jobs over the network and > can print them to an attached printer. We were thinking about utilizing > websockets to notify the print server that a job is ready, so node came to > mind. But it doesn't seem lik

Re: [nodejs] Suggestions on how to print from node.js

2012-05-17 Thread Tim Caswell
Sounds like you'd have to write a C++ node addon that interfaces with the windows print API and expose it to node as a JavaScript API. Then when you deploy, include this binary addon pre-compiled along with node and your server code. I doubt node will be able to talk to the printer out of the box

[nodejs] Suggestions on how to print from node.js

2012-05-17 Thread Tauren Mills
I'd like to build a print server that receives jobs over the network and can print them to an attached printer. We were thinking about utilizing websockets to notify the print server that a job is ready, so node came to mind. But it doesn't seem like node is the right tool for interfacing with a pr

Re: [nodejs] Async testing with nodeunit

2012-05-17 Thread Nuno Job
I really think specify is great for this kind of stuff (especially so if you need to nock http requests). i still didnt find the time to show it on blogpost or video but you can look at some samples in the nano test folder: https://github.com/dscape/nano/blob/master/tests/att/pipe.js#L11-#L43 nu

[nodejs] Re: Uniquely identify a socket

2012-05-17 Thread mscdex
On May 17, 8:33 am, Veeru wrote: > Ok, one question here, am setting a cool_id to the socket, then later on > how can i retrieve this socket from another socket. i.e i want to send a > message from a socket to this particular socket. how to do that? You could just have a global object that contai

Re: [nodejs] Uniquely identify a socket

2012-05-17 Thread Matthew Hazlett
// global scope var connection = 0; // on connection socket['cool_id'] = connection; connection++; Could you just do something as simple as this? On 5/17/2012 8:33 AM, Veeru wrote: Ok, one question here, am setting a cool_id to the socket, then later on how can i retrieve this socket from anot

Re: [nodejs] Question about buffers

2012-05-17 Thread Ben Noordhuis
On Thu, May 17, 2012 at 9:56 PM, Mattias Ernelli wrote: > How should node buffers/streams be handled if parsing/conversion of utf8 > encoded text data will be done? > > This simple test shows that naive concatenation or processing of buffers > will fail: > > var str = "Hälöö!"; > > var b = new Buf

Re: [nodejs] deadlock, how to hunt it down?

2012-05-17 Thread Ben Noordhuis
On Thu, May 17, 2012 at 10:33 AM, Erik Dubbelboer wrote: > It happened again. > > But judging from the stack trace it seems more like a problem in V8. > > There are 3 threads running. > > This one seems to be from libeio waiting for work (which it will never get > in our app): > #0  0x7f326936

Re: [nodejs] problems with changing process.env.TZ at runtime

2012-05-17 Thread Ben Noordhuis
On Thu, May 17, 2012 at 5:50 PM, SethP wrote: > Thanks, Ben. The patch applied fine to my v0.6.17-release branch, but > doesn't appear to have fixed the issue. > > (Also, 'make clean' doesn't seem to drop the /out dir - which doesn't seem > very clean to me; I dropped it manually.) Try `make dist

[nodejs] Question about buffers

2012-05-17 Thread Mattias Ernelli
How should node buffers/streams be handled if parsing/conversion of utf8 encoded text data will be done? This simple test shows that naive concatenation or processing of buffers will fail: var str = "Hälöö!"; var b = new Buffer(str); var b1 = b.slice(0, 5); var b2 = b.slice(5); console.log("

Re: [nodejs] Re: Question about cpu usage

2012-05-17 Thread Mark Hahn
There was another thread recently about a million objects in a hash bringing the cpu to its knees. On Thu, May 17, 2012 at 10:28 AM, marcucio wrote: > Thanks for the replies, I'm thinking it is GC too, because I do cache a > lot of data, and my app's code is not executing any more than when the

Re: [nodejs] Why is 'require' not doing callbacks?

2012-05-17 Thread Angel Java Lopez
Interesting... thanks for the detailed history. Isaac, this is nice topic for dinner at Buenos Aires, with Argentinean meat and wine ;-) we are waiting for your talk at http://jsconf.com.ar On Wed, May 16, 2012 at 9:11 PM, Isaac Schlueter wrote: > Synchronous require() not a "wart". Nor are fs

[nodejs] Re: Question about cpu usage

2012-05-17 Thread marcucio
Thanks for the replies, I'm thinking it is GC too, because I do cache a lot of data, and my app's code is not executing any more than when the cpu is much lower. I will try to expire my data cache quicker to see if this fixes the issue. On Thursday, May 17, 2012 6:37:21 AM UTC-4, darcy wrote: >

[nodejs] Re: How to keep a queue active after a request is made in node.js amqp?

2012-05-17 Thread Graeme Foster
This seems a slightly odd way to use a queue - normally you would get the queue from the connection and subscribe once, then you get notified of each message as it is taken off the queue. Are you using it for RPC or something? Maybe if you could explain how you want to use the queue we could c

[nodejs] justjs: beginner-friendly node tutorials, starting with the simplest blog ever

2012-05-17 Thread Tom Boutell
Hello node.js community, I've launched a blog presenting beginner-friendly node tutorials. The justjs blog is focused on the joy of working in a single, fast programming language without constantly switching gears in your brain. The first installments covered installing Node and MongoDB on your

Re: [nodejs] Uniquely identify a socket

2012-05-17 Thread Veeru
Ok, one question here, am setting a cool_id to the socket, then later on how can i retrieve this socket from another socket. i.e i want to send a message from a socket to this particular socket. how to do that? On Tuesday, 29 November 2011 03:32:24 UTC+5:30, Jann Horn wrote: > > 2011/11/28 JoeZ9

Re: [nodejs] problems with changing process.env.TZ at runtime

2012-05-17 Thread SethP
Thanks, Ben. The patch applied fine to my v0.6.17-release branch, but doesn't appear to have fixed the issue. (Also, 'make clean' doesn't seem to drop the /out dir - which doesn't seem very clean to me; I dropped it manually.) -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://

Re: [nodejs] Async testing with nodeunit

2012-05-17 Thread Osher El-Netanany
oups. excuse me all, I re-checked myself - I left some mock object in the wrong place, and the server was *not*running Sorry for the bother! On Thu, May 17, 2012 at 4:56 PM, Osher El-Netanany wrote: > oups. > > correction: > module.exports = > { login: > function(test) { >setT

Re: [nodejs] Async testing with nodeunit

2012-05-17 Thread Osher El-Netanany
oups. correction: module.exports = { login: function(test) { setTimeout( function(){ test.done(); } , 1000); } } On Thu, May 17, 2012 at 4:54 PM, Osher E wrote: > module.exports = > { login: > function(test) { >setTimeout( >

Re: [nodejs] Async testing with nodeunit

2012-05-17 Thread Osher E
oish... well this is a pseudo code, simplified it, to cut down the scuffold it fails the same with test file of: module.exports = { login: function(test) { setTimeout( function(test){ test.done(); } , 1000); } } Maybe its something wrong

Re: [nodejs] Async testing with nodeunit

2012-05-17 Thread Bryan Donovan
What does svr.login() look like? On May 17, 2012, at 4:50 AM, Osher El-Netanany wrote: > Hi all > > I'm trying to use nodeunit for asynchronous testing, > > my code is like: > var svr = require("mysvr") > ; > svr.listen(5353); > module.exports = > { login: > function(is) { >s

Re: [nodejs] Nodejs scaling by running multiple processes: what's the optimal number of processes?

2012-05-17 Thread Jeremy Darling
Our experience has shown that 2 processes per core thread (IE: On an i7 you get 8 core threads on 4 cores due to hyperthreading) balances quite well. This isn't to say that your experience won't differ. We have all of our code broke into logical families and utilize Hook.io as a message bus betwe

[nodejs] Async testing with nodeunit

2012-05-17 Thread Osher El-Netanany
Hi all I'm trying to use nodeunit for asynchronous testing, my code is like: var svr = require("mysvr") ; svr.listen(5353); module.exports = { login: function(is) { svr.login( { usr: "u", pwd: "p" } , function(err, res){ is.ok(!err); is.done();

[nodejs] Upload aborted when using Opera and node.js

2012-05-17 Thread Aleksey Ryb
Hi, all. Maybe someone had same problem: I'm developing node.js - solution where users can upload files to server using node.js directly without any proxy. It uses formidable module. Files are videos, after upload they are processed, extracting audio etc. The problem is: it works fine in all brow

[nodejs] Re: Question about cpu usage

2012-05-17 Thread darcy
in my experiences, if there are memleaks, the gc will use more and more cpu time as the memory usage raise. On Wednesday, May 16, 2012 11:21:25 PM UTC+8, marcucio wrote: > I have a question about cpu usage, I noticed that my server cpu usage > increases all day as the server is being used but i

Re: [nodejs] Re: How to keep a queue active after a request is made in node.js amqp?

2012-05-17 Thread Dan Milon
Oh ok, i get it now. Well, i cannot guarantee about the publish method (but i find it highly unlikely that it needs to reinstantiate the queue). But on my app, i subscribe to a queue, and it works as expected (fires callback when a message is delivered). Could you write a gist to test it? On

[nodejs] [ANN] argparse - Native JavaScript port of Python's library.

2012-05-17 Thread ixti
Hello again :)) We have released first version of argparse [1] - native port of Python's awesome library for parsing command line arguments and options. It features expressive but yet robust syntax and, of course, absolute awesomeness. :)) See lots of examples [2] or take a look on real-world usa

Re: [nodejs] [ANN] Mincer: Native JavaScript port of the Sprockets.

2012-05-17 Thread Aleksey Zapparov
Thanks for your response! Feel free to give some criticism/suggestions/issues. Any response is highly appreciated. :)) We have prepared a Server middleware as well, which can be used as a standalone server or used as connect middleware. See `examples/server.js` for details. On Thu, May 17, 2012

Re: [nodejs] [ANN] Mincer: Native JavaScript port of the Sprockets.

2012-05-17 Thread Martin Wawrusch
This looks awesome and probably solves my snockets / connect-assets problems. Thanks a ton. I'll provide some feedback over the weekend. Cheers Martin On Thu, May 17, 2012 at 2:16 AM, ixti wrote: > Hello everybody, > > Yesterday we have finished Mincer [1] - 100% native JavaScript > port of the

[nodejs] [ANN] Mincer: Native JavaScript port of the Sprockets.

2012-05-17 Thread ixti
Hello everybody, Yesterday we have finished Mincer [1] - 100% native JavaScript port of the Sprockets. For those who not familiar, it's an awesome web assets processor, that allows you to write JS and CSS assets in almost any language you like (CoffeeScript, LESS, Stylus) more than that it allows

[nodejs] Node JS server

2012-05-17 Thread Joy
We are trying with a Node JS server for HTTP traversal of real time audio and video. On client we are using XHR polling to reach the server. One of our demo failed behind proxy. But we dont know which proxy it is? Do any one have a test server running with an application that can be tested behind t

Re: [nodejs] deadlock, how to hunt it down?

2012-05-17 Thread Erik Dubbelboer
It happened again. But judging from the stack trace it seems more like a problem in V8. There are 3 threads running. This one seems to be from libeio waiting for work (which it will never get in our app): #0 0x7f3269366d84 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/x86_64-linux-gnu/li

[nodejs] Re: How to keep a queue active after a request is made in node.js amqp?

2012-05-17 Thread Cassio Melo
Hi Dan, by "request" I mean "exchange", sorry. I know the queue has to be configured each time. Let me rephrase the problem. In the exchange above, the result is redirected to the queue "incoming", which just prints out the message. If I publish in the exchange for the second time, i.e, "exchange