[00:04] jackyyll: what's the best way to check if a file exists with node? [00:05] RayMorgan has joined the channel [00:09] Cainus has joined the channel [00:12] aryounce: jackyyll: path.exists [00:13] aryounce: jackyyll: but you'll have to roll your own synchronous version [00:13] aryounce: jackyyll: or take the one from the src/node.js [00:13] aryounce: file [00:21] jackyyll: yeah it doesn't make sense to me to have an async version of that ... [00:21] jackyyll: dont see the point [00:23] abadr has joined the channel [01:07] _ry: jackyyll: fs.stat [01:11] konobi: jackyyll: depends on how I/O bound your machine is... it may take a very long time to get a response back from the filesystem about wether something exists... time that you app could actually be doing something [01:12] jackyyll: i suppose [01:14] Tim_Smart has joined the channel [01:15] jackyyll: hey tim [01:15] Tim_Smart: yo [01:15] jackyyll: hows it going [01:15] Tim_Smart: Not bad. Have been in the world of Firefox extension development. The side of Javascript that give ehasaches [01:15] Tim_Smart: *headaches [01:16] Tim_Smart: all this stupid scope and security stuff [01:16] jackyyll: lol [01:20] dekz has joined the channel [01:21] brapse has joined the channel [01:26] alisdair has joined the channel [01:27] eelco has joined the channel [01:30] konobi: Tim_Smart: I once had to do a thunderbird extension... _definitely_ not fun [01:30] Tim_Smart: konobi: Yeah, atm I'm working some on greasemonkey [01:31] Tim_Smart: Trying to find some alternate ways of injecting scipts in page land [01:36] aryounce: Just wrote my own .ini parsing function, and then looked in lib/ because of a namespace conflict... doh [01:37] MattJ: Heh [01:38] pavelz has joined the channel [01:38] jacobat has joined the channel [01:38] beppu has joined the channel [01:38] cadorn has joined the channel [01:43] aryounce: On the plus side the included version isn't parsing properly [01:43] aryounce: so maybe it wasn't a waste of time after all [01:43] _ry: aryounce: patch please :) [01:44] aryounce: _ry: Will do :) [01:44] _ry: aryounce: or at add to test/simple/test-ini.js [01:47] bpot has joined the channel [01:55] MattJ: _ry: Have you ever looked at Lua? [01:55] aho has joined the channel [01:55] MattJ: Curious, after hearing you just "need closures" :) [01:59] _ry: MattJ: a bit [01:59] Cainus has joined the channel [02:00] konobi: io language looks kinda interesting too [02:00] _ry: MattJ: javascript has additional benifits (vm arms race, large programmer base) [02:00] MattJ: Yeah, both attractive [02:00] _ry: *benefits [02:00] alisdair: io is really cool, but no one uses it [02:01] MattJ: Still tempted though, if it's not hard, to see if it would be possible to s/V8/Lua/ in Node [02:01] _ry: MattJ: lua comes with some io libraries - which is unfortunate [02:01] _ry: difficult to force people to do non-blocking i/o [02:01] MattJ: Standard library? [02:01] _ry: yeah [02:02] _ry: i guess you could hack it to not expose those [02:02] konobi: _ry: did you see my pull request at all? [02:02] MattJ: Sure [02:02] alisdair: lua's vm is orders of magnitude faster than v8 [02:02] _ry: konobi: yes [02:02] konobi: not sure it's the right approach, but something along those lines might be good [02:02] MattJ: alisdair: That's one reason I'm tempted [02:03] softdrink has joined the channel [02:03] _ry: konobi: what are you trying to do? [02:04] _ry: (with --paths) [02:04] konobi: _ry: be able to ask node itself where it believes it's install prefix and library paths should be [02:05] ditesh|cassini has joined the channel [02:06] _ry: konobi: but why? i ask because i was thinking about adding a "-I" flag (to modify require.paths) and i wodner if that'd help? [02:07] Tim_Smart: konobi: process.installPrefix? [02:07] _ry: i'd also like to add a "-e" flag to execute from the command line [02:07] konobi: Tim_Smart: only available if you have a script to run [02:08] Tim_Smart: Right, I see where you are coming from [02:08] _ry: if that was done "./node -e 'process.stdio.write(process.installPrefix)' would work [02:08] konobi: i'm needing the details for a makefile, for example [02:08] konobi: it would also simplify some of the stuff in node-waf [02:08] konobi: it could just ask node directly instead of doing a lot of legwork [02:09] creationix has joined the channel [02:09] creationix: _ry: how do I create a write-only tcp connection using evcom [02:09] _ry: creationix: write-only? [02:09] creationix: non-duplex [02:09] creationix: or is that possible [02:10] _ry: creationix: the other side has to shutdown [02:10] _ry: afaik [02:10] creationix: so then what is an evcom_writer? [02:10] _ry: it's for pipe() [02:10] abadr has left the channel [02:11] voodootikigod_ has joined the channel [02:11] _ry: creationix: use evcom_stream for tcp [02:11] creationix: ok [02:11] creationix: if I'm only interesting in writing to the tcp socket, do I need to wait for connect before writing [02:12] _ry: konobi: okay [02:13] _ry: i'll merge it after dinner - i maybe combine it with --cflags [02:13] _ry: like ./node --vars [02:13] _ry: or something [02:13] konobi: _ry: perl -V, or the like [02:14] konobi: that's what i was sort of thinking like... but again... may not be the best approach, etc. [02:27] peregrine81 has joined the channel [02:28] unomi has joined the channel [02:41] masuidrive has joined the channel [02:41] binary42 has joined the channel [02:45] BryanWB has joined the channel [02:47] RayMorgan has joined the channel [02:49] BryanWB: I don't know much about messaging systems, but I have been working w/ a rails app that is kluged together [02:49] BryanWB: w/ apache activemq [02:50] BryanWB: are folks in the node community thinking about tools to replace such kluges? [02:53] alisdair: aren't node and messaging systems rather orthagonal? [03:00] BryanWB: alisdair, umm, u could use one pool of node.js servers for handling requests and another for messages [03:00] BryanWB: node.js doesn't only have to be used for handling http requests [03:08] hassox has joined the channel [03:22] BryanWB has joined the channel [03:22] aryounce has joined the channel [03:31] voodootikigod_ has joined the channel [03:33] BryanWB has joined the channel [03:39] voodootikigod_ has joined the channel [03:40] aryounce has joined the channel [03:41] unomi has joined the channel [03:46] dandean has joined the channel [03:48] konobi: _ry: about? [03:57] masuidrive has joined the channel [04:03] aryounce has joined the channel [04:17] isaacs has joined the channel [04:17] rektide: BryanWB: ryah is working on an AMQP client, which is about as pure MQ as it gets. its just a library written in node.js, there's other MQ libraries. [04:26] BryanWB: rektide, neat [04:32] rektide: "good luck" with ActiveMQ [04:35] masuidrive: Yes! I almost coded node-mysql! I'll build real application for testing. [04:35] cedricv has joined the channel [04:37] masuidrive: BTW I found http://github.com/Sannis/node-mysql project name is conflict. maybe users will be confuse. [04:38] masuidrive: I'll change my project name to node-mysql-js or node-mysql-async . Do you have good suggestion? [04:41] PyroPeter has joined the channel [04:45] tlrobinson_ has joined the channel [04:51] steadicat has joined the channel [04:57] kriskowal has joined the channel [05:00] Tim_Smart: _ry: Got around to the registerExtension patch http://github.com/Tim-Smart/node/commit/f9545cc9b9f0d867f22e5b6a593cdbc499614ee2 [05:00] Tim_Smart: Comments / improvements / etc welcome by anyone [05:01] _ry: Tim_Smart: okay - i'll have a look at it tomorrow [05:06] isaacs: hey, this is odd: http://github.com/Tim-Smart/node/commit/f9545cc9b9f0d867f22e5b6a593cdbc499614ee2#L0R524 [05:06] isaacs: i thought it was .node, not .addon [05:07] Tim_Smart: yeah, it was previously in the source :/ [05:07] Tim_Smart: so I left it [05:09] micheil has joined the channel [05:20] gwoo has joined the channel [05:20] creationix has joined the channel [05:21] creationix: _ry: I'm almost done with this silly homework [05:21] creationix: I've got one question [05:21] gwoo has joined the channel [05:21] creationix: how do I pass an arguments to the callback of an ev_timeout [05:22] creationix: I tried enabling nesting functions in gcc, but the closures don't work the same as javascript's [05:23] BryanWB has joined the channel [05:25] Tim_Smart: creationix: I remember using ev_timeout's a little while ago, I'll see if I can find my code on it [05:25] creationix: ok, thanks [05:29] Tim_Smart: creationix: I think I tossed the code, but this was extremely useful http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod#code_ev_timer_code_relative_and_opti [05:29] Tim_Smart: but no doubt you looked there [05:29] creationix: yep [05:30] creationix: I'm so close, but this project is due in 30 minutes [05:30] creationix: all I need is simple closures [05:30] Tim_Smart: from memory, I called a callback from the callback [05:30] Tim_Smart: :p [05:30] creationix: hmm, manual closure type stuff [05:33] Tim_Smart: creationix: Ah, this might help http://github.com/ry/node_postgres/blob/master/binding.cc#L523 [05:33] Tim_Smart: not exactly a timeout callback, but they are structured in a similar fashion [05:34] creationix: I'm using plain C, I'm not if I can use that [05:35] Tim_Smart: Ah right, I'm pretty novice to C and C++, so hopefully someone else can answer in 30 minutes :p [05:37] creationix: here's the relevent snippet [05:37] creationix: http://pastie.org/859089 [05:37] masuidrive has joined the channel [05:42] masuidri_ has joined the channel [05:43] dekz has joined the channel [05:43] _ry: creationix: pack stuff into a struct and set watcher.data [05:43] creationix: watcher.data, awesome [05:44] creationix: I just need an int [05:44] creationix: do you have a quick example [05:45] _ry: mm.. [05:47] _ry: http://github.com/ry/evcom/blob/612fc6227e729d50a7686ff38071e301ad6df770/evcom.c#L996 ? [05:50] _ry: konobi: pon [05:50] _ry: g [05:55] BryanWB has joined the channel [05:56] konobi: _ry: nm... looks like there's no way to doing something along the lines of lwatchFile() [05:58] creationix: _ry: That worked, thanks! [05:59] creationix: git clone http://git.creationix.com/ricart [05:59] creationix: if you want to see my trials and tribulations [05:59] creationix: I haven't slept in 36 hours [05:59] _ry: : [06:00] creationix: the good news is I know a lot more about evcom and libev now [06:00] creationix: so next time I give a talk on node I won't be completely pulling it out of thin air [06:02] _ry: is it working [06:02] _ry: ? [06:03] creationix: it is on my mac, I'm testing on the solaris machine now [06:03] creationix: it takes a while to compile everything [06:05] _ry: creationix: were you supposed to use event loops? [06:05] creationix: it was our option [06:05] creationix: I chose event loops over threads for fun [06:05] Tim_Smart: creationix: What was the project? [06:06] creationix: just a school project to simulate Ricart Agrawala algorithm [06:09] kennethkalmer has joined the channel [06:10] creationix: crap, does sparc have different endieness than osx [06:11] creationix: I'm getting bug errors on every process [06:11] creationix: s/bug/bus/ [06:15] creationix: simulation.c:45: warning: cast to pointer from integer of different size [06:15] creationix: I'll bet that's it, it's using the wrong end of the pointer [06:15] creationix: oh well, off to bed [06:17] _ry: yes [06:20] halorgium: ACTION wonders why people write C without considering endianz [06:24] blastbyte has joined the channel [06:25] creationix: fixed the pointer cast issue, now the tcp connections are being refused [06:25] Tim_Smart: modula is a nice alternative to C as well [06:25] Tim_Smart: You can use C libraries with it also [06:25] creationix: I hear go is pretty nice [06:25] creationix: I wonder if it works with v8 yet [06:26] steadicat has joined the channel [06:31] tlrobinson_ has joined the channel [06:33] BryanWB has joined the channel [06:34] brapse has joined the channel [06:41] bronson has joined the channel [06:52] aguynamedben has joined the channel [06:53] abadr has joined the channel [06:53] abadr: anyone know when net2 is going to be merged? [06:54] r11t has joined the channel [06:56] kennethkalmer has joined the channel [06:56] BryanWB has joined the channel [06:56] kennethkalmer has joined the channel [07:05] tlrobinson_ has joined the channel [07:21] r11t_ has joined the channel [07:27] kriskowal: _ry i'd really like to get the main() decoupled from most of the other stuff in node.cc [07:29] kriskowal: i'm presently doing a manual patch to my copy of it for the narwhal main() [07:31] kriskowal: i'm more than happy to do the work; just need a hint as to what you'd consider merge-worthy. [07:32] michaelk^ has joined the channel [07:32] kriskowal: perhaps break it into node.{h,cc} and node_common.{h,cc}? [07:47] mikeal has joined the channel [07:49] markwubben has joined the channel [07:52] syd_ has joined the channel [07:54] unomi has joined the channel [07:54] unomi has joined the channel [07:54] syd_: http://pastie.org/859187 [07:54] syd_: any idea what might be causing that? [08:06] konobi: why does http server lowercase header names? [08:07] felixge has joined the channel [08:07] felixge has joined the channel [08:10] kjeldahl has joined the channel [08:12] Tim_Smart: syd_: Have you tried re-cloning the latest HEAD? [08:13] syd_: I only pulled for the first time about half an hour ago [08:13] Tim_Smart: hmm ok. What OS you running? [08:13] r11t has joined the channel [08:13] syd_: ubuntu jaunty [08:15] Tim_Smart: konobi: HTTP doesn't explicitly say what casing needs to be used, so it is lower cased for [08:15] Tim_Smart: *so you don't run into surprises I guess [08:16] Tim_Smart: syd_: Hmm ok, I have run node on jaunty before, all I needed was build-essential and node's source [08:16] syd_: strange, I have build-essential in there [08:16] Tim_Smart: so I assume maybe something is gone weird with waf or gcc [08:17] syd_: maybe I'll git revert back a bit and see if it worked at a later point [08:18] Tim_Smart: OK. Give it a shot, otherwise start a thread in the mailing list [08:25] syd_: yeah, no luck. [08:25] syd_: I'll post on the mailing list. [08:27] michaelk^ has joined the channel [08:47] erikvold has joined the channel [08:58] markwubben_ has joined the channel [09:10] pdelgallego has joined the channel [09:11] piranha has joined the channel [09:12] davidjrice has left the channel [09:24] christkv has joined the channel [09:31] rtomayko has joined the channel [10:10] Mandar has joined the channel [10:12] ithinkihaveacat has joined the channel [10:14] felixge has joined the channel [10:14] felixge has joined the channel [10:29] Tim_Smart has left the channel [10:38] spoob has joined the channel [10:53] jed_ has joined the channel [11:28] micheil_mbp has joined the channel [11:32] JonGretar has joined the channel [11:48] rolfb has joined the channel [12:58] alex-desktop has joined the channel [13:03] peregrine81 has joined the channel [13:11] binary42 has joined the channel [13:17] softdrink has joined the channel [13:31] kriszyp has joined the channel [13:33] felixge has joined the channel [13:33] felixge has joined the channel [13:41] cedricv has joined the channel [13:42] peregrine81 has joined the channel [14:01] sztanpet has joined the channel [14:11] n8o has joined the channel [14:12] gwillickers has joined the channel [14:14] davidsklar has joined the channel [14:15] gwillickers has left the channel [14:18] pdelgallego has joined the channel [14:30] steadicat has joined the channel [14:39] cedricv has joined the channel [14:42] gf3 has joined the channel [14:48] mattly has joined the channel [14:48] Booster has joined the channel [14:59] mattly has joined the channel [15:00] MattJ has joined the channel [15:01] alex-desktop has joined the channel [15:26] bronson has joined the channel [15:29] hassox has joined the channel [15:35] dnolen has joined the channel [15:36] binary42 has joined the channel [15:37] binary42 has joined the channel [15:38] dnolen has joined the channel [15:45] steadicat has joined the channel [15:52] aryounce has joined the channel [15:55] cloudhead has joined the channel [15:55] piranha has joined the channel [15:58] around has joined the channel [16:02] cozby has joined the channel [16:06] cozby has joined the channel [16:13] brapse has joined the channel [16:14] alexiskander has joined the channel [16:34] siculars has joined the channel [16:49] mattly has joined the channel [16:51] joshbuddy has joined the channel [16:56] bpot has joined the channel [16:58] kennethkalmer has joined the channel [17:07] RayMorgan has joined the channel [17:07] dnolen has joined the channel [17:12] felixge has joined the channel [17:14] CIA-77: node: 03Ryan Dahl 07master * r209b219 10/ src/node.cc : Add environmental varibles to help text - http://bit.ly/ctQYXS [17:14] CIA-77: node: 03Felix Geisendörfer 07master * rc473915 10/ doc/api.txt : Fix typo in fs.writeStream docs - http://bit.ly/dvuJfX [17:14] CIA-77: node: 03Felix Geisendörfer 07master * r9a9f08b 10/ (4 files in 3 dirs): [17:14] CIA-77: node: Add callbacks to stream methods [17:14] CIA-77: node: Allows for more fine graining, especially finding out about an individual [17:14] CIA-77: node: chunk of data being flushed in a write stream rather than the whole queue. [17:14] CIA-77: node: This commit also fixes a bug causing forceClose to fail on a readStream that [17:14] CIA-77: node: did not finish opening yet. - http://bit.ly/apNaHf [17:14] CIA-77: node: 03Ryan Dahl 07master * r40e42e8 10/ src/node.cc : Replace --cflags with --vars [17:15] mikeal has joined the channel [17:23] aguynamedben has joined the channel [17:29] christkv: felixge: there's a pretty bad bug in the latest v8 you guys merged into master [17:29] christkv: http://code.google.com/p/v8/issues/detail?id=636 [17:30] felixge: christkv: I'd say "pretty weird", not sure what real implication this would have [17:30] christkv: it breaks the mongodb bson serialization [17:30] felixge: christkv: did you experience it in any node code? [17:30] felixge: christkv: fair enough :) [17:31] felixge: Well, usually v8 fixes these things quickly, but _ry could also revert the v8 upgrade [17:31] christkv: felixge: a better explenation http://github.com/christkv/node-mongodb-native/issues#issue/3 [17:31] christkv: felixge: seems to be some sort of bug in the jitter is my thought since adding a "nop" call seems to work around it [17:32] _ry: there's been a few releases [17:32] _ry: i can update [17:32] felixge: _ry: not sure if this would help, seems like the bug has not been specifically adressed [17:32] felixge: does the changelog say anything ? [17:33] _ry: no [17:33] felixge: christkv: do you know which v8 version introduced the bug? [17:34] _ry: but, yeah. i think they'll fix this very quickly if it doesn't match other js engines [17:34] christkv: can't tell you unfortunately. I got it from one of the users. [17:35] christkv: but after 0.1.31 that's for sure [17:35] felixge: christkv: it says you found a workaround right? [17:35] christkv: one I'm not applying lol [17:35] felixge: :) [17:35] christkv: work around is a do nothing operation in the for loop [17:36] felixge: christkv / everybody: We should all "star" the issue so it gets attention from the v8 guys [17:37] christkv: star == add a comment right [17:37] felixge: christkv: no, there is a little star icon on the top left [17:38] christkv: my bad found it [17:38] _ry: felixge: http://github.com/ry/node/issues#issue/75 [17:38] felixge: christkv: you may still want to consider the workaround for the time being [17:39] felixge: _ry: huh, I think he's right. I wonder why this worked locally for me so [17:39] spot__ has joined the channel [17:39] felixge: _ry: fixing it [17:39] jviereck has joined the channel [17:39] felixge: _ry: ah, the test suite exports 'fs' as a global, right? [17:39] felixge: damn, global variables FTL [17:39] jviereck has left the channel [17:40] _ry: felixge: yeah - i suppose that should be fixed [17:40] _ry: i do that all the time [17:40] _ry: fucking javascript [17:40] felixge: _ry: :) [17:41] felixge: _ry: let me fix the test suite, then the bug [17:41] orlandov: amen [17:41] CIA-77: node: 03Ryan Dahl 07master * rc98b079 10/ (46 files in 9 dirs): Upgrade V8 to 2.1.2.6 - http://bit.ly/aSSNkF [17:43] jviereck has joined the channel [17:43] voodootikigod has joined the channel [17:46] around: dont mess around [17:46] around: know when 2 pull out [17:50] _ry: felixge: thanks [17:53] dandean has joined the channel [17:57] qFox has joined the channel [17:57] technoweenie has joined the channel [18:00] felixge: christkv: I think the v8 bug got noticed :) http://code.google.com/p/v8/issues/detail?id=636&colspec=ID%20Type%20Status%20Priority%20Owner%20Summary%20HW%20OS%20Area%20Stars&start=100#makechanges [18:01] unomi has joined the channel [18:02] dnolen has joined the channel [18:07] felixge: _ry: http://github.com/felixge/node/commits/file2 [18:07] piranha has joined the channel [18:08] felixge: _ry: I actually found another semi-bug while doing this [18:08] felixge: http://github.com/felixge/node/commit/10fc429eb63fb84f0a8f118ac5a9d529fddfb20a#L12L2 [18:12] kriszyp has joined the channel [18:15] bronson has joined the channel [18:15] RayMorgan_ has joined the channel [18:18] RayMorgan__ has joined the channel [18:21] paulca has joined the channel [18:22] CIA-77: node: 03Ryan Dahl 07master * re898c1f 10/ (38 files in 5 dirs): Upgrade WAF to 1.5.14 - http://bit.ly/abPlDi [18:23] CIA-77: node: 03Felix Geisendörfer 07master * r44dde5f 10/ (19 files in 2 dirs): [18:23] CIA-77: node: Remove fs/path globals from test suite [18:23] CIA-77: node: It is way too easy to not notice bugs due to those modules being [18:23] CIA-77: node: exported as globals while running the test suite. [18:23] CIA-77: node: See: http://github.com/ry/node/issues#issue/75 - http://bit.ly/bSKXTW [18:23] CIA-77: node: 03Felix Geisendörfer 07master * r3947270 10/ lib/fs.js : [18:23] CIA-77: node: fs.createWriteStream throws fs undefined error [18:23] CIA-77: node: The improved test suite now catches this bug, so hopefully thing like [18:23] CIA-77: node: this will not happen again. [18:23] CIA-77: node: See: http://github.com/ry/node/issues#issue/75 - http://bit.ly/bX6VZN [18:23] _ry: felixge: thanks--^ [18:23] alisdair has joined the channel [18:24] felixge: _ry: np. Makes the tests a little more verbose, but keeps idiots like me from breaking the build unnoticed :) [18:24] _ry: including waf, scons, v8, libev, libeio in node has worked out really well. [18:24] _ry: so nice to know explicitly what code is being run [18:24] felixge: _ry: yeah the build system is very nice : ) [18:24] felixge: also the new test suite is sweet [18:27] JAAulde has joined the channel [18:44] bajeczka has joined the channel [18:54] alisdair has joined the channel [19:08] tlrobinson_ has joined the channel [19:08] tilgovi has joined the channel [19:08] jviereck has joined the channel [19:09] r11t has joined the channel [19:10] javajunky has joined the channel [19:10] javajunky: lo ;) [19:13] isaacs has joined the channel [19:13] CIA-77: node: 03Ryan Dahl 07master * rc9c13e0 10/ test/simple/test-http-tls.js : require('fs') in test-http-tls - http://bit.ly/bSGAFs [19:13] javajunky: Before I embarrass myself by trying to fix it, is process.mixin currently working fully ? ..i.e. I expected the outcome of sys.puts(sys.inspect(process.mixin(true, {b: {foo:"bar"}}, {a: 'x', b: {c:"d"}}) )); to be { b: { foo:"bar", c:"d"}, a:'x'} but I actually get { b: { c:"d"}, a:'x'} [19:13] mikeal has joined the channel [19:14] r11t has joined the channel [19:15] isaacs: javajunky: it doesn't do a deep copy [19:15] isaacs: javajunky: so, the "b" member from the second is overwriting the "b" member on the first [19:16] javajunky: so the first argument 'deep' isn't actually listened to ? [19:17] felixge: _ry: sorry, the tls test doesn't run on my system [19:17] felixge: javajunky: I think this is a bug [19:18] javajunky: I think I can prolly fix it and submit a patch. [19:18] r11t has joined the channel [19:19] felixge: javajunky: sweet : )! Ping me and I'll review [19:20] mikeal has joined the channel [19:27] maritz has joined the channel [19:28] maushu has joined the channel [19:29] sveisvei has joined the channel [19:31] voodootikigod: i'd pay for some action... [19:31] felixge: voodootikigod: what kind of action? :) [19:32] voodootikigod: something better than "ncsa-mosica is on github" [19:33] maushu: Besides require what are the other ways to insert external code? [19:33] isaacs: javajunky: ah, didn't catch that you passed "true" as the first arg. yes, that looks bugish [19:33] felixge: maushu: fs.cat() + process.compile() [19:33] maushu: felixge, thanks. [19:33] felixge: * fs.readFile() [19:34] isaacs: javajunky: hey, btw, i have a feeling that process.mixin could be a lot faster if it used Object.create rather than copying in a for/in loop [19:34] felixge: maushu: check src/node.js for inspiration on rolling your own module system [19:34] malte_ has joined the channel [19:34] felixge: process.mixin = the devil [19:34] felixge: could really need some refactoring badly [19:34] felixge: :) [19:34] javajunky: currently my head is melting ;) [19:34] maushu: Not my own module system, I want to create a (web) manager that allows me to load, unload node programs. [19:34] isaacs: javajunky: something like this: http://gist.github.com/306377 [19:35] isaacs: javajunky: the issue then is that it won't be an "own property" of the target object [19:35] felixge: isaacs: that looks lovely, you should make a patch for node [19:35] felixge: :) [19:35] felixge: and replace mixin [19:35] isaacs: _ry: thoughts? ^ [19:36] javajunky: ;) suits me [19:37] malte_: felixge: How is your work on dirty/.30 coming along? [19:37] felixge: malte_: flush() is a little more difficult to get right than I thought [19:38] malte_: Do you have a branch on github? [19:38] felixge: malte_: but it should be easier now that I got file streams done [19:38] felixge: malte_: no, I could push one so [19:38] malte_: would be cool [19:38] felixge: fuck, open source distracts me from transloadit too much :) [19:38] felixge: anyway, let me spend a dirty hour [19:38] felixge: and see what I can do [19:38] felixge: :) [19:38] felixge: ACTION could need a club mate [19:39] felixge: ACTION got addicted recently [19:39] gwoo: NO [19:39] gwoo: felixge: don't do it [19:39] gwoo: you remember what happend to the last time [19:39] felixge: gwoo: no, was it good? [19:40] gwoo: if you consider 48 coding sessions and 48 sleeping sessions to be a good idea [19:40] gwoo: 48hr [19:40] sxs has joined the channel [19:40] sxs: hello [19:40] sveisvei: felixge: zip it, and work it - i need _dirty_ for dirty app here :P [19:41] felixge: sveisvei: ok, headed out to get a club mate! Let's do some hacking [19:42] sxs: i compiled nodejs on two macs but on the third machine the compile hangs up. no error. all three machines have osx 10.6. how can i debug this? [19:42] gwoo: and you thought felixge was bad after a few beers [19:42] gwoo: wait until the club mate kicks in [19:42] gwoo: :) [19:45] mau has joined the channel [19:49] malte_ has joined the channel [19:49] kjeldahl_ has joined the channel [19:50] charlenopires has joined the channel [19:51] pedrobelo has joined the channel [19:52] joshbuddy has joined the channel [19:52] joshbuddy has joined the channel [19:53] felixge: ok, all fueled up, time to get dirty [19:54] gwoo: oh no [19:54] gwoo: just when the voodootikigod was looking to pay for something [19:55] gwoo: felixge: would there be any benefit to writing dirty in c++ and including it in node as an embedded db? [19:56] JimBastard has joined the channel [19:56] spot__: FYI... http://twitter.com/spotnyk/status/10185260832 [19:56] gwoo: oh [19:56] drostie has joined the channel [19:56] felixge: gwoo: yes, it could be made faster and more memory efficient. But for now that's my lowest priority since it's already "fairly" good in both categories [19:57] gwoo: and i guess it is so easily included that being embedded in node would not be all that advantageous [19:57] felixge: V8 might be getting slower due to rolling some Ecma5 stuff *wild guess* [19:57] voodootikigod: what about me [19:58] felixge: but I'm mean it's only the laws of physics in between google's resources spend on V8 and optimal performance - so I'm not worried in the long run [20:01] isaacs: yikes, there's a continue statement inside a forEach in process.mixin [20:01] isaacs: that's no good [20:02] isaacs: js> f = {foo:"bar"}; g = {f:f}; process.mixin(true, f, g) [20:02] gbot2: isaacs: Error: ReferenceError: process is not defined [20:02] isaacs: (well, it'd throw if you had access to process) [20:02] Guest30751: FIX IIIIIIT [20:02] orlandov: does anyone know if the HTML4 webdatabase query method supports multiple sqlstatements per single call? [20:02] orlandov: s/HTML4/HTML5/ [20:03] orlandov: its not immdediately obvious from the w3 site [20:03] maushu: orlandov, it shouldn't. [20:03] orlandov: kk... i know that sqlite can support that via prepare and step [20:04] orlandov: and tail [20:04] maushu: Technically sqlite has nothing to do with web databases. [20:04] maushu: Thats how some people decided to implement in the back. [20:05] maushu: Chrome also uses sqlite for localStorage. :3 [20:05] orlandov: yeah, that's why i figured it'd be good to ask :) [20:05] malte_: maushu: Its specced as: The same behavior as sqlite that we might eventually document so that there could be other implementations [20:06] maushu: It doesn't say to use sqlite. It just says that it's the same behavior. :p [20:08] javajunky: hey felixge, how'd that gist look to you ? [20:10] felixge: javajunky: could you paste it with a '.diff' filename so github does syntax highlight? [20:12] bpot has joined the channel [20:13] javajunky: is it any better now ? [20:13] mikeal: why not use gist.github ? [20:13] mikeal: there is a drop down [20:14] javajunky: I did ;) [20:15] paulca has joined the channel [20:18] brandon_beacher has joined the channel [20:19] javajunky: i've a patch, hot to trot if thats ok with you felixge (the *limited* existing tests continue to pass) [20:20] felixge: javajunky: the patch looks good to me. But yes, the limited tests on this function are worrying :) [20:20] javajunky: coolI'll submit the patch to the ML :) [20:23] _ry: we have to get rid of process.mixin [20:23] gwoo: yes [20:23] gwoo: :) [20:24] gwoo: felixge: how do you feel about process.mixin? [20:24] _ry: i just copied it in from jquery as a quick hack - now everyone is hacking it [20:24] gwoo: _ry: yeah it's a slippery slope [20:25] _ry: which means it needs to be user-land [20:25] alisdair has joined the channel [20:25] _ry: unfortunately it's a bit difficult to get rid of. [20:25] _ry: the tests use it very much [20:26] felixge: _ry: I think we should provide a good deep copy [20:26] felixge: JS sorely lacks an implementation [20:26] felixge: and everybody kind of wants the same thing, just bug free [20:26] mrd` has joined the channel [20:26] malte_: JSON.parse(JSON.stringify({ deep: { deeper: [1,2,3]}})) [20:27] javajunky: *ironically* thats where I started out 'fixing' my problem this evening... [20:28] _ry: doesn't ES5 have a deep copy? [20:28] _ry: Object.clone or something? [20:28] gwoo: i think so [20:30] _ry: felixge: feel free to help me write http://wiki.github.com/ry/node/gsoc-application [20:30] _ry: felixge: :) [20:30] mrd`: _ry: Can I suggest updating to waf-1.5.14a? It fixes a compatibility bug with older Python versions (e.g., OS X 10.5's). [20:30] _ry: i'll have a look at it tonight [20:30] _ry: mrd`: i just ran into that issue [20:30] felixge: _ry: I was just waiting for their form to become available, wasn't this morning for me [20:31] _ry: (and so did the build bots: http://buildbot.nodejs.org:8010/waterfall [20:31] gwoo: felixge: usually it's around the 13th [20:37] gwoo: _ry: i'll help with the gsoc application if you want [20:38] rictic has joined the channel [20:43] _gcr has joined the channel [20:43] _gcr: Hey guys! I have the worst idea ever! [20:43] _gcr: How's THIS for an anti-templating system? http://dpaste.com/169596/ [20:43] _gcr: Now, somebody convince me not to make that. [20:49] isaacs: _ry: so, i'm looking through this a bit more... deep copy is pretty broken. [20:49] isaacs: there's three things i've found so far that completely hose it. [20:49] Booster has joined the channel [20:49] isaacs: also, the "prevent infinite loop" thing very much does not prevent the infinite loops [20:49] isaacs: and there's a continue inside a closure... ugh. [20:49] isaacs: do the tests really use *deep* copy? or just copying? [20:50] _ry: isaacs: they just copy [20:50] isaacs: _ry: how would you feel about removing the deep functionality? let that live in a module somewhere outside node core [20:50] isaacs: it could simplify the logic quite a lot [20:51] _ry: isaacs: does es5 have any copyin? [20:51] javajunky: arggghh this is turning out badly for me ;) … [20:51] isaacs: _ry: it has Object.create, and with maybe just a few lines, you can do Object.deepCreate [20:51] isaacs: _ry: i think perhaps a good solution is to have a process.deepCopy that makes a deep copy of an object, and process.mixin that just copies properties from source to target shallowly [20:52] _ry: but what if i want to copy require('sys') into global? [20:52] _ry: (my main use-cse for process.mixin) [20:52] isaacs: _ry: well, in that case, you'd do process.mixin(require("sys")) just like before [20:52] isaacs: and it'd do a shallow copy [20:52] isaacs: if you want a deep copy that doesn't share refs, you could do process.mixin(process.deepCopy(require("sys"))) [20:52] _ry: i think i want to remove process.mixin [20:53] isaacs: _ry: what about putting it into the tests/mjsunit/common.js [20:53] maushu: Anyone knows a realtime javascript syntax highlighter in javascript? [20:53] isaacs: node itself doesn't really use mixin anywhere, that i'm aware of. [20:53] _ry: isaacs: there might be a few places [20:53] _ry: yeah that'd work [20:53] isaacs: _ry: i'd volunteer to hunt it down and eradicate. [20:54] _ry: just have common.js copy sys manually into global [20:54] isaacs: _ry: the better solution is to point people to the facilities already available in ES5 and supported by v8 [20:54] isaacs: "process.mixin was removed. please see this gist for how to do it yourself: ..." [20:54] _ry: yeah i think Object.clone can be used in many cases where process.mixin is now [20:54] javajunky: *sob* this is going down as my least successful bug-find&patch cycle ever :( [20:55] isaacs: _ry: sure, or setting __proto__ manually, etc. [20:55] _ry: we're going to have to keep process.mixin for a while and just add a message [20:55] isaacs: javajunky: fwiw, this would've happened eventually, i think. [20:55] _ry: i think many people use process.mixin for options [20:55] _ry: this.options = Object.clone(options); [20:55] isaacs: _ry: (it's Object.create)_ [20:55] _ry: er [20:55] isaacs: also, that's faster anyhow [20:56] _ry: this.options = Object.clone(defaults, options); [20:56] _ry: ^-- is that right? [20:56] _ry: oh [20:56] _ry: create [20:56] isaacs: since it's not iterating over the object, and uses v8's shadow objects [20:56] _ry: :P [20:56] isaacs: _ry: so, the diff there is that process.mixin creates "own" properties, since it's copying over. [20:56] isaacs: _ry: so if you then do Object.getOwnPropertyNames, it'll show the new ones. the __proto__ tree is flattened. [20:57] kjeldahl_: Anybody having any luck with js-haml partials working, for instance the sample_app that comes with the picard framework (load "/partial"). It bombs at my end. [20:57] isaacs: that's convenient for some things, but also slower. [20:57] javajunky: isaacs, that example from before, will that do a deep-clone effectiely anyway ? (I'm fixing someone else' code as it happens… and that job just got work .. [20:57] jspiros has joined the channel [20:57] isaacs: javajunky: according to the docs, yes, what you expected was valid. however, the code wasn't right. [20:57] isaacs: javajunky: it looked like you actually want a deep copy-and-merge [20:59] javajunky: 'deep-merge' it would seem ;) I can just write one I just uess his code was depending on it previously (fwiw its the 'express' framework) [21:00] Tim_Smart has joined the channel [21:00] isaacs: javajunky: sure, that's probably best. [21:00] javajunky: cheers. [21:03] Tim_Smart: _ry: You get around to looking at that registerExtension thing? [21:05] RayMorgan has joined the channel [21:05] jviereck_ has joined the channel [21:07] javajunky: arggg process.mixin is *everywhere* :( [21:08] unomi has joined the channel [21:09] _ry: Tim_Smart: looking at it now [21:10] isaacs: javajunky: yeah, replacing one line of code with 2 all over the place is lame. but process.mixin(true, ...) is really quite rarte. [21:10] isaacs: and that's what's so broken [21:12] felixge: _ry: not perfect yet, but it's a start: http://wiki.github.com/ry/node/gsoc-application [21:14] _ry: felixge: thanks [21:14] _ry: Tim_Smart: this seems kind of complicated [21:15] felixge: _ry: I think the fact that you ported V8 to solaris looks very nice in the project description :) [21:15] _ry: maybe i don't get it [21:15] javajunky: sorry to be so dumb, I get 'deep' is borked, but what are you suggesting I replace http://github.com/visionmedia/express/blob/master/lib/express/core.js#L6 with as an example ? [21:17] _ry: Tim_Smart: i was thinking just a hook directly before process.compile [21:17] _ry: Tim_Smart: seems like it would be 10 line change at most [21:18] _ry: Tim_Smart: also, did you have an evalcx patch? [21:19] Cainus has joined the channel [21:23] Tim_Smart: Tim_Smart: Yeah I did. [21:23] unomi has joined the channel [21:24] indiefan has joined the channel [21:24] Tim_Smart: lolwut, I mentioned myself? _ry: Yeah I did [21:27] Tim_Smart: _ry: The reason I didn't check it before process.compile, is so I could change the way it does things depending if it was require.async or just a normal require [21:29] jfherdman has joined the channel [21:33] maushu: Anyone here used John Resig's microtemplating? [21:35] CIA-77: node: 03Ryan Dahl 07master * r5809483 10/ tools/wafadmin/Tools/config_c.py : Upgrade waf to 1.5.14a - http://bit.ly/buEhRV [21:35] felixge: _ry: do you have any pointers for how big chunks one should send to fs.write() for optimal performance? [21:36] felixge: optimal performance = writing stuff to disk as fast as possible [21:36] felixge: maushu: I have, it's nice [21:36] felixge: maushu: have not used it within node yet if that's what you mean so [21:36] maushu: It destroys the tabs and newlines and I don't know what for. [21:37] maushu: I'm trying to understand all these splits and stuff. [21:37] maushu: str.replace(/[\r\t\n]/g, " ") <- what is this for? What is the problem of \r\t\n? [21:38] felixge: maushu: no idea - the code is quite hackish :) [21:39] maushu: I find it silly. [21:39] maushu: I'm trying to recreate it. [21:40] felixge: Tim_Smart: it seems like you overwrote my node application stuff in the wiki? [21:40] Tim_Smart: >.< [21:40] maushu: Should we get the pitchforks and torches? [21:41] felixge: looks like github does not let me restore it [21:41] felixge: Tim_Smart: can you make sure the old version gets restored? [21:42] Tim_Smart: yup [21:46] marcus__ has joined the channel [21:47] maushu: felixge, I just need to fix the single quote problem and my version should supposedly work without all that anti-space stuff. [21:47] maushu: I still don't see _why_ all that stuff is needed. It's like he found a weird bug or something that I haven't found yet. [21:49] indiefan: maushu: and it isn't unit tested? [21:49] abadr has joined the channel [21:49] abadr: what's the right way to manage db connections? [21:50] maushu: indiefan, I'm unit testing my version. Till now I haven't found anything but I haven't really tried with something really hard. [21:50] Tim_Smart: felixge: That better? :p [21:50] felixge: Tim_Smart: yes! Thanks [21:51] Tim_Smart: The wiki system needs rebase >.> [21:51] Tim_Smart: and conflict warnings [21:52] technoweenie: i dont think the github wiki is stored in git [21:53] jfherdman: i once started to write a wiki with a git backend. it proved kind of awkward [21:53] technoweenie: http://github.com/al3x/git-wiki [21:53] jfherdman: touche ;) [21:53] maushu: Can I replace specific parts in a regex replace instead of the whole regex match? [21:54] indiefan: ([subpattern]), no? [21:54] maushu: indiefan, wat? [21:54] maushu: I'm trying to replace all single quotes between those two "%>" "<%". [21:55] maushu: Something like str.replace(/%>(')*<%/, "\'"); [21:56] indiefan: catch subpatterns in parens then refer to them with backreferences [21:56] maushu: Huh. [21:57] Tim_Smart: `git add --patch` is freaken awesome [21:58] Tim_Smart: You can commit little chunks of changes within a file, and leave the reset unstaged [21:58] Tim_Smart: *rest [21:58] maushu: indiefan, I don't understand, how do I do that with replace? [22:03] indiefan: Not sure what the best way to do it would be, but i'd use a callback. pass it the subpattern and then do an additional replace on that [22:04] indiefan: maushu: here's an example of passing subpattern matches into a callback on replace: http://ejohn.org/blog/search-and-dont-replace/ [22:04] indiefan: of course, you'd return the replacement in your case [22:05] maritz: why not do a global match, go through all matches and add a ' before/after the match? [22:06] maushu: ... [22:07] maritz: ? [22:09] tilgovi has joined the channel [22:12] erikvold has joined the channel [22:13] indiefan: maritz: he wants to add a \ before all single quotes between %> and <%. Is there a global match that would do that? [22:16] maritz: na, sorry. though match did something it doesn't do. stupid me [22:16] maritz: :D [22:16] maritz: *thought [22:16] indiefan: cool. maushu: that callback strategy make sense? [22:17] maushu: It's weird. [22:18] maritz: hm, i can't think of any way this would work. *brainfart* [22:18] maushu: Regex failed me. [22:19] maushu: The humanity. [22:19] maushu: I mean, *cough*, Oh The Humanity! [22:20] maritz: you could take out the entire content in %>content<%, pass it to the callback, and then do the replace in the callback. would that work? :D [22:20] maushu: ...isn't the copy in the callback a copy by value? [22:21] MattJ: Use a closure! [22:21] Tim_Smart: _ry: Braces :p Done, while I was there I did the whole lot, which you might like / not like, not sure [22:21] MattJ: (I've no idea what your problem is, but closures make everything better) [22:21] indiefan: maushu: something like this? http://pastium.org/view/dbeb1b9a0112d8867d8928829b63210f [22:21] maushu: MattJ, it's still a copy by value, a substring of a string if you will. Not the string. [22:22] maushu: Huh, that might work. [22:22] maritz: indiefan: wouldn't you then have %>%><%<%? but else it's exactly what i meant and was just about to gist too :D [22:22] maushu: Actually, if it works like I think it *should* work. Thanks indiefan! [22:23] maritz: ARG, disregard me, i suck cocks [22:24] jfherdman has left the channel [22:24] maushu: Wait, what just happened. [22:24] indiefan: may need to tell the pattern not to be greedy? [22:25] kriskowal has joined the channel [22:25] maushu: At least now I'm on the right path. [22:26] mikeal: isaacs: did you get the hosting worked out for js-registry? [22:27] rolfb has joined the channel [22:30] maritz: maushu indiefan: it needs to be (.*) in the first pattern. :) [22:30] maushu: maritz, yeah, I just found out. [22:30] maushu: Silly bug. [22:30] maritz: not a bug, correct behavious [22:30] maritz: *r [22:34] bpot has joined the channel [22:42] dekz has joined the channel [22:49] maushu: Huh, why is the option "s" not working on regex? [22:53] maushu: ...javascript doesn't have s. [22:53] christkv has joined the channel [22:55] maushu: It seems [\s\S]* works. [23:02] javajunky: quick q re ordering, do 'sequential' calls to fs.write (note not fs.writeSync) ..occur in the order they're called or are there no guarantees? .. currently I have an asyc callback feeding me some data, but was unsure whether I had to call fs.writeSync inside the callback to avoid corrupting the file ? [23:09] dekz has joined the channel [23:10] felixge: club mate session was successful, got the basics of dirty working again on node 0.1.30+ : http://github.com/felixge/node-dirty/tree/v0.2 [23:23] derferman has joined the channel [23:25] dekz has joined the channel [23:26] derferman: Anyone have experience with creating a streaming api with node? [23:27] technoweenie: it shouldnt be that hard should it? just keep the response socket open [23:28] technoweenie: the twitter api periodically sends \n's if there are no tweets [23:28] isaacs: mikeal: re: hosting for js-registry: nope, not yet [23:29] mikeal: ok [23:29] mikeal: I'm going to make some changes [23:29] isaacs: mikeal: i'm playing with it on localhost atm, and i'm gonna probably stick it on registry.izs.me or something soonish [23:29] mikeal: not to what actually goes in to couchdb [23:29] isaacs: mikeal: awesome [23:29] mikeal: but it's going to use the new couchapp stuff that i wrote in node [23:29] isaacs: so the data is still gonna work? [23:29] mikeal: it'll be like 1 file that is 50 lines instead of directories with small files all annoying like it is now [23:29] isaacs: ie, not schema change [23:30] mikeal: there is no schema :) [23:30] isaacs: well, sure [23:30] siculars: so im trying to grok fu.js from http://github.com/ry/node_chat/blob/master/fu.js and it seams that once a static file is loaded via fu.staticHandler() it will not reload until the node process is restarted. i wonder if updating fu.staticHandler to keep an mtime check somewhere could fix that and reload if mtime changes. any thoughts? anyone know where i could thief some code? [23:30] mikeal: the design doc will be identical [23:30] mikeal: just the sync script and the definition that is checked in to source will change [23:30] mikeal: in fact that sync script will go away [23:30] mikeal: instead you'll do [23:30] isaacs: mikeal: well, there IS a schema, like there is such a thing as 7, it's just that the database doesn't know what it is, necessarily [23:30] mikeal: npm install couchapp [23:30] mikeal: couchapp sync app.js [23:30] isaacs: zomgawesome [23:30] isaacs: yay [23:30] mikeal: actually [23:30] mikeal: couchapp —design app.js --sync [23:31] mikeal: and you can do —test to run the tests [23:31] isaacs: mdash? really? [23:31] isaacs: :P [23:31] isaacs: -- ≠ — [23:31] mikeal: adium globs that [23:31] Tim_Smart: technoweenie: Do you think a patch for dynamically adding extra tracking channels for twitter-node is ideal? [23:31] isaacs: colloquy ftw! [23:31] mikeal: that's weird [23:31] mikeal: colloquey is too good at crashing [23:31] technoweenie: extra tracking channels [23:31] Tim_Smart: colloquy :D [23:31] technoweenie: oh so you could have multiple streams open? [23:32] technoweenie: well twitter wont let you have multiple connections, you'd need to use multiple twitter accounts i guess [23:32] Tim_Smart: technoweenie: Well, so you could on-the-fly add an extra user to listen for tweets [23:32] technoweenie: oh so it'd drop and recreate the connenction [23:32] technoweenie: i think that would be cool [23:32] technoweenie: i bet you could just create the new one and i'td automatically drop the first one [23:32] Tim_Smart: technoweenie: Yeah, but it will do it a non-destructive way [23:34] Tim_Smart: technoweenie: I'll look into patching it soon. I will need it later on for a app I'm working on [23:34] maushu: It worked! O_O [23:34] Cainus has joined the channel [23:36] cloudhead has joined the channel [23:37] pedrobel_ has joined the channel [23:38] maushu: Yay! My templater works! ...and it doesn't desorganizes the source code. [23:41] gf3 has joined the channel [23:41] voodootikigod_ has joined the channel [23:41] javajunky has joined the channel [23:44] technoweenie: Tim_Smart: cool, i didnt actually do the app i wrote twitter-node for :) [23:44] indiefan: technoweenie: what was it going to be? [23:44] derferman: so, I have noticed that on the modules, there are three different web sockets implementations on top ob node js. Any idea which one is the best? [23:44] technoweenie: cant tell you [23:44] indiefan: hahaa, fair enough [23:44] technoweenie: ah we had a few ideas, nothing major :) [23:47] mjijackson has joined the channel [23:48] isaacs: mikeal: lmk when you push some changes for js-registry. i gotta run for a bit [23:48] mikeal: will do [23:56] Tim_Smart: derferman: http://github.com/ncr/node.ws.js looks good [23:57] derferman: thanks tim [23:58] Tim_Smart: as for client side, there is a cross browser implementation that falls back to flash somewhere [23:59] derferman: yeah, I have actually used that as well [23:59] derferman: it is just tough deciding on what ws server side module to use, as three are linked