Re: [nodejs] Where exactly is the error?[Beginner]

2014-02-11 Thread Diogo Resende
Your “Code” part does not seem to have any problems, at least a missing “)”. 
You should really install a linter in your editor, you have unused vars and 
global pollution..

--  
Diogo Resende


On Tuesday 11 February 2014 at 19:14 , Anurag Prasad wrote:

  
  
  
 Code-
  
 var fs = require('fs');
 var sax = require('sax');
  
 parser = sax.parser(true);
  
 elements_array = [];  
 nodeCounter = -1;
  
 parser.onerror = function(e) {
 // an error happened.
   };
  
 parser.onopentag = function(node) {
 // opened a tag. node has name and attributes
 if (node.name (http://node.name) == 'node') {
   nodeCounter++;
   elements_array.push({
   group: 'nodes',
   data: { id: node.attributes.id (http://node.attributes.id), label: 
 node.attributes.label }
   });
  
 if (node.name (http://node.name) == 'edge') {
   nodeCounter++;
   elements_array.push({
   group: 'edges',
   data: { label: node.attributes.label, source: node.attributes.source, 
 target: node.attributes.target }
   });
  
 if (node.name (http://node.name) =='att') {
   var key = node.attributes.name (http://node.attributes.name);
   elements_array[nodeCounter].data.key = { type : node.attributes.type, 
 value: node.attributes.value};
 };
 };
  
   };
  
  parser.onend = function() {
 // parser stream is done, and ready to have more stuff written to it.
 console.log(XML has been parsed.\n);
   };
  
  
 try {
 var file_buf = fs.readFileSync('./graph.xml');
 parser.write(file_buf.toString('utf8')).close();
 } catch(ex) {
 // keep 'em silent
 }
  
 console.log(elements_array);
  
 --  
 --  
 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 nodejs@googlegroups.com 
 (mailto:nodejs@googlegroups.com)
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com)
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en
   
 ---  
 You received this message because you are subscribed to the Google Groups 
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com).
 For more options, visit https://groups.google.com/groups/opt_out.

-- 
-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
attachment: Screen Shot 2014-02-12 at 12.41.30 AM.png

Re: [nodejs] Re: ORM for Express.JS

2014-01-27 Thread Diogo Resende
I’m sorry to inform you but it depends on specific drivers. You have to install 
them as usual.

--  
Diogo Resende


On Monday 27 January 2014 at 10:43 , Oleksandr Knyga wrote:

 Try light-orm. Super simple ORM node.js wrapper for relational databases. It 
 does not depends on any specific driver, so you can connect to mysql, ms 
 server and so on..
 https://npmjs.org/package/light-orm
  
  
 воскресенье, 3 апреля 2011 г., 23:49:58 UTC+3 пользователь Alexey Ozerov 
 написал:
  Hi All,
  At the moment I know only one ORM project for Node.JS and Redis: it's
  nohm project at https://github.com/maritz/nohm.
  Do you know another nohm-like projects, especially for Express.JS?
  BR,
  Alexey Ozerov.
 --  
 --  
 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 nodejs@googlegroups.com 
 (mailto:nodejs@googlegroups.com)
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com)
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en
   
 ---  
 You received this message because you are subscribed to the Google Groups 
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com).
 For more options, visit https://groups.google.com/groups/opt_out.

-- 
-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [nodejs] Subfolder as different app?

2013-08-21 Thread Diogo Resende
app = express();
your_other_express_app = express();
// ...
app.use(/subfolder, your_other_express_app);

-- 
Diogo Resende


On Wednesday, August 21, 2013 at 21:41 , Jose Luis Rivas wrote:

 Hey guys,
 
 I have site.com (http://site.com) which is running Express. Is there a way to 
 have
 site.com/subfolder (http://site.com/subfolder) as a different app? Has anyone 
 any experience on
 this? I'm trying to make the site.com (http://site.com) Express app don't 
 grow any bigger
 but keep it separated with a different stack.
 
 -- 
 Jose Luis Rivas
 http://joseluisrivas.net/
 
 -- 
 -- 
 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 nodejs@googlegroups.com 
 (mailto:nodejs@googlegroups.com)
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com)
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com).
 For more options, visit https://groups.google.com/groups/opt_out.
 
 


-- 
-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [nodejs] Announcing JS-Git and related projects.

2013-06-13 Thread Diogo Resende
+1 for all your work. It's always good to have people thinking about new ways 
of developing and improving code. Even if it's not widely adopted, it's good to 
have different paths to choose :)

-- 
Diogo Resende


On Thursday, June 13, 2013 at 20:54 , Tim Caswell wrote:

 As some of you know, and many of you do not, I've been spending the last few 
 months working on implementing git in javascript.
 
 I started out with a small, but successful [kickstarter] that enabled me to 
 quit my day job and work full time on JS-Git.  Since then I've worked with 
 others like Chris Dickinson on the project.  At this time, there is a node 
 CLI tool in npm called js-git-node (I'll probably rename to just js-git 
 or js-git-cli) that supports full clone.  I also have a chrome app that 
 shows one way the code can run in a non-node'js environment with minimal 
 changes. 
 
 The goal of the project is to give git to all JavaScript environments as a 
 set of modular packages.  I will target chrome apps, websites, node client 
 and servers, and anything else that makes sense. 
 
 While working on this project, I've developed many new interfaces for things 
 like streams and callbacks.  I didn't want to port the node APIs directly to 
 other platforms and instead took this opportunity to redesign from scratch 
 what I would have done for node in hindsight. 
 
 I'm now at the point where I'm very happy with the resulting API primitives.
 
 The new stream interface is called [min-stream] because is the minimal API 
 surface for streams (data or objects) with backpressure and protocol filters. 
  It's a lot simpler than node streams and can interop with node streams using 
 the [min-stream-node] library. 
 
 The stream interface is designed in such a way that creating a stream is 
 nothing more than creating a function with a certain behavior and signature.  
 Piping a stream source to a stream sink is just a normal function call.  
 There is no need for an 82 line [pipe] function to connect min-streams.  
 
 // The body of a TCP echo server in min-streams is simple
 socket.sink(socket.source);
 
 Another primitive that replaces callback-last-style in node is called 
 [continuables].  It's much closer to node callbacks than promises (in fact 
 all it takes to convert a node style function to a continuable is to use bind 
 to partially apply the non-callback arguments). 
 
 To convert setTimeout to continuable format is simply:
 
 function sleep(ms) {
   return function (callback) {
 setTimeout(callback, ms);
   };
 }
 
 Also of interest is integrating generators into continuables.  The next 
 v0.11.3 release of node should finally have full support for ES6 generators 
 (behind a flag for now) and chrome dev channel already has it (also behind a 
 flag).  By using a tiny 40 line helper library, it's trivial to write sync 
 style code that consumes native callback or continuable code with no build 
 step as I've done in the [gen-run] library. 
 
 Then using the sleep function above is as simple as:
 
 function* () {
   console.log(Waiting 1 second);
   yield sleep(1000);
   console.log(Done waiting)
 }
 
 I'm still working on js-git and am starting to make progress much faster now 
 that I've decided what APIs I want to build from and implemented most the 
 primitives.  Any of these sub-projects can be used standalone and probably 
 deserve their own announcement mail, but I'd rather not spam the list with 
 every project I release.  Follow me on twitter @creationix if you want that 
 level of traffic. 
 
 I do need your help.  In order to finish [js-git] in a timely manner, I need 
 to continue working on it full-time.  If you find this project worthwhile 
 and/or need it in your project, please show support by backing the fundraiser 
 on [bountysource]. (or better, getting your employer to sponsor) 
 
 There are so many awesome project ideas that have git in javascript as a 
 dependency.  I'm running out of money from the kickstarter (it's been months) 
 and will have to stop working on js-git and get a new job if I don't get more 
 funds soon. 
 
 This is an experiment to see if a person can live off making 100% open source 
 software that doesn't cater to any particular business.
 
 All software I've released in the open and is licensed MIT for anyone to use. 
  I have open discussion on IRC (#js-git) and twitter and the jsgit google 
 group every day looking for community feedback on the APIs. 
 
 Let me know what you think.
 
 -Tim Caswell
 
 [bountysource]: https://www.bountysource.com/#fundraisers/325-js-git 
 [js-git]: https://github.com/creationix/js-git
 [kickstarter]: http://www.kickstarter.com/projects/creationix/js-git
 [js-git-node]: https://github.com/creationix/js-git-node
 [min-stream]: 
 https://github.com/creationix/js-git/blob/master/specs/min-stream.md
 [min-stream-node]: https://github.com/creationix/min-stream-node
 [continuable]: 
 https://github.com

Re: [nodejs] [ANN] mysql-pg-proxy

2013-05-28 Thread Diogo Resende
You're sick dude.. you need to rest :)

-- 
Diogo Resende


On Tuesday, May 28, 2013 at 14:51 , Andrey wrote:

 https://github.com/sidorares/mysql-pg-proxy
 
 Simple mysql to postgresql proxy. Allows you to make pg queries from mysql 
 client.
 
 Andrey.
 
 
 -- 
 -- 
 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 nodejs@googlegroups.com 
 (mailto:nodejs@googlegroups.com)
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com)
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en
  
 --- 
 You received this message because you are subscribed to the Google Groups 
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com).
 For more options, visit https://groups.google.com/groups/opt_out.
  
  

-- 
-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] Mysql in a Loop?

2013-05-06 Thread Diogo Resende
Model.create in orm2 should be expecting an Array of Objects, not an Object.

-- 
Diogo Resende


On Saturday, May 4, 2013 at 21:57 , lars wrote:

 Hi,
 
 i just don't get my own script.
 
 I do this - with the help of underscore and node-orm2 etc... - 
 
 _.each(objectInDatabase, function(object, index)
 {
 Object.find({name:object.name (http://object.name)}, 1, function(err, 
 objects) {
 if ( objects.length  0 ) {
   console.log(objects); // found it!
   relatedObject.create({object_id:objects[0].id, found:1}); 
 // never got called? WHY?
 }
 });
 });
 
 But the create is never called... Why? I found so many answers to this 
 problems, but nothing helped..
 Because inside the loop, the data is there..
 
 -- 
 -- 
 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 nodejs@googlegroups.com 
 (mailto:nodejs@googlegroups.com)
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com)
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en
  
 --- 
 You received this message because you are subscribed to the Google Groups 
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com).
 For more options, visit https://groups.google.com/groups/opt_out.
  
  

-- 
-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] [ANN] LXJS 2013

2013-05-05 Thread Diogo Resende
On Sunday, May 5, 2013 at 19:32 , Nuno Job wrote:
 Hey,
 
 LXJS 2013 was a blast last year, with lots of fun from the links of substack, 
 mikeal and dshaw :)
 
Last year you mean 2012 :^) 

-- 
-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] NPM Readme vs Github Readme

