[node-dev] Re: VFP2 ARM V8 Issues

2012-08-13 Thread Adam Malcontenti-Wilson
Whoops, I forgot to mention I had tried both a 0.8.6 release and the master 
branch - they appear to be quite far apart in terms of v8 so that's another 
complicating factor.

Re: [node-dev] VFP2 ARM V8 Issues

2012-08-13 Thread Ben Noordhuis
On Mon, Aug 13, 2012 at 4:44 PM, Adam Malcontenti-Wilson
adman@gmail.com wrote:
 The V8 bundled with node currently requires an ARM CPU supporting VFP3 for
 hard-float support, causing problems when trying to compile for ARMv6
 devices like the Raspberry Pi.
 There is a patch that was committed upstream at
 http://codereview.chromium.org/10818026/ but does not apply cleanly to the
 bundled V8 source, and attempting to replace it with version V8 version
 3.12.17 which does include the fixes, produces a `error: ‘MAP_TRANSITION’
 was not declared in this scope`.

You probably botched the upgrade, e.g. by leaving old files around. I
usually upgrade V8 as follows:

  rm -rf deps/v8/  (cd /path/to/v8  git archive --format=tar
--prefix=deps/v8/ commit) | tar x

Where /path/to/v8 is a clone of https://github.com/v8/v8 and commit
is the commit or branch name (possibly just HEAD).


[nodejs] Re: Best practices for sharing code and data between the server and client

2012-08-13 Thread greelgorke
to the topic: take a look at derbyjs.org :)

Am Samstag, 11. August 2012 18:21:20 UTC+2 schrieb shoshy:

 Nils,

 Thanks a lot for your quick reply. 
 I'll test it, i did see the entry_validation, but didn't know if backbone 
 likes to be used on both sides :) same goes with require.js... i'll keep 
 you updated.

 regarding SQL driver - is think this is a major pitfall for node.js. 
 node.js should have a native (core) , out-of-the-box generalised drivers to 
 SQL DB , just like php's PDO.
 Regarding the deep callbacks, have you used async (for flow control)  
 https://github.com/caolan/async/  , and  
 http://fennb.com/nodejs-a-giant-step-backwards  ? 

 thanks about the ORM tip

 shoshy 

 On Saturday, August 11, 2012 7:05:50 PM UTC+3, Nils Lattek wrote:

 Shoshy,

 thanks for your kind feedback. Yes you can just move any javascript file 
 to the shared/js folder and adjust the file to require amdefine at the top 
 (like in the example entry_validation file).
 Then make sure to use the correct (relative) path on the client and 
 server. Take a look at client/js/entry.js and server/models/entry.js
 If you are using a Backbone.Model do not forget to require backbone on 
 your server.

 Regarding your SQL question: I do not have a solution for you. After 
 experimenting a little bit with MySQL using 
 http://www.sequelizejs.com/(works with MySQL and Postgresql) and 
 https://npmjs.org/package/mysql my code quickly turned into deep 
 callback nesting. Especially when dealing with relationships. This made me 
 think about that maybe NoSQL is a better fit for the Nodejs style, but I am 
 still experimenting and looking for the opinion of other people.

 On a side note if your are using a serverside ORM framework like 
 Sequelizejs which has its own Model-Class/Syntax you cannot use the same 
 model on the server and client because Backbone models are created by 
 extending Backbone.Model and Sequelize models by using sequelize.define. 
 Thats why I was going to just share the validation logic.
   
 Nils

 On Friday, August 10, 2012 10:38:29 PM UTC+2, shoshy wrote:


 Nils ,

 Thanks so much for your boilerplate, i'm new to node.js but i've been 
 working with backbone, we have the same boilerplate structure and bits of 
 code for that matter. 
 My question is , i need to share the SAME model of the client. Rather 
 it's for extending it or use it as-is. Does that mean that i can just put 
 the models directory from the client in the shared and use it from backbone 
 as is? 

 Also what is your suggestion for generalised SQL driver for node? (lets 
 say i want to connect to mysql OR to postreSQL but i don't want 2 . Like 
 PDO in php)

 Thanks again! would love to keep in touch. I'm adopting your 
 boilerplate. 
 P.S. it needs updating (express changed their commands a bit)

 Shoshy


 On Saturday, June 2, 2012 7:26:55 PM UTC+3, Nils Lattek wrote:

 I found it a little difficult to setup a module sharing solution, 
 because of the two different module formats (AMD and CommonJS). Projects 
 such as browserify are awesome, but I wanted to try it with AMD modules.

 So after a lot of googling and experimenting I created a small demo 
 project which shows how to share code between backbonejs and nodejs.
 I do not use it to share the complete model, because most db-modules 
 (like sequelizejs or mongoose) in node have their own way of defining 
 models. So you would have to merge the definition code of a backbone model 
 with the one of a mongoose model.
 What I tried to do is share the validation logic between the client and 
 the server. This kind of code can be executed regardless of which model 
 format (backbone, mongoose, sequelize) you are using.
 You could also use it for other kind of modules or to share 
 Constants/enums across the client and server.

 The example also shows how to setup mochajs unittesting for these 
 modules.
 There are still some things which could be solved better and I am 
 interested in seeing more examples from other people.

 You can find it here:
 https://github.com/NilsLattek/backbone-requirejs-node-boilerplate


 On Wednesday, May 30, 2012 1:58:46 PM UTC+2, al-Amjad Tawfiq Isstaif 
 wrote:

 Hello everybody!

 I'm new to the great world of Node.js and have been playing around 
 with different modules and frameworks. However, there seems a lot of 
 methods for sharing server code with the client, and there are no default 
 way for doing that.

 I have come across many ideas:

 express-expose: this is a nice replacement for parsing JSON objects 
 rendered by the the server.
 https://github.com/visionmedia/express-expose

 This article exposes a hack to share backbone models on the Node 
 server, and they are trying to neat their hack with their Capsule and 
 Thoonk frameworks:

 http://andyet.net/blog/2011/feb/15/re-using-backbonejs-models-on-the-server-with-node/

 Syncrhonizing Backbone model using socket.io
 https://github.com/scttnlsn/backbone.io

 DNode and RPC as a method 

[nodejs] Re: Choose an extension is suit for nodejs ?

2012-08-13 Thread greelgorke
its not. not the extension, but the route and placement on server are key

Am Samstag, 11. August 2012 12:15:56 UTC+2 schrieb bo b:

 NO,  .js IS refer to static brower javascript .

 if you choose .js as page extension it would be great problem !


-- 
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] a pakage that exports few modules

2012-08-13 Thread Osher E
Hi all

most modules have an entry point, which is by default index.js.

