Re: [nodejs] Re: Fatal error

2012-05-28 Thread kapil gopinath
hi, On Mon, May 28, 2012 at 10:35 AM, mscdex msc...@gmail.com wrote: On May 24, 1:30 am, kapil gopinath kapilgopin...@gmail.com wrote: Please help me in solving this issue which is causing the node file to hang. FATAL ERROR: CALL_AND_RETRY_2 Allocation failed - process out of

Re: [nodejs] Re: Fatal error

2012-05-28 Thread kapil gopinath
Hi, I am sharing the code here. The node version used is node-v0.6.9 OS On Mon, May 28, 2012 at 2:25 PM, kapil gopinath kapilgopin...@gmail.comwrote: hi, On Mon, May 28, 2012 at 10:35 AM, mscdex msc...@gmail.com wrote: On May 24, 1:30 am, kapil gopinath kapilgopin...@gmail.com

[nodejs] Blogging with Node?

2012-05-28 Thread Axel Kittenberger
Dear List, What blogging software is there available using Node? (I'm get more and more displeased with Posterous not working correctly. Since a few months I'm already renting a VPS running node, I will just host my blog myself. Would like to use a fancy alternative rather than yet another

Re: [nodejs] Re: asynchronous Socket

2012-05-28 Thread Micheil Smith
Your best bet is possibly to write a wrapper for a wakanda/ssjs socket that makes it mimic an asynchronous node.js socket, alternatively, you could do the inverse, but it's a lot harder to do. Or, you could wrap it in promises, which would provide a potentially more unified interface, but

Re: [nodejs] Blogging with Node?

2012-05-28 Thread Amjad
Check out this git-based blog, Wheat: https://github.com/creationix/wheat It is used by HowToNode.org http://howtonode.org/ On Mon, May 28, 2012 at 12:37 PM, cole gillespie mcg42...@gmail.com wrote: store your posts in couch then just build a backbone app on the front end to display your

Re: [nodejs] Re: asynchronous Socket

2012-05-28 Thread Oleg Podsechin
as an example of what i have: var socket = new SocketSync(); socket.open('localhost', 8856); socket.write('my request'); var mydata= socket.read(); socket.end(); Check out the socket module in Common Node: https://github.com/olegp/common-node Here's the canonical chat example written

[nodejs] Re: Blogging with Node?

2012-05-28 Thread Oleg Podsechin
If you want something simple, https://github.com/olegp/mcms may do the trick. On Monday, May 28, 2012 12:31:12 PM UTC+3, Axel Kittenberger wrote: Dear List, What blogging software is there available using Node? (I'm get more and more displeased with Posterous not working correctly.

Re: [nodejs] JSON5: modern JSON

2012-05-28 Thread Alan Hoffmeister
Awesome idea! Not sure about allowing commas on the last object / key but all the rest are good to go! -- Att, Alan Hoffmeister 2012/5/27 Aseem Kishore aseem.kish...@gmail.com I love JSON, but writing it by hand has always been a pain. Needing to (double-)quote keys, not being able to

Re: [nodejs] JSON5: modern JSON

2012-05-28 Thread Axel Kittenberger
Oh great! 3 I really looked for this a few weeks back! see: http://stackoverflow.com/questions/9637517/parsing-relaxed-json-without-eval On Mon, May 28, 2012 at 3:32 AM, Aseem Kishore aseem.kish...@gmail.com wrote: I love JSON, but writing it by hand has always been a pain. Needing to

Fwd: [nodejs] Re: Fatal error

2012-05-28 Thread kapil gopinath
Hi, I am re-attaching the code here. OS is linux,Ubuntu. -- Forwarded message -- From: Ryan Schmidt google-2...@ryandesign.com Date: Mon, May 28, 2012 at 3:59 PM Subject: [nodejs] Re: Fatal error To: nodejs@googlegroups.com On May 28, 2012, at 03:59, kapil gopinath wrote:

[nodejs] Re: recommended flow control library?

2012-05-28 Thread babibu
Why do you recommend using no flow control library? On May 27, 3:40 pm, Oliver Leics oliver.le...@gmail.com wrote: I recommend using no flow control library, but I recommend to learn how the async library does what it does. If things are going to become a real mess, I recommend the

[nodejs] Using nodejs as teaching tool.

2012-05-28 Thread jsalvachua
Hello, We are a group of professors facing new lectures. We are thinking on changing out network and distributed lectures from java to javaScript and node.js. Our point is to use the same programming language on the client and the server side, appart from getting then involved in new

[nodejs] Node.js proxy-caching server

2012-05-28 Thread phuong dang
Hi all, I want to build a proxy server in Node.js that will be stored in my local server and cache all website visited so , how can i do ? can you so me any guides, please ? my sort solution : - The first i have a Proxy-server - when an HTTP request comes in, check if it's in the cache. If it

Re: [nodejs] Re: recommended flow control library?

2012-05-28 Thread Oliver Leics
On Mon, May 28, 2012 at 9:26 AM, babibu wagener.bast...@googlemail.com wrote: Why do you recommend using no flow control library? Because it's no rocket-science what libraries like async provide. They are very helpful in the beginning, to get used to the async programming style. But once you

[nodejs] Re: JSON5: modern JSON

2012-05-28 Thread Vitaly Puzrin
Why not to just use YAML :) ? понедельник, 28 мая 2012 г., 6:32:23 UTC+4 пользователь Aseem Kishore написал: I love JSON, but writing it by hand has always been a pain. Needing to (double-)quote keys, not being able to document the data with comments, and not having support for trailing

