Re: [nodejs] ender vs. browserify?

2012-04-23 Thread Jamison Dance
Neat. Sounds like I could just use a package.json file for my client-side 
files, do an `npm install`, and then a browserify build, which is a nice 
workflow.



-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] ender vs. browserify?

2012-04-23 Thread Mark Hahn
I am thinking of putting the entire app in a client-side browserify bundle.
 I can create the entire BODY element of the dom from js code including the
style info.  The idea here is to release an app by just releasing the
bundle.

I could create a generic index.html file that requires the bundle.

I have one question though.  How/where would I store my image files?  I can
imagine putting image files in package folders installed from npm but then
how would I serve them?  I doubt I want the node_modules folder inside my
web root folder.  :-)

-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs]will kilos setTimeout spend too much resourece?

2012-04-23 Thread Joran Greef
If you pass a function reference to an existing function to setTimeout, and 
then call this function repeatedly, rather than creating a closure each 
setTimeout call, that will lower your memory and cpu overhead substantially.

On Monday, April 23, 2012 7:49:08 AM UTC+2, Jason.桂林 wrote:

 I need to write a service use something like in memory cache, and I want 
 to do `expire` things in setTimeout, will it very slow, If I expire too 
 much things, about kilos to millions.

 -- 
 Best regards,

 Jason Green
 桂林




-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] running npm project as node program

2012-04-23 Thread Mark Hahn
I *conceptually* want to do this ...

  npm install wonder-app
  node wonder-app

In other words I want to distribute the complete app ready to run via npm.
 What is the easiest way to do this?

-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] running npm project as node program

2012-04-23 Thread Paddy Byers
Hi,

I *conceptually* want to do this ...

   npm install wonder-app
   node wonder-app

 In other words I want to distribute the complete app ready to run via npm.
  What is the easiest way to do this?


What about:

npm install wonder-app
node --eval require('wonder-app')()

?

Paddy

-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] running npm project as node program

2012-04-23 Thread Oliver Leics
Have a look at
http://npmjs.org/doc/json.html#bin
and then:

  npm install -g wonder-app
  wonder-app

On Mon, Apr 23, 2012 at 8:44 AM, Paddy Byers paddy.by...@gmail.com wrote:
 Hi,

 I *conceptually* want to do this ...

   npm install wonder-app
   node wonder-app

 In other words I want to distribute the complete app ready to run via npm.
  What is the easiest way to do this?


 What about:

 npm install wonder-app
 node --eval require('wonder-app')()

 ?

 Paddy

 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en



-- 
Oliver Leics @ G+
https://plus.google.com/112912441146721682527

-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] running npm project as node program

2012-04-23 Thread Mark Hahn
Thx.  Your suggestions make it easy.

On Mon, Apr 23, 2012 at 12:18 AM, Oliver Leics oliver.le...@gmail.comwrote:

 Have a look at
 http://npmjs.org/doc/json.html#bin
 and then:

  npm install -g wonder-app
  wonder-app

 On Mon, Apr 23, 2012 at 8:44 AM, Paddy Byers paddy.by...@gmail.com
 wrote:
  Hi,
 
  I *conceptually* want to do this ...
 
npm install wonder-app
node wonder-app
 
  In other words I want to distribute the complete app ready to run via
 npm.
   What is the easiest way to do this?
 
 
  What about:
 
  npm install wonder-app
  node --eval require('wonder-app')()
 
  ?
 
  Paddy
 
  --
  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 group.
  To post to this group, send email to nodejs@googlegroups.com
  To unsubscribe from this group, send email to
  nodejs+unsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/nodejs?hl=en?hl=en



 --
 Oliver Leics @ G+
 https://plus.google.com/112912441146721682527

 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en


-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: Examples of C++ modules, for Node.js

2012-04-23 Thread rhasson
I found out that I needed to set up my LD_LIBRARY_PATH env variable 
otherwise it will not find the path to the shared library.  set it up like 
this:  export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/hdf5/lib

Then rebuild the project.  Once rebuilt type: ldd build/Release/hdf5.node 
(or whatever your module name is) and see if your HDF5 shared library you 
trying to link to is listed. If not than it didn't link correctly.

Roy

On Monday, April 23, 2012 12:57:44 AM UTC-4, Ryan Cole wrote:

 I have adjusted the binding.gyp file to include the linker settings 
 required for including the HDF5 libs I need. I believe that the current gyp 
 file mirrors a Makefile that I am able to get working, for HDF5's stand 
 alone compile. The only difference is that you're supposed to run the HDF5 
 Makefile with this custom binary, h5c++, that I think does some additional 
 build configurations for you.

 I only see two options here, I think. One option would be to compile this 
 node lib using that h5c++ binary. The other option would be to figure out 
 what that h5c++ binary does, and reproduce it within the binding.gyp file.

 Currently, using this binding.gyp file, my node lib will compile and I 
 assume it also links with hdf5 lib now. (
 https://github.com/ryancole/node-hdf5/blob/master/binding.gyp) I have 
 updated to a node version 0.7+, and can see the error message when I try to 
 require my node lib, now. It looks like this:

 ryan@ryan-server:~/repos/node-hdf5$ node

  require('./build/Release/hdf5')

 Error: libhdf5.so.7: cannot open shared object file: No such file or 
 directory

 at Object..node (module.js:475:11)

 at Module.load (module.js:351:32)

 at Function._load (module.js:309:12)

 at Module.require (module.js:357:17)

 at require (module.js:373:17)

 at repl:1:2

 at REPLServer.eval (repl.js:110:21)

 at Interface.anonymous (repl.js:249:12)

 at Interface.emit (events.js:87:17)

 at Interface._onLine (readline.js:178:10)


 That's with my .gyp file as-is. When I try to run this command, node-gyp 
 build CXX=/path/to/h5c++, I get an error saying that I need to try again 
 using the -fPIC parameter. No matter where I specify that parameter, it 
 just seems to tell me to try again using -fPIC. I think I may be heading 
 down the wrong path with that -fPIC, though.

 Anyway, just wanted to document my leaving-off-spot so that I can pick up 
 with it tomorrow. Also, so that if anybody has any suggestions they could 
 share them too! :)

 Thanks all,
 Ryan


-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs]will kilos setTimeout spend too much resourece?

2012-04-23 Thread jason . 桂林
Oh cool! and I found

setTimeout(console.log, 1000, 'hello world')

is much better than

setTimeout(function(){
   console.log('hello world');
}, 1000)