2013-02-23 Thread Diogo Resende
It seems to work for me, the only thing that doesn't seem to highlight 
correctly is coffee script.

-- 
Diogo Resende


On Saturday, February 23, 2013 at 15:37 , Tim Caswell wrote:

 I would think the easiest route would be sending Isaac a pull request 
 (assuming the npm website is on github).  I can't imagine he would be against 
 making this match github's markdown features.
 
 
 On Fri, Feb 22, 2013 at 7:13 AM, Michal Srb xixi...@seznam.cz 
 (mailto:xixi...@seznam.cz) wrote:
  Hi,
  
  I was trying to find any information about this, but I couldn't. It seems 
  that NPM's README rendering (on NPM website), does not use Github flavored 
  markdown. How can I / should I practically include two separate README 
  files, one for github and one for npm? What is the best practice?
  
  For example of failure, compare:
  
  https://npmjs.org/package/metacoffee
  https://github.com/xixixao/meta-coffee
  
  Thanks,
  
  Michal
  -- 
  -- 
  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 nodejs@googlegroups.com 
  (mailto:nodejs@googlegroups.com)
  To unsubscribe from this group, send email to
  nodejs+unsubscr...@googlegroups.com 
  (mailto:nodejs%2bunsubscr...@googlegroups.com)
  For more options, visit this group at
  http://groups.google.com/group/nodejs?hl=en?hl=en
   
  --- 
  You received this message because you are subscribed to the Google Groups 
  nodejs group.
  To unsubscribe from this group and stop receiving emails from it, send an 
  email to nodejs+unsubscr...@googlegroups.com 
  (mailto:nodejs%2bunsubscr...@googlegroups.com).
  For more options, visit https://groups.google.com/groups/opt_out.
   
   
 
 -- 
 -- 
 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 nodejs@googlegroups.com 
 (mailto:nodejs@googlegroups.com)
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com)
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en
  
 --- 
 You received this message because you are subscribed to the Google Groups 
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com).
 For more options, visit https://groups.google.com/groups/opt_out.
  
  

-- 
-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] Loadbalancing multiple MySQL connections

2013-02-06 Thread Diogo Resende
A Pool feature just landed mysql module a few days ago. You can start there :)

-- 
Diogo Resende


On Wednesday, February 6, 2013 at 14:53 , lancore wrote:

 Hi,
 
 I need to create a pool of connections to multiple MySQL DBs (some of them 
 read-only), and balance the load between them.
 MySQL Proxy (http://dev.mysql.com/downloads/mysql-proxy/) pretty much sounds 
 exactly like the tool I need, but for various reasons I can't use it.
 
 Before I implement my own solution now, I thought I'm just going to ask if 
 there already is something similar out there I could use in node.js? 
 
 -- 
 -- 
 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 nodejs@googlegroups.com 
 (mailto:nodejs@googlegroups.com)
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com)
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en
  
 --- 
 You received this message because you are subscribed to the Google Groups 
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com).
 For more options, visit https://groups.google.com/groups/opt_out.
  
  

-- 
-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] Re: Javascript Class Specification for the next generation of JS class system, hope to discuss with you.

2013-02-01 Thread Diogo Resende
Nobody said OOP and classes are flawed. OOP is a lot more than classes, and 
having support for classes is not necessary for the language to be OOP.

-- 
Diogo Resende


On Thursday, January 31, 2013 at 21:06 , Dan Milon wrote:

 Kinda offtopic:
 
 I see a lot of people here mention OOP and classes are flawed.
 Does anyone have some reading to suggest about OOP and its issues? Maybe
 some comparison with functional programming.
 
 danmilon.
 
 On 01/31/2013 10:10 PM, Diogo Resende wrote:
  +1. Java people should really read and learn about OOP before
  associating it to just classes..
  
  -- 
  Diogo Resende
  
  On Thursday, January 31, 2013 at 19:48 , Geerten van Meel wrote:
  
   In case you are wondering why you don't recieve a lot of love in this
   topic, let me elaborate: You are trying to fix something which is not
   broken, at least in the eyes of many that are reading this. You are
   trying to make JavaScript more like Java by turning everything into
   classes. 
   
   Things are not broken though. The CommonJS (~npm) and AMD (browser)
   approaches are actually quite elegant in their respective environments
   and allow to encapsule simple functionality into a module without
   considerable overhead. While it is good that you gave something like
   this a decent amount of thought, you may be barking up the wrong tree
   here by turning JavaScript into Java.
   
   On Wednesday, January 30, 2013 12:15:20 PM UTC+1, fengchu...@gmail.com 
   (http://gmail.com)
   http://gmail.com wrote:
Hi, Senior JS fans

I am a senior Java/JS developer about 12 year+. I recently wrote a
specification named JCS. The goal of this specification is replace
the currently popular of CommonJS or RequireJS for building the next
generation of full object-oriented class system. The first
implementation of the specification is JSDK1.0:
https://github.com/fch415/jtdk


The specification is still evolving, welcome yousuggest improvements!

JCS 1.0 document:
https://github.com/fch415/jss/blob/master/%231/jss%231_jcs_en.md
https://github.com/fch415/jss/blob/master/%231/jss%231_jcs_en.md

Sincerely,
FengChun

   
   
   -- 
   -- 
   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 nodejs@googlegroups.com 
   (mailto:nodejs@googlegroups.com)
   mailto:nodejs@googlegroups.com
   To unsubscribe from this group, send email to
   nodejs+unsubscr...@googlegroups.com 
   (mailto:nodejs+unsubscr...@googlegroups.com)
   mailto:nodejs+unsubscr...@googlegroups.com
   For more options, visit this group at
   http://groups.google.com/group/nodejs?hl=en?hl=en
   
   ---
   You received this message because you are subscribed to the Google
   Groups nodejs group.
   To unsubscribe from this group and stop receiving emails from it, send
   an email to nodejs+unsubscr...@googlegroups.com 
   (mailto:nodejs+unsubscr...@googlegroups.com)
   mailto:nodejs+unsubscr...@googlegroups.com.
   For more options, visit https://groups.google.com/groups/opt_out.
   
   
   
  
  
  -- 
  -- 
  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 nodejs@googlegroups.com 
  (mailto:nodejs@googlegroups.com)
  To unsubscribe from this group, send email to
  nodejs+unsubscr...@googlegroups.com 
  (mailto:nodejs+unsubscr...@googlegroups.com)
  For more options, visit this group at
  http://groups.google.com/group/nodejs?hl=en?hl=en
  
  ---
  You received this message because you are subscribed to the Google
  Groups nodejs group.
  To unsubscribe from this group and stop receiving emails from it, send
  an email to nodejs+unsubscr...@googlegroups.com 
  (mailto:nodejs+unsubscr...@googlegroups.com).
  For more options, visit https://groups.google.com/groups/opt_out.
  
  
  
 
 
 -- 
 -- 
 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 nodejs@googlegroups.com 
 (mailto:nodejs@googlegroups.com)
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com)
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr

Re: [nodejs] Breaking away from the procedural structure of method calling

2013-02-01 Thread Diogo Resende
Your pastie has an obvious error, db is required in App.js and not in users.js. 
You need to pass it on. Maybe:

```js
// ...
app.post(/login, users.login(db));
// ...
```

And make users.login() return the function (req, res, next). 

-- 
Diogo Resende


On Friday, February 1, 2013 at 18:16 , Oleg Slobodskoi wrote:

 Its actually pretty easy:
 
 http://pastie.org/6016681
 
 
 In your case everything is executed serially.
 
 It is  little bit more complicated when you want to mix parallel and serial 
 execution.
 
 
 For this case I wrote this utility:
 
 https://github.com/kof/do
 
 I have done a step away from Step/async libraries. They make the code harder 
 to understand.
 
 Am 01.02.2013 um 17:10 schrieb Thomas Gray thomas.g...@randomstorm.com 
 (mailto:thomas.g...@randomstorm.com):
  Hi guys
  
  Let me start out here with a disclaimer. I am a newbie to programming in 
  Javascript. It's syntax is acceptable, so I have no problem with that - 
  it's just on the structuring of Javascript especially within the Async 
  context of nodeJS.
  
  I am at the moment trying to write a really simple RESTful API in NodeJS 
  using Mongo as a data source. I'm using express to handle the HTTP 
  component and the MongoDB library (via NPM) to handle my interaction with 
  Mongo. I am having some real troubles with how to properly structure my 
  application. You can view it as it stands here: http://pastie.org/6013517
  
  As you will see, I am calling the user collection, then finding a user, 
  then creating a new login token, then updating the user with that login 
  token, then sending that login token back to the browser. All within one 
  crazy nested method. I've been programming in non-async languages for a 
  while, and I guess I am failing to understand the concept of how to program 
  asynchronously. The best I can come up with is to have a User object that 
  just has methods that are called within the callback of each component.
  
  Looking at the code I have given above - how would I better structure this 
  to remove the levels of nesting, but still not have it as a procedural 
  object (ie. one method calls the next which calls the next and so on).
  
  Maybe i'm just not understanding how to program in this environment?
  
  Tom
  
  
  
  -- 
  -- 
  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 nodejs@googlegroups.com 
  (mailto:nodejs@googlegroups.com)
  To unsubscribe from this group, send email to
  nodejs+unsubscr...@googlegroups.com 
  (mailto:nodejs+unsubscr...@googlegroups.com)
  For more options, visit this group at
  http://groups.google.com/group/nodejs?hl=en?hl=en
   
  --- 
  You received this message because you are subscribed to the Google Groups 
  nodejs group.
  To unsubscribe from this group and stop receiving emails from it, send an 
  email to nodejs+unsubscr...@googlegroups.com 
  (mailto:nodejs+unsubscr...@googlegroups.com).
  For more options, visit https://groups.google.com/groups/opt_out.
   
   
 
 -- 
 -- 
 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 nodejs@googlegroups.com 
 (mailto:nodejs@googlegroups.com)
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com)
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en
  
 --- 
 You received this message because you are subscribed to the Google Groups 
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com).
 For more options, visit https://groups.google.com/groups/opt_out.
  
  

-- 
-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] Re: Javascript Class Specification for the next generation of JS class system, hope to discuss with you.

2013-01-31 Thread Diogo Resende
+1. Java people should really read and learn about OOP before associating it to 
just classes..

-- 
Diogo Resende