But what if my module does not have one entry point?
What if it is a colleciton of many small cross-project core utility modules 
that i would not always want to load them all to use one of them?
I mean, by doing

var core = require('core').logger
we require  whatever is exported on the entry-point of core, and use only 
logger.
and there could be twenty of them, where in this project I just need the 
logger here.

Please avoid the discussion of wither to wrap each utility as it's own 
package...
Just assume that they do not justify that, but do need a package to live 
in...

I saw somewhere that I should be able to
var core = require('core/logger')
and should be able to direct in my package.json that 'core/logger' is 
actually available at ./lib/logger
only that now i cant find that place that sais how to do it...

Was I dreaming? Can anybody point it out for me? :)

Thanks

O.

-- 
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] Best practices for sharing code and data between the server and client

2012-08-13 Thread Mariusz Nowak
See also https://github.com/medikoo/modules-webmake the idea is to use same 
module format on server and client side, so you can easily share same 
code on both sides.
I use it with success. Currently I work with application for which 
client-side code is built of over 200 Node.js style modules and 60% of 
those modules are also used on server-side.

-- 
Mariusz Nowak
http://github.com/medikoo
http://twitter.com/medikoo

On Saturday, June 2, 2012 3:20:29 PM UTC+2, al-Amjad Tawfiq Isstaif wrote:

 Thank you very much everybody for your notes!

 @Martin
 I tried to have a fast look at YUI. What gives YUI the ability to run 
 client code on the server? I mean what makes it different from other 
 Javascript MVC frameworks such as Backbone.js?



 On Thu, May 31, 2012 at 6:43 AM, Martin Cooper mfnc...@gmail.comjavascript:
  wrote:

 On Wed, May 30, 2012 at 4:58 AM, Amjad iss...@gmail.com javascript: 
 wrote:
  Hello everybody!
 
  I'm new to the great world of Node.js and have been playing around with
  different modules and frameworks. However, there seems a lot of methods 
 for
  sharing server code with the client, and there are no default way for 
 doing
  that.

 That's in part because it rather depends on what you're trying to do.
 For example, you might be:

 * trying to take existing code written for Node and run it in the browser
 * trying to take existing code written for the browser and run it in Node
 * trying to write a new codebase that will run in both places

 As has been mentioned, browserify is probably the best solution for
 the first of these. I think it's safe to say that it garners the most
 attention, in part because it's good at what it does.

 For the last case, you might want to take a look at YUI, which
 provides the abstractions to let you write your code once and run it
 in both places. Yahoo! has built Mojito on top of YUI and is using
 that to create multi-device apps that transparently share code between
 client and server. (BTW, you'll likely find that YUI is much more
 lightweight and modular than you think.)

 --
 Martin Cooper


  I have come across many ideas:
 
  express-expose: this is a nice replacement for parsing JSON objects 
 rendered
  by the the server.
  https://github.com/visionmedia/express-expose
 
  This article exposes a hack to share backbone models on the Node 
 server, and
  they are trying to neat their hack with their Capsule and Thoonk 
 frameworks:
  
 http://andyet.net/blog/2011/feb/15/re-using-backbonejs-models-on-the-server-with-node/
 
  Syncrhonizing Backbone model using socket.io
  https://github.com/scttnlsn/backbone.io
 
  DNode and RPC as a method to use server methods on the client and vice 
 versa
  https://github.com/substack/dnode
 
  I know I've mixed a lot of topics, I thought sharing my confusion would 
 help
  to get more clarification, especially that there are a lot of production
  projects based on Node, andI think that the community certainly have 
 reached
  a good collection of concepts and tools for sharing code between the 
 server
  and client. I would be very grateful for sharing your thoughts about 
 that.
 
  Best regards,
 
  Amjad
 
 
  --
  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.comjavascript:
  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.comjavascript:
 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
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] Re: a pakage that exports few modules

2012-08-13 Thread greelgorke
make your core configurable:

// core module

module.exports = function load(arrayOfSubmodules){

}

Am Montag, 13. August 2012 12:02:10 UTC+2 schrieb Osher E:

 Hi all

 most modules have an entry point, which is by default index.js.

 But what if my module does not have one entry point?
 What if it is a colleciton of many small cross-project core utility 
 modules that i would not always want to load them all to use one of them?
 I mean, by doing

 var core = require('core').logger
 we require  whatever is exported on the entry-point of core, and use only 
 logger.
 and there could be twenty of them, where in this project I just need the 
 logger here.

 Please avoid the discussion of wither to wrap each utility as it's own 
 package...
 Just assume that they do not justify that, but do need a package to live 
 in...

 I saw somewhere that I should be able to
 var core = require('core/logger')
 and should be able to direct in my package.json that 'core/logger' is 
 actually available at ./lib/logger
 only that now i cant find that place that sais how to do it...

 Was I dreaming? Can anybody point it out for me? :)

 Thanks

 O.


-- 
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] Re: a pakage that exports few modules

2012-08-13 Thread greelgorke
make your entry point configurable:

// core entry point:
module.exports.libs = ['logger', 'morelib', /*all other*/];

module.exports.load = function load(libsToLoad){
  var libs = {};
  if(libsToLoad.indexOf('logger') =0)
   libs.logger = require('./logger');
//proceed for every entry in libsToLoad

  return libs;
};


// client module
var core = require('core');
// check that lib can be loaded with core.libs

var libs = core.load(['logger']);
var logger = libs.logger;


hope it helps, i don't see any way to load a module out of the package. in 
fact this would contradict the purpose of packages as they are meant 

greetz

Am Montag, 13. August 2012 12:02:10 UTC+2 schrieb Osher E:

 Hi all

 most modules have an entry point, which is by default index.js.

 But what if my module does not have one entry point?
 What if it is a colleciton of many small cross-project core utility 
 modules that i would not always want to load them all to use one of them?
 I mean, by doing

 var core = require('core').logger
 we require  whatever is exported on the entry-point of core, and use only 
 logger.
 and there could be twenty of them, where in this project I just need the 
 logger here.

 Please avoid the discussion of wither to wrap each utility as it's own 
 package...
 Just assume that they do not justify that, but do need a package to live 
 in...

 I saw somewhere that I should be able to
 var core = require('core/logger')
 and should be able to direct in my package.json that 'core/logger' is 
 actually available at ./lib/logger
 only that now i cant find that place that sais how to do it...

 Was I dreaming? Can anybody point it out for me? :)

 Thanks

 O.


-- 
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] Re: a pakage that exports few modules

2012-08-13 Thread greelgorke
replace
 //proceed for every entry in libsToLoad
with
 //proceed for every entry in exports.libs