Re: [nodejs] Re: JSON5: modern JSON

2012-05-28 Thread Aseem Kishore
Great question. I actually didn't know until after I published this that YAML is a superset of JSON. Other than that, I didn't really consider YAML only because it doesn't seem to have very good uptake in JS-land. Looking at it a bit now, though, I think there might be some value in incremental

Re: [nodejs] Re: JSON5: modern JSON

2012-05-28 Thread Nuno Job
While I appreciate your work I would like to ask if you think the advantages of these additions are enough to justify: 1) The added complexity 2) Changing the semantics of something already completely defined and with a very large tools ecosystems around it. In other words, markups are cool but

Re: [nodejs] Re: JSON5: modern JSON

2012-05-28 Thread Angel Java Lopez
Well, I see a value: compatibility with eval. That should be the key for this project: it's not another markup language. It's plain Javascript (wo/need eval) Initially, I had the idea to suggest: { mypage = 'loret ipsum... ... ' } that is, multiline string, where the end of

Re: [nodejs] Re: JSON5: modern JSON

2012-05-28 Thread Aseem Kishore
Definitely guys -- thanks for the feedback and for the discussion. Chicken-and-egg problems are always hard. As an attempt to make JSON5 more feasible, I've purposefully made stringify() output regular (strict) JSON. So existing tools could continue to write regular JSON; it's just my hope that

Re: [nodejs] Re: JSON5: modern JSON

2012-05-28 Thread Arunoda Susiripala
I like this. Definitely I'll use this in my config file. Hope nconf would add this into the core :) On Mon, May 28, 2012 at 8:07 PM, Aseem Kishore aseem.kish...@gmail.comwrote: Definitely guys -- thanks for the feedback and for the discussion. Chicken-and-egg problems are always hard. As an

Re: [nodejs] Re: JSON5: modern JSON

2012-05-28 Thread jason . 桂林
Like it. 2012/5/28 Arunoda Susiripala arunoda.susirip...@gmail.com I like this. Definitely I'll use this in my config file. Hope nconf would add this into the core :) On Mon, May 28, 2012 at 8:07 PM, Aseem Kishore aseem.kish...@gmail.comwrote: Definitely guys -- thanks for the feedback

Re: [nodejs] Re: recommended flow control library?

2012-05-28 Thread Mark Volkmann
On Mon, May 28, 2012 at 7:43 AM, Oliver Leics oliver.le...@gmail.com wrote: On Mon, May 28, 2012 at 9:26 AM, babibu wagener.bast...@googlemail.com wrote: Why do you recommend using no flow control library? Because it's no rocket-science what libraries like async provide. They are very