On Thursday, January 31, 2013 at 19:48 , Geerten van Meel wrote:

 In case you are wondering why you don't recieve a lot of love in this topic, 
 let me elaborate: You are trying to fix something which is not broken, at 
 least in the eyes of many that are reading this. You are trying to make 
 JavaScript more like Java by turning everything into classes.  
 
 Things are not broken though. The CommonJS (~npm) and AMD (browser) 
 approaches are actually quite elegant in their respective environments and 
 allow to encapsule simple functionality into a module without considerable 
 overhead. While it is good that you gave something like this a decent amount 
 of thought, you may be barking up the wrong tree here by turning JavaScript 
 into Java.
 
 On Wednesday, January 30, 2013 12:15:20 PM UTC+1, fengchu...@gmail.com 
 (http://gmail.com) wrote:
  Hi, Senior JS fans
  
  I am a senior Java/JS developer about 12 year+. I recently wrote a 
  specification named JCS. The goal of this specification is replace the 
  currently popular of CommonJS or RequireJS for building the next generation 
  of full object-oriented class system. The first implementation of the 
  specification is JSDK1.0: https://github.com/fch415/jtdk 
  
  
  The specification is still evolving, welcome you suggest improvements!
  
  JCS 1.0 document: 
  https://github.com/fch415/jss/blob/master/%231/jss%231_jcs_en.md
  
  Sincerely,
  FengChun 
 
 -- 
 -- 
 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 nodejs@googlegroups.com 
 (mailto:nodejs@googlegroups.com)
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com)
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en
  
 --- 
 You received this message because you are subscribed to the Google Groups 
 nodejs group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com).
 For more options, visit https://groups.google.com/groups/opt_out.
  
  

-- 
-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
nodejs group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [nodejs] Re: Running javascript code safely

2013-01-18 Thread Diogo Resende
Assuming you get the script in advance and you have time before running it 
(user submits it), I would go with the uglify approach. I would then right a 
new script using vm and would run it using child_process. I would check if it 
lasts longer than expected. If ok, then save it and run it later whenever you 
want.

-- 
Diogo Resende


On Friday, January 18, 2013 at 19:15 , Bradley Meck wrote:

 Austin: won't go into great detail, but heres a fun little example:
 
 ```javascript
 function exploit() {
   console.log.constructor(process.exit(42))();
 }
 var result = require('vm').runInNewContext([
   'use strict;',
   '('+exploit.toString()+')()'
 ].join('\n'), {console:console});
 console.log('I SURVIVED THE STORM!'); // it wont
 
 ```
 
 Thats pretty trivial and then prototype injection attacks can occur if you 
 pass in natives and eventually use say... JSON.stringify if you override 
 .toJSON, .toString, .constructor, .valueOf, .__proto__, ...
 Then it gets worse when you do something like say... get a hold of a 
 non-strict mode function from a different scope by having it construct lets 
 say a continuation callback ...
 Even still... get a hold of some options object that feeds into a secure area 
 and set the options to something insecure (at a future point in time with 
 lets say Object.defineProperty).
 ...
 it goes on...
 ...
 
 -- 
 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 nodejs@googlegroups.com 
 (mailto:nodejs@googlegroups.com)
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com)
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: Running javascript code safely

2013-01-18 Thread Diogo Resende
Ex:

# the exploit
```js
..whatever
```

1. Run thru uglify and check if it calls require.
2. Write a script (maybe based on a template) that would load the exploit 
using a vm and without any context.

```js
require('vm').runInNewContext([
  'use strict;',
  '('+exploit.toString()+')()'
].join('\n'), { ... }); // no console of course, and nothing that isn't needed

```

3. Run the new script and check if finished ok (exit code 0) and within your 
specified time (setTimeout) 

-- 
Diogo Resende


On Friday, January 18, 2013 at 19:43 , Diogo Resende wrote:

 Assuming you get the script in advance and you have time before running it 
 (user submits it), I would go with the uglify approach. I would then right a 
 new script using vm and would run it using child_process. I would check if it 
 lasts longer than expected. If ok, then save it and run it later whenever you 
 want.
 
 -- 
 Diogo Resende
 
 
 On Friday, January 18, 2013 at 19:15 , Bradley Meck wrote:
 
  Austin: won't go into great detail, but heres a fun little example:
  
  ```javascript
  function exploit() {
console.log.constructor(process.exit(42))();
  }
  var result = require('vm').runInNewContext([
'use strict;',
'('+exploit.toString()+')()'
  ].join('\n'), {console:console});
  console.log('I SURVIVED THE STORM!'); // it wont
  
  ```
  
  Thats pretty trivial and then prototype injection attacks can occur if you 
  pass in natives and eventually use say... JSON.stringify if you override 
  .toJSON, .toString, .constructor, .valueOf, .__proto__, ...
  Then it gets worse when you do something like say... get a hold of a 
  non-strict mode function from a different scope by having it construct lets 
  say a continuation callback ...
  Even still... get a hold of some options object that feeds into a secure 
  area and set the options to something insecure (at a future point in time 
  with lets say Object.defineProperty).
  ...
  it goes on...
  ...
  
  -- 
  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 nodejs@googlegroups.com 
  (mailto:nodejs@googlegroups.com)
  To unsubscribe from this group, send email to
  nodejs+unsubscr...@googlegroups.com 
  (mailto:nodejs+unsubscr...@googlegroups.com)
  For more options, visit this group at
  http://groups.google.com/group/nodejs?hl=en?hl=en
 

-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Running javascript code safely

2013-01-16 Thread Diogo Resende
I would try a parser like uglify to detect if require() is called in the code. 
If not I would accept the script. You could check more things but that is the 
most important.

Then I would just run the code inside vm module. 

-- 
Diogo Resende


On Wednesday, January 16, 2013 at 21:24 , Gustavo Machado wrote:

 Hello,
 
 We are building a platform that is oriented to developers in node.js, and we 
 are in the process of evaluating giving our users the ability to configure 
 validation and authorisation rules in Javascript.
 
 On virtually every request, these validation rules are going to be executed, 
 so it needs to be somewhat performant, but most importantly safe. And by 
 safe I mean:
 
 - no require-ing
 - no access to global
 - any kind of attack that may give access to the local system (files, 
 network, etc)
 
 So far, we found the sandbox module: 
 https://github.com/gf3/sandbox/blob/master/example/example.js but are looking 
 for some other choices.
 
 Thanks,
 Gustavo Machado
 
 -- 
 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 nodejs@googlegroups.com 
 (mailto:nodejs@googlegroups.com)
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com)
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en
 
 


-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Remove diacritic from text

2013-01-14 Thread Diogo Resende
I think what you want is something like transliteration using for example iconv 
lib, like in PHP:

$new_text = iconv(utf-8, ascii//translit, $text);

Something like this I think...  

--  
Diogo Resende


On Monday, January 14, 2013 at 10:04 , Danilo Luiz Rheinheimer Danilo wrote:

 Hi,
  
 Someone is aware os a funcion to remove diacritics (accebts) from words on 
 node.js string. In fact what I want is to replace the char with the diacritic 
 with his version without the diacritic.  
  
 If I have a string like :
  
 Imóvel
  
 I want the funcion result to be :
  
 Imovel
  
  
 Danilo.  
  
 --  
 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 nodejs@googlegroups.com 
 (mailto:nodejs@googlegroups.com)
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com)
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en



-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: Is it wise to host nodejs apps on third party machines with source code? Can't we compile into machine code before hosting?

2013-01-11 Thread Diogo Resende
But what password are you talking about? Some kind of unique id / serial that 
ensures the code runs? Can't that be a generated number? What about people just 
wanting to close the source, but still distributed it freely?

-- 
Diogo Resende


On Friday, January 11, 2013 at 6:05 , Gregg Caines wrote:

 You shouldn't look to compilation to solve this problem, because compilation 
 is not encryption.  Even if it was compiled C, anyone who can open a 
 hexeditor can see your username and password in there.  I bet you could even 
 see it from notepad.
 
 An encryption scheme won't be bulletproof either, because you've got to put 
 the decryption logic on the machine as well, or your app won't actually be 
 able to use the decrypted username/password.
 
 Of course you could encrypt anyway; that's at least mildly harder than 
 reading plain text (but still pretty trivial to decrypt -- they just need to 
 console.log(decryptedPassword) before you use it in your code).
 
 I think you've either got to trust your 3rd-party hosts, or stop using 
 3rd-party hosts.  As with most scenarios, if someone malicious has full 
 access to your machine, there's not much you can do.
 
 G
 
 
 
 On Wednesday, January 9, 2013 2:31:55 AM UTC-8, Koti Kanna wrote:
  
  Hi all,
  
  
  I am using npm module imap to fetch emails. where it requires username and 
  password to fetch mails. This mail client i am hosting on a third party 
  machine. My worry is, if any body open this file they can actually see my 
  user name and password. Is there any way to precompile this module into 
  machine code?
  
  
  Do you have any plans to support executables for nodejs Apps, before it 
  touches version 1.0?
  
  
  Thanks
  Koti
  
  
  P.S.: The one and only language right now i know is JavaScript.
  
  
 
 
 
 
 -- 
 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 nodejs@googlegroups.com 
 (mailto:nodejs@googlegroups.com)
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com)
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] os.release() on Mac OS

2013-01-04 Thread Diogo Resende
Mine is OSX 10.7.5 and I get '11.4.2'. This is kernel version, not OS version.

-- 
Diogo Resende


On Friday, January 4, 2013 at 15:34 , SteveCronin wrote:

 Folks;
 
 I am wondering if someone could add some perspective to this finding
 
 On a Mac running Mac OS X 10.7.5  and node v0.8.10 I see this:
 ahab: node
 console.log(require('os).release())
 11.7.4
 
 On a Mac running Mac OS X 10.8.2 and node v0.8.9 I see this:
 orbitter: node
 console.log(require('os).release())
 12.2.0
 
 
 -- 
 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 nodejs@googlegroups.com 
 (mailto:nodejs@googlegroups.com)
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com)
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] os.release() on Mac OS

2013-01-04 Thread Diogo Resende
uname -a

-- 
Diogo Resende


On Friday, January 4, 2013 at 15:41 , Diogo Resende wrote:

 Mine is OSX 10.7.5 and I get '11.4.2'. This is kernel version, not OS version.
 
 -- 
 Diogo Resende
 
 
 On Friday, January 4, 2013 at 15:34 , SteveCronin wrote:
 
  Folks;
  
  I am wondering if someone could add some perspective to this finding
  
  On a Mac running Mac OS X 10.7.5  and node v0.8.10 I see this:
  ahab: node
  console.log(require('os).release())
  11.7.4
  
  On a Mac running Mac OS X 10.8.2 and node v0.8.9 I see this:
  orbitter: node
  console.log(require('os).release())
  12.2.0
  
  
  -- 
  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 nodejs@googlegroups.com 
  (mailto:nodejs@googlegroups.com)
  To unsubscribe from this group, send email to
  nodejs+unsubscr...@googlegroups.com 
  (mailto:nodejs+unsubscr...@googlegroups.com)
  For more options, visit this group at
  http://groups.google.com/group/nodejs?hl=en?hl=en
 

-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] On Reserving Package Names

2012-12-16 Thread Diogo Resende
+1

--  
Diogo Resende


On Sunday, December 16, 2012 at 2:42 , Outsider (JeongHoon Byun) wrote:

 +1
 i think it's necessary policy for module quality not just module count.
 and it's reasonable to me.
  
 node comunity has became pretty big.
 so commiters can't communicate with each module authors.
 doing so waste time too much and positive result will be very low.
  
  
 2012년 12월 15일 토요일에 Isaac Schlueter님이 작성:
  There's no need for drama, you're right.  But you make an important
  point: the correct answer is Oh, sorry about that, sure, it's all
  yours.
   
  The problem is that sometimes the response is No, I'm planning on
  releasing something there some day, so you can't have it.  The
  relevant difference is that planned modules don't exist.
   
  On Fri, Dec 14, 2012 at 6:05 PM, Chris O'Hara cohar...@gmail.com wrote:
   It's worth adding that you should reach out to the author first if you 
   find
   such a package in npm. There's a good chance that they're not squatting
   the name intentionally - they probably just started a project excitedly 
   and
   didn't push as fast as they'd hoped.
  
   I had a dynamo and task in npm without little or no code. I was
   contacted by jed who had a dynamo client ready to go and tkellen who 
   wanted
   task for a gruntjs related project. - in both cases I gave up the names.
  
   No drama, no need call anyone a squatter, no need to get Isaac involved,
   good times.
  
  
   On Saturday, December 15, 2012 11:10:23 AM UTC+11, Isaac Schlueter wrote:
  
   TL;DR - Package squatting is not allowed.  If you sit on a package
   name and don't publish code, it'll be deleted without warning.
  
   
  
   npm package names have always been a first come, first served
   system.  I think this is generally good.  It incentivizes early
   adopters, which is important, because they're the most valuable users.
  
   It also is a powerful motivator to *actually write code*.
   Traditionally, the pattern has been that if you think of a great name,
   well, you'd better ship something, then!  We never had to have an
   explicit rule about publishing empty packages, for the same reason
   that you don't have to have an explicit rule about leaving garbage on
   the floor in someone's house.  It's just not something you'd do.
  
   It is hard to really comprehend *just how many* possible package names
   there are.  The math isn't that hard, but the actual numbers are
   mind-boggling.  Even just limiting to 4 characters, there's
   36*38*38*38 potential names.  That's about 100x the number of npm
   packages that have ever been published.  And yes, it includes stuff
   like 0-_-, but still.  You don't have to limit it to 4 characters.  At
   8 characters, there's 4118960973312 potential names.  If you got TJ
   Holowaychunk and Raynos and Substack and architectd and Dominic Tarr
   together and managed to get them to publish a package with a unique
   8-character name every MILLISECOND, it'd take OVER 130 YEARS to ever
   use them all up!  Absurdity aside, there are millions and millions of
   common words and clever spellings.  We'll never run out.  There is no
   scarcity.
  
   (To the alpha-nerds in the audience: this is not a challenge.  Please
   don't DOS the registry. ;)
  
   The official policy for handing name disputes mostly focuses on
   abandoned modules, confusing name collisions, and other cases where
   two parties both actually have published (or want to publish) working
   code.  There's never been a need to make the no seat saving
   explicit, because it just didn't happen much.  Disputes between two
   authors have generally always been handled pretty easily.  The
   occasional no code here module was always a mistake or an oversight,
   and promptly cleaned up.
  
   Lately, probably owing to the increase in our community's size, or the
   increase in npm's popularity, or some combination of factors, I've
   been seeing a lot more cases where someone asks to use a module,
   pointing out that the author isn't using it, and they're told, No,
   that's something I'll be publishing at some time in the future.  When
   I've stepped in and made a ruling, pointing out that **npm is for node
   modules that exist, not for node modules that don't exist**, the
   squatters have in some cases reacted with surprise and frustration.
   It's gotten un-amicable.
  
   If you think I'm talking about you, you're probably right.  But I
   wouldn't bother to write this if it had been an isolated incident, so
   you're not alone.  I don't want to single anyone out, and it's
   happened enough times that clearly there's some widespread confusion
   about what's ok and what isn't.  You're not a bad person.  You didn't
   know.
  
  
  
 --  
 Sent from my iPad
 --  
 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

Re: [nodejs] Weak references. Does node-weak and other simliar libraries, add significant overhead?

2012-10-22 Thread Diogo Resende
You could use ES6 WeakMaps.

https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/WeakMap
 

-- 
Diogo Resende


On Monday, October 22, 2012 at 17:05 , Fredrik O wrote:

 Hi,
 
 Does anyone know if it is safe, for performance reasons to heavily use the 
 npm module: node-weak and similar libraries? Does it add significant 
 overhead?
 
 
 Thanks in advance
 -- 
 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 nodejs@googlegroups.com 
 (mailto:nodejs@googlegroups.com)
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com)
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: Poll for v0.10 feature: Crypto default to 'binary' strings vs defaulting to buffers

2012-10-12 Thread Diogo Resende
Not crypto related but since you're trying to give consistency to the API, why 
not make other changes like:

var sock1 = new require(net).Socket(...);
var sock1 = require(dgram).createSocket(..);

I'm sure there aren't a lot of inconsistencies but this is one that bugs me.. 

-- 
Diogo Resende


On Friday, October 12, 2012 at 17:07 , Trevor Norris wrote:

 (a) go for it
 
 It seems like it would be reasonable to make the change at the same time you 
 introduce the streams2 branch. Don't worry about migrating it the current, 
 just to change it over.
 
 On Monday, October 8, 2012 4:24:36 PM UTC-7, Isaac Schlueter wrote:
  Please select one, and reply with your choice and perhaps any other 
  feedback you have on this issue.  Thanks. 
  
  a) Go for it.  This won't affect me, and if by chance it does, I don't 
  mind putting 'binary' args here and there. 
  b) Please wait.  Mark the API as unstable in 0.10, but don't change it 
  until 0.12. 
  c) I have no opinion, because I don't use the crypto API directly. 
 -- 
 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 nodejs@googlegroups.com 
 (mailto:nodejs@googlegroups.com)
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com)
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: Poll for v0.10 feature: Crypto default to 'binary' strings vs defaulting to buffers

2012-10-12 Thread Diogo Resende
I just realized there is dgram.Socket.. but the documentation says:

The dgram Socket class encapsulates the datagram functionality. It should be 
created viadgram.createSocket(type, [callback]). 

-- 
Diogo Resende


On Friday, October 12, 2012 at 17:25 , Diogo Resende wrote:

 Not crypto related but since you're trying to give consistency to the API, 
 why not make other changes like:
 
 var sock1 = new require(net).Socket(...);
 var sock1 = require(dgram).createSocket(..);
 
 I'm sure there aren't a lot of inconsistencies but this is one that bugs me.. 
 
 -- 
 Diogo Resende
 
 
 On Friday, October 12, 2012 at 17:07 , Trevor Norris wrote:
 
  (a) go for it
  
  It seems like it would be reasonable to make the change at the same time 
  you introduce the streams2 branch. Don't worry about migrating it the 
  current, just to change it over.
  
  On Monday, October 8, 2012 4:24:36 PM UTC-7, Isaac Schlueter wrote:
   Please select one, and reply with your choice and perhaps any other 
   feedback you have on this issue.  Thanks. 
   
   a) Go for it.  This won't affect me, and if by chance it does, I don't 
   mind putting 'binary' args here and there. 
   b) Please wait.  Mark the API as unstable in 0.10, but don't change it 
   until 0.12. 
   c) I have no opinion, because I don't use the crypto API directly. 
  -- 
  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 nodejs@googlegroups.com 
  (mailto:nodejs@googlegroups.com)
  To unsubscribe from this group, send email to
  nodejs+unsubscr...@googlegroups.com 
  (mailto:nodejs+unsubscr...@googlegroups.com)
  For more options, visit this group at
  http://groups.google.com/group/nodejs?hl=en?hl=en
 

-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] node_modules for private modules that need to be committed?

2012-10-10 Thread Diogo Resende
You have 2 choices:

1. Change your .gitignore
2. Change your require() calls

Example for 1:
(instead of having node_modules)

node_modules/a
node_modules/b
...

Example for 2:
(in case you put your module in priv_modules)

var xpto = require(./priv_modules/xpto); 

-- 
Diogo Resende


On Wednesday, October 10, 2012 at 16:09 , Tom wrote:

 I've added the node_modules folder to my .gitignore file, which works fine 
 thanks to NPM Shrinkwrap (after deploying I need to run npm install using the 
 shrinkwrap.json file).
 
 However, I've got some private modules now that I won't publish to NPM. I 
 would like to require these modules like the other modules in node_modules.
 
 Unfortunately I cannot put these modules in node_modules, because they'd be 
 ignored by git, messing with my future deployment.
 
 Where should I place these modules instead? I've been told that editing the 
 paths variable for node's module lookup is highly unrecommended.
 
 Note that these are small undocumented nonpublic modules, which is why I 
 don't want to publish them to NPM.
 
 Tom 
 
 -- 
 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 nodejs@googlegroups.com 
 (mailto:nodejs@googlegroups.com)
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com)
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] How to start with node.js ?

2012-10-04 Thread Diogo Resende
If you're a bit familiar with js in general, I would advise you to read the 
documentation pages. It's not that big and you'll get a picture of what you can 
do with the core.

http://nodejs.org/docs/latest/api/

Then, there are plenty of modules here:

http://toolbox.no.de/ 

-- 
Diogo Resende


On Thursday, October 4, 2012 at 5:56 , Mayur wrote:

 Hi..
 I am very new to node.js ..!!
 just yesterday, i came across node.js and found it quite interesting !!
 
 but dont know how to start with and from where ?
 Please help me..!!
 
 Thanks 
 -- 
 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 nodejs@googlegroups.com 
 (mailto:nodejs@googlegroups.com)
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com)
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Node-static can not serve json file

2012-10-03 Thread Diogo Resende
I did not debug the code and can't tell you what's wrong but you're missing one 
thing on p_request, you're not sending the original headers to the sub request 
(just 'host'). Perhaps that might be originating the block from it.. or you're 
missing more stuff?

-- 
Diogo Resende


On Wednesday, October 3, 2012 at 9:21 , Thuan le minh wrote:

 i think i don't parse json on my code ?
 my code is attacted
 
 On Wednesday, October 3, 2012 2:59:20 PM UTC+7, ryandesign wrote:
  
  On Oct 3, 2012, at 02:47, Thuan le minh leminh...@gmail.com (javascript:) 
  wrote: 
  
   i am trying to create caching http proxy server with node.js and i use 
   node-static as middleware for caching module . 
   i tested my app on my browser : localhost:8080/?url=http://google.com, it 
   ran ok . 
   but when i test it with any website that include json content such as : 
   http://application.pedev.lan:8080/abc/ext/oxplorer?content=abclogin=abcpass=abcformat=json

   it can not run . 
  
  Why can't it run? What error occurs? 
  
  Can we see your code anywhere? 
  
  
 -- 
 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 nodejs@googlegroups.com 
 (mailto:nodejs@googlegroups.com)
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com)
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en
 
 Attachments: 
 - node-proxy.js
 


