[00:00] isaacs: however, you can pre-compile it on all of them, and then have a main script that loads the right own [00:00] isaacs: *one [00:00] creationix: isaacs: how would it load the right one? [00:00] tim_smart: mrryanjohnston: Across all the boards, because the event loop can't guarantee it will call your callback exactly x ms after you called setTimeout [00:00] reid has joined the channel [00:00] isaacs: require("./blah-" + os.platform() + ".node") [00:00] creationix: if the require function would just ignore addons that aren't the native architecture, that would be enough [00:00] tiemonster has joined the channel [00:00] creationix: it could fall through to the parent folder's node_modules [00:00] isaacs: creationix: "if" [00:00] tim_smart: mrryanjohnston: So it could 1004 ms after you called `setTimeout(myTimeout, 1000)` [00:00] tim_smart: *could be [00:00] jesusabdullah: Nuck: You could use a sexier url for that countdown. stylings look pretty snazzy though imo [00:01] isaacs: creationix: the fact is, it doens't, and that's kind of an involved change to the api [00:01] tjholowaychuk: creationix / isaacs the ajaxorg guys did similar with their canvas thing [00:01] creationix: isaacs: how hard can that be? it would involve any user facing api changes [00:01] isaacs: it'd be nice, but it needs thought and planning to be applied. [00:01] [[zz]] has joined the channel [00:01] tjholowaychuk: they just had the general require do what isaac mentioned there [00:01] tjholowaychuk: pretty much [00:02] isaacs: creationix: "i'm doing require('foo'), but i'm getting foo-x86.node, which is a different thing!?" [00:02] isaacs: creationix: it's adding magic [00:02] creationix: isaacs: no [00:02] Nuck: :3 This is great. [00:02] isaacs: magic should be added carefully, minimally, and with great trepidation [00:02] creationix: if I require('goo.node') and "node_modules/goo.node" is arm, but I'm in i686, then ignore it and find the one in "../node_modules/goo.node" [00:02] isaacs: creationix: even more magic! [00:02] [Null] has joined the channel [00:02] Nuck: I'm tempted to set up a graph showing the watchers for Node and Rails over time [00:03] nerdfiles has joined the channel [00:03] nerdfiles has left the channel [00:03] Nuck: Using graphael probably [00:03] creationix: isaacs: ok, how about a run-time way to query my running arch [00:03] mrryanjohnston: tim_smart: I see. but wouldn't calculating the difference in milliseconds itself throw off the timer? [00:03] creationix: then I can just require(' [00:03] Nuck: Wouldn't be too hard, I could do it pretty simply too... [00:03] Nuck: Just toss it into an object [00:03] creationix: require('foo- ' +(process.arch) + '.node') [00:03] jesusabdullah: Nuck: If you save the data now then you can graph it later [00:03] Nuck: push it onto an array [00:03] Nuck: jesusabdullah: Good point :P [00:04] jeromegn has joined the channel [00:04] jesusabdullah: console.log it to a csv ;) [00:04] tim_smart: mrryanjohnston: Date.now() and friends take less than a ms to execute (I think) [00:04] Nuck: I should set up a storage mechanism lol [00:04] isaacs: creationix: sure [00:04] jesusabdullah: Or, do the right thing and try to database it :P [00:04] isaacs: creationix: i don't think it's process.arch, though [00:04] Nuck: jesusabdullah: Or just do Redis [00:04] Nuck: :P [00:04] jesusabdullah: NO [00:04] jesusabdullah: BE A MAN [00:04] isaacs: creationix: the os.arch() function got added in 0.5 [00:04] creationix: tjholowaychuk: so they use a modified node? [00:04] Nuck: Mongo? [00:04] jesusabdullah: NO [00:04] Nuck: I have a Mongo [00:04] jesusabdullah: EXCEL SPREADSHEETS [00:04] Nuck: I do NOT have a redis [00:04] isaacs: creationix: but you can fake it with a child proc to uname [00:04] tjholowaychuk: creationix one sec i'll see if i can find it [00:04] mrryanjohnston: tim_smart: ah, kay. [00:05] Nuck: jesusabdullah: I think I'll set it up to toss onto a Redis instance, so I can learn that too :P [00:05] creationix: isaacs: you really think it's magical to ignore invalid addons [00:05] Nuck: I learned basics of socket.io with this :P [00:05] jesusabdullah: word [00:05] Nuck: Very nice, very simple, I love it. [00:05] isaacs: creationix: well... yeah, it's magical. it'd be nice. [00:05] jesusabdullah: Yeah, I think I'm gonna try to play with couch in my offtime [00:05] isaacs: creationix: but it would need to be carefully thought out [00:05] torsd has joined the channel [00:05] isaacs: creationix: [00:05] apanda has joined the channel [00:05] jesusabdullah: It's like [00:05] jesusabdullah: a PLACE where you can PUT THINGS [00:05] isaacs: creationix: evenif you touch foo.node and then do require("./foo") it'll do a process.dlopen on the empty file [00:05] chjj: jesusabdullah: ! [00:06] jesusabdullah: I bet I'd be really happy with just couchdb and futon [00:06] jesusabdullah: and nothing else [00:06] jesusabdullah: "Oh I'll just ENTER THIS INTO THE DATABASE" [00:06] tjholowaychuk: creationix https://github.com/ajaxorg/o3/blob/master/modules/o3.js [00:06] jesusabdullah: click click type type [00:06] mrryanjohnston: Nuck: throw a "fork me on github" thingy on there to get credit for your creation ;) [00:06] Bennito: Nuck: How do you parse JSON? [00:06] creationix: isaacs: right, and throw the error "Error: /home/tim/node_modules/foo.node: file too short" [00:06] isaacs: creationix: right [00:07] davidbanham has joined the channel [00:07] Nuck: Bennito: JSON.parse [00:07] Marak: dammit why did http://doodle.no.de/ go down [00:07] Nuck: Built in to JS [00:07] zivester has joined the channel [00:07] isaacs: creationix: forking in a js layer is probably the best approach. i could see the value in a magic fall-through, but it'd have to be done carefully [00:07] Nuck: jesusabdullah: I prefer Mongo. It's more natural to me, since I used to know SQL. [00:08] Nuck: I'd rather do that than write a map-reduce function [00:08] JaKWaC has joined the channel [00:08] Nuck: And I imagine it's a tad faster too :P [00:08] jesusabdullah: Hah! [00:08] isaacs: Marak: have the owner ssh in and tell you :) [00:08] Nuck: Since it can be indexed and sorted and whatnot in BSON [00:08] creationix: isaacs: ok, ugly boilerplate for now [00:08] jesusabdullah: I'm down with the mr's [00:08] jesusabdullah: probably [00:09] Bennito: Nuck: Thanks a lot [00:09] dscape: what are you guys using for oauth? [00:09] CStumph has joined the channel [00:09] dscape: im tired of everyauth [00:09] tiemonster: what's the state of sendfile in Node.js right now? it's stable enough to use for static file serving, right? [00:10] Nuck: tiemonster: It can, it's just not one of the things Node is best for [00:10] chjj: tiemonster: it is, but you have to implement it at the http level yourself [00:11] creationix: tjholowaychuk: I see, thanks [00:11] tiemonster: Nuck: it just seems dumb to run a separate nginx process just to serve up the static files for an app... [00:11] isaacs: tiemonster: why's that dumb? nginx is great at serving static files [00:11] jesusabdullah: v8> array(5).join(",") [00:11] v8bot_: jesusabdullah: ReferenceError: array is not defined [00:11] Nuck: tiemonster: Meh, I disagree [00:11] jesusabdullah: v8> Array(5).join(",") [00:11] v8bot_: jesusabdullah: ",,,," [00:11] Nuck: I think that's actually a great plan [00:11] tiemonster: I'm guessing that it hasn't made it into connect for the reasons mentioned here: http://groups.google.com/group/nodejs/browse_thread/thread/479e1e5de272931d/d2f7bfaffc0d01e8?lnk=gst&q=sendfile#d2f7bfaffc0d01e8 [00:11] Nuck: static file serving? [00:12] Nuck: I know Express has a middleware for that [00:12] jesusabdullah: v8> Array(5).join("THE BEST ") [00:12] v8bot_: jesusabdullah: "THE BEST THE BEST THE BEST THE BEST " [00:12] Nuck: Pretty sure that's inherited from Connect [00:12] tiemonster: yeah, but it uses the stream API [00:12] chjj: Nuck: hes talking about sendfile [00:12] tiemonster: I figured there would be a speed boost from sendfile [00:12] CIA-69: libuv: 03Ryan Dahl 07master * rb47fa77 10/ src/unix/fs.c : unix/fs.c: Apply macro magic, implement symlink, link, chown, fchown - http://git.io/x6bdCw [00:12] albertosheinfeld has joined the channel [00:12] tjholowaychuk: tiemonster yeah it's just a fs.ReadStream right now [00:12] Nuck: My guess is that sendfile is just using the stream api too? [00:13] mehlah has joined the channel [00:13] chjj: tiemonster: personally, i have my own little middleware i use for sendfile [00:13] tiemonster: it wouldn't hurt to implement as a Connect middleware I guess [00:13] tiemonster: chjj: really? on github? [00:14] chjj: tiemonster: yeah, its tightly coupled with my framework though, you might do better to look at tim smart's middleware collection, it was partially based on his implementation and peter griess' example [00:14] tiemonster: I would think that would be comparable in speed to nginx [00:14] socketio\test\28 has joined the channel [00:14] chjj: tiemonster: https://github.com/chjj/vanilla/blob/5eb25d09bfb9ddb34ac502ee9891c012f0f153fb/lib/vanilla.js#L571 [00:15] tiemonster: how can a middleware be tightly coupled? isn't that the whole point of middleware? :-) [00:15] chjj: i think people have done benchmarks, its still not as fast as nginx, but its much faster than using node streams [00:15] tiemonster: I might do my own and see [00:15] chjj: tiemonster: yeah, its not actually middleware, i lied, i keep my static file server function kind of internal and then layer a middleware on top of it, its the one thing i do backwards [00:15] tiemonster: I guess there would be a small overhead for V8 context switching [00:16] arthurd has joined the channel [00:16] zivester has joined the channel [00:16] Bennito: Why is nginx better than Node application server like Haibu? [00:17] chjj: huh? [00:17] jesusabdullah: v8> Array(5+1).join("THE BEST ") [00:17] v8bot_: jesusabdullah: "THE BEST THE BEST THE BEST THE BEST THE BEST " [00:17] jesusabdullah: ACTION just now figured out why the +1 [00:17] Nuck: Bennito: Because JS isn't built for binary data [00:17] tiemonster: ooh - found this: https://gist.github.com/702695 [00:17] Nuck: And while Node can provide a way to deal with binary data, it isn't perfect [00:18] jesusabdullah: wait wait wait [00:18] Nuck: Generally a server like Nginx will be better simply because it lacks overhead from the Js layer, etc. [00:18] lime_ has joined the channel [00:18] jesusabdullah: Bennito: what do you mean by "node application server" ? [00:18] chjj: tiemonster: that wont work, you need to set up an io watcher and handle EAGAIN [00:18] aoberoi has joined the channel [00:19] chjj: tiemonster: look at the function i showed you, you need to do everything there basically [00:19] lime_: I have node.js running on hostmonster, but I am unable to access my site once I do `node server.js` [00:19] jesusabdullah: lime_: Does it work locally? If not, maybe it's a problem with hostmonster [00:19] lime_: I have it set up on port 1337, and the server starts, but I'm unable to acesss the site at domain:1337.org [00:20] Bennito: jesusabdullah: https://github.com/nodejitsu/haibu [00:20] jesusabdullah: lime_: domain.org:1337 [00:20] chjj: you mean domain.org:1337? [00:20] lime_: upps domain.org:1337 [00:20] lime_: yeah sorry not thinking :D [00:20] maushu: Great, updating node broke something. [00:20] chjj: lime_: do you have some kind of firewall setup? did you forward port 1337? [00:21] jesusabdullah: Bennito: I guess my thinking is that haibu and nginx solve different problems entirely. nginx is a fast webserver that just, y'know, serves stuff,,, whereas haibu does a bunch of stuff to "wrap" node.js apps [00:21] lime_: I'll check @chjj [00:21] reid_ has joined the channel [00:21] lime_: It's pretty much the default install [00:21] maushu: Oh for the love- [00:21] lime_: besides git and node.js [00:22] maushu: writeUInt16LE? [00:22] chjj: lime_: are you using some kind of vps? [00:22] chjj: lime_: has nothing to do with the node install [00:22] jesusabdullah: people like to throw nginx out front because it's fast, can do proxying and can handle static files better n' node can [00:22] chjj: jesusabdullah: i think its overrated, id rather keep things simple and just use node if i can [00:23] Bennito: jesusabdullah: So the best thing is to use both? [00:23] chjj: jesusabdullah: if its *just* for static files and youre not youtube, i wouldnt care [00:23] chjj: oh @whoever [00:23] chjj: or* [00:24] ivan` has joined the channel [00:24] ivan` has left the channel [00:24] lime_: @chjj well I'm running a shared hosting and it appears only specific ports are allowed open. [00:24] jesusabdullah: chjj: me too [00:24] lime_: http://hostmonsterforum.com/showthread.php?3934-Open-ports-on-a-SHared-IP-address [00:24] jesusabdullah: Bennito: It depends on how you roll. Nodejitsu does not use nginx, fwiw,  [00:24] chjj: lime_: youll either have to use a port thats allowed or find a way to forward port 1337 [00:24] lime_: Is there a way to shutdown apache/php or whatever else is going on [00:25] tiemonster: jesusabdullah: vhost-based proxying based on different domains? [00:25] chjj: killall httpd [00:25] jesusabdullah: chjj: I agree [00:25] Yuffster_work has joined the channel [00:25] chjj: or killall apache or whatever [00:25] tjholowaychuk: jesusabdullah doesnt mean it's fast [00:25] jesusabdullah: This innanet is killin' me [00:25] tjholowaychuk: haproxy > node-http-proxy [00:25] tjholowaychuk: if you want speed [00:25] Marak: i dont think nginx does websocket proxying out of the box yet [00:25] tjholowaychuk: though it's cool to go "all node" [00:25] tjholowaychuk: if you can [00:25] Bennito: jesusabdullah: Yes, I know. I want to host a few apps on my VPS and considerning what would be the best solution.. [00:25] khrome has joined the channel [00:26] lime_: Before I do that, should running `http` get everything back to normal? [00:26] tiemonster: I used squid for a while [00:26] dgathright has joined the channel [00:26] Marak: yeah, haproxy should definitely be more performant [00:26] Marak: at least for now [00:26] chjj: lime_: do this: `ps -A | grep httpd`, is apache running? [00:26] chrislorenz has joined the channel [00:27] socketio\test\63 has joined the channel [00:27] chjj: lime_: if so you have an apache server running on that box, are you sure you want to kill it? [00:27] tiemonster: it's certainly easier to deploy all-node [00:27] lime_: There are almost 20 httpds running :D @chjj [00:27] tbranyen: tjholowaychuk: yo dude you around? [00:27] tjholowaychuk: tbranyen kinda, gotta run pretty soon [00:27] chjj: lime_: im not sure what youre normally using that server for [00:27] v3ctR has joined the channel [00:27] tbranyen: tjholowaychuk: okay, i'll bug you about it later [00:28] tbranyen: i got a ridic patch to socket.io i wanna run by you for lols [00:28] tbranyen: before i submit it [00:28] tjholowaychuk: alright cool man [00:28] chjj: lime_: but if you understand the implications of what youre doing, yes you could kill all those processes so you get access to port 80 or whatever you wanted [00:28] Daegalus: Anyoen here use nide? [00:28] Marak: ya [00:28] Bennito: Daegalus: yap [00:28] Marak: Daegalus: i tried today [00:28] chjj: lime_: what is that server used for? are those your processes? [00:28] Marak: seemed to work, but i have textmate so you know [00:29] chjj: lime_: do you have root access? etc [00:29] khrome: anyone using mootools under node? [00:29] Daegalus: Any of you know how to run multiple? I would like a few for multiple projects [00:29] lime_: Its a website server, and no I don't appear to root acess. [00:29] Marak: Daegalus: you should just be able to set the port [00:29] Marak: Daegalus: whats the issue? [00:29] chjj: lime_: well then, you cant kill those processes anyway most likely [00:29] Daegalus: Well, I would have to change the script, launchone, change the script again, launch, etc. [00:30] chjj: lime_: if thats a shared webhost theyre probably reverse proxying requests to all those processes [00:30] chjj: lime_: you would probably need to specifically request them to set it up for node for you [00:31] lime_: chjjj: ok thanks for the info, I'm going to do some googling I might be back in a minute [00:31] Destos has joined the channel [00:31] slyphon has joined the channel [00:32] matyr_ has joined the channel [00:32] lunks has joined the channel [00:34] devongovett has joined the channel [00:34] jeromegn has joined the channel [00:34] marksoper has joined the channel [00:35] kiffness has joined the channel [00:36] v3ctR: is this the place to ask about libuv? [00:37] chjj: v3ctR: there would be no better place [00:37] v3ctR: ok :-) [00:38] v3ctR: is it possible to run uv_run() in another thread? [00:39] kiffness_ has joined the channel [00:41] tiemonster: well you guys can watch here if you want: https://github.com/tiemonster/node-sendfile [00:41] jasong_at_apache has joined the channel [00:41] CIA-69: libuv: 03Ryan Dahl 07master * rb89f4f3 10/ src/unix/fs.c : implement uv_fs_utime - http://git.io/86mhDg [00:41] lime_: Are there any decently cheap hosting services that support php and node.js? [00:41] tiemonster: I'll hack together a solution over the next few weeks and then do some benchmarking [00:41] bnoordhuis: v3ctR: right now now [00:41] tiemonster: cya o/ [00:41] bnoordhuis: not reliably anyway [00:42] v3ctR: oh ok... [00:42] v3ctR: i got it running to a point where it can accept connections... [00:42] bnoordhuis: the event loop isn't thread-safe [00:43] isaacs has joined the channel [00:43] bnoordhuis: wait for the multiplicity branch to land [00:43] bnoordhuis: and you'll be able to have one event loop per thread [00:43] luke` has joined the channel [00:44] v3ctR: what do you mean by one event loop per thread? [00:44] v3ctR: sorry :-/ [00:45] bradleymeck has joined the channel [00:45] bnoordhuis: v3ctR: right now there's a single event loop, the one you start with uv_run() [00:45] bnoordhuis: the multiplicity stuff means you can have more than one loop [00:45] bnoordhuis: a loop is not thread-safe by itself [00:46] chjj: lime_: youre going to want a vps or something that gives you root access, i know amazon might still have their promotional for ec2 micro instances [00:46] ryah: v3ctR: what do you want to do? [00:46] bnoordhuis: but a loop per thread is [00:46] v3ctR: ryah: I'm doing an npapi plugin [00:46] Nuck has joined the channel [00:46] TooTallNate: i wonder if this multiplicity thing would help me at all... [00:47] v3ctR: so i cant run uv_run on the same thread as the plugin that interfaces with javascript [00:47] Nuck: So, socket.io appears to crash safari mobile over 3G [00:47] Nuck: Maybe an issue with WebSockets? [00:48] v3ctR: so i worte a sort of wrapper around libuv that takes calls from javascript [00:49] Nuck: Anyone able to reproduce my error on socket.io? [00:49] Nuck: Need iPhone, just switch off the wifi and try loading peterlejeck.tk:3030 [00:50] dgathright has joined the channel [00:50] Nuck: Test it and see if it crashes [00:51] chjj: .tk domains, mm, i remember when those were still free [00:51] Nuck: Still are, chin [00:52] chjj: they are? [00:52] Nuck: chjj even [00:52] v3ctR: bnoordhuis: does that mean that say if you call uv_read_start on a handle on one thread, the event loop in another thread canl add it to the read queue? [00:52] chjj: wat! [00:52] gkatsev_ has joined the channel [00:52] Nuck: Yup that's why I use them [00:52] chjj: huh, i thought they started selling em, weird [00:53] bnoordhuis: v3ctR: no [00:53] Nuck: They force you to get 25 hits a month unless you pay, but thats easy [00:53] v3ctR: bnoordhuis:any idea how to? :-P [00:53] chjj: bots and crawlers alone would take care of that [00:54] Nuck: Yup lol [00:54] bnoordhuis: v3ctR: you can't do that unless you protect both loops with a mutex [00:54] v3ctR: ok... [00:55] v3ctR: bnoordhuis:howcome it works with listening? [00:56] Nuck: Anyone able to test it for me? [00:56] bnoordhuis: v3ctR: that's because the fd you're listening on is lock-protected inside the kernel [00:57] Nexxy has joined the channel [00:57] Nexxy has joined the channel [00:57] bnoordhuis: kind of hand-wave-y that but close enough [00:57] Nexxy: I always miss the hand waving ;/ [00:57] v3ctR: bnoordhuis: is it not the same for reading then? [00:58] sorensen: afternoon folks [00:58] bnoordhuis: v3ctR: libub doesn't do any kind of locking [00:58] kiffness has joined the channel [00:58] marksoper has joined the channel [00:59] bnoordhuis: if you add or remove stuff from several threads, its internal data structures will get corrupted [01:00] SebastianFlyte has joined the channel [01:02] tauren: I can use process.cwd() to get the current directory. But is there a way that I can change the currect directory? [01:03] ctide: process.chdir [01:04] vicapow has joined the channel [01:04] nerdy has joined the channel [01:04] v3ctR: bnoordhuis: if i call uv_read_start on a handle from the main thread...it adds the handle to the LOOP? can i just lock the LOOP in the main thread before doing that? [01:05] bnoordhuis: v3ctR: yes [01:05] tauren: ctide: thanks! [01:07] v3ctR: bnoordhuis: will that affect the event loop in the other thread tho or would i have to set it up to wait for the LOOP to be freed again? [01:07] ctide: tauren: np [01:08] fairwinds has joined the channel [01:09] bnoordhuis: v3ctR: the other thread cannot be inside the event loop at that time [01:09] bnoordhuis: v3ctR: if it wakes up, it'll trash those aforementioned internal structures [01:10] bnoordhuis: v3ctR: so if you want to keep it simple, stick to a single event / single thread model for now [01:10] v3ctR: bnoordhuis: uv_run blocks... [01:10] postwait has joined the channel [01:10] willwhite has joined the channel [01:11] v3ctR: bnoordhuis: so the calls from javascript will never get through... [01:11] perezd has joined the channel [01:12] bnoordhuis: v3ctR: set up a pipe and feed it data from the js thread, that'll wake up the main thread [01:12] jamesarosen has joined the channel [01:14] v3ctR: bnoordhuis: these sort of pipes? http://msdn.microsoft.com/en-us/library/aa365780(v=vs.85).aspx [01:15] bnoordhuis: v3ctR: yes, check out the uv_pipe_* functions [01:16] Marak: anyone wanna play? http://fat-guys-with-guns.nko2.nodeknockout.com/room_for_browser/0/play [01:17] brianseeders has joined the channel [01:17] v3ctR: bnoordhuis: will those pipes not need an event loop too? [01:18] bnoordhuis: v3ctR: you add the pipe to the event loop [01:19] bnoordhuis: v3ctR: then, when you want javascript to wake up the main thread, you write some data to it [01:19] descipher has joined the channel [01:19] tiemonster: Marak: for a couple minutes [01:19] Marak: tiemonster: im in room one [01:20] Marak: wanna see if this thing works [01:20] Marak: room 0 rather [01:20] tiemonster: went to the link. nothing is happening. [01:20] Marak: tiemonster: maybe go straight to http://fat-guys-with-guns.nko2.nodeknockout.com/ [01:20] SuMarDi has joined the channel [01:20] Marak: you gotta like go to a link on your phone too [01:20] Marak: it requires phone + browser [01:21] Marak: game on browser, controlled by phone [01:21] tiemonster: oh. didn't know that. [01:21] tiemonster: can't do that right now. sorry. [01:21] Marak: sorr,y [01:21] Marak: k [01:21] Nuck: Marak: Do you use socket.io or websockets? [01:21] Brandon_R has joined the channel [01:21] Brandon_R: hello fellow nodesters [01:21] blup has joined the channel [01:22] tiemonster: Marak: wait, can I use my tablet? [01:22] Nuck: Marak: It's crashing mobile safari [01:22] perezd_ has joined the channel [01:22] Brandon_R: what is? is it a nodejs example? lemme see :) [01:22] Marak: Nuck: i got kicked out of room 0 [01:22] Marak: im in room 1 now [01:23] v3ctR: bnoordhuis: ah ok... [01:23] Nuck: Marak: yes but mobile safari crashes when doing WebSockets over 3G [01:23] Nuck: Or so it seems [01:23] Marak: this game sucks [01:24] Marak: oihh shit starting [01:24] chilts: I can't seem to do anything, whether it's room 0 or 1 [01:24] v3ctR: bnoordhuis: so i set up a pipe server using bind and all that in the libuv thread? [01:24] enhydra has joined the channel [01:25] Marak: chilts: you need 2 finger sqipe [01:25] Marak: swipe [01:25] chilts: ah, I see, I need a phone too :) [01:25] chilts: lol [01:25] m_: nothing happening when i swipe [01:25] Marak: two fingers, should turn red [01:25] Marak: to green [01:26] m_: nope [01:26] bnoordhuis: v3ctR: yes [01:26] m_: i'm on android 2.3 [01:26] Marak: okay, this game is terrible [01:26] Marak: lol [01:26] Marak: i give up [01:26] tiemonster: Marak: got knocked out [01:26] chilts: it's an interesting idea [01:26] tiemonster: Marak: try room 3 [01:26] blup has joined the channel [01:26] chilts: a remote control for your browser :) [01:27] phiggins has joined the channel [01:27] v3ctR: bnoordhuis: so uv_pipe_connect can be used from the javascript thread? [01:27] tiemonster: 2 rather [01:27] Brandon_R: so guys [01:27] v3ctR: bnoordhuis: sorry if i'm asking too many q's :-/ [01:27] Brandon_R: what are some nodejs projects you are working on? [01:27] tiemonster: m_: doesn't work on Android browser [01:27] tiemonster: opera works [01:27] Marak: tiemonster: okay ill try [01:27] m_: eh. [01:27] tiemonster: Brandon_R: lots [01:27] tiemonster: :) [01:27] Brandon_R: cool [01:28] Brandon_R: any demos i could try out? [01:28] tiemonster: hmm [01:28] tiemonster: probably not at the moment [01:28] Brandon_R: Quick question [01:28] v3ctR: bnoordhuis: are there any examples of that so i can learn from it instead of annoying you... [01:28] Marak: im in now [01:28] Brandon_R: Does socket.io support UDP? [01:29] Marak: crap room 2 i think [01:29] fezzle has joined the channel [01:29] bnoordhuis: v3ctR: from a separate event loop so once the the multiplicity stuff lands [01:29] Marak: Brandon_R: hrmm? [01:29] bnoordhuis: v3ctR: have a look at the tests and the benchmarks [01:29] constantx_ has joined the channel [01:29] Brandon_R: if it's even possible :D [01:30] wilmoore has joined the channel [01:30] tiemonster: Brandon_R: it uses its own protocol over tcp, I believe [01:30] Brandon_R: oh [01:30] tiemonster: Marak: no go. doesn't work. [01:30] Marak: yeah i give up [01:30] tiemonster: hehe [01:30] tiemonster: it was worth a try [01:30] Brandon_R: lol [01:30] tiemonster: I have to go read now [01:31] Brandon_R: what were you working on? [01:31] v3ctR: bnoordhuis: if its in a seperate event loop wont the javascript thread not be able communicate with it tho? [01:31] Emmanuel has joined the channel [01:31] tiemonster: Brandon_R: we were trying to play a game from Node Knockout [01:31] Vertice has joined the channel [01:31] v3ctR: bnoordhuis: i only need to communicate one way... [01:31] Brandon_R: cool, nodeknockout has some cool stuff, which game? [01:31] tiemonster: http://fat-guys-with-guns.nko2.nodeknockout.com/ [01:31] v3ctR: bnoordhuis: npapi provides a mechanism for calling back to the javascript thread from worker threads [01:31] tiemonster: anyways, I'm off [01:32] blup has joined the channel [01:32] tiemonster: I'm at www.github.com/tiemonster if you want to poke around [01:32] tiemonster: cya o/ [01:32] v3ctR: bnoordhuis: so i don't need to listen on the javascript thread... [01:32] fitzgen has joined the channel [01:32] v3ctR: bnoordhuis: does that cut out the need for another event loop? [01:32] wookiehang0ver has joined the channel [01:33] bnoordhuis: v3ctR: yes if you can just write to the pipe [01:33] bnoordhuis: truth be told, i'm not sure how that works exactly on windows [01:33] bnoordhuis: on unix you need to connect first [01:33] dmkbot: Avoid buffer overrun with 'binary' encoding reported by koichik: https://github.com/joyent/node/issues/1624 [01:34] JumpMast3r has joined the channel [01:34] CIA-69: node: 03koichik 07v0.4 * r96ede8c 10/ (src/node_buffer.cc test/simple/test-buffer.js): [01:34] CIA-69: node: buffer: Avoid overrun with 'binary' encoding. [01:34] CIA-69: node: Fixes #1624. - http://git.io/sm5sQQ [01:34] H4ns` has joined the channel [01:35] v3ctR: bnoordhuis: but i can just connect once and then send stuff... [01:36] v3ctR: bnoordhuis: i dont need to poll for responses... [01:36] rvaj2 has joined the channel [01:38] captain_morgan has joined the channel [01:39] bnoordhuis: v3ctR: was that a question or a statement? [01:39] ditesh|cassini has joined the channel [01:39] v3ctR: bnoordhuis:a bit of both? :-P [01:40] sambasiva has joined the channel [01:40] bnoordhuis: v3ctR: you should wait for the multiplicity stuff [01:41] bnoordhuis: v3ctR: right now, you can listen on the pipe with uv but you can't connect to it from within the same program [01:41] sambasiva has left the channel [01:41] bnoordhuis: (if it's from another thread, that is) [01:41] blup has joined the channel [01:41] v3ctR: bnoordhuis: so it's just for processes? [01:42] bnoordhuis: the alternative is to set up a pipe listener with uv and connect with the regular windows/unix api [01:42] pt_tr_ has joined the channel [01:42] bnoordhuis: v3ctR: yes [01:42] Brandon_R: guys [01:42] v3ctR: bnoordhuis: yeah i'm just looking through the api... [01:42] Brandon_R: do you think nodejs for windows uses the default Windows IOCP for its networking stuff. IOCP is pretty much done perfectly on windows :) [01:43] bnoordhuis: Brandon_R: yes [01:43] temp01 has joined the channel [01:43] abraxas has joined the channel [01:43] Brandon_R: cool, does it have any gain from the linux version? [01:43] bnoordhuis: Brandon_R: it's faster right now - but that won't last if i can help it [01:44] toki_kanno has joined the channel [01:46] Brandon_R: does linux support iocp? or same concept just under a different name? [01:47] joshthecoder has joined the channel [01:47] bnoordhuis: v3ctR: uv_async_send is probably what you're looking for [01:47] bnoordhuis: let's you wake up the main thread from another thread [01:48] bnoordhuis: Brandon_R: no, i/o works differently on the unices [01:48] Brandon_R: by differently do you mean different interface but relatively same performance or something totally different? [01:49] bnoordhuis: on par performance but totally different concepts [01:50] losing has joined the channel [01:50] Brandon_R: i guess i'll have to read up on this more [01:50] bnoordhuis: Brandon_R: http://tinyclouds.org/iocp-links.html <- it's not 100% factually correct but close enough [01:51] JakeyChan has joined the channel [01:51] jj0hns0n has joined the channel [01:51] JakeyChan has joined the channel [01:52] v3ctR: bnoordhuis: wahey! [01:52] v3ctR: bnoordhuis: it's exactly what I'm looking for [01:53] bnoordhuis: v3ctR: caveat emptor: you have to do the uv_async_init from the main threa [01:53] bnoordhuis: *thread, but afterwards you can send events from other threads [01:53] bnoordhuis: and now i'm off to bed :) [01:54] v3ctR: but i can do that before i start the event loop right? [01:54] Marak: yo someone join http://playbossman.com/ [01:54] v3ctR: bnoordhuis: thanks for your help! [01:55] Brandon_R: joined [01:56] jerrysv has joined the channel [01:56] jamesarosen has joined the channel [01:56] chilts: heh, I just kept jumpign :) [01:56] chilts: I have no idea where the end is, so I quit :) [01:57] marksoper has joined the channel [01:58] brokenjames has joined the channel [01:58] Marak: that game is open [01:58] k1ttty has joined the channel [01:58] Marak: awesome* [01:58] brokenjames: ! [01:59] brokenjames: any one here use awk? [01:59] brokenjames: || is over the age of 30? [01:59] jerrysv: brokenjames: what do you need, i've used it a few times over the decades [02:00] sivy has joined the channel [02:00] jesusabdullah: brokenjames: pkrumins wrote a book about awk [02:00] Brandon_R: did you make that gamete? [02:00] jerrysv: brokenjames: been using it since my teens [02:01] rvaj2 has joined the channel [02:01] brokenjames: I was attracted to learning it because of some db report processing tasks that have been coming up [02:01] jerrysv: i use it whenever we're trying to determine load issues at work [02:01] brokenjames: and I was wondering if it is a good direction or if pearl is something better [02:02] jerrysv: perl is fairly powerful, but i'm a big fan of small tools for discrete tasks [02:02] jerrysv: i've worked at two jobs that were perl shops [02:02] booo has joined the channel [02:02] jerrysv: and almost every job i've used awk, no matter the tools i have available [02:03] jerrysv: but, that said, it really depends on what you need to do [02:03] brokenjames: that is always the disclaimer [02:03] dscape: can some one tell me how can this work? [02:03] kuhrt has joined the channel [02:03] dscape: a = function () { return 1; } [02:03] dscape: a.foo = "boo" [02:03] dscape: what's teh data model on this javascript thing? :) [02:03] sivy_ has joined the channel [02:03] Ratty_: ? [02:03] Ratty_: What is there that can't work? [02:03] jerrysv: brokenjames: yes, when all you have is a hammer, it's time to visit the tool store [02:04] dscape: Ratty_: well, how would you implement something like that? [02:04] brokenjames: The node people seem a bit young and so am I and Im trowling awk mans [02:04] dscape: whats the underlying data structure? [02:04] Ratty_: dscape: what is there to implement? [02:04] jerrysv: brokenjames: i'm not, but this probably isn't the venue to be discussing awk :) [02:04] dscape: nothing Ratty_ but maybe something to understand [02:04] brokenjames: hehe [02:05] dscape: just knowing something works is not always enough [02:05] Ratty_: It's a function object with an extra property on it [02:05] Brandon_R: Hey guys [02:05] Brandon_R: Anyone got an example of how to use multicast in nodejs? [02:06] jerrysv: dscape: a = function () { this.foo = "boo"; return 1; } [02:06] dscape: jerrysv: that makes sense [02:06] d0k has joined the channel [02:06] jamesarosen has joined the channel [02:07] shanebo has joined the channel [02:07] marksoper has joined the channel [02:07] dscape: I guess that why you dont write a query language in javascript :P [02:07] jerrysv: v8: (function() { a = function() { this.foo = "boo"; return 1; }; return a.foo; })(); [02:07] v8bot_: jerrysv: undefined [02:07] jerrysv: bah [02:07] Ratty_: 'this' wouldn't be the function [02:08] Nuck: jerrysv: Yo dawg, I heard you like functions [02:08] jesusabdullah: v8: (function() { a = new function() { this.foo = "boo"; }; return a.foo; })() [02:08] v8bot_: jesusabdullah: "boo" [02:08] jerrysv: v8: (function() { a = function() { this.foo = "boo"; return 1; }; a(); return a.foo; })(); [02:08] v8bot_: jerrysv: undefined [02:08] jerrysv: ^^ what jesusabdullah said ^^ [02:08] chilts: heh [02:09] jerrysv: been too long of a day [02:09] Ratty_: yeah [02:09] Ratty_: praise jesus [02:09] Nexxy: HALLELUJAH [02:09] Nexxy: amen? [02:09] dscape: Ratty_: well but that doesnt return 1 when you ask for a [02:09] Vertice has joined the channel [02:12] maximosis has joined the channel [02:14] Nuck has joined the channel [02:14] jro has joined the channel [02:14] fg3 has joined the channel [02:15] dgathright has joined the channel [02:15] jesusabdullah: v8: (function() { a = new function() { this.foo = "boo"; }; return a.foo; })() [02:15] v8bot_: jesusabdullah: "boo" [02:15] jesusabdullah: v8: (function() { a = new function() { this.foo = "boo"; return 1;}; return a.foo; })() [02:15] v8bot_: jesusabdullah: "boo" [02:15] jesusabdullah: ah [02:17] dscape: jesusabdullah: tried returning the 1 still didnt work :\ [02:17] Ratty_: Indeed [02:17] Ratty_: It's a constructor, so it's return value isn't used [02:18] dscape: so what kind of magic allows it to work in two lines? [02:18] dscape: but not in one? :) what's under the hood? [02:18] neoesque has joined the channel [02:19] fezzle has joined the channel [02:19] zemanel: Marak: ping [02:19] Ratty_: No magic [02:19] Marak: zemanel: pong [02:19] Ratty_: the keyword there is 'new' [02:19] jesusabdullah: v8: (function() { a = function() { this.foo = "boo"; return 1;}; return [ a(), new a()]; })() [02:19] v8bot_: jesusabdullah: [1, {"foo": "boo"}] [02:19] Nuck: heh [02:19] Nuck: 1018 more watchers and we'll pass up Rails [02:19] Nuck: Earlier, it was at 1050 [02:19] dscape: jesusabdullah: good one [02:19] zemanel: Marak: im watching your presentation of hook.io on http://blip.tv/jsconf/marak-squires-the-evented-web-hook-io-3900861 [02:20] Marak: zemanel: okay, thats like v0.2.0 [02:20] maximosis: Dope presentation Marak I watched it [02:20] zemanel: it kind of reminded me of a state machine [02:20] Marak: thats 2 complete rebuilds of that project [02:20] Marak: since then [02:20] Marak: code base i talk about it non existent [02:20] zemanel: i'm known for getting late to parties :) [02:20] Marak: the project is about 1000x better now [02:21] Marak: i wasnt solving the right problem [02:21] Marak: the problem is i/o [02:21] Ratty_: dscape: I don't even know what the goal is. [02:21] dscape: Ratty_: learning :) [02:21] Marak: its not just the user who wants things to happen, its also all the actors on the network [02:21] dscape: understanding, thats all [02:21] Ratty_: I mean, what do you expect the code to do [02:22] dscape: I know how to do what I need to do, I just wanted to understand how it works [02:22] Marak: zemanel: id just start at http://hook.io and go from there [02:22] broofa_ has joined the channel [02:22] zemanel: Marak: i used a workflow/state machine for a project (http://incubator.apache.org/zetacomponents/documentation/trunk/Workflow/tutorial.html) and though about porting it to node [02:22] Marak: its not about that anymore [02:22] zemanel: i see [02:23] Ratty_: dscape: erm ok. [02:23] Marak: hook.io creates a distributed node.js EventEmitter that works cross-process / cross-platform / cross-browser. Think of it like a real-time event bus that works anywhere JavaScript is supported. [02:23] Marak: You create custom i/o scenarios by picking and choosing from an extensive library of tiny, independent, autonomous "hooks" that seamlessly work together. [02:25] zemanel: humm [02:25] Brandon_R has joined the channel [02:25] zemanel: reminds me of some colleagues project on an "ant colony" framework [02:26] ncb000gt: Anyone have a second to help me test something? [02:26] Brandon_R: good morning guys [02:26] cjm has joined the channel [02:26] Brandon_R: i will help [02:26] ncb000gt: With bcrypt [02:26] Brandon_R: link [02:26] ncb000gt: Brandon_R: what env you in? [02:26] jerrysv: anyone up to joining a node knockout game? http://fop-gun.nko2.nodeknockout.com/ [02:26] Brandon_R: windows [02:26] ncb000gt: :( [02:27] Brandon_R: but my desktop has archlinux [02:27] Ratty_: fap gun! [02:27] jwcooper has joined the channel [02:27] broofa has joined the channel [02:27] Brandon_R: i could switch over [02:27] ncb000gt: that might be good enough [02:27] ncb000gt: i'd imagine it would be [02:27] ncb000gt: :) [02:27] zemanel: Marak: now i see. i was reading nodejitsu blog and just noticed that entry was from january [02:27] ncb000gt: if you don't mind [02:27] kriszyp has joined the channel [02:27] jerrysv: anyone? trying to judge here [02:27] igl1 has joined the channel [02:27] Marak: zemanel: http://blog.nodejitsu.com/distribute-nodejs-apps-with-hookio [02:28] rbuck has joined the channel [02:28] ncb000gt: sure jerrysv [02:28] Marak: zemanel: im busy, bother me when you have a question [02:28] Marak: and people in #nodejitsu can help too with hook.io questions [02:28] zemanel: heh was reading that one. no prob take care [02:28] marksoper has joined the channel [02:28] ncb000gt: Brandon_R: can you pull down and "make build" bcrypt? https://github.com/ncb000gt/node.bcrypt.js [02:29] __sorin__ has joined the channel [02:29] ncb000gt: Brandon_R: then run https://gist.github.com/1187800 [02:29] ncb000gt: in the same directory [02:29] ncb000gt: and let me know if it segfaults? [02:29] ncb000gt: please [02:30] ncb000gt: I'm testing locally on 0.4.1, 0.5.4 and 0.5.5 [02:30] ncb000gt: erm [02:30] ncb000gt: 0.4.12 [02:30] ncb000gt: dammit 0.4.11 [02:30] ncb000gt: >_< [02:31] kiffness has joined the channel [02:34] MrNko has joined the channel [02:34] zemanel: ACTION goes back to the trench [02:34] jerrysv: pro tip for next year's node knockout: if you're requiring a LOT of your judges, think again :) [02:34] kiffness has joined the channel [02:34] ncb000gt: jerrysv: did you still need someone? [02:34] jerrysv: ncb000gt: nah, i fired up a ton of browsers for that one [02:35] ncb000gt: haha ok [02:36] fitzgen has joined the channel [02:36] shipit has joined the channel [02:36] MUILTFN has joined the channel [02:38] Nuck: Socket.io sucks on iOS [02:39] Nuck: Somebody make it suck less [02:39] kurtzhong_ has joined the channel [02:40] mrryanjohnston: could I do something like this with mongoose: User.findOne({displayName: { $in: [self.player1.displayName, self.player2.displayName]}}, function(err,user) { [02:40] mrryanjohnston: to get those two results specifically from the Users collection [02:40] mrryanjohnston: Nuck: well, it IS open source, afterall ;) you know, you could :3 [02:41] Nuck: mrryanjohnston: I try to avoid non-jQuery browser JS nowadays [02:41] Nuck: Well, to large levels [02:41] Nuck: I do small things without jQuery, but nothing that big [02:43] jchris has joined the channel [02:43] ncb000gt: ... [02:44] kiffness has joined the channel [02:44] jesusabdullah: I just used node -e to throw down a one-liner [02:44] jesusabdullah: I feel pretty boss [02:45] CarterL has joined the channel [02:45] JasonSmith has left the channel [02:45] jesusabdullah: To be fair, it was the most obvious way I could think of to make a script pause for a few seconds [02:45] JasonSmith has joined the channel [02:45] kiffness_ has joined the channel [02:47] jetienne_ has joined the channel [02:47] Nuck: jesusabdullah: Pausing is bad. [02:47] Nuck: Never pause. [02:47] Nuck: >:C [02:47] Nuck: idle, yes. [02:47] Nuck: Pause, no. [02:49] toki_kanno has joined the channel [02:49] yept: ty [02:49] kiffness has joined the channel [02:49] mikeal has joined the channel [02:49] mrryanjohnston: answered my own question: totally works. [02:50] jesusabdullah: Nuck: MAYBE I WAS IDLING [02:50] jesusabdullah: Nuck: It's also a bash one-liner [02:51] perezd has joined the channel [02:51] jesusabdullah: Okay, I need a way to have my computer beep or something now [02:51] Nuck: jesusabdullah: There's a BEEP symbol [02:51] jesusabdullah: and beep isn't working [02:51] Nuck: Push that to the console [02:51] Nuck: jesusabdullah: D: [02:51] Nuck: jesusabdullah: