You mean like structs and arrays? I made this which doesn't depend on
proxies https://github.com/Benvie/reified.
On Friday, May 25, 2012 8:35:36 PM UTC-4, m1k3l wrote:
Nice Brandon.
One thing I started thinking about but didn't find a good framework yet is
to define structures in Typed
On Tuesday, May 29, 2012 6:35:25 AM UTC-7, Brandon Benvie wrote:
You mean like structs and arrays? I made this which doesn't depend on
proxies https://github.com/Benvie/reified.
yes like C structs. Indeed reified seems to address this needs nicely,
thanks!
-- m1k3
On Friday, May
+1
nextTick is the efficient way to yield to another thread of processing
(thread between quotes of course) when performing an expensive computation.
So it is the antidote to starvation and thus a very useful call.
If you change its behavior, you should at least provide a replacement call
Just wrote a quick bench: https://gist.github.com/2830638
Results:
Benching setTimeout
elapsed: 15593
Benching nextTick
elapsed: 2226
So, there is a penalty in switching from nextTick to setTimeout: the call
is 7 times slower!
On Tuesday, May 29, 2012 10:31:41 PM UTC+2, Mikeal Rogers wrote:
Your intention is to break up a computationally intensive task, does that
latency to run the units really matter under load?
Benchmarks alone are not helpful unless you do them in the context of a real
use case. Yes, latency is an issue, but the latency you're talking about would
be less than
Translation: You're doing something reasonable. But we don't think you
should do it that way, so we're going to shoot you in the foot and then
blame you for it. I'm on board with this plan. - sarcasm
Seriously though. Can we at least hear what other options y'all have
considered for fixing the
The job of core is to provide the best API possible to accomplish several use
cases.
When core provides an API to handle that use case and people decide to ignore
it, do something inferior with an API that was not designed for that use case,
and then protest altering the this API to better
Mikeal, I understand your frustration, but that's not how I read the
history. nextTick was *intended* for this use case. But it sounds like it
was the wrong solution. nextTick was implemented as yield to the event
loop for whatever else may happen. It's always been pretty clear to me
that some
I understand that different people have different perspectives on the same
event. This is a common phenomenon. I've been working with node for a long
time. I started many months before it was announced to the world back in
2009. When nextTick was introduced I remember it being for the purpose
On May 29, 2012, at May 29, 20122:42 PM, Marco Rogers wrote:
Mikeal, I understand your frustration, but that's not how I read the history.
nextTick was *intended* for this use case. But it sounds like it was the
wrong solution. nextTick was implemented as yield to the event loop for
For the record, I know I have code that will break under this change, but I
didn't bother linking to it because it's so trivial for me to fix. I do,
however have code that is broken under the current implementation that I
can't fix.
On Tue, May 29, 2012 at 5:05 PM, Mikeal Rogers
This is an example of *very* productive feedback :)
Tim Caswell Rules!
On May 29, 2012, at May 29, 20123:10 PM, Tim Caswell wrote:
For the record, I know I have code that will break under this change, but I
didn't bother linking to it because it's so trivial for me to fix. I do,
however
FYI: setImmediate === nextTick and identical to a setTimeout(f,0) without the
clamping.
--
Jorge.
On May 29, 2012, at 10:45 PM, Isaac Schlueter wrote:
Computationally expensive stuff should be done in a child process, or
a uv_work_t thread in an addon. nextTick is a bad fit for this.
I don’t understand why you’d want to use process.nextTick() for that, or
indeed, any similar API. The API you want is “do this work in a separate
thread/process/other schedulable unit that the operating system knows about”.
From: nodejs-dev@googlegroups.com [mailto:nodejs-dev@googlegroups.com]
so I guess in a way setImmediate(fn) could be described
fairly accurately as a faster setTimeout(fn, 0). As I understand timer
events get put at the end of the queue as well.
On Tue, May 29, 2012 at 5:53 PM, Tim Caswell t...@creationix.com wrote:
On Tue, May 29, 2012 at 5:22 PM, Jorge
Hi Gustavo,
maybe this one? https://github.com/ammmir/node-oauth2-provider ...
Cheers,
Sascha
On May 29, 12:18 am, Gustavo Machado machad...@gmail.com wrote:
Hi List!
Does anybody recommend any production-ready packages to implement OAuth2
Server for my application? This one looks good but
Hi list, yet another question (I know its getting much in the last days :-).
Suppose I want to host a second legacy website with Apache-PhP on my
VPS otherwise running awesome node.js (not my blog, its yet something
else). So I check request.headers.host and if its the VHOST for the
legacy
var httpProxy = require('http-proxy')
;
httpProxy.createServer(options, function(req, res, proxy) {
if(req.headers.host === 'whatever.example.com') {
proxy.proxyRequest(req, res,
{ host: 'localhost'
, port: '8080'
}
)
return
}
res.writeHead(400, {})
Thank you.
The thing that confuses me is, why httpProxy.createServer(...);
Cant I just create http.createServer() handle requests normally for
the main node site, and in my request handler create a proxyRequst
only when it relates the VHOST?
On Tue, May 29, 2012 at 9:14 AM, Oliver Leics
eval isn't evil, but it has potential for evil. using eval in for
configuration files is not bad, because you know what they contain,
after all, you are editing them by hand.
if you are sending JSON5 or eval'd js remotely that is probably a bad idea.
On Tue, May 29, 2012 at 4:24 PM, Dick Hardt
Yes. https://github.com/nodejitsu/node-http-proxy/tree/master/examples
On Tue, May 29, 2012 at 12:25 AM, Axel Kittenberger axk...@gmail.comwrote:
Thank you.
The thing that confuses me is, why httpProxy.createServer(...);
Cant I just create http.createServer() handle requests normally for
No. All of the examples proxy through httpProxy.createServer
On Tue, May 29, 2012 at 9:48 AM, Marak Squires marak.squi...@gmail.com wrote:
Yes. https://github.com/nodejitsu/node-http-proxy/tree/master/examples
On Tue, May 29, 2012 at 12:25 AM, Axel Kittenberger axk...@gmail.com
wrote:
Thanks for it. Will start using it. Seems cool to me!
Concerning discussion about yaml. I've been using some configurations with
ruby.
When started with node, changed to json because of its simplicity and
direct mapping to JS,
less mental mappings for me. Maybe will change my mind in the
var http = require('http')
, httpProxy = require('http-proxy')
, proxy = new httpProxy.RoutingProxy()
;
http.createServer(function(req, res) {
if(req.headers.host === 'whatever.example.com') {
proxy.proxyRequest(req, res,
{ host: 'localhost'
, port: '8080'
}
)
On Tue, May 29, 2012 at 9:32 AM, Dominic Tarr dominic.t...@gmail.com wrote:
eval isn't evil, but it has potential for evil. using eval in for
configuration files is not bad, because you know what they contain,
after all, you are editing them by hand.
If you ever release a package to npm that
Awesome, thanks!
On Tue, May 29, 2012 at 11:03 AM, Oliver Leics oliver.le...@gmail.com wrote:
var http = require('http')
, httpProxy = require('http-proxy')
, proxy = new httpProxy.RoutingProxy()
;
http.createServer(function(req, res) {
if(req.headers.host === 'whatever.example.com') {
What can we do to add the ability to siege an external server?
I mean - instead of providing app.js - I want to provide a base URL to an
exteranal server.
Do you think it is simple to add? :)
On Sun, May 6, 2012 at 7:04 PM, jason.桂林 guil...@gmail.com wrote:
siege.js is a http benchmark module.
hi all,
i am trying install and configure Nginx with node.js in a server
when i enter command : /etc/init.d/nginx start (or restart) to start
(or reload) nginx server , i get an error :
Restarting nginx: nginxnginx: [warn] conflicting server name
dantri.com.vn on 0.0.0.0:83, ignored
nginx:
hi all,
i am trying install and configure Nginx with node.js in a server
when i enter command : /etc/init.d/nginx start (or restart) to start
(or reload) nginx server , i get an error :
Restarting nginx: nginxnginx: [warn] conflicting server name
dantri.com.vn on 0.0.0.0:83, ignored
nginx:
I've used Amir's OAuth2 provider. Simple enough, the included example walks
through the auth flow.
https://github.com/ammmir/node-oauth2-provider
On Monday, May 28, 2012 3:18:09 PM UTC-7, Gustavo Machado wrote:
Hi List!
Does anybody recommend any production-ready packages to implement
Hello,
I've installed Node.js and WebSocket server on Windows 7 through npm route,
and I can't get ws.js with this method.
How can I get this file. I tried the following command but it's not working:
npm install ws.js
I desperately need this file to get the advantage that linux computer has,
On Tue, May 29, 2012 at 6:24 AM, Ket kettin...@gmail.com wrote:
Hello,
I've installed Node.js and WebSocket server on Windows 7 through npm route,
and I can't get ws.js with this method.
How can I get this file. I tried the following command but it's not working:
npm install ws.js
I
On Tue, May 29, 2012 at 11:40 AM, phuong dang hanhphuong...@gmail.com wrote:
hi all,
i am trying install and configure Nginx with node.js in a server
when i enter command : /etc/init.d/nginx start (or restart) to start
(or reload) nginx server , i get an error :
Restarting nginx:
installs fine on a win7starter netbook :-)
try ``npm install ws.js`` several times in a row, sometimes this
helps, especially for huge packages.
and don't forget to post the error log.
On Tue, May 29, 2012 at 12:05 PM, Ben Noordhuis i...@bnoordhuis.nl wrote:
On Tue, May 29, 2012 at 6:24 AM,
Use what works for you, and don't bother with premature optimization.
By the way it's not greatest bind use case, I wouldn't use bind here. In
some older versions of node (v0.6.3 ?) , setTimeout passes one argument to
the callback, and in your example it will be logged as well.
On Tuesday,
On May 29, 6:18 am, Oliver Leics oliver.le...@gmail.com wrote:
installs fine on a win7starter netbook :-)
I just tried it (`npm install ws.js`) on XP and I get: npm ERR! git
clone git://github.com/yaronn/xmldom.git CreateProcessW: The system
cannot find the file specified even though git is in
BTW: httpProxy.createServer(...) can proxy websocket-requests. And it
supports ssl connections.
On Tue, May 29, 2012 at 11:24 AM, Axel Kittenberger axk...@gmail.com wrote:
Awesome, thanks!
On Tue, May 29, 2012 at 11:03 AM, Oliver Leics oliver.le...@gmail.com wrote:
var http = require('http')
For me
setTimeout(function() { console.log(x) }, 5000)
is cleaner than
setTimeout(console.log.bind(console, x), 5000)
I used .bind() a lot to get rid of scope-problems for once and all
times. But then the code became, well, a mess: Everything I saw was
calls to .bind() ;-) Way too much
Async.auto() avoids this problem, since you always have access to 'results'
hash object that contains results of calculations, and you can access them
by name.
-
Boris Egorov
skype/gtalk/nickname: dolphin278
mobile: +7 905 728 1543
On Tue, May 29, 2012 at 2:50 AM, Xavi Ramirez
Hi,
Can anyone recommend me a jsonrpc 2.0 library which can use named
parameters. I'm now using the bitcoin jsonrpc2 module, and although it
claims to be 2.0 I can't figure out how to use it with named
parameters.
Like so:
-- {jsonrpc: 2.0, method: subtract, params: {subtrahend:
23, minuend:
Btw, I'd need both client and server.
On Tue, May 29, 2012 at 2:25 PM, Thijs Koerselman
thijskoersel...@gmail.com wrote:
Hi,
Can anyone recommend me a jsonrpc 2.0 library which can use named
parameters. I'm now using the bitcoin jsonrpc2 module, and although it
claims to be 2.0 I can't
Hi Thijs,
If I recall correctly, JSON-RPC (any version) doesn't have named parameters,
this is an extension on the spec. There are (were) a few explains of this being
done, but it seems that the people that were doing this have now revoked the
code from the public domain.
Regards,
Micheil
Hi all,
i installed Nginx and Node.js in my server !
i tested Nginx , it worked Ok
when i try ran my node.js file , i got an error :
node.js:201
throw e; // process.nextTick error, or 'error' event on first
tick
^
Error: listen EADDRNOTAVAIL
at errnoException
On Mon, May 28, 2012 at 5:50 PM, Xavi Ramirez xavi@gmail.com wrote:
The only real downside is that the original Step been
more less abandoned.
I prefer to think of it as complete not abandoned ;). It still works
just as well as the day I released it. We're still writing ES5 code in
I don't think this part of JavaScript will ever change. Node does not
modify the JavaScript language it uses.
Lua does this though if you want to try luvit.io (node ported to lua). It
has syntax sugar to make defining and calling context-first methods easier.
-- This is lua code, not JS
I've just been comparing Node's pbkdf2 function to that from CryptoJS (
http://code.google.com/p/crypto-js/#PBKDF2). This program:
console.log('CryptoJS', Crypto.PBKDF2('foo', 'salt', {keySize: 16,
iterations: 1}).toString());
crypto.pbkdf2('foo', 'salt', 1, 16, function(error, key1) {
On May 29, 12:15 pm, James Coglan jcog...@gmail.com wrote:
Can someone explain why the outputs are different? I'm trying make
something that's portable between the server and the client, so need to
pick a library I can rely on for consistent output.
It seems the crypto.pbkdf2() in node is
2012.05.28, Version 0.7.9 (unstable)
* Upgrade V8 to 3.11.1
* Upgrade npm to 1.1.23
* uv: rework reference counting scheme (Ben Noordhuis)
* uv: add interface for joining external event loops (Bert Belder)
* repl, readline: Handle Ctrl+Z and SIGCONT better (Nathan Rajlich)
* fs: 64bit
Very cool and useful, thanks!
FWIW, since JSON5 is built off of Douglas Crockford's json_parse.js, its
parse() function also supports a reviver argument -- so this'll work w/
JSON5 too. =)
Aseem
On Tue, May 29, 2012 at 1:25 PM, Marco Rogers marco.rog...@gmail.comwrote:
FYI, not related to
Thank you very much guys, looks like it's the one. Anybody used it in
production environments?
Thanks,
Gustavo
On Tue, May 29, 2012 at 12:31 AM, Tyler Stalder ty...@stalder.me wrote:
I've used Amir's OAuth2 provider. Simple enough, the included example
walks through the auth flow.
I believe the current state of things is that the closure method of binding
is optimized and very fast in v8. Function#bind is not. This is partly due
to the fact that nobody uses it, so it may not be worth the time to
optimize. But I agree with those that say do what works for you. Deal with
When I launch my app in test or dev, it runs a database initializer,
based on config file, that cleans out the db entirely, loads the
properties, loads the seed data. Works fine.
Looking for a pattern for similar in production.
a) Is there anything like rake db:migrate from Rails for node?
b)
fn.bind() is a bit slower than calling function () { fn() }, it's
true. But it's a difference between 5,000,000Hz and 10,000,000Hz. If
you're doing IO anywhere, an extra µs isn't going to affect
performance noticeably.
Write your program so that it's clear and readable. Then profile it.
Then
Okay, so, my bad, I've never seen named parameters in JSON-RPC 2.0,
a misunderstanding on my behalf.
– Micheil
On 29/05/2012, at 4:02 PM, Thijs Koerselman wrote:
On Tue, May 29, 2012 at 3:11 PM, Micheil Smith mich...@brandedcode.com
wrote:
If I recall correctly, JSON-RPC (any version)
Seems like a great event indeed! Thanks for sharing. Seems too expensive
for me, are there any discounts available?
El lunes, 28 de mayo de 2012 00:18:45 UTC+2, Nuno Job escribió:
I'm organizing LXJS (lxjs.org) where you will be able to find lots of
Iberian node.js devs :)
Nuno
On Sun,
Wow, I remember bind being much slower than that a while back. Maybe some
work has been done. Either way it proves the point. Don't assume you're
better at optimizing js than v8 is.
:Marco
On Tuesday, May 29, 2012 10:46:24 AM UTC-7, Isaac Schlueter wrote:
fn.bind() is a bit slower than
On Tue, May 29, 2012 at 2:55 PM, Marco Rogers marco.rog...@gmail.comwrote:
Wow, I remember bind being much slower than that a while back. Maybe some
work has been done. Either way it proves the point. Don't assume you're
better at optimizing js than v8 is.
Especially don't assume that you're
This is a community run, not for profit, developer event. Organizers
volunteers are not paid, neither are any of the speakers which are generous
enough to dedicate their time to the community.
Even our sponsors are mostly companies pushing for a better nodejs future,
and not typical big
Also, there have been situations where V8's advantage in one technique over
another has reversed.
On Tue, May 29, 2012 at 11:59 AM, Scott González
scott.gonza...@gmail.comwrote:
On Tue, May 29, 2012 at 2:55 PM, Marco Rogers marco.rog...@gmail.comwrote:
Wow, I remember bind being much slower
Just read
http://www.infoq.com/articles/surviving-asynchronous-programming-in-javascript
- it's good interview about.
2012/5/26 Davis Ford davisf...@gmail.com
There does not appear to be a shortage of libraries out there that help
with flow control. I'm looking for something that is well
Just wanted to say, so far it looks good. Was wondering if you are going to
do a tutorial. Something like a guest book with a DB backend, sessions /
cookies, and something showing integration with socket.io.
On Tuesday, May 8, 2012 5:17:24 PM UTC-5, Shogun wrote:
Hi all!
I know there
I am attempting to debug random slowness in an application and before I
google the web too much, I thought I'd ask here:
% time seconds usecs/call callserrors syscall
-- --- --- - -
32.370.027971 2 14698
Hello,
I would like to password protect a node.js website running on port 8000. I
am not sure what method to follow for this.
Will installing htpasswd (https://github.com/gevorg/htpasswd#readme) will
help to achieve this?.
I installed htpasswd and created a password file using htpasswd -c
On Tue, May 29, 2012 at 1:40 PM, deitch a...@deitcher.net wrote:
a) Is there anything like rake db:migrate from Rails for node?
One of my coworkers wrote a migration lib for node:
https://github.com/nearinfinity/node-db-migrate
Hope that helps.
Ben
--
Job Board: http://jobs.nodejs.org/
There is nothing built-in to node to auto-read htpassword files. You'll
need a library that implements the authentication. The easiest is to
implement http basic auth
http://en.wikipedia.org/wiki/Basic_access_authentication (the one where
your browser shows an ugly blocking popup asking for
Thanks to everyone for all the great suggestions. I appreciate the input
from everyone. I can also appreciate the suggestions on why not to use a
library. Personally, I have no problem using a library if it saves time
and makes the code quicker and easier to write -- that's a personal
On Tue, May 29, 2012 at 11:51 PM, gjohnson gjj...@gmail.com wrote:
I am attempting to debug random slowness in an application and before I
google the web too much, I thought I'd ask here:
% time seconds usecs/call calls errors syscall
-- --- --- -
On Tue, May 29, 2012 at 10:40:04AM -0700, deitch wrote:
When I launch my app in test or dev, it runs a database initializer,
based on config file, that cleans out the db entirely, loads the
properties, loads the seed data. Works fine.
Looking for a pattern for similar in production.
a) Is
Yes Ben !
here is my nginx configuration file :
server {
listen 0.0.0.0:86;
server_name bongda.com.vn;
access_log /var/log/nginx/yourdomain.log;
location / {
# The IP(s) on which your node server is running , I chose the
port 3000
proxy_pass
@marco,
No, definitely not looking for it to be like Rails. But the concept of
having a well-defined database schema versionizing structure and
command to go up/down is very intelligent.
I like your approach of having three (as opposed to my two) different
types of database initialization:
a)
Nooline is geared toward blogging and content management. It's a CMS,
built in node. Requires that you write HTML in your posts right now, but
WYSIHTML5 will be integrated into the next release.
Goal is to make content management easy-peasy.
Link: http://nooline.org
Github:
71 matches
Mail list logo