在 2012年4月23日 下午2:32,Joran Greef jo...@ronomon.com写道:

 If you pass a function reference to an existing function to setTimeout,
 and then call this function repeatedly, rather than creating a closure each
 setTimeout call, that will lower your memory and cpu overhead substantially.


 On Monday, April 23, 2012 7:49:08 AM UTC+2, Jason.桂林 wrote:

 I need to write a service use something like in memory cache, and I want
 to do `expire` things in setTimeout, will it very slow, If I expire too
 much things, about kilos to millions.

 --
 Best regards,

 Jason Green
 桂林


  --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en




-- 
Best regards,

Jason Green
桂林

-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: Node.js server GET to separate API failing after a few hours of use

2012-04-23 Thread henry.oswald
For a little more clarity the mongo call never fails. There is actually 
logging around it as now shown below which is always hit.

var Request = require('request');
downloadPDF : function(req, res) {
  Project.findById(req.params.Project_id, function(err, project) {
project.findDoc(req.params.doc_id ,function(err, doc) {
  var pdfileName = doc.name + .pdf;
  res.contentType(pdfileName);
  res.header('Content-Disposition', filename= + pdfileName);

  console.log(sending request for +project._id);
  Request(http://localhost:3001/; + project._id).pipe(res);
});
  });
}


On Saturday, 21 April 2012 10:58:15 UTC+1, henry.oswald wrote:

 In my node site I call a restful API service I have built using a standard 
 http get. After a few hours of this communication successfully working I 
 find that the request stops being sent, it just waits and eventually times 
 out.

 The API that is being called is still receiving requests from elsewhere 
 perfectly well but when a request is sent from the site it does not reach 
 the API.

 The data being sent is a pdf of between 1 and 10 pages. I have tried with 
 stream.pipe, util.pump and just writing the file to the file system.

 I am using Node 0.6.15. My site and the service that is being called are 
 on the same server so calls to localhost are being made. Memory usage is 
 about 25% over all with cpu averaging about 10% usage.

 After a while of the problem I started using the 
 requesthttps://github.com/mikeal/request module 
 but I get the same behaviour. The number of calls it makes before failing 
 varies it seems between 5 to 100. In the end I have to restart the site 
 but not the api to make it work again.

 Here is roughly what the code in the site looks like:

 var Request = require('request');
 downloadPDF: function(req, res) {
   Project.findById(req.params.Project_id, function(err, project) {
 project.findDoc(req.params.doc_id ,function(err, doc) {
   var pdfileName = doc.name + .pdf;
   res.contentType(pdfileName);
   res.header('Content-Disposition', filename= + pdfileName);
   Request(http://localhost:3001/; + project._id).pipe(res);
 });
   });
 }

 I am loss at what could be happening.


-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] ender vs. browserify?

2012-04-23 Thread Dominic Tarr
you'd probably still need a bit on the server side, for validation. you
wouldn't want to give the browser direct access to your database for
example.

On Mon, Apr 23, 2012 at 6:10 PM, Mark Hahn m...@hahnca.com wrote:

 I am thinking of putting the entire app in a client-side browserify
 bundle.  I can create the entire BODY element of the dom from js code
 including the style info.  The idea here is to release an app by just
 releasing the bundle.

 I could create a generic index.html file that requires the bundle.

 I have one question though.  How/where would I store my image files?  I
 can imagine putting image files in package folders installed from npm but
 then how would I serve them?  I doubt I want the node_modules folder inside
 my web root folder.  :-)

  --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en


-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: How to gzipSync?

2012-04-23 Thread Axel Kittenberger
 npm install nosync

 require(nosync)
 fs.openSync(filename, r) // -- throws

Cool. Thats why I don't buy into the argument, the Sync versions of
the un/compress API would lead to people misusing it, since it can be
inhibited as easy as you showed us.

Although I do buy into the argument, it is hardly used/requested and
for  the amount of code to maintain it's not worth it and easy to
workaround with Asyncs rather than bloating the node core.

-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: ender vs. browserify?

2012-04-23 Thread Alexey Petrushin
Does browserify support Less/Stylus and Jade/Mustashe?

-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: Node.js server GET to separate API failing after a few hours of use

2012-04-23 Thread mscdex
On Apr 23, 5:47 am, henry.oswald henry.osw...@gmail.com wrote:
 For a little more clarity the mongo call never fails. There is actually
 logging around it as now shown below which is always hit.

Did you try replacing the use of Request() with a plain http.get call?
That way you can add an 'error' listener and also check that it's not
something specific to the request module.

-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Node buffers stdin when it's a pipe - turn this off?

2012-04-23 Thread Adam Spragg
Hi there,

I'm currently working on a system that passes javascript commands to node.js 
through a pipe.

Node.js appears to buffer it's stdin under these circumstances, which is a 
problem as I'm wanting to send one command, wait a few seconds, send another, 
wait a bit more, send the next, etc... - but I want the first command to be 
executed as soon as it's received.

To reproduce:

  $ cat | node
  setTimeout(function() { console.log('testing'); }, 1);
  console.log('start');
  ^D
  start
  testing
  $ 

I can pause for as long as I like between the console.log(...) line and 
hitting ^D, but the 'start' never comes up until I do, and 'testing' doesn't 
appear until 10 seconds after that.

Is there a command line switch I can use to get it to turn this buffering off? 
If not, where might I start looking through the code to patch my local copy 
myself? I found what looks like the main event loop 
uv_run(uv_default_loop()); in node.cc:Node::Start(), but can't figure out 
where to look next from there.


Thanks,

Adam Spragg

-- 
Adam Spragg adam.spr...@octaltelecom.co.uk
Developer
Octal Telecom http://www.octaltelecom.co.uk/


It reverses the logical flow of conversation!
 Why?
  No.
   Should I top post?
http://www.google.com/search?q=%22top+posting%22

-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Opinions on self hosting stacks for Node apps

2012-04-23 Thread Jeremy Darling
Sorry for the late reply to everyone was at the track with my Kids all
weekend racing so now to play catchup :).

I probably didn't word that very well at all. I was saying that since each
instance of Node will run in a separate process that the # of cores matters
more than processor speed from what I have seen.  Now I will say that we
have our code separated into service families with each family running in a
different instance of node and communicating either over IPC (local), TCP
(in network remote), and REST over HTTP (public remote) for RPC.  (on
second read that seems more complex LOL)

We have matched down our stack per machine to 2 node processes per core +1
(each) for OS and MongoDB usage.  Nearness is used to decide what gets
turned on on each stack (everything gets deployed but machines don't run
the full stack), so two families that are likely to call between each other
(hopefully one high load and one low) are placed on the same physical
machine.  Things that don't call one another are placed on completely
separate machines.  Replication is handled by MongoDB.