Am Montag, 13. August 2012 13:15:34 UTC+2 schrieb greelgorke:

 make your entry point configurable:

 // core entry point:
 module.exports.libs = ['logger', 'morelib', /*all other*/];

 module.exports.load = function load(libsToLoad){
   var libs = {};
   if(libsToLoad.indexOf('logger') =0)
libs.logger = require('./logger');
 //proceed for every entry in libsToLoad

   return libs;
 };


 // client module
 var core = require('core');
 // check that lib can be loaded with core.libs

 var libs = core.load(['logger']);
 var logger = libs.logger;


 hope it helps, i don't see any way to load a module out of the package. in 
 fact this would contradict the purpose of packages as they are meant 

 greetz

 Am Montag, 13. August 2012 12:02:10 UTC+2 schrieb Osher E:

 Hi all

 most modules have an entry point, which is by default index.js.

 But what if my module does not have one entry point?
 What if it is a colleciton of many small cross-project core utility 
 modules that i would not always want to load them all to use one of them?
 I mean, by doing

 var core = require('core').logger
 we require  whatever is exported on the entry-point of core, and use 
 only logger.
 and there could be twenty of them, where in this project I just need the 
 logger here.

 Please avoid the discussion of wither to wrap each utility as it's own 
 package...
 Just assume that they do not justify that, but do need a package to live 
 in...

 I saw somewhere that I should be able to
 var core = require('core/logger')
 and should be able to direct in my package.json that 'core/logger' is 
 actually available at ./lib/logger
 only that now i cant find that place that sais how to do it...

 Was I dreaming? Can anybody point it out for me? :)

 Thanks

 O.



-- 
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 pakage that exports few modules

2012-08-13 Thread Dan Milon
I believe there is no performance drop if you require a huge library and 
only use a small part of it. I mean, code memory is a small part of the 
total memory you use.


danmilon.

On 08/13/2012 01:02 PM, Osher E wrote:

Hi all

most modules have an entry point, which is by default index.js.

But what if my module does not have one entry point?
What if it is a colleciton of many small cross-project core utility 
modules that i would not always want to load them all to use one of them?

I mean, by doing

var core = require('core').logger
we require  whatever is exported on the entry-point of core, and use 
only logger.
and there could be twenty of them, where in this project I just need 
the logger here.


Please avoid the discussion of wither to wrap each utility as it's own 
package...
Just assume that they do not justify that, but do need a package to 
live in...


I saw somewhere that I should be able to
var core = require('core/logger')
and should be able to direct in my package.json that 'core/logger' is 
actually available at ./lib/logger

only that now i cant find that place that sais how to do it...

Was I dreaming? Can anybody point it out for me? :)

Thanks

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


--
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] npm got Segmentation fault at linux (npm 1.1.48 node v0.8.6)

2012-08-13 Thread TZ

http://stackoverflow.com/questions/11895623/npm-got-segmentation-fault-at-linux


   - *linux version:*

[root@etone231 download]# lsb_release -a
LSB Version:
:core-3.1-amd64:core-3.1-ia32:core-3.1-noarch:graphics-3.1-amd64:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: RedHatEnterpriseServer
Description:Red Hat Enterprise Linux Server release 5.1 (Tikanga)
Release:5.1
Codename:   Tikanga


   - *node.js:*

git clone https://github.com/joyent/node.git
cd node
./configure
make
sudo make install


   - *npm fail:*

[root@etone231 download]# node -e console.log('a')
a

[root@etone231 download]# node -v
v0.8.6

[root@etone231 download]# python -V
Python 2.7.3

[root@etone231 download]# gmake -v
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for x86_64-redhat-linux-gnu

[root@etone231 download]# npm -v
1.1.48

[root@etone231 download]# npm list
Segmentation fault

-- 
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] npm got Segmentation fault at linux (npm 1.1.48 node v0.8.6)

2012-08-13 Thread Ben Noordhuis
On Mon, Aug 13, 2012 at 11:42 AM, TZ atia...@qq.com wrote:

 http://stackoverflow.com/questions/11895623/npm-got-segmentation-fault-at-linux

 linux version:

 [root@etone231 download]# lsb_release -a
 LSB Version:
 :core-3.1-amd64:core-3.1-ia32:core-3.1-noarch:graphics-3.1-amd64:graphics-3.1-ia32:graphics-3.1-noarch
 Distributor ID: RedHatEnterpriseServer
 Description:Red Hat Enterprise Linux Server release 5.1 (Tikanga)
 Release:5.1
 Codename:   Tikanga

 node.js:

 git clone https://github.com/joyent/node.git
 cd node
 ./configure
 make
 sudo make install

 npm fail:

 [root@etone231 download]# node -e console.log('a')
 a

 [root@etone231 download]# node -v
 v0.8.6

 [root@etone231 download]# python -V
 Python 2.7.3

 [root@etone231 download]# gmake -v
 GNU Make 3.81
 Copyright (C) 2006  Free Software Foundation, Inc.
 This is free software; see the source for copying conditions.
 There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
 PARTICULAR PURPOSE.

 This program built for x86_64-redhat-linux-gnu

 [root@etone231 download]# npm -v
 1.1.48

 [root@etone231 download]# npm list
 Segmentation fault

Try this:

  $ gdb --args npm list
   run
  # wait for crash
   backtrace full
  # post the backtrace

By the way, you have more than one node binary installed. The GH repo
builds v0.9.1-pre but `node -v` reports v0.8.6.

-- 
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 pakage that exports few modules

2012-08-13 Thread Christian Tellnes
You can use getters like connect does.

https://github.com/senchalabs/connect/blob/master/lib/connect.js#L86-92



2012/8/13 Osher E osher...@gmail.com:
 Hi all

 most modules have an entry point, which is by default index.js.

 But what if my module does not have one entry point?
 What if it is a colleciton of many small cross-project core utility modules
 that i would not always want to load them all to use one of them?
 I mean, by doing

 var core = require('core').logger
 we require  whatever is exported on the entry-point of core, and use only
 logger.
 and there could be twenty of them, where in this project I just need the
 logger here.

 Please avoid the discussion of wither to wrap each utility as it's own
 package...
 Just assume that they do not justify that, but do need a package to live
 in...

 I saw somewhere that I should be able to
 var core = require('core/logger')
 and should be able to direct in my package.json that 'core/logger' is
 actually available at ./lib/logger
 only that now i cant find that place that sais how to do it...

 Was I dreaming? Can anybody point it out for me? :)

 Thanks

 O.

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

-- 
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] Re: Can I add a new crl after the server has started?

2012-08-13 Thread Christian Tellnes
For reference, here is my implementation. Had I only managed to come
on a better name for the module.

https://github.com/tellnes/tls-cert-update

-- 
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] Re: Web scraping and Memory leaking issue