-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] Timezone shifting - format dates according to locations in a certain date

2012-10-02 Thread Diogo Resende
Hi, 

I think this is essential to anyone. Some people already faced this problem, 
some probably never heard of it but it's there.

I use MomentJS [1] to format and node-time [2] to do find the timezone offset.

https://gist.github.com/3819961

It works perfectly (I think...) so I wanted to share with anyone interested. If 
someone has a better or simpler way of doing this please tell me :)


[1]: http://momentjs.com/
[2]: https://github.com/TooTallNate/node-time

-- 
Diogo Resende

-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Timezone shifting - format dates according to locations in a certain date

2012-10-02 Thread Diogo Resende
Are you talking about timezone-js? I want this server side, not client side.

-- 
Diogo Resende


On Tuesday, October 2, 2012 at 16:21 , Mikeal Rogers wrote:

 i used timezone to do offsets and formatting because it's pure js and doesn't 
 have any compiled dependencies like node-time.
 
 On Oct 2, 2012, at October 2, 20125:20 PM, Diogo Resende 
 drese...@thinkdigital.pt (mailto:drese...@thinkdigital.pt) wrote:
  Hi, 
  
  I think this is essential to anyone. Some people already faced this 
  problem, some probably never heard of it but it's there.
  
  I use MomentJS [1] to format and node-time [2] to do find the timezone 
  offset.
  
  https://gist.github.com/3819961
  
  It works perfectly (I think...) so I wanted to share with anyone 
  interested. If someone has a better or simpler way of doing this please 
  tell me :)
  
  
  [1]: http://momentjs.com/
  [2]: https://github.com/TooTallNate/node-time
  
  -- 
  Diogo Resende
  
  
  -- 
  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 nodejs@googlegroups.com 
  (mailto:nodejs@googlegroups.com)
  To unsubscribe from this group, send email to
  nodejs+unsubscr...@googlegroups.com 
  (mailto:nodejs+unsubscr...@googlegroups.com)
  For more options, visit this group at
  http://groups.google.com/group/nodejs?hl=en?hl=en
 
 -- 
 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 nodejs@googlegroups.com 
 (mailto:nodejs@googlegroups.com)
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com)
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Timezone shifting - format dates according to locations in a certain date

2012-10-02 Thread Diogo Resende
I was looking for something like that, google search didn't show me that. But 
node-time seems to do what I want for now, at least until momentjs support this.

Thank you 

-- 
Diogo Resende


On Tuesday, October 2, 2012 at 17:14 , Jeff Barczewski wrote:

 I believe Mikeal is referring to the npm module timezone
 
 npm info timezone # gives you all the package.json info which points you to 
 homepage and source
 
 http://bigeasy.github.com/timezone/
 
 
 From the wiki page, timezone runs on server and client.
 
 
 
 On Tuesday, 2 October 2012 10:27:39 UTC-5, Diogo Resende wrote:
  Are you talking about timezone-js? I want this server side, not client side.
  
  -- 
  Diogo Resende
  
  
  On Tuesday, October 2, 2012 at 16:21 , Mikeal Rogers wrote:
  
   i used timezone to do offsets and formatting because it's pure js and 
   doesn't have any compiled dependencies like node-time.
   
   On Oct 2, 2012, at October 2, 20125:20 PM, Diogo Resende 
   dres...@thinkdigital.pt (javascript:) wrote:
Hi, 

I think this is essential to anyone. Some people already faced this 
problem, some probably never heard of it but it's there.

I use MomentJS [1] to format and node-time [2] to do find the timezone 
offset.

https://gist.github.com/3819961

It works perfectly (I think...) so I wanted to share with anyone 
interested. If someone has a better or simpler way of doing this please 
tell me :)


[1]: http://momentjs.com/
[2]: https://github.com/TooTallNate/node-time

-- 
Diogo Resende


-- 
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 nod...@googlegroups.com 
(javascript:)
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com (javascript:)
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
   
   -- 
   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 nod...@googlegroups.com (javascript:)
   To unsubscribe from this group, send email to
   nodejs+un...@googlegroups.com (javascript:)
   For more options, visit this group at
   http://groups.google.com/group/nodejs?hl=en?hl=en
  
 -- 
 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 nodejs@googlegroups.com 
 (mailto:nodejs@googlegroups.com)
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com)
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: What Editor / OS / Dev enviroment do you use?

2012-09-25 Thread Diogo Resende
Better alternative: iTerm2

-- 
Diogo Resende


On Tuesday, September 25, 2012 at 8:40 , Zhao Cheng wrote:

 On Mon, Sep 24, 2012 at 10:02 PM, Tim Caswell t...@creationix.com 
 (mailto:t...@creationix.com) wrote:
  Why on earth do you want control+c and control+v overriding the terminals
  input? Osx gets away with using its native clipboard bindings because
  option+anything doesn't clash with tty commands. Most control+anything key
  bindings have common and essential meanings in tty apps.
  
  I'm my ~18 years of Unix style development gnome-terminal is the best tty
  emulator out there.
  
 
 
 I agree with you, gnome-terminal is the most thing I miss after I have
 switched to Mac.
 
 -- 
 Cheng
 Intel Open Source Technology Center
 
 -- 
 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 nodejs@googlegroups.com 
 (mailto:nodejs@googlegroups.com)
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com)
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en
 
 


-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: What Editor / OS / Dev enviroment do you use?

2012-09-21 Thread Diogo Resende
Works fine for me, Cmd+Shift+V instead of Cmd+V. If you think this should 
always be normal paste, just change the key bindings..

-- 
Diogo Resende


On Friday, September 21, 2012 at 15:27 , Sotonin wrote:

 Don't really see the big deal. Press tab. Shrug
 
 On Fri, Sep 21, 2012 at 8:52 AM, deitch a...@deitcher.net 
 (mailto:a...@deitcher.net) wrote:
  Mac OS X + TextMate. Would love to go SublimeText2 like some of the other 
  posters, but it screws up my indenting, see 
  
  http://www.sublimetext.com/forum/viewtopic.php?f=3t=4941
  
  
  On Thursday, September 20, 2012 7:42:27 PM UTC+3, Andrew Mclagan wrote:
   Im switching to Ubuntu after struggling with windows, i will replace 
   notepad++ with Vim and finally get into terminal... 
   
   Im interested in what OS / Dev Enviroment other Node.js developers use?
  
  -- 
  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 nodejs@googlegroups.com 
  (mailto:nodejs@googlegroups.com)
  To unsubscribe from this group, send email to
  nodejs+unsubscr...@googlegroups.com 
  (mailto:nodejs%2bunsubscr...@googlegroups.com)
  For more options, visit this group at
  http://groups.google.com/group/nodejs?hl=en?hl=en
 
 -- 
 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 nodejs@googlegroups.com 
 (mailto:nodejs@googlegroups.com)
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com)
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: What Editor / OS / Dev enviroment do you use?

2012-09-21 Thread Diogo Resende
Does it run on node v0.8.x? I was waiting for it to happen to try it out on a 
private domain.

-- 
Diogo Resende


On Friday, September 21, 2012 at 19:28 , Tim Caswell wrote:

 On Fri, Sep 21, 2012 at 1:12 PM, William Oliveira sudowill...@gmail.com 
 (mailto:sudowill...@gmail.com) wrote:
  @Tim Caswell I'm going to try Cloud9, heard so much about it. Any tips for
  new users?
  
 
 
 Disclaimer: I'm employed at cloud9. That said, the editor is finally
 something that I enjoy using now that I have a real tty emulator and
 linux environment with every workspace. The latency is still a
 problem sometimes, but most the time it's quite nice when on my home
 internet.
 
 I'm actively working to improve the latency and offline support.
 
 The editor has node docs inline with autocomplete.
 
 Anyway, enough marketing and back to making awesome stuff...
 
 
  
  
  On Fri, Sep 21, 2012 at 2:26 PM, Tim Caswell t...@creationix.com 
  (mailto:t...@creationix.com) wrote:
   
   For the longest time time I used Gedit on linux, Textmate on OSX, and
   Vim on headless boxes. Then sublime2 came out and I used that for a
   short while since it runs on windows, linux, and osx. Now I mostly
   use the hosted cloud9 because I work from several machines and having
   my dev environment always the same no matter what machine I'm using is
   nice.
   
   In all the cases, I use the terminal for everything except editing, so
   IDE features are lost on me. I just want a good way to edit my code.
   When porting code from one language to another, multiple cursors in
   sublime and cloud9 is amazing.
   
   On Fri, Sep 21, 2012 at 12:11 PM, Jimb Esser wastel...@gmail.com 
   (mailto:wastel...@gmail.com) wrote:
I'm also using Sublime Text 2, on Windows 7, though running all of my
node
processes on Ubuntu.

Interestingly with my start-up, the four programmers were originally
using 4
different editors (VIM, Emacs, Visual Studio, and WebStorm) for the
first
year, and now we're mostly all using Sublime Text 2 (admittedly with
individual plugins that make it behave more like VIM, Emacs, and Visual
Studio ;).


On Thursday, September 20, 2012 9:42:27 AM UTC-7, Andrew Mclagan wrote:
 
 Im switching to Ubuntu after struggling with windows, i will replace
 notepad++ with Vim and finally get into terminal...
 
 Im interested in what OS / Dev Enviroment other Node.js developers 
 use?

--
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 nodejs@googlegroups.com 
(mailto:nodejs@googlegroups.com)
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com 
(mailto:nodejs+unsubscr...@googlegroups.com)
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

   
   
   --
   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 nodejs@googlegroups.com 
   (mailto:nodejs@googlegroups.com)
   To unsubscribe from this group, send email to
   nodejs+unsubscr...@googlegroups.com 
   (mailto:nodejs+unsubscr...@googlegroups.com)
   For more options, visit this group at
   http://groups.google.com/group/nodejs?hl=en?hl=en
   
  
  
  
  
  
  --
  // w. oliveira
  // js - python - lisp - clojure
  
  --
  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 nodejs@googlegroups.com 
  (mailto:nodejs@googlegroups.com)
  To unsubscribe from this group, send email to
  nodejs+unsubscr...@googlegroups.com 
  (mailto:nodejs+unsubscr...@googlegroups.com)
  For more options, visit this group at
  http://groups.google.com/group/nodejs?hl=en?hl=en
  
 
 
 -- 
 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 nodejs@googlegroups.com 
 (mailto:nodejs@googlegroups.com)
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com)
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en
 
 


-- 
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

Re: [nodejs] Re: Is it a good idea for me to learn node.js?

2012-08-29 Thread Diogo Resende
I would encourage you to read the pages at 
https://developer.mozilla.org/en-US/docs/JavaScript and avoid any Google links 
do w3schools.

