Re: [nodejs] npm got Segmentation fault at linux (npm 1.1.48 & node v0.8.6)

2012-08-20 Thread 天猪
hi, I found a pc(window, can be remote control from public) which can connect to the linux server. could you plz send me an private email? (atian25 # qq.com) 在 2012年8月21日星期二UTC+8上午12时10分39秒,Ben Noordhuis写道: > > On Mon, Aug 20, 2012 at 6:06 PM, TZ (天猪) > > wrote: > > sadly, should I give up?

[nodejs] Re: How would you solve this: how many minutes connected

2012-08-20 Thread Filipe
I mean setInterval, inside a socket.on('connect') On Aug 20, 10:18 pm, Filipe wrote: > If there's the need to update user points every one second (server > side and client side), will be a wise idea to use a setTimeout with an > anonymous function to update DB and emit new point to client side?

[nodejs] Re: How would you solve this: how many minutes connected

2012-08-20 Thread Filipe
If there's the need to update user points every one second (server side and client side), will be a wise idea to use a setTimeout with an anonymous function to update DB and emit new point to client side? -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wi

Re: [nodejs] How would you solve this: how many minutes connected

2012-08-20 Thread Dan Milon
What about socket.io .on('connect'), .on('disconnect'). You can get the time range user is logged, and then sum up these in db. On Tue, Aug 21, 2012 at 3:09 AM, Filipe wrote: > Hi everyone! > > I have this scenario: Express, Socket.io and MongoDB. > > The problem: reward points to the user on ho

Re: [nodejs] Re: [ANN] New release of node-webkit - run node.js apps on desktop

2012-08-20 Thread Zhao Cheng
On Mon, Aug 20, 2012 at 11:19 PM, sihorton wrote: > This looks like a great project. > > I have downloaded the nw_release_win32 and then I have downloaded a zip of > https://github.com/zcbenz/nw-file-explorer and extracted to a subdirectory > called "file-explorer" under nw_release_win32. I then

Re: [nodejs] How would you solve this: how many minutes connected

2012-08-20 Thread Mark Hahn
Why not update their count in the db once a minute? If you want, the code would be simpler to sample all of them once a minute. It wouldn't be as accurate but it would work well. On Mon, Aug 20, 2012 at 5:09 PM, Filipe wrote: > Hi everyone! > > I have this scenario: Express, Socket.io and Mong

[nodejs] How would you solve this: how many minutes connected

2012-08-20 Thread Filipe
Hi everyone! I have this scenario: Express, Socket.io and MongoDB. The problem: reward points to the user on how many seconds (or time in general) he keeps logged in (with the Socket opened). This is for a chat site I'm building and I want to build a ranking based on how many minutes users stay

Re: [nodejs] Why `fs.exists` has signature `(exists)` instead of `(err, exists)` ?

2012-08-20 Thread Stewart Mckinney
Yeah, I couldn't agree with Dan more. Consistency is super important, especially for a core lib. I mean, it could be worse, b ut, it should be addressed rather than ignored. On Mon, Aug 20, 2012 at 6:37 PM, Dan Milon wrote: > Thats what PHP thought about deprecation also. See where this got them

Re: [nodejs] Why `fs.exists` has signature `(exists)` instead of `(err, exists)` ?

2012-08-20 Thread Mikeal Rogers
Because we spend a lot of time convincing library authors not to defect from the standard callback signature. Diverging from it in core sends the wrong message. On Aug 20, 2012, at August 20, 20128:59 AM, Arnout Kazemier wrote: > I really dont get why people want to depricate functions just b

Re: [nodejs] Why `fs.exists` has signature `(exists)` instead of `(err, exists)` ?

2012-08-20 Thread Dan Milon
Thats what PHP thought about deprecation also. See where this got them. On Mon, Aug 20, 2012 at 6:59 PM, Arnout Kazemier wrote: > I really dont get why people want to depricate functions just because they > dont agree with the api signature. > > This is a useful function, it doesnt hurt anyone i

Re: [nodejs] how to link multiple dependencies with node-gyp

2012-08-20 Thread rhasson
Fairly simple library ( http://www.five-ten-sg.com/libpst/packages/ ). I never tried porting to gyp before but it can't hurt to try. On Monday, August 20, 2012 4:22:33 PM UTC-4, Nathan Rajlich wrote: > > What is the external library / addon in question? > > If the library is simple enough, the

Re: [nodejs] how to link multiple dependencies with node-gyp

2012-08-20 Thread Nathan Rajlich
What is the external library / addon in question? If the library is simple enough, the best way is to write a .gyp file for it and do it the "gyp way". I would highly encourage you to attempt to do that. An example of this is node-sqlite3's sqlite3.gyp file: https://github.com/developmentseed/nod

[nodejs] how to link multiple dependencies with node-gyp

2012-08-20 Thread rhasson
I'm building a native-addon and I'm using an external dependency that when compiles outputs an object file (.o). I want my project to compile, then compile the external dependency (via makefile not gyp) and then link the resulting objects together to create my addon. Is there a way to do that?

[nodejs] Re: Is npm 1.1.49 slightly broken for global installs on Windows?

2012-08-20 Thread Bert Belder
On Friday, August 17, 2012 9:00:49 PM UTC+2, adrians wrote: > > > With node 0.8.7 x64 (Windows 7), npm seems to not see global modules > installed under userdir/npm/... It only seems to look at the node_modules > dir inside the install location. As well, when trying to install modules > with -g,

[nodejs] Re: NPM install as git post-merge hook

2012-08-20 Thread Adam Crabtree
Here are some relevant npm github issues for reference: https://github.com/isaacs/npm/issues/1341 https://github.com/isaacs/npm/issues/2442 https://github.com/isaacs/npm/issues/1558 Cheers, Adam On Mon, Aug 20, 2012 at 10:38 AM, Adam Crabtree wrote: > Howdy all, > > We're currently determining

[nodejs] NPM install as git post-merge hook

2012-08-20 Thread Adam Crabtree
Howdy all, We're currently determining our post-git-merge npm install process, and I was just curious if anyone's come up with anything particularly elegant that's worked well for them. Our project is a multiprocess server, with each process having it's own self-contained dependencies in addition

Re: [nodejs] npm got Segmentation fault at linux (npm 1.1.48 & node v0.8.6)

2012-08-20 Thread Ben Noordhuis
On Mon, Aug 20, 2012 at 6:06 PM, TZ (天猪) wrote: > sadly, should I give up? If you can somehow get a ssh tunnel going, I'll be happy look at it. But right now there's not much I can do. -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Po

Re: [nodejs] npm got Segmentation fault at linux (npm 1.1.48 & node v0.8.6)

2012-08-20 Thread 天猪
sadly, should I give up? 在 2012年8月20日星期一UTC+8下午10时48分46秒,Ben Noordhuis写道: > > On Fri, Aug 17, 2012 at 5:30 PM, TZ (天猪) > > wrote: > > https://www.dropbox.com/s/vgcgatk917fovmb/core.7355 > > https://www.dropbox.com/s/9oa3li8inq6wzx2/node > > Thanks. I looked at it but couldn't find the culprit

Re: [nodejs] Why `fs.exists` has signature `(exists)` instead of `(err, exists)` ?

2012-08-20 Thread Arnout Kazemier
I really dont get why people want to depricate functions just because they dont agree with the api signature. This is a useful function, it doesnt hurt anyone if we keep it, but it does hurt when its removed. On 20 aug. 2012, at 17:53, Tim Caswell wrote: > How about removing it from the docs

Re: [nodejs] Non-blocking wrapper for a blocking library

2012-08-20 Thread Nikhil Marathe
On Mon, Aug 20, 2012 at 7:23 PM, Navaneeth KN wrote: > > I was not talking about will it block the event loop or not. Because I am > not using event loop at all explicitly. All I am doing is directly calling > the C function in my module. I was wondering should I implement using Work > queue (http

Re: [nodejs] Why `fs.exists` has signature `(exists)` instead of `(err, exists)` ?

2012-08-20 Thread Tim Caswell
How about removing it from the docs and making it non-enumerable in the fs module. Then any new developers won't know it's there unless they are reading someone else's code. Or maybe in the docs simply say that it shouldn't be used and is only left there so as to not break old code. Also, how is

Re: [nodejs] Re: [ANN] New release of node-webkit - run node.js apps on desktop

2012-08-20 Thread sihorton
This looks like a great project. I have downloaded the nw_release_win32 and then I have downloaded a zip of https://github.com/zcbenz/nw-file-explorer and extracted to a subdirectory called "file-explorer" under nw_release_win32. I then open a console and run nw.exe file-explorer it opens a w

Re: [nodejs] Re: Writing data to a socket

2012-08-20 Thread Juan Ignacio Dopazo
Thank you both! I hadn't noticed client.write(str, callback), but when I test it I still get the same result. And client.end('a') only writes once, then marks the socket as not writable. I figured out that the socket had a buffer. I wanted to understand a bit more about why. And also the descript

Re: [nodejs] Non-blocking wrapper for a blocking library

2012-08-20 Thread Shripad K
On Mon, Aug 20, 2012 at 7:23 PM, Navaneeth KN wrote: > Hello, > > Thanks for responding. > > On Monday, 20 August 2012 17:37:55 UTC+5:30, Shripad K wrote: >> >> Hello Navaneeth, >> >> One cannot ascertain from the JS code whether the call is going to block >> the event loop or not. In libev, you

Re: [nodejs] npm got Segmentation fault at linux (npm 1.1.48 & node v0.8.6)

2012-08-20 Thread Ben Noordhuis
On Fri, Aug 17, 2012 at 5:30 PM, TZ (天猪) wrote: > https://www.dropbox.com/s/vgcgatk917fovmb/core.7355 > https://www.dropbox.com/s/9oa3li8inq6wzx2/node Thanks. I looked at it but couldn't find the culprit - there's a uv_async_t handle that seems mostly uninitialized (most fields are 0 or NULL) for

Re: [nodejs] Non-blocking wrapper for a blocking library

2012-08-20 Thread Navaneeth KN
Hello, Thanks for responding. On Monday, 20 August 2012 17:37:55 UTC+5:30, Shripad K wrote: > > Hello Navaneeth, > > One cannot ascertain from the JS code whether the call is going to block > the event loop or not. In libev, you would register a ev_io watcher and > listen for EV_READ, EV_WRITE

Re: [nodejs] Can I use another encoding in node.js when I use fs.readFile()

2012-08-20 Thread Matt
No. You have to read the data as a Buffer (binary) and use node-iconv to convert it. On Sat, Aug 18, 2012 at 2:49 AM, Satit Rianpit wrote: > Can I use tis620 or windows874 encoding for fs.readFile() in node.js > > Thanks. > > Satit Rianpit > > -- > Job Board: http://jobs.nodejs.org/ > Posting gu

Re: [nodejs] Non-blocking wrapper for a blocking library

2012-08-20 Thread Shripad K
Hello Navaneeth, One cannot ascertain from the JS code whether the call is going to block the event loop or not. In libev, you would register a ev_io watcher and listen for EV_READ, EV_WRITE (or both) events (ev_io_init() + ev_io_start()) whenever the FD becomes readable/writable. I think the equi

[nodejs] Re: Writing data to a socket

2012-08-20 Thread Clément Fossati
Hi Juan, It's because the socket has a buffer and it's not flush everytime you write on it. If you want to send multiple message, you can use client.end('a'); instead of client.write('a'); You don't need to write client.end(); because you socket is already half-closed by the client.end('a');

Re: [nodejs] Node.js for small in-house app (should not need much maintenance)

2012-08-20 Thread Rob Zolkos
Sounds like a nice small project to get the learning-fu going with node. thanks, Rob On Mon, Aug 20, 2012 at 3:22 PM, Mark Hahn wrote: > > we don't want to change it all the time because Nodejitsu or whatever > web hoster deprecates support > > That is not likely to happen. I have code tha

[nodejs] Can I use another encoding in node.js when I use fs.readFile()

2012-08-20 Thread Satit Rianpit
Can I use tis620 or windows874 encoding for fs.readFile() in node.js Thanks. Satit Rianpit -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "

[nodejs] Non-blocking wrapper for a blocking library

2012-08-20 Thread Navaneeth KN
Hello, I have a C shared library. I am writing a node module for this library. I wrote a process function which can be accessed from JS and it calls my shared library function. In JS, it looks like, myLibrary.process(args, function(output) { }); I am wondering, is this a non-blocking call or b

[nodejs] Monograph with NODEJS

2012-08-20 Thread abelardo oliveira
Hello, i need to make a monograph, and i go make about nodejs. You guys know how i can or a idea about one system with nodejs for i make? -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message bec

[nodejs] Sinon.js test spies across all methods of an object?

2012-08-20 Thread Chris Corbyn
Hi All, I'm using sinon.js as a way to stub out dependencies in my Mocha tests. I prefer the 'spy' approach over a classic mock approach, as the introspection of the spy seems clearer and affords more flexibility than the somewhat backward-thinking with classic mock objects. That said, I wond

[nodejs] Re: Writing data to a socket

2012-08-20 Thread greelgorke
client.write writes to the kernel buffer, process next tick delays the execution to the next event loop run. the event loop is faster than client.write, so you write more data to the buffer, before it gets flushed. try this: var client = net.connect({port: 1337}, function () { console.log('co

[nodejs] Re: Node.js domain module + express.js. Create domain for every request.

2012-08-20 Thread Honigbaum
Hi, nobody an idea? Torben Am Donnerstag, 16. August 2012 08:51:36 UTC+2 schrieb Honigbaum: > > Hi, > > I'm using express.js and the domain module of node.js for handling > uncaught exception. I start every worker of the cluster in it's own domain. > When an uncaught exception occurs I use