2012-08-13 Thread ec.developer
After upgrading from v0.8.0 to v0.8.6 - app seems to work without any 
memory leaks. After checking over 4 thousands of pages, it uses around 45mb 
- 60mb.

On Monday, July 2, 2012 4:08:13 PM UTC+3, ec.developer wrote:

 Hi all, 
 I've created a small app, which searches for Not Found [404] exceptions on 
 a specified website. I use the node-scraper module (
 https://github.com/mape/node-scraper/), which uses native node's request 
 module and jsdom for parsing the html). 
 My app recursively searches for links on the each webpage, and then calls 
 the Scraping stuff for each found link. The problem is that after scanning 
 100 pages (and collecting over 200 links to be scanned) the RSS memory 
 usage is 200MB (and it still increases on each iteration). So after 
 scanning over 300-400 pages, I got memory allocation error. 
 The code is provided below. 
 Any hints? 

 var scraper = require('scraper'),
 util = require('util');

 var checkDomain = process.argv[2].replace(https://;, 
 ).replace(http://;, ),
 links = [process.argv[2]],
 links_grabbed = [];

 var link_check = links.pop();
 links_grabbed.push(link_check);
 scraper(link_check, parseData);

 function parseData(err, jQuery, url)
 {
 var ramUsage = bytesToSize(process.memoryUsage().rss);
 process.stdout.write(\rLinks checked:  + 
 (Object.keys(links_grabbed).length) + / + links.length +  [+ ramUsage 
 +] );

 if( err ) {
 console.log(%s [%s], source - %s, err.uri, err.http_status, 
 links_grabbed[err.uri].src);
 }
 else {
 jQuery('a').each(function() {
 var link = jQuery(this).attr(href).trim();

 if( link.indexOf(/)==0 )
 link = http://; + checkDomain + link;

 if( links.indexOf(link)==-1  links_grabbed.indexOf(link)==-1  [#, 
 ].indexOf(link)==-1  (link.indexOf(http://; + checkDomain)==0 || 
 link.indexOf(https://+checkDomain)==0) ) 
 links.push(link);
 });
 }

 if( links.length0 ) {
 var link_check = links.pop();
 links_grabbed.push(link_check);
 scraper(link_check, parseData);
 }
 else {
 util.log(Scraping is done. Bye bye =));
 process.exit(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
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] [Ann] Connect-bruteforce

2012-08-13 Thread Pedro Narciso García Revington
Hi everyone,

This is a module that prevents brute force login by delaying responses. 
It is also usefull when you want to require captcha validation after some 
unsuccesful tries.

See README for usage.

https://github.com/revington/connect-bruteforce

Cheers,
Pedro

-- 
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] Best practices for sharing code and data between the server and client

2012-08-13 Thread Jeff Barczewski
Mariusz,

After reviewing your readme, webmake looks pretty nice!


One idea, if you made your API signature use 

  function (require, exports, module)

then it would be compatible with AMD's commonjs signature, and there could 
be some nice ways to integrate with AMD modules and tools. Just something 
to consider.


I like the elegance of your approach, seems to really make things easy. I 
will have to give it a try soon.

All the best,

Jeff

On Monday, 13 August 2012 05:36:38 UTC-5, Mariusz Nowak wrote:

 See also https://github.com/medikoo/modules-webmake the idea is to use 
 same module format on server and client side, so you can easily share 
 same code on both sides.
 I use it with success. Currently I work with application for which 
 client-side code is built of over 200 Node.js style modules and 60% of 
 those modules are also used on server-side.

 -- 
 Mariusz Nowak
 http://github.com/medikoo
 http://twitter.com/medikoo

 On Saturday, June 2, 2012 3:20:29 PM UTC+2, al-Amjad Tawfiq Isstaif wrote:

 Thank you very much everybody for your notes!

 @Martin
 I tried to have a fast look at YUI. What gives YUI the ability to run 
 client code on the server? I mean what makes it different from other 
 Javascript MVC frameworks such as Backbone.js?



 On Thu, May 31, 2012 at 6:43 AM, Martin Cooper mfnc...@gmail.com wrote:

 On Wed, May 30, 2012 at 4:58 AM, Amjad iss...@gmail.com wrote:
  Hello everybody!
 
  I'm new to the great world of Node.js and have been playing around with
  different modules and frameworks. However, there seems a lot of 
 methods for
  sharing server code with the client, and there are no default way for 
 doing
  that.

 That's in part because it rather depends on what you're trying to do.
 For example, you might be:

 * trying to take existing code written for Node and run it in the browser
 * trying to take existing code written for the browser and run it in Node
 * trying to write a new codebase that will run in both places

 As has been mentioned, browserify is probably the best solution for
 the first of these. I think it's safe to say that it garners the most
 attention, in part because it's good at what it does.

 For the last case, you might want to take a look at YUI, which
 provides the abstractions to let you write your code once and run it
 in both places. Yahoo! has built Mojito on top of YUI and is using
 that to create multi-device apps that transparently share code between
 client and server. (BTW, you'll likely find that YUI is much more
 lightweight and modular than you think.)

 --
 Martin Cooper


  I have come across many ideas:
 
  express-expose: this is a nice replacement for parsing JSON objects 
 rendered
  by the the server.
  https://github.com/visionmedia/express-expose
 
  This article exposes a hack to share backbone models on the Node 
 server, and
  they are trying to neat their hack with their Capsule and Thoonk 
 frameworks:
  
 http://andyet.net/blog/2011/feb/15/re-using-backbonejs-models-on-the-server-with-node/
 
  Syncrhonizing Backbone model using socket.io
  https://github.com/scttnlsn/backbone.io
 
  DNode and RPC as a method to use server methods on the client and vice 
 versa
  https://github.com/substack/dnode
 
  I know I've mixed a lot of topics, I thought sharing my confusion 
 would help
  to get more clarification, especially that there are a lot of 
 production
  projects based on Node, andI think that the community certainly have 
 reached
  a good collection of concepts and tools for sharing code between the 
 server
  and client. I would be very grateful for sharing your thoughts about 
 that.
 
  Best regards,
 
  Amjad
 
 
  --
  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
  To unsubscribe from this group, send email to
  nodejs+un...@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 nod...@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+un...@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

Re: [nodejs] Re: Best practices for sharing code and data between the server and client

2012-08-13 Thread Phoscur

Server not found

Am 13.08.2012 09:11, schrieb greelgorke:

to the topic: take a look at derbyjs.org :)

Am Samstag, 11. August 2012 18:21:20 UTC+2 schrieb shoshy:

Nils,

Thanks a lot for your quick reply.
I'll test it, i did see the entry_validation, but didn't know if
backbone likes to be used on both sides :) same goes with
require.js... i'll keep you updated.

regarding SQL driver - is think this is a major pitfall for
node.js. node.js should have a native (core) , out-of-the-box
generalised drivers to SQL DB , just like php's PDO.
Regarding the deep callbacks, have you used async (for flow
control) https://github.com/caolan/async/
https://github.com/caolan/async/ , and
http://fennb.com/nodejs-a-giant-step-backwards
http://fennb.com/nodejs-a-giant-step-backwards ?

thanks about the ORM tip

shoshy

On Saturday, August 11, 2012 7:05:50 PM UTC+3, Nils Lattek wrote:

Shoshy,

thanks for your kind feedback. Yes you can just move any
javascript file to the shared/js folder and adjust the file to
require amdefine at the top (like in the example
entry_validation file).
Then make sure to use the correct (relative) path on the
client and server. Take a look at client/js/entry.js and
server/models/entry.js
If you are using a Backbone.Model do not forget to require
backbone on your server.

Regarding your SQL question: I do not have a solution for you.
After experimenting a little bit with MySQL using
http://www.sequelizejs.com/ (works with MySQL and Postgresql)
and https://npmjs.org/package/mysql
https://npmjs.org/package/mysql my code quickly turned into
deep callback nesting. Especially when dealing with
relationships. This made me think about that maybe NoSQL is a
better fit for the Nodejs style, but I am still experimenting
and looking for the opinion of other people.

On a side note if your are using a serverside ORM framework
like Sequelizejs which has its own Model-Class/Syntax you
cannot use the same model on the server and client because
Backbone models are created by extending Backbone.Model and
Sequelize models by using sequelize.define. Thats why I was
going to just share the validation logic.
Nils

On Friday, August 10, 2012 10:38:29 PM UTC+2, shoshy wrote:


Nils ,

Thanks so much for your boilerplate, i'm new to node.js
but i've been working with backbone, we have the same
boilerplate structure and bits of code for that matter.
My question is , i need to share the SAME model of the
client. Rather it's for extending it or use it as-is. Does
that mean that i can just put the models directory from
the client in the shared and use it from backbone as is?

Also what is your suggestion for generalised SQL driver
for node? (lets say i want to connect to mysql OR to
postreSQL but i don't want 2 . Like PDO in php)

Thanks again! would love to keep in touch. I'm adopting
your boilerplate.
P.S. it needs updating (express changed their commands a bit)

Shoshy


On Saturday, June 2, 2012 7:26:55 PM UTC+3, Nils Lattek
wrote:

I found it a little difficult to setup a module
sharing solution, because of the two different module
formats (AMD and CommonJS). Projects such
as browserify are awesome, but I wanted to try it with
AMD modules.

So after a lot of googling and experimenting I created
a small demo project which shows how to share code
between backbonejs and nodejs.
I do not use it to share the complete model, because
most db-modules (like sequelizejs or mongoose) in node
have their own way of defining models. So you would
have to merge the definition code of a backbone model
with the one of a mongoose model.
What I tried to do is share the validation logic
between the client and the server. This kind of code
can be executed regardless of which model format
(backbone, mongoose, sequelize) you are using.
You could also use it for other kind of modules or to
share Constants/enums across the client and server.

The example also shows how to setup mochajs
unittesting for these modules.
There are still some things which could be solved
better and I am interested in seeing more examples
from other people.

You can find it here:


Re: [nodejs] Best practices for sharing code and data between the server and client

2012-08-13 Thread Mariusz Nowak
@Jeff Thanks for that note, I might change that signature in near future 
just to resemble some standard, however I doubt any external tools can 
benefit from that, at least I can't imagine any valid use case.

On Monday, August 13, 2012 6:25:45 PM UTC+2, Jeff Barczewski wrote:

 Mariusz,

 After reviewing your readme, webmake looks pretty nice!


 One idea, if you made your API signature use 

   function (require, exports, module)

 then it would be compatible with AMD's commonjs signature, and there could 
 be some nice ways to integrate with AMD modules and tools. Just something 
 to consider.


 I like the elegance of your approach, seems to really make things easy. I 
 will have to give it a try soon.

 All the best,

 Jeff

 On Monday, 13 August 2012 05:36:38 UTC-5, Mariusz Nowak wrote:

 See also https://github.com/medikoo/modules-webmake the idea is to use 
 same module format on server and client side, so you can easily share 
 same code on both sides.
 I use it with success. Currently I work with application for which 
 client-side code is built of over 200 Node.js style modules and 60% of 
 those modules are also used on server-side.

 -- 
 Mariusz Nowak
 http://github.com/medikoo
 http://twitter.com/medikoo

 On Saturday, June 2, 2012 3:20:29 PM UTC+2, al-Amjad Tawfiq Isstaif wrote:

 Thank you very much everybody for your notes!

 @Martin
 I tried to have a fast look at YUI. What gives YUI the ability to run 
 client code on the server? I mean what makes it different from other 
 Javascript MVC frameworks such as Backbone.js?



 On Thu, May 31, 2012 at 6:43 AM, Martin Cooper mfnc...@gmail.comwrote:

 On Wed, May 30, 2012 at 4:58 AM, Amjad iss...@gmail.com wrote:
  Hello everybody!
 
  I'm new to the great world of Node.js and have been playing around 
 with
  different modules and frameworks. However, there seems a lot of 
 methods for
  sharing server code with the client, and there are no default way for 
 doing
  that.

 That's in part because it rather depends on what you're trying to do.
 For example, you might be:

 * trying to take existing code written for Node and run it in the 
 browser
 * trying to take existing code written for the browser and run it in 
 Node
 * trying to write a new codebase that will run in both places

 As has been mentioned, browserify is probably the best solution for
 the first of these. I think it's safe to say that it garners the most
 attention, in part because it's good at what it does.

 For the last case, you might want to take a look at YUI, which
 provides the abstractions to let you write your code once and run it
 in both places. Yahoo! has built Mojito on top of YUI and is using
 that to create multi-device apps that transparently share code between
 client and server. (BTW, you'll likely find that YUI is much more
 lightweight and modular than you think.)

 --
 Martin Cooper


  I have come across many ideas:
 
  express-expose: this is a nice replacement for parsing JSON objects 
 rendered
  by the the server.
  https://github.com/visionmedia/express-expose
 
  This article exposes a hack to share backbone models on the Node 
 server, and
  they are trying to neat their hack with their Capsule and Thoonk 
 frameworks:
  
 http://andyet.net/blog/2011/feb/15/re-using-backbonejs-models-on-the-server-with-node/
 
  Syncrhonizing Backbone model using socket.io
  https://github.com/scttnlsn/backbone.io
 
  DNode and RPC as a method to use server methods on the client and 
 vice versa
  https://github.com/substack/dnode
 
  I know I've mixed a lot of topics, I thought sharing my confusion 
 would help
  to get more clarification, especially that there are a lot of 
 production
  projects based on Node, andI think that the community certainly have 
 reached
  a good collection of concepts and tools for sharing code between the 
 server
  and client. I would be very grateful for sharing your thoughts about 
 that.
 
  Best regards,
 
  Amjad
 
 
  --
  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
  To unsubscribe from this group, send email to
  nodejs+un...@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 nod...@googlegroups.com
 To unsubscribe from this group, send email to
 nodejs+un...@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: 

[nodejs] Re: Raft - PaaS - Advice from nodester / nodejitsu / haibu

2012-08-13 Thread chrismatthieu
Hi Tim,

I'm the founder of Nodester, the open source Node.JS PaaS.  Your project 
sounds really cool!  Answers to your questions are provided below:

- I know that nodester is hosted on AWS's and with that how many apps are 
hosted per server? Are the server like a 8GB/RAM 4/core pc running maybe 20 
apps per server, or is is a micro server running just one app?

Nodester is currently hosting over 6,000 Node.JS apps on a single Extra 
Large AWS instance without a reverse proxy!  We have a team currently 
working on horizontal scaling and monitoring and the ability to spin up 
additional resources like Heroku's dynos.  We are calling them Jets to go 
along with our rocket theme ;)

- To nodester. why did you chose git for the pushing of apps to the 
backend? 

We love Git!  It's the modern way for updating code and pushing updates on 
many services.  Now that Windows users are becoming more familiar with git, 
our support efforts have decreased with trying to teach people how to use 
it.  Setting up an RSA key the first time for git has always been our most 
FAQ.  Over time, this has proven to be the right decision!

- To nodester / nodejitsu. Have you guys thought of a kind of dynos (heroku 
style)? if so how would you guys go about doing that? like you spawn 2 
processes of the same app and just route request to each app like node does 
with the cluster module?

Jets are coming...

- To nodester. On average what are your costs running 3000+ app on AWS's? 

$500 per month (which is sponsored by @Tropo) :)

Gotta love the Node.JS community and Tropo - http://tropo.com!

Hack the Planet!
@ChrisMatthieu



On Saturday, August 11, 2012 2:33:21 PM UTC-7, Tim Dickinson wrote:

 Hey all.

 So this is not a ANN but more of an request for advice from nodester / 
 nodejitsu / haibu and the community in general. What i have been working on 
 for the past few months is of sort a PaaS. The basic idea behind it is to 
 create a server to can spawn node apps that are pushed out to it with a cli.

 I'm calling it Raft as in a boat to float apps on. It has gone through a 
 few iterations since it creation. It started out as a MVC style app 
 container. The basic app structure was you would have your model's, view's 
 and controller's, and raft would load all these into the app, kinda so 
 you didn't have to code and express server or is server or what have you. 
 As i worked on raft and played around with it more i found that 
 the MVC style was much less dynamic then i would have liked. So from that 
 the current version has evolved.

 The current version... OK the current version is now very low leave, in 
 fact it does not do much other then load the app and its module in a 
 context with its own process. the only different between the raft context 
 and plain nodejs context is that you get a global called raft. what the 
 raft object does is gives you http, tcp, express server and so on. these 
 servers are just like the native server but for one difference and that 
 been httpserver.listen, the native httpserver.listen take a port and host, 
 but what the raft httpserver.listen take is a string that is a domain that 
 gets routed to the port of that app. 

 OK so like i say this is not an announcement but more a request for advice.

 Some of the questions:

 I know that nodester is hosted on AWS's and with that how many apps are 
 hosted per server? Are the server like a 8GB/RAM 4/core pc running maybe 20 
 apps per server, or is is a micro server running just one app?

 Nodejitsu are the developer of  haibu, but i dont think that is what they 
 are using for the PaaS. Now on that is their backend a custom build 
 of haibu or is it a whole new module in its own?

 To nodester. why did you chose git for the pushing of apps to the backend? 

 To nodester / nodejitsu. Have you guys thought of a kind of dynos (heroku 
 style)? if so how would you guys go about doing that? like you spawn 2 
 processes of the same app and just route request to each app like node does 
 with the cluster module?

 To nodester. On average what are your costs running 3000+ app on AWS's? 

 OK so this is what im going to ask for now. I do have more question but i 
 would like to see if i get any answers for these ones.

 Gota love node!

 The code for now. Please note that this is not a release but a QA
 https://npmjs.org/package/raft
 https://github.com/FLYBYME/Raft


 Thanks all
 Tim


-- 
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] node on IBM AIX POWER7

2012-08-13 Thread rgmilone
Does anyone know if it's within the realm of feasibility to run node on 
IBM's AIX OS?  This is IBM's UNIX OS running on IBM Power Systems hardware 
with POWER7 chip architecture.  I can't find any references to anyone doing 
this so I'm thinking it might not work.  I tried compiling the source and 
it blew up, but I'm not sure if it's something I'm doing wrong or if it's 
just simply that it will never work because of a fundamental 
incompatibility with IBM's hardware.  Before I go any further does anyone 
know if I'm crazy for trying this or if it theoretically should compile?

-- 
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 on IBM AIX POWER7

2012-08-13 Thread Ben Noordhuis
On Mon, Aug 13, 2012 at 6:56 PM, rgmilone rgmil...@cnxcorp.com wrote:
 Does anyone know if it's within the realm of feasibility to run node on
 IBM's AIX OS?  This is IBM's UNIX OS running on IBM Power Systems hardware
 with POWER7 chip architecture.  I can't find any references to anyone doing
 this so I'm thinking it might not work.  I tried compiling the source and it
 blew up, but I'm not sure if it's something I'm doing wrong or if it's just
 simply that it will never work because of a fundamental incompatibility with
 IBM's hardware.  Before I go any further does anyone know if I'm crazy for
 trying this or if it theoretically should compile?

POWER is not a supported architecture. You could compile an x86 build
and run that in an emulator but it won't be fast.

-- 
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 on IBM AIX POWER7

2012-08-13 Thread rgmilone
Thanks Ben, do you know if the incompatibility goes all the way down to 
google v8 or is the incompatibility is with nodejs itself?  I guess I'm 
wondering what the effort would be to make POWER a supported platform and 
what your feeling might be that compatibility may occur at some point in 
the near future.  I love nodejs but my company does mostly large scale 
enterprise apps on IBM Power Systems.

On Monday, August 13, 2012 12:10:48 PM UTC-5, Ben Noordhuis wrote:

 On Mon, Aug 13, 2012 at 6:56 PM, rgmilone rgmi...@cnxcorp.comjavascript: 
 wrote: 
  Does anyone know if it's within the realm of feasibility to run node on 
  IBM's AIX OS?  This is IBM's UNIX OS running on IBM Power Systems 
 hardware 
  with POWER7 chip architecture.  I can't find any references to anyone 
 doing 
  this so I'm thinking it might not work.  I tried compiling the source 
 and it 
  blew up, but I'm not sure if it's something I'm doing wrong or if it's 
 just 
  simply that it will never work because of a fundamental incompatibility 
 with 
  IBM's hardware.  Before I go any further does anyone know if I'm crazy 
 for 
  trying this or if it theoretically should compile? 

 POWER is not a supported architecture. You could compile an x86 build 
 and run that in an emulator but it won't be fast. 


-- 
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] Best practice for SSL termination with Socket.io