-- 
Diogo Resende


On Wednesday, August 29, 2012 at 20:34 , ANIKET KADAM wrote:

 thanks for your time
 
 can you give me a very short roadmap for learning Javascript ( espically 
 async javascript programming ) 
 Please help me because i m learning alone thats why.
 
 On Thu, Aug 30, 2012 at 12:56 AM, Abraham itule wandah...@gmail.com 
 (mailto:wandah...@gmail.com) wrote:
  As others have recommended u, i would also recommend you learning node.js. 
  As you have clearly stated yourself, node.js is javascript. Now i 
  personally before even nodejs came out, i had learnt JavaScript and i was 
  doing some front end stuff. But when nodejs came n i tried to learn it, i 
  was kinda  lost because node.js works Asynchronously, and async JavaScript 
  which is quite hard to write. So the book eloquent javascript helped me 
  quite alot to get my head around the asynchronous way of writing javascript 
  which is good for both backend and frontend code. 
  
  Hence the reason i say ur on the right path. 
  
  Though one thing to note is that, since u said u have very little 
  javascript experience, i would have you know that though the book 
  eloquent javascript will help u understand alot about writing async 
  javascript, its also lacks details in other parts of javascript that u 
  would need to know to write front-end javascript. I learnt that on another 
  book by Nicholas C Zakas called JavaScript for Web Developers (u can 
  torrent it).  The reason i say this is because since u have very little 
  javascript experience, i dont want u to be strong on writing Back-end code 
  in javascript and be poor in writing Front-end. 
  
  # sorry for the slangs, i couldnt be arsed writing full sentences. 
  
  
  
  
  On Wed, Aug 29, 2012 at 6:52 PM, ANIKET KADAM aniketkadam1...@gmail.com 
  (mailto:aniketkadam1...@gmail.com) wrote:
   I know HTML and CSS, but I have very little Javascript experience and 
   very little programing knowlege. I have decided to learn back-end web 
   development. I choose Node.js over Ruby on Rails 
   (http://www.quora.com/Node-js/Is-it-a-good-idea-for-me-to-learn-node-js#).
   The reason I choose Node.js is because JavaScript is everywhere.
   
   Front end - Javascript (jQuery 
   (http://www.quora.com/Node-js/Is-it-a-good-idea-for-me-to-learn-node-js#)),
HTML 
   (http://www.quora.com/Node-js/Is-it-a-good-idea-for-me-to-learn-node-js#),
CSS 
   (http://www.quora.com/Node-js/Is-it-a-good-idea-for-me-to-learn-node-js#).
   Back end - Javascript (node.js) 
   NoSQL Database - Javascript (MongoDB 
   (http://www.quora.com/Node-js/Is-it-a-good-idea-for-me-to-learn-node-js#))
   
   That means that if I learn Javascript I will be able to pick up the above 
   things reasonably fast (Please tell me if I'm wrong, this is what I 
   assumed). But in Ruby on Rails things are quite different, and the 
   backend will be in Ruby.
   
   So please can you tell me if it would be a good idea to learn Node.js for 
   or I should learn Ruby on Rails?
   
   == What you suggest me in this Situation ==
   
   On Wed, Aug 29, 2012 at 10:19 PM, Abraham itule wandah...@gmail.com 
   (mailto:wandah...@gmail.com) wrote:
sorry for the late reply, i was working on a project.
Here is another excellent place for your to learn node.js  
http://book.mixu.net/ch1.html 

# I have read the book eloquent javascript before in the past, and i 
can guarantee u that it is an excellent book and a good place for you 
to start. 


On Wed, Aug 29, 2012 at 12:31 PM, ANIKET KADAM 
aniketkadam1...@gmail.com (mailto:aniketkadam1...@gmail.com) wrote:
 thnaks
 
 
 
 On Wed, Aug 29, 2012 at 4:08 PM, Shripad K 
 assortmentofso...@gmail.com (mailto:assortmentofso...@gmail.com) 
 wrote:
  On Wed, Aug 29, 2012 at 3:54 PM, ANIKET KADAM 
  aniketkadam1...@gmail.com (mailto:aniketkadam1...@gmail.com) 
  wrote:
   please please provide me a link about HTTP 1.1 API
  
  
  www.w3.org/Protocols/rfc2616/rfc2616.html 
  (http://www.w3.org/Protocols/rfc2616/rfc2616.html)
   
   
   
   On Wed, Aug 29, 2012 at 3:16 PM, Abramovick wandah...@gmail.com 
   (mailto:wandah...@gmail.com) wrote:
if your going make a website u obviously would need to 
require(http) or https if thats wat u plan to implement. My 
point is, that u need to learn the HTTP 1.1 API to understand 
how to build http web servers and how ur going to fully take 
advantage of the http features provided in node. It should take 
u less than an hour really to understand HTTP 1.1 API.


On Sunday, August 26, 2012 9:47:19 AM UTC+1, ACK wrote:
 I know HTML and CSS, but I have very little Javascript 
 experience and very

Re: [nodejs] Re: Is it a good idea for me to learn node.js?

2012-08-29 Thread Diogo Resende
Yes. Node is just a javascript environment with a usable async API. Express is 
on top of Node.

Stick with JavaScript, learn the basis, play with it in the browser if you 
like, you can use jQuery if you want, just stick with JS. After that, jump to 
Node and read the entire docs, it's not that big. 

-- 
Diogo Resende


On Wednesday, August 29, 2012 at 21:50 , ANIKET KADAM wrote:

 did one should master javascript for learning node.js and express.js
 
 On Thu, Aug 30, 2012 at 2:18 AM, Sugarstack mjadob...@gmail.com 
 (mailto:mjadob...@gmail.com) wrote:
  Using coffeescript requires you to understand the JavaScript it generates 
  and how/why it generates it that way
  
  I would not use it until you are comfortable with js first.
  
  --
  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 nodejs@googlegroups.com 
  (mailto:nodejs@googlegroups.com)
  To unsubscribe from this group, send email to
  nodejs+unsubscr...@googlegroups.com 
  (mailto:nodejs%2bunsubscr...@googlegroups.com)
  For more options, visit this group at
  http://groups.google.com/group/nodejs?hl=en?hl=en
 
 -- 
 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 nodejs@googlegroups.com 
 (mailto:nodejs@googlegroups.com)
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com)
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Most efficient way of piping HTTP body through a tunneling proxy

2012-08-03 Thread Diogo Resende
I'm not sure why you don't use .pipe().. you don't need to buffer all the 
request before sending it. The headers should have a content-length so your 
endpoint will know about it. Just send the data directly to the other end 
instead of buffering.

-- 
Diogo Resende


On Monday, July 30, 2012 at 22:40 , axs wrote:

 Thank you, Mikeal. I use request quite a bit in my projects, and it's great. 
 However, I won't be using request for this project, because I need to write 
 this one at the transport layer. Eventually I will be redirecting various 
 requests to other servers and examining data at the transport layer. I just 
 need to make this barebones version function and then branch from it. Any 
 ideas on how to pipe the request into the socket? 
 
 I thought of listening to the 'connection' event on the proxy server, and 
 piping the socket into the tunnel. But this won't differentiate between http 
 and https requests without parsing the request header, which I'm not sure how 
 to do.
 
 Regards,
 Alex
 
 On Monday, July 30, 2012 5:21:04 PM UTC-4, Mikeal Rogers wrote:
  request does all of this, including SSL tunneling.
  
  req.pipe(request(req.url, {proxy:'https://site.com'})).pipe(resp)
  
  -Mikeal
 -- 
 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 nodejs@googlegroups.com 
 (mailto:nodejs@googlegroups.com)
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com)
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] A method to get memory profiles that works?

2012-08-03 Thread Diogo Resende
http://nodetime.com/

-- 
Diogo Resende


On Friday, August 3, 2012 at 17:48 , Axel Kittenberger wrote:

 Dear all,
 
 Since my node server needs far more memory than I think it should, I
 tried to get a memory profile of it.
 How do I get it? Something that works? (node v0.8.5, viewing in Chrome
 20.0.1132.57)
 
 for example I followed the tutorial at
 https://github.com/felixge/node-memory-leak-tutorial
 
 It all looks nice, except for me there is no profile button
 
 I tried
 
 var profiler = require('v8-profiler');
 ...
 console.log(util.inspect(profiler.takeSnapshot('1')));
 
 and get
 
 node: symbol lookup error:
 /home/axel/meshcraft/node_modules/v8-profiler/build/Release/profiler.node:
 undefined symbol: _ZNK2v813HeapGraphNode17GetRetainersCountEv
 
 bnoordhuis profiler ( https://github.com/bnoordhuis/node-profiler )
 looks to do CPU only (that works! but now what I need)
 
 Now I do not know what else to try, help!
 
 Kind regards,
 Axel
 
 -- 
 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 nodejs@googlegroups.com 
 (mailto:nodejs@googlegroups.com)
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com)
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en
 
 


-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] detect network speed, serve content accordingly

2012-07-29 Thread Diogo Resende
I think the worst you can find is latency, not speed.

-- 
Diogo Resende


On Monday, July 30, 2012 at 0:35 , jerome wrote:

 I guess my point is, if anybody has any information on the process of 
 detecting network speeds, and adjusting behavior between the client/server in 
 response, I'd be interested in exploring what's possible.
 
 -- 
 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 nodejs@googlegroups.com 
 (mailto:nodejs@googlegroups.com)
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com)
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en
 
 


-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: Version 0.8.2 (stable)

2012-07-09 Thread Diogo Resende
Node 0.8.2 manual page still says 0.8.1

--  
Diogo Resende


On Monday, July 9, 2012 at 18:49 , Domenic Denicola wrote:

 Could someone expand on the busy loop fixes? Are they OMG I'd better deploy 
 this or are they very rare edge cases?
  
 On Monday, July 9, 2012 1:25:58 PM UTC-4, Isaac Schlueter wrote:
  2012.07.09, Version 0.8.2 (Stable)  
   
  * npm: Upgrade to 1.1.36  
   
  * readline: don't use Function#call() (Nathan Rajlich)  
   
  * Code cleanup to pass 'use strict' (Jonas Westerlund)  
   
  * module: add filename to require() json errors (TJ Holowaychuk)  
   
  * readline: fix for unicode prompts (Tim Macfarlane)  
   
  * timers: fix handling of large timeouts (Ben Noordhuis)  
   
  * repl: fix passing an empty line inserting undefined into the  
  buffer (Nathan Rajlich)  
   
  * repl: fix crashes when buffering command (Maciej Małecki)  
   
  * build: rename strict_aliasing to node_no_strict_aliasing (Ben Noordhuis)  
   
  * build: disable -fstrict-aliasing for any gcc  4.6.0 (Ben Noordhuis)  
   
  * build: detect cc version with -dumpversion (Ben Noordhuis)  
   
  * build: handle output of localized gcc or clang (Ben Noordhuis)  
   
  * unix: fix memory corruption in freebsd.c (Ben Noordhuis)  
   
  * unix: fix 'zero handles, one request' busy loop (Ben Noordhuis)  
   
  * unix: fix busy loop on unexpected tcp message (Ben Noordhuis)  
   
  * unix: fix EINPROGRESS busy loop (Ben Noordhuis)  
   
   
  Source Code: http://nodejs.org/dist/v0.8.2/node-v0.8.2.tar.gz  
   
  Macintosh Installer (Universal): 
  http://nodejs.org/dist/v0.8.2/node-v0.8.2.pkg  
   
  Windows Installer: http://nodejs.org/dist/v0.8.2/node-v0.8.2-x86.msi  
   
  Windows x64 Installer: 
  http://nodejs.org/dist/v0.8.2/x64/node-v0.8.2-x64.msi  
   
  Windows x64 Files: http://nodejs.org/dist/v0.8.2/x64/  
   
  Other release files: http://nodejs.org/dist/v0.8.2/  
   
  Website: http://nodejs.org/docs/v0.8.2/  
   
  Documentation: http://nodejs.org/docs/v0.8.2/api/  
   
  Shasums:  
   
  ```  
  6571b7aad17ed4860d9ecb7946098dcd569e3eb0  node-v0.8.2-x86.msi  
  8436e940b8c3b1dff73bf4d1eee98fd3b1fc6295  node-v0.8.2.pkg  
  0e743d21b487151e67950f09198def058db19a1e  node-v0.8.2.tar.gz  
  dcc45bee9d4a6b38ccef0f00e4a6028864f07278  node.exe  
  5417f98a533c90f2b72ed3a2a002c2c36a65cb75  node.exp  
  57700a9555d16ebf5401898c179669654f045c5f  node.lib  
  5bf7e8777d715d5d6b40c21ea3969c4244c20879  node.pdb  
  6a5fe7efb56c3e17de357e9b9adc8f1c54db895a  x64/node-v0.8.2-x64.msi  
  72f04cb5bb25bd568cb7bc42eb5e1365e614b672  x64/node.exe  
  6b402ca44a45a3bc1393854d92247bf79eb3df2b  x64/node.exp  
  ad39add3918fb31aef25e3a4acfe1da499900143  x64/node.lib  
  fa981c97e0c474ede8e7c28904d710cc3ee3390c  x64/node.pdb  
  ```  
  --  
  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 nodejs@googlegroups.com 
 (mailto:nodejs@googlegroups.com)
  To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com)
  For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: old repositories, ubuntu packages?

2012-06-29 Thread Diogo Resende
NodeJS is on Ubuntu, but at the other extreme (very old versions). Only Precise 
Pangolin has 0.6.12..

https://launchpad.net/ubuntu/precise/+source/nodejs 

-- 
Diogo Resende


On Friday, June 29, 2012 at 15:59 , hd nguyen wrote:

 I think you should download node-v0.8.0.tar.gz 
 (http://nodejs.org/dist/v0.8.0/node-v0.8.0.tar.gz) directly from 
 http://nodejs.org/dist/v0.8.0/ , then extract it to use on Ubuntu.
 
 On Fri, Jun 29, 2012 at 9:52 PM, randy 4nu...@gmail.com 
 (mailto:4nu...@gmail.com) wrote:
   p.s. i know i can find all this stuff at http://nodejs.org/dist/ and via 
  git, but not as nice package 
   Am Freitag, 29. Juni 2012 16:46:50 UTC+2 schrieb randy:
   hello out there!
   
   as you all know there are some differences between node 0.6.x and 0.8... 
   so i thougth using my ubuntu packet manager to get a old version of node. 
   but i tryed the semi-offical-channel at 
   http://ppa.launchpad.net/chris-lea/node.js/ and found no old versions. is 
   there a better place to look at? why there are no old versions or at 
   least one at 0.6.x? or are there any deb-package? 
   
   thanks a lot in advance! 
  
   -- 
   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 nodejs@googlegroups.com 
  (mailto:nodejs@googlegroups.com)
   To unsubscribe from this group, send email to
  nodejs+unsubscr...@googlegroups.com 
  (mailto:nodejs%2bunsubscr...@googlegroups.com)
   For more options, visit this group at
  http://groups.google.com/group/nodejs?hl=en?hl=en
 
 
 
 -- 
 Nguyen Hai Duy
 Mobile : 0914 72 1900
 Yahoo: nguyenhd_lucky
  -- 
  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 nodejs@googlegroups.com 
 (mailto:nodejs@googlegroups.com)
  To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com)
  For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: API changes from 0.6 to 0.8

2012-06-22 Thread Diogo Resende
The goal is to have a module compatible with both 0.6 and 0.8, not one for each 
version.

-- 
Diogo Resende


On Friday, June 22, 2012 at 2:37 , Dominic Tarr wrote:

 you can set what version of node a module is for in the package.json
 
 engines: { node : 0.6 }
 
 for example. this does mean you'll have two versions of the code,
 feature detection may be easier to maintain. you choice.
 
 see `npm help json`
 
 
 On Fri, Jun 22, 2012 at 12:14 AM, Roly Fentanes roly...@gmail.com 
 (mailto:roly...@gmail.com) wrote:
  I'm in a similar situation with a module I wrote. And I think I'll just
  write a note in the readme specifying which version should be installed for
  node v0.6.x.
  
  
  On Thursday, June 21, 2012 2:35:15 AM UTC-7, Diogo Resende wrote:
   
   Hi,
   
   I have a module (node-rack) to abstract the cluster module. It was built
   for 0.6 and I want to be able to support 0.8 too but not dropping 0.6
   support. I noticed for example that `kill()` was renamed to `destroy()`. I
   think this can be easy to detect but what about events? `death`event was
   changed to `exit`.
   
   Is there a way to know what events an object supports or should I just
   check the node version (using process.version.node) and do my changes from
   there?
   
   I would prefer the first option as it's similar to feature detection. This
   way I would just check for available methods and events and use the
   preferred (and available) ones.
   
   --
   Diogo Resende
  --
  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 nodejs@googlegroups.com 
  (mailto:nodejs@googlegroups.com)
  To unsubscribe from this group, send email to
  nodejs+unsubscr...@googlegroups.com 
  (mailto:nodejs+unsubscr...@googlegroups.com)
  For more options, visit this group at
  http://groups.google.com/group/nodejs?hl=en?hl=en
 
 -- 
 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 nodejs@googlegroups.com 
 (mailto:nodejs@googlegroups.com)
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com)
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] API changes from 0.6 to 0.8