When we placed it all on one single machine (I have to admit its a VM in
a service center and I have no idea what it is) having the same # of
cores, RAM, etc the server actually ran slower than when it was balanced
across multiple smaller machines totaling the same specifications (# of
cores and RAM).

Thinking about this (and going back some years so my info is dated) this
makes perfect sense as you should be lowering the task switch (even if it
is pico seconds per switch) and there is no need to balance across multiple
processors since in the case of i series processors the cores are on the
same silicon pointing at the same IO Bus.  In the server I'm guessing (4x4,
4x8, or 8x8) that we are running into the VM load balancing across the
processors thus causing more latency than we experience on the multiple
machines config.  Course I could be wrong :)

But, I digress, what I'm really interested in is what others
experiences have been with hardware setups and hosting?

 - Jeremy

On Fri, Apr 20, 2012 at 12:04 PM, Tim Caswell t...@creationix.com wrote:

 Jeremy, are you saying that 3 node processes on three dedicated machines
 is faster than one node process on one beefy machine?

 If you want to use all n cores on a machine you need n node processes on
 that machine.  And yes, node is mostly single threaded.  Some things like
 fs.* and zlib.* use a thread-pool so that they don't block the main thread,
 but your js code will always run in the main thread.


 On Fri, Apr 20, 2012 at 12:00 PM, Ryan Schmidt google-2...@ryandesign.com
  wrote:


 On Apr 20, 2012, at 07:40, Jeremy Darling wrote:

  Just curious what experiences others have had with hardware and hosting
 multi-process Node app stacks using MongoDB (or similar)?  So far my
 testing has shown that a cluster of smaller (3 - i5's with 8GB Ram and
 120GB SSD's) machines out performs a single massive server (4x4 with 64GB
 Ram and 120GB NAS fiber attached storage).  This isn't too surprising

 It is to me.. why would that be the case?

  since node basically allocates a single core per running process,

 What do you mean? I didn't think node allocates anything; I thought
 *you* allocate node processes by using cluster to start as many of them as
 is appropriate for the size of your server.


 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en


  --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en


-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Node buffers stdin when it's a pipe - turn this off?

2012-04-23 Thread Ben Noordhuis
On Mon, Apr 23, 2012 at 12:34, Adam Spragg
adam.spr...@octaltelecom.co.uk wrote:
 I'm currently working on a system that passes javascript commands to node.js
 through a pipe.

 Node.js appears to buffer it's stdin under these circumstances, which is a
 problem as I'm wanting to send one command, wait a few seconds, send another,
 wait a bit more, send the next, etc... - but I want the first command to be
 executed as soon as it's received.

 To reproduce:

  $ cat | node
  setTimeout(function() { console.log('testing'); }, 1);
  console.log('start');
  ^D
  start
  testing
  $

 I can pause for as long as I like between the console.log(...) line and
 hitting ^D, but the 'start' never comes up until I do, and 'testing' doesn't
 appear until 10 seconds after that.

 Is there a command line switch I can use to get it to turn this buffering off?
 If not, where might I start looking through the code to patch my local copy
 myself? I found what looks like the main event loop
 uv_run(uv_default_loop()); in node.cc:Node::Start(), but can't figure out
 where to look next from there.

Look for the _normalWrite() method in lib/readline.js

-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Node buffers stdin when it's a pipe - turn this off?

2012-04-23 Thread Nathan Rajlich
Basically what is happening is node is expecting you to be piping an entire
file into stdin, so it does indeed buffer and wait for EOF before executing
the script passed in from stdin.

But it sounds like maybe your're expecting to enter the REPL in this case,
and enter commands one-at-a-time? I'm node v0.7.7 the -i flag was added
to make this case work. So with node v0.7.7 or above:

  $ cat | node -i

But this buffering behavior in general doesn't happen, it's only because
you were attempting to pipe a script into node with no script file to run
itself, so it waits for a script from stdin and executes that. If you try
the same thing again with a simple script (test.js):

  process.stdin.setEncoding('utf8')
  process.stdin.resume()
  process.stdin.on('data', function (command) {
console.log('got command: %s', command.trim())
  })

and run it:

  $ cat | node test.js

Then you can enter commands one-line-at-a-time.


On Mon, Apr 23, 2012 at 3:34 AM, Adam Spragg adam.spr...@octaltelecom.co.uk
 wrote:

 Hi there,

 I'm currently working on a system that passes javascript commands to
 node.js
 through a pipe.

 Node.js appears to buffer it's stdin under these circumstances, which is a
 problem as I'm wanting to send one command, wait a few seconds, send
 another,
 wait a bit more, send the next, etc... - but I want the first command to be
 executed as soon as it's received.

 To reproduce:

  $ cat | node
  setTimeout(function() { console.log('testing'); }, 1);
  console.log('start');
  ^D
  start
  testing
  $

 I can pause for as long as I like between the console.log(...) line and
 hitting ^D, but the 'start' never comes up until I do, and 'testing'
 doesn't
 appear until 10 seconds after that.

 Is there a command line switch I can use to get it to turn this buffering
 off?
 If not, where might I start looking through the code to patch my local copy
 myself? I found what looks like the main event loop
 uv_run(uv_default_loop()); in node.cc:Node::Start(), but can't figure out
 where to look next from there.


 Thanks,

 Adam Spragg

 --
 Adam Spragg adam.spr...@octaltelecom.co.uk
 Developer
 Octal Telecom http://www.octaltelecom.co.uk/


 It reverses the logical flow of conversation!
  Why?
   No.
Should I top post?
 http://www.google.com/search?q=%22top+posting%22

 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en


-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: Examples of C++ modules, for Node.js

2012-04-23 Thread Ryan Cole
Roy,

I notice you mentioned this early in the email chain. I should have tried 
it earlier. It fixes the issue. I wonder why the ldflags in binding.gyp 
does not properly set this up, in my case? Or, is LD_LIBRARY_PATH just 
another required step no matter what? Also, I did not know about the ldd 
command - very handy!

Thanks,
Ryan

On Monday, April 23, 2012 3:29:38 AM UTC-5, rhasson wrote:

 I found out that I needed to set up my LD_LIBRARY_PATH env variable 
 otherwise it will not find the path to the shared library.  set it up like 
 this:  export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/hdf5/lib

 Then rebuild the project.  Once rebuilt type: ldd build/Release/hdf5.node 
 (or whatever your module name is) and see if your HDF5 shared library you 
 trying to link to is listed. If not than it didn't link correctly.

 Roy