2012-08-13 Thread Matt
On Sun, Aug 12, 2012 at 2:07 PM, dvbportal dvbpor...@gmail.com wrote:

  So is the only solution that's going to keep the connecting IP going to
 be using Apache for load balancing and SSL termination?

 No, another solution is HAProxy for balancing and stud for termination.
 This combination is by far better, if you expect thousands of connections.


But loses the connecting IP, right?

-- 
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] Best practice for SSL termination with Socket.io

2012-08-13 Thread Guillermo Rauch
No. Stud can use the PROXY protocol to communicate with HAProxy. From the
README:

stud will optionally write the client IP address as the first few octets
 (depending on IPv4 or IPv6) to the backend--or provide that information
 using HAProxy's PROXY protocol.


-- 
Guillermo Rauch
LearnBoost CTO
http://devthought.com

-- 
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] Best practice for SSL termination with Socket.io

2012-08-13 Thread Matt
Oooh. Done!

On Mon, Aug 13, 2012 at 2:45 PM, Guillermo Rauch rau...@gmail.com wrote:

 No. Stud can use the PROXY protocol to communicate with HAProxy. From the
 README:

 stud will optionally write the client IP address as the first few octets
 (depending on IPv4 or IPv6) to the backend--or provide that information
 using HAProxy's PROXY protocol.


 --
 Guillermo Rauch
 LearnBoost CTO
 http://devthought.com

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


