[nodejs] Re: JavaScripts spec.

2014-01-23 Thread Floby
http://nodejs.org/api/all.html On Wednesday, 22 January 2014 09:03:33 UTC+1, Michael Monashev wrote: Hi. Where can I find complete all in one page JavaScript specification for Node.JS? -- Michael mailto:softs...@gmail.com javascript: -- -- Job Board:

[nodejs] Strange bug in benchmark, Express.js is slower than Ruby on Rails

2014-01-23 Thread Alexey Petrushin
I ran a benchmark for Ruby on Rails and Express.js using `siege` - and Express for some reason performed worse than Rails. How benchmark works - application query some text from remote HTTP service (service delays each request for 200ms) and render HTML page using that text. *Results* -

Re: [nodejs] Strange bug in benchmark, Express.js is slower than Ruby on Rails

2014-01-23 Thread Fedor Indutny
I think you could be hitting this: http://nodejs.org/api/http.html#http_agent_maxsockets On Thu, Jan 23, 2014 at 1:57 PM, Alexey Petrushin alexey.petrus...@gmail.com wrote: I ran a benchmark for Ruby on Rails and Express.js using `siege` - and Express for some reason performed worse than Rails.

[nodejs] Re: Tidying up callback declarations

2014-01-23 Thread Liam Ryan
Thanks, declaring the expression before the call worked perfectly, I'm still struggling with the function declaration though - var fs = require(fs); fs.readFile( process.argv[2], fileCallback(err, file) ); function fileCallback(err, file) { console.log(file.toString().split(\n).length - 1);

[nodejs] installing mysql ?

2014-01-23 Thread pitambar patra
i am new to node.js ,so trying to read/write to database, but i am getting the error while compiling my sql1.js file sql1.js -- var mysql = require('mysql'); var connection = mysql.createConnection({ host : 'localhost', user : 'me', password : 'secret' });

Re: [nodejs] installing mysql ?

2014-01-23 Thread pitambar patra
am using latest ver node-v0.10.24 On Thu, Jan 23, 2014 at 4:53 PM, Fedor Indutny fe...@indutny.com wrote: Hi! What node.js version are you using? Cheers, Fedor. On Thu, Jan 23, 2014 at 3:15 PM, pitambar patra pitamba...@gmail.com wrote: i am new to node.js ,so trying to read/write to

Re: [nodejs] Re: Tidying up callback declarations

2014-01-23 Thread Paul Spencer
You are invoking fileCallback inside the call to fs.readFile, you just want to provide the function referencer instead. var fs = require('fs'); fs.readFile(process.argv[2], fileCallback); function fileCallback(err, file) {   console.log(file.toString().split('\n').length - 1); } --  Paul

[nodejs] stack

2014-01-23 Thread klrumpf
It would be nice to have a warning when Node runs low on stack when firing up (successfully at first glance). When this happens and the first client logs in the client will just hang there without any error on the server side. Solution is to increase

Re: [nodejs] installing mysql ?

