Re: [nodejs] Re: Ben Noordhuis's Departure

2013-12-09 Thread Michael Schoonmaker
Adam, You and I have disagreed on a great many things, but you've put my own thoughts into words better than I. Thank you. Ben, Thank you for your immensely positive impact on this community. I've learned more from your informative responses than the official Node documentation. : ) On Mon, Dec

Re: [nodejs] This is how I avoid writing __dirname before any path

2013-10-13 Thread Michael Schoonmaker
We've had this conversation before, and we don't need to have it again. That said and for posterity, I'd like folks to know what tools they have available to them. If you're writing a shell script and want to operate on the user's files (e.g. `myscript dir/file.txt`, use `process.cwd()`. That's bo

Re: [nodejs] Re: How to prevent disasters caused by the callback getting called multiple times?

2013-10-03 Thread Michael Schoonmaker
+1 for just using the `once` module and being done with it. Measure everything, and worry about the side effects when you see them. If you're already into a "huge project", this is (as always, in my opinion) the most pragmatic option. On Thu, Oct 3, 2013 at 11:39 AM, Alexey Petrushin < alexey.pet

Re: [nodejs] Node faster after printing out console.log() after each packet send???

2013-09-04 Thread Michael Schoonmaker
Jt, It has less to do with the OS and more to do with the way zmq has been integrated with libuv and its behaviour under "load" (lots of pending messages). If you don't mind my reluctance to dive into the specifics, what problem are you trying to solve? Would another library like axon serve your n

Re: [nodejs] Modules by Author

2013-08-23 Thread Michael Schoonmaker
hat the npm list is extremely quiet, I > don't see any reason you shouldn't be able to post there. Odd. > > -- > Martin Cooper > > > On Wed, Aug 21, 2013 at 9:46 AM, Michael Schoonmaker < > michael.r.schoonma...@gmail.com> wrote: > >> Maybe I'm missing

[nodejs] Modules by Author

2013-08-21 Thread Michael Schoonmaker
Maybe I'm missing something obvious, but hunting around the various docs hasn't revealed a way to get all modules by author. All I'm looking for is module names, and the input requirements are flexible. -Schoon P.S. Is posting disabled in the NPM mailing list for shmoes like me? I thought that l

Re: [nodejs] Assert returns undefined when element exists?

2013-08-01 Thread Michael Schoonmaker
Jason, All methods in the `assert` module return undefined instead of returning a Boolean representing the result. While this would make sense in the affirmative case: console.log(assert(true)) => "true" It stops making sense once the assertion is false. Because it throws an AssertionError, the co

Re: [nodejs] Best practice for Node module interface

2013-07-11 Thread Michael Schoonmaker
For what it's worth, I consistently use E, but frequently provide a "wrapper" module in the style of A (if the module has multiple pieces), so `require('module/foo') == require('module').Foo`. On Thu, Jul 11, 2013 at 11:15 AM, Jake Verbaten wrote: > E for everything! > > if your module needs to

Re: [nodejs] You're going to have to rewrite it anyway

2013-07-10 Thread Michael Schoonmaker
Another point to consider is that libuv is itself written in C. Cognitively-speaking, the more similar we can make the two in terms of concept and feel, the better. On Wed, Jul 10, 2013 at 11:15 AM, Stephen Belanger wrote: > C++ also becomes pretty awkward when trying to interact with the API of

Re: [nodejs] Help in conversion of C# code into node.js(FFI) equivalent

2013-06-18 Thread Michael Schoonmaker
Vinod, There's a lot about the surrounding code we'd have to know to make sense of these lines (IntPtr has way too many uses). The best I can tell is that you're looking for the global parseInt function: https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/parseInt?redirect

Re: [nodejs] cluster module sending messages

2013-06-01 Thread Michael Schoonmaker
Here's an annotated example: https://gist.github.com/Schoonology/5691289 On Sat, Jun 1, 2013 at 10:52 AM, Mark Volkmann wrote: > Sorry, I'm still missing something and I don't see it in the API docs or > the sl-me code. If a worker calls process.send(msg), what does the master > need to do to li

Re: [nodejs] cluster module sending messages

2013-05-31 Thread Michael Schoonmaker
+1 for taking a gander at sl-mq. It's doing a little more than just sending messages blindly, but it should make sense of the built-in IPC channel, Mark. In particular, take a look at broker.js:_onFork and one of the queue types (pub/sub or push/pull). On Fri, May 31, 2013 at 8:30 PM, Sam Robert

Re: [nodejs] meaning of the semver ~