2012-06-21 Thread Diogo Resende
Hi, 

I have a module (node-rack) to abstract the cluster module. It was built for 
0.6 and I want to be able to support 0.8 too but not dropping 0.6 support. I 
noticed for example that `kill()` was renamed to `destroy()`. I think this can 
be easy to detect but what about events? `death`event was changed to `exit`.

Is there a way to know what events an object supports or should I just check 
the node version (using process.version.node) and do my changes from there?

I would prefer the first option as it's similar to feature detection. This way 
I would just check for available methods and events and use the preferred (and 
available) ones. 

-- 
Diogo Resende

-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] cluster API is amazing

2012-06-16 Thread Diogo Resende
I have a module to abstract this, called rack (node-rack on github). I have to 
check the changes (I know they are some) to work with version 0.8.

-- 
Diogo Resende


On Saturday, June 16, 2012 at 19:29 , carter-thaxton wrote:

 Sorry, Nuno.  The project itself is closed-source.
 
 But it wasn't particularly tough to implement.  I basically just tweaked the 
 code examples from:
 http://nodemanual.org/latest/nodejs_ref_guide/cluster.html
 
 One of the things that's cool about the cluster API is that the child 
 processes just create HTTP or TCP servers like they would have as a 
 standalone single-process server.  The only difference is a big if-stmt at 
 the top of your program that check if you're running as a master or a worker, 
 and if you're the master, fork off the workers.  The rest of my server 
 basically remained the same.
 
 Of course, once I got it working, I added some tweaks to my logging code, to 
 include the PID for the worker process in every log line, and that sort of 
 thing.
 
  
  -- 
  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 nodejs@googlegroups.com 
 (mailto:nodejs@googlegroups.com)
  To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com)
  For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] toolbox.no.de

2012-06-14 Thread Diogo Resende
I'm not sure from whom this is but I'm getting 500 for a week now.. 

-- 
Diogo Resende

-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] process.nextTick in a callback

2012-06-06 Thread Diogo Resende
The _this_ inside process.nextTick seems quite odd to me..

-- 
Diogo Resende


On Wednesday, June 6, 2012 at 14:31 , Anand George wrote:

 Hi!
 
 Have been reading up on process.nextTick and found this one rather odd. It's 
 forcing the calling function to run again.
 
 function addasync(no1, no2, result)
 {
 res = no1 + no2;
 this.result = result(false, res);
 process.nextTick(function() {
 this.result = result(true, res);
 });
 };
 
 addasync(1, 2, function(err, res) {
 console.log(res);
 });
 
 function addsync(no1, no2) {
 return (no1 + no2);
 }
 
 console.log(addsync(4, 2)); 
 
 When I run this code I get the following output.
 
 3
 6
 3.
 
 Any ideas why this could be happening. 
 
  -- 
  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 nodejs@googlegroups.com 
 (mailto:nodejs@googlegroups.com)
  To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com)
  For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] [ANN] node-mysql 2.0.0-alpha

2012-05-15 Thread Diogo Resende
Looking at the fixes and the speed improvement, this is great! :)

-- 
Diogo Resende


On Tuesday, May 15, 2012 at 12:00 , Felix Geisendoerfer wrote:

 Hi everybody,
 
 I just released version 2.0.0-alpha of my node-mysql module:
 
 https://github.com/felixge/node-mysql/tree/v2.0/
 
 The new version is 5x faster, fixed 62 out of 66 GitHub issues, and has many 
 new features. The full details are on my blog:
 
 http://debuggable.com/posts/releasing-node-mysql-2-0-0-alpha:4fb21c18-7f84-4e8c-a1ef-599bcbdd56cb
 
 Looking forward to some feedback!
 --fg
 
  -- 
  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 nodejs@googlegroups.com 
 (mailto:nodejs@googlegroups.com)
  To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com)
  For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en


-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Live cloning of VM

2012-05-15 Thread Diogo Resende
Perhaps thinking that nodejs is a Xen node :P

-- 
Diogo Resende


On Tuesday, May 15, 2012 at 12:21 , Ben Noordhuis wrote:

 On Tue, May 15, 2012 at 6:04 AM, Ifeanyi ifeanyeg2...@gmail.com 
 (mailto:ifeanyeg2...@gmail.com) wrote:
  Please can anyone help me with C/C++ sample/example code for live cloning of
  VM on Xen platform.
 
 How is this in any way related to node.js?
 
 -- 
 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 nodejs@googlegroups.com 
 (mailto:nodejs@googlegroups.com)
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com)
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en