Re: [nodejs] Re: asynchronous Socket

2012-05-28 Thread Tim Caswell
This is a common problem porting blocking code to node. If you block on network sockets in node, it will destroy the performance of your server. There is only one thread. The server will be unable to serve multiple connections at once if one is blocking. Why are you porting this to node? This

Re: [nodejs] Blogging with Node?

2012-05-28 Thread Tim Caswell
Axel, what features do you need in the blog? The wheat engine I wrote is rather fragile to setup (typos can cause it to die, but it's stable one the article is done). Also there is zero web interface to wheat. You write articles as markdown and javascript files and publish them using git. On

Re: [nodejs] Detecting blocking piece of code

2012-05-28 Thread Tim Caswell
I wonder if you could use the v8 debug protocol and interrupt the code at random samples and see where it is in the code. Or use the v8 profile tools and see what code is taking up the most time. I imagine anything that's blocking for seconds will show up pretty easily using such methods. On

Re: [nodejs] Detecting blocking piece of code

2012-05-28 Thread Tim Caswell
The other method is to wrap all the sync functions in node and have them log a stack trace to stderr if they are called beyond the first tick. Assumming you're not using any binary addons that add more sync interfaces to node, the number of sync functions in node itself is finite. On Mon, May

Re: [nodejs] Re: recommended flow control library?

2012-05-28 Thread Oliver Leics
On Mon, May 28, 2012 at 5:25 PM, Mark Volkmann r.mark.volkm...@gmail.com wrote: On Mon, May 28, 2012 at 7:43 AM, Oliver Leics oliver.le...@gmail.com wrote: On Mon, May 28, 2012 at 9:26 AM, babibu wagener.bast...@googlemail.com wrote: Why do you recommend using no flow control library?

Re: [nodejs] Re: asynchronous Socket

2012-05-28 Thread Serti Ayoub
i use socket as client not as Server. So i will not have problem with blocking I/O 2012/5/28 Tim Caswell t...@creationix.com This is a common problem porting blocking code to node. If you block on network sockets in node, it will destroy the performance of your server. There is only one

Re: [nodejs] Re: asynchronous Socket

2012-05-28 Thread Tim Caswell
Ok, then it will block your client. But depending on your logic that may be ok. Still node doesn't have a blocking socket primitive, you would have to implement your own in C. On Mon, May 28, 2012 at 10:50 AM, Serti Ayoub ayb.se...@gmail.com wrote: i use socket as client not as Server. So

Re: [nodejs] Re: JSON5: modern JSON

2012-05-28 Thread Vitaly Puzrin
I'd like like to separate 2 questions. Your work is great, and json really worth to be improved. For example, it's convenient, when you need to keep things simple (for very small files), or keep speed very fast. The second question, about bad yaml uptake, is ralated to lack of good libraries

[nodejs] Re: JSON5: modern JSON

2012-05-28 Thread Alexey Petrushin
There's also CSON https://github.com/bevry/cson - with very compact CoffeeScript syntax -- 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

Re: [nodejs] Node.js proxy-caching server

2012-05-28 Thread Mark Hahn
I highly recommend nginx. it is very easy to use and faster than any node proxy. it works well with node and is used in many node installations. On Mon, May 28, 2012 at 3:36 AM, phuong dang hanhphuong...@gmail.comwrote: Hi all, I want to build a proxy server in Node.js that will be stored in

Re: [nodejs] Node.js proxy-caching server

2012-05-28 Thread Arunoda Susiripala
Worth looking at haproxy too. On Mon, May 28, 2012 at 10:29 PM, Mark Hahn m...@hahnca.com wrote: I highly recommend nginx. it is very easy to use and faster than any node proxy. it works well with node and is used in many node installations. On Mon, May 28, 2012 at 3:36 AM, phuong dang

Re: [nodejs] Blogging with Node?

2012-05-28 Thread Anand George
https://github.com/guyht/Glog is a git and Node.js backed blog that uses markdown for formatting On Mon, May 28, 2012 at 9:14 PM, Tim Caswell t...@creationix.com wrote: Axel, what features do you need in the blog? The wheat engine I wrote is rather fragile to setup (typos can cause it to die,

Re: [nodejs] Re: JSON5: modern JSON

2012-05-28 Thread Matt
The problem with YAML is it's a horrendously bloated spec, making it super complex to write a correct parser (unless you shim a C library). It started off as a really simple idea but then Ingy went a bit off the rails with things it could do, and the spec ended up about 10 times longer than the

Re: [nodejs] Re: JSON5: modern JSON

2012-05-28 Thread Axel Kittenberger
On Mon, May 28, 2012 at 7:28 PM, Matt hel...@gmail.com wrote: The problem with YAML is it's a horrendously bloated spec, making it super complex to write a correct parser (unless you shim a C library). It started off as a really simple idea but then Ingy went a bit off the rails with things it

Re: [nodejs] Re: JSON5: modern JSON

2012-05-28 Thread Karl Tiedt
How is javascript in any way similar to XML or any other markup language thats like apple to beef comparisons (not oranges because they are that different) -Karl Tiedt -- Job Board: http://jobs.nodejs.org/ Posting guidelines:

Re: [nodejs] Re: asynchronous Socket

2012-05-28 Thread Oleg Podsechin
Common Node doesn't block since it uses fibers and there's no need to write anything C. It's also cross platform thanks to the recent support for Windows in fibers. On Monday, May 28, 2012 7:08:34 PM UTC+3, Tim Caswell wrote: Ok, then it will block your client. But depending on your logic

Re: [nodejs] Detecting blocking piece of code

2012-05-28 Thread Oleg Podsechin
I wonder if you could use the v8 debug protocol and interrupt the code at random samples and see where it is in the code. Or use the v8 profile tools and see what code is taking up the most time. I imagine anything that's blocking for seconds will show up pretty easily using such

Re: [nodejs] Re: JSON5: modern JSON

2012-05-28 Thread Matt
On Mon, May 28, 2012 at 1:32 PM, Axel Kittenberger axk...@gmail.com wrote: On Mon, May 28, 2012 at 7:28 PM, Matt hel...@gmail.com wrote: The problem with YAML is it's a horrendously bloated spec, making it super complex to write a correct parser (unless you shim a C library). It started

[nodejs] Get latest version

2012-05-28 Thread Alan Hoffmeister
Hello there! Is there a clean way for getting the last stable version of Node.js? I would really like to GET http://nodejs.org/versions and retrieve a list of versions like: { latest-stable : 0.6.18, latest-unstable : 0.7.9, versions : [ 0.7.9, 0.7.8, etc...

Re: [nodejs] Get latest version

2012-05-28 Thread Martin Wawrusch
use https://github.com/visionmedia/n On Mon, May 28, 2012 at 12:22 PM, Alan Hoffmeister alanhoffmeis...@gmail.com wrote: Hello there! Is there a clean way for getting the last stable version of Node.js? I would really like to GET http://nodejs.org/versions and retrieve a list of versions

Re: [nodejs] Re: JSON5: modern JSON

2012-05-28 Thread Vitaly Puzrin
Who cares about difficulty of writing parser, if it already exists for node? Who makes you use every yaml feature? Yaml is widely used in ruby/python. And i'm not sure, that it would be clever idea to invent another way for node. Every time i look into package.json, i remember about dying

Re: [nodejs] Re: JSON5: modern JSON

2012-05-28 Thread Matt
On Mon, May 28, 2012 at 3:29 PM, Vitaly Puzrin vit...@rcdesign.ru wrote: Who cares about difficulty of writing parser, if it already exists for node? I do just from a personal sense of smug satisfaction :-) I don't like complicated solutions. Who makes you use every yaml feature? The