-- 
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] Best practice for SSL termination with Socket.io

2012-08-13 Thread Mikeal Rogers
Avoid apache, use haproxy or nginx. This configuration, stud and haproxy is 
quite nice.

I wrote a pure TCP proxy in node rather than using HAProxy.

https://github.com/mikeal/stud-proxy

It works great but I ditch x-forwarded-for and do any IP filtering in 
stud-proxy rather than the processes behind it. Also, need to make sure that 
web sockets is wss instead of ws because the backend process think they aren't 
TLS.

-Mikeal

On Aug 13, 2012, at August 13, 201212:11 PM, Matt hel...@gmail.com wrote:

 Oooh. Done!
 
 On Mon, Aug 13, 2012 at 2:45 PM, Guillermo Rauch rau...@gmail.com wrote:
 No. Stud can use the PROXY protocol to communicate with HAProxy. From the 
 README:
 
 stud will optionally write the client IP address as the first few octets 
 (depending on IPv4 or IPv6) to the backend--or provide that information using 
 HAProxy's PROXY protocol.
 
 -- 
 Guillermo Rauch
 LearnBoost CTO
 http://devthought.com
 
 
 -- 
 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
 
 
 -- 
 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

-- 
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] [Ann] Prototype Light-weight processes/thread support

2012-08-13 Thread Kevin Jones


