Re: [nodejs] Re: How to avoid callback hell?

2012-04-11 Thread Mark Hahn
> A language that doesn't even get its scoping at least somewhat right is a no-go for me . Any yet you use a language that defaults everything to global. The lack of the var statement is the only thing wrong with scoping at the moment and I showed you a nice workaround. Otherwise scoping is mo

Re: [nodejs] Re: Node.js vs Ruby on Rails

2012-04-11 Thread Mark S
You would if you were paying for the infrastructure. Speed is an important factor in user experience and SEO elevation. Also, if you use PageSpeed, YSlow or Chrome's tools you'll end up writing xHTML and CSS much better - most sites can be rewritten with 50% or less of the markup. The obvious c

Re: [nodejs] Re: How to avoid callback hell?

2012-04-11 Thread Axel Kittenberger
> Any yet you use a language that defaults everything to global. Its not like you got much choice when you do client-side web development. Default to local is IMHO not any better than default to global. Why default to anything? Jhint warns nicely about any default to globals. > The lack of the va

[nodejs] Meteor,what you think

2012-04-11 Thread Nikolay Yasinskiy
meteor.com/screencast meteor.com/examples -- 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 n

Re: [nodejs] Re: How to avoid callback hell?

2012-04-11 Thread Mark Hahn
You would obviously be happy with Erlang. Can't you code server-side in Erlang? -- 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.

Re: [nodejs] How do you execute a function asynchronously?

2012-04-11 Thread Jeremy Rudd
Hi all, threads_a_gogo sounds cool, but what are the technical details of using it? 1. What does it use in the back-end to schedule / manage tasks? child_process? 2. child_process takes some 30 ms to spawn a child thread. How much time does GoGo take? 3. How does it internally work? Are there c

Re: [nodejs] Meteor,what you think

2012-04-11 Thread Marak Squires
Looks neat, but the license is GPL. In the faq, it says: If the GPL doesn't work for your project, get in touch (cont...@meteor.com) > and we will write you a commercial license to your specifications. We are > happy to be flexible. What's important is that we have a conversation about > how you

Re: [nodejs] Re: How to avoid callback hell?

2012-04-11 Thread Axel Kittenberger
I've code sharing between server and client. So unless Erlang translates to Javascript, node.js is the way to go. On Wed, Apr 11, 2012 at 9:37 AM, Mark Hahn wrote: > You would obviously be happy with Erlang.  Can't you code server-side in > Erlang? > > > -- > Job Board: http://jobs.nodejs.org/ >

Re: [nodejs] [ANN] Calango.js: Build native apps in Node + HTML5

2012-04-11 Thread Brandon Benvie
This excites me On Tuesday, April 10, 2012 9:35:14 PM UTC-4, Roger Wang wrote: Currently we are integrating it with CEF and it will be available on > Linux/Windows/OSX soon. > > -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-G

Re: [nodejs] HTML to PDF

2012-04-11 Thread mlegenhausen
@alan When you simply want to convert webpages to PDF then phantomjs fits better. We use wkhtmltopdf for generating invoices from a html template, where we need features like headers and footers that are placed on each site. Such a feature (as long as a I know) is not available in phantomjs. --

[nodejs] Re: [ANN] Calango.js: Build native apps in Node + HTML5