Re: [nodejs] Get latest version

2012-05-28 Thread Martin Cooper
On Mon, May 28, 2012 at 12:22 PM, Alan Hoffmeister alanhoffmeis...@gmail.com wrote: Hello there! Is there a clean way for getting the last stable version of Node.js? I would really like to GET http://nodejs.org/versions and retrieve a list of versions like: {     latest-stable : 0.6.18,  

Re: [nodejs] Blogging with Node?

2012-05-28 Thread Michael Nisi
I wrote blake, a blog aware infrastructure that implements IO and template routing to generate static websites: https://github.com/michaelnisi/blake On Mon, May 28, 2012 at 7:13 PM, Anand George mranandgeo...@gmail.com wrote: https://github.com/guyht/Glog is a git and Node.js backed blog that

[nodejs] Re: Detecting blocking piece of code

2012-05-28 Thread Jan Jongboom
If you have a Joyent SmartMachine you can see this blog post http://blog.nodejs.org/2012/04/25/profiling-node-js/ to create a visual representation of the time your app takes in various functions. This should give an indication of the blockiness. On May 28, 1:46 pm, Boris Egorov

[nodejs] Abort http request throw Error: socket hang up

2012-05-28 Thread lbdremy
Hey, I'm using node v0.6.16 and if I call the `abort` method of the instance of `http.ClientRequest` returned by `http.get()`, I catch an error: `Error: socket hang up`. For example with this code: ```js var http = require('http'); var options = { host : 'google.com' } var request =