2014-01-23 Thread Scott González
Check for connection errors: connection.connect(function(err) { console.log(err.code); // 'ECONNREFUSED' console.log(err.fatal); // true}); On Thu, Jan 23, 2014 at 6:15 AM, pitambar patra pitamba...@gmail.comwrote: i am new to node.js ,so trying to read/write to database, but i am

Re: [nodejs] installing mysql ?

2014-01-23 Thread pitambar patra
get error while connection, what is the reason for it, how to check that mysql is installed or not, how to make it wrok :) pitambar@pitambar-TravelMate-4740:~/node-example/hands-on-node.js$ node sql1.js ECONNREFUSED true On Thu, Jan 23, 2014 at 7:15 PM, Scott González

[nodejs] Parsing GYP files?

2014-01-23 Thread Kevin Ingwersen
Hey! Is it possible to parse GYP files in nodejs? JSON.parse fails at the first single-quote x.x Kind regards, Ingwie -- -- 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

Re: [nodejs] Parsing GYP files?

2014-01-23 Thread Fedor Indutny
Won't work either, I guess. As it may contain comments. On Thu, Jan 23, 2014 at 6:15 PM, Arnout Kazemier i...@3rd-eden.com wrote: eval it? On Thursday 23 January 2014 at 15:01, Kevin Ingwersen wrote: Hey! Is it possible to parse GYP files in nodejs? JSON.parse fails at the first

Re: [nodejs] Parsing GYP files?

2014-01-23 Thread Arnout Kazemier
eval it? On Thursday 23 January 2014 at 15:01, Kevin Ingwersen wrote: Hey! Is it possible to parse GYP files in nodejs? JSON.parse fails at the first single-quote x.x Kind regards, Ingwie -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines:

Re: [nodejs] Strange bug in benchmark, Express.js is slower than Ruby on Rails

2014-01-23 Thread Matt
Also important that your node code is only using one CPU. See http://nodejs.org/docs/v0.10.22/api/cluster.html On Thu, Jan 23, 2014 at 5:15 AM, Fedor Indutny fe...@indutny.com wrote: I think you could be hitting this: http://nodejs.org/api/http.html#http_agent_maxsockets On Thu, Jan 23,

Re: [nodejs] Strange bug in benchmark, Express.js is slower than Ruby on Rails

2014-01-23 Thread Alexey Petrushin
Single core shouldn't be a problem as far as I know ruby also uses only one CPU it doesn't have real threads. On Thursday, January 23, 2014, Matt hel...@gmail.com wrote: Also important that your node code is only using one CPU. See http://nodejs.org/docs/v0.10.22/api/cluster.html On Thu,

Re: [nodejs] Strange bug in benchmark, Express.js is slower than Ruby on Rails

2014-01-23 Thread Matt
On Thu, Jan 23, 2014 at 9:33 AM, Alexey Petrushin alexey.petrus...@gmail.com wrote: Single core shouldn't be a problem as far as I know ruby also uses only one CPU it doesn't have real threads. Apparently for Puma this changes if you're running under Rubinius or JRuby. But I strongly

Re: [nodejs] Parsing GYP files?

2014-01-23 Thread Arnout Kazemier
Then you could do something like `data = (new Function(‘return ‘+ gyp)())` to get the data. Founder: 3rd-Eden Product: Observe.it (http://observe.it) Lead Software Engineer: Nodejitsu.com (http://nodejitsu.com) Twitter: @3rdEden Github: @3rd-Eden Skype: arnoutkazemier Facebook:

Re: [nodejs] Parsing GYP files?

2014-01-23 Thread Fedor Indutny
I meant python comments: https://github.com/joyent/node/blob/master/node.gyp#L83 But I think some simple regexp to trim them and eval could really make the trick work. On Thu, Jan 23, 2014 at 6:56 PM, Arnout Kazemier i...@3rd-eden.com wrote: Then you could do something like `data = (new

Re: [nodejs] Parsing GYP files?

2014-01-23 Thread Arnout Kazemier
Yeah, I noticed that after pressing send, and a find/replace should take out most of these. On Thursday 23 January 2014 at 15:58, Fedor Indutny wrote: I meant python comments: https://github.com/joyent/node/blob/master/node.gyp#L83 But I think some simple regexp to trim them and eval

Re: [nodejs] Strange bug in benchmark, Express.js is slower than Ruby on Rails

2014-01-23 Thread Alexey Petrushin
Fedor, you are right, thanks. That was the problem, after fixing it node became more than 10 times faster. Issue resolved. On Thursday, 23 January 2014 14:15:19 UTC+4, Fedor Indutny wrote: I think you could be hitting this: http://nodejs.org/api/http.html#http_agent_maxsockets On Thu,

Re: [nodejs] Strange bug in benchmark, Express.js is slower than Ruby on Rails

2014-01-23 Thread Fedor Indutny
You are welcome! On Thu, Jan 23, 2014 at 7:19 PM, Alexey Petrushin alexey.petrus...@gmail.com wrote: Fedor, you are right, thanks. That was the problem, after fixing it node became more than 10 times faster. Issue resolved. On Thursday, 23 January 2014 14:15:19 UTC+4, Fedor Indutny wrote:

Re: [nodejs] Parsing GYP files?

2014-01-23 Thread Fedor Indutny
They just start with '#' . I think you better Google it anyway ;) On Thu, Jan 23, 2014 at 7:37 PM, Kevin Ingwersen ingwie2...@googlemail.com wrote: Turn sout that digging npmjs.org revealed a very small amount of gyp handlers. I havent tried one, but i feel like they could be quite old :p But

Re: [nodejs] Parsing GYP files?

2014-01-23 Thread Kevin Ingwersen
Turn sout that digging npmjs.org revealed a very small amount of gyp handlers. I havent tried one, but i feel like they could be quite old :p But what is that about python comments? I never did python myself. Am Do. Jan. 23 2014 16:00:18 schrieb Arnout Kazemier: Yeah, I noticed that after

Re: [nodejs] Parsing GYP files?

2014-01-23 Thread Kevin Ingwersen
I thought those were more likely called „shell-like comments“, as they’re used in Shibangs too x3. Thanks for the info anyway! ^^ Am Do. Jan. 23 2014 16:44:37 schrieb Fedor Indutny: They just start with '#' . I think you better Google it anyway ;) On Thu, Jan 23, 2014 at 7:37 PM, Kevin

Re: [nodejs] Virtual Hosts in nodejs