-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: Node buffers stdin when it's a pipe - turn this off?

2012-04-23 Thread Adam
Hi Nathan,

On Apr 23, 4:07 pm, Nathan Rajlich nat...@tootallnate.net wrote:
 But it sounds like maybe your're expecting to enter the REPL in this case,
 and enter commands one-at-a-time?

I have a program occasionally piping commands, one-at-a-time, into
node's stdin which I want to be executed as soon as possible. Like in
the REPL. The commands need to be executed in the same node instance,
as they share state, so I can't just close the pipe and start a new
node for subsequent commands. I don't need the REPL prompt, but it
won't do any harm.

 I'm node v0.7.7 the -i flag was added
 to make this case work. So with node v0.7.7 or above:

   $ cat | node -i

I think that sounds like what I need. But... that's the unstable
branch. Do you have any experience with that? How unstable is it? Is
it likely to crash on me or cause other problems?

 But this buffering behavior in general doesn't happen, it's only because
 you were attempting to pipe a script into node with no script file to run
 itself, so it waits for a script from stdin and executes that. If you try
 the same thing again with a simple script (test.js):

   process.stdin.setEncoding('utf8')
   process.stdin.resume()
   process.stdin.on('data', function (command) {
     console.log('got command: %s', command.trim())
   })

 and run it:

   $ cat | node test.js

So I could just change the console.log() to an eval() in that test.js
and that should work.

OK, thanks.

Adam

-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: Writing to closed connection = Boom!

2012-04-23 Thread steven loe
 I missed the 'writable' property. That's a big help.

Thanks very much for your help!


 What about listening for the 'error' event and/or checking if the
 'writable' property of the socket is set to false?




-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Your thoughts wanted on a node AI project

2012-04-23 Thread Dennis Kane
The site is powered by an express server, which exec's a separate node AI 
process for each new IP address.  Each process will automatically end after 
10 minutes of inactivity.  You can interface with the process either 
through a browser at ai.webcyte.net or by sending a URL encoded GET request 
to http://ai.webcyte.net/send.  So, the comand line for the phrase, there 
is a boy named joe using curl will look like:

$ curl http://ai.webcyte.net/send/there%20is%20a%20boy%20named%20joe

Detailed instructions can be found at ai.webcyte.net.

This project is currently meant to be a prototype in order to build 
interest in developing a robust AI system that just works (read: NOT 
another chatterbot!).  It can possibly be used as the intelligent backend 
to a Siri-like voice interface in the not too distant future.

I am interested in getting in touch with academic/research types as well as 
business types.

Will probably want to develop an open source version for non-business 
purposes that can be used on the client side (eventually) and keep the 
supported commercial version well hidden from prying eyes on the server 
side.

Thoughts?

-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Your thoughts wanted on a node AI project

2012-04-23 Thread Ted Young
Really nifty.  It would be fun to play with.  One way to do it would be to open 
source the AI engine, but keep the large scale hosting and support architecture 
hidden.  That way academics and users with other needs could play with it and 
contribute.

Ted

On Apr 23, 2012, at 10:50 AM, Dennis Kane wrote:

 The site is powered by an express server, which exec's a separate node AI 
 process for each new IP address.  Each process will automatically end after 
 10 minutes of inactivity.  You can interface with the process either through 
 a browser at ai.webcyte.net or by sending a URL encoded GET request to 
 http://ai.webcyte.net/send.  So, the comand line for the phrase, there is a 
 boy named joe using curl will look like:
 
 $ curl http://ai.webcyte.net/send/there%20is%20a%20boy%20named%20joe
 
 Detailed instructions can be found at ai.webcyte.net.
 
 This project is currently meant to be a prototype in order to build interest 
 in developing a robust AI system that just works (read: NOT another 
 chatterbot!).  It can possibly be used as the intelligent backend to a 
 Siri-like voice interface in the not too distant future.
 
 I am interested in getting in touch with academic/research types as well as 
 business types.
 
 Will probably want to develop an open source version for non-business 
 purposes that can be used on the client side (eventually) and keep the 
 supported commercial version well hidden from prying eyes on the server side.
 
 Thoughts?
 
 -- 
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: errors when using node-gyp to build

2012-04-23 Thread mscdex
On Apr 23, 1:45 pm, SteveCronin steve.d.cro...@gmail.com wrote:
 Can someone help me figure out what is going on with this invocation of
 node-gyp?
 Where do I go for more information?

What are you trying to build with node-gyp? Why is sudo needed?

-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: An interactive console.dir() for the terminal/nodejs.

2012-04-23 Thread Roly Fentanes
this is really cool.

On Monday, April 23, 2012 1:39:44 PM UTC-7, hij1nx wrote:

 https://github.com/hij1nx/cdir

 Usage: `console.dir = require('cdir'); console.dir(object);`

 https://github.com/hij1nx/cdir/raw/master/screenshot.png



-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Node Philly is Live

2012-04-23 Thread Nuno Job
If you guys are curious about what is happening in Philly, and want to
see the talks, the event is being live streamed:

http://node.ph

Nuno

-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: errors when using node-gyp to build

2012-04-23 Thread Nathan Rajlich
If you're behing a corporate proxy, then will have to set the PROXY
environment variable, or set the --proxy switch to your the address of your
proxy server.

