simple answer: if(userName === newUserName)
better answer: show us code
Am Mittwoch, 10. Juli 2013 18:20:26 UTC+2 schrieb rh:
>
> Hi all. I have some basic experience with JavaScript and have a very
> basic question as I'm trying to figure out how this works.
>
> I need to know how I can take a
In addition to point 2: You can use in both project require('myLib')
without path, just define NODE_PATH to the folder. but still you have to
manage to different versions of the same lib. the git-dep is a better
sollution here, i guess.
Am Donnerstag, 11. Juli 2013 02:26:40 UTC+2 schrieb Marco
you can do shadowing with dynamicly binding, IF your two-function access
the global scope:
var foo = 'bar' //i'm global
function one() {
var foo = 'baz';
two.call({foo:foo});
}
function two() {
console.log(this.foo)
}
but in the end this is also not quite elegant, and incredibly bad. And
the way how node module loader resolves modules allows it to place C only
once in the hierarchy of dependencies. B still has access to
C. http://nodejs.org/api/modules.html#modules_all_together describes, how
the resolver works.
Am Freitag, 12. Juli 2013 04:53:10 UTC+2 schrieb Maxim Yefremov:
>
sometimes its faster to
load. http://nodejs.org/api/modules.html#modules_all_together:
LOAD_AS_FILE(X)1. If X is a file, load X as JavaScript text. STOP2. If X.js is
a file, load X.js as JavaScript text. STOP3. If X.node is a file, load X.node
as binary addon. STOP
without extension 1. fail
You mean to say that functions with sketchy side effects are something to
thrive for ? =)
On Thursday, 11 July 2013 10:31:57 UTC+2, Jean-Michel Hiver wrote:
>
> Thanks for this floby, but now I have to pass an extra argument to my
> function, which is what I was trying to avoid... well looks lik
I've an identical processing javascript function that run on both node.js
server and a browser (chrome). I've no idea how to test which side is
faster.
Does it's the right idea to run it on a server and render on chrome, or
should I process on chrome alone.
In this case, does node.js act as na
On 11/07/2013, at 10:31, Jean-Michel Hiver wrote:
> basically "you can have global variables, private variables, but no proper
> lexically scoped local variables".
Much rather the opposite, what you haven't got is dynamic scoping.
--
( Jorge )();
--
--
Job Board: http://jobs.nodejs.org/
Post
On the side note: This is server sent application.
--
--
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, se
Thanx Marco and greelgorke. Looks like true. But the problem is that module
B dont have access to C and throws error (module not found) if it is loaded
in* A/node_modules* and not in *A/node_modules/B/node_modules.* Allthough
it's required as usual inside B: *require('C').* I found temporal solutio
It was exaclty the question you asked. It you were only ready to accept a
answer from Isaac, then you should have mailed him.
On Thursday, 11 July 2013 15:06:46 UTC+2, Matt Sergeant wrote:
>
>
> On Thu, Jul 11, 2013 at 3:34 AM, Floby >wrote:
>
>> I think the reason why is that passing around fil
On Fri, Jul 12, 2013 at 8:41 AM, Floby wrote:
> It was exaclty the question you asked. It you were only ready to accept a
> answer from Isaac, then you should have mailed him.
>
I'm sorry but it really wasn't the question I asked. You told me why
cluster works the way it does in the general case
I made a mistake in my Go code: setting the buffer to 64 KB.
If I set the buffer to (for example) 1 KB; performance of Go TCP server is *a
bit* better than Node.JS.
Node.JS:
sent: 100% rcvd: 100%, fail: 0%, count: 5000
2765.13435456013 op/sec
Go:
sent: 100% rcvd: 100%, fail: 0%, count: 5000
282
FYI, I updated execSync (node's missing execSync) project to be an add-on
and it now supports Windows.
I don't claim this to be robust enough for serious production use. It's
only meant for scripting within jake, grunt, cakefiles, etc.
https://github.com/mgutz/execSync
--
--
Job Board: http:
Does it matter whether it's faster on the server-side or the client-side?
Just run whatever makes sense on either end of the app.
If it really matters to you, you can benchmark it in the browser and in
node using benchmarkjs: http://benchmarkjs.com/
Gary Katsevman
gkatsev.com
On Fri, Jul 12, 20
I forgot to say that yet in most cases Node.JS performs better than Go - of
course in a little threshold.
--
--
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
I have an add-on (execSync) which builds painlessly on non-Windows
environments. To make it simpler for Windows users, I would like to
distribute prebuilt add-on binaries for Windows and have npm skip the build
process. How do I do this?
--
--
Job Board: http://jobs.nodejs.org/
Posting guidel
Hey all,
I hope this question is appropriate for this forum, as I've been attempting
to google my issue but haven't gotten very far.
I am running a TLS server and offering a few protocols via NPN, one of
which is http/1.1. When clients request http/1.1 I want to provide a normal
HTTP server to
I need some help with database choice and module setup for a Node app I'm
working on. I've read a good bit about Node/Express/Angular/MongoDB as a
popular choice for app setup. The app i'm developing will use geolocation
HTML5 data from several users at a time and will display some relative da
I can do simple command line parsing. However I want to build a nested
command line hierarchy store in in a stack and execute them. Is there some
kind of node.js package./script readily available? If not, can I get
suggestions.
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
ht
When I use node.js create a server, when process a new request, I will
creata a new process, after running one week, it fork new process faile,
and log message shows ‘spawn EAGAIN'
/Users/irteam/apps/nelo2/symbolicator_1.2.0/node_modules/thrift/lib/thrift/server.js:50
throw e;
Hi, guys!
I encountered something very similar to memory leak that I cannot explain.
I made stripped down test-case that can show what I mean. Our regular
workload for node is 20m requests per day (10 nodes on 2 servers makes that
200m) and server is getting slower each day. Here is fancy graph
Not sure if this is what you mean, commanderjs has `#command` which mimics
git like sub commands. For example if my main script is 'foo', I can create
'foo-bar', 'foo-baz' scripts. To use them in commander
### foo
program
.command('bar', 'spawn foo-bar')
.command('baz', 'spawn foo-baz')
.
Wow.. bugger looks awesome! I love how you can use Chrome's command-shift-O
to get a list of the functions in the current file. Always missed that with
node-inspector.
Does the support for coffeescript source maps mean that you can actually
debug in coffeescript? Any tips on how to set this up?
On Fri, Jul 12, 2013 at 3:17 AM, 陈小军 wrote:
> When I use node.js create a server, when process a new request, I will
> creata a new process, after running one week, it fork new process faile, and
> log message shows ‘spawn EAGAIN'
>
> /Users/irteam/apps/nelo2/symbolicator_1.2.0/node_modules/thrift
Generally: yes, you should be able to debug coffee-script directly with bugger.
But... it's broken in the current beta. The biggest issue is Chrome not liking
that the compiled file and the source file have the same filename. I tried
different ways to work around it, but the current solution (pa
On Friday, July 12, 2013 7:00:33 PM UTC+2, David Beck wrote:
> Wow.. bugger looks awesome! I love how you can use Chrome's
> command-shift-O to get a list of the functions in the current file. Always
> missed that with node-inspector.
>
> Does the support for coffeescript source maps mean that y
TL;DR: I started something I can't finish, want to help me?
Many times in my career I've found a need for large volumes of realistic
test data (aka "fixtures"),
and had long had a thought at the back of my mind that it could be well
provided by a service.
Last year I had time to work on the ide
On Thu, Jul 11, 2013 at 10:18 AM, Matt wrote:
> Well it wouldn't stop working - it would just notify the "someone" N
> different ports. Which doesn't seem like the end of the world to me - most
> scenarios I can think of where you're doing this would continue working.
> Is there anyone who relies
On Fri, Jul 12, 2013 at 4:21 PM, Sam Roberts wrote:
> Run an http server (express maybe), listen(0), use your web browser to
> connect to the single ephemeral port.
>
> Now cluster it. You have N workers on N different ephemeral port,
> meaning you don't have http load balanced across a set of se
What you're describing sounds a lot like this:
http://www.generatedata.com/
What would be the key differentiators?
--
Martin Cooper
On Fri, Jul 12, 2013 at 12:45 PM, Ken wrote:
>
> TL;DR: I started something I can't finish, want to help me?
>
> Many times in my career I've found a need for l
On Thu, Jul 11, 2013 at 5:52 PM, Benjamin Pasero
wrote:
> Hi,
>
> I am wondering whats the best way of reading some data from a file stream
> (readable stream) and under a certain condition stop reading? Is it safe to
> e.g. call destroy() from within the on('data') handler? Or do I even have to
>
On Fri, Jul 12, 2013 at 2:59 AM, Daniel Lamando wrote:
> Hey all,
>
> I hope this question is appropriate for this forum, as I've been attempting
> to google my issue but haven't gotten very far.
>
> I am running a TLS server and offering a few protocols via NPN, one of which
> is http/1.1. When c
Thanks for the link, I think that is pretty similar in intent and will
contact the maintainer. The main differences are that the golem generation
algorithms aren't random--they're deterministic, reproducible, and
reversible, which in turn gives golems persistence without needing to store
them
I'm using node 0.11.3 with --harmony-generators to try the new feature. I
found two libraries that should help use existing node callback-based code
with generators (suspend and galaxy). The code I'm trying to run was
similar to the following:
(using suspend)
var fs = require('fs');
var requ
On Fri, Jul 12, 2013 at 5:47 PM, cpprototypes wrote:
> I'm using node 0.11.3 with --harmony-generators to try the new feature. I
> found two libraries that should help use existing node callback-based code
> with generators (suspend and galaxy). The code I'm trying to run was
> similar to the fo
2013.07.12, Version 0.11.4 (Unstable)
* npm: Upgrade to 1.3.4
* v8: Upgrade to v3.20.2
* c-ares: Upgrade to piscisaureus/cares@805d153
* timers: setImmediate process full queue each turn (Ben Noordhuis)
* http: Add agent.get/request methods (isaacs)
* http: Proper KeepAlive behavior (isaacs)
If you want to use `yield` in nested functions you will have to use yield*
to and your nested functions need to be generators
```js
suspend(function* (resume) {
var contents = yield fs.readFile('idList.json', 'utf8', resume);
yield* each(contents.split('\n'), function* (id) {
var i
You are confusing me!
On Friday, July 12, 2013 11:20:48 PM UTC+7, Kaveh Shahbazian wrote:
>
> I forgot to say that yet in most cases Node.JS performs better than Go -
> of course in a little threshold.
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node
I've tired the code below it isn't worked:
var WebSocketServer = require('ws').Server;
> var wsServer = new WebSocketServer({port: 8080});
>
> wsServer.on('connection', function(ws) {
> if (ws.origin != 'http://example.com') {
> console.log('Origin was not http://example.com');
>
That was not my intention!
See; when we have a echo server that echos a little string like "string"
and we set a little buffer in Go, it acts a bit better.
But in all other cases (bigger messages) Node.JS acts a bit better.
By "a bit" I mean ~2.5 %.
And in Node.JS you do not need to worry abou
the arm-pi builds are great, but whereis:
nodejs.org/dist/v0.11.4/node-v0.11.4-linux-arm-pi.tar.gz
11.3 seems to be the latest.
thanks again
Jonathan
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received
> What am I missing here?
It's a well-known V8 bug, it just doesn't understand let statements without
strict mode. Hope it'll be fixed soon.
On Thursday, July 11, 2013 11:02:12 PM UTC+4, Jean-Michel Hiver wrote:
>
> The OP is lost :-)
>
> Matt, excuse my poor Javascript mastery... you said I s
1. mv node_modules node_modules.backup
2. npm install
`npm update` is just broken, and there is no way around it :(
On Monday, July 8, 2013 8:15:50 PM UTC+4, Maxim Yefremov wrote:
>
> I got lib1 that depends on lib2 via git:
> "dependencies": {
> "lib2": "git+ssh://g...@repo.com:userName/li
Thank you, Alex
On Jul 13, 2013 10:08 AM, "Alex Kocharin" wrote:
>
> 1. mv node_modules node_modules.backup
> 2. npm install
>
> `npm update` is just broken, and there is no way around it :(
>
>
> On Monday, July 8, 2013 8:15:50 PM UTC+4, Maxim Yefremov wrote:
>>
>> I got lib1 that depends on lib
err... guys, what is wrong with socket.io? I used socket.io for a long time
(until moved to pure websockets 'cause screw ie6), and was quite happy with
it then.
On Tuesday, July 9, 2013 6:49:52 PM UTC+4, mgutz wrote:
>
> I've come to the same conclusion Meteor, Pusher and you have and that
>
You can also try to make use of module.parent.require() function and
module.parent.parent.(...).parent.require() to get dependencies using
context of modules that required current module.
On Tuesday, July 9, 2013 7:58:47 AM UTC+4, j...@team9.com.au wrote:
>
> Thanks for the suggestions guys, I
You can pass client/socket object and whatever else you need to different
files. I see no problem with that. Also, socket.io supports namespaces
exactly for this kind of things.
PS: another good solution would be to forget about MVC forever ;)
On Sunday, June 30, 2013 8:50:29 AM UTC+4, Mike C
48 matches
Mail list logo