2014-01-23 Thread Thomas Murphy
Check out vhost in Connect: http://www.senchalabs.org/connect/vhost.html On Thu, Jan 23, 2014 at 10:52 AM, kyoukhana kyoukh...@gmail.com wrote: For local host development how can i set up a virtual host in nodejs. i edit the host file under etc/hosts Lets say the domain name is

[nodejs] Virtual Hosts in nodejs

2014-01-23 Thread kyoukhana
For local host development how can i set up a virtual host in nodejs. i edit the host file under etc/hosts Lets say the domain name is testdomain My nodejs app was created using the following $ express --sessions --css stylus devtestdomain -- -- Job Board: http://jobs.nodejs.org/

Re: [nodejs] Parsing GYP files?

2014-01-23 Thread Kevin Ingwersen
GYP is….python?! I ALWAYS thought it was some ultra-abstract JSON :o…this explains why there is barely any parser. Am Do. Jan. 23 2014 17:14:20 schrieb Tim Caswell: They are called python comments in this case because gyp files are in fact python code. Yes, python does have a lot of syntax

Re: [nodejs] Parsing GYP files?

2014-01-23 Thread Tim Caswell
They are called python comments in this case because gyp files are in fact python code. Yes, python does have a lot of syntax overlap with JS and shell code. On Thu, Jan 23, 2014 at 9:48 AM, Kevin Ingwersen ingwie2...@googlemail.comwrote: I thought those were more likely called „shell-like

Re: [nodejs] Strange bug in benchmark, Express.js is slower than Ruby on Rails

2014-01-23 Thread Reza Razavipour
what was the fix? You changed the 5 to what? On Thursday, January 23, 2014 7:19:06 AM UTC-8, Alexey Petrushin wrote: Fedor, you are right, thanks. That was the problem, after fixing it node became more than 10 times faster. Issue resolved. On Thursday, 23 January 2014 14:15:19 UTC+4,

[nodejs] Build tools

