[00:02] cloudhead has joined the channel [00:04] JimBastard: yo bentomas [00:05] JimBastard: http://maraksquires.com/node_debug/ [00:06] bentomas: a screencast! nice! [00:06] sudoer has joined the channel [00:06] JimBastard: its a little weaksauce, im gonna do better for v 0.2 [00:07] JimBastard: i didnt think it was worth wasting time for it >.< [00:07] JimBastard: profiling is whats up [00:07] JimBastard: so has declared ryah [00:07] JimBastard: i have no idea where to even start [00:08] bentomas: what does he mean by profiling? memory usage and such? [00:08] JimBastard: probaly code performance [00:08] JimBastard: putting in listeners maybe [00:08] JimBastard: and breakpoints [00:09] bentomas: that would be really sweet [00:10] JimBastard: i think you'd have to hook into v8 [00:10] JimBastard: again, no idea [00:11] JimBastard: im gonna rip out the session code, thats needed [00:17] CIA-28: node: 03Ryan Dahl 07master * r4129305 10/ (28 files in 8 dirs): Upgrade v8 to 2.0.2 - http://bit.ly/6gtAkv [00:17] CIA-28: node: 03simonw 07master * r516874f 10/ doc/api.txt : Documented repl.scope for explicitly exposing variables within the repl. - http://bit.ly/7xaAeN [00:17] ryah: any pending patches? [00:19] rtomayko has joined the channel [00:20] softdrink has joined the channel [00:22] ashb: inimino: is LALR necessary? [00:41] rtomayko has joined the channel [00:45] edspencer has joined the channel [00:54] rtomayko has joined the channel [00:57] frodenius: hm i get Error: (no message) [00:57] frodenius: weird [00:57] JimBastard: maybe just syntax error [00:58] frodenius: ya well that would give me a stack trace [00:58] JimBastard: im trying to figure this out [00:58] JimBastard: breakpoints [00:58] JimBastard: if you can figure it out ill wrap it up in the debugger [00:58] ashb: debugger; [00:58] frodenius: heh [00:58] ashb: should be a break point; [00:58] JimBastard: are you debug.log() already? [00:59] frodenius: ? na i'm not using it yet [00:59] JimBastard: its usefull for dropping variables [00:59] JimBastard: to the log [00:59] CIA-28: node: 03Ryan Dahl 07master * r0cea946 10/ deps/v8/SConstruct : Fix v8 SConstruct for freebsd - http://bit.ly/5iKrzu [00:59] CIA-28: node: 03Ryan Dahl 07master * r633d6be 10/ (ChangeLog doc/api.txt doc/index.html wscript): bump version - http://bit.ly/7oJzPP [00:59] JimBastard: http://maraksquires.com/node_debug/ [01:00] ryah: JimBastard: http://groups.google.com/group/nodejs/browse_thread/thread/a0da84e342580a87# [01:00] ryah: er [01:00] ryah: JimBastard: http://code.google.com/p/v8/wiki/DebuggerProtocol [01:02] ryah: JimBastard: http://github.com/ry/node/blob/debugger/bin/node-debug [01:02] ryah: the debugger needs to be run out of process [01:10] JimBastard: hi [01:10] JimBastard: cool beans [01:10] JimBastard: good to know [01:11] JimBastard: so i guess i could implement break points using that [01:11] JimBastard: ? [01:11] ryah: es [01:11] ryah: you have to start the node script with --debug [01:11] JimBastard: also, ive been toying around with sessions. i have a javascript md5 library, is there a better solution you think to for creating unique session ids ? [01:11] JimBastard: got ya [01:12] JimBastard: so i can make two modes then [01:12] JimBastard: it would be useful to have the debugger work on a regular instance as well (with limited functionality) [01:35] bentomas: JimBastard: you around? [01:36] JimBastard: sup [01:36] JimBastard: just working on http://github.com/Marak/node_session/blob/master/session.js [01:36] JimBastard: kinda tired [01:37] JimBastard: need moar snacky cakes [01:38] bentomas: I was thinking about the UI for node_debug [01:38] JimBastard: sup [01:39] bentomas: Right now it sort of top posts, where it inserts the last command at the top of the list [01:39] JimBastard: yes [01:39] bentomas: It might feel more terminal like if the command input was at the bottom and then it puts the last command at the bottom of the list [01:39] JimBastard: you thinking about reworking the #log interface? [01:39] bentomas: (and I love me the terminal!) [01:40] bentomas: I'm not sure, I haven't checked out the code yet [01:40] JimBastard: well, it should have sorting controls [01:40] JimBastard: for all columns [01:40] JimBastard: i want to add session information next [01:40] JimBastard: ip address, date time of connect [01:40] JimBastard: also have a running log id number [01:40] bentomas: yeah, I read that sounds cool! [01:40] JimBastard: which would have a numeric sort [01:41] bentomas: that all makes sense [01:41] bentomas: well, keep up the good work! [01:41] JimBastard: thanks man [01:42] JimBastard: i need to get this session.js done [01:42] JimBastard: everyone is talking about doing session management in their frameworks [01:42] sudoer has joined the channel [01:44] bentomas: yeah, I'm going to be thinking about that again soon myself: http://bomber.obtdev.org [01:44] bentomas: where are you storing the session data? [01:44] JimBastard: dead link [01:44] JimBastard: in memory [01:45] JimBastard: session shouldnt be worrying about persisting data too much, should just be options in the session declaration that will get passed along to other places [01:45] JimBastard: browser sends a unique key to the server based on fingerPrint [01:46] bentomas: okay: http://bomber.obtdev.com — you'd think I'd be able to remember the domain name. The framework doesn't really do much yet, but is sure fun to play around with :P [01:47] JimBastard: what are you doing for session? [01:47] bentomas: nothing right now [01:47] bentomas: I'm just happy that it can route a url to a function! [01:47] JimBastard: help me fix that [01:47] JimBastard: :-) [01:48] JimBastard: i could use some help with the plumbing [01:49] JimBastard: getting cgi information out of the request [01:49] JimBastard: and then an easy way to set the cookie in the browser and read that back out of the request [01:49] JimBastard: i got the md5 and logic all ready [01:49] bentomas: i see that, impressive! what do you mean by "cgi information" (sorry!) [01:49] JimBastard: ip address [01:50] JimBastard: also user_agent [01:50] bentomas: ahh… right right right [01:50] JimBastard: well check http://github.com/Marak/node_session/blob/master/session.js so far, not much of anything [01:50] JimBastard: im taking a break [01:51] JimBastard: see if you can figure out what to do, bbl [01:57] inimino: ashb: I don't think it's necessary [01:59] inimino: ah, good to see JimBastard did the session stuff while I was away [02:34] kolektiv has joined the channel [02:35] kolektiv: hi all - is anyone else aware of problems building on freebsd? [02:36] kolektiv: i get an error scons fails part way through the make step. using either latest from git or the latest tarball [02:36] frodenius: the most recent version fixed that [02:36] frodenius: well i think [02:36] frodenius: let me look [02:37] frodenius: kolektiv: http://github.com/ry/node/commit/0cea946cb9030d772897b468e2f4e32e40842c2a [02:37] frodenius: but i can not confirm that it's working, no bsd here [02:38] kolektiv: i don't thik that's the error i'm getting, let me clone the latest git head and try it right now [02:39] kolektiv: nope still get it, it's not that one [02:39] frodenius: :/ [02:40] inimino: and the error is? [02:40] kolektiv: hang on a tick, will gist it [02:41] kolektiv: http://gist.github.com/244350 [02:42] kolektiv: there's various output from make prior to that, that's where the actual error seems to crop up [02:42] kolektiv: unfortunately i'm no scons expert [02:43] kolektiv: this might be a stupid question. when i configure, that completes successfully, but some of the output shows fail as status. is that an issue here? [02:43] kolektiv: i have been presuming that configure will not complete unless it would compile from then [02:45] inimino: that's generally the intention [02:45] inimino: unless the fails look like they might be directly related to where make breaks [02:46] kolektiv: no they didn't look obvious [02:46] kolektiv: and as you say - if they were critical, i'd expect configure to flag that up [02:47] kolektiv: of course, that make output didn't really give any info about what went wrong, as it looks like scons swallowed it [02:47] inimino: yeah I don't see anything helpful there [02:48] kolektiv: i might have to delve in to scons a bit it seems [02:48] inimino: better you than me [02:49] kolektiv: heh, not so sure about that! [02:50] kolektiv: i'm not really even much of a python programmer, let alone a scons expert :) [02:50] inimino: the only thing worse than make is all the other build systems people invent to avoid having to use make... [02:51] kolektiv: haha - i was thinking something similar [02:51] kolektiv: as i'm just looking at a scons file [02:51] kolektiv: this is supposed to be simple? [02:51] inimino: and autoconf, which is the spawn of satan himself [02:54] kolektiv has joined the channel [02:54] kolektiv: sorry about that [02:54] kolektiv: must remember not to start tramp from outside a shell spawned emacs [02:54] kolektiv: doh [02:55] JimBastard has joined the channel [02:57] kolektiv: nah this is going to take a bunch of fiddling with to even get more info out. damn. will do after more sleep :) [02:59] JimBastard: debug? [03:00] kolektiv: JimBastard: is there a flag to make that will make scons output debug? [03:00] JimBastard: well, do you know how to debug objects so you can inspect properties? [03:01] kolektiv: hang on, wait, are you talking about debugging JS? [03:01] JimBastard: server side [03:01] JimBastard: yeah [03:01] kolektiv: i'm having problems getting nodejs to compile on freebsd [03:01] kolektiv: :) [03:01] JimBastard: weaksauce [03:01] JimBastard: sorr [03:01] JimBastard: y [03:01] kolektiv: hehe, no worries [03:02] kolektiv: i would much rather be trying to fix JS than scons DSL nonsense :) [03:03] JimBastard: i used a rackspace cloud [03:03] JimBastard: was fast [03:04] JimBastard: also there is the live-cde [03:04] JimBastard: live cd [03:04] JimBastard: on the mailing list [03:04] kolektiv: true [03:04] kolektiv: i'm just seeing if i can get it running in my local freebsd cluster :) [03:04] kolektiv: (so far - no.) [03:04] kolektiv: but i'm going to have a bit more of a delve in to the build tomorrow [03:04] kolektiv: after many sleeps [03:05] kolektiv: self.sleep(28800) [03:14] choonkeat has joined the channel [03:19] JoePeck has joined the channel [03:37] n8o has joined the channel [03:38] JimBastard: whats the easiest way to get information from a connected client [03:38] JimBastard: like ip address and user_agent [03:41] JimBastard: nm, i just dumped a few objects and found it [03:54] inimino: JimBastard: where's your stuff that you have so far on sessions [03:54] inimino: ? [03:55] JimBastard: sup [03:55] JimBastard: http://github.com/Marak/node_session [03:55] JimBastard: inimino [03:55] JimBastard: im fucking head deep inside of the node_debug console [03:55] inimino: ACTION looks [03:55] JimBastard: Connorhd_ is doing some server-side templating which id ont like [03:55] JimBastard: should be returning JSON data to be templated on the client [03:56] JimBastard: i need session bad though [03:56] JimBastard: im fixing up the #log view [03:56] JimBastard: each row will be tagged according to the session that created it [03:56] Connorhd_: the reason I did that was purely laziness so I could just use the jquery treeview [03:56] JimBastard: ;-) [03:57] JimBastard: makes perfect sense [03:57] JimBastard: what you setup REALLY helped me [03:57] JimBastard: i would be pretty lost without it [03:57] JimBastard: thanks again [03:57] JimBastard: im trying to pimp it out now [03:57] inimino: ACTION has a templating system that uses $variables$ $like$ $this$ [03:57] JimBastard: naaah [03:57] JimBastard: mustache [03:58] JimBastard: mustache FTW [03:58] JimBastard: works client-side and server-side really well [03:58] JimBastard: {{ }} [03:58] JimBastard: has extra views for doing MVVM type stuff (barely) [03:58] JimBastard: but back to session [03:58] JimBastard: you see whats going on there? [03:58] bentomas: MVVM? [03:58] Connorhd_: I don't know why people use { } for templating when its already used for CSS [03:59] JimBastard: model - view - view - model [03:59] Connorhd_: just seems like a bad choice [03:59] inimino: link? [03:59] JimBastard: {{ is mustache [03:59] JimBastard: two! its twice as good! [03:59] Connorhd_: thats just wasting bytes [03:59] JimBastard: fair enough [03:59] JimBastard: but your still using v8 [03:59] JimBastard: :p [03:59] inimino: $foo$ works [03:59] inimino: {{}} is ugly [03:59] inimino: what's wrong with $$? [03:59] JimBastard: its all the same [03:59] JimBastard: you can replace the token [04:00] JimBastard: im not even templating anything [04:00] JimBastard: session [04:00] bentomas: I like the {{ }} based templates. I like {{ var }} a lot better than $var$ or or "$var" or <%= var %>. [04:00] inimino: that takes all the fun out of it [04:00] inimino: these should be baked in and we should choose templating systems based on them... [04:01] inimino: bentomas: why do you like {{ }} better than $var$? [04:01] JimBastard: "session" should be a variable that exists in the client and the server that is unique per user session and can have values assigned to it [04:01] JimBastard: i got the basic fingerprint stuff up [04:01] JimBastard: you should be able to finish that [04:01] JimBastard: store it in memory for now [04:01] inimino: hm... [04:02] JimBastard: the md5 stuff + fingerprint should be a sufficient start [04:02] JimBastard: ill add the secret key stuff later [04:02] inimino: I wasn't even going to use any MD5, at least not here [04:02] JimBastard: did you look at the code i sent you? [04:02] inimino: yeah [04:02] inimino: I'm reading it [04:03] JimBastard: the goal is to create a unique UUID per session [04:03] JimBastard: and use that the token in the session store [04:03] JimBastard: what would you use instead of MD5? [04:03] Connorhd_: has no one made a node_crypt or similar yet? [04:03] JimBastard: for what? [04:03] Connorhd_: md5, sha1 etc [04:03] JimBastard: not sure, its just a placeholder for now [04:03] JimBastard: thats a diffirent module [04:03] frodenius: ugh i really dislike {{var}} <%= %> is so much better [04:04] inimino: JimBastard: I'd let the caller create their own token, and the session stuff just takes the token as an argument [04:04] Connorhd_: so you don't need to include them in every bit of code that uses them [04:04] JimBastard: it would be a great module [04:04] JimBastard: id use it for sure [04:04] JimBastard: i took 15 minutes and copy pasta'd the md5 code im using [04:04] inimino: JimBastard: then if you want to hash some crap, or use a username, or timestamp, or some random token, or something that an auth library gives you, or whatever, you do that [04:05] JimBastard: inimino could you create a demo? [04:05] inimino: yeah, ok [04:05] JimBastard: i want to stub out session.js [04:05] Connorhd_: how do you stop collisions between the tokens? [04:05] inimino: Connorhd_: responsibility of the caller [04:05] JimBastard: well the idea is for now it will regenerate [04:06] JimBastard: but this is all just hacky stuff to get it working [04:06] JimBastard: and modular [04:06] JimBastard: so we can update [04:06] JimBastard: and fork [04:06] Connorhd_: ahh, the caller is the node script using sessions? [04:06] JimBastard: yes [04:06] JimBastard: i think [04:06] JimBastard: hard to explain over IRC [04:06] inimino: Connorhd_: yeah [04:06] inimino: but if you want something easy and unique you can just use timestamps [04:06] inimino: if you care about session hijacking obviously don't do that :) [04:07] Connorhd_: node_debug does var id = Math.floor(Math.random()*10000); [04:07] Connorhd_: �_� [04:07] JimBastard: like i said, for now we can use ip address, timestamp, and user_agent (if we have it) [04:07] JimBastard: then MD5 that [04:07] JimBastard: its REALLY basic and will work [04:07] inimino: stuff I am more concerned about right now is how do you set the Set-Cookie header on the response [04:07] inimino: and that kind of stuff [04:08] JimBastard: okay [04:08] inimino: API issues [04:08] JimBastard: so for now i would start with passing the token as a url variable if its easier [04:08] JimBastard: caus you will have to set the cookie client-side at some point [04:08] JimBastard: also, if cookies are disabled completely we can still persist somewhat of a session based on the fingerprint [04:08] JimBastard: this is pretty key [04:08] sudocarl has joined the channel [04:08] inimino: cookies are better [04:09] JimBastard: so yeah we need a bunch of stuff [04:09] JimBastard: so i say start small and get a piece done that we can fork off of [04:09] inimino: you can do something with URI query parameters if cookies are disabled [04:09] inimino: but I don't care about that yet [04:09] inimino: yeah [04:10] JimBastard: okay im putting down the node_debug for a bit to focus on this [04:10] JimBastard: i need the state for the UI [04:10] JimBastard: :p [04:11] sudocarl: *cough* Hello :) I am new to node.js and I thought I would come and say hi... Cudo's to ry for making such a sweet framework/system if he is around [04:12] inimino: sudocarl: that's ryah, but he's on vacation at the moment; anyway, welcome :) [04:13] sudocarl: iminino: thanks :) [04:13] JimBastard: okay iminino im hacking together all the session code and putting into the CommonJS export wrapper, few moments [04:13] sudocarl: I am working on a simple twitter clone to catch up on my node.js knowledge right now [04:13] JimBastard: look into setting the cookie on the request response if you want [04:14] JimBastard: hey sudocarl check out the node_debug http://maraksquires.com/node_debug/ [04:14] sudocarl: already done and I love it [04:14] JimBastard: :-D [04:14] sudocarl: did you do it? [04:14] sudocarl: its great :) [04:14] JimBastard: yep [04:14] JimBastard: thanks [04:14] JimBastard: updating it now [04:14] sudocarl: nice [04:14] sudocarl: :) [04:14] sudocarl: its on my todolist on integrating it into my project [04:15] JimBastard: awesome! try to fork on github so i can track progress [04:15] sudocarl: out of curiousity could someone explain how POST requests are handled? [04:15] sudocarl: will do :) [04:15] JimBastard: not really sure [04:15] sudocarl: lol [04:15] JimBastard: broad question [04:15] sudocarl: I am not sure if they are :) [04:15] JimBastard: so if you have your server.js [04:15] inimino: JimBastard: k [04:16] JimBastard: you can http.createServer(function (req, res) { debug.log(req, res) [04:16] JimBastard: that has a bunch of properties in it that are interesting [04:16] sudocarl: oo thats not a bad idea [04:16] sudocarl: lemmi look at that [04:16] JimBastard: way better then reading the docs [04:16] sudocarl: cd ../node_debug [04:16] sudocarl: and go :) [04:16] Connorhd_: did you make debug.log deal with multiple arguments? [04:16] JimBastard: ummm, maybe not [04:16] JimBastard: its on the todo [04:16] JimBastard: it works client-side like that for sure [04:17] Connorhd_: what does clientside debug.log do? [04:17] JimBastard: im toying with the idea of having two views of client-side versus server-side renderings [04:17] JimBastard: not sure of the use [04:17] JimBastard: Connorhd_ http://benalman.com/projects/javascript-debug-console-log/ [04:17] JimBastard: read [04:18] Connorhd_: so it doesn't do anything with the page? just outputs to the browsers js console? [04:18] JimBastard: its cross-browser safe debugging that fails gracefully is there are no console outputs [04:18] JimBastard: you could hook into it [04:18] Connorhd_: sudocarl, OOI have you tried my node_debug and Maraks? [04:19] sudocarl: oo ~_~ [04:19] sudocarl: I am currently using yours [04:19] sudocarl: sorry jim's din't think there were two :D [04:19] sudocarl: jim didn't** [04:20] JimBastard: did you check that vidya sudocarl? [04:20] sudocarl: what? [04:20] JimBastard: http://maraksquires.com/node_debug/ [04:20] JimBastard: i did a little screen cast so you can see the UI [04:20] JimBastard: cant run that shit on a public domain, hax [04:20] sudocarl: oo now thats nice [04:20] sudocarl: :) [04:21] Connorhd_: I was wondering if it would be possible to sandbox node somehow and run node_debug for people to try out stuff in [04:22] JimBastard: session.js [04:22] JimBastard: well [04:22] JimBastard: sys.exec() is the main issues [04:22] Connorhd_: well, one of them :P [04:22] JimBastard: this is a classic problem, i think you are better off sandboxing the linux user account [04:22] Connorhd_: all the fs stuff [04:22] JimBastard: do it on a OS level [04:22] Connorhd_: plus you could use to to attack another site [04:23] Connorhd_: yeh [04:23] Connorhd_: or running the whole thing in a VM [04:23] JimBastard: im doing that right now [04:23] JimBastard: its kinda fubar [04:23] JimBastard: having a console [04:23] JimBastard: you need it though [04:24] Connorhd_: best to proxy it with auth and block the actual port its on [04:25] Connorhd_: JimBastard, a feature I do want to add is showing all the debug.log results even if you didn't have the page open [04:25] Connorhd_: or the last 20 or something [04:26] Connorhd_: also debug.clone or similar to output a copy of an object so it can't change before you have chance to view it [04:27] sudocarl: wow JimBastard really nice debug gui [04:27] sudocarl: its helpful [04:27] JimBastard: :-D [04:28] JimBastard: Connorhd_ im trying to get the session stuff online, so that every browser that was connected is a unique session, then we will store session history and have the #log view bound to that [04:28] JimBastard: so it will show the previous log [04:28] JimBastard: truncate at 20 or whatever [04:29] sudocarl: well it doesn't look like post requests show up in the req object [04:29] sudocarl: ~_~ [04:29] sudocarl: anyone know how to access post? [04:31] inimino: sudocarl: it's just the same as any other HTTP request [04:31] sudocarl: my lack of experience might show as I respond Huh? I don't know? :) [04:31] inimino: sudocarl: POST is just an HTTP request with a request content body [04:32] sudocarl: how do I access the body? [04:32] Connorhd_: sudocarl, http://nodejs.org/api.html#_multipart_parsing read that? [04:32] inimino: sudocarl: the data in the body can be in any format but if you're coming from PHP or something you're probably used to form data [04:32] sudocarl: oh thanks :) [04:33] choonkeat has joined the channel [04:33] sudocarl: Ohh... so if I wanted to access the raw body data I would add a event listener on the "body" event on req? [04:35] sudocarl: thanks for bearing with me on this :) [04:35] sudocarl: appreciate it [04:38] inimino: JimBastard: ok, this is what I was thinking as far as session API: http://boshi.inimino.org/3box/session/demo.js [04:38] inimino: JimBastard: the only thing is that there's no way there for the session to actually set the cookie on the request, so that's not workable as written [04:39] inimino: JimBastard: but what I was thinking is just have something return that cookie header and then insert it with the other headers... but yuck [04:40] inimino: JimBastard: this is what I was on about filters or middleware, it would make this kind of thing more tolerable for the user [04:41] JimBastard: okay back, sorry [04:42] Connorhd_: sudocarl, probably, I've not tried myself, I would suggest just trying stuff out [04:42] JimBastard: sup inimino [04:42] okito has joined the channel [04:43] inimino: JimBastard: hey, see above [04:43] JimBastard: im reading through now, its a good start [04:43] JimBastard: im pretty much doing what you have described [04:43] sudocarl: Connorhd_: thats the best way to learn :) [04:43] JimBastard: i put together the code right now got it compiling as we speak [04:43] Connorhd_: :) [04:43] inimino: sudocarl: yes, listen for the body event, and there may be several of them [04:43] JimBastard: but it still needs many pieces [04:44] inimino: ok [04:44] JimBastard: inimino can you write the code that will get the fingerPrint? [04:44] inimino: from what? [04:44] JimBastard: http://gist.github.com/244390 [04:44] sudocarl: inimino: on a side note, I am looking at some of your projects on 3box and they are really nifty! especially ed :) [04:44] inimino: from the request? [04:45] JimBastard: yeah [04:45] inimino: sudocarl: oh, cool :) [04:45] JimBastard: and i guess result will be the session [04:45] JimBastard: ill fix up the namespace and write onSessionStart [04:46] inimino: hm, fingerprint, ok [04:46] JimBastard: fingerprints are not unique, but they are pretty close [04:46] JimBastard: and a partial fingerPrint can give us an idea [04:47] JimBastard: i gotta do some js magic here [04:47] JimBastard: to get the selector syntax right [04:47] JimBastard: i was thinking [04:47] JimBastard: "session.blah.is.a.session.avariable" [04:47] JimBastard: and that will persist per session client-side and server-side [04:48] JimBastard: im not sure what you were doing with history inmino [04:48] JimBastard: inimino [04:48] inimino: hm, what about history? [04:49] JimBastard: we will use it to store the visitor's browsing history [04:49] JimBastard: if(!session.history) session.history = [] [04:49] JimBastard: from your docs [04:50] JimBastard: alright im going to finish onSessionStart right now, we'll need a timer process running too that monitors sessions [04:50] inimino: oh yeah [04:50] inimino: just to demo the session, I thought I'd store something in it [04:50] JimBastard: that will shut down invalid sessions, we also need a check onSessionStart to auto-expire as well [04:50] JimBastard: got y [04:50] inimino: so I'm storing the URLs the visitor visited [04:50] JimBastard: got ya [04:50] inimino: k [04:51] JimBastard: all the node_debug stuff is evented on unique location.hash's i just havent added the routing code [04:51] JimBastard: too distracted for the fancy stuff [04:51] JimBastard: some sweet eventful jquery up in there [04:51] JimBastard: redbull and smoke time [04:52] sudocarl: is there a repo for a session module? [04:53] JimBastard: yeah [04:53] JimBastard: we both working on it [04:53] JimBastard: right now [04:53] sudocarl: public? [04:53] JimBastard: yeah, but if you want sessions you should look at the chat example [04:53] JimBastard: i think i will finish session.js tonight [04:53] JimBastard: mostly done with the basics, very basic [04:53] sudocarl: thanks [04:54] JimBastard: what are you trying to build [04:55] sudocarl: uhh... a twitter clone? [04:55] JimBastard: whats your database [04:55] sudocarl: pgsql [04:55] JimBastard: you got node.js talking to it yet? [04:55] sudocarl: yea [04:55] JimBastard: nice [04:55] sudocarl: first thing I made sure worked [04:55] JimBastard: so have you looked into routing at all? [04:55] sudocarl: using ry's [04:55] sudocarl: I am using node-router.js [04:56] JimBastard: so does that have post and get variables? [04:56] sudocarl: just fixing some parts of it that seem to not work [04:56] sudocarl: thats the part that I am fixing [04:56] JimBastard: how are you fixing it? [04:56] JimBastard: links ? [04:56] sudocarl: well the default resource controller is using a function called "req.jsonBody" to get the post as json [04:56] sudocarl: but that function does not exist... [04:56] JimBastard: no clue [04:57] sudocarl: hence I am figuring out how to do post in node.js [04:57] sudocarl: and I am fixing the node-router library so the resourcecontroller works [04:57] JimBastard: did you try dumping the request object using the debugger [04:57] sudocarl: yea [04:57] sudocarl: as far as I can tell I just attach two listeners to the req object [04:57] sudocarl: a body and complete event [04:58] sudocarl: the body event calls a function with a chunk param (a chunk of the http stream) [04:58] sudocarl: and the complete signals that its finished [04:58] sudocarl: testing it now [04:58] JimBastard: probaly want onRequestStart, onRequest, onRequestEnd, but thats a diffirent story [04:58] JimBastard: you want to wrap your request for sure [04:58] JimBastard: i gotta get back to sessions [04:58] sudocarl: probably, but for now I just want to get it to work :) [04:59] sudocarl: have fun [05:01] inimino: sudocarl: yeah, that's how body and complete events work [05:01] inimino: I have a wrapper around here somewhere for it... [05:02] Connorhd_: http.createServer(function (req, res) { var data = ''; req.addListener("body", function (c) { data += c }); req.addListener("complete", function () { debug.log(data) });}).listen(8000); [05:03] Connorhd_: seems to work [05:03] JimBastard: hax [05:03] inimino: sudocarl: http://www.pastie.org/717869 [05:03] inimino: yeah something like that [05:03] sudocarl: thanks :) [05:03] sudocarl: lemmi play with that [05:17] sudocarl: can anyone think of a clever name of a simple twitter clone written in js on node.js? [05:17] sudocarl: for a* [05:19] JimBastard: no [05:19] sudocarl: :) [05:28] JimBastard: Connorhd_ im slowly replacing all your server-side html [05:39] inimino: JimBastard: got a demo up: http://boshi.inimino.org:8080/quux [05:40] JimBastard: kk checking it out in a sec [05:40] JimBastard: brb [05:40] inimino: k [05:40] inimino: code is this http://boshi.inimino.org/3box/session/demo.js and this http://boshi.inimino.org/3box/session/sessions.js [05:42] JimBastard: so this all works? [05:42] JimBastard: whats next, setting the cookie in the browser? [05:43] okito has joined the channel [05:44] inimino: yeah it works [05:44] inimino: it sets the cookie in the browser [05:44] JimBastard: so how do i write to the session [05:44] inimino: it currently doesn't give it an expiration date though, so it expires when you close the window [05:44] inimino: I should probably add an option to that [05:44] inimino: you store whatever you want on the session.data object [05:45] JimBastard: thats fine for now [05:45] JimBastard: so how would i include this [05:45] inimino: it's just a plain object, initially empty [05:46] JimBastard: i see [05:47] JimBastard: ive been cleaning up the log view a bit [05:47] JimBastard: lets see if we can get sessions working right now [05:47] JimBastard: get a stable session.js up and running [05:47] inimino: cool [05:49] inimino: brb [05:52] JimBastard: so why doesnt session.data = "poopbar"; debug.log(session.data); work in the debug [05:53] inimino: dunno [05:53] inimino: but .data is an object [05:53] inimino: should by .data.foo = 'bar'; debug (session.data.foo) [05:53] JimBastard: i think i got it [05:54] inimino: ok [05:54] JimBastard: working in some more stuff [05:55] inimino: ok [05:57] softdrink has joined the channel [05:59] JimBastard: so inimino i think ive got your code integrated nicely now [05:59] JimBastard: but im having an issue, could be a debugger bug [06:00] JimBastard: when i try to access the "session" object from a console statement i can't see it [06:00] inimino: huh, that's weird [06:00] inimino: it's in scope there? [06:01] JimBastard: i think Connorhd_ explained this to me, but im kinda retarded [06:01] JimBastard: i still havent explored every creavice of the legacy node_debug code [06:01] inimino: ACTION doesn't know where the console gets it's scope from exactly [06:01] Connorhd_: its just the global scope [06:02] JimBastard: we need the scope from inside the request handler [06:02] JimBastard: do i pass it along? [06:02] inimino: ok [06:02] Connorhd_: you can just make some kind of function to return the object you want [06:02] inimino: yeah [06:02] inimino: well, hm [06:02] JimBastard: whats the easiest way to do this for all objects? [06:03] inimino: I was going to say just do GLOBAL.session = session, but... [06:03] Connorhd_: export.getSessions = function () { return session } or something? [06:03] JimBastard: where would that go? [06:03] inimino: in this case that means it'll be a different object on every request from a different user [06:04] JimBastard: i see whats going on here hrmmm [06:05] JimBastard: i gotta rip out the session stuff from inside of node_debug [06:05] inimino: let's see [06:05] Connorhd_: I'm not entirely sure what you're trying to do [06:05] inimino: so the debugger takes what you type and sends it back to the server and does eval? [06:06] Connorhd_: yeh [06:06] inimino: ACTION should RTFS [06:06] JimBastard: pretty much [06:06] JimBastard: i think the debugger actually needs a session object [06:06] JimBastard: its not getting assigned one right now [06:06] JimBastard: since its not on 8000 [06:06] Connorhd_: then lets you browse the result [06:06] JimBastard: durr [06:06] inimino: ok, you could just make sure 'session' is in scope when it does that eval and it'll work [06:06] Connorhd_: so "hello" outputs "hello", 1+2 outputs 3, GLOBAL; outputs the global object [06:07] JimBastard: i want debug to register with session now [06:07] inimino: so you want to be able to do stuff like session.data.myStuff = foo from the debugger console and cache it away? [06:07] JimBastard: yeah [06:07] inimino: that could be handy... [06:07] JimBastard: and then i want to be able to inspect and modify other peoples session data [06:07] JimBastard: in real time [06:08] inimino: but then you want it to be unique to your session, and so it can't be a global per se [06:08] JimBastard: everyone has a unique session store [06:08] JimBastard: and the store is a browsable collection [06:08] Connorhd_: yeh, you'll have to inject something into the eval I guess [06:08] inimino: ok [06:08] JimBastard: ohh ima inject ALOT into EVAL ALL THE TIME [06:08] inimino: yeah probably [06:09] inimino: how you do debug stuff that's inside modules in general? [06:09] Connorhd_: eval("session = thisUsersSession;"+code); [06:09] Connorhd_: maybe? [06:09] JimBastard: i havent really gotten to that yet [06:09] JimBastard: i should build a modules tab that exposes and shows all available modules [06:09] Connorhd_: inimino, they need to expose what they want in the global scope [06:09] inimino: I mean I guess the debugger doesn't let you see stuff that's not available from the global scope? [06:09] JimBastard: this is a really great start to the session stuff [06:09] inimino: does v8 have some kind of 'browse GC roots' view or something? [06:09] inimino: ok, so no [06:09] JimBastard: i havent hooked into the v8 debugger yet either [06:10] JimBastard: inimino can you change some of the syntax on the session [06:10] Connorhd_: I'm not sure the v8 debugger will be that useful in node_debug in its current form [06:10] JimBastard: we REALLY need server side profiling, results can be dumped [06:10] inimino: yeah, I've never used it, don't know what's available [06:10] Connorhd_: since you can't pause execution or the debugger itself stops [06:11] Connorhd_: profiling of what? [06:11] JimBastard: code blocks [06:11] inimino: heh, yeah [06:11] JimBastard: start and stop [06:11] JimBastard: inimino, can you make the getter and setter work directly on the "session" object instead of session.data [06:12] JimBastard: meh, fuck it [06:12] JimBastard: its better that way [06:12] Connorhd_: JimBastard, what is your goal for node_debug? [06:12] n8o has joined the channel [06:12] inimino: JimBastard: yeah, I was going to do it that way, but then I'd have nowhere to stick methods on the session [06:12] Connorhd_: I'm not entirely sure where you're going with this session stuff [06:12] JimBastard: session.js is just a module [06:13] JimBastard: i need to add auth to node_debug [06:13] Connorhd_: so you're looking to let people interact with session.js through node_debug? [06:13] JimBastard: well yeah [06:13] JimBastard: my trying to have the debugger work kinda as an instance monitor / administrator [06:13] JimBastard: so you can manage multiple clients and node.js instances [06:14] JimBastard: clicky click pointy point server spawn [06:17] Connorhd_: at some point it might be worth calling that node_admin or something, since I plan on keeping node_debug fairly minimal [06:18] JimBastard: well [06:18] JimBastard: its a fork! [06:18] JimBastard: :-) [06:19] JimBastard: i guess renaming wouldnt be out of the question [06:19] JimBastard: see what ryah has to say [06:20] Connorhd_: well, if the projects become significantly different it would reduce confusion thats all [06:20] inimino: yeah, I think JimBastard's fork is growing to be more than just raw debug stuff [06:21] JimBastard: im just gonna keep adding modules [06:21] inimino: node_pwn [06:21] JimBastard: well.... [06:21] JimBastard: node_drop [06:21] JimBastard: is really the one [06:22] Connorhd_: whats node_drop? [06:22] JimBastard: node_drop('randomJSassett.js'); [06:22] JimBastard: node_drop('www.website.scom/blah.js'); [06:22] Connorhd_: what does that do? [06:22] JimBastard: node_drop(function(){asdasd}); [06:22] inimino: (why is it called _drop again?) [06:22] JimBastard: because, you can optionally drop it into the browser [06:22] JimBastard: so it runs client-side [06:23] Connorhd_: I'm completely confused :P [06:23] JimBastard: a shortcut to doing $().html('') kinda [06:23] JimBastard: if you use jQuery [06:24] JimBastard: take a JS assett from an arbritrary location run it [06:24] JimBastard: either require() it server side [06:24] JimBastard: or inject it into the browser [06:24] JimBastard: or do both [06:24] inimino: oh [06:24] Connorhd_: when would you want to do that? [06:24] inimino: why would you want to do both? [06:24] JimBastard: not sure [06:25] inimino: if this is like a commonJS + browser-compatible module or something? [06:25] JimBastard: that sounds about right [06:25] JimBastard: it could just be node_require [06:25] inimino: k [06:26] Connorhd_: how does it output to the browser? surely thats up to whatever is generating output? [06:27] JimBastard: thats kinda the idea [06:28] JimBastard: so if you call node_drop() client side it will request the assett [06:28] Connorhd_: oh, ok [06:28] Connorhd_: request it through the node server? [06:28] JimBastard: i havent really through it all through [06:28] JimBastard: yes, i guess it would need a namespace or something [06:28] JimBastard: maybe XHR request with a flag [06:28] JimBastard: not sure [06:30] inimino: server-side proxy [06:30] JimBastard: yeah one of those too [06:30] JimBastard: for sure [06:31] JimBastard: reverse [06:33] Connorhd_: node_drop seems like it would be part of a framework [06:33] JimBastard: probaly [06:33] JimBastard: i dont really have a need for it right now i guess [06:33] JimBastard: im looking through the fu.js file from node_debug [06:34] JimBastard: lots of not so great things going on [06:34] Connorhd_: that should probably be updated [06:34] JimBastard: well [06:35] bentomas has left the channel [06:35] JimBastard: the node_debug runs a seperate server right [06:35] Connorhd_: yeh [06:35] Connorhd_: well for all I know the script node_debug is debugging isn't a server [06:36] JimBastard: i want to be able to make multiple debugger instances going at a time [06:36] JimBastard: but they need to be aware of each other [06:36] Connorhd_: why? [06:37] JimBastard: i guess its not really needed [06:38] JimBastard: so you can monitor what each person is doing [06:38] Connorhd_: why not do it in once instance? [06:40] JimBastard: i dont for now [06:40] JimBastard: i guess thats really for an application anyway [06:40] JimBastard: im just gonna clean up some of the table results in #log [06:40] JimBastard: and think about it all [06:40] inimino: so for auth, I was thinking [06:41] inimino: have a separate module that "does auth" somehow [06:41] inimino: maybe OpenID, maybe HTTP Auth, maybe a plain old username/password HTML form [06:41] inimino: and then once you do that it gives you a token of some kind and you use that to create a session [06:41] JimBastard: that sounds about right [06:42] inimino: cool [06:42] Connorhd_: JimBastard, what did you think was wrong with fu.js btw? [06:42] inimino: maybe I'll work on that tomorrow [06:42] JimBastard: nothing is wrong with it [06:42] inimino: let me know whatever else you want on the session stuff and I'll try to add it [06:42] inimino: nn [06:49] bentomas has joined the channel [06:57] JimBastard: im thinking of taking the debugger off a seperate webserver [06:57] cmlenz has joined the channel [06:57] JimBastard: put on the production [06:57] JimBastard: with a path [06:57] JimBastard: like /debug [06:57] JimBastard: or /admin [07:12] JimBastard: okay ive got node_debug outputting into nice table results with highlighty columns [07:12] JimBastard: and rows [07:25] JimBastard: hey Connorhd_ what is the purpose of the session code in debug.js [07:31] Connorhd_: so multiple people can use the console without the results overlapping? [07:33] JimBastard: why would they overlap and not just push down? [07:33] Connorhd_: and for long polling to work [07:33] JimBastard: ahhh [07:33] JimBastard: okay [07:33] Connorhd_: if I run "GLOBAL;" how does it know who to output the result to? [07:33] JimBastard: im gonna ignore trying to have the node_debug be able to introspect and node_debug itself [07:33] JimBastard: was making me slightly crazy [07:34] JimBastard: im going to add some usefull debugging statements to the sample application and play around with fu.js some more i think [07:38] Connorhd_: you can access all the node_debug stuff from itself fine [07:39] Connorhd_: as long as you put whatever you want to access in the global scope [07:42] Connorhd_: maybe a nice feature would be debug.import(object) to add an object to the scope of the debugger without adding it to the global scope [07:45] JimBastard: im trying to think it all out [07:45] JimBastard: im gonna try to build an application now [07:45] JimBastard: and see whats good [08:22] malkomalko has joined the channel [08:27] choonkeat has joined the channel [08:45] choonkeat_ has joined the channel [09:05] kriskowal has joined the channel [09:17] mtotheikle has joined the channel [09:17] mtotheikle: Hello everyone [09:18] mediacoder: hi there [09:18] mtotheikle: So what is the best way to use node with MySQL? [09:19] frodenius: not at all [09:19] frodenius: hrhr [09:19] mediacoder: currently there isnt afaik. since there is no async mysql lib [09:19] mtotheikle: haha [09:19] sudocarl: its a bit unfortunate [09:19] sudocarl: but the postgre wrapper is working well enough for most projects [09:19] sudocarl: if thats an alternative [09:19] mtotheikle: Thats what I figured, but wanted to ask cause I know a client that would love this technology but we currently have the site running on php with mysql so we need to access data [09:19] sudocarl: http://github.com/ry/node_postgres [09:20] mediacoder: use couch, use redis, use tokyocabinet..use the simple postres wrapper. [09:20] sudocarl: if you wanted you could write a mysql wrapper... but it would have to block which would sorta kill the point ~_~ [09:21] mtotheikle: ya hmm... MySQL is still in the old days thought, built more for Apache and stuff it seems [09:21] sudocarl: indeed [09:22] mediacoder: at some point there will be a good mysql wrapper, i think..atleast i read it somewhere (that probably ryah will make it part of node-package itself?) [09:22] sudocarl: could you move the client's db into one of the above mentioned databases? [09:22] mtotheikle: this whole idea behind node.js is new, but could become vary popular which is why I am interested in it [09:22] mtotheikle: I may be able to do that, but the site is running on phpBB and Social Engine, so I would have to create scripts to update info into a database listed above [09:23] sudocarl: oo [09:23] mtotheikle: is ryah the main developer? [09:23] sudocarl: yea that might hurt [09:23] sudocarl: yea [09:23] mtotheikle: yes, kinda defeats the purpose... [09:24] mtotheikle: Right now we have a chat running with php and it kinda sucks, but I need user authentication which is all in MySQL if I was to use node [09:24] sudocarl: I think that given the current state of node and its very rapid dev pace... it would be unwise to try and wrestle an existing system ontop of it [09:25] sudocarl: can you connect to the mysql daemon via tcp [09:25] mtotheikle: yes, but it would be nice to build a new chat system with node using the data from the main site as far as user info and stuff [09:25] sudocarl: ? [09:25] mtotheikle: I may be able to connect with tcp, however not sure how well that will work... [09:25] sudocarl: if you can then you could potentially use the node.js async tcp wrapper to control mysql [09:25] mediacoder: sudocarl: yea ..atleast thats how im doing it currently with memcached [09:26] sudocarl: mediacoder, so your using mysql + node? [09:26] mediacoder: no [09:26] sudocarl: or you mean tcp + memcached? [09:26] mediacoder: im using memcached over tcp [09:26] sudocarl: ah [09:26] mediacoder: in node [09:26] mediacoder: yea [09:26] sudocarl: hmm that seems interesting [09:26] sudocarl: so via the same concept a mysql pure js wrapper could be created? [09:26] sudocarl: and the async would be handled in the tcp stack [09:26] sudocarl: rather than the mysql stack [09:27] sudocarl: s/stack/module [09:29] mtotheikle: looks like a TCP connection will work... [09:29] sudocarl: sweet [09:30] mtotheikle: now just gonna have to figure how to work with mysql over TCP as that is something new to me [09:30] sudocarl: I would take a look at http://github.com/creationix/postgres-js [09:31] sudocarl: for a postgre implementation [09:31] sudocarl: over tcp [09:31] sudocarl: however note that that module wont work as it uses raw bit arrays rather than binary for tcp transmissions [09:31] sudocarl: it is in the updating phase [09:50] halorgium: hmm, i'm having troubles with posix files [09:51] halorgium: the posix.write is errback'ing [10:21] the_undefined has joined the channel [10:33] rtomayko has joined the channel [10:45] johan-s has joined the channel [11:04] Biscuits has joined the channel [11:16] halorgium: rtomayko: you up? [11:18] halorgium: oh, TODO: cast ;) [11:43] Biscuits: ? [11:52] halorgium: Biscuits: was wondering if he impl'd cast on node-bertrpc [12:30] gwoo_ has joined the channel [12:33] Biscuits: Did anyone get Chrome's Eclipse developer tools to work with Node.js ? [12:33] Biscuits: http://code.google.com/p/chromedevtools/ [12:33] Biscuits: I get it to connect, but nothing useful yet [12:33] Biscuits: :/ [12:34] sudocarl: \away [12:55] saikko has joined the channel [13:12] ryah: Biscuits: no, but would be interesting to hear what you find [13:13] ryah: it's the most advanced v8 debugger [13:22] Biscuits: Meh, I'll have to test it with Chrome first, see if and how that works [13:22] Biscuits: Currently there's a lot of debug output, but nothing remotely useful :/ [13:23] ryah: hm [13:24] ryah: it might default to chrome-debugging instead of v8-only-debugging [13:25] Biscuits: Nah, set it to V8 debugging [13:26] Biscuits: Btw, on a totally different matter, what are your intentions and plans for Win32 compatibility ? [13:34] ryah: going to be compatible [13:35] ryah: would ike to compile on vc [13:35] ryah: might have to settle for mingw [13:35] ryah: but it's going to be a while [13:35] ryah: probably won't happen for 0.2 [13:35] ryah: unless i get some help [13:36] Biscuits: Well, I'd love to help, I'm fairly proficient in Win32 coding, only downside is that I have next to zero knowledge of POSIX stuff :/ [13:37] Biscuits: And I'm not really sure what way you'd like to go. If you'd like to use all Win32 APIs, I'd probably be able to help. Not so sure if you'd like to stick to POSIX wrappers :/ [13:37] ryah: if you're willing to work on it i can provide tech support [13:38] ryah: i have almost no knowledge of win32 stuff - so seems like a good balance ;) [13:39] Biscuits: Hmmm, let me just see if I can get multipart to parse some MIME headers, and after that I'll fire up Visual Studio see how much work it'll be [13:39] ryah: i guess it will be about 40-80 hours of work [13:39] Biscuits: Definitely be willing to put that in :) [13:40] ryah: (for me) [13:40] ryah: but yeah, cool [13:41] ryah: i'm on vacation for the next few days, but after that i'll be around a lot more [13:43] hassox has joined the channel [13:44] Biscuits: Oh btw, a quick architectural question [13:44] Biscuits: let's say I have a function that gets an object [13:44] Biscuits: and it either has to request that object from a file or a stream [13:44] Biscuits: err [13:44] Biscuits: wait [13:44] Biscuits: let's say it has to get it from somewhere else [13:44] Biscuits: so it returns a Promise [13:45] Biscuits: What'd be the best way to cache that? [13:45] Biscuits: A simple returnvalue.emitSuccess won't work because it won't have the listeners attached [13:45] Biscuits: but setTimeout(function() { returnvalue.emitSuccess() },0); doesn't seem right [13:45] Biscuits: What's your view on that ? [13:48] halorgium: Biscuits: are you concerned the callback won't be set in time? [13:49] ryah: Biscuits: that's what i do [13:49] Biscuits: the setTimeout 0? [13:50] malkomalko has joined the channel [13:50] halorgium: ryah: are the callbacks not called even after events are fired? [13:50] Biscuits: halorgium: Nah, setTimeout probably only triggers once all the JS code is run, but it just looks weird. You actually mean something like "do this after all work is complete" but you type "do this in 0 milliseconds" :S [13:51] halorgium: Biscuits: right, schedules it for the next event tick [13:51] ryah: maybe we should alias settimeout 0 as a "nextTick()" function [13:51] halorgium: ACTION notes this is a different approach to EM::Deferrables [13:52] halorgium: yer, that'd be nice [13:52] Biscuits: At least it looks nicer [13:52] malkomalko: morning [13:52] halorgium: what scope does the repl.start(x) run inside? [14:23] CIA-28: node: 03Ryan Dahl 07master * r8a58e83 10/ wscript : Add gnutls version to configure script - http://bit.ly/66lTxx [14:24] Biscuits: Hmm, what's the best way to export only a class from a module ? [14:24] Biscuits: for now I just do function Class(); export.Class=Class; then require("./Class").Class [14:24] Biscuits: Sounds awfully complicated [14:24] Biscuits: don't suppose there's any way to make exports the actual class ? [14:25] ryah: well. sure, i guess - it's an object like anythign else [14:25] ryah: it's just it wont have a constructor really [14:25] ryah: exports.prototype.mymethod = funciton () {} [14:25] ryah: ^-- this should work [14:26] Biscuits: yeah, but that would disallow the new Class(); bit, won't it ? [14:26] ryah: (new require("./Class")).mymethod() [14:27] Biscuits: That'd work :o? [14:27] ryah: i think so [14:28] Biscuits: Shouldn't exports be a function instead of an object to work ? [14:28] ryah: oh yeah, maybe [14:29] ryah: could probably be changed easily src/node.js:419 [14:30] Biscuits: Hmm [14:30] ryah: this.exports = function () {}; [14:30] Biscuits: nah, don't think a change like that would be justified just for that :/ [14:31] ryah_away: later [14:31] Biscuits: later :) [14:31] Biscuits: I'll keep you posted on any win32 stuff I work on [15:13] Connorhd__ has joined the channel [15:26] cmlenz has joined the channel [15:39] malkomalko has joined the channel [15:44] CIA-28: node: 03Ryan Dahl 07master * r38e425d 10/ (doc/api.txt src/node.cc): Add V8 heap info to process.memoryUsage() - http://bit.ly/5Ncm1D [16:32] cloudhead has joined the channel [17:05] softdrink has joined the channel [17:08] soveran has joined the channel [17:16] inimino: Biscuits: there's no such thing as a class ;) [17:16] inimino: Biscuits: but maybe you'll like elliottcable's stuff [17:31] mikekelly: anyone aware of work on a reverse proxy? [17:32] mikekelly: (with node.js) >_> [17:33] ryah_away: mikekelly: what do you mena? [17:33] mikekelly: an HTTP reverse proxy [17:33] ryah: written in node [17:33] ryah: ? [17:33] mikekelly: yeah [17:34] mikekelly: I'm not talking SOAP/ message'y middleware [17:34] mikekelly: just routing requests to other servers from HTTP headers [17:35] hug has joined the channel [17:36] hug: hello [17:37] mikekelly: hi [17:38] mikekelly: ryah: nobody tried yet? [17:39] hug: first: sory but my english is poor [17:39] hug: :( [17:39] hug: someone compile a mongodb drivers on node extension? [17:40] ryah: mikekelly: there is a little example in test/mjsunit/test-http-proxy.js [17:40] ryah: hug: no [17:41] hug: arf :) [17:42] gwoo: ryah you still in CA? [17:42] hug: i am not c++ developer i try to compile http://github.com/erh/mongo-v8-driver [17:43] hug: it 's work for a shell [17:43] hug: but i am a problem to compile it for node [17:44] ryah: gwoo: yeah [17:45] gwoo: ryah: san fran? [17:45] ryah: gwoo: at the moment san diego, monday sf [17:45] gwoo: you gonna swing by LA? [17:45] ryah: no [17:46] gwoo: aww too bad [17:46] ryah: :) [17:46] gwoo: soak up the sun in SD [17:46] ryah: currently raining [17:46] ryah: :) [17:46] gwoo: really? [17:46] gwoo: clear blue skies [17:46] ryah: yeah. sucks. [17:46] gwoo: and im only 2hrs north [17:47] gwoo: i live in venice beach [17:47] gwoo: uh oh that was logged [17:47] ryah: you'll probably have rain later :) [17:47] gwoo: now all the stalkers are gonna find me [17:47] gwoo: don't say that! [17:47] gwoo: i have not seen rain in months :) [17:48] gwoo: ryah: you gonna be giving any talks in SF while you're there? [17:48] ryah: no [17:50] gwoo: btw, nice video from jsconf [17:51] frodenius: hmmmm, meatballs with mustard, what could be better [17:52] ryah: thanks [18:03] okito has joined the channel [18:27] JimBastard has joined the channel [18:27] JimBastard: zzzzz [18:40] bentomas has joined the channel [18:41] JimBastard: so whats the easiest way to pull in an outside resource like an html file and drop its contents into sendBody() [18:41] JimBastard: good morning inimino [18:42] inimino: hey JimBastard [18:42] Nailor: posix.cat [18:42] inimino: ACTION watching ryah's jsconf talk [18:42] JimBastard: looking through POSIX Nailor [18:43] JimBastard: inimino you want to finish up the session.js stuff today? make it a bit more modular and user friendly [18:43] JimBastard: i can help for sure [18:43] JimBastard: im setting up a demo front-end site with sessions [18:43] JimBastard: right now [18:43] JimBastard: using your code [18:44] inimino: sure [18:45] JimBastard: really i think i would want require('./session') and then session object is magically available [18:46] JimBastard: then have the optional ability to set an options hash after require('/session') that will override session settings [18:46] JimBastard: what you think of that? [18:49] inimino: magically available? [18:50] JimBastard: so there is a global object [18:50] JimBastard: "session" [18:50] JimBastard: or i guess "session.data" [18:50] n8o has joined the channel [18:50] JimBastard: so if you assign a variable in some SSJS code such as "session.data.property = foo" then it will be available in that property for the duration of the session [18:52] frodenius: nah, keep to the var session = require('session') pattern please [18:52] JimBastard: why? [18:52] frodenius: global pollution [18:52] inimino: yeah, I don't want to break the module abstraction [18:52] inimino: but I'm not sure I understand what you're asking yet [18:52] JimBastard: well, you'd have to add the require into every single page for sessions to work in them right [18:53] JimBastard: every single js module that is [18:53] frodenius: you have to do that with every module [18:53] JimBastard: i guess that makes sense [18:53] frodenius: think of sys [18:53] JimBastard: so i guess [18:53] JimBastard: thats fine then [18:54] inimino: ok [18:54] JimBastard: i guess maybe encapulate the session handling code a bit [18:55] inimino: you mean the cookie stuff? [18:57] JimBastard: http://boshi.inimino.org/3box/session/demo.js [18:57] JimBastard: the requestHandler [18:58] JimBastard: can we take that code and wrap it in something like onSessionStart() [18:58] JimBastard: and pass it the request [18:58] kriskowal has joined the channel [18:58] inimino: I'm not sure [18:58] inimino: what would onSessionStart do? [19:00] JimBastard: well ideally you want onSessionStart to fire the moment a request comes into your server [19:00] JimBastard: think of the request life cycle [19:01] JimBastard: onApplicationStart, onSessionStart, onRequestStart, onRequest, onRequestEnd, onSessionEnd, onApplicationEnd [19:01] JimBastard: onSessionStart would call - session = sessions.lookupOrCreate(sessionID,options) [19:02] JimBastard: sessionID = sessions.idFromRequest(req) [19:02] JimBastard: and probaly also do some md5 stuff [19:02] JimBastard: and other related stuff [19:02] inimino: ah, ok [19:03] JimBastard: not a major change, just a wrapper for better syntax [19:03] JimBastard: so you could make code easier to read [19:03] inimino: so basically just a wrapper around idFromRequest and lookupOrCreate? [19:03] inimino: yeah, ok [19:06] JimBastard: it would make it pretty clear where the session "started" [19:07] sudoer has joined the channel [19:08] inimino: ACTION finishes watching the video [19:08] inimino: ryah: great talk :) [19:10] inimino: JimBastard: the default session ID should probably be something better, too [19:11] JimBastard: ive got the fingerPrint + MD5 code [19:11] inimino: and it should probably be an option to lookupOrCreate [19:11] JimBastard: i think a UUID is sufficient [19:12] inimino: yeah, just wondering about all that MD5 stuff [19:12] JimBastard: ive got that working [19:12] JimBastard: i can copy pasta ya [19:12] JimBastard: just setup the hook [19:12] JimBastard: make an option of the session [19:12] JimBastard: session.token = "uuid" [19:12] inimino: seems like it should be in a separate library and we should depend on it [19:12] JimBastard: session.token = "id" [19:12] JimBastard: make it a token type [19:12] JimBastard: right? [19:13] JimBastard: so you can extend types and implement your own token code [19:13] JimBastard: SHA, etc [19:13] JimBastard: session.token = "MD5" [19:13] inimino: not sure if I followed that [19:13] inimino: oh, sure [19:13] inimino: yeah, I'm going to put it in the options object instead of on the session, but yeah [19:14] JimBastard: k [19:14] JimBastard: stub out the methods and ill put the code in [19:14] JimBastard: create the fingerPrint [19:14] inimino: you mean "MD5" would be an MD5 string, or the literal string "MD5"? [19:14] JimBastard: well [19:15] JimBastard: you want to create a fingerprint / signature of the request [19:15] JimBastard: so thats the first step [19:16] JimBastard: then you want to implement some unique id based on that [19:16] JimBastard: the unique id could just be an autonumber, and the fingerprint is mostly ignored [19:16] JimBastard: OR you could implement some sort of hashing algo against the fingerprint [19:16] JimBastard: either way, a unique ID is created [19:16] inimino: well, it all depends on what you're doing with the session [19:16] inimino: if you're doing auth with it, and it matters for anything, you have to be careful [19:16] JimBastard: doesnt really matter [19:17] inimino: if not, it can be just about anything [19:17] JimBastard: so its important to help figure out what requests are coming from where [19:17] inimino: what I have now is IP + timestamp which means sessions can be hijacked easily [19:17] JimBastard: thats where most of the session code will be [19:17] JimBastard: well we will MD5 it and salt it [19:18] JimBastard: that will help a bit, then we can re-evaluate and implement better crypto [19:19] inimino: yeah, ok [19:19] JimBastard: through building fingerPrints we can query the session scope based on things like, how many people are connected from this IP address, how many people are connected with the same user_agent [19:19] Nailor: Don't use timestamp as it will collide [19:20] JimBastard: timestamp can be private and ignored maybe, use it for later [19:20] JimBastard: when the session monitor expires it [19:20] inimino: yeah I have some code that uses timestamps already for server-side per-request unique IDs [19:20] inimino: but we only get millisecond precision from JavaScript Date object [19:21] JimBastard: not_a_good_idea [19:21] inimino: I'm worried about collisions [19:21] Nailor: but if you construct the session id from timestamp there's a chance it'll collide [19:21] Nailor: Use random string long enough for the id, no need to worry about collisions [19:22] JimBastard: is there any easy way to query node.js and get all the available modules? [19:22] JimBastard: UUID [19:22] inimino: ACTION would really prefer to shove all the ID generation stuff outside the session module if possible [19:22] inimino: I guess we have Math.random [19:22] JimBastard: did you read what i said inimino? [19:23] JimBastard: use an auto-number by default [19:23] JimBastard: ACTION let people hijack requests [19:23] JimBastard: just start at 0 and auto-increment it until the application dies [19:23] inimino: yeah [19:23] JimBastard: thats fine [19:23] JimBastard: you should build a collision check too, even though it should never happen [19:24] JimBastard: because we will want that anyway [19:24] Nailor: urgh [19:24] inimino: you can't really check for collisions [19:24] Nailor: Unless you have a method of reserving those auto-increasing ids, don't use them, just go with random string or UUID (which technically is just a bit fancier random string) [19:24] inimino: if you knew whether two requests are from the same client without sessions you wouldn't need sessions [19:24] JimBastard: if(typeof session[id] == 'object') [19:25] JimBastard: Nailor, you just increment the id + 1 [19:25] inimino: that's not useful because that's the common case when you get the second request from that client [19:26] JimBastard: should be the same session [19:26] JimBastard: same id [19:26] Nailor: JimBastard: what if you have two clients running? What if the id is in a database that doesn't support auto increment [19:26] inimino: unless you have a request that doesn't have that header set, I guess [19:26] JimBastard: Nailor , its lame as hell its just to get all the other code working [19:26] Nailor: JimBastard: then you would have to implement locks, which eventually would mean deadlocks and all the other crap that comes with locking [19:27] JimBastard: i already have the md5 stuff ready [19:27] Nailor: Yeah but why not to do it right from the start [19:27] ryah: inimino: thanks [19:27] JimBastard: http://github.com/Marak/node_session/blob/master/session.js [19:27] Nailor: instead of using a crappy solution and run in to problems later :p [19:27] JimBastard: because we are writing code and trying to collaborate [19:27] inimino: what about a database? [19:27] JimBastard: what the fuck you doing [19:27] inimino: ryah: I liked the technical stuff at the end, too [19:28] JimBastard: onSessionStart({ip:"127.0.0.1",user_agent:"Mozilla Firedog 1.3.5.6.1.2.3 asb", timestamp: d}); [19:28] inimino: (and now I'm interested to play around with createChildProcess) [19:29] inimino: Nailor: I actually have no idea what the right way is, that's why I kind if want to avoid making decisions on how the session ID is generated [19:29] JimBastard: onSessionStart({id:"1234-5678-9012-3456-7890-1234-5678-9012-3456-7890"}); [19:30] Nailor: inimino: well you can always provide a way to the user to hook a custom session identifier generator, but the default should be a sane, since most people use the default anyway [19:30] inimino: JimBastard: so that is basically leaving it up to the caller to construct the fingerprint? [19:30] inimino: Nailor: agreed [19:31] JimBastard: you could just pass the req instead [19:31] Nailor: inimino: for example you could accept an custom function for session id generation and if it's not set, you could just go with random strings/UUUID [19:31] Nailor: -U [19:31] inimino: so, just a random string by default [19:31] JimBastard: and have the onSessionStart build the fp [19:32] inimino: and if someone wants to use something more fancy, or tie it into their authentication library or whatever, they can pass a custom ID or ID generator into to the options object on the call that creates the session [19:32] inimino: ok, I like that solution [19:32] inimino: keeps things small and avoids an MD5 dependency [19:33] mediacoder: are there things like sessionLifetime and gc considered in some way? :-) [19:33] inimino: that stuff should be options too [19:34] inimino: and serializing sessions to disk, in case anybody cares about persistent sessions across node.js restarts [19:34] inimino: which they probably will if they are doing a shopping cart or something [19:35] frodenius: or for keeping memory usage small [19:35] frodenius: *low [19:35] mediacoder: inimino: i think that should be also optional.. like you could also store sessions to db or memcached [19:35] inimino: frodenius: that too, I guess, if people have huge amounts of stuff in a session [19:36] inimino: mediacoder: yeah, I'm just going to add a serialize() method on the session or something, people can call it if they care [19:36] inimino: should definitely be optional [19:37] mediacoder: so you pass you "storage adapter" as serializer option? or does it just return the serialized session and you take care of storage yourself? [19:37] inimino: and maybe a 'stringify' if they want to stick it in a database as a blob or varchar, but I guess they can just use JSON for that anyway [19:37] JimBastard: storage adapter is an option [19:38] JimBastard: meh i wouldnt worry about that yet inimino [19:38] Nailor: And you could start by writing a simple-ish in memory session handler, just keep the API sane for the future extensions [19:38] inimino: JimBastard: I'm not, just thinking ahead [19:38] Nailor: Though the in-memory sessin handler has some serious drawbacks, like the memory footprint [19:38] inimino: Nailor: yep, that's what we have [19:38] mediacoder: (especially if there is no session gc or the like) [19:39] Nailor: yeah [19:39] inimino: yeah, sessions have serious drawbacks any way you cut them [19:39] inimino: but yeah, session timeouts would be good too [19:40] JimBastard: ryah, is there any easy way to query node.js for all possible system modules [19:41] JimBastard: enumerate things like: sys, posix, http [19:41] Nailor: inimino: And the lifetime support, ie. if lifetime is one hour, the timeout time is pushed an hour to future every time the user visits the site with a valid session [19:42] Nailor: ...and then you need some sort of gc to clean the old sessions every now and then [19:42] inimino: Nailor: yeah [19:42] inimino: yes [19:42] Nailor: as mediacoder stated [19:42] ryah: JimBastard: no [19:44] JimBastard: ryah - k. im just adding some modules to the node_debug so you can debug all the modules easily [19:44] JimBastard: i looked through the v8 docs for debuggings [19:45] JimBastard: still not entirely sure what i would need to do, to implement break points [19:47] ryah: JimBastard: would be cool to have process.memoryUsage() displayed in the debugger [19:47] ryah: maybe a raphaeljs pie chart? [19:47] ryah: that changes in real-time [19:48] mediacoder: long-polling implementation :-) [19:50] JimBastard: yes yes im on it [19:50] JimBastard: i <3 raphael [19:50] JimBastard: im fixing up the bottom right now [19:50] JimBastard: a server status [19:50] JimBastard: where on the UI you think that should go? [19:51] okito has joined the channel [19:51] JimBastard: http://maraksquires.com:1337/ [19:51] JimBastard: ^ debug instance [19:51] ryah: maybe another tab? [19:52] JimBastard: maybe the default tab? [19:54] mediacoder: JimBastard: i think you should a bit change the UI anyways..maybe think about a fixed tab on top or bottom ..that hold buttons, collapsed windows, etc [19:54] mediacoder: maybe some progress indication on long-running tests [19:54] JimBastard: how can i subscribe to an event change on this.process.memoryUsage() [19:55] JimBastard: there are some UI states for busy / waiting [19:55] JimBastard: im working on getting those back in [19:55] JimBastard: the session code needs to be fixed for that to work right [19:55] JimBastard: so im working on a simple front-end application [19:55] mediacoder: JimBastard: ah, ok..i was just surprised, cause i didnt notice i clicked soemethng and some seks later got some output [19:56] JimBastard: yeah, if you run a long test it returns a promise? then the result async loads? [19:56] JimBastard: maybe? its a little bit like magic [19:56] JimBastard: how can i subscribe to an event change on this.process.memoryUsage() [19:56] JimBastard: how can i subscribe to an event change on this.process.memoryUsage() => debug.log(debug.log(this.process.memoryUsage()); [19:57] mediacoder: does it emit events? not sure [19:58] ryah: JimBastard: are you working on this with Connorhd? [19:59] JimBastard: we've been chatting [19:59] JimBastard: this is a fork of his build [19:59] mravaux has joined the channel [20:05] Nailor: inimino: Btw, if you plan to generate uuids, that probably comes handy: http://www.broofa.com/Tools/Math.uuid.js [20:06] inimino: Nailor: ah, I was just about to write that [20:06] JimBastard: why not md5? [20:08] Nailor: It doesn't bring any improvement over version 4 uuid? [20:08] Nailor: Or any other benefits compared to random strings [20:08] Nailor: inimino: that also generates random strings, if the len is given [20:09] inimino: yeah I'm considering just using random strings [20:09] inimino: is there any reason to prefer UUIDs? [20:09] inimino: I should probably read the RFC [20:10] JimBastard: UUIDs are supported data types in a bunch of places [20:10] Nailor: Well, uuid v4 is just a bit fancier way of presenting a random string, but in this case, it really doesn't bring any additional value [20:10] softdrink has joined the channel [20:10] inimino: 128 bits is probably way overkill too [20:11] inimino: 64 bits should be fine [20:11] inimino: anybody know how v8's Math.random() is implemented? [20:13] inimino: ACTION resolves not to worry about it [20:13] mtotheikle has joined the channel [20:13] Nailor: Probably better not to. :p [20:14] ryah: inimino: George Marsaglia's MWC algorithm [20:14] inimino: ryah: ah, cool, thanks [20:19] ryah: inimino: n&sa=N&cd=1&ct=rc#W9JxUuHYyMg/trunk/src/v8.cc&q=RandomPositiveSm package:http://v8\.googlecode\.com&l=153 [20:19] ryah: http://www.google.com/codesearch/p?hl=en&sa=N&cd=1&ct=rc#W9JxUuHYyMg/trunk/src/v8.cc&q=RandomPositiveSm package:http://v8\.googlecode\.com&l=153 [20:20] mtotheikle: hey ryah I was talking to some people about MySQL integration last night and they said you may be working on integration. Is that still the case? [20:20] inimino: ryah: thanks [20:20] ryah: mtotheikle: not yet, but i want to soon [20:21] mtotheikle: Ah okay [20:27] jherdman has joined the channel [20:29] jherdman has left the channel [20:31] jherdman has joined the channel [20:31] jherdman: hi room. i'm having a little difficulty with requiring modules in the node repl. [20:31] ashb: ryah: is libev re-enterant in its ev_loop function? [20:32] jherdman: e.g. given "circle.js", in the node repl, in the same directory as circle.js, `require('./circle')` files [20:32] jherdman: *fails [20:33] ashb: i dont think the repl has its current dir set right. danwrong reported that issue too [20:33] jherdman: ah! thanks ashb [20:41] inimino: interesting, Mozilla's Math.random fills up all 53 bits of the significand with pseudo-random bits, but v8 only uses 32 [20:42] inimino: the spec is vague but it does say "evenly distributed" over the 0-1 range which I'd say probably makes v8 non-conforming [20:48] ryah: ashb: i guess so, if you use EV_MULTIPLICITY=1 [20:57] JimBastard: ugh raphael is being strange and giving me an E is null error [20:57] JimBastard: when trying to load [20:57] JimBastard: hrmm [20:58] n8o has joined the channel [21:09] cmlenz has joined the channel [21:09] jherdman has left the channel [21:37] Connorhd has joined the channel [21:56] zellyn has joined the channel [21:58] zellyn: Just trying out node.js: make errored out with this: http://gist.github.com/244662 [21:58] zellyn: Any ideas? [21:58] ryah: zellyn: what version of python do you have? [21:58] zellyn: Hah. That's probably it. [21:58] zellyn: I'm running leopard. [21:59] ryah: python --version [21:59] zellyn: 2.5.1 [21:59] sudocarl: that should work? [21:59] ryah: hm. should be okay [22:00] ryah: zellyn: which version of node? [22:00] zellyn: Aah. nm http://kourge.net/node/123 [22:00] zellyn: Just pulled from github. [22:01] ryah: node includes scons [22:01] zellyn: Hmm. [22:01] zellyn: I have a very close to vanilla Mac OS Tiger setup. [22:02] ryah: yeah - we should figure out what's causing this error [22:07] zellyn: Looks like there are two jsmin.py files. [22:07] zellyn: One in tools/jsmin.py, one in deps/v8/tools/jsmin.py [22:08] zellyn: One of them has JavaScriptMinifier def in it, the other not. [22:08] zellyn: ugh. s/class/def/ [22:08] zellyn: I mean s/def/class/ [22:08] sudocarl: lol [22:08] zellyn: (Can't type today!) [22:09] sudocarl: looks like the one in node/tools is outdated [22:09] zellyn: Is any of that new, though? [22:09] sudocarl: by 7 years? [22:09] sudocarl: nvm 2 years [22:09] zellyn: (Can't believe I'm the first person to fail ./configure && make on leopard. [22:10] zellyn: Although, all the cool kids might be running Snow Leopard… [22:14] ryah: fixing it [22:14] zellyn: Did you figure out what was wrong? [22:15] zellyn: I must be missing something: I renamed tools/jsmin.py to tools/jsmin.old.py and re-ran make. [22:15] ryah: i've been procrastinating upgrading to the new jsmin.js [22:15] emyller has joined the channel [22:15] ryah: but now i will [22:15] zellyn: Strangely, it broke with the same error: couldn't find jsmin.JavaScriptMinifier — which is weird, since the only jsmin.py left *definitely* has that class in it. [22:16] sudocarl: did you remove jsmin.pyc [22:16] zellyn: Yeah. [22:16] sudocarl: hm weird [22:16] zellyn: I'd have expected an error on "import jsmin"… [22:16] elliottcable: argh [22:17] elliottcable: so, hi all. uh. [22:17] zellyn: …I think I'll have to go spelunking to figure out where the python path is getting set. [22:17] sudocarl: yea that might work [22:17] elliottcable: Node.js is blowing up on some of my source. I’m just getting “Error: (no message),” with no stacktrace or anything at all [22:17] elliottcable: and a failure exit code from the interp [22:17] sudocarl: whats the source? [22:18] elliottcable: http://gist.github.com/244669 [22:18] elliottcable: there’s the code [22:18] elliottcable: there’s two places where it seems to blow up, both marked with FIXME comments [22:18] elliottcable: but I can’t seem to trace the exact call causing the error or anything, I just know those are the codepaths that blow up [22:19] elliottcable: (if you want to try it… set +x, and run `./file.js afile.jess $PWD`. make sure afile.jess exists, content is unimportant) [22:21] zellyn: elliottcable: nevermind. I have an outdated jsmin.py in *my* path, due to it being in django's trunk/lib/jsmin.py [22:21] elliottcable: was that at somebody else? [22:21] zellyn: ugh. s/elliottcable/ryah/ [22:21] elliottcable: (-: [22:21] elliottcable: oh ryah is here! [22:21] elliottcable: what! [22:21] zellyn: Once again, can't type today. [22:21] sudocarl: zellyn, glad you got it resolved [22:21] zellyn: thanks [22:21] sudocarl: elliottcable, there seems to be a couple people who have had trouble with fileio [22:22] sudocarl: elliottcable, its a bit finiky I think [22:22] elliottcable: hm. [22:22] sudocarl: thats a crapload of callbacks :D [22:22] sudocarl: entertaining to read but a bit of a mindfuck [22:23] elliottcable: HAH [22:23] elliottcable: yep. [22:23] sudocarl: have you tried to reproduce the error using the least amount of code possible? [22:23] elliottcable: not really. [22:23] elliottcable: I have internet now d-: [22:23] sudocarl: :) [22:23] sudocarl: might be a good start [22:23] elliottcable: so… thought I’d take advantage of this rarity. [22:23] sudocarl: fair enough [22:23] elliottcable: yeah, but by the time I do that, I won’t have internet any more. [22:24] elliottcable: o I thought I’d jum[ in here and see if anybody had an answer anyway [22:24] elliottcable: damn can’t type [22:24] elliottcable: ACTION is crushed up against his steering wheel with his laptop, not the most compfortable typing position [22:24] zellyn: ACTION hopes his lack of typing skills today is not contagious. [22:24] sudocarl: haha lol really? [22:24] elliottcable: yap. [22:24] sudocarl: wow thats too bad [22:24] halorgium: elliottcable: i hope you're driving too [22:24] sudocarl: get in the passenger seat atleast :) [22:24] sudocarl: haha [22:25] elliottcable: halorgium: not atm [22:25] elliottcable: halorgium: but I’ve been there, several times. [22:25] elliottcable: halorgium: IRC’in while driving == #win [22:25] sudocarl: good channel [22:25] elliottcable: hahaha [22:26] elliottcable: ugh IRC [22:26] halorgium: elliottcable: yer, i usually have it on the passengers seat [22:26] elliottcable: how come you had to come forward in time and steal my hashtagzorz’ syntax! [22:26] elliottcable: ACTION glowers at it [22:26] elliottcable: anyway. [22:26] elliottcable: ryah: well, when you’re around, I’d appreciate a quick glance at that code, to see what known fileio issues might be coming into play /-: [22:27] sudocarl: elliottcable, so I just ran it and I have come up with no errors [22:27] sudocarl: /home/carl/temp $ ./test.js afile.jess $PWD [22:27] sudocarl: -- Arguments: {"0":"afile.jess","1":"/home/carl/temp"} [22:27] sudocarl: -- Determining destination [22:27] sudocarl: -- Destination is not a file [22:27] sudocarl: -- Writing to /home/carl/temp/afile.js [22:28] elliottcable: sudocarl: yeah, I gave a bad example lol [22:28] sudocarl: elliottcable, lol [22:28] elliottcable: sudocarl: *that* path (single file in, single file out) works [22:28] sudocarl: ok [22:28] sudocarl: what doesn't work? [22:28] elliottcable: sudocarl: but if it goes into the stat errBack (i.e. outfile doesn’t exist), or if it tries to recurse (i.e. more than one sourcefile) it blows up [22:28] elliottcable: sudocarl: so try it with ./test.js afile.jess afile.js [22:28] sudocarl: ok [22:28] elliottcable: sudocarl: or ./test.js *.jess $PWD [22:29] sudocarl: interesting... [22:29] elliottcable: yes [22:29] elliottcable: more interesting: [22:29] elliottcable: when you supply more than one file [22:29] elliottcable: the *entire thing* should work exactly the same for the first file [22:29] elliottcable: but instead, you get an error *before it even recurses* [22:29] elliottcable: (i.e. the arguments are never printed for a second call) [22:30] elliottcable: so the first run through fails… if there’s more than one source. And that’s *really* odd. [22:30] elliottcable: oh, and if there’s more than one file… the file.write call shits bricks. [22:30] elliottcable: instead of passing the number of bytes written to the callback… it passes the name of the file [22:30] elliottcable: for instance, uncomment all of that junk, and run it with more than one inputfile [22:31] elliottcable: it’ll spit out something like `Error: Write to destination file partially failed (foo.jess of 4)` [22:31] elliottcable: which means that the `written` vargument contains 'foo.jess' <_< [22:31] sudocarl: brb [22:31] elliottcable: yeah I’m gonna lose WiFi in a minute [22:32] elliottcable: but… if anybody keeps looking at that and gets a solution, ping me in here, or hit me up on Twitter or something. )-: [22:32] elliottcable: I’ll try to narrow it down and come back to give ryah a specific bug report, too. [22:32] sudocarl: back [22:32] sudocarl: oh ok [22:32] sudocarl: cheers [22:34] halorgium: where are the input files for that script? [22:34] sudocarl: they are just empty files [22:34] elliottcable: halorgium: input files are irelevant [22:34] sudocarl: touch jfile.jess [22:34] elliottcable: halorgium: at the moment [22:34] halorgium: elliottcable: oh, in that case ;) [22:34] elliottcable: hah yep [22:36] sudocarl: well it looks like it is blowing the stack [22:37] sudocarl: I got it to recurse and blow the stack with ./test *.jess *PWD [22:37] sudocarl: I got it to recurse and blow the stack with ./test *.jess $PWD ** [22:37] elliottcable: *PWD? o_O [22:37] sudocarl: thats what the "error (no message)" means [22:37] sudocarl: I meant $PWD [22:37] sudocarl: sorry [22:37] elliottcable: blow the stack? you mean the callstack? [22:37] sudocarl: yea [22:37] elliottcable: so it’s just recursing infinitely. [22:37] elliottcable: That’s a relief. [22:37] sudocarl: like recurse forever [22:37] sudocarl: indeed [22:37] elliottcable: that means it’s a problem in my code, not Node.js! [22:38] sudocarl: bingo [22:38] elliottcable: odd though. It’s not recursing on my function endlessly, or else it’d print the arguments each time… (s’why I put that up there) [22:38] sudocarl: I would throw process.mixin(GLOBAL, require('sys')); at the top [22:38] sudocarl: then you can just call debug(string) for debug statements to stdio [22:38] elliottcable: any particular reason? o_O [22:38] sudocarl: or puts for string stmts [22:38] elliottcable: meh [22:38] elliottcable: the sys stuff never worked very well for me /-: [22:39] sudocarl: weird [22:39] elliottcable: correction, it didn’t work any better than JSON.stringify [22:39] sudocarl: in what way? [22:39] sudocarl: what do you mean by not working well? [22:39] elliottcable: if sys.inspect were actually *useful*… I’d be more likely to use it. [22:39] sudocarl: oh, but it works on your system [22:39] elliottcable: as it is, it chokes up in exactly the same ways as JSON.stringify [22:39] sudocarl: oh... [22:39] sudocarl: weird cause it doesn't for me [22:39] elliottcable: yeah, not a bug, just a personal gripe ^_^ [22:39] sudocarl: oh nvm [22:39] elliottcable: try passing it undefined or null or anything other than a nice object [22:40] sudocarl: ah thats true [22:40] elliottcable: when I want to inspect something, the, uh, point of inspecting it, is to figure out *what it is* [22:40] sudocarl: haha [22:40] sudocarl: I opened a bag of worms [22:40] elliottcable: inspect blowing up on me doesn’t help me in that case… which is the case where I would *want to use it*, so… [22:40] elliottcable: yep d-: [22:40] elliottcable: will write my own inspect at some point. [22:40] sudocarl: as for your script... [22:40] elliottcable: probably should have done it before now, given how often I’m printing stuff to test… sigh. [22:40] sudocarl: yea [22:40] halorgium: ACTION notes that elliottcable is quite a passionate coder. read: interesting comments ;) [22:41] elliottcable: no fucking kidding [22:41] sudocarl: halorgium, :D they are great eh? lol [22:41] elliottcable: I’m opnionated all to hell. [22:41] elliottcable: hey halgie, read this: http://github.com/elliottcable/poopy.js/blob/new-acquire/lib/acquire.js [22:41] halorgium: ACTION refactors the code to make it understandable [22:41] elliottcable: hahaha [22:41] elliottcable: I liek mah code )-: [22:42] gwoo has joined the channel [22:44] elliottcable: oh dear [22:44] elliottcable: fucking god. [22:44] elliottcable: I am retarded. [22:44] elliottcable: >_< [22:44] elliottcable: ahahahahahahahahahahahahaha [22:44] elliottcable: ahhahaha. ahha.haha. [22:44] sudocarl: uh you fixed it? [22:44] elliottcable: note to self… don’t fucking use arguments.callee inside anonymous callbacks. [22:45] elliottcable: I keep forgetting that all closures are functions in JS >_< [22:45] elliottcable: so I, for some dumb reason, was simply assuming arguments.callee would fall up to my outer function >_< [22:45] elliottcable: instead my callback is just getting called endlessly <_< [22:45] sudocarl: :D [22:45] sudocarl: yay for simple solutions [22:45] sudocarl: that make you feel like a dumbass [22:45] elliottcable: hahah yes. [22:45] sudocarl: happens to me all the time..... hm... [22:45] elliottcable: hey dude fuck as long as this code works… [22:45] elliottcable: I’m happy. [22:45] elliottcable: I can’t afford to get bogged down in another project. [22:46] sudocarl: sounds like a standard programmer response [22:46] sudocarl: :D [22:46] elliottcable: so I have to power through this idea, and have it *done*, this weekend [22:46] elliottcable: so I can go back to writing what I wrote this to *help* me write. [22:46] sudocarl: haha yay [22:46] elliottcable: anyway thanks y’all. [22:46] sudocarl: cheers! [22:46] elliottcable: halorgie, talk to you later. Interesting to see you in here. [22:46] elliottcable: halorgium: hopin’ you’re gonna love Node.js d-: [22:46] halorgium: elliottcable: hint, a few more functions might help ;) [22:47] elliottcable: oh fuck that. [22:47] elliottcable: d-: [22:47] elliottcable: modularization? code reuse? WAT? [22:47] halorgium: elliottcable: yer, writing ec2 rest wrapper based on elasticfox failcode [22:47] halorgium: need libxml though [22:49] halorgium: so i have a node.js/ruby hybrid ;) [22:49] elliottcable: uhm [22:49] elliottcable: libxmljs? [22:49] elliottcable: I’ve been using it for months, great tool. [22:49] elliottcable: elasticfox? [22:50] elliottcable: and halorgium, if you’re into EC2, you might want to checkout http://github.com/elliottcable/ArchLinux-AMIs [22:50] halorgium: elliottcable: yer, i think we've had that discussion ;) [22:50] halorgium: elliottcable: elasticfox is a firefox plugin wrapping EC2 [22:51] halorgium: elliottcable: twas interesting to integrate ruby with the node.js [22:52] halorgium: but yer, libxmljs is next [22:52] inimino: "firefox plugin wrapping EC2"? [22:52] inimino: what does that even mean? [22:53] halorgium: inimino: a UI for managing EC2 [22:54] inimino: oh ok [22:57] halorgium: inimino: yer, it isn't EC2 on firefox ;) [22:58] inimino: hehe [23:00] inimino: ACTION got sessions working with random strings, now to add expiration [23:00] elliottcable: oi all [23:01] elliottcable: halorgium: hey so where do I know you from? Ruby-something, I assume. [23:01] halorgium: elliottcable: i can't remember [23:04] halorgium: ah, fauna [23:07] elliottcable: ah! [23:07] elliottcable: there we go. [23:08] elliottcable: this internet *seriously* sucks. [23:08] elliottcable: ACTION is tethering over EDGE [23:08] elliottcable: DIEEEEE [23:25] ryah: ACTION massages elliottcable [23:25] ryah: relax [23:35] sudocarl: ryah have you thought about adding a catch to the printing methods in sys to catch if x is undefined? [23:35] sudocarl: also, node.js is amazing thanks for leading the charge!! :) [23:37] erikcorry has joined the channel [23:38] ryah: erikcorry: hey [23:38] erikcorry: Hi [23:39] ryah: sudocarl: i think that was fixed recently [23:39] sudocarl: I have the latest version on gh but I don't see the fix? [23:39] ryah: er.. i guess not [23:40] ryah: ACTION tries to remember where that patch was... [23:40] sudocarl: :) [23:40] ryah: oh i have it locally [23:40] sudocarl: lol [23:40] CIA-28: node: 03Friedemann Altrock 07master * r1107a1b 10/ lib/sys.js : sys.puts should not kill the process when giving it undefined - http://bit.ly/5A51Kz [23:40] ryah: there - is that what you wanted? [23:41] sudocarl: hm does that work? [23:41] sudocarl: I suppose it would [23:41] sudocarl: does write(x) with x = undefined => "undefined"?? [23:42] sudocarl: it gives me a "x is not defined" reference error [23:43] inimino: sudocarl: that's just simple JavaScript [23:44] sudocarl: I was thinking something closer to this:http://gist.github.com/244704 [23:44] sudocarl: inimino, what do you mean? [23:45] inimino: what I mean is [23:45] sudocarl: or even: http://gist.github.com/244704 [23:45] inimino: f(x) will throw an exception if 'x' is not the name of any variable in scope [23:45] inimino: regardless of what you happen to write in the body of f [23:45] sudocarl: ah [23:46] inimino: if you're trying to print something, you should at least know that the variable exists, even if you may not know what value it has [23:46] sudocarl: true [23:47] sudocarl: but if you call debug(y) with y being something you are trying to debug... wouldn't the information DEBUG: undefined be useful or is the exception better? [23:47] sudocarl: I suppose the exception is better because that way you know for sure where the problem is [23:47] ryah: sudocarl: that's what this patch does [23:48] inimino: I think the exception is better, but it doesn't really matter [23:48] sudocarl: Well both the patch and the current version on GH will throw an exception [23:48] sudocarl: er... right? [23:48] ryah: sudocarl: make install [23:48] inimino: you can't implement any other behavior in JavaScript [23:48] inimino: you don't like that, take it up with Brendan Eich ;) [23:48] sudocarl: lol [23:50] Connorhd_ has joined the channel [23:50] sudocarl: ok I suppose that will work a bit better thanks ryah :) [23:50] sudocarl: the exception becomes a bit clearer :) [23:51] ryah: sudocarl: works no, or? [23:51] sudocarl: yea it works [23:51] ryah: s/no/now/ [23:51] sudocarl: :) [23:51] ryah: good