[nodejs] lambdas in node

2012-05-28 Thread Joshua Bowles
I'm clearly missing something about anonymous functions in node. As a learning exercise I'm trying to pass multiple lambdas to a function. I've got a gist https://gist.github.com/2820160 (and a comparison in Ruby of what I'm trying to do https://gist.github.com/2820073). Thanks in advance! I

[nodejs] lambdas in node

2012-05-28 Thread Joshua Bowles
I'm clearly missing something about anonymous functions in node. As a learning exercise I'm trying to pass multiple lambdas to a function. I've got a gist https://gist.github.com/2820160 (and a comparison in Ruby of what I'm trying to do https://gist.github.com/2820073). Thanks in advance! I

Re: [nodejs] lambdas in node

2012-05-28 Thread Angel Java Lopez
Hmmm... I'm a bit confused. In your gist, you define lambda_good as function lambda_good() ... // no parameters but in your Ruby code, you define it explicitly with TWO arguments. What were your intention? On Mon, May 28, 2012 at 2:37 PM, Joshua Bowles bowlesl...@gmail.com wrote: I'm

Re: [nodejs] lambdas in node

2012-05-28 Thread Joshua Holbrook
First of all, these all look like named functions and not anonymous functions. The difference is that anonymous functions don't have a name in between the function keyword and the parens, basically. So, nothing special. Are you trying to do something like: var first = function () { return

Re: [nodejs] lambdas in node

2012-05-28 Thread Angel Java Lopez
And you can write function compose(f,g) { return function(x) { return f(g(x)); } }; compose(function(x) { return x*x; }, function(x) { return x*2; })(3); -- 36 too lambda, the best thing since sliced bread ;-) On Mon, May 28, 2012 at 5:33 PM, Joshua Holbrook josh.holbr...@gmail.comwrote:

Re: [nodejs] lambdas in node

2012-05-28 Thread Joshua Bowles
I left out params for clarity... I wasn't doing it right so i didn't want to muddy up my example. I agree, it's not very clear what my intentions are here... On Mon, May 28, 2012 at 2:29 PM, Angel Java Lopez ajlopez2...@gmail.comwrote: Hmmm... I'm a bit confused. In your gist, you define

Re: [nodejs] Re: recommended flow control library?