2012-04-11 Thread Morteza Milani
Hi, Good to see another project working on this idea. This is exactly what I'm working at http://github.com/milani/appjs! Appjs uses GTK to bring GUI stuff to nodejs and I'm working on using CEF with it ( currently I'm using webkit ). Good Luck! On Saturday, April 7, 2012 2:56:03 AM UTC+4:30

Re: [nodejs] Re: How to avoid callback hell?

2012-04-11 Thread Richard Marr
On 10 April 2012 14:46, Bruno Jouhier wrote: > It's like you have to follow the dogma and the last thing you should do is > try things out and make up your own mind. > > Come on guys, I don't care if you'll end up using streamline or not but > please BE CURIOUS AND TRY THINGS OUT. Considering

Re: [nodejs] Re: How to avoid callback hell?

2012-04-11 Thread Isaac Schlueter
Trying stuff out is great. Do that. Also, you should learn JavaScript. It's unavoidable, after all, so you'll always end up dealing with it somehow. (For similar reasons, you should learn C as well.) A lot of people seem to be ok with using JavaScript without any meta language in front of it.

Re: [nodejs] How do you execute a function asynchronously?

2012-04-11 Thread Jorge
On Apr 11, 2012, at 9:40 AM, Jeremy Rudd wrote: > On 4/10/2012 6:09 PM, Jorge wrote: >> That's exactly what threads_a_gogo is for: >> >> >> >> It lets you run these calculations in parallel, in javascript, in threads, >> and using all the available CPU

Re: [nodejs] Re: How to avoid callback hell?

2012-04-11 Thread Mariusz Nowak
Adding to what Isaac said. Many of us have gone through "callback hell" and don't have that problem anymore, it's not Node.js or JavaScript issue. Check available solutions, listen to those who've been there. Important note: asynchronous programming requires some time to get with it, and it will

Re: [nodejs] Re: How to avoid callback hell?

2012-04-11 Thread Nuno Job
>> Streamline is more for people who write applications than for library writers. Thanks for putting that crystal clear Bruno. It's very positive when people say what their tools are good for, and not so adequate for imho. The way you write your applications is entirely up to you, and you are alw

[nodejs] Re: Should a binding module support multiple Node versions

2012-04-11 Thread christkv
there are still tons off people using 0.4 which is somewhat annoying and I assume it will get a lot worse as 0.8 comes out. I plan on only supporting current version + last. so once 0.8 is out the mongodb driver will stop support for 0.4.X actively. On Apr 11, 5:12 am, Nathan Rajlich wrote: > You

[nodejs] Re: Should a binding module support multiple Node versions

2012-04-11 Thread Liam
There have been 15 bugfix releases for 0.6 in 5 months. That might have affected migration somewhat. On Apr 11, 3:38 am, christkv wrote: > there are still tons off people using 0.4 which is somewhat annoying > and I assume it will get a lot worse as 0.8 comes out. I plan on only > supporting curr

Re: [nodejs] HTML to PDF

2012-04-11 Thread Dean Landolt
On Wed, Apr 11, 2012 at 4:18 AM, mlegenhausen wrote: > @alan When you simply want to convert webpages to PDF then phantomjs fits > better. We use wkhtmltopdf for generating invoices from a html template, > where we need features like headers and footers that are placed on each > site. Such a featu

Re: [nodejs] Understanding the v8-profiler output

2012-04-11 Thread Ben Noordhuis
On Wed, Apr 11, 2012 at 13:41, Satyam Shekhar wrote: > Hi, > > I am trying to understand the output of the v8 profiler. Below is the > profiler output for my app. > > I have the following doubts. > > 1. What are unaccounted ticks? The profiler is sampling based. That is, it wakes up at regular in

[nodejs] Re: nodejs throughput verses custom server, scaling question to someone with experience.

2012-04-11 Thread christkv
if perf is dropping over time I suspect a possible memory leak causing the gc to have to go through longer and longer of uncollectable items. it might be worth just writing a simple test app dropping mongoskin and hitting the driver directly. On Apr 11, 12:12 am, timp wrote: > Oh well, thanks fo

[nodejs] Re: Meteor,what you think

2012-04-11 Thread Bradley Meck
Very interesting, but im worried about XSS attacks and form refreshes since it is automatically sharing/refreshing parts of the page. On Wednesday, April 11, 2012 2:16:28 AM UTC-5, Nikolay Yasinskiy wrote: > > meteor.com/screencast > meteor.com/examples -- Job Board: http://jobs.nodejs.org/ Po

Re: [nodejs] Understanding the v8-profiler output

2012-04-11 Thread Satyam Shekhar
> > > > I am trying to understand the output of the v8 profiler. Below is the > > profiler output for my app. > > > > I have the following doubts. > > > > 1. What are unaccounted ticks? > > The profiler is sampling based. That is, it wakes up at regular > intervals (ticks) and records where the ins

Re: [nodejs] Re: Meteor,what you think

2012-04-11 Thread Joshua Cohen
It's an interesting concept, and certainly impressive from a technological perspective in many respects. That being said, it seems so prone to exploit on a number of levels. They had to take down the demo that was running last night because someone had the bright idea of basically inserting items i

Re: [nodejs] Re: How to avoid callback hell?

2012-04-11 Thread Jann Horn
Am Sonntag, den 08.04.2012, 22:48 -0700 schrieb Mark Hahn: > In coffeescript it is only nesting heck. And in coco, it is often not even nesting heck. :) coffeescript: foo (resultA) -> bar (resultB) -> baz() coco: (resultA) <- foo! (resultB) <- bar! baz! signature.asc Description: This