Hi All,


 I have created a prototype of LWP running over threads for node. There are 
a couple of short videos of it running at 

http://www.youtube.com/channel/UCEKyOjUJwxe6kTes3p-HYRg. The code  
pre-built Windows binary are at https://github.com/westboost/troop.js.proto. 
Only Windows support is working at the moment. You should be able to run 
any standard node code in each LWP without problems.


 I am sure some/many will view this as unneeded, my interest is being able 
to use node for medium/heavy data processing and in that area I was 
concerned processes (particularly IPC) would really would become an issue, 
so hence a prototype using threads to see how scary it was. LWP was just 
a convenient model to present the threads. The code was designed as far as 
possible to be a bolt-on to node to make it easy to track changes without 
too much heartache, it's currently based on v0.8.


 What I have not put much/any effort into is defining a decent interface to 
the LWP model, all you can do at the moment is exec() to create new LWP. 
Very much open to suggestions on what people would think is 
essential/useful. Feel free to open wish list items against the prototype, 
I will look at these when deciding on what changes are needed for a 
production version with wider OS support to work.


 Enjoy,

Kev

-- 
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 on IBM AIX POWER7

2012-08-13 Thread Ben Noordhuis
On Mon, Aug 13, 2012 at 7:27 PM, rgmilone rgmil...@cnxcorp.com wrote:
 Thanks Ben, do you know if the incompatibility goes all the way down to
 google v8 or is the incompatibility is with nodejs itself?  I guess I'm
 wondering what the effort would be to make POWER a supported platform and
 what your feeling might be that compatibility may occur at some point in the
 near future.  I love nodejs but my company does mostly large scale
 enterprise apps on IBM Power Systems.

Two things would need to be ported, V8 and libuv. Both are not trivial
and unlikely to happen. I conservatively estimate it at 3 to 6 man
months with perpetual maintenance afterwards - we simply don't have
the resources for that.

-- 
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] Re: [Ann] Prototype Light-weight processes/thread support

2012-08-13 Thread Bradley Meck
This looks similar to the work on isolates from a while back, can you 
enumerate the differences and if you are managing some of the more complex 
state of processes like process.env / process.cwd?

On Monday, August 13, 2012 1:04:09 PM UTC-5, Kevin Jones wrote:

 Hi All,


  I have created a prototype of LWP running over threads for node. There 
 are a couple of short videos of it running at 

 http://www.youtube.com/channel/UCEKyOjUJwxe6kTes3p-HYRg. The code  
 pre-built Windows binary are at 
 https://github.com/westboost/troop.js.proto. Only Windows support is 
 working at the moment. You should be able to run any standard node code in 
 each LWP without problems.


  I am sure some/many will view this as unneeded, my interest is being 
 able to use node for medium/heavy data processing and in that area I was 
 concerned processes (particularly IPC) would really would become an issue, 
 so hence a prototype using threads to see how scary it was. LWP was just 
 a convenient model to present the threads. The code was designed as far as 
 possible to be a bolt-on to node to make it easy to track changes without 
 too much heartache, it's currently based on v0.8.


  What I have not put much/any effort into is defining a decent interface 
 to the LWP model, all you can do at the moment is exec() to create new LWP. 
 Very much open to suggestions on what people would think is 
 essential/useful. Feel free to open wish list items against the prototype, 
 I will look at these when deciding on what changes are needed for a 
 production version with wider OS support to work.


  Enjoy,

 Kev