2012-05-28 Thread Jake Verbaten
A recent quora answer about flow control patterns might be helpful ( http://www.quora.com/JavaScript/What-are-known-javascript-design-patterns-for-asynchronous-programming/ ) It's a personal choice whether you use the primitives directly or abstract them lightly. The main question is what

Re: [nodejs] lambdas in node

2012-05-28 Thread Joshua Bowles
Ah, I see. thank you. I think I've confused two patterns. Here, we name the function and pass the vars to wrapper. Yes, I think this answers on of my questions. On Mon, May 28, 2012 at 2:33 PM, Joshua Holbrook josh.holbr...@gmail.comwrote: First of all, these all look like named functions and

Re: [nodejs] lambdas in node

2012-05-28 Thread Joshua Bowles
Aha. yes, I think this answers the second part of what I was after. Thank you. I'm going dig a bit deeper with this. On Mon, May 28, 2012 at 2:39 PM, Angel Java Lopez ajlopez2...@gmail.comwrote: And you can write function compose(f,g) { return function(x) { return f(g(x)); } };

Re: [nodejs] Abort http request throw Error: socket hang up

2012-05-28 Thread Ben Noordhuis
On Mon, May 28, 2012 at 4:18 PM, lbdremy remyloubra...@gmail.com wrote: Hey, I'm using node v0.6.16 and if I call the `abort` method of the instance of `http.ClientRequest` returned by `http.get()`, I catch an error: `Error: socket hang up`. For example with this code: ```js var http =

[nodejs] [ANN] LXJS, A JS Conference in Europe that is focused on Node.js Mobile

2012-05-28 Thread Nuno Job
Hi guys, For us Europeans Node Conf is a bit more expensive. If you are European and can't make it to Node Conf this might be a cool opportunity: Me and some other folks are running a conference in Lisbon later this year (September). Lot's of great community members are coming, and there will be

[nodejs] initial usage problems

2012-05-28 Thread Dan
The following is copied over here from the npm discussion per Isaac's suggestion. Dan --- s this what you expect: events.js:48 throw arguments[1]; // Unhandled 'error' event ^ Error: getaddrinfo ENOENT at errnoException (dns.js:31:11) at

[nodejs] OAuth2 Server

2012-05-28 Thread Gustavo Machado
Hi List! Does anybody recommend any production-ready packages to implement OAuth2 Server for my application? This one looks good but doesn't seem to be very active: https://github.com/AF83/oauth2_server_node Thanks in advance! Gustavo -- Job Board: http://jobs.nodejs.org/ Posting guidelines:

Re: [nodejs] lambdas in node

2012-05-28 Thread Joshua Bowles
Thanks again Angel and Joshua for clarifying soem concepts. For completeness sake of this thread here is what I was trying to clarify for myself; the complete gist is here: (https://gist.github.com/2820160). - var func_one =

Re: [nodejs] Re: recommended flow control library?

2012-05-28 Thread Xavi Ramirez
Aync certainly has everything you'd ever want (and more), but I personally find the API a bit overwhelming and at times verbose. For example I dislike having to manually deconstruct an array to get the results of two callbacks executed in parallell. Because of this, I tend to use Step:

[nodejs] FN.bind vs fn() { FN() }

2012-05-28 Thread phidelta
Hi all, I have recently come to use .bind a lot, because it makes for very clean code. So rather than doing code var x; // this has some value that comes from prior code setTimeout(function() { console.log(x) }, 5000); /code I am now often doing code var x;

Re: [nodejs] Re: JSON5: modern JSON

2012-05-28 Thread jason . 桂林
I hope JSON can support Date type serialization, but it not, now I hope JSON5 can do this Date serialization. 2012/5/29 Vitaly Puzrin vit...@rcdesign.ru Who cares about difficulty of writing parser, if it already exists for node? Who makes you use every yaml feature? Yaml is widely used in

[nodejs] Re: FN.bind vs fn() { FN() }

2012-05-28 Thread mscdex
On May 28, 8:52 pm, phidelta philipp.dun...@gmail.com wrote: The question I have is: what is more performant? Is there any reason to avoid .bind()? IIRC there is a performance hit when using bind, but whether it will seriously impact your application is something you'll have to test. -- Job

Re: [nodejs] Re: JSON5: modern JSON

2012-05-28 Thread Aseem Kishore
Someone else made the same request: https://github.com/aseemk/json5/issues/3 It seems that the right thing to do is what native JSON already does (at least in V8) -- serialize to an ISO 8601 string. Let me know if that's not right. Aseem On Mon, May 28, 2012 at 9:35 PM, Arunoda Susiripala