Re: [nodejs] Understanding the v8-profiler output

2012-04-11 Thread Ben Noordhuis
On Wed, Apr 11, 2012 at 15:02, Satyam Shekhar wrote: >> The profiler is sampling based. That is, it wakes up at regular >> intervals (ticks) and records where the instruction pointer is. If the >> IP points to an address that cannot be resolved to a function, the >> tick is reported as unaccounted

Re: [nodejs] Re: How to avoid callback hell?

2012-04-11 Thread Jann Horn
Am Dienstag, den 10.04.2012, 20:14 +0200 schrieb Axel Kittenberger: > On Tue, Apr 10, 2012 at 3:37 PM, Yi Tan wrote: > > you really should spend a few hours learning coffee script if the js > > callback syntax make you uncomfortable > > Unless coffee script fixes its "implicit local variable is g

[nodejs] Coffeescript line numbers

2012-04-11 Thread Jann Horn
Am Dienstag, den 10.04.2012, 18:50 -0700 schrieb Mikeal Rogers: > > I'm working at the app level and I have 10,000 lines of coffeescript. I > > can't imagine coding all that in javascript. > > I have about 10 times that in javascript and it's quite easy, when things > break I even get line numb

Re: [nodejs] Re: Meteor,what you think

2012-04-11 Thread Chris Rhoden
I don't think that the security concerns are any more of an issue than they are with any other platform (including one you build yourself). If you have a JS api on the client side which is somewhat capable, it's going to be an issue. On Wed, Apr 11, 2012 at 9:46 AM, Joshua Cohen wrote: > It's an

Re: [nodejs] "return callback(...);" vs "callback(...); return;"

2012-04-11 Thread Mark Volkmann
On Tue, Apr 10, 2012 at 6:17 PM, Ken wrote: > Assuming that the callback doesn't return a value, does v8 behave any > differently when invoking callbacks in one of these forms vs. the other?  I > find the first approach to be a convenient shorthand in many cases, but am > wondering (after observin

Re: [nodejs] Meteor,what you think

2012-04-11 Thread Chris Rhoden
On Wed, Apr 11, 2012 at 4:04 AM, Marak Squires wrote: > Looks neat, but the license is GPL. > > In the faq, it says: > > If the GPL doesn't work for your project, get in touch (cont...@meteor.com) >> and we will write you a commercial license to your specifications. We are >> happy to be flexible.

Re: [nodejs] Meteor,what you think

2012-04-11 Thread Marak Squires
*cue 30 responses disagreeing about licensing* On Wed, Apr 11, 2012 at 7:31 AM, Chris Rhoden wrote: > > > On Wed, Apr 11, 2012 at 4:04 AM, Marak Squires wrote: > >> Looks neat, but the license is GPL. >> >> In the faq, it says: >> >> If the GPL doesn't work for your project, get in touch ( >>> c

Re: [nodejs] Meteor,what you think

2012-04-11 Thread Jann Horn
Am Mittwoch, den 11.04.2012, 07:33 -0700 schrieb Marak Squires: > *cue 30 responses disagreeing about licensing* I just wanted to ask why you're opposed to the GPL... :D signature.asc Description: This is a digitally signed message part

[nodejs] Any good rest module?

