Re: [nodejs] Best practices for handling persistent database connections

2012-12-07 Thread Jake Verbaten
I use one indirectly. I have a lazy mongo module https://github.com/Raynos/mongo-col that opens up one db connection and buffers all your database interactions until it's open. This gives the illusion that your database is open immediately. The nice thing is that you can just require it

Re: [nodejs] Best practices for handling persistent database connections

2012-12-07 Thread Jake Verbaten
What's wrong with parking database connections in a module? Most high level database libraries use a pool of connections internally and give you a simple API on top. They have effectively hidden the database connection in the module. On Thu, Dec 6, 2012 at 8:47 PM, Forrest L Norvell

[nodejs] nested exec, any best bractice

2012-12-07 Thread Mahmoud Adel Farid
i am using child process to download zip file extract it rename it and remove the archive this is the best i came up with http://pastebin.com/7TyJdA1e but when i decided to handle the exception i have imagined how hard it will be any recommendations -- Job Board: http://jobs.nodejs.org/

[nodejs] Creating file into C++ addon of node.js

2012-12-07 Thread Mayur
Hi.. I want to know how i can create file and append string(text) data inside it in c++ addon (.cc) file of node.js ?? I have used below code to do same, but not able to find file data.txt in my ubuntu machine. FILE * pFileTXT; pFileTXT = fopen (data.txt,a+); const char * c =

Re: [nodejs] Creating file into C++ addon of node.js

2012-12-07 Thread Ben Noordhuis
On Fri, Dec 7, 2012 at 1:03 PM, Mayur mayur.da...@avinashi.com wrote: Hi.. I want to know how i can create file and append string(text) data inside it in c++ addon (.cc) file of node.js ?? I have used below code to do same, but not able to find file data.txt in my ubuntu machine. FILE

Re: [nodejs] Creating file into C++ addon of node.js

2012-12-07 Thread Mayur Dabhi
Sorry Ben, May be i have posted the question at wrong place. Let's we will not look at code, may be it contains errors, but can you guide me on issue : it is possible to create file into c++ Addon for node.js module..?? On Fri, Dec 7, 2012 at 5:49 PM, Ben Noordhuis i...@bnoordhuis.nl wrote:

Re: [nodejs] Creating file into C++ addon of node.js

2012-12-07 Thread Ben Noordhuis
On Fri, Dec 7, 2012 at 2:01 PM, Mayur Dabhi mayur.da...@avinashi.com wrote: Sorry Ben, May be i have posted the question at wrong place. Let's we will not look at code, may be it contains errors, but can you guide me on issue : it is possible to create file into c++ Addon for node.js

[nodejs] Re: WebMatrix Database

2012-12-07 Thread Justin Beckwith
I'm guessing you started here: https://github.com/WindowsAzure/node-sqlserver And this gives a basic overview: http://blogs.msdn.com/b/sqlphp/archive/2012/06/08/introducing-the-microsoft-driver-for-node-js-for-sql-server.aspx Let me know if you need any help! On Friday, November 9, 2012 1:34:23

[nodejs] Running NodeJs inside JVM

2012-12-07 Thread prashant pandey
Hi All, I want to know has anyone tried to run NodeJs inside JVM? Or is there any specific approach we need to employ to get this done? -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message

[nodejs] Error: database names cannot contain the character '.'

2012-12-07 Thread man12
I am in the process of learning node.js and using mongoose for Mongodb. I am following an example from a tutorial to connect to hosted mongodb. I am getting the error message: 'database names cannot contain the character '.' Here is my code: //

Re: [nodejs] Running NodeJs inside JVM

2012-12-07 Thread Forrest L Norvell
On Fri, Dec 7, 2012 at 11:03 AM, prashant pandey prashant.pra...@gmail.comwrote: I want to know has anyone tried to run NodeJs inside JVM? Or is there any specific approach we need to employ to get this done? Since Node is only partly the JavaScript code of the standard library and

Re: [nodejs] Running NodeJs inside JVM

2012-12-07 Thread Ilya Dmitrichenko
Yeah, you should also checkout vert.x (http://vertx.io/) On 7 December 2012 21:57, Forrest L Norvell forr...@newrelic.com wrote: On Fri, Dec 7, 2012 at 11:03 AM, prashant pandey prashant.pra...@gmail.com wrote: I want to know has anyone tried to run NodeJs inside JVM? Or is there any

Re: [nodejs] Error: database names cannot contain the character '.'

2012-12-07 Thread Daniel Rinehart
Remove the space before the @ sign in your address variable. -- Daniel R. dani...@neophi.com [http://danielr.neophi.com/] On Fri, Dec 7, 2012 at 2:40 PM, man12 mnazar...@gmail.com wrote: var mongoose = require('mongoose'); var Schema = mongoose.Schema; module.exports.mongoose = mongoose;

Re: [nodejs] Running NodeJs inside JVM

2012-12-07 Thread Rick Waldron
I believe Nashorn purports to be a Node compatible JS engine on the JVM https://oracleus.activeevents.com/connect/sessionDetail.ww?SESSION_ID=6661tclass=popup http://www.theregister.co.uk/2012/11/27/project_nashorn_server_javascript/

Re: [nodejs] Error: database names cannot contain the character '.'

2012-12-07 Thread man12
Space is not there. That's just a typo on my part. On Friday, December 7, 2012 4:35:34 PM UTC-6, Daniel R. wrote: Remove the space before the @ sign in your address variable. -- Daniel R. dan...@neophi.com javascript: [http://danielr.neophi.com/ ] On Fri, Dec 7, 2012 at 2:40 PM, man12

Re: [nodejs] Error: database names cannot contain the character '.'

2012-12-07 Thread Ryan Schmidt
Do the variables username or password contain spaces, colons, slashes or other special characters? If so they need to be percent-encoded for use in a URL. On Dec 7, 2012, at 18:42, man12 wrote: Space is not there. That's just a typo on my part. On Friday, December 7, 2012 4:35:34 PM

[nodejs] What's the default value for buffer

2012-12-07 Thread Goddy Zhao
var buf = new Buffer[1]; console.log(buf[0]); The above code will print a random value of buf[0], anyone know why the default value of a buffer element is not 0 but a random one, and what's the rule of the value? -- Job Board: http://jobs.nodejs.org/ Posting guidelines:

[nodejs] What's the default value of a buffer

2012-12-07 Thread Goddy Zhao
var buf = new Buffer(1); console.log(buf[0]); The above code will print a random value of buf[0], anyone know why the default value of a buffer element is not 0 but a random one, and what's the rule of the value? -- Job Board: http://jobs.nodejs.org/ Posting guidelines:

Re: [nodejs] What's the default value of a buffer

2012-12-07 Thread Dan Milon
Its just allocated space, there's no default. It defaults to whatever the previous process which owned that chunk of memory wrote there. danmilon. On 12/08/2012 04:14 AM, Goddy Zhao wrote: var buf = new Buffer(1); console.log(buf[0]); The above code will print a random value of buf[0],

Re: [nodejs] What's the default value for buffer

2012-12-07 Thread Mark Hahn
I would guess the rule is that there is no rule. On Fri, Dec 7, 2012 at 6:13 PM, Goddy Zhao goddy...@gmail.com wrote: var buf = new Buffer[1]; console.log(buf[0]); The above code will print a random value of buf[0], anyone know why the default value of a buffer element is not 0 but a random