On Mon, Apr 23, 2012 at 2:13 PM, Ryan Cole r...@rycole.com wrote:

 According to the node-gyp read me file, node-gyp will download required
 files. It looks to me like that download is failing for you.

 Ryan


 On Monday, April 23, 2012 12:45:22 PM UTC-5, SteveCronin wrote:

 Can someone help me figure out what is going on with this invocation of
 node-gyp?
 Where do I go for more information?

 node-gyp@0.4.1  /usr/local/lib/node_modules/**node-gyp

 hsd-test-iMac-1073:XYZApp admin$ node --version
 v0.6.15
 hsd-test-iMac-1073:XYZApp admin$ which node
 /usr/local/bin/node

 hsd-test-iMac-1073:XYZApp admin$ sudo node-gyp -v configure build
 Password:
 info it worked if it ends with ok
 verb command 'configure' []
 verb `which` succeeded for `python` '/usr/bin/python'
 verb no --target version specified, falling back to host node version
 'v0.6.15'
 verb command 'install' [ 'v0.6.15' ]
 verb input version string 'v0.6.15'
 verb installing legacy version? true
 verb installing version '0.6.15'
 verb --ensure was passed, so won't reinstall if already installed
 verb version not already installed, continuing with install '0.6.15'
 verb created: '/Users/admin/.node-gyp/0.6.**15'
 info downloading: 
 http://nodejs.org/dist/v0.6.**15/node-v0.6.15.tar.gzhttp://nodejs.org/dist/v0.6.15/node-v0.6.15.tar.gz

 verb got an error, rolling back install
 verb command 'remove' [ '0.6.15' ]
 verb using node-gyp dir '/Users/admin/.node-gyp'
 verb removing development files for version '0.6.15'
 ERR! Error: connect ETIMEDOUT
at errnoException (net.js:670:11)
at Object.afterConnect [as oncomplete] (net.js:661:19)
 ERR! not ok
 hsd-test-iMac-1073:XYZApp admin$

  --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en


-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: An interactive console.dir() for the terminal/nodejs.

2012-04-23 Thread Nathan Rajlich
Someone make a codestream http://codestre.am showing it in use!!!

On Mon, Apr 23, 2012 at 2:18 PM, Roly Fentanes roly...@gmail.com wrote:

 this is really cool.


 On Monday, April 23, 2012 1:39:44 PM UTC-7, hij1nx wrote:

 https://github.com/hij1nx/cdir

 Usage: `console.dir = require('cdir'); console.dir(object);`

 https://github.com/hij1nx/cdir/raw/master/screenshot.png

  --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en


-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: how do you trace the stack on a stack overflow?

2012-04-23 Thread mscdex
On Apr 23, 4:37 pm, Mark Hahn m...@hahnca.com wrote:
 Never mind.  I found some old threads explaining that this is impossible.
  I'm trying long-threads and trycatch now but I'm not having any luck.

Maybe the domains feature that landed recently in 0.7.x might help?:
http://nodejs.org/docs/v0.7.8/api/domain.html

-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: how do you trace the stack on a stack overflow?

2012-04-23 Thread Mark Hahn
cool -- i'll give it a try  -- didn't know they were out in the wild yet.

On Mon, Apr 23, 2012 at 3:57 PM, mscdex msc...@gmail.com wrote:

 On Apr 23, 4:37 pm, Mark Hahn m...@hahnca.com wrote:
  Never mind.  I found some old threads explaining that this is impossible.
   I'm trying long-threads and trycatch now but I'm not having any luck.

 Maybe the domains feature that landed recently in 0.7.x might help?:
 http://nodejs.org/docs/v0.7.8/api/domain.html

 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en


-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Deploy to staging without pain: announcing stagecoach

2012-04-23 Thread Tom Boutell


Stagecoach is a framework for deploying node.js web applications and 
testing them on a staging server. It includes a complete mechanism for 
running many such node applications on a single staging server, restarting 
them gracefully on reboot, and accessing them at nice URLs without port 
numbers.

Stagecoach also includes sc-deploy, a minimalist deployment tool based on 
rsync that understands multiple deployment targets and makes pretty much no 
assumptions about your project. It is suitable for pretty much any site or 
web app, although the examples provided are node-oriented.

sc-proxy is a node.js-based frontend proxy server solution for web apps 
that listen on independent ports. It's very simple thanks to the nodejitsu 
folks and node-http-proxy. It's great for testing lots of node projects on 
the same staging server while giving them all reasonable hostnames and 
allowing them to respond on port 80 as subdomains. It will soon also be 
suitable for deploying several apps to a production server.

Stagecoach uses 'node-http-proxy' and 'forever' by Nodejitsu and also 
provides an Upstart script for stopping and starting the whole shebang on 
Ubuntu servers. 

You can find it here: 

https://github.com/punkave/stagecoach

Feedback is very welcome!


-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] ender vs. browserify?

2012-04-23 Thread Azer Koçulu
On Sun, Apr 22, 2012 at 9:11 PM, Dominic Tarr dominic.t...@gmail.com wrote:
 browserify has _by far_ the most test coverage. I know from my own dabbling
 in the problem that there are _alot_ of edgecases.

I confidently say that OneJS is a well-tested project that faced
_more_ edge-cases already and solved those issues. And I think
browserify has some issues which can't be considered as edge-cases,
e.g; polluting global scope, a lot.

To have an idea of the accuracy of OneJS, check the following examples;
- MultiplayerChess.com built with OneJS: http://multiplayerchess.com/mpc.js
- ExpressJS built with OneJS: https://gist.github.com/2415048

ExpressJS is not a client-side project but it's a good example project
to see the accuracy of the implementations of CommonJS specs. And I
get following error when I try to build it with browserify;

 ./node_modules/.bin/browserify index.js -o express.js
Expressions in require() statements:
require(./middleware/+name)
Expressions in require() statements:
require(this.engine)
SyntaxError: 'return' outside of function
  at line 22:32 in expression:

  if (res._hasConnectPatch) return;
at 
/home/azer/dev/express/node_modules/browserify/node_modules/deputy/node_modules/detective/node_modules/burrito/index.js:16:17
at 
/home/azer/dev/express/node_modules/browserify/node_modules/deputy/node_modules/detective/node_modules/burrito/index.js:41:11
at Function.find
(/home/azer/dev/express/node_modules/browserify/node_modules/deputy/node_modules/detective/index.js:15:5)
at Function.find
(/home/azer/dev/express/node_modules/browserify/node_modules/deputy/index.js:38:27)
at Function.anonymous
(/home/azer/dev/express/node_modules/browserify/lib/wrap.js:435:39)
at Function.require
(/home/azer/dev/express/node_modules/browserify/index.js:155:28)
at /home/azer/dev/express/node_modules/browserify/lib/wrap.js:458:14
at Array.forEach (native)
at Function.anonymous
(/home/azer/dev/express/node_modules/browserify/lib/wrap.js:457:27)
at Function.require
(/home/azer/dev/express/node_modules/browserify/index.js:155:28)



Best,

Azer


 https://github.com/substack/node-browserify/tree/master/test

 I just use browserify now


 On Mon, Apr 23, 2012 at 6:07 AM, Mark Hahn m...@hahnca.com wrote:

   OneJS moves the revolution of NPM one step forward and makes it
  available for client-side projects!

 Does this mean you can load a module directly from the npm registry into
 the client to run? Can you also query the registry?

 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en


 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] ender vs. browserify?

2012-04-23 Thread Dominic Tarr
oh right, that is because you are listing a directory and then requiring
each item automatically.

how does onejs handle that case?

you are right about browserify poluting the global namespace. it should
define it's stuff inside a closure.

On Tue, Apr 24, 2012 at 12:11 PM, Azer Koçulu a...@kodfabrik.com wrote:

 On Sun, Apr 22, 2012 at 9:11 PM, Dominic Tarr dominic.t...@gmail.com
 wrote:
  browserify has _by far_ the most test coverage. I know from my own
 dabbling
  in the problem that there are _alot_ of edgecases.

 I confidently say that OneJS is a well-tested project that faced
 _more_ edge-cases already and solved those issues. And I think
 browserify has some issues which can't be considered as edge-cases,
 e.g; polluting global scope, a lot.

 To have an idea of the accuracy of OneJS, check the following examples;
 - MultiplayerChess.com built with OneJS:
 http://multiplayerchess.com/mpc.js
 - ExpressJS built with OneJS: https://gist.github.com/2415048

 ExpressJS is not a client-side project but it's a good example project
 to see the accuracy of the implementations of CommonJS specs. And I
 get following error when I try to build it with browserify;

  ./node_modules/.bin/browserify index.js -o express.js
 Expressions in require() statements:
require(./middleware/+name)
 Expressions in require() statements:
require(this.engine)
 SyntaxError: 'return' outside of function
  at line 22:32 in expression:

  if (res._hasConnectPatch) return;
at
 /home/azer/dev/express/node_modules/browserify/node_modules/deputy/node_modules/detective/node_modules/burrito/index.js:16:17
at
 /home/azer/dev/express/node_modules/browserify/node_modules/deputy/node_modules/detective/node_modules/burrito/index.js:41:11
at Function.find

 (/home/azer/dev/express/node_modules/browserify/node_modules/deputy/node_modules/detective/index.js:15:5)
at Function.find

 (/home/azer/dev/express/node_modules/browserify/node_modules/deputy/index.js:38:27)
at Function.anonymous
 (/home/azer/dev/express/node_modules/browserify/lib/wrap.js:435:39)
at Function.require
 (/home/azer/dev/express/node_modules/browserify/index.js:155:28)
at /home/azer/dev/express/node_modules/browserify/lib/wrap.js:458:14
at Array.forEach (native)
at Function.anonymous
 (/home/azer/dev/express/node_modules/browserify/lib/wrap.js:457:27)
at Function.require
 (/home/azer/dev/express/node_modules/browserify/index.js:155:28)



 Best,

 Azer

 
  https://github.com/substack/node-browserify/tree/master/test
 
  I just use browserify now
 
 
  On Mon, Apr 23, 2012 at 6:07 AM, Mark Hahn m...@hahnca.com wrote:
 
OneJS moves the revolution of NPM one step forward and makes it
   available for client-side projects!
 
  Does this mean you can load a module directly from the npm registry into
  the client to run? Can you also query the registry?
 
  --
  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 group.
  To post to this group, send email to nodejs@googlegroups.com
  To unsubscribe from this group, send email to
  nodejs+unsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/nodejs?hl=en?hl=en
 
 
  --
  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 group.
  To post to this group, send email to nodejs@googlegroups.com
  To unsubscribe from this group, send email to
  nodejs+unsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/nodejs?hl=en?hl=en

 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en


-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Wrapping a C++ object, and adding properties directly onto args.This() = incorrect?

2012-04-23 Thread Ryan Cole
I'm wrapping a C++ object and then appending some properties. I'm calling 
Wrap(), and then Set()'ing the properties directly onto args.This(). This 
does not look or feel right to me, so I'm inclined to think I'm doing it 
wrong. I'm so new to this that none of the examples are standing out to me 
as the proper way of doing this.

Can someone please take a peek at the highlighted lines of my code and give 
me a few pointers? Namely, am I doing this incorrectly?

https://github.com/ryancole/node-hdf5/blob/master/src/node_h5file.cc#L67-74

Thanks,
Ryan

-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Wrapping a C++ object, and adding properties directly onto args.This() = incorrect?

2012-04-23 Thread Ben Noordhuis
On Tue, Apr 24, 2012 at 02:54, Ryan Cole r...@rycole.com wrote:
 I'm wrapping a C++ object and then appending some properties. I'm calling
 Wrap(), and then Set()'ing the properties directly onto args.This(). This
 does not look or feel right to me, so I'm inclined to think I'm doing it
 wrong. I'm so new to this that none of the examples are standing out to me
 as the proper way of doing this.

 Can someone please take a peek at the highlighted lines of my code and give
 me a few pointers? Namely, am I doing this incorrectly?

 https://github.com/ryancole/node-hdf5/blob/master/src/node_h5file.cc#L67-74

There's nothing really wrong with that approach. If the properties are
subject to change, you could use ObjectTemplate::SetAccessor()
instead.

-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Wrapping a C++ object, and adding properties directly onto args.This() = incorrect?

2012-04-23 Thread Stewart Mckinney
The reason why you use args.This() instead of creating an empty
ValueObject and appending keys to that is partially due to the way the
new operator works in JavaScript when called with a function and
operating in accordance with that when faking JS object creation via C++
functions. Roughly speaking, it does the following (in order):

1) First creates an empty object
2) Sets the new objects hidden prototype field to the function's
prototype member, if there is one. (interpret this loosely, changes
slightly from interpreter to interpreter, but essentially this is what
happens )
3) Sets this to the empty object, and then calls the function body
(making any changes to this happen to the empty object)

The interesting part comes in when you consider the way in which
v8 implements callbacks: you want the callback function to behave like
Normal JS, but v8 function callbacks don't work in quite way you might
expect. You might expect, for instance, that Set would overwrite any
function
present within the object, and that overriding a function declared with
Set would simply get rid of the callback.

From what I believe, the first is true, but I know for sure the second is
not. If you overwrite a function within JS, the overriding function will be
called *before* your function callback, but both will be called. However,
your C++ callback will be the function that actually returns a value. So
in order
to preserve any changes made to this during the callback, you extend
args.This(), and do not simply create a new Object (unless this is what you
desire).

Hope that helps,
Stew


On Mon, Apr 23, 2012 at 9:37 PM, Ben Noordhuis i...@bnoordhuis.nl wrote:

 On Tue, Apr 24, 2012 at 02:54, Ryan Cole r...@rycole.com wrote:
  I'm wrapping a C++ object and then appending some properties. I'm calling
  Wrap(), and then Set()'ing the properties directly onto args.This(). This
  does not look or feel right to me, so I'm inclined to think I'm doing it
  wrong. I'm so new to this that none of the examples are standing out to
 me
  as the proper way of doing this.
 
  Can someone please take a peek at the highlighted lines of my code and
 give
  me a few pointers? Namely, am I doing this incorrectly?
 
 
 https://github.com/ryancole/node-hdf5/blob/master/src/node_h5file.cc#L67-74

 There's nothing really wrong with that approach. If the properties are
 subject to change, you could use ObjectTemplate::SetAccessor()
 instead.

 --
 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 group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en


-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: Examples of C++ modules, for Node.js

2012-04-23 Thread rhasson
I'm using node-gyp and ldflags didn't work for me either.  Maybe Nathan has 
an idea, but I found out that I needed to set the LD_LIBRARY_PATH otherwise 
my shared library wouldn't link.

On Monday, April 23, 2012 11:21:06 AM UTC-4, Ryan Cole wrote:

 Roy,

 I notice you mentioned this early in the email chain. I should have tried 
 it earlier. It fixes the issue. I wonder why the ldflags in binding.gyp 
 does not properly set this up, in my case? Or, is LD_LIBRARY_PATH just 
 another required step no matter what? Also, I did not know about the ldd 
 command - very handy!

 Thanks,
 Ryan

 On Monday, April 23, 2012 3:29:38 AM UTC-5, rhasson wrote:

 I found out that I needed to set up my LD_LIBRARY_PATH env variable 
 otherwise it will not find the path to the shared library.  set it up like 
 this:  export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/hdf5/lib

 Then rebuild the project.  Once rebuilt type: ldd build/Release/hdf5.node 
 (or whatever your module name is) and see if your HDF5 shared library you 
 trying to link to is listed. If not than it didn't link correctly.

 Roy



-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: Examples of C++ modules, for Node.js

2012-04-23 Thread Ben Noordhuis
On Tue, Apr 24, 2012 at 04:46, rhasson rhas...@gmail.com wrote:
 I'm using node-gyp and ldflags didn't work for me either.  Maybe Nathan has
 an idea, but I found out that I needed to set the LD_LIBRARY_PATH otherwise
 my shared library wouldn't link.

The ldflags setting is what is passed to the linker at the time of
compilation. LD_LIBRARY_PATH affects the search path of the dynamic
linker, which is what is run when a program starts up.

What I mean to say is that a linker is not the same thing as a dynamic
linker (though they're related) and that gyp is only involved in the
compilation phase.

-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: Examples of C++ modules, for Node.js

2012-04-23 Thread rhasson
ok that makes sense.  So the question is, once gyp compiled and the linker 
linked the shared library into the .node module using ldflags.  How do you 
require the module without needing to set the LD_LIBRARY_PATH ?

Now if I set the LD_LIBRARY_PATH I can require the module and it works. 
 But if I don't set it, require fails saying it can't find the shared 
library.

Roy

On Monday, April 23, 2012 11:03:15 PM UTC-4, Ben Noordhuis wrote:

 On Tue, Apr 24, 2012 at 04:46, rhasson  wrote:
  I'm using node-gyp and ldflags didn't work for me either.  Maybe Nathan 
 has
  an idea, but I found out that I needed to set the LD_LIBRARY_PATH 
 otherwise
  my shared library wouldn't link.

 The ldflags setting is what is passed to the linker at the time of
 compilation. LD_LIBRARY_PATH affects the search path of the dynamic
 linker, which is what is run when a program starts up.

 What I mean to say is that a linker is not the same thing as a dynamic
 linker (though they're related) and that gyp is only involved in the
 compilation phase.



-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: Examples of C++ modules, for Node.js

2012-04-23 Thread Ben Noordhuis
On Tue, Apr 24, 2012 at 05:23, rhasson rhas...@gmail.com wrote:
 ok that makes sense.  So the question is, once gyp compiled and the linker
 linked the shared library into the .node module using ldflags.  How do you
 require the module without needing to set the LD_LIBRARY_PATH ?

You don't*. The dynamic linker only searches in a set of blessed paths
unless you set LD_LIBRARY_PATH. You can dlopen() the .so and look up
symbols with dlsym() (but watch out for C++ name mangling).

* Okay, that's not entirely true. There are hacks like setting $ORIGIN
but not all linkers support that.

-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: Examples of C++ modules, for Node.js

2012-04-23 Thread rhasson
Ben, 

When I get rid of LD_LIBRARY_PATH and include the ldflags and libraries 
lines in by binding.gyp file the shared library is not linked as shown by 
ldd.  If I set the LD_LIBRARY_PATH then it links it correctly.

Is ldflags not parsed correctly? 

Here is my gyp file:

{
  'targets': [
{
  'target_name': 'freeling',
  'type': 'loadable_module',
  'product_extension': 'node',
  'product_prefix': '',
  'include_dirs': ['.','/home/roy/freeling/free3/include', 
'/home/roy/cvv8/include/cvv8'],
  'conditions': [
 ['OS==linux', {
  'link_settings': {
'ldflags': ['-L/home/roy/freeling/free3/lib/'],
'libraries': ['/home/roy/freeling/free3/lib/libfreeling.so']
},
 }],
   ],
  'sources': ['freeling.cc', 'freeling_tokenizer.cc', 
'freeling_splitter.cc', 'helper.cc'],
},
  ],
}



On Monday, April 23, 2012 11:03:15 PM UTC-4, Ben Noordhuis wrote:

 On Tue, Apr 24, 2012 at 04:46, rhasson  wrote:
  I'm using node-gyp and ldflags didn't work for me either.  Maybe Nathan 
 has
  an idea, but I found out that I needed to set the LD_LIBRARY_PATH 
 otherwise
  my shared library wouldn't link.

 The ldflags setting is what is passed to the linker at the time of
 compilation. LD_LIBRARY_PATH affects the search path of the dynamic
 linker, which is what is run when a program starts up.

 What I mean to say is that a linker is not the same thing as a dynamic
 linker (though they're related) and that gyp is only involved in the
 compilation phase.



-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: Examples of C++ modules, for Node.js

2012-04-23 Thread Ben Noordhuis
On Tue, Apr 24, 2012 at 05:45, rhasson rhas...@gmail.com wrote:
 Ben,

 When I get rid of LD_LIBRARY_PATH and include the ldflags and libraries
 lines in by binding.gyp file the shared library is not linked as shown by
 ldd.  If I set the LD_LIBRARY_PATH then it links it correctly.

 Is ldflags not parsed correctly?

 Here is my gyp file:

 {
   'targets': [
     {
       'target_name': 'freeling',
       'type': 'loadable_module',
       'product_extension': 'node',
       'product_prefix': '',
       'include_dirs': ['.','/home/roy/freeling/free3/include',
 '/home/roy/cvv8/include/cvv8'],
       'conditions': [
          ['OS==linux', {
           'link_settings': {
             'ldflags': ['-L/home/roy/freeling/free3/lib/'],
             'libraries': ['/home/roy/freeling/free3/lib/libfreeling.so']
             },
          }],
        ],
       'sources': ['freeling.cc', 'freeling_tokenizer.cc',
 'freeling_splitter.cc', 'helper.cc'],
     },
   ],
 }


You should set it like this:

  'link_settings': {
'ldflags': ['-L/home/roy/freeling/free3/lib/', '-lfreeling'],
  },

-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Re: Your thoughts wanted on a node AI project

2012-04-23 Thread Evan
That's great!

I am reminded of this blog [[ http://www.briangrinstead.com ]] which also 
has some neat AI algorithms written in JS.  He wrote them for the browser, 
but I can tell you his A* implementation 
[[ http://www.briangrinstead.com/blog/astar-search-algorithm-in-javascript 
]] works great in node :D

On Monday, April 23, 2012 10:50:25 AM UTC-7, denniskane wrote:

 The site is powered by an express server, which exec's a separate node AI 
 process for each new IP address.  Each process will automatically end after 
 10 minutes of inactivity.  You can interface with the process either 
 through a browser at ai.webcyte.net or by sending a URL encoded GET 
 request to http://ai.webcyte.net/send.  So, the comand line for the 
 phrase, there is a boy named joe using curl will look like:

 $ curl http://ai.webcyte.net/send/there%20is%20a%20boy%20named%20joe

 Detailed instructions can be found at ai.webcyte.net.

 This project is currently meant to be a prototype in order to build 
 interest in developing a robust AI system that just works (read: NOT 
 another chatterbot!).  It can possibly be used as the intelligent backend 
 to a Siri-like voice interface in the not too distant future.

 I am interested in getting in touch with academic/research types as well 
 as business types.

 Will probably want to develop an open source version for non-business 
 purposes that can be used on the client side (eventually) and keep the 
 supported commercial version well hidden from prying eyes on the server 
 side.

 Thoughts?


-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: Examples of C++ modules, for Node.js

2012-04-23 Thread rhasson
I found out that for Solaris ELF executables you can pass a 
-R/path/to/lib argument which will record the path and library name into 
the executable which will allow it to find it at runtime without needing to 
update the LD_LIBRARY_PATH.  Is there an equivalent argument for Linux?

On Monday, April 23, 2012 11:48:33 PM UTC-4, Ben Noordhuis wrote:

 On Tue, Apr 24, 2012 at 05:45, rhasson  wrote: 
  Ben, 
  
  When I get rid of LD_LIBRARY_PATH and include the ldflags and libraries 
  lines in by binding.gyp file the shared library is not linked as shown 
 by 
  ldd.  If I set the LD_LIBRARY_PATH then it links it correctly. 
  
  Is ldflags not parsed correctly? 
  
  Here is my gyp file: 
  
  { 
'targets': [ 
  { 
'target_name': 'freeling', 
'type': 'loadable_module', 
'product_extension': 'node', 
'product_prefix': '', 
'include_dirs': ['.','/home/roy/freeling/free3/include', 
  '/home/roy/cvv8/include/cvv8'], 
'conditions': [ 
   ['OS==linux', { 
'link_settings': { 
  'ldflags': ['-L/home/roy/freeling/free3/lib/'], 
  'libraries': ['/home/roy/freeling/free3/lib/libfreeling.so'] 
  }, 
   }], 
 ], 
'sources': ['freeling.cc', 'freeling_tokenizer.cc', 
  'freeling_splitter.cc', 'helper.cc'], 
  }, 
], 
  } 
  

 You should set it like this: 

   'link_settings': { 
 'ldflags': ['-L/home/roy/freeling/free3/lib/', '-lfreeling'], 
   }, 


-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: Examples of C++ modules, for Node.js

2012-04-23 Thread rhasson
I found out that for Solaris ELF executables you can pass a 
-R/path/to/lib argument which will record the path and library name into 
the executable which will allow it to find it at runtime without needing to 
update the LD_LIBRARY_PATH.  Is there an equivalent argument for Linux?

On Monday, April 23, 2012 11:48:33 PM UTC-4, Ben Noordhuis wrote:

 On Tue, Apr 24, 2012 at 05:45, rhasson  wrote: 
  Ben, 
  
  When I get rid of LD_LIBRARY_PATH and include the ldflags and libraries 
  lines in by binding.gyp file the shared library is not linked as shown 
 by 
  ldd.  If I set the LD_LIBRARY_PATH then it links it correctly. 
  
  Is ldflags not parsed correctly? 
  
  Here is my gyp file: 
  
  { 
'targets': [ 
  { 
'target_name': 'freeling', 
'type': 'loadable_module', 
'product_extension': 'node', 
'product_prefix': '', 
'include_dirs': ['.','/home/roy/freeling/free3/include', 
  '/home/roy/cvv8/include/cvv8'], 
'conditions': [ 
   ['OS==linux', { 
'link_settings': { 
  'ldflags': ['-L/home/roy/freeling/free3/lib/'], 
  'libraries': ['/home/roy/freeling/free3/lib/libfreeling.so'] 
  }, 
   }], 
 ], 
'sources': ['freeling.cc', 'freeling_tokenizer.cc', 
  'freeling_splitter.cc', 'helper.cc'], 
  }, 
], 
  } 
  

 You should set it like this: 

   'link_settings': { 
 'ldflags': ['-L/home/roy/freeling/free3/lib/', '-lfreeling'], 
   }, 


-- 
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Geddy Mailing List?

2012-04-23 Thread Matthew Hazlett
Does geddy have a mailing list?  I searched google groups but it says 
there wasn't one.


anyway

In the example application for geddy (todo list)...

I added a route for updating the data:
router.match('/todos/update').to({controller: 'todos', action: 'update'});

Then in the controller I have:
  this.update = function (req, resp, params) {
geddy.model.adapter.Todo.getID(params.id, function(todo){
  todo.title = params.title;
  todo.status= params.status;
}.bind(this));

this.redirect({controller: this.name});
  };

And it works, somehow the data gets updated. I'm not complaining I just 
don't see how,
I never 'save' the new data to the geddy.todo array, yet somehow it gets 
saved.


Is this a feature that just magically works?

--
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 group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en