2013-05-30 Thread Michael Schoonmaker
A. semver.satisfies('~1.2.3', '1.2.4') => true B. semver.satisfies('~1.2', '1.3.0') => false C. semver.satisfies('~1.2', '1.2.6') => true D. semver.satisfies('1.2', '1.3.0') => false E. semver.satisfies('1.2', '1.2.4') => true My understanding is similar to Forrest's. ~1.2.3 means 1.2.3 <= version

Re: [nodejs] Module naming

2013-05-28 Thread Michael Schoonmaker
I apologize for adding to the "drama", but after reading your comments I still legitimately believed that what you were arguing towards was muddying the water between single namespace npm and dual namespace GitHub (whether through the discovery and search system or the storage is less consequential

Re: [nodejs] Re: Module naming

2013-05-26 Thread Michael Schoonmaker
'Evening, Greetings from a member of the (apparently) quiter majority. The way npm works today is sufficient. It solves my problems with a simplicity like no other package manager or package registry I've experienced. It's obvious and easily teachable, and is the #1 reason I ever recommend Node to

Re: [nodejs] node js input

2013-04-05 Thread Michael Schoonmaker
Adva, I'm not sure you understand what this mailing list is for. There are no text boxes in Node, which is a server-side Javascript environment. http://nodejs.org/api/ On Fri, Apr 5, 2013 at 1:37 PM, Adva wrote: > i added a input in node js (=textBox). > and now i'm trying to read what the user

Re: [nodejs] How to call MakeCallBack of an addon from another thread

2013-04-05 Thread Michael Schoonmaker
Jerry, Are you talking about building a native module, since you refer to Handles and threads? On Fri, Apr 5, 2013 at 1:42 PM, Mark Hahn wrote: > How are you using threads in node? > > > On Fri, Apr 5, 2013 at 9:42 AM, Jerry Yin wrote: >> >> Hi, >> >> I want to make a program like below. >> >> t

Re: [nodejs] ZeroMQ Libraries

2013-04-05 Thread Michael Schoonmaker
@Stephan - The primary goal was to take _inspiration_ from the streams2 API to build an ideally easy-to-understand, easy-to-control binding to ZeroMQ. A big deal for me was straightforward handling of EAGAIN, a nemesis to previous iterations of the private project using these libraries. @Alexey -

Re: [nodejs] Re: Minimal "pseudo-promises" implementation. Feedback requested.

2013-04-04 Thread Michael Schoonmaker
For the sake of providing you with an answer, I would not use this in place of the existing solutions. There's a lot of wisdom behind the Promises/A+ specification, and my promise implementations of choice follow that spec. -Schoon On Thu, Apr 4, 2013 at 12:44 PM, Paul wrote: > Ok. This will be

Re: [nodejs] Re: Wanted: federated-event/message-emitting platform?

2013-02-18 Thread Michael Schoonmaker
Mike, I'd look for the pub-sub setup that makes the most sense to you, and keep it simple. You don't need a ton of "framework" on top of it. Redis will meet your needs well, but if you need many thousands of messages a second (which it doesn't sound like is the case!), I would take a closer look at

Re: [nodejs] Wanted: federated-event/message-emitting platform?

2013-02-18 Thread Michael Schoonmaker
Mike, When it comes to "taking the output" of sensors or other processes, what happens when a new process is added to the mesh? Should it be able to ask for the current sensor state, or simply sit idle until the next chunk of output is published to the mesh? -Schoon On Mon, Feb 18, 2013 at 10:39

Re: [nodejs] How an event loop works

2013-02-15 Thread Michael Schoonmaker
Matt, A quick read through the basics of libuv (http://nikhilm.github.com/uvbook/basics.html) has been really helpful to me. While it's not required, muscling through building a native addon for Node has been enlightening, too. -Schoon On Fri, Feb 15, 2013 at 8:44 AM, Matt wrote: > Although nex

Re: [nodejs] Elegant way to require('some-app-component')

2013-02-09 Thread Michael Schoonmaker
In the interest of bringing up all options, one practice I like is to: 1. Place all internal dependencies within a top-level `lib` directory. 2. Place an index in the `lib` directory. 3. Make the `lib/index.js` useful in one or both of two ways. (Dependent on project needs) The first way is the "n

Re: [nodejs] ZeroMQ Libraries

2013-02-08 Thread Michael Schoonmaker
oll when it > should be sync instead. > > > On Saturday, February 9, 2013, Michael Schoonmaker wrote: >> >> Jacob, >> I won't be changing the existing ZeroMQ semantics. REQ and REP require >> synchronicity because of the way they're designed. If you want &

Re: [nodejs] ZeroMQ Libraries

2013-02-08 Thread Michael Schoonmaker
Jacob, I won't be changing the existing ZeroMQ semantics. REQ and REP require synchronicity because of the way they're designed. If you want asynchronous request/reply, check out DEALER and ROUTER. They're harder to work with, but much more powerful. Shuttle is built entirely with these two socket

[nodejs] ZeroMQ Libraries

2013-02-08 Thread Michael Schoonmaker
I want to make sure I'm not unnecessarily duplicating effort. The existing ZeroMQ library (https://npmjs.org/package/zmq) is _perfect_ for a significant number of use cases. It handles a lot of the low-level socket management for you, automatically emitting 'message' events as new messages arrive.

Re: [nodejs] nodejs 100% cpu randomly

2012-11-14 Thread Michael Schoonmaker
... which is easily diagnosed with `forever list`, and can be assuaged with forever's "spinning" parameters, "minUptime" and "spinSleepTime". Other than Adam's reason, I've never seen CPU spikes because of forever. Let's not have any straw men here. On Wed, Nov 14, 2012 at 8:40 AM, Adam Crabtree

Re: [nodejs] Re: Server-to-Server Communication

2012-10-27 Thread Michael Schoonmaker
ZeroMQ is designed for server-to-server communication, and works really well. For my current project I wanted a call-and-callback style structure, so https://github.com/Schoonology/shuttle was born. The Shuttle framework may be exactly what you're looking for, but if not I hope it's a useful examp

Re: [nodejs] Poll for v0.10 feature: Crypto default to 'binary' strings vs defaulting to buffers

2012-10-08 Thread Michael Schoonmaker
My vote is a', "Please for the love of all that is holy go for it." The incongruence is annoying, and I have to context-switch every time I work with our crypto code. On Mon, Oct 8, 2012 at 4:33 PM, Joshua Holbrook wrote: > I say go for it. :) > > --Josh > > On Mon, Oct 8, 2012 at 4:24 PM, Isaac

Re: [nodejs] execute the anonymous function that was passed to another function

2012-09-29 Thread Michael Schoonmaker
Satya, The "event loop" doesn't matter until two things happen: 1. You actually perform asynchronous work. (A for loop doesn't count. Please read http://nodemanual.org/latest/nodejs_dev_guide/writing_asynchronous_code.html ) 2. You understand *and deeply care about* the boundaries b

Re: [nodejs] Re: Keeping semantics in your version numbers, i.e. please don't release major version zero

2012-09-20 Thread Michael Schoonmaker
I don't disagree with you insofar as using something that *looks like *semver without *being *semver can be confusing. However, what I do disagree with is the attitude that we should change *common practice* because there is a similar-looking *standard*. Does that make sense? It's one thing to be

Re: [nodejs] Re: Keeping semantics in your version numbers, i.e. please don't release major version zero

2012-09-20 Thread Michael Schoonmaker
I think one way we disagree is in the definition of "standard". All npm guarantees is that the version by *parseable* by node-semver, not that they follow the complete semver specification. It may not be a documented "standard", but what Tim alludes to, architecture-change.breaking-change.non-brea

Re: [nodejs] repl with async ops

2012-09-19 Thread Michael Schoonmaker
Dan, What are your goals in pausing the REPL? Especially when working with the REPL on a running application, I find invoking async operations with a callback like this one to be a lot more useful. Not saying you have to use that module or that your motivat

Re: [nodejs] Re: Threading, and Dogmatisms.

2012-09-17 Thread Michael Schoonmaker
As someone who started using Node after said experimentation was over, I want to publically thank those who argued this sort of thing *in the past*, and am excited about what we (myself included) can build in and with Node. Those decisions were not easy, but they've been decided, and by incredibly

[nodejs] Re: Giving up on node.js / Flatiron / hook.io

2012-09-11 Thread Michael Schoonmaker
Seconded. On Tuesday, 11 September 2012 14:17:29 UTC-7, Adam Crabtree wrote: > > Sad to hear. It sounds like you won't be able to (or maybe don't want to, > understandable), but will you be able to make any of your work toward 0.9 > or its integration with Flatiron available anywhere? Were you p

[nodejs] Re: Feature poll: Do you use the clientError event?

2012-08-30 Thread Michael Schoonmaker
4 On Wednesday, 29 August 2012 16:07:23 UTC-7, Isaac Schlueter wrote: > > Do you use the clientError event? > > Please choose one: > > 1. Yes, I use it all the time. Please don't change it ever, thank you. > > 2. I don't use it, but I'm aware of it, and I think I might someday. > > 3. I don't