Re: [nodejs] Re: [ANN] webkitgtk - version 1.0

2014-09-23 Thread Dhi Aurrahman
nice! Dhi Aurrahman GPG Key: http://bit.ly/rckbrsgpg On Wed, Sep 24, 2014 at 7:22 AM, Jérémy Lal wrote: > Hello again, > after several modifications, i just pushed version 1.0. > > ``` > WebKit().load('http://github.com') > .png('github.png') > .pdf('github.pdf') > .html(function(err, htm

Re: [nodejs] Callback hell and how to get around it?

2014-09-23 Thread Alexey Petrushin
> http://www.ckwop.me.uk/Why-Exceptions-Suck.html That's just another theoretical talk. You may find tons of such stuff explaining how J2EE is a superior next-generation technology or whatever other nonsense. You may even find articles insisting that explicit error checks in Go "is the right way

[nodejs] chaining API vs promises

2014-09-23 Thread Alex Kocharin
There seem to be a conflict between chaining api and promise-based api. Both of them use return value, but chaining api returns `this`, and promise-based one returns promise. Is it possible to use both at the same time? Here is some abstract example. Suppose we have a class: ```js function Me

Re: [nodejs] Re: [ANN] webkitgtk - version 1.0

2014-09-23 Thread Jérémy Lal
Hello again, after several modifications, i just pushed version 1.0. ``` WebKit().load('http://github.com') .png('github.png') .pdf('github.pdf') .html(function(err, html) { // the html body as string console.log(this.status, html); }).on('authenticate', function(auth) { auth.u

Re: [nodejs] Callback hell and how to get around it?

2014-09-23 Thread Matt
On Tue, Sep 23, 2014 at 5:04 PM, Bruno Jouhier wrote: > So I would not take this blog article as an authoritative source on > exceptions. I don't. But it's a good read on some of the pitfalls exceptions can lead you towards. -- Job board: http://jobs.nodejs.org/ New group rules: https://gist

Re: [nodejs] Can someone help me with basic postgresql question?

2014-09-23 Thread TigerNassau
Try the node postgres driver and use the wiki examples Sent from my LG Mobile kurofune wrote: >Thanks for your helpful responses. Inspite of my "fundamental >misunderstanding of how async code works" I was able to use my brain really >hard to get it to work. And I didn't even need to read the

Re: [nodejs] Callback hell and how to get around it?

2014-09-23 Thread Bruno Jouhier
> > http://www.ckwop.me.uk/Why-Exceptions-Suck.html > "Checked exceptions are certainly better than unchecked exceptions" !!! Java had checked exception but its successors (C#) removed this feature. The designers of Java libraries have moved away from checked exceptions too (the presence of ch

Re: [nodejs] Can someone help me with basic postgresql question?

2014-09-23 Thread kurofune
Thanks for your helpful responses. Inspite of my "fundamental misunderstanding of how async code works" I was able to use my brain really hard to get it to work. And I didn't even need to read the node beginner book for a third time to do it! But I do love the section in there about databases a

Re: [nodejs] Can someone help me with basic postgresql question?

2014-09-23 Thread Matt
You're just fundamentally misunderstanding how async code works (a common problem with people new to Node). You're coding as if things are synchronous. You need to do some of the basic ground work first to understand this. Try http://nodebeginner.org/ On Tue, Sep 23, 2014 at 2:16 PM, kurofune wr

Re: [nodejs] Can someone help me with basic postgresql question?

2014-09-23 Thread Ryan Schmidt
On Sep 23, 2014, at 1:16 PM, kurofune wrote: > I am doing my first node project and want to save subscriber input info to a > postgres db, and I think I almost have it working. It successfully made the > table when I tested it in my browser, but instead of saving the data, like it > should, it

Re: [nodejs] Callback hell and how to get around it?

2014-09-23 Thread Tom Boutell
Alexey, that's an interesting comparison. Your benchmark does almost no work in the node/ruby code itself. Since you used a modern Ruby webserver that is based on lightweight threads rather than processes, it's not too surprising that node is "only" 1.3 times faster under an appreciable but not out

Re: [nodejs] Callback hell and how to get around it?

2014-09-23 Thread Matt
On Tue, Sep 23, 2014 at 3:14 PM, Alexey Petrushin < alexey.petrus...@gmail.com> wrote: > > I've programmed in both sync and async code, and neither is perfect. > Node basically > > has trade-offs - I get better performance [1] at the expense of a > slightly cumbersome programming model. > > I comp

Re: [nodejs] Callback hell and how to get around it?

2014-09-23 Thread Alexey Petrushin
> I've programmed in both sync and async code, and neither is perfect. Node basically > has trade-offs - I get better performance [1] at the expense of a slightly cumbersome programming model. I compared Node.js with "slow" Ruby on Rails and the result is that node.js is only 1.3 times faster

[nodejs] Re: How can Node.js be a replacement for the server side when users can see the files?

2014-09-23 Thread Jimb Esser
Depending on what "users" the original poster is referring to - if you are selling a server to your clients, using Node does expose all of your server source code to your "users". However, thinking that the traditional method of selling a compiled executable with "sensitive data" compiled and

[nodejs] Can someone help me with basic postgresql question?

2014-09-23 Thread kurofune
Hi there, I am doing my first node project and want to save subscriber input info to a postgres db, and I think I almost have it working. It successfully made the table when I tested it in my browser, but instead of saving the data, like it should, it is ignoring the data altogether and killin

[nodejs] Re: In chaijs/type-detect module, what does this line of code do: {if (obj === Object(obj)) return 'object';}?

2014-09-23 Thread enormouspenguin
> > typeof [] => object Taken cared by this and this . typeof null => object Taken cared by this

Re: [nodejs] Node.js Addon Examples with V8 Version 3.22

2014-09-23 Thread Fedor Indutny
I'd certainly recommend using nan. However, in the new V8 API it'll look this way: args.GetReturnValue().Set(...) On Tue, Sep 23, 2014 at 7:06 PM, blazs wrote: > Thanks, this is helpful! Dramatic changes in the V8 API are giving me a > headache. > > Suppose I have the following scenario. I wra

[nodejs] Re: In chaijs/type-detect module, what does this line of code do: {if (obj === Object(obj)) return 'object';}?

2014-09-23 Thread Simon
This is used to determine if something is a primitive or not. `typeof null` returns 'object' even though it is not an object and `typeof function() {}` returns 'function' even though it is an object. Basically 'typeof' alone is not enough to determine if something is primitive or object. `insta

Re: [nodejs] Callback hell and how to get around it?

2014-09-23 Thread Matt
On Tue, Sep 23, 2014 at 7:29 AM, Alexey Petrushin < alexey.petrus...@gmail.com> wrote: > Ha-ha, very good example, compare this async version it with the sync > version below, and tell me that there's no problem with > callbacks """if you know how to deal with it""" :D > > Not saying that in even

[nodejs] tty.ReadStream bug on Node.js 0.11

2014-09-23 Thread Alexandre Strzelewicz
Currently we are working with a library called pty.js that allows us to use fork_pty in Node.js Everything works well with Node 0.10 but it doesn't with the 0.11. We deeply inspected the C++ code to interact with fork_pty, everything works as expected (0.11 or 0.10), file descriptors, file are

Re: [nodejs] Node.js Addon Examples with V8 Version 3.22

2014-09-23 Thread blazs
Thanks, this is helpful! Dramatic changes in the V8 API are giving me a headache. Suppose I have the following scenario. I wrapped a C++ object v of type NodeJsVec and I want an operation shuffle() so that var w = v.shuffle(); gives me a new vector w, which is a randomly shuffled vector v. How

Re: [nodejs] Callback hell and how to get around it?

2014-09-23 Thread Tom Boutell
You won't catch me suggesting streamline isn't a good idea, since the sublimetext snippets I'm using can be thought of as a crude implementation of streamline. What I prefer about them is that I don't have to integrate any preprocessors into my workflow for front or back-end code. On Tue, Sep 23,

Re: [nodejs] Node.js Addon Examples with V8 Version 3.22

2014-09-23 Thread Matt
Have you looked into using Nan? https://github.com/rvagg/nan On Tue, Sep 23, 2014 at 3:48 AM, blazs wrote: > Hi, > > I am looking for Node.js C++ Addon examples, written for v0.12 version of > the Node.js --- the one that uses V8 version 3.22. There are major changes > between V8 3.14 and V8 3.2

Re: [nodejs] Node.js Addon Examples with V8 Version 3.22

2014-09-23 Thread Fedor Indutny
Hello! Have you seen: https://github.com/joyent/node/blob/master/doc/api/addons.markdown#hello-world Cheers. On Tue, Sep 23, 2014 at 11:48 AM, blazs wrote: > Hi, > > I am looking for Node.js C++ Addon examples, written for v0.12 version of > the Node.js --- the one that uses V8 version 3.22.

Re: [nodejs] Callback hell and how to get around it?

2014-09-23 Thread Alexey Petrushin
Ha-ha, very good example, compare this async version it with the sync version below, and tell me that there's no problem with callbacks """if you know how to deal with it""" :D Not saying that in even such a simple code it's extremely easy to make small errors like missing `else` statements etc.

Re: [nodejs] Callback hell and how to get around it?

2014-09-23 Thread Matt
On Mon, Sep 22, 2014 at 9:37 PM, Tom Boutell wrote: > There's an important difference though. With a regular "if" statement > in synchronous code, if there is no else clause, that doesn't prevent > the next line *after* the if from executing. With an "if" statement in > synchronous code, every po

[nodejs] Re: socket.io over https memory leak issue

2014-09-23 Thread 张大伟
Hi Our team is now facing this problem, that a big memory leak, when sixteen users visit our website, the memory was rose 350 MB :( and the version of the socket.io that we use is 0.9, which version you are using. -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/

[nodejs] Node.js Addon Examples with V8 Version 3.22

2014-09-23 Thread blazs
Hi, I am looking for Node.js C++ Addon examples, written for v0.12 version of the Node.js --- the one that uses V8 version 3.22. There are major changes between V8 3.14 and V8 3.22, and I'd like to update my code for V8 3.22 as soon as possible. Examples on the official GitHub repository are v