-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] HTTP module not accepting CONNECT requests

2012-05-06 Thread Diogo Resende
I was just replying about this. I think I found a solution. If I listen to the 
upgrade event, I get just what I need and the socket is not closed :)

If I still have any issue with this I'll try that version.

-- 
Diogo Resende


On Sunday, May 6, 2012 at 23:53 , Ben Noordhuis wrote:

 On Mon, May 7, 2012 at 12:20 AM, Diogo Resende drese...@thinkdigital.pt 
 (mailto:drese...@thinkdigital.pt) wrote:
  I'm trying to make an https proxy and I'm not able to make the http module 
  accept CONNECT requests. I have to use the net module directly. Am I 
  missing something?
  
  I'm using the latest stable version.
 
 Improved CONNECT support got added in v0.7.0[1].
 
 [1] https://github.com/joyent/node/commit/08a91acd
 
 -- 
 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 nodejs@googlegroups.com 
 (mailto:nodejs@googlegroups.com)
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com)
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en


-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] New line in node.js mailer template

2012-04-19 Thread Diogo Resende
Isn't the message part going on text/html? If you're sending just plain text, 
you have to ensure the message content type is text/plain.

-- 
Diogo Resende


On Thursday, April 19, 2012 at 13:44 , Feras Odeh wrote:

 
 I'm using node.js mailer module to send email from node server. I used 
 template file for that but I got all spaces trimmed when the message was 
 sent. I tried to add '\n' at the end line of the template but it doesn't work 
 also. Here is an example of template file:
 
 Hi {{username}},\\n Thanks for creating an account with us 
 
 I tried \n and \n , nothing all doesn't work. Any help?
 
 
 Thanks,
 
 
 Feras
 
 
  -- 
  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 nodejs@googlegroups.com 
 (mailto:nodejs@googlegroups.com)
  To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com)
  For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en


-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] which one is correct ?

2012-03-09 Thread Diogo Resende
That doesn't work..

-- 
Diogo Resende


On Friday, March 9, 2012 at 16:40 , Mark Volkmann wrote:

 Here's another approach that I prefer:
 
 exports.get_user = function (id, cb) {
  var user;
  users.some(function (u) {
  var found = u.id === id;
  if (found) user = u;
  return found;
  });
  cb(user ? null : 'not found', user);
 }
 
 On Fri, Mar 9, 2012 at 5:02 AM, Axel Kittenberger axk...@gmail.com 
 (mailto:axk...@gmail.com) wrote:
  Many coders forget that you can use the return statement before the
  end of the function. At least most people who finished some coding
  course hardly ever do this. It usually simplifies many functions:
  
  exports.get_user = function (id, func) {
   for (var i = 0, z = users.length; i  z; i ++) {
   var u = users[i];
   if (u.id === id) {
   func(null, u);
   return;
   }
   }
   func('NOT_FOUND', null);
  }
  
  Depending on optimizing speed vs memory use, or if this function is
  heavly used compared to only seldomly (profiler!) l it might be a good
  idea to keep a table handy, where the users are sorted with their id.
  
  --
  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 nodejs@googlegroups.com 
  (mailto:nodejs@googlegroups.com)
  To unsubscribe from this group, send email to
  nodejs+unsubscr...@googlegroups.com 
  (mailto:nodejs+unsubscr...@googlegroups.com)
  For more options, visit this group at
  http://groups.google.com/group/nodejs?hl=en?hl=en
 
 
 
 -- 
 R. Mark Volkmann
 Object Computing, Inc.
 
 -- 
 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 nodejs@googlegroups.com 
 (mailto:nodejs@googlegroups.com)
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com)
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en


-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: Payment Gateway / Card Processing

2012-03-03 Thread Diogo Resende
 As far as I know.. US only  

--  
Diogo Resende


On Saturday, March 3, 2012 at 17:05 , jmartins wrote:

  
 Can I use Stripe in Brazil?? Stripe billing in dollar, euro, others?
  
 Because in Brazil we have a law: If you are a brazilian guy and buy in Brazil 
 the transaction need use brazilian money R$ (real).
  
 tks
 Joao
  
 Em quinta-feira, 1 de março de 2012 15h44min37s UTC-3, Spencer Alger escreveu:
  I'm looking for the simplest way to integrate payments into my node app 
  without using those pre-baked and tacky Buy Now buttons from PayPal or 
  needing to redirect users to a third party site. My client already has a 
  PayPal merchant account and wants to stay with PayPal, so I'm thinking that 
  I'm going to be using paynode which seems fairly simple to use. Does anyone 
  have some useful advice for me before I embark on this adventure? Thanks!!
  
  
  
  --  
  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 nodejs@googlegroups.com 
 (mailto:nodejs@googlegroups.com)
  To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com 
 (mailto:nodejs+unsubscr...@googlegroups.com)
  For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en


-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] sos beginners problems with node-mysql

2012-03-01 Thread Diogo Resende

Post a gist please.

https://gist.github.com/

---
Diogo R.

On Thu, 1 Mar 2012 00:34:42 -0800 (PST), antic wrote:
i have a problem. i want to read some data from the database and 
write

it on to a page to show in the browser and i am having some trouble.
im using node-mysql. i can write it succesfully in the console line
but when i put the same code in a function and export it and call it
in the other file it does not work. lets say i have one index.js 
where

i want to show data in html and antoher file mysqldb.js where the
functions for the database are. could someone please write me a small
example i would be gratefull. thanks in advance!

 --
 Job Board: http://jobs.nodejs.org/ [1]
 Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
[2]
 You received this message because you are subscribed to the Google
 Groups nodejs group.
 To post to this group, send email to nodejs@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/nodejs?hl=en?hl=en [3]


Links:
--
[1] http://jobs.nodejs.org/
[2] 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines

[3] http://groups.google.com/group/nodejs?hl=en?hl=en


--
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Connection dies with ECONNREFUSED

2012-02-22 Thread Diogo Resende

On Wed, 22 Feb 2012 07:19:33 -0800 (PST), Rambo wrote:

I'm establishing a streaming connection using http.get(). It's
supposed to be kept alive forever but suddenly it dies with en
ECONNREFUSED error that I cannot catch.
I know everyone is sick of this type of error but no one says how to
solve it. How can I catch that error and what the fuck is that?


Node version might be helpfull. Perhaps an old bug already
solve on recent versions?

---
Diogo R.

--
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: using upstart

2012-02-20 Thread Diogo Resende

On Mon, 20 Feb 2012 03:44:44 -0800 (PST), Angelo Chen wrote:

Hi,

Thanks for sharing the script, that works.
one thing, say your app will connect to redis like those using 
coffee-
resque, it will try to connect to redis-server once loaded, and yet 
at

that time, redis is not yet ready, so you got those exceptions,
putting this might not be absolute sure it will work:

start on started redis


This should work properly. I don't have redis installed so can't ensure
the redis service is really called redis but if you have a
/etc/init/redis.conf that should work.

---
Diogo R.

--
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


[nodejs] TCP connection ending not emitting any event

2012-02-16 Thread Diogo Resende

My environment:

- node v0.7.4
- server listenning on loopback port 9000
- client connected to server
- client events (timeout, error, end) listened and console'd
- client retries connection when lost (based on any of the above 
events)


After having client and server up I use tcpkill to simulate TCP RESET:

# tcpkill -i lo port 9000

Randomly (after a few client reconnects or sometimes on the first one), 
the
client doesn't yeld anything and the process just ends (because I have 
nothing

left on the loop).

I can avoid this using process.on(exit) and force the process not to 
end and
assume the client disconnected but I would like not to use this. Am I 
doing

something wrong?

Should I test on 0.6.x ?

--
Diogo R.

--
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: TCP connection ending not emitting any event

2012-02-16 Thread Diogo Resende

On Thu, 16 Feb 2012 12:58:16 -0800 (PST), mscdex wrote:

On Feb 16, 2:08 pm, Diogo Resende drese...@thinkdigital.pt wrote:

Same happens on v0.6.10..


FIN is what causes 'end' to be emitted for TCP streams. If I remember
correctly, you'll have to listen on the 'close' event for RST.


Thank you so much, close is emitting just fine. You saved my day :)

---
Diogo R.

--
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] REPL crash in production

2012-02-16 Thread Diogo Resende

On Thu, 16 Feb 2012 22:21:09 +0100, Laurent Perrin wrote:

I just had a bad surprise on a production server and thought I'd
share it.

I have a complex node process that can open a REPL over a unix socket
for debugging purposes. If I enter invalid code:

- If the code is executed immediately, it reports an error in the 
REPL

and continues.

- However, if the code is in a different tick (e.g.
setTimeout/setInterval), it crashes the whole process.

Now, I could add a process.uncaughtException, but I'd rather let the
process crash if a real error happen somewhere else. It's not
necessarily a node problem, but it makes the REPL a very dangerous
tool to me.

Is there a safer way to inspect a running process ?

Btw, here's a simple example: http://pastebin.com/ad93YHdk [1]


You can set process.uncaughtException and if someone is connected thru
the REPL, you post the exception and not fail, otherwise log and fail.

This can cover most of the cases. Changing code in production on a REPL
is really dangerous..

---
Diogo R.

--
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] how to write for-each loop in JavaScript properly

2012-02-12 Thread Diogo Resende

On Sun, 12 Feb 2012 04:42:51 -0800 (PST), Shimon Doodkin wrote:
You could do :  myobj.hasOwnProperty(key) But then if myobj is NULL 
it

will throw an error.


It will probably throw 1 or 2 lines before in the for (...).

If you're using an object as a hash you can avoid it. If you want to be
sure, I use this:

for (k in obj) {
  if (!obj.hasOwnProperty(k)) continue;
  ..
}

Or if I can, I don't need to handle this references, I use .forEach.

---
Diogo R.

--
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en


Re: [nodejs] Re: patio - orm

2012-02-01 Thread Diogo Resende

How are you going to handle this..

db.createTable(airport, {engine:innodb}, ..);

.. on SQL Server or anything other than MySQL ?

---
Diogo R.

On Wed, 1 Feb 2012 11:48:48 -0800 (PST), Douglas Martin wrote:

Currently there is not any documentation geared towards writing you
own adapter, but I will get on that! For now you could look at the
mysql adapter(lib/adapters/mysql).

Right now patio is written in a way where every SQL fragment is given
its own method, so anything adapter specific should be able to just
override a particular method. So what you need to focus on is the
creating/deletion/validation of connections for the connection pool,
and overriding methods inside of patio.Dataset for literal
serialization and sql creation. Im currently in the process of 
writing

the postgres adapter so for documentation I'll probably document the
process as I am writing the adapter.


--
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en