2014-01-23 Thread Kevin Ingwersen
Hey. I just wonder one thing: Has there ever been a build tool written in nodejs? I mean, something like make or ninja. Doing the configuration stuff is not very hard, but one would rather use CMake I guess; I never dealt with external libraries that differ on the platforms (if that is even

[nodejs] New to Node - Integrating with existing project?

2014-01-23 Thread Nick Dugger
Hey there, I've recently started a project, and I need a server for it. I don;t wan to simply drag it into my xampp folder, but rather create it's own server for Node (also so I can actually USE Node in the project). My project currently looks like this: Project Folder | HTML File (this is

Re: [nodejs] Any font close to node.js logo?

2014-01-23 Thread jurbania
Closest I've seen http://fontfabric.com/cube-02-font/ -J On Wednesday, June 1, 2011 1:56:49 AM UTC-5, Jason.桂林(Gui Lin) wrote: hey guys I don't know are there any font like node.js logo? I like this font. -- Best regards, Jason Green 桂林 -- -- Job Board: http://jobs.nodejs.org/

Re: [nodejs] New to Node - Integrating with existing project?

2014-01-23 Thread Angel Java Lopez
I guess you want to add server Node.js logic, sometimes in the future. Then, explore Express http://expressjs.com/ and put all your current files in the public declared directory Read http://expressjs.com/guide.html Short path npm install express -g express yourapp cd yourapp (copy all your

Re: [nodejs] Strange bug in benchmark, Express.js is slower than Ruby on Rails

2014-01-23 Thread Alexey Petrushin
I've changed agent.maxSockets https://github.com/alexeypetrushin/web-frameworks-benchmarks/commit/bac85d4485809d7dca59d9a1ea64445c37af71de On Thursday, 23 January 2014 20:35:18 UTC+4, Reza Razavipour wrote: what was the fix? You changed the 5 to what? On Thursday, January 23, 2014 7:19:06 AM

Re: [nodejs] Parsing GYP files?

2014-01-23 Thread Alex Kocharin
Sounds like YAML parser can do the job. At least, `require('js-yaml').safeLoad(fs.readFileSync('./config.gypi', 'utf8'))` works. :P 23.01.2014, 18:59, Fedor Indutny fe...@indutny.com: I meant python comments: https://github.com/joyent/node/blob/master/node.gyp#L83 But I think some simple

[nodejs] Re: HTTP client request headers (lowercase) issue

2014-01-23 Thread Dave Winer
I seem to be having this problem, not sure what the solution or workaround is. I'm writing the head as follows: response.writeHead (200, {Content-Type: text/html, Access-Control-Allow-Origin: fargo.io}); When it shows up on the client, the header names are lowercased. Happens in two clients,

Re: [nodejs] Parsing GYP files?

2014-01-23 Thread Nathan Rajlich
This one leverages Python itself: https://npmjs.org/package/gyp-reader On Thu, Jan 23, 2014 at 10:37 AM, Alex Kocharin a...@kocharin.ru wrote: Sounds like YAML parser can do the job. At least, `require('js-yaml').safeLoad(fs.readFileSync('./config.gypi', 'utf8'))` works. :P 23.01.2014,

[nodejs] Node v0.10.25 (Stable)

2014-01-23 Thread Timothy J Fontaine
2014.01.23, Version 0.10.25 (Stable) * uv: Upgrade to v0.10.23 * npm: Upgrade to v1.3.24 * v8: Fix enumeration for objects with lots of properties * child_process: fix spawn() optional arguments (Sam Roberts) * cluster: report more errors to workers (Fedor Indutny) * domains: exit() only

Re: Re[2]: [nodejs] JavaScripts spec.

2014-01-23 Thread Rick Waldron
On Thu, Jan 23, 2014 at 2:42 PM, Michael Monashev softsea...@gmail.comwrote: Hi, Rick. This is the ES5.1 spec, in one page: http://es5.github.io/ (non-pdf). I am looking for specification with examples like this: http://www.tutorialspoint.com/javascript/javascript_arrays_object.htm The

Re[2]: [nodejs] JavaScripts spec.

2014-01-23 Thread Michael Monashev
Hi, Rick. This is the ES5.1 spec, in one page: http://es5.github.io/ (non-pdf). I am looking for specification with examples like this: http://www.tutorialspoint.com/javascript/javascript_arrays_object.htm -- Michael -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines:

Re: [nodejs] Build tools

2014-01-23 Thread Forrest L Norvell
There's grunt (declarative, plugin-based), gulp (imperative, plugin-based), jake (like rake in the Ruby world), and fez (probably the closest to make, although it's actually based on tup). There's also just writing straight-up Node code to do your build steps, although until execSync lands (which

[nodejs] Loading data in node is too verbose

2014-01-23 Thread David Beck
I will go out on a limb here and say it sucks to have to write a bunch of async code to load data in node. Many times we know exactly what we want to load ahead of time. Why can't we just declare all the things we want to load and then load it all at once? For example, with two mongo

[nodejs] Latest version of bootstrap and jquery-1.10.2

2014-01-23 Thread kyoukhana
I was looking on NPM and I only saw jQuery 2.x is there a NPM module for 1.10.2. Also I don't see a module for the latest version of twitter bootstrap on NPM. Or should I just include them in public/js -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines:

Re: [nodejs] Loading data in node is too verbose

2014-01-23 Thread Alex Kocharin
 If it sucks to write async code, just use generators and write a sync code.  24.01.2014, 00:31, "David Beck" davegb...@gmail.com: I will go out on a limb here and say it sucks to have to write a bunch of async code to load data in node. Many times we know exactly what we want to load ahead of

[nodejs] Australian Node.js developers wanted (up to $110k) - Western Sydney

2014-01-23 Thread josh . e
You only want to work with the best, and here's an opportunity hot off the presses. The team consists of mostly young, energetic developers in a fun, funky environment. The office is modern and fresh. You don't need to wear a suit and tie, just semi-casual.*We know you've got to be

[nodejs] CampJS III - Melbourne, Australia. Tickets on sale.

2014-01-23 Thread Tim Oxley
*CampJS http://campjs.com/ is a unique retreat for JS developers in Melbourne, Australia. * CampJS III runs from Friday 23 to Monday 26 of May. Early bird tickets are available now! http://tickets.campjs.com/ See campjs.com for more details about what happens at a CampJS. In light of the

[nodejs] Re: Strange bug in benchmark, Express.js is slower than Ruby on Rails

2014-01-23 Thread tjholowaychuk
plus this benchmark doesn't really test express, it tests outbound requests AND express :p so that's really misleading On Thursday, 23 January 2014 01:57:58 UTC-8, Alexey Petrushin wrote: I ran a benchmark for Ruby on Rails and Express.js using `siege` - and Express for some reason

[nodejs] Re: HTTP client request headers (lowercase) issue

2014-01-23 Thread Michael Hart
What node version are you using? Works fine for me on v0.10.25: $ cat test.js require('http').createServer(function(req, res) { res.writeHead(200, {Something: 'yep'}) res.end() }).listen(3000) $ node test.js [1] 85457 $ curl -v localhost:3000 * Adding handle: conn: 0x7fdc09004000 * Adding

[nodejs] Re: Strange bug in benchmark, Express.js is slower than Ruby on Rails

2014-01-23 Thread Alexey Petrushin
Yes, but I wanted to see a test that more or less close to what's used in real projects. Express usually don't work in isolation, usually it uses some sort of database. And request seems like a good approximation for DB connection. On Friday, 24 January 2014 07:33:59 UTC+4, tjholowaychuk