-- 
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] Re: [Ann] Prototype Light-weight processes/thread support

2012-08-13 Thread Kevin Jones

On Monday, August 13, 2012 9:04:57 PM UTC+1, Bradley Meck wrote:

 This looks similar to the work on isolates from a while back, can you 
 enumerate the differences and if you are managing some of the more complex 
 state of processes like process.env / process.cwd?


I started from understanding the 0.7 code and re-used some bits of it.  I 
can't really be definitive on how it differs as I never found a good 
description of where that work was going to end up, best I let others 
comment really. There is opportunity to separate out state fairly easily, I 
nearly went down that path but thought better keep it simple for now, so if 
you use features like env and cwd changes will be visible to all the LWP 
modulo any caching that might be happening that I have not seen. Similarly 
if one LWP listens on a port others won't be able to etc.

Kev

-- 
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] Best practice for SSL termination with Socket.io

2012-08-13 Thread Jimb Esser
Though stud can write the IP info, as far as I can tell there's still no 
way to pull that out on node without building your own version of node that 
supports a pre-parse event before passing the stream to the HTTP parser. 
 This is a pretty simple change and is what we do, but does require our own 
deployment of node.

Also of note, until 3 days ago, to get stud to *read* the PROXY line with 
the IP address coming from HAProxy also required a version of stud other 
than their master one, but it looks like they finally merged one of the 
outstanding pull requests to add that, so you can use the --proxy-proxy 
option to pass the IP from HAProxy through stud.

  Jimb Esser
  Cloud Party, Inc

On Monday, August 13, 2012 12:11:17 PM UTC-7, Matt Sergeant wrote:

 Oooh. Done!

 On Mon, Aug 13, 2012 at 2:45 PM, Guillermo Rauch wrote:

 No. Stud can use the PROXY protocol to communicate with HAProxy. From the 
 README:

 stud will optionally write the client IP address as the first few octets 
 (depending on IPv4 or IPv6) to the backend--or provide that information 
 using HAProxy's PROXY protocol.

  
 -- 
 Guillermo Rauch
 LearnBoost CTO
 http://devthought.com




-- 
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] Best practice for SSL termination with Socket.io

2012-08-13 Thread Matt
On Mon, Aug 13, 2012 at 5:43 PM, Jimb Esser wastel...@gmail.com wrote:

 Though stud can write the IP info, as far as I can tell there's still no
 way to pull that out on node without building your own version of node that
 supports a pre-parse event before passing the stream to the HTTP parser.
  This is a pretty simple change and is what we do, but does require our own
 deployment of node.


Good to know. I probably don't need it on the node side though. It's mostly
just for logs, which stud can write. Am I missing a need for the real IP in
node?


 Also of note, until 3 days ago, to get stud to *read* the PROXY line with
 the IP address coming from HAProxy also required a version of stud other
 than their master one, but it looks like they finally merged one of the
 outstanding pull requests to add that, so you can use the --proxy-proxy
 option to pass the IP from HAProxy through stud.


Also good to know!

-- 
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] npm got Segmentation fault at linux (npm 1.1.48 node v0.8.6)

2012-08-13 Thread TZ
I'v try again, uninstall everything.
then, git checkout v0.8.6 before make
but still got the same error.

*had follow your step:*
[root@etone231 opt]# gdb --args npm  
GNU gdb Red Hat Linux (6.5-25.el5rh)
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain 
conditions.
Type show copying to see the conditions.
There is absolutely no warranty for GDB.  Type show warranty for details.
This GDB was configured as 
x86_64-redhat-linux-gnu.../usr/local/bin/npm: not in executable format: 
File format not recognized

(gdb) run
Starting program:  
No executable file specified.
Use the file or exec-file command.
(gdb) backtrace full
No stack.
(gdb) 

[root@etone231 opt]# ll /usr/local/bin/npm
lrwxrwxrwx 1 root root 38 Aug 14 09:14 /usr/local/bin/npm - 
../lib/node_modules/npm/bin/npm-cli.js


在 2012年8月13日星期一UTC+8下午8时19分50秒,Ben Noordhuis写道:

 On Mon, Aug 13, 2012 at 11:42 AM, TZ ati...@qq.com javascript: wrote: 
  
  
 http://stackoverflow.com/questions/11895623/npm-got-segmentation-fault-at-linux
  
  
  linux version: 
  
  [root@etone231 download]# lsb_release -a 
  LSB Version: 
  
 :core-3.1-amd64:core-3.1-ia32:core-3.1-noarch:graphics-3.1-amd64:graphics-3.1-ia32:graphics-3.1-noarch
  

  Distributor ID: RedHatEnterpriseServer 
  Description:Red Hat Enterprise Linux Server release 5.1 (Tikanga) 
  Release:5.1 
  Codename:   Tikanga 
  
  node.js: 
  
  git clone https://github.com/joyent/node.git 
  cd node 
  ./configure 
  make 
  sudo make install 
  
  npm fail: 
  
  [root@etone231 download]# node -e console.log('a') 
  a 
  
  [root@etone231 download]# node -v 
  v0.8.6 
  
  [root@etone231 download]# python -V 
  Python 2.7.3 
  
  [root@etone231 download]# gmake -v 
  GNU Make 3.81 
  Copyright (C) 2006  Free Software Foundation, Inc. 
  This is free software; see the source for copying conditions. 
  There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A 
  PARTICULAR PURPOSE. 
  
  This program built for x86_64-redhat-linux-gnu 
  
  [root@etone231 download]# npm -v 
  1.1.48 
  
  [root@etone231 download]# npm list 
  Segmentation fault 

 Try this: 

   $ gdb --args npm list 
run 
   # wait for crash 
backtrace full 
   # post the backtrace 

 By the way, you have more than one node binary installed. The GH repo 
 builds v0.9.1-pre but `node -v` reports v0.8.6. 


-- 
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] npm got Segmentation fault at linux (npm 1.1.48 node v0.8.6)

2012-08-13 Thread Mihamina Rakotomandimby

On 08/14/2012 04:31 AM, TZ wrote:

[root@etone231 opt]# gdb --args npm


Re-read carefully.

He told you:
gdb --args npm list




--
RMA.

--
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] Nodejs and Backbone connect

2012-08-13 Thread almarjin
Hi,

I'd like to know how to connect to Nodejs API on the server using Backbone. 
What I need to do is to POST, PUT, DELETE and GET.

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