2012-04-11 Thread Alan Hoffmeister
I was thinking about something like this on the server side: rest-module.on('hello', function(req, res, data){ res.send('Hello ' + data.world); }); And on the client side: $('#button').click(function(){ var data = { world : 'world' }; rest-module.emit('hello', data, function(res){

Re: [nodejs] Any good rest module?

2012-04-11 Thread Matt
Looks like you want socket.io Matt. On Wed, Apr 11, 2012 at 10:58 AM, Alan Hoffmeister < alanhoffmeis...@gmail.com> wrote: > I was thinking about something like this on the server side: > > rest-module.on('hello', function(req, res, data){ > res.send('Hello ' + data.world); > }); > > And on

Re: [nodejs] Re: Meteor,what you think

2012-04-11 Thread john.tiger
+1 an interesting start but needs serious attention to security. Some are comparing it to Clipper, dBase, FoxPro (before MS bought it) - those were great products (I'm old enough to have used them) and built lots of productive apps, BUT, those were all pre-web, pre-wireless, pre-cloud where s

[nodejs] Re: Any good rest module?

2012-04-11 Thread Alan Hoffmeister
Yep I could use it, but keep a persistent connection for every visitor will consume a lot more resources from the server then a restfull service. Em quarta-feira, 11 de abril de 2012, Matt escreveu: > Looks like you want socket.io > > Matt. > > > On Wed, Apr 11, 2012 at 10:58 AM, Alan Hoffmeister

Re: [nodejs] Understanding the v8-profiler output

2012-04-11 Thread Matt
On Wed, Apr 11, 2012 at 9:55 AM, Ben Noordhuis wrote: > > I mean when the profiler wakes up, it would look at a call trace right? > Are > > the lines logged in the JS section at the top of the stack? > > This can be misleading since the call stack might have changed due to > > setTimeouts. I want

Re: [nodejs] Re: Any good rest module?

2012-04-11 Thread Matt
On Wed, Apr 11, 2012 at 11:16 AM, Alan Hoffmeister < alanhoffmeis...@gmail.com> wrote: > Yep I could use it, but keep a persistent connection for every visitor > will consume a lot more resources from the server then a restfull service. a) That's why you're using Node - it copes with massive con

Re: [nodejs] Understanding the v8-profiler output

2012-04-11 Thread Satyam Shekhar
On Wed, Apr 11, 2012 at 7:25 PM, Ben Noordhuis wrote: > On Wed, Apr 11, 2012 at 15:02, Satyam Shekhar > wrote: > >> The profiler is sampling based. That is, it wakes up at regular > >> intervals (ticks) and records where the instruction pointer is. If the > >> IP points to an address that cannot

Re: [nodejs] "return callback(...);" vs "callback(...); return;"

2012-04-11 Thread Tim Caswell
I also initially preferred approach B "{callback();return}", but now use approach A "return callback()". Yes there is a slight difference under the hood, at least in the initial abstract syntax tree. Usually this is done in an async callback where the return value is going to be ignored anyway.

RE: [nodejs] Re: Any good rest module?

2012-04-11 Thread Glenn Block
You can't get the callback functionality without 1. Long polling 2. WebSockets You need to do one on the two if you want the server to call back the client. NowJs or DNode is what I would recommend Sent from my Windows Phone -- From: Alan Hoffmeister Sent: 4/11/2012

Re: [nodejs] "return callback(...);" vs "callback(...); return;"

2012-04-11 Thread Joshua Cohen
My preference for option A is because it leaves less room for errors to creep in. If the invocation of a callback should end processing in a given branch, then it should be coupled directly with a return. If you do callback(...); return;, there's a chance that later on someone might stick some logi

Re: [nodejs] "return callback(...);" vs "callback(...); return;"

2012-04-11 Thread Mark Hahn
> there's a chance that later on someone might stick some logic between the invocation of the callback and the return statement I view that as an argument for B. I find it easier to add code before the return with case B. This is similar to the need to allow commas at the end of lists. You ca

Re: [nodejs] Re: Keeping HTTP connection alive even if there are no more requests

2012-04-11 Thread Jann Horn
On Mon, Apr 09, 2012 at 03:00:56PM -0700, Jimb Esser wrote: > We ran into this same thing, and I ended up just writing a small patch > to the HTTPS agent to hold on to https sockets for 10 seconds after a > request finished. This ended up roughly tripling our SimpleDB > performance (back to Node 0

Re: [nodejs] "return callback(...);" vs "callback(...); return;"

2012-04-11 Thread Joshua Cohen
Yes, and it's easy enough for me to not be stupid, but who can say what the next person maintaining my code might do ;). At the end of the day there's not a huge difference between options A and B, so any preference for one or the other can easily be questioned, I tend to err on the side of trying

[nodejs] Re: Meteor,what you think

2012-04-11 Thread rhasson
Overall very interesting and looks promising. Like many on here already stated, how they address security will be interesting. Talking directly to the DB (as shown in the screencast) opens the door to a lot of concern. In a client->server->db model at least you have the server abstracting acce

Re: [nodejs] "return callback(...);" vs "callback(...); return;"

2012-04-11 Thread Mark Hahn
> At the end of the day there's not a huge difference between options A and B, Of course. I just like to argue, which is slightly different than being a troll. -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You rec

Re: [nodejs] Re: Meteor,what you think

2012-04-11 Thread Naouak
Getting access directly to database in my opinion is not a feature but a serious flaw. So many easy exploits doable like that. I have also concerns about accessibility and SEO. Naouak, Grade 2 de Kobal. Site web: http://www.naouak.net On Wed, Apr 11, 2012 at 19:24, rhasson wrote: > Overall ve

Re: [nodejs] Re: Meteor,what you think

2012-04-11 Thread Mark Hahn
I had to include the functionality of meteor in my app, including direct access to the db. In order to do this I am proxying the db access through node and checking permissions. If couchdb's permissions didn't suck so much I could have gone direct. -- Job Board: http://jobs.nodejs.org/ Posting

Re: [nodejs] Re: Meteor,what you think

2012-04-11 Thread Chris Rhoden
This isn't actually direct, that's not the way that, for instance, mongodb works. I wasn't going to say anything but it's clear that this is a misconception lots of people have. The database is necessarily proxied through the server side application for all datastores aside from couchdb at this ti

[nodejs] Better async loop

2012-04-11 Thread Tim Price
How would one better write this function? Array.prototype.forLoop = function(worker, callBack) { var self = this; var returnData = []; var loop = function(i) { if(i === self.length) { return callBack(returnData); } process.nextTick(function() { worker.call(self, self[i], function(d) { returnData

Re: [nodejs] Better async loop

2012-04-11 Thread Tim Caswell
That depends on what you want it to do. This seems to execute each item serially. You can do them all parallel and abort on the first error like this: function asyncForEach(array, worker, callback) { var len = array.length; var results = new Array(l); if (!len) return callback(null, result

Re: [nodejs] Better async loop

2012-04-11 Thread Tim Price
I Wanted to keep the items in serially, as im trying to break the stack. Your asyncForEach is at the end of the day synchronous loop just like any other forloop. On Wednesday, April 11, 2012 3:33:18 PM UTC-4, Tim Caswell wrote: > > That depends on what you want it to do. This seems to execute e

Re: [nodejs] Node.js Base64 Image decoding and writing to file

2012-04-11 Thread Jann Horn
On Thu, Apr 05, 2012 at 04:57:30PM -0700, Mehdi Avdi wrote: > I'm sending the contents of this Flex form (Don't ask why) over to node. > There is a post paramteter called "photo" which is a base64 encoded image. > > Contents of photo get sent over ok. Problem is when I am trying to decode > the

Re: [nodejs] Better async loop

2012-04-11 Thread Tim Caswell
If you just want to keep the stack from growing a simple while or for loop is much easier. var items = [1,2,3,4]; function forEach(items, worker) { for (var i = 0, l = items.length; i < l; i++) { worker(items[i], i, items); } } forEach(items, function (value, index, array) { }); or just

Re: [nodejs] Better async loop

2012-04-11 Thread Tim Caswell
My point being that you're showing your worker has a callback. If there is a callback then I assume it's an async function. The callback will already be called in a new stack. There is no need to use nextTick to break the stack. If the worker is a sync function then it should return it's value i

Re: [nodejs] Re: Meteor,what you think

2012-04-11 Thread Matt
How does Meteor work across a cluster (or local multi-cpu "cluster.js") installation? Matt. -- 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 "no

[nodejs] When fibers beat handwritten callbacks by 10 to 1

2012-04-11 Thread Bruno Jouhier
https://gist.github.com/2362015 fibers: 10 times faster! callbacks generated by streamline: almost 2 times faster!!! (find out why!) Bruno -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message bec

Re: [nodejs] Better async loop

2012-04-11 Thread Tim Price
OK good point. The stack would be the wrong word. What im trying to do is push eash loop around the array to be in a new cycle around node loop. I'm trying to keep node event loop running fast. The "asyncForEach" can take as long as it need, it would be bulk work. I dont want to through 1000+

Re: [nodejs] Re: vHosts, someone?

2012-04-11 Thread Alan Hoffmeister
Ok guyz, node-http-proxy just did it, awesome! Now I have a multi website server running 100% javascript, whit socket.io support out of the box. Just an off-topic question now: how about mongodb? Any idea how could I get one instance for each website? If I run one instance per site my t1.micro box

Re: [nodejs] When fibers beat handwritten callbacks by 10 to 1

2012-04-11 Thread Jann Horn
On Wed, Apr 11, 2012 at 01:22:42PM -0700, Bruno Jouhier wrote: > https://gist.github.com/2362015 > > fibers: 10 times faster! Uhm... ok, what? > callbacks generated by streamline: almost 2 times faster!!! (find out why!) Erm... I like streamlinejs, but I don't see how it can be faster than the

Re: [nodejs] Understanding the v8-profiler output

2012-04-11 Thread Ben Noordhuis
On Wed, Apr 11, 2012 at 17:22, Satyam Shekhar wrote: > Hmm.. So here is another question just to pester you more. :).. > > Lets suppose a function in my app(iin JS) has this code: > > var cpp_binding = require('./cpp-binding'); > function js_fn() { >    cpp_binding.execute(); > } > > Now when the

Re: [nodejs] question regarding googletalk: Node.js: JavaScript on the Server

2012-04-11 Thread Jann Horn
On Wed, Apr 04, 2012 at 09:54:27PM -0700, reinvent wrote: > im on windows7 node.js version v0.6.13 > > stat('etc/passwd', function(err, s){ On this line, replace 'etc/passwd' with the name of some file in the same folder as your node script. pgp9AYiMxbE07.pgp Description: PGP signature

Re: [nodejs] When fibers beat handwritten callbacks by 10 to 1

2012-04-11 Thread Mark Hahn
Anything is faster than code with a process.nextTick(). The callback example should be rewritten to not use it. -- 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 t

Re: [nodejs] Understanding the v8-profiler output

2012-04-11 Thread Ben Noordhuis
On Wed, Apr 11, 2012 at 17:18, Matt wrote: > Couldn't a much more accurate profiler be built using the debugger hooks? It > would be massively slower but should be 100% accurate and allow line-by-line > profiling like perl's Devel::NYTProf. I don't think you'll get meaningful numbers that way. Ea

Re: [nodejs] Better async loop

2012-04-11 Thread Tim Caswell
Ok, so you have a large array and want to do some work on it but break up the work across several ticks? That's fine. I still don't understand why your workers have a callback if they are sync. So assuming sync workers you could do something like: var queue = [1,2,3,4,5]; function processSlowl

Re: [nodejs] When fibers beat handwritten callbacks by 10 to 1

2012-04-11 Thread Jann Horn
On Wed, Apr 11, 2012 at 02:11:24PM -0700, Mark Hahn wrote: > Anything is faster than code with a process.nextTick(). The callback > example should be rewritten to not use it. I thought so, too - but that gives you a stack overflow. :D Seems like you'd have to do a process.nextTick() depending on

Re: [nodejs] Understanding the v8-profiler output

2012-04-11 Thread Satyam Shekhar
> Also, in the profiler output I sent I dont have any ticks in C++ section, > > however I m using bindings (node-expat, compress-buffer). > > Why could have that happened? > > Modules are loaded with dlopen(). I don't think the V8 profiler > handles that, time spent in them will be counted towards

Re: [nodejs] When fibers beat handwritten callbacks by 10 to 1

2012-04-11 Thread Mikeal Rogers
node includes a bunch of great benchmarks for fairly real world performance issues, this is not one. if you want to try and be faster than callbacks i would suggest you use a real benchmark. On Apr 11, 2012, at April 11, 20122:15 PM, Jann Horn wrote: > On Wed, Apr 11, 2012 at 02:11:24PM -0700,

[nodejs] Re: When fibers beat handwritten callbacks by 10 to 1

2012-04-11 Thread mscdex
On Apr 11, 5:22 pm, Mikeal Rogers wrote: > node includes a bunch of great benchmarks for fairly real world performance > issues, this is not one. > > if you want to try and be faster than callbacks i would suggest you use a > real benchmark. +1 -- Job Board: http://jobs.nodejs.org/ Posting gu

Re: [nodejs] Node.js IDE for iPad

2012-04-11 Thread Ryan Schmidt
On Apr 8, 2012, at 02:31, Srirangan wrote: > Cloud9IDE (http://c9.io/) comes to mind, but there are many others out there > that you can check out. Many of them are open-source as well. I've looked at the Cloud9IDE web site and screencast and it looks very promising. I like what they're trying

Re: [nodejs] "return callback(...);" vs "callback(...); return;"

2012-04-11 Thread Ken Woodruff
Tim Caswell wrote: > Yes there is a slight difference under the hood, at least in the initial > abstract syntax tree. Usually this is done in an async callback where the > return value is going to be ignored anyway. > Is there an easy (or at least not ridiculously hard) way to get node to spit

Re: [nodejs] Understanding the v8-profiler output

2012-04-11 Thread Ben Noordhuis
On Wed, Apr 11, 2012 at 23:16, Satyam Shekhar wrote: >> Modules are loaded with dlopen(). I don't think the V8 profiler >> handles that, time spent in them will be counted towards the main node >> binary. > > This makes it really difficult. If a binding in my app is consuming lot of > ticks, profi

Re: [nodejs] Node.js IDE for iPad

2012-04-11 Thread Ben Noordhuis
On Thu, Apr 12, 2012 at 00:05, Ryan Schmidt wrote: > On Apr 8, 2012, at 02:31, Srirangan wrote: >> Cloud9IDE (http://c9.io/) comes to mind, but there are many others out there >> that you can check out. Many of them are open-source as well. > > I've looked at the Cloud9IDE web site and screencast

[nodejs] announcing gsub

2012-04-11 Thread Zachary Scott
Happy Wednesday everyone, I'm pleased to announce gsub[1]! This minute command-line utility is designed to recursively search any directory and replace all occurrences of the pattern substituted for the second argument. You'll need to have `sed` and `find` available for child_process.exec() Then,

Re: [nodejs] When fibers beat handwritten callbacks by 10 to 1

2012-04-11 Thread Mark Hahn
> I thought so, too - but that gives you a stack overflow. That code would give an overflow, that's why I'm saying it should be rewritten. You can't argue it is impossible because streamline does it without process.nextTick() or stack overflow. -- Job Board: http://jobs.nodejs.org/ Posting gui

[nodejs] Re: When fibers beat handwritten callbacks by 10 to 1

2012-04-11 Thread Marco Rogers
I would've hoped you had more fortitude against the attacks on streamline then to start throwing around hastily designed benchmarks to prove your point. It sucks that the "sync-looking" advocates have to deal with the level of aggression they do here. I've expressed that to some people myself,

[nodejs] Chat: Sockets + Http

2012-04-11 Thread sparky
I'm working to create a simple chat demo that will send messages to flash clients over a socket connection. I also need to be able to tell node to send a message to all connected clients. Currently, I'm hitting the node http server with a browser to test this. I have the socket chat working, bu

Re: [nodejs] Better async loop

2012-04-11 Thread Ted Young
Total aside, but I often use a callback instead of returning a value, even for sync operations, if there is any chance at all something may become async in the future. It's a totally annoying to have to refactor EVERYWHERE anything that called the code, plus anything that called the code that c

Re: [nodejs] Better async loop

2012-04-11 Thread Tim Dickinson
Thanks for the snippet. I have taken your var result = new Array(length); to optimize the array. Why I use a function for the call back with the result is to play on the make call now get result latter. Really I'm using this function to update data in my database. Array.prototype.forLoop = fu

[nodejs] Re: Meteor,what you think

2012-04-11 Thread Chris
Nobody noticed the node-fibers dep? It'll be interesting to see the pressure build to get fibers/coroutines in core if this gains in popularity (likely if you look at the HN score). >From the docs: "Meteor gathers all your JavaScript files, excluding anything under the client and public subdirect

[nodejs] How do I define SMPP TLV

2012-04-11 Thread Hasan S.
Hi. How to create a SMPP TLV ? //user_message_reference smpp.tlv=0x001E; smpp.addTLV(0x001E,2,2); session.deliver_sm({ //sequence_number:pdu.sequence_number++, // service_type: "sms", //source_addr_ton: 1,

[nodejs] Re: Meteor,what you think

2012-04-11 Thread alessio_alex
I don't see any reason why fibers should be in the core. That's just some user preference, not an essential thing for Node. -- 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 sub

Re: [nodejs] How do you execute a function asynchronously?

2012-04-11 Thread Jeremy Rudd
Thanks Jorge! Fantastic information, it sounds like threads-a-gogo is the way to go. I'll use it and let you all know of my results. Thanks again! Jeremy On 4/11/2012 3:05 PM, Jorge wrote: On Apr 11, 2012, at 9:40 AM, Jeremy Rudd wrote: On 4/10/2012 6:09 PM, Jorge wrote: That's exactly wha