[00:00] walkah has joined the channel [00:00] walkah has joined the channel [00:00] tenumm: bnoordhuis : Ok understood, so that is essentially to support MSFT? Do we gain anything on linux platforms? [00:00] tenumm: bnoordhuis: or its just better way to manage those? [00:01] systemfault has joined the channel [00:01] systemfault has joined the channel [00:01] bnoordhuis: tenumm: gain? not really - the idea is to move the platform-specific code into its own library (libuv) [00:01] bnoordhuis: tenumm: so node can become, er, dumber [00:01] bnoordhuis: tenumm: as in, doesn't have to care about it [00:02] bnoordhuis: tenumm: because platform details tend to creep into higer-level code [00:02] bnoordhuis: *higher [00:02] tenumm: bnoordhuis : ok, makes sense [00:03] tenumm: bnoordhuis: thanks [00:03] infynyxx has left the channel [00:04] tenumm: bnoordhuis: on the side I had one question. Lets say if we run node on separate thread of another process would that interfere with eio or ev? [00:04] theCole has joined the channel [00:05] tenumm: bnoordhuis: is there a way to run node in thread and still expect evything to work as is ? [00:05] bnoordhuis: tenumm: i don't follow - another process? [00:05] tenumm: bnoordhuis: like right now nodejs has to have its own process right ? [00:05] bnoordhuis: tenumm: yes [00:06] tenumm: bnoordhuis: so lets say if we want to run nodejs in separate thread of another process, is that possible? [00:06] tenumm: bnoordhuis: would async call work then ? [00:07] sounko has joined the channel [00:07] bnoordhuis: tenumm: well... [00:07] tenumm: bnoordhuis : sorry if I am asking too dumb question [00:07] bnoordhuis: tenumm: let's just say node wasn't designed with that in mind [00:08] bnoordhuis: tenumm: there was some effort to turn node into a library [00:08] bnoordhuis: tenumm: and to a certain extent you can use it like that [00:08] felixge: SubStack: It's your lib, so any API you like is fine with me : ). What's wrong with adding it to merge() / update() directly so? [00:08] tenumm: bnoordhuis: are there any pointers to that ? [00:09] aurynn has joined the channel [00:09] bnoordhuis: tenumm: no, it's not documented behaviour (or supported behaviour, really) [00:10] aurynn has left the channel [00:10] bnoordhuis: tenumm: but it's very simple at the core: simply call node::Start() from a thread [00:10] walkah has joined the channel [00:11] tenumm: bnoordhuis: ok. I will try that and what if we want to pass v8 context of current process? [00:12] bnoordhuis: tenumm: you're SOL :) [00:12] SubStack: felixge: oh adding it directly is fine too, I just think it would be handy to have both [00:12] felixge: SubStack: SGTM, want me to send a pull? [00:13] tenumm: bnoordhuis: :) [00:13] tenumm: bnoordhuis : I guess I will leave that crazy thought here :) [00:13] tenumm: bnoordhuis : and continue to switch to libuv [00:13] SubStack: felixge: go for it [00:14] tenumm: bnoordhuis : thanks for clarification. [00:14] felixge: SubStack: alright, late here now, so probably tomorrow. See ya on Github :) [00:15] clifton has joined the channel [00:15] bnoordhuis: tenumm: you're welcome - and yeah, that whole 'node as a lib' idea is pretty crazy right now [00:16] wookiehangover has joined the channel [00:16] guidocalvano_ has joined the channel [00:16] xeodox has joined the channel [00:19] quackquack has left the channel [00:19] davve: is there strtok() or simillar to js? [00:20] jesusabdullah: What's strtok? [00:20] jesusabdullah: Sounds like a minor daemon [00:20] jesusabdullah: PRAISE STRTOK [00:20] jesusabdullah: LORD OF CARGO CULT AGILE SOFTWARE PRACTICES [00:20] jesusabdullah: But seriously: What's strtok? [00:20] davve: tokenize a string [00:20] Cleer: String.split() [00:20] davve: like split with a delimiter [00:21] brainproxy: davve: try string.split() [00:21] brainproxy: davve: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/split [00:21] davve: brainproxy: ah. ty [00:22] jesusabdullah: Ah, I see! [00:22] brainproxy: davve: yw [00:22] jesusabdullah: What language are you coming from, davve? ooc? [00:22] davve: ansi c [00:24] cccaldas has joined the channel [00:24] jacobolu_ has joined the channel [00:24] guidocalvano_: what are peoples thoughts on 1 raw v8, 2. v8juice 3. node objectwrap? [00:26] bnoordhuis: guidocalvano_: that's a really open question [00:27] guidocalvano_: yes it is [00:27] guidocalvano_: but what are the first things that pop to mind [00:27] guidocalvano_: are you dutch by the way? [00:28] FireFly|n900 has joined the channel [00:29] guidocalvano_: I am deciding on which I will use [00:29] guidocalvano_: important issues; ease of use [00:29] guidocalvano_: garbage collection [00:29] guidocalvano_: performance [00:30] guidocalvano_: I will use it for creating a node module that's an api on a 3D scene graph [00:31] ngs has joined the channel [00:31] guidocalvano_: bnoordhuis: you seem to have knowledge about it, just posted some criteria I base my choice on [00:32] Aria has joined the channel [00:32] bnoordhuis: guidocalvano_: yes, i'm dutch :) [00:32] mandric has joined the channel [00:32] bnoordhuis: guidocalvano_: speed is important, i take it? [00:32] guidocalvano_: yes [00:32] guidocalvano_: ik ook trouwens [00:32] bnoordhuis: hah, kleine wereld [00:33] guidocalvano_: jottem (: [00:33] bnoordhuis: but let's stick to english [00:33] guidocalvano_: yes [00:33] bnoordhuis: let's see, speed [00:33] bnoordhuis: okay, keep the number of objects down [00:33] guidocalvano_: but speed is not that important as it seems [00:33] zackattack has joined the channel [00:33] jacobolus has joined the channel [00:33] bnoordhuis: okay, what is the critical factor? [00:33] guidocalvano_: you see the call on the scenegraph isnt the costly part [00:34] guidocalvano_: ease of use [00:34] Swimming_bird has joined the channel [00:34] bnoordhuis: oh, that's easy [00:34] guidocalvano_: and particularly garbage collection I imagine [00:34] bnoordhuis: use ObjectWrap [00:35] bnoordhuis: ObjectWrap is easy in that it does almost everything for you [00:35] guidocalvano_: like? [00:35] bnoordhuis: allocate your resources in your constructor, free them in your destructor and you're set [00:35] bnoordhuis: well, making sure the object is destructed, for instance [00:35] bnoordhuis: registering a weak callback with v8 [00:35] guidocalvano_: k [00:36] guidocalvano_: so suppose I only allow creating and destroying scenenodes in js [00:36] bnoordhuis: yes? [00:36] guidocalvano_: and i keep a link in js for every link in the C++ scene graph [00:36] guidocalvano_: then I'm set with gc right? [00:37] guidocalvano_: whenever something must be destroyed it will be destroyed [00:37] bnoordhuis: yep [00:37] bnoordhuis: ObjectWrap will take care of that [00:37] guidocalvano_: is it fast? [00:37] bnoordhuis: another open question :) [00:37] bnoordhuis: it's not as fast as native js [00:37] SubStack: open scene graph bindings for node? [00:37] SubStack: want [00:37] guidocalvano_: ogre3d [00:37] SubStack: oh [00:38] bnoordhuis: the "context switch" (for lack of a better word) from js to c++ is pretty costly [00:38] bnoordhuis: same goes for weak pointers [00:38] guidocalvano_: how come? [00:39] bnoordhuis: ah, those open questions [00:39] smtlaissezfaire has joined the channel [00:39] guidocalvano_: this is not an open question [00:39] bnoordhuis: it's to do with how v8's heap and gc is structured [00:39] guidocalvano_: at all [00:39] guidocalvano_: k [00:39] guidocalvano_: is it something you pay for once? [00:39] bnoordhuis: oh, and the context switch is simply that v8 has to drop all optimizations [00:40] guidocalvano_: but it doesn't have to [00:40] bnoordhuis: well, it's comparable to a syscall on linux [00:40] __directory has joined the channel [00:40] bnoordhuis: the kernel can't make any assumptions on what registers are free to clobber [00:40] guidocalvano_: because it can assume that c++ won't create or destroy objects unless they are created or destroyed in js first [00:40] bnoordhuis: so it has to store them all and restore them later on [00:41] bnoordhuis: bad analogy maybe but you get the point [00:41] guidocalvano_: it can just do anything it wants, and whenever something gets created or destroyed in js, just match it with a call in c++ [00:42] guidocalvano_: is it possible to force v8 to optimize anyway? [00:42] guidocalvano_: does juice allow this? [00:42] bnoordhuis: no (2x) [00:42] bnoordhuis: it's simply how v8 works [00:42] guidocalvano_: k [00:42] mraleph has joined the channel [00:42] guidocalvano_: that sucks [00:42] mustakes has joined the channel [00:42] bnoordhuis: well... it's supposedly getting better [00:43] guidocalvano_: i get the impression that in terms of performance it barely matters which you choose [00:43] guidocalvano_: so the choice boils down to ease of use [00:43] bnoordhuis: yep [00:43] jeedey has joined the channel [00:43] guidocalvano_: so go for objectwrap right? [00:44] bnoordhuis: yes [00:44] guidocalvano_: tnx [00:44] bnoordhuis: my pleasure [00:44] guidocalvano_: (: [00:47] ryan_ has joined the channel [00:47] ajsie has left the channel [00:48] mustakes has joined the channel [00:49] towski has joined the channel [00:49] xeodox has joined the channel [00:52] guidocalvano_: bnoordhuis: but what about v8 juice? [00:52] azeroth_ has joined the channel [00:52] daigo has joined the channel [00:52] guidocalvano_: why not use juice instead of ow [00:52] thalll has joined the channel [00:52] guidocalvano_: juice keeps track of types right? [00:52] jesusabdullah: What is this juice? [00:53] bnoordhuis: guidocalvano_: no opinion, don't know it that well [00:53] guidocalvano_: v8juice is a library that makes binding to v8 easier [00:54] caiges_ has joined the channel [00:55] xandrews has joined the channel [00:55] Brandonn has joined the channel [00:55] jesusabdullah: hmm, I see [00:56] k1ttty has joined the channel [00:57] guidocalvano_: what i understand from the people i just spoke to; [00:58] guidocalvano_: basic v8; poorly documented, hard to debug, bare [00:58] jesusabdullah: bare isn't necessarily bad [00:59] brolin has joined the channel [00:59] guidocalvano_: objectwrap: better cause it facilitates construction of objects and has a callback to the C++ destructor if the js object is garbage collected [00:59] ParadoxQuine has joined the channel [00:59] guidocalvano_: v8juice; best because it also tracks types [01:00] jmoyers: sigh @ names like v8juice [01:00] jmoyers: super easy to google, right? [01:00] jmoyers: WRONG [01:01] ctide: haha [01:01] ctide: yeah, i ran into the same thing [01:03] guidocalvano_: good night everybody o/ [01:06] tilgovi has joined the channel [01:10] kakamba has joined the channel [01:13] theCole has joined the channel [01:13] aurynn has joined the channel [01:13] aurynn has left the channel [01:14] daigo has joined the channel [01:15] neoesque has joined the channel [01:16] boehm has joined the channel [01:16] AvianFlu has joined the channel [01:17] theCole_ has joined the channel [01:17] davve: can someone recommend a good templating module? simple html 4 would be nice. [01:18] ekryski has joined the channel [01:18] davve: or with some ease of use for a html/css lame-o [01:20] TooTallNate: davve: client-side? [01:20] davve: backend [01:21] TooTallNate: I mean, jade isn't straight up html, but that's what we use [01:22] davve: interesting. ty [01:23] xandrews has joined the channel [01:23] necrodearia has joined the channel [01:24] shirro has joined the channel [01:24] jerrysv has joined the channel [01:25] jtsnow has joined the channel [01:27] abraxas has joined the channel [01:29] rfay has joined the channel [01:31] postwait has joined the channel [01:31] towski has joined the channel [01:32] kartmetal: What's the least horrible way of querying a specific DNS server from node? [01:33] seawise has joined the channel [01:35] jameson has joined the channel [01:35] kriskowal has joined the channel [01:35] hybsch has left the channel [01:37] MrTopf has joined the channel [01:37] kriszyp has joined the channel [01:38] bartt has joined the channel [01:40] brolin has joined the channel [01:43] brainproxy: any recs on best/favored static file server available via npm? [01:44] caiges has joined the channel [01:45] sub_pop has joined the channel [01:46] tjholowaychuk has joined the channel [01:46] mustakes has joined the channel [01:48] AvianFlu has joined the channel [01:48] smtlaissezfaire has joined the channel [01:50] ryantm has joined the channel [01:51] maqr has joined the channel [01:52] Robdor_ has joined the channel [01:56] Jakwac_ has joined the channel [01:58] fattytuna has joined the channel [02:01] clifton has joined the channel [02:01] Me1000 has joined the channel [02:02] amerine has joined the channel [02:03] jacobolus has joined the channel [02:04] Wa has joined the channel [02:04] langworthy has joined the channel [02:06] hij1nx has joined the channel [02:08] othiym23 has joined the channel [02:10] pHcF has joined the channel [02:10] skohorn has joined the channel [02:10] supster has joined the channel [02:10] ditesh|cassini has joined the channel [02:11] smtlaissezfaire has joined the channel [02:13] leoju has joined the channel [02:15] theCole_ has joined the channel [02:15] Remoun has joined the channel [02:16] Guest51073 has joined the channel [02:16] Sorella has joined the channel [02:17] Satan_: ACTION wants a sandwich. [02:18] meat_popsicle has joined the channel [02:19] reid has joined the channel [02:20] cachemoney has joined the channel [02:20] Murugaratham has joined the channel [02:22] darshanshankar has joined the channel [02:22] brimster_ has joined the channel [02:24] dexter_e has joined the channel [02:24] context-: brainproxy: nginx [02:24] brainproxy: context-: heh, yeah, that's what I do already [02:25] avalanche123 has joined the channel [02:25] jerrysv: brainproxy: sounds like you have it down [02:25] brainproxy: I'm going to use node-static for something portable in terms of node/npm [02:25] context-: brainproxy: pretty sure most people use connect with its static middleware [02:25] context-: connect/express [02:26] tjholowaychuk: node-static is a little sloppy [02:26] tjholowaychuk: but you can see that for yourself [02:26] brainproxy: yeah, the bar is pretty low for this one; just want to make a bunch of statics available via http under a given path [02:26] tjholowaychuk: https://github.com/cloudhead/node-static/blob/master/lib/node-static.js [02:26] Croms has joined the channel [02:26] zachwe has joined the channel [02:26] Satan_Jobs: ACTION wants node.js to be a DDD. [02:27] Aria: DDD? [02:27] brainproxy: tjholowaychuk: fair enough, but is there a dead simple way to use connect to just serve up static files under a path [02:27] tjholowaychuk: yes [02:27] tjholowaychuk: connect(connect.static(path)).listen() [02:27] tjholowaychuk: less setup than node-static [02:27] brainproxy: not looking for a tutorial, just wondered if someone has a one liner up somewhere [02:27] tjholowaychuk: or [02:27] brainproxy: okay, that wins I suppose :) [02:27] tjholowaychuk: connect().use('/public', connect.static(path)).listen() [02:28] Satan_Jobs: Aria: A Demon **** Devourer [02:29] Satan_Jobs: ACTION wants a mongodb client in node.js now! [02:29] ryan[WIN] has joined the channel [02:29] brainproxy: tjholowaychuk: okay, thanks, I'll experiment with that [02:30] brainproxy: basically, i want to integrate a static file server into platonov's test-run [02:30] tjholowaychuk: no clue what that is [02:31] brainproxy: joose-oriented test anything platform [02:31] brainproxy: nice for cross-environment stuff [02:31] tjholowaychuk: ah cool [02:31] socketio\test\37 has joined the channel [02:31] brainproxy: but browsers need visibility into some files ,and I'm tired of monkeying with vhosts/nginx [02:31] brainproxy: every time I setup a new env [02:32] tjholowaychuk: yeah this would be much easier [02:32] tjholowaychuk: connect has a directory middleware too [02:32] tjholowaychuk: if you need file browsing [02:32] brainproxy: tjholowaychuk: awesome, thanks again [02:34] Jakwac_: Anyone have any experience with LDAP and node? Played with a few modules and couldn't get any of them to work. [02:34] ngs has joined the channel [02:35] hassox has joined the channel [02:37] wookiehangover has joined the channel [02:37] mjijackson: ah! LDAP! [02:37] softdrink has joined the channel [02:38] mjijackson: i remember the good ol' days when i was using an LDAP server. haven't done that in a while, sorry. :) [02:41] seivan has joined the channel [02:43] chorrell has joined the channel [02:46] seivan has joined the channel [02:46] AvianFlu has joined the channel [02:48] KUHRT_ has joined the channel [02:48] bogomips2_ has joined the channel [02:49] bingomanatee has joined the channel [02:50] dexter_e has joined the channel [02:50] bingomanatee: marcello3d, ping [02:50] seivan has joined the channel [02:51] e6nian has joined the channel [02:51] keeto has joined the channel [02:52] kunal has joined the channel [02:53] amerine has joined the channel [02:54] Sorella has joined the channel [02:55] sourcode has joined the channel [02:56] theCole has joined the channel [02:58] clifton has joined the channel [03:01] cbiscardi has joined the channel [03:01] greg has joined the channel [03:02] benjaminRRR has joined the channel [03:03] AvianFlu has joined the channel [03:04] daigo_ has joined the channel [03:04] infynyxx has joined the channel [03:04] Murugaratham has joined the channel [03:05] darshanshankar has joined the channel [03:05] dexter_e: What happens to node if two requests arrive at the same time and one corrupts the thread? [03:06] tjholowaychuk has joined the channel [03:07] ckknight: I wish javascript had a way to do integer division. I dislike having to do x = Math.floor(x / y) [03:07] Aria: dexter_e: "corrupts the thread"? [03:08] dexter_e: yeah throws some weird-runtime exception etc. [03:08] mustakes has joined the channel [03:08] theCole_ has joined the channel [03:08] Aria: Well, if it actually corrupts the process, then ... who knows. [03:08] Murugaratham has joined the channel [03:08] Aria: But node isn't threaded in a way visible to javascript land. [03:09] chrisdickinson: ckknight: x = ~~(x/y) [03:09] rfay has joined the channel [03:09] ckknight: chrisdickinson: yeah, I know that trick, but it's no better, imo [03:09] fattytuna has left the channel [03:10] ckknight: I'd rather be able to do something like x \= y (assuming \ is a made up integer divide operator) [03:10] dexter_e: Threaded systems create a whole new instance of your application for every request, but this ensures a reliable and consistent response to all requests.. How does node do this? [03:10] chrisdickinson: ckknight: or a floordiv operator: "x // y" [03:10] Xano has joined the channel [03:10] ckknight: chrisdickinson: precisely. [03:10] chrisdickinson: well, you know, excepting that // is a comment :\ [03:10] ckknight: yeah [03:10] ckknight: hehe [03:11] clifton has joined the channel [03:12] mbrevoort has joined the channel [03:13] cccaldas has joined the channel [03:17] marcello3d has joined the channel [03:18] colinclark has joined the channel [03:19] Sorella has joined the channel [03:19] Corren has joined the channel [03:20] DTrejo has joined the channel [03:21] sleek has joined the channel [03:21] briznad has joined the channel [03:21] sivy has joined the channel [03:23] tk has joined the channel [03:24] bradleymeck_ has joined the channel [03:25] hassox has joined the channel [03:25] matwill has joined the channel [03:32] malkomalko has joined the channel [03:32] rchavik has joined the channel [03:33] Destos has joined the channel [03:34] jamescarr has joined the channel [03:35] flippyhead has joined the channel [03:35] xeodox has joined the channel [03:35] jamescarr: tjholowaychuk, hey, can you make me a stylus compiler... for java? :-P [03:36] Wa has joined the channel [03:36] tjholowaychuk: pfft :p [03:36] tjholowaychuk: wouldn't count on id :D [03:36] Aria: system.exec('node stylus') [03:36] xeodox_ has joined the channel [03:39] chjj: ew dont get your java on my nodejs [03:39] othiym23 has joined the channel [03:40] dexter_e: From NodeJS.org --> "In future versions, Node will be able to fork new processes" Anyone know when thats hittin? [03:41] JoshC1 has joined the channel [03:42] Nuck: Apparently I yell code in my sleep. [03:42] SubStack: dexter_e: in the meantime you can use one of the fork libs from npm [03:42] Nuck: My brother has informed me that I often yell "semicolon" [03:43] flippyhead has joined the channel [03:43] dexter_e: SubStack: Thanks [03:44] bradleymeck_: dexter_e until what to do on windows is resolved its going to be on hold [03:45] dexter_e: I see [03:45] dexter_e: What happens now if two requests come in at the same time and one of the requests corrupts the process? [03:45] dexter_e: In a threaded system we don't have to worry about that because each request has a new instance of the entire app. [03:46] bradleymeck_: they arent handled in parallel they are done in sequence, if the first corrupts the app your app is bones, happens in threaded apps too [03:47] dexter_e: What if 10 requests come in at the same time? Are they added to some kind of que by node? [03:47] bradleymeck_: basically keep your objects from being shared if they arent finalized, you wont have that problem, do it in both threaded and node and you can save a lot of effort [03:47] Aria: In a queue by the OS, actually. [03:48] bradleymeck_: dexter_e its an event loop so yes [03:48] Aria: And requests don't even come in whole, they connect, send a trickle of data, then get handled, then send a response (usually -- unless you start responding early) [03:48] Aria: So ten requests may be in different states of parse and handling at the same time, and Node alternates when buffers fill or data is available to read. [03:49] dexter_e: I see. Thats great. [03:49] Aria: Yeah. It's well done. [03:49] Aria: And generally, since the app is all-javascript, you can handle errors and maintain state for each request separately if you need it. [03:49] Aria: And it's relatively hard to actually corrupt the process. [03:50] Aria: But it's also possible to have the same chunk of code handle all the requests in a relatively shared fashion. Nothing stops either approach. [03:50] dexter_e: So at this point is it ok to just use node as a basic webserver? [03:50] dexter_e: and just forget nginx and just run your entire site / app through node? [03:50] Aria: You could. nginx is still a bit more efficient, but it's quite possible to go all-node [03:51] tjholowaychuk: yeah we are all-node [03:51] tjholowaychuk: have been for quite a while [03:51] galaxywatcher has joined the channel [03:51] dexter_e: I like the sound of all node [03:51] dexter_e: tjholowaychuk: Are you using haproxy or anything like that? [03:51] gkatsev: all node all the way to the max [03:51] dexter_e: Or just Node on port80 [03:51] tjholowaychuk: nah not right now, our load isn't very high [03:51] tjholowaychuk: 80 [03:51] dexter_e: What about respawning? Upstart ? [03:52] gkatsev: you could iptables 80 to another port so you won't need to run node as root [03:52] tjholowaychuk: or that [03:52] gkatsev: dexter_e: there are node modules like forever and node-daemon to keep it running forever [03:52] tjholowaychuk: dexter_e: cluster [03:52] jamescarr: dexter_e, I use upstart btw [03:52] jamescarr: dexter_e, I have loved it so far [03:52] tjholowaychuk: i dont think forever is meant for managing workers [03:52] jamescarr: my app is always up [03:52] tjholowaychuk: maybe restarting it if master dies [03:53] dexter_e: Yeah I'm on upstart now and it seems to restart it instantly [03:53] jamescarr: heh. I even tricked myself with it... [03:53] gkatsev: yeah [03:53] jamescarr: I couldnt figure out why something wasnt saving... [03:53] tjholowaychuk: dexter_e you may not need it but http://learnboost.github.com/cluster/ [03:53] dexter_e: tjholowaychuk: Thanks [03:53] jamescarr: turned out it was crashing each time on the save [03:54] gkatsev: heh [03:54] akmalfikri has joined the channel [03:54] gkatsev: jamescarr: get node-debug or one of those instead. They keep it running and updated but will print out errors for you. [03:55] malkomalko: hmmm [03:56] akmalfikri: i am doing a site using node.js + express + socket.io with loadbalancers with haproxy [03:56] akmalfikri: I cant seem to find the rgith config for the load balancer [03:56] akmalfikri: right* [03:57] dexter_e: so you've got haproxy on 80 passing things off to multiple instances of node? [03:57] akmalfikri: anybody done this b4? [03:57] mykul has joined the channel [03:58] akmalfikri: well, we only have two instances of node [03:58] jacobolu_ has joined the channel [03:58] akmalfikri: yes, we aer passing port 80 to them [03:58] akmalfikri: but the load balancers are always disconnected with no reason [03:58] malkomalko: has anybody seen a node bug, or can you think of a possible reason that when requiring a module, I'm getting back an empty object? I can't figure it out for the life of me [03:59] Aria: malkomalko: not all modules add to their exports [03:59] gavin_huang has joined the channel [03:59] dexter_e: akmalfikri: I've head about this issue in conjuction with socket.io having something to do with http 1.0 and 1.1 [03:59] jzacsh: hey, any one else have problems with jslint thinking that require() stuff isn't okay? http://dl.dropbox.com/u/128640/scrot.png [03:59] Aria: Requiring an empty file will give you {}, as will an object that never touches module.exports or exports [03:59] benjaminRRR has joined the channel [03:59] malkomalko: File A (which requires B/C) calls File B (which requires C)... in File A .. module C is a function not an empty object, but in File B, module C is an empty object [04:00] malkomalko: module C is module.export = function(){ .. } [04:00] malkomalko: I can't figure out what's happening [04:00] flippyhead has joined the channel [04:00] akmalfikri: dexter_e : yeah, i've heard that also too before, but I didn't understand what's going on with that [04:01] jamescarr: hey, I have an odd request... [04:01] jamescarr: remember that octopus graphic that was on the joyent site during the first node knockout? [04:01] jamescarr: anywhere I could get that to use as a wallpaper? [04:02] Aria: module.exports or module.export? [04:03] flippyhead_ has joined the channel [04:04] dexter_e: akmalfikri: Is haproxy http1.1 capable ? [04:04] malkomalko: hmm [04:04] malkomalko: module.exports [04:05] akmalfikri: yes iinm [04:05] ekryski has joined the channel [04:06] malkomalko: module.exports [04:06] malkomalko: err, sorry that was an accident [04:07] akmalfikri: dexter_e : do u have any good sample config that I can use? [04:08] dexter_e: akmalfikri: yeah I can zap you the one my friend sent me [04:08] eee_c has joined the channel [04:09] seivan has joined the channel [04:10] akmalfikri: yeah cool can email me : akmal@motionworks.com.my [04:10] onr: anyone interested in javascript to standalone executable binary compiler? [04:11] pquerna: onr: you mean as in, compiling in the js to a single binary with node? [04:11] onr: pquerna: node.js app to single binary. compiler wont use node [04:13] newy_ has joined the channel [04:14] dexter_e: akmalfikri: I put it here: http://pastie.org/2181166 [04:14] dexter_e: akmalfikri: haproxy.cfg [04:14] smtlaissezfaire has joined the channel [04:16] levi501d has joined the channel [04:18] ryanj has joined the channel [04:19] clifton has joined the channel [04:20] felipellrocha has joined the channel [04:20] ryah has joined the channel [04:20] sivy has joined the channel [04:21] boehm has joined the channel [04:21] felipellrocha: anyone know of a good tutorial about how to get mustaches and/or weld working with express.js? [04:23] ccarella has joined the channel [04:23] tjholowaychuk: felipellrocha i've never seen anyone use weld but one sec [04:23] hippich has joined the channel [04:23] hippich has joined the channel [04:23] igl1 has joined the channel [04:23] tjholowaychuk: https://github.com/fat/stache [04:24] tjholowaychuk: is from the twitter guys [04:24] tjholowaychuk: wrapping something [04:24] tjholowaychuk: haven't tried it personally [04:24] tjholowaychuk: but i imagine it should work then [04:24] felipellrocha: tjholowaychuk: thz. ima try it :) [04:24] tjholowaychuk: the partials handling for mustache is just fundamentally different [04:24] tjholowaychuk: which makes mustache kinda lame IMO [04:24] tjholowaychuk: but i like aspects of it [04:26] SubStack: express partials are silly! [04:27] tjholowaychuk: what would you prefer? [04:27] tjholowaychuk: (not saying they are perfect i actually want to know) [04:27] tjholowaychuk: but packing partials in the object like mustache [04:27] tjholowaychuk: is really lame [04:27] SubStack: this style is nifty: https://github.com/substack/node-jadeify/blob/master/example/partials/static/main.js [04:28] tjholowaychuk: doesn't really help for server-side partials [04:28] SubStack: it could! [04:29] sivy has joined the channel [04:29] tjholowaychuk: changing some vars [04:29] tjholowaychuk: is not really the same idea [04:29] tjholowaychuk: as a partial [04:29] SubStack: nesting them explicitly [04:29] SubStack: well partials are a silly idea [04:29] jslatts has joined the channel [04:30] hassox has joined the channel [04:30] tjholowaychuk: so you're suggesting one massive template? [04:30] tjholowaychuk: with no organization [04:30] SubStack: strawman! [04:31] SubStack: I'm suggesting even more tiny template files [04:31] SubStack: that is so not obvious with jade/express right now [04:31] meso has joined the channel [04:31] tjholowaychuk: ok, well even then, you need some way to get data to them [04:31] tjholowaychuk: not just static includes [04:31] SubStack: tjholowaychuk: I like nesting them like in that example [04:32] SubStack: msg and body templates [04:32] SubStack: body nested in msg [04:32] tjholowaychuk: :s [04:32] tjholowaychuk: well i mean that's basically what partial() does lol [04:32] SubStack: then just https://github.com/substack/node-jadeify/blob/master/example/partials/views/msg.jade and https://github.com/substack/node-jadeify/blob/master/example/partials/views/body.jade [04:32] tjholowaychuk: it just cuts down boilerplate for the server-side templates [04:32] tjholowaychuk: i wouldnt use jade at all on the client-side [04:33] SubStack: tjholowaychuk: it's really not [04:33] SubStack: tjholowaychuk: too late this is much easier [04:33] tjholowaychuk: lol.. [04:34] tbranyen: i'm like 80% done with my template engine xD [04:34] SubStack: I was tired to using jquery to update the dom everywhere [04:34] tbranyen: writing a parser is semi fun [04:34] tjholowaychuk: im not even sure i want to call this thing im working on a template engine [04:34] tjholowaychuk: it's really not [04:35] aurynn has joined the channel [04:35] tbranyen: tjholowaychuk: https://gist.github.com/994418 my bastard love child of mustache and django templates [04:35] SubStack: I guess partials in express are just really really weird [04:35] SubStack: I don't like them at all [04:35] tjholowaychuk: k, well then dont use them [04:35] SubStack: something about arrays and looping [04:35] dexter_e has joined the channel [04:35] SubStack: but I do like splitting up template files into lots of little files [04:35] rhdoenges has joined the channel [04:36] SubStack: express partials are just a really bizarre way to do that [04:36] tjholowaychuk: passing tons of templates as locals [04:36] tjholowaychuk: is weird to me [04:36] tjholowaychuk: but obviously not everyone is going to love everything about a library [04:36] SubStack: they're just strings [04:36] tjholowaychuk: yeah [04:36] tjholowaychuk: but no one wants to do that all the time [04:36] tjholowaychuk: well 1 person [04:36] dexter_e: Why are the called locals and not just an arbitrary name like the other parameters that can be passed to the render method? [04:37] tjholowaychuk: ? [04:37] tjholowaychuk: what [04:37] dexter_e: I just wonder why that parameter is called "locals" [04:37] tjholowaychuk: it's not [04:37] tjholowaychuk: that's legacy [04:37] tjholowaychuk: res.render(view, { foo: 'bar' }) [04:38] dexter_e: ok :) [04:38] kmiyashiro has joined the channel [04:39] dexter_e: Can EJS templates be composited from lots of little chunks the same way? [04:39] CIA-110: libuv: 03Robert Mustacchi 07master * r341ecab 10/ src/uv-unix.c : Remove extra dereference on hints - http://bit.ly/rayp9v [04:39] CIA-110: libuv: 03Robert Mustacchi 07master * rc946697 10/ src/ev/ev.h : [04:39] CIA-110: libuv: C89 compatibility. [04:39] CIA-110: libuv: This changes the libev constants to be the corresponding negative values. [04:39] CIA-110: libuv: Without this the header file is not valid ISO C 89. This fix makes the uv [04:39] CIA-110: libuv: header compile fine in a simple C 89 program. - http://bit.ly/ozGDdi [04:39] CIA-110: libuv: 03Robert Mustacchi 07master * r7867894 10/ Makefile : Clean target missing prefix for object files - http://bit.ly/qbNCZj [04:39] CIA-110: libuv: 03Robert Mustacchi 07master * r8c00b36 10/ (12 files in 4 dirs): [04:39] CIA-110: libuv: C99 compatibility. [04:39] CIA-110: libuv: Get 99% of the way there for --std=c89 -pedantic for core files. Also cleans [04:39] SubStack: I have run into some stuff I want to do with jade for jadeify that I can't do naively the way it is [04:39] tjholowaychuk: dexter_e: yeah, that's one of the main reasons partial() exists, it will work for pretty much all template engines [04:39] dgathright has joined the channel [04:40] tjholowaychuk: dexter_e the template engines by themselves are just "dumb" and compile a function nothing else [04:40] CIA-110: libuv: up follow up warnings and others in tests. - http://bit.ly/n2OB9c [04:40] tbranyen: tjholowaychuk: j/w do most template engines have express versions or should be simple enough to drop in? [04:40] tbranyen: it be* [04:40] tbranyen: i'll have to investigate [04:40] tjholowaychuk: most just export the .compile() method [04:41] tjholowaychuk: that's all you need to integrate it but take a look at ejs [04:41] scottj has joined the channel [04:41] tbranyen: tjholowaychuk: yeah will do, would be nice to have jquery and express support when i launch it [04:41] dgathright_ has joined the channel [04:41] tjholowaychuk: yeah that would be great i know quite a few people want django-ish stuff [04:42] leoju has joined the channel [04:42] jesusabdullah: tjholowaychuk: Why does express do anything with templates other than pass them off to a template rendering engine? [04:42] scottj: if I've sudo npm installed foo, in a js file what do I have to do beyond require("foo") to load it? [04:42] jesusabdullah: It seems like you should have a total separation of concerns there [04:42] tbranyen: the only thing about django i liked is that there wasn't any weird syntax stuff like {{#whatever}} {{/whatever}} i mean what does that really mean? [04:42] tjholowaychuk: jesusabdullah: unification [04:42] tjholowaychuk: and to support things like view lookup [04:42] tjholowaychuk: which could otherwise not be possible [04:42] jesusabdullah: What do you mean by view lookup? [04:43] jesusabdullah: and unification, for that matter? [04:43] mathec has joined the channel [04:44] SubStack: you can pass a views directory to express [04:44] SubStack: and res.render() will look in it for templates [04:44] dshaw_1 has joined the channel [04:45] devaholic: SubStack what does it do with them at that point? lol [04:45] tjholowaychuk: renders them? [04:45] tjholowaychuk: lol [04:45] devaholic: i use express for partials with EJS [04:45] devaholic: but [04:45] SubStack: devaholic: I have no idea! [04:45] devaholic: which one tj [04:45] SubStack: maybe I would get partials if the docs had an example :p [04:46] jesusabdullah: I can't even really comment on partials in particular in an intelligent manner, since I haven't tried to use them [04:46] jesusabdullah: but I guess I have this feeling that, if I were writing express or something similar [04:46] SubStack: otherwise I'm just going to continue to whip up my hackey work-arounds [04:46] jesusabdullah: that I would try to make the templating engine do as much of the template work as possible [04:47] devaholic: i think mine is probably pretty hackey too [04:47] devaholic: but i might be doing it right, who knows? [04:47] tjholowaychuk: jesusabdullah that's all fine until you have to implement I/O and everything else 5 times for 5 engines [04:47] tjholowaychuk: and have them all behave differently etc [04:48] tjholowaychuk: or be opinionated like django [04:48] tjholowaychuk: and only support one [04:48] sandstrom has joined the channel [04:48] sandstrom has joined the channel [04:48] tjholowaychuk: (afaik) [04:48] jesusabdullah: Well, *you* don't [04:48] felipellrocha: tjholowaychuk: it worked! :) thz! :D u were saying that mustache partials are weird? why do u say so? [04:48] tjholowaychuk: felipellrocha worked? good to know [04:48] jesusabdullah: well [04:48] jesusabdullah: I guess I should say [04:49] felipellrocha: tjholowaychuk: what kind of templating do u use w express? [04:49] tjholowaychuk: i use jade or SS stuff [04:49] jesusabdullah: I would create a minimal interface for template engines, and then write the extra features into jade [04:49] tjholowaychuk: and im working on something better for the CS [04:49] jesusabdullah: and if someone wants to use ejs instead, then they can deal with the fact that ejs doesn't have these features [04:50] tjholowaychuk: :s [04:50] jesusabdullah: for example [04:50] tjholowaychuk: that's kinda lame [04:50] jesusabdullah: Why? [04:50] jesusabdullah: Why is that lame? [04:50] devaholic: ejs is html thats why it should be supported [04:50] Mrfloyd has joined the channel [04:50] onr has left the channel [04:50] devaholic: i love jade, and i used it for a while, but literal HTML is superior, just my .02 [04:50] jesusabdullah: That seems completely reasonable to put the onus of feature-having onto the template engine [04:50] SubStack: I like jade but partials still confuse the fuck out of me [04:51] tjholowaychuk: jesusabdullah partial() is just a function, it's a local like anything else [04:51] unlink has joined the channel [04:51] unlink has joined the channel [04:51] devaholic: i can do partials in ejs with <%- var %> which might not be the right way but whatever [04:51] jesusabdullah: What does that have to do with anything? [04:51] tjholowaychuk: what's confusing about rendering another template [04:51] SubStack: everything [04:51] tjholowaychuk: haha [04:51] brainproxy: tjholowaychuk: does connect's static module support caching [04:51] tjholowaychuk: wow [04:51] SubStack: why is the example so big? [04:51] felipellrocha: devaholic: yeah. i think literal html is as simple as it gets... [04:52] dexter_e: SubStack: Are you passing in the full paths to your partials? [04:52] devaholic: at least i get to write in html, so when i want to do something hackey on that level, i dont have to translate it thrice times to get the result i want [04:52] tjholowaychuk: html is fine, i don't disagree with that, but when you have 200+ templates [04:52] tjholowaychuk: like we do [04:52] tjholowaychuk: it's brutal [04:52] SubStack: tjholowaychuk: also wtf is with res.partial() doing? [04:52] tjholowaychuk: we do all the i18n stuff transparently [04:52] devaholic: i actually found that when you have more than a dozen templates, that is when jade becames the arse [04:52] devaholic: probably just my preference [04:52] SubStack: and why does partial() take a collection anyhow? [04:53] SubStack: I guess I just don't understand why all this stuff is the way it is [04:53] Corren: o/ evening [04:53] tjholowaychuk: that's fine, you're not using it so who cares [04:53] devaholic: wait so why would i want to pass the views directory to res.render() instead of the actual location of the view i want to render? didnt get what you meant by that at all. [04:53] jesusabdullah: I seriously don't understand what a preference for ejs vs. jade, or how important rendering is for a given need, has to do with whether the templating engine or the framework that interfaces with it implements templating features [04:53] SubStack: I might be if I knew how to use it! [04:53] jesusabdullah: and I'm not trying to troll, really! [04:54] Corren: what do you guys use for environment config with node? [04:54] tjholowaychuk: jesusabdullah: it's just a choice, either you attempt to unify, or you dont [04:54] tjholowaychuk: and you duplicate work [04:54] devaholic: ejs for instance does not support partials, jesusabdullah [04:54] Corren: do you use expresses's NODE_ENV value? [04:54] tjholowaychuk: i chose to unifty what i can [04:54] devaholic: so you have to use a higher framework to do it [04:54] jesusabdullah: devaholic: So why is it express's responsibility to implement partials for ejs? [04:54] devaholic: Corren i use redis [04:54] tjholowaychuk: it's just a simple choice, it does not get away from template engines doing whatever they want [04:55] tjholowaychuk: jesusabdullah no... it's a LOCAL [04:55] tjholowaychuk: lol [04:55] tjholowaychuk: a function [04:55] tjholowaychuk: helper [04:55] Corren: how do you find redis tho? is it hardcoded into your js files? [04:55] tjholowaychuk: whatever you want to call it [04:55] CIA-110: libuv: 03Ryan Dahl 07master * r18fa8c0 10/ (include/ev.h src/ev/ev.h): Move ev.h to include/ - http://bit.ly/rlZdo0 [04:55] devaholic: jesusabdullah: it isnt i guess, but you could write your own little functional script to handle partials pretty easily, i think it is a somewhat trivial thing [04:55] jesusabdullah: tjholowaychuk: I *know* it's a function. What does that have to do with anything? [04:55] tjholowaychuk: it has to do with the fact that it's extremely simple [04:55] tjholowaychuk: to provide it to all template engines [04:55] jesusabdullah: It's functionality that shouldn't be express's responsibility [04:56] jesusabdullah: is all I'm saying [04:56] tjholowaychuk: you could say that about anything [04:56] tjholowaychuk: it's just the level of abstraction I chose [04:56] tjholowaychuk: similar things could be said for connect etc [04:56] devaholic: Corren there is a master server that has a list of all current active servers that i make sure doesnt go down, and only servers ever interact with it [04:56] jesusabdullah: Connect sticks to its domain very well. It implements a middleware system, and mostly stays out of the way beyond that [04:56] devaholic: you could probably start just by hard coding yeah [04:56] philtor has joined the channel [04:56] tjholowaychuk: no it doesnt [04:56] tjholowaychuk: it has a router [04:56] tjholowaychuk: haha [04:57] tjholowaychuk: it has lots it does not need [04:57] Corren: but is that master server behind a vip or something? otherwise isn't that a SPOF? [04:57] jesusabdullah: Isn't the router just middleware? [04:57] tjholowaychuk: yeah, but it's tailored to express [04:57] devaholic: it is a SPOF, thats why its only used for config and why i make sure its up [04:57] devaholic: its the only thing that needs to be watched manually in that case [04:57] dguttman has joined the channel [04:57] tjholowaychuk: you could easily think of express the same way, it provides helpers to template engines [04:58] tjholowaychuk: doing less is not always a feature [04:58] cjm has joined the channel [04:58] Corren: I'm pretty sure installing a single redis server to store config info (which incldues the name of redis and riak) is not a smart bet. If that's down your sites down... [04:58] jesusabdullah: but clean separation of concerns is usually a good thing [04:58] htoothrot has joined the channel [04:58] tjholowaychuk: thats *your* definition of clean [04:58] Corren: what about config via static files, does anyone do that? [04:59] jesusabdullah: yessch [04:59] jesusabdullah: whatevs [04:59] devaholic: Corren if your sites down your sites down [04:59] devaholic: there is always going to be a SPOF [04:59] skm has joined the channel [04:59] Corren: there is? [04:59] devaholic: if you dont liek the idea thats perfectly fine, but it works wonders for a distributed system [04:59] jesusabdullah: I don't really want to fight about this, I'm just making my stance, as a sometimes-user, clear. Just feedback, is all. [04:59] Corren: I'm not trying to be argumentative, but I don't really see how there's "always a spof" [05:00] tjholowaychuk: jesusabdullah: no worries, I appreciate the feedback [05:00] devaholic: .. [05:00] tjholowaychuk: but it's something completely optional [05:00] tjholowaychuk: so it wont be going away [05:00] brainproxy: Corren: i guess if you really needed something resilient, you could have your env stuff in static files across servers in multiple datacenters behind round robin dns [05:01] brainproxy: then point your node process at that file when it fires up [05:01] dexter_e: Trying to inject One consistent chunk of HTML into multiple totally unique views... Partials right? [05:01] Corren: that's the direction I was thinking, is there a module already doing that, or should I roll my own (not saying it's all that complicated) [05:02] devaholic: bah [05:02] brainproxy: Corren: I'm not aware of one [05:02] devaholic: no one will answer my qs about res.render() :( [05:02] apejens: can I somehow make a function in a datastructure that replaces itself with the return value, async? [05:03] fangel has joined the channel [05:04] Corren: rgr [05:04] sreeix has joined the channel [05:04] brainproxy: apejens: i think it would be possible [05:04] dexter_e: Single div injected into many unique views. --> res.render( "viewfile" , { div:"fiepath?" } ) [05:04] Corren: judging from your conv on templating, I assume you guys are doing composition in node [05:05] Corren: I went the api route only for node, with all my composition done in the browser with nginx serving static content [05:05] JohnnyL has joined the channel [05:05] JohnnyL: will ms own node.js? [05:06] kmiyashiro: lol wat? [05:06] apejens: brainproxy: any idea how? [05:06] TheJH_ has joined the channel [05:06] JohnnyL: ok [05:07] Corren: JohnnyL: eh? ms? [05:07] nphase has joined the channel [05:08] __directory has joined the channel [05:08] brainproxy: JohnnyL: what are there joyent buyout rumors or something? [05:08] mange has joined the channel [05:09] brainproxy: apejens: thinking .. how is the function being called? [05:09] jacobolus has joined the channel [05:09] apejens: right now I just do: { options: function() { }() } [05:09] apejens: but I can call it later. The thing is it will be doing IO, so I want it async [05:09] apejens: and giving it a callback will be rather cumbersome [05:10] Corren: btw, node.js blog is from wordpress, is it being rendered with node-js ? [05:10] brainproxy: well with Joose it would be easy, not sure if you want to go that route though [05:10] brainproxy: so is the object associated with a constructor? [05:10] apejens: no [05:10] brainproxy: or is this just object literal? [05:10] apejens: literal right now [05:10] apejens: but I can change that [05:10] apejens: that would change what this refers to I presume? [05:11] brainproxy: is the literal assoc'd with a variable definition? [05:11] apejens: its in a module, where I basically replace module.exports with a "object" [05:12] apejens: module.exports = { some: 'options', are: function() {}() } [05:12] aguynamedben has joined the channel [05:12] brainproxy: var x = { are : function() { x.are = ... } } [05:13] aurynn has left the channel [05:13] brainproxy: x.are() [05:13] brainproxy: let me see [05:14] JohnnyL: hm, will microsoft own node.js? [05:14] brainproxy: apejens: that worked for, i did `x.are = 1` [05:14] brainproxy: JohnnyL: what you are you referring to? [05:14] JohnnyL: bradwright: What noun was difficult to parse? [05:14] hassox has joined the channel [05:15] apejens: brainproxy: ahh, nice idea :p [05:15] apejens: brainproxy: thanks! [05:15] JohnnyL: brainproxy: ^ [05:15] brainproxy: JohnnyL: what we're asking is some context for the question .. why is it that ms (microsoft?) might come to own node.js? [05:16] brainproxy: that is what motivates your asking the question? as opposed to asking if Purina will own node.js [05:16] JohnnyL: because it's 1) not patented 2) free to implement 3) free to sell. because of the vaccumm under the windows platform. [05:16] Corren: what's the url for search.npmjs.org's project on github [05:16] Corren: anyone know [05:17] Wa has joined the channel [05:17] TheJH: JohnnyL, about 1) and 2): they'd have to completely reimplement node [05:18] JohnnyL: TheJH. ok. [05:18] JohnnyL: TheJH. and? [05:18] brainproxy: JohnnyL: node.js is under the MIT license [05:18] brainproxy: which is pretty liberal [05:18] brainproxy: the question is really, why would ms fork node.js [05:18] briznad has joined the channel [05:19] TheJH: JohnnyL, about 3): they could sell you one copy (as far as I understand the license), but you could then give it to everyone else, so MS couldn't sell it to others [05:19] TheJH: JohnnyL, and finally, if they fork it, they have to add some value to the program in order to make people prefer their fork [05:19] JohnnyL: TheJH: ok. [05:20] JohnnyL: All they really have to do is port it to their VM. [05:20] apejens: brainproxy: worked like a charm, thanks :) [05:20] brainproxy: apejens: np, glad it worked :D [05:21] dexter_e: How to render partials into a view... render( "view-path" , { chunkOfHtml:"pathToFile"} ) ? [05:21] dexter_e: Or multiple partials into one view ... render( "viewFile" , { chunk:"Path" , chunk2:"path2" } ) ? [05:22] cognominal_ has joined the channel [05:24] devaholic: view-path and viewFile? [05:24] dexter_e: I thought thats what render was expecint [05:24] dexter_e: was a path to a template file [05:24] devaholic: or did you mistype one of those? [05:24] dexter_e: I was just putting arbitrary demo strings in there [05:25] dexter_e: they are meant to represent the path to a template file .. [05:25] devaholic: oh okay, thats the main template [05:25] dexter_e: yeah , I would like to add a div into many different views with partials ... [05:26] dexter_e: but when I pass it in as part of the hash it just renders the paths as strings [05:27] saschagehlich has joined the channel [05:28] dexter_e: render( viewName , { divToAdd:"what-goes-here" } ? [05:28] devaholic: sounds liek a block of html goes there [05:28] dexter_e: yeah a block of html , but how to access that block ? [05:28] devaholic: i think they were just talking about partials a bit ago, if u have been idling, i honestly thought you were answering their earlier question :P [05:29] devaholic: depending what template the block of html is written in [05:30] devaholic: open it and hydrate it and then pass it in as a string? [05:30] Skola has joined the channel [05:30] devaholic: maybe not the best practice but it would undoubtedly work [05:30] dexter_e: You use ejs with <%- var %> right ? [05:30] dexter_e: I'm not sure what hydrate it means :) [05:31] devaholic: i have used a variety but i find that to be pretty simplistic and yes, i do use it [05:31] devaholic: fill in the variables [05:31] felipellrocha: any one here uses less.js for rendering css? im having some issues with @import :\ [05:31] dexter_e: How are you opening the file to pass in? [05:32] devaholic: depends what kind of templating engine you are using [05:32] dexter_e: I'm on JES [05:32] devaholic: use it to render to html [05:32] dexter_e: EJS [05:32] devaholic: well... [05:32] devaholic: you already have the layout.ejs to start with then [05:33] devaholic: somewhere inside layout.ejs you will have <%- body %> [05:36] dexter_e: right , thats perfect, but is it possible to have <%- body -> and then also a <%- newDiv -> and <%- newScriptTag -> [05:36] descipher_ has joined the channel [05:36] dexter_e: Basically just inject more stuff into the view [05:36] blueadept: anyone know of a good curl wrapper for node.js? [05:37] fly-away has joined the channel [05:37] derferman has joined the channel [05:38] Corren: I hate blogs :s [05:38] mjijackson has joined the channel [05:38] CIA-110: libuv: 03Ryan Dahl 07master * r6d8c499 10/ include/uv.h : Don't export the private CPP symbols. - http://bit.ly/oihk7L [05:39] sreeix_ has joined the channel [05:39] devaholic: dex if you want another one besides body? try partial('nameOfViewFile', name); where name is ( i believe) now available in your parent docs as <%- name %> [05:39] devaholic: so yes, just replace name with newDiv [05:40] necrodearia has joined the channel [05:40] dexter_e: dev: so use partial() instead of render ? [05:40] dexter_e: or in the options of render ? [05:41] luke` has joined the channel [05:41] dexter_e: render( 'nameOfViewFile' , { newDiv:partial( 'nameOfPartial', {} } ? [05:42] devaholic: if you need to pass in some data to the partial to hydrate it's variables, pass an object with collection, object, and as params in place of name [05:42] devaholic: it should then be available in the parent, yeah [05:42] devaholic: that line isnt quite right [05:43] devaholic: but i am not entirely sure how the partial gets into the parent either [05:43] devaholic: i think it might just be magic [05:43] dexter_e: render ( 'nameOfView' , { newDiv:partial( 'nameOfPartial' ,{} ) } ); [05:44] dexter_e: Ok I'll try that [05:44] devaholic: no i dont think thats it either, does it work? lol [05:45] dshaw_ has joined the channel [05:45] devaholic: partial('views/newDiv.ejs', { collection: arrayOfvariablesToInsertInPartial, as: newDiv }); [05:45] devaholic: then just use <%- newDiv %> inside whatever you call with res.render() [05:45] boehm has joined the channel [05:45] devaholic: does that make sense? [05:46] necrodearia has joined the channel [05:46] devaholic: let me know if it works out for you, its been a few weeks since ive played around with partials [05:47] vid_ has joined the channel [05:47] devaholic: so im sort of interested now, heh [05:47] sivy has joined the channel [05:47] davidascher has joined the channel [05:47] dexter_e: so basically use the partial function on the view file [05:47] dexter_e: alrighty I'll try that [05:48] davidascher has joined the channel [05:51] SamuraiJack has joined the channel [05:52] akshatj_ has joined the channel [05:52] luke` has joined the channel [05:52] dexter_e: dev: Its still giving me strings in the final result and also omitting the layout file [05:52] DTrejo has joined the channel [05:52] dexter_e: strings = fiel paths and not rendering the actual html [05:53] stephanepayrard_ has joined the channel [05:53] devaholic: can you throw up a gist? [05:53] grekko has joined the channel [05:54] stephank has joined the channel [05:56] alim has joined the channel [05:56] dexter_e: Yes. Check out what I've found too: http://www.wonderlandlabs.com/wll_drupal/node/242 [05:56] dexter_e: it describes the solution you just suggested [05:58] alex__ has left the channel [06:00] dexter_e: dev: I think I've found it: http://stackoverflow.com/questions/5120680/is-it-possible-to-add-multiple-statements-to-a-node-js-ejs-layout [06:02] devaholic: i dont know if thats the same [06:02] devaholic: they are hard coding things in the templates [06:03] sreeix has joined the channel [06:04] muhqu has joined the channel [06:04] cha0s has joined the channel [06:04] cha0s has joined the channel [06:05] leoju has joined the channel [06:10] dgathright has joined the channel [06:11] dexter_e: Yeah I modified this example a bit and now I do render( viewFile , { header:"partialPath1" , script:"partialPath2" , div:"partialPath2"} ); and in your views just <%- partial( div ) %> <%- partial( script ) -> [06:11] devaholic: aye [06:12] devaholic: can you do everything the same but the call to partial on the server, now? [06:12] devaholic: or is that not the way it was meant to be used [06:12] devaholic: it thought it was but i could be wrong [06:12] devaholic: i* [06:12] dexter_e: What do you mean on the server? [06:13] dexter_e: the only thing that feels weird is putting the partial() function call inside the views [06:13] daigo has joined the channel [06:13] devaholic: err [06:13] devaholic: :) [06:13] dexter_e: but its ok until I find a cleaner way [06:13] devaholic: like not in your tempalte file, but in your express route :) [06:14] azeroth_ has joined the channel [06:14] devaholic: yea exactly [06:14] Dulak: um on the new node at the repl how do you send a hard return? [06:14] devaholic: can u just call partial with the path name passed in right before you do res.render and pass the return value in as a string [06:15] dexter_e: Yeah that makes sense to me too , but it throws exception when partial function is passed inside the option hash. [06:15] Dulak: even single lines are giving me ... instead of a hard return [06:15] jvduf has joined the channel [06:15] devaholic: how about var var newDiv = partial('pathtopartial'); and then just pass in newDiv which would at the point be a string of HTML [06:16] DTrejo has joined the channel [06:16] devaholic: that keeps the templates clean [06:16] CrypticSwarm has joined the channel [06:16] SubStack: devaholic: I know right? [06:16] SubStack: that's what jadeify does [06:16] devaholic: whatta you know [06:16] SubStack: but it's just for browser-side rendering [06:17] fizx has joined the channel [06:17] devaholic: i gave up on jade [06:17] briznad has joined the channel [06:18] dexter_e: Yeah me too [06:18] tdegrunt has joined the channel [06:19] dexter_e: The concept of jade is cool but it seems to introduce too many new jade specific syntax requirements [06:19] hij1nx has joined the channel [06:19] dexter_e: I want to move closer and closer to single platform and not towards lots of specialized DSLs for specific tasks [06:20] amerine has joined the channel [06:20] ParadoxQuine has joined the channel [06:20] dexter_e: Ideally pure javascript for everything [06:21] dexter_e: Browser: Javascript , Server:Javascript, Templates:Javascript, Server Config files: Javascript [06:21] devaholic: i'm pretty sure what i said earlier would work without having to make any function calls inside an ejs template [06:21] benjaminRRR has joined the channel [06:22] devaholic: also database is javascript :P [06:22] dexter_e: devaholic: I'm pretty sure you did too. It is in fact exactly what you said. :) [06:22] dexter_e: and yes database is javsscript too [06:23] petrjanda has joined the channel [06:24] dexter_e: and JSONCSS instead of CSS [06:24] chrischris has joined the channel [06:24] dexter_e: so basically everything = javascript [06:25] dexter_e: Originally I thought JSDOM was a better way to go than EJS but I got scared when people said it was slow. [06:25] kbni has joined the channel [06:26] dexter_e: with JSDOM you don't have to put any funky <%- %> in your templates at all [06:26] seivan has joined the channel [06:27] devaholic: ehh i dont mind them [06:27] devaholic: you can always change it to curly braces too [06:28] devaholic: i like the idea of jade not having to have that, and really liked the idea of it being aware of indentation [06:30] devaholic: but its sort of like coffeescript in that you are getting away from true control [06:30] jkridner has joined the channel [06:31] grekko has joined the channel [06:33] fangel has joined the channel [06:34] Wa has joined the channel [06:35] benjaminRRR has joined the channel [06:36] `3rdEden has joined the channel [06:37] gregoryigelmund has joined the channel [06:39] seivan has joined the channel [06:40] gregoryigelmun has joined the channel [06:42] dgathright has joined the channel [06:43] grekko has joined the channel [06:43] adrianmg has joined the channel [06:45] groom has joined the channel [06:45] admc has joined the channel [06:46] davidbanham has joined the channel [06:47] pigmej has joined the channel [06:48] topaxi has joined the channel [06:48] Skola: what control are you giving up? [06:48] tdegrunt has joined the channel [06:49] TheJH: Skola, e.g. "my function only returns stuff when I want it to do it" - can be bad if you have a huge loop at the end of a function [06:50] patzak has joined the channel [06:51] Skola: but then you can explicitely return something right? [06:51] davidbanham: I'm having issues handling multiple deletions in node-mysql. I think I'm failing on the mySQL syntax. Can someone please have a look? http://pastebin.com/FfDBWDwD [06:51] TheJH: Skola, yes, a `return` at the end prevents that, but still... [06:51] davidbanham: At the moment that handles the deletion of one record fine, but chokes if I pass it more than one item in req.body.ips [06:52] sandstrom has joined the channel [06:52] seivan has joined the channel [06:53] TheJH: davidbanham, DELETE with a SET? don't you need a WHERE? (warning: I'm an SQL noob) [06:53] JoshC1 has joined the channel [06:53] dguttman has joined the channel [06:56] CIA-110: libuv: 03Robert Mustacchi 07master * r8287551 10/ (include/ev.h src/uv-sunos.c src/uv-unix.c): Fix SunOS build - http://bit.ly/rqAFX6 [06:56] CIA-110: libuv: 03Robert Mustacchi 07master * ree599ec 10/ (config-unix.mk include/ares.h): Fix Linux build - http://bit.ly/nZArRb [06:58] davidban_ has joined the channel [06:58] saurabhverma has joined the channel [06:59] Dulak: anyone having problems with cradle? [06:59] Dulak: cradle methods don't return anything at all, run from the repl or a script [07:00] davidban_: TheJH: You're correct, sorry. That paste was actually a failed experiment rather than working code. The implementation that works with a single record is: http://pastebin.com/pcWXgpva [07:01] davidban_: Any ideas on how to make it work for multiple records? I know I could loop for each item in the array and do a new client.query for each one but it just doesn't seem like the Right Way. [07:01] pigmej: Dulak: you need callbacks :) [07:01] pigmej: they will not return anything:) [07:01] pigmej: but cradle is 'broken' generally ;) [07:02] Dulak: some of them don't require a callback, they just return, like .databases() [07:03] mraleph has joined the channel [07:03] Dulak: is there a good alt to cradle that works? [07:03] seivan has joined the channel [07:03] dexter_e: why is cradle "broken generally" ? [07:03] TheJH: davidban_, if I was manually creating the query, it would look like "DELETE FROM ips WHERE ip = 1 OR ip = 2 OR ip = 3" [07:04] dexter_e: pigmej: Why is cradle "broken generally" ? [07:04] TheJH: davidban_, where does the ip-list come from? from a previous query? [07:04] Dulak: the fact that it doesn't work is maybe a good indicator.... [07:04] davidban_: TheJH: Yeah, me too. I can't figure out how that would work with the node-mysql syntax, though. [07:05] davidban_: TheJH: It's from a post from a user. JSON format. [07:05] tuhoojabotti: JSON<3 [07:06] chjj: who would win in a fight? ice cube, an anaconda, or JSON? [07:06] pigmej: dexter_e: because it is ;) [07:06] pigmej: look at the bugs [07:06] pigmej: ;-) [07:06] pigmej: very very important bugs was without answer for 2 months etc [07:07] dguttman has joined the channel [07:07] JKarsrud has joined the channel [07:09] davidban_: :q [07:09] davidban_: Whoops, wrong window. [07:09] devaholic: time for some doug crockford vidyas [07:09] TheJH: davidban_, maybe like this? https://gist.github.com/23153b5007d195756372 [07:09] benjaminRRR has joined the channel [07:10] dexter_e: I just read through the bugs and it looks like no one has touched it for about a month, hmmm [07:10] dexter_e: Thats too bad cause it really is a rockin module in terms of functionality [07:11] davidban_: TheJH: Tricky! I'll give it a shot, cheers. [07:12] TheJH: davidban_, maybe you should also make sure that you don't create a very fat query string or so [07:12] AAA_awright: TheJH: You can shorten that to WHERE ip IN (1, 2, 3) [07:12] seivan has joined the channel [07:13] TheJH: AAA_awright, wow, cool - as I said, SQL doesn't really like me [07:13] skm has joined the channel [07:14] devaholic: people need to release more node.js videos [07:15] devaholic: i want to consume [07:15] davidban_: AAA_awright: I tried that, but it doesn't seem to play nicely with node-mysql - http://pastebin.com/dp40zwCs returns Error: too many parameters given [07:15] AAA_awright: davidban_: What is 'values'? [07:16] AAA_awright: Usually an argument must be a string or integer, I don't think it supports Arrays [07:16] AAA_awright: davidban_: That would be a cool patch to use [07:16] AAA_awright: to apply... [07:16] steffkes has joined the channel [07:17] tobmaster has joined the channel [07:17] AAA_awright: For a query like that you're probably going to need to construct the list into a string yourself [07:17] davidban_: AAA_awright: I think it's pretty standard format for node-mysql. For example, this works like a champion - http://pastebin.com/DigBzZUz [07:17] djcoin has joined the channel [07:17] saschagehlich has joined the channel [07:17] AAA_awright: davidban_: Well of course, those are strings or numeric [07:18] davidban_: Ahh, so I should be serialising req.body.ips into values? [07:20] gregoryigelmund has joined the channel [07:20] AAA_awright: davidban_: You probably have to construct a (1,2,3) type list yourself... I've never seen anyone pass an Array or similar structure as a paramater to a prepared query [07:20] narayan82 has joined the channel [07:21] darshanshankar has joined the channel [07:21] AAA_awright: values.map(escape).join(',') [07:21] sounko: chris br0n0r [07:21] sounko: fuck wrong window [07:21] AAA_awright: where escape is the MySQL quoting function [07:22] tuhoojabotti: Stupid question: I see readInt and such, but how do I read a byte or a short from a buffer? :D [07:22] davidban_: AAA_awright: Ah, fair enough. I just thought there was something simple in node-mysql or mysql syntax that I was overlooking. Cheers, I'll build the request manually. [07:22] TheJH: tuhoojabotti, for reading a byte, just do an array access: buf[0] [07:22] tuhoojabotti: Yes [07:22] tuhoojabotti: I was thinking about that :P [07:23] mikeal has joined the channel [07:23] tuhoojabotti: Thanks for confirmation [07:24] skm has joined the channel [07:25] catphive has joined the channel [07:25] skm has joined the channel [07:25] asabil has joined the channel [07:28] tuhoojabotti: Hmm [07:28] tuhoojabotti: Is there an easy way to get the key name from the value? :P [07:28] tuhoojabotti: Like i have an array with the packet codes, and I want the name of the code [07:28] tuhoojabotti: not array [07:28] tuhoojabotti: object [07:28] tuhoojabotti: like end: 255 [07:29] tuhoojabotti: login: 1 [07:29] tuhoojabotti: etc. [07:29] blup has joined the channel [07:29] tuhoojabotti: Perhaps more of a #javascript question [07:30] jesusabdullah: Maybe, but we should be able to help, it's not that obscure [07:30] tuhoojabotti: Yes, that's why I asked. :D [07:30] jesusabdullah: Unfortunately for you, I'm a total idiot with that kinda thing ;) [07:30] tuhoojabotti: So am I [07:30] TheJH: tuhoojabotti, iterate through the object and wait until you encounter the value [07:30] SubStack: you could build another hash and look up values from that [07:31] tuhoojabotti: Yeah [07:31] tuhoojabotti: So the answer is: "No easy way" [07:31] tuhoojabotti: :D [07:31] tuhoojabotti: Thanks [07:31] TheJH: tuhoojabotti, maybe you can also use some fancy v8 debugging stuff to do it [07:31] jesusabdullah: Yeah, I would do what TheJH said---I don't think there's a trick [07:31] SubStack: v8: var obj = { a : 1, b : 2, c : 3 }; var obj_ = Object.keys(obj).reduce(function (acc, key) { acc[obj[key]] = key; return acc }, {}); obj_[2] [07:31] v8bot: SubStack: "b" [07:31] SubStack: pow [07:31] tuhoojabotti: There we go :D [07:32] tuhoojabotti: SubStack++ [07:32] v8bot: tuhoojabotti has given a beer to SubStack. SubStack now has 42 beers. [07:32] catb0t: SubStack now has 1 beer [07:32] JakeyChan has joined the channel [07:32] jesusabdullah: ahaha [07:32] SubStack: catb0t: why you drink my beers? [07:32] catb0t: drink of choice was gin beers [07:32] tuhoojabotti: :D [07:32] jesusabdullah: "You only have one beer?" "That's the markov bot." "Oh!" [07:32] JakeyChan: how could I compare two object to check they have same property ?? [07:32] jesusabdullah: That do you mean, JakeyChan ? [07:32] seivan has joined the channel [07:33] JakeyChan: how would you cleanly compare 2 objects to validate they have the same properties ? any special function ? [07:33] jesusabdullah: I don't think js has a built-in deepEqual, but they exist [07:33] jesusabdullah: I MIGHT BE WRONG [07:34] SubStack: traverse has one of those, although it is a bit more strict than most [07:34] SubStack: also there's assert.deepEqual() [07:34] SubStack: you could wrap that in a try/catch [07:34] djcoin has joined the channel [07:34] SubStack: v8: require('assert') [07:34] v8bot: SubStack: ReferenceError: require is not defined [07:34] SubStack: >_< [07:35] jesusabdullah: derp! [07:35] tuhoojabotti: That's runInNewContext for ya :D [07:35] TheJH: JakeyChan, maybe like this: var keys1 = Object.keys(obj1).sort(); var keys2 = Object.keys(obj2).sort(); if (keys1.length != keys2.length) return false; for (var i=0; i var assert = require('assert'); var xs = { a : 3 }, ys = { a : 3, b : 1 }, equal = true; try { assert.deepEqual(xs, ys) } catch (err) { equal = false }; equal [07:37] SubStack: false [07:37] tuhoojabotti: :) [07:37] SubStack: > var assert = require('assert'); var xs = { a : 3 }, ys = { a : 3 }, equal = true; try { assert.deepEqual(xs, ys) } catch (err) { equal = false }; equal [07:37] tuhoojabotti: SubStack is our new bot [07:37] SubStack: true [07:37] SubStack: beep boop [07:37] mikedeboer has joined the channel [07:37] tuhoojabotti: I'm just a destroyer bot [07:37] tuhoojabotti: (By my nick) [07:37] cognominal has joined the channel [07:39] tdegrunt has joined the channel [07:39] jesusabdullah: I'm, umm [07:39] jesusabdullah: a messiah, apparently [07:41] Jippi has joined the channel [07:43] davidban_: TheJH: http://pastebin.com/FdZGvcML works perfectly for what I wanted it to do, thanks! It turns out I also did some stupid stuff on the client side which I've just fixed up, but your solution worked awesome. [07:46] jetienne: hi [07:47] gozala has joined the channel [07:47] davidcoallier has joined the channel [07:48] Bj_o_rn has joined the channel [07:49] Emmanuel has joined the channel [07:49] bergie has joined the channel [07:49] cosmincx has joined the channel [07:50] davidbanham has joined the channel [07:52] stalled has joined the channel [07:54] bentkus: what is the most representative color for node.js? [07:55] aliem has joined the channel [07:56] TheJH: davidbanham, are you davidban_? [07:56] TheJH: bentkus, in the logo, there are black, white and green, so I'd say "green" [07:58] tuhoojabotti: jetienne: Hello [08:00] langworthy has joined the channel [08:01] guidocalvano has joined the channel [08:01] jetienne: bentkus: use a browser debugger to get them [08:01] guidocalvano_ has joined the channel [08:01] Emmanuel has joined the channel [08:02] bentkus: 'green' is enough, since im doing that for the console: http://is.gd/aqIsCS [08:03] jbpros has joined the channel [08:03] igl has joined the channel [08:04] radiodario has joined the channel [08:05] mendel_ has joined the channel [08:09] Nexxy has joined the channel [08:09] robhawkes has joined the channel [08:10] creationix has joined the channel [08:10] markwubben has joined the channel [08:15] euforic has joined the channel [08:16] Xano has joined the channel [08:17] pickels has joined the channel [08:20] kmox83 has joined the channel [08:20] d0k has joined the channel [08:20] alim has joined the channel [08:21] Bj_o_rn has left the channel [08:24] seivan has joined the channel [08:26] pdelgallego has joined the channel [08:27] herbySk has joined the channel [08:28] andree has joined the channel [08:28] leoju has joined the channel [08:30] tuhoojabotti: Hmm [08:30] tuhoojabotti: How do I read a 4 byte Int from a buffer? :D [08:31] jetienne has joined the channel [08:34] tuhoojabotti: Anyone? [08:34] tuhoojabotti: I really want to :3 [08:34] mczerkawski has joined the channel [08:36] seivan has joined the channel [08:36] tuhoojabotti: Oh nice we have binary move ops [08:36] TheJH: tuhoojabotti, like this? https://github.com/tlrobinson/v8-typed-array [08:37] pdonald: var i = ((buffer[0] & 0xFF) << 24) + ((buffer[1] & 0xFF) << 16) + ((buffer[2] & 0xFF) << 8) + ((buffer[3] & 0xFF) << 0); [08:37] tuhoojabotti: Ermm don't think so [08:37] tuhoojabotti: Like that :P [08:37] tuhoojabotti: pdonald: I didn't know we had >> and << :P [08:37] tuhoojabotti: Thanks. [08:37] tuhoojabotti: Well I just found out. [08:40] blup has joined the channel [08:43] tuhoojabotti: Hmm [08:43] tuhoojabotti: erro oob :D [08:43] tuhoojabotti: error* [08:43] Esteb has joined the channel [08:43] hassox has joined the channel [08:46] mehlah has joined the channel [08:47] tuhoojabotti: Hmm [08:47] tuhoojabotti: pdonald: I'm getting the wrong value :D [08:47] mikedeboer has joined the channel [08:47] tuhoojabotti: I think it's inverted [08:48] pdonald: v8: var buffer = new Buffer([0,0,0,1]); var i = ((buffer[0] & 0xFF) << 24) + ((buffer[1] & 0xFF) << 16) + ((buffer[2] & 0xFF) << 8) + ((buffer[3] & 0xFF) << 0); i; [08:48] v8bot: pdonald: ReferenceError: Buffer is not defined [08:48] tuhoojabotti: The int as bytes is 04 00 00 00 and it should return 4 [08:48] caiges has joined the channel [08:49] xhr has joined the channel [08:49] pdonald: no, 00 00 00 04 is 4 [08:49] tuhoojabotti: Yes inverted :D [08:50] tuhoojabotti: Yes I see now [08:50] aliem has joined the channel [08:51] tbassetto has joined the channel [08:52] tuhoojabotti: But it's weird, since the first int in the packet should be the length of the packet, but it's 00 00 00 00 :D [08:53] brimster_ has joined the channel [08:54] onr has joined the channel [08:55] tuhoojabotti: pdonald: Are you sure that's not a big/little endian thing? :D [08:56] tuhoojabotti: Because I think it's correct [08:56] mendel_ has joined the channel [08:57] tuhoojabotti: So how do I read it.. :D [08:57] tuhoojabotti: Just invert it I guess [08:58] mendel__ has joined the channel [08:59] eldios has joined the channel [08:59] tuhoojabotti: Oh yes :D [08:59] tuhoojabotti: Working [08:59] tuhoojabotti: pdonald: Thanks for your help. :P [09:00] bzinger has joined the channel [09:01] markwubben has joined the channel [09:02] TheJH: is LearnBoost around here? does he have an IRC nick? [09:05] `3rdEden: TheJH Learnboost is a company [09:05] TheJH: `3rdEden, oops - who should I ask for socket.io stuff? [09:05] `3rdEden: TheJH #socket.io [09:05] TheJH: `3rdEden, thanks [09:06] Emmanuel has joined the channel [09:06] seivan has joined the channel [09:07] jetienne: any suggestion on a simple testunit stuff ? (working in browser too in a plus) [09:07] CerealWasTaken has joined the channel [09:07] `3rdEden: jetienne for basic assertions, we use should [09:07] `3rdEden: but [09:07] `3rdEden: qunit also runs on server and client [09:08] zackattack has joined the channel [09:08] brimster has joined the channel [09:09] brimster has left the channel [09:11] jetienne: `3rdEden: you are using qunit too ? [09:12] altamic has joined the channel [09:13] SubStack: I have something in the works much more awesome than qunit ;) [09:13] SubStack: stack traces, node modules, cross-browser testing [09:13] SubStack: all kinds of useful craziness! [09:14] `3rdEden: jetienne yes and no [09:14] `3rdEden: For one of my private projects I'm using qunit [09:14] `3rdEden: but for socket.io we use should [09:14] kulor-uk has joined the channel [09:14] `3rdEden: with a custom should for the browser [09:15] `3rdEden: so test cases can run both on the server and lcieent [09:15] jetienne: `3rdEden: ok. lets go for should [09:17] sourcode has joined the channel [09:18] zest` has joined the channel [09:18] zest`: hello [09:18] tuhoojabotti: I'm so bad at this. :/ [09:18] tayy has joined the channel [09:18] tuhoojabotti: How do I write an integer into 4 bytes? :P [09:18] tuhoojabotti: pdonald: I know you know how :D [09:18] zest`: i wonder we can use other language libs with node.js like python libs for example ? [09:18] JasonSmith has joined the channel [09:19] tuhoojabotti: C++ [09:19] v8bot: tuhoojabotti has given a beer to C. C now has 15 beers. [09:19] tuhoojabotti: Lol [09:19] tuhoojabotti: :D [09:19] zest`: i wonder too if there a good feedparser for node [09:19] tuhoojabotti: zest`: I guess you can call python via the commandline and read the stdout. :P [09:20] pdonald: tuhoojabotti: like this (this is for 2 bytes) new Buffer([(length >> 8) & 0xff, length & 0xff]) [09:20] tuhoojabotti: Okay, I'll try, thanks. :P [09:20] tuhoojabotti: pdonald: Is that right endian for me? :P [09:20] TheJH: what happens if I do this? [09:20] TheJH: C++++ [09:21] tuhoojabotti: TheJH: Nothing. [09:21] TheJH: :( [09:21] TheJH: C++ ++ [09:21] pdonald: (C++)++ [09:22] tuhoojabotti: C.plus(2).plus(2) [09:22] tuhoojabotti: Nothing. :/ [09:22] simenbrekken has joined the channel [09:23] pdonald: C\+\+++ [09:23] pdonald: meh [09:23] simenbrekken: How do I make sure I get the current system timezone when creating a date in node.js? [09:25] zest`: tuhoojabotti: ok :) so unless a strong feedparser exists fo node.js it would be a way for using python UniversalFeedParser ? [09:28] aliem has joined the channel [09:30] SubStack: tuhoojabotti: > require('put')().word32be(1337).buffer() [09:30] SubStack: [09:30] MrWarGames has joined the channel [09:30] hkjels has joined the channel [09:30] larsvegas has joined the channel [09:31] SubStack: https://github.com/substack/node-put [09:31] hkjels: Is proxy through nginx's still the recommended way to make use of virtualhosts? [09:32] SubStack: hkjels: check out https://github.com/nodejitsu/node-http-proxy [09:33] e6nian has joined the channel [09:33] hkjels: nice [09:33] hkjels: thank you SubStack [09:34] hkjels: I guessed someone would have started something like this [09:34] hkjels: ;) [09:34] SubStack: you can make it work with websockets even! [09:35] hkjels: sounds good [09:35] MrWarGames has joined the channel [09:35] hkjels: https to. This covers all my needs I guess [09:40] simenbrekken has joined the channel [09:41] mczerkawski has joined the channel [09:43] ukd1_b has joined the channel [09:45] vid_ has joined the channel [09:46] tuhoojabotti: The server replies, but I can't see it because of the firewall here :P [09:47] tuhoojabotti: Some one on windows? :D [09:47] tuhoojabotti: http://netmatch.vesq.org/download <- dl, launch, connect lakka.kapsi.fi:61821 Thanks you :D [09:49] shinuza has joined the channel [09:49] dexter_e: url.hostname and url.host undefined for some reason... anyone know why possibly? [09:50] tuhoojabotti: url.address? :u [09:50] dexter_e: url.address isn't in the Node documents.. [09:51] dexter_e: http://nodejs.org/docs/v0.5.0/api/url.html#url.parse [09:51] tuhoojabotti: Oh [09:52] jetienne: SubStack: in seq, is there a way to callback run everytime, no matter if the sequence got error or not ? [09:53] SubStack: jetienne: you can put a .seq() after a .catch() [09:53] andrewfff has joined the channel [09:54] jetienne: SubStack: an empty catch ? [09:54] SubStack: if you like [09:54] jetienne: ok thanks [09:54] tuhoojabotti: When I'm replying to a client with dgram do I sock.send to server port or the peer's port? :D [09:55] hellp has joined the channel [09:57] TheJH: tuhoojabotti, to the peers port [09:57] tuhoojabotti: Ye [09:57] tuhoojabotti: I wonder why the client isn't receiving anything, just times out :/ [09:58] TheJH: tuhoojabotti, could you show us the code? [09:58] tuhoojabotti: Ye [09:58] TheJH: tuhoojabotti, you could try to find out what's happening using wireshark [09:58] jetienne: tuhoojabotti: check that the datagram is sent via tcpdump [09:58] seivan has joined the channel [09:58] tuhoojabotti: jetienne: tcpdump on udp? [09:58] tuhoojabotti: :o [09:58] soupy: hi i get a request with a body object.. how can i take a value of a table element with a certain id from it? [09:59] jetienne: tuhoojabotti: then be sure to reply with the same ports of the request [09:59] jetienne: tuhoojabotti: yep [10:00] tuhoojabotti: https://gist.github.com/1071492 Don't laugh. :P [10:00] tuhoojabotti: Or cry, I'm a noob. [10:01] adrianmg has left the channel [10:01] jetienne: tuhoojabotti: "sudo tcpdump -i any udp" in a terminal [10:01] jetienne: and look at what is passing [10:01] ditesh|cassini has joined the channel [10:01] tuhoojabotti: jetienne: sudo = no can do. :/ [10:02] tuhoojabotti: But the buffer is ok [10:02] jetienne: tuhoojabotti: ? [10:02] tuhoojabotti: jetienne: I'm running this on a shared irc shell server :D [10:02] tuhoojabotti: They opened the port for me [10:02] jetienne: tuhoojabotti: why not on a local computer ?* [10:02] FireFly has joined the channel [10:03] tuhoojabotti: jetienne: I don't have a stable one right now. [10:03] tuhoojabotti: Jumping between work and a minilappy [10:03] tuhoojabotti: Also no linux atm on any of my pcs [10:03] jetienne: hmm ok [10:03] jetienne: tuhoojabotti: you may save a lot of time with a proper dev env [10:03] tuhoojabotti: Ye I know. [10:03] jetienne: i dunno what is the status of node on window [10:04] fermion has joined the channel [10:04] jetienne: joyent did press on it, i dunno how complete it is [10:04] tuhoojabotti: I know [10:04] tuhoojabotti: But you see anything wrong in that code? [10:04] TheJH: tuhoojabotti, are you testing the case "login with wrong version"? because that's the only one for which you send replies (as far as I can see) [10:04] tuhoojabotti: TheJH: Yes. [10:05] tuhoojabotti: the client sends v2.4 [10:05] tuhoojabotti: TheJH: http://pastebin.com/etF5Pme2 [10:05] tuhoojabotti: log [10:07] supster has joined the channel [10:07] unomi has joined the channel [10:08] tuhoojabotti: That last buffer is exactly the data I want to send [10:08] tuhoojabotti: But the client never receives it [10:10] caiges has joined the channel [10:10] TheJH: question: a dgram socket that is bound to a port will use that port as source port for outgoing packets, right? [10:10] tuhoojabotti: I don't know :u [10:10] tuhoojabotti: I just coped the dgram part tom some chat-server example :D [10:11] tuhoojabotti: copied* [10:11] tuhoojabotti: This is my first server other than http [10:11] TheJH: ACTION is away now, maybe someone else can figure it out - maybe source ip or port is wrong [10:12] micheil has joined the channel [10:12] tuhoojabotti: Hm? [10:12] tuhoojabotti: :D [10:14] fyskij has joined the channel [10:20] k1ttty_ has joined the channel [10:21] caiges has joined the channel [10:22] dexter_e has joined the channel [10:26] jbpros_ has joined the channel [10:27] dnjaramba has joined the channel [10:27] burg: how can i install a node module globally? so i can include it from everywhere, without its path? [10:27] jbpros_ has joined the channel [10:28] Wizek has joined the channel [10:28] dnjaramba has joined the channel [10:31] dnjaramba has joined the channel [10:33] context: burg: you cant. has to be in ./node_modules [10:33] context: either installed or linked. [10:34] context: you can install globally and link it to each project [10:34] burg: how can i install it globally? [10:34] context: install -g [10:35] boogyman has joined the channel [10:43] pickels_ has joined the channel [10:45] towski has joined the channel [10:48] cjm has joined the channel [10:48] guidocalvano has joined the channel [10:48] dexter_e: Any idea why hostname and host would be missing from a parsed url ? [10:48] okuryu has joined the channel [10:48] materialdesigner has joined the channel [10:50] philhawksworth has joined the channel [10:50] philhawksworth has left the channel [10:50] ukd1_b has joined the channel [10:50] tuhoojabotti: M.I.A. [10:57] k0ral has joined the channel [10:57] k0ral: hi [10:57] tuhoojabotti: Hello [10:58] k0ral: I'm starting with node.js and I see there are numerous modules for each single need [11:00] k0ral: I'm quite lost with the number of modules, are there some that you would recommend for web framework categories ? [11:00] tuhoojabotti: express [11:00] tuhoojabotti: I guess [11:00] tuhoojabotti: It's the most popular afaik [11:01] k0ral: as I understand it bundles lots of single features [11:01] tuhoojabotti: Usually frameworks do? [11:01] tuhoojabotti: :u [11:01] k0ral: well, I was talking about web framework categorIES [11:01] k0ral: sub-categories [11:02] tuhoojabotti: Huh [11:02] k0ral: listed in the wiki for example [11:02] tuhoojabotti: You mean like express middleware? [11:02] sandstrom has joined the channel [11:02] sandstrom has joined the channel [11:03] k0ral: I don't know what is express middleware :s [11:03] tuhoojabotti: module for the framework that doess stuff. [11:03] tuhoojabotti: Like node-gzip I guess [11:03] tuhoojabotti: eh [11:03] tuhoojabotti: express-gzip [11:03] k0ral: ah yes [11:04] k0ral: but I'm fine with a framework if you tell me it's better than using several sub-tools [11:05] k0ral: it's just that there are so many modules, I can't afford testing each of them to make my mind [11:05] tuhoojabotti: express is the most popular web framework [11:05] tuhoojabotti: That's all I know, I made my own ;D [11:06] k0ral: interesting, so for example would you tell me why you made your own ? Were there some lacks in express ? [11:06] tuhoojabotti: k0ral: Because I didn't know about express, and I just wanted to reply to some simple http responses. :P [11:07] k0ral: ah fine [11:07] tuhoojabotti: But it grew and now it's an ugly monster [11:08] tuhoojabotti: I should switch to express :P [11:08] sreeix_ has joined the channel [11:08] tuhoojabotti: But now I'm writing a game server using udp [11:08] k0ral: waw [11:08] tuhoojabotti: But the clients don't get my reply :/ [11:08] k0ral: well, thank you for your advice, I'll dig into express :) [11:09] tuhoojabotti: No problem. : [11:09] tuhoojabotti: :)* [11:11] omni5cience_ has joined the channel [11:14] eee_c has joined the channel [11:17] BulletBob has joined the channel [11:18] kmox83 has joined the channel [11:19] ditesh|cassini has joined the channel [11:22] rchavik has joined the channel [11:23] necrodearia has joined the channel [11:24] dexter_e has joined the channel [11:24] CoinOpeBoy has joined the channel [11:25] socketio\test\91 has joined the channel [11:25] dipser has joined the channel [11:26] bpierre has joined the channel [11:29] necrodearia has joined the channel [11:32] dexter_e: If I just put node on port:80 will req.host and req.hostname be missing ? [11:32] jbroman: dexter_e: Why would they be missing on port 80? [11:33] dexter_e: well, i don't know, I'm shooting in the dark because req.hostname and req.host are just absent ? [11:34] jbroman: Wait, this is for an http.Server? [11:34] dexter_e: yeah [11:35] dexter_e: its just a standard express install [11:36] jbroman: I haven't used Express much, but I don't see a reference to those ever being populated. But it could just be ignorance. [11:36] jbroman: req.header('host') or similar might work [11:37] unlink has joined the channel [11:37] unlink has joined the channel [11:38] dexter_e: Wow, that does work! [11:38] bergie has joined the channel [11:38] Deltachaos has joined the channel [11:39] dexter_e: I wonder if the documented method are getting deprecated [11:39] Deltachaos: hi @all [11:39] dexter_e: jbroman: Thanks! [11:42] theCole has joined the channel [11:42] smtlaissezfaire has joined the channel [11:43] theCole_ has joined the channel [11:43] arnee has joined the channel [11:45] Emmanuel__ has joined the channel [11:45] guidocalvano: has anyone got experience getting v8 juice to work on mac? [11:45] Deltachaos: anyone who wat to goof on this: http://piratenpad.de/RSgrZ6cC5d or better give constructive criticism ;) [11:45] Deltachaos: *want [11:47] jbpros has joined the channel [11:48] djcoin has joined the channel [11:53] mikeal1 has joined the channel [11:54] thalll has joined the channel [11:56] Garo_ has joined the channel [11:56] janne has joined the channel [11:57] jbpros has joined the channel [11:59] level09 has joined the channel [12:01] smtlaissezfaire has joined the channel [12:02] Badababuba1 has joined the channel [12:04] Skola has joined the channel [12:05] apanda has joined the channel [12:05] Badababuba1 has joined the channel [12:06] Jippi has joined the channel [12:06] hwinkel has joined the channel [12:06] Badababuba1 has joined the channel [12:08] Badababuba has joined the channel [12:09] sreeix has joined the channel [12:10] bergie has joined the channel [12:10] piscisaureus has joined the channel [12:12] ryanfitz has joined the channel [12:13] Wizek has joined the channel [12:16] adrianmg has joined the channel [12:17] sirdancealot has joined the channel [12:17] alim has joined the channel [12:18] hybsch has joined the channel [12:19] TechCel has joined the channel [12:20] Mrfloyd has joined the channel [12:20] sfoster has joined the channel [12:21] piscisaureus_ has joined the channel [12:23] __doc__ has joined the channel [12:25] xhr has joined the channel [12:26] eee_c has joined the channel [12:27] mehtryx has joined the channel [12:28] charlenopires has joined the channel [12:29] jbpros has joined the channel [12:34] charlenopires_ has joined the channel [12:36] Swimming_bird has joined the channel [12:37] Mrfloyd has joined the channel [12:37] mehtryx has joined the channel [12:38] aurynn has joined the channel [12:38] fumanchu182 has joined the channel [12:39] xeodox has joined the channel [12:39] aurynn has left the channel [12:39] mraleph has joined the channel [12:41] xeodox has joined the channel [12:43] tmedema has joined the channel [12:44] broofa has joined the channel [12:44] adambeynon has joined the channel [12:44] yozgrahame has joined the channel [12:45] tmedema: any chance schaermu is here? [12:45] sledge has joined the channel [12:45] nyholt has joined the channel [12:45] jomoho has joined the channel [12:45] steffan has joined the channel [12:46] mAritz has joined the channel [12:46] [AD]Turbo has joined the channel [12:46] aliem has joined the channel [12:47] [AD]Turbo: yo all [12:48] mehlah has joined the channel [12:50] ph^ has joined the channel [12:51] unomi has joined the channel [12:53] aheckmann has joined the channel [12:55] Renegade001 has joined the channel [12:56] jonasen has joined the channel [12:57] cccaldas has joined the channel [12:59] AaronMT has joined the channel [13:00] cccaldas_ has joined the channel [13:01] ditesh|cassini has joined the channel [13:02] mrryanjohnston has joined the channel [13:02] mrryanjohnston: greetings all [13:03] kmox83 has joined the channel [13:03] Lair has joined the channel [13:04] herbySk has joined the channel [13:05] yozgrahame has joined the channel [13:06] baudehlo has joined the channel [13:07] SamuraiJack has joined the channel [13:07] skohorn has joined the channel [13:07] keyvan: is there a replacement for the whole !typeof(foo)=="undefined" nonsense in ruby? [13:07] keyvan: err sorry... node... gah [13:07] keyvan: (bouncing between ruby and node for this thing im doing hehe) [13:08] JKarsrud: why would you want to replace typeof? [13:08] JKarsrud: you could probably wrap it as a function tho? [13:08] keyvan: JKarsrud: was just wondering--i thought i remembered Ryan speak of a replacement in a recent video--just making sure [13:09] JKarsrud: hmm, not that I've heard of, no [13:09] keyvan: ya i thought maybe node already has [13:09] keyvan: kk ty [13:09] JKarsrud: atleast not in node, but there might be, I'm no node expert :) [13:10] CrisO has joined the channel [13:11] keyvan: oh wait... no need... just asking for the object, if it is not defined, seems to return false or nil or something--doesnt crash :] [13:11] bnoordhuis has joined the channel [13:11] guidocalvano has joined the channel [13:11] JKarsrud: cool [13:11] JKarsrud: probably returns undefined [13:11] JKarsrud: :P [13:12] seawise has joined the channel [13:12] pigmej: hmm [13:12] keyvan: kinda weird, since in node console you get a referenceError: foo not defined [13:12] keyvan: curious case [13:12] pigmej: is there any way to validate json in node ? [13:12] pigmej: a contents of json [13:12] pigmej: I've seen the node-validator [13:12] JKarsrud: keyvan: exactly, it's undefined [13:13] pigmej: but it's missing some features that I need like custom validation functions [13:13] hdon has joined the channel [13:13] ngs has joined the channel [13:13] xandrews has joined the channel [13:13] pigmej: wrr not that lib ;) [13:13] pigmej: the schema.js [13:15] kartmetal: so uh... skamper's ndns seems to be a pretty good way to make complex dns queries to arbitrary servers.. but it has almost disappeared from the net.. is there a backstory there/a reason to stay away from that code? [13:15] lukstr: if you're not already watching: http://www.nasa.gov/multimedia/nasatv/ [13:17] bbttxu has joined the channel [13:19] kuya has joined the channel [13:21] avalanche123 has joined the channel [13:22] davidascher has joined the channel [13:23] b_erb has joined the channel [13:23] davidsklar has joined the channel [13:24] Lair has left the channel [13:24] random123 has joined the channel [13:24] dexter_e has joined the channel [13:24] wenbert has joined the channel [13:25] b_erb: is there any rule of thumb, when redis will outperform javascript object literals in v8 for large key value stores ("hash maps, caches etc,) in terms of object count, ops/s etc.? [13:25] brolin has joined the channel [13:26] ceej has joined the channel [13:27] confoocious has joined the channel [13:27] confoocious has joined the channel [13:29] wenbert: is this a good idea? https://github.com/pascalopitz/long_polling_example [13:30] level09 has joined the channel [13:30] micheil: depends on your use case [13:30] bradleymeck_ has joined the channel [13:30] micheil: ie, whether long polling makes sense for your application vs use websockets (or using something like pusher.com) [13:31] saschagehlich_ has joined the channel [13:31] jtsnow has joined the channel [13:33] wenbert: micheil what does facebook use for chat? [13:33] onr: long polling [13:34] wenbert: i see that the favicon in my tab does not stop spinning... [13:34] Swimming_bird has joined the channel [13:35] onr: recursive HTTP, maybe [13:36] chrisjpowers has joined the channel [13:36] gustavowt has joined the channel [13:37] akshatj has joined the channel [13:38] wenbert: http://query7.com/avoiding-long-polling [13:39] guidocalvano has joined the channel [13:40] yhahn has joined the channel [13:41] trotter has joined the channel [13:41] kartmetal has joined the channel [13:42] squeese has joined the channel [13:42] colinclark has joined the channel [13:43] onr: RTMP is ok for online gaming [13:44] malkomalko has joined the channel [13:44] Poetro_ has joined the channel [13:44] Poetro_ has joined the channel [13:45] Kingdutch has joined the channel [13:45] sourcode has joined the channel [13:47] herbySk has joined the channel [13:47] ksheurs has joined the channel [13:49] smtlaissezfaire has joined the channel [13:51] mbrevoort has joined the channel [13:53] dtan has joined the channel [13:56] dtan: hey all [13:56] dexter_e: yo [13:56] dtan: hey dexter_e, do you have any experience with mongoose-auth or everyauth? [13:57] willwhite has joined the channel [13:57] dexter_e: dtan: nope :) [13:57] dtan: heh np, i just started looking into it really this morning [13:57] dtan: but running into an issue running it in express [13:59] ccarella has joined the channel [13:59] TheJH: anyone here who can tell me where my npm config is? the --dev flag is set to true which means that when I try to install the socket.io-client, it will fail because of a recursive dependency (socket.io <-> socket.io-client) [13:59] dtan: thejh - is it not in /usr/local/ or /usr/local/bin? [14:00] TheJH: dtan, the config file? [14:00] catshirt has joined the channel [14:00] dtan: hmm [14:00] TheJH: dtan, npm is installed to /usr/bin/npm [14:01] fawxtin has joined the channel [14:01] yozgrahame has joined the channel [14:01] dtan: ah, i have all of my stuff going to /usr/local/bin [14:01] zomgbie has joined the channel [14:01] dtan: is your npm folder symlinked anywhere? [14:01] dtan: b/c it is in mine to /usr/local/lib/node_modules/npm [14:02] dtan: and inside that folder i see a configure file [14:02] stereosteve has joined the channel [14:02] dtan: which is a script for reading in flags basically [14:03] fawxtin: Is there a way, to kind of "mock" the 'document', to mimic client behaviour? (btw, Is this question asked many times?) [14:03] guidocalvano: looking for unit testing? [14:04] fawxtin: yep [14:04] TheJH: dtan, I can see /usr/lib/node_modules/npm, but how is the config file named? [14:04] mcutler has joined the channel [14:04] wenbert: how do I echo the PATH again [14:04] wenbert: > [14:04] wenbert: ? [14:04] dtan: right, i don't see one, it's weird [14:04] dtan: wenbert > $PATH [14:04] dans has joined the channel [14:04] dtan: it seems to just set it against the ./bin/npm.js file [14:05] mcutler has left the channel [14:05] dtan: thejh can't you do npm install --dev false [14:05] dtan: ? [14:05] wenbert: looks like node_modules is in the wrong directory [14:05] wenbert: where should I put this? [14:05] dtan: wenbert what are you trying to do? [14:06] dtan: there are two places the node_modules folder usually goes [14:06] dtan: it depends on if you're install the module locally or globally [14:06] wenbert: playing around with socket.io [14:06] wenbert: ah i see [14:06] brettgoulder has joined the channel [14:06] dtan: haven't done socket.io stuff yet [14:06] wenbert: i guess this is installed locally since it's in /home/blah/node_modules [14:06] rauchg has joined the channel [14:07] dtan: is /home/blah your app folder? [14:07] dtan: that's what i meant by locally [14:07] dtan: it'll be a child folder of your app folder [14:07] wenbert: it's the user folder... [14:07] wenbert: ah i get [14:07] dtan: cd appfolder; npm install module; [14:08] dtan: and it'll install in the appfolder [14:08] dtan: if you use npm install module -g [14:08] towski has joined the channel [14:08] dtan: it will install to a global path for all of your apps to have access to, i believe [14:10] dans has joined the channel [14:10] wenbert: i guess i must have installed it locally... but i guess it'll be okay for now... thanks dtan [14:10] TheJH: dtan, I don't know why, but it still doesn't work [14:10] dtan: yup np [14:11] wenbert: you cleared up things for me ;) [14:11] dtan: cool, wenbert [14:11] dtan: thejh are you getting any error messages? [14:11] bergie has joined the channel [14:12] fawxtin: guidocalvano: I can load normally yuitest-node.js, and run things there, but when there's 'document' objects it gives me 'reference error', :P [14:13] _iori_ has joined the channel [14:16] guidocalvano: can't you unittest on the browser? [14:17] guidocalvano: using requirejs or something? [14:18] systemfault_ has joined the channel [14:19] systemfault has joined the channel [14:19] systemfault has joined the channel [14:19] tbranyen: fawxtin: look into jsdom or something [14:20] gtramont1na has joined the channel [14:21] Destos has joined the channel [14:22] brianc has joined the channel [14:23] Skola has joined the channel [14:23] guidocalvano: i'd be careful unittesting on a mock dom [14:23] guidocalvano: if you just want to create a mock dom you can also just create it yourself. That isn't that hard [14:24] JJMalina has joined the channel [14:24] guidocalvano: if you want to test code that uses the dom however, i'd test it on the actual dom because they can be different across browsers [14:25] Skola: ] [14:25] brianseeders has joined the channel [14:26] JJMalina has joined the channel [14:27] sub_pop has joined the channel [14:27] ryanfitz has joined the channel [14:28] adrianmg has joined the channel [14:28] fawxtin: tbranyen: ok, Ill try that [14:29] mynyml has joined the channel [14:30] TheJH: dtan, I think that it works now (although I didn't change anything) [14:30] dtan: heh ok [14:30] stepheneb has joined the channel [14:30] dtan: that's most important, right? =) [14:30] eldios: http://www.nasa.gov/multimedia/nasatv/index.html [14:31] fawxtin: guidocalvano: yes, I can do it on the browser too, I was just trying to run most things that dont need browser on it.. [14:31] adelgado: eldios: Thanks. I'd forgotten about that. [14:31] eldios: ^_ [14:31] eldios: ^_^ [14:31] bbrandon has joined the channel [14:32] fawxtin: guidocalvano: but, as the whole code is minified, it keeps asking for the 'document', hehe.. Im trying to mock it [14:34] jtrudeau has joined the channel [14:35] mehtryx: anyone out there using unit testing with coffee script? [14:36] tayy has joined the channel [14:37] Skola: sure mehtryx I have [14:37] pHcF has joined the channel [14:37] Skola: it's no different from js unit testing [14:38] mehtryx: Skola: great……what are you using? [14:38] tuhoojabotti: That's like ...... [14:39] tuhoojabotti: … does look neater on a monospace font, but it's just pragging [14:40] colinclark has joined the channel [14:40] hij1nx has joined the channel [14:40] sivy has joined the channel [14:41] eee_c1 has joined the channel [14:42] mehtryx: Skola: the reason I ask is I'm looking to add unit testing and I'm just starting out with node.js but immediately using coffeescript…..so I have not unit tested js either :) [14:42] d0k has joined the channel [14:43] systemfault: You could take a look at jasmine-node [14:44] mapleman has joined the channel [14:46] incon: how unstable is .5 atm? [14:47] bnoordhuis: incon: very [14:48] bnoordhuis: incon: at least if you use the uv backend (default is legacy) [14:49] incon: how is uv going now? [14:49] bnoordhuis: incon: steady, we're getting there [14:50] tmedema: Could someone link me to a simple example of a node.js module extending EventEmitter? [14:50] incon: binaries exe for download yet? [14:52] incon: not everyone wants to setup a mingw evn [14:52] bpierre has joined the channel [14:52] Emmanuel__ has joined the channel [14:54] bpierre: Hey, I’m trying to get a structured stack trace, and found this page: http://code.google.com/p/v8/wiki/JavaScriptStackTraceApi [14:54] gazumps has joined the channel [14:54] bpierre: But Error.prepareStackTrace does not exist. Do you know how to do this? [14:54] mehtryx: thanks systemfault, I've been checking that out the past 2 days ( the amount of time I've spent on node.js and coffeescript period though its all strangly familiar ;) ) there are so many I'm trying to figure out if there was a community favorite…..so jasmine-node looks good. [14:54] zmbmartin has joined the channel [14:55] systemfault: I'm not talking for the community ;) I just personally think it's a good one [14:55] ccarella has joined the channel [14:55] kmox83 has joined the channel [14:56] mehtryx: no worries :) [14:56] bnoordhuis: incon: not yet but i think that's coming this week (don't quote me on that though) [14:56] softdrink has joined the channel [14:56] clifton has joined the channel [14:56] guidocalvano: when I call setTimeout(t, function() ) in node twice in a row such that they will occur a precisely the same time, will the subsequent handling of those two functions also occur in order? [14:57] guidocalvano: say; setTimeout(0), function() { alert( 'a' ) ; } ) ; setTimeout(0), function() { alert( 'b' ) ; } ) ; [14:57] bnoordhuis: guidocalvano: no, no hard guarantees [14:57] guidocalvano: will this always produce a popup with a and then b? [14:57] dnjaramba has joined the channel [14:58] bnoordhuis: guidocalvano: and node doesn't have alert() :) [14:58] guidocalvano: but on node? [14:58] guidocalvano: setTimeout(0), function() { sys.puts( 'a' ) ; } ) ; setTimeout(0), function() { sys.puts( 'b' ) ; } ) ; [14:59] guidocalvano: a. [14:59] guidocalvano: now but it does have sys.puts [14:59] guidocalvano: but will this always produce; [14:59] guidocalvano: a [14:59] guidocalvano: b [14:59] dnjaramba has joined the channel [14:59] Benjie has left the channel [14:59] guidocalvano: ? [15:00] bpierre: Does someone ever tried to use Error.prepareStackTrace? [15:02] postwait has joined the channel [15:02] BillyBreen has joined the channel [15:02] bnoordhuis: guidocalvano: no guarantees, it's an implementation detail [15:02] dtan_ has joined the channel [15:02] BillyBreen has left the channel [15:03] guidocalvano: it most definely is NOT a detail (: [15:03] JakeyChan has joined the channel [15:04] brettgoulder has joined the channel [15:04] Mrfloyd has joined the channel [15:05] gxdssoft has joined the channel [15:05] dtan: hey bnoordhuis [15:05] dtan: have you ever used mongoose-auth and express together? [15:06] Skola: mehtryx: jasmine, vows, or just assert [15:06] JasonSmith has joined the channel [15:07] mehtryx: Skola: thanks [15:08] jakehow has joined the channel [15:09] vDubG has joined the channel [15:10] jonasen has joined the channel [15:10] pandeiro has joined the channel [15:10] chrisjpowers: Hey guys, quick question: If manipulating require.paths is discouraged, is there a way to add load paths *other than* setting NODE_PATH in the environment? Can NODE_PATH be altered in the app at runtime? [15:11] nibblebot has joined the channel [15:12] larsvegas has joined the channel [15:13] ccarella has joined the channel [15:13] simenbrekken has joined the channel [15:14] _jhs has joined the channel [15:14] admc has joined the channel [15:14] briznad has joined the channel [15:15] SirFunk has joined the channel [15:15] bradleymeck_: chrisjpowers, runtime env changes wont be picked up unless you hook them manually somehow (c++?). is there a reason you *need* require.paths? [15:15] rworth has joined the channel [15:16] SirFunk: Anyone here use everyauth? Can someone tell me how to actually authenticate? I know it has routing helpers built in, but if i want to take auth via json and just pass the username/password how can i do that? [15:16] wookiehangover has joined the channel [15:17] DTrejo has joined the channel [15:17] unibomb has joined the channel [15:18] shanez has joined the channel [15:19] mjr_: b_erb: if your V8 heap starts growing past 100MB, it'll probably be faster to keep your data in Redis instead. [15:19] mjr_: b_erb: but I don't fully understand all of the factors that account for higher GC cost in V8. [15:19] tmedema: A question, what does require('child_process').spawn return? It's not documented. [15:19] aron_ has joined the channel [15:20] tmedema: Does it return a process ID or something? [15:20] liar has joined the channel [15:20] chrisjpowers: bradleymeck_, Okay, I'll see if I can make it work just with env vars, just wanted to make sure I wasn't missing something [15:21] red5 has joined the channel [15:21] red5: is there any way to run my jasmine spec with node.js? [15:22] chrisjpowers: red5 I like using the Jessie npm package, it's a Jasmine runner on Node with some nice extras [15:22] chrisjpowers: red5 Also look for Jezebel, which has built in file watchers and a Node REPL [15:24] dgathright has joined the channel [15:24] Destos has joined the channel [15:24] eee_c has joined the channel [15:24] mjr_: tmedema: spawn returns a ChildProcess object, see lib/child_process.js:150 [15:25] chrisjpowers: tmedema: http://nodejs.org/docs/v0.5.0/api/all.html#child_Processes [15:25] red5: chrisjpowers: how i do to import js files on another reports, like jasmine structure ? [15:26] wenbert: okay my node structure is f_cked up :/ [15:27] mjr_: The docs indeed to not specify what spawn() returns. I actually didn't know until I just looked right now. [15:27] wenbert: i did npm install sockets.io -g and still i can't var io = require('socket.io').listen(8080); [15:27] incon: http://www.nasa.gov/multimedia/nasatv/index.html last launch live now [15:28] chrisjpowers: red5: I don't think I understand your question, can you reword that please? [15:28] vipaca has joined the channel [15:31] m00p has joined the channel [15:31] febits has joined the channel [15:31] isaacs has joined the channel [15:32] jbpros has joined the channel [15:33] mbrevoort has joined the channel [15:34] tokumine has joined the channel [15:34] davve: can i reload my code on the fly somehow? [15:34] altamic has joined the channel [15:34] mehtryx: Skola: systemfault: I know this is probably basic……I've pastebin an example here with my spec and source file (http://pastebin.com/NrHS8DN8) problem I am encountering is I get a typeError myServer is undefined when I run SpecRunner I think I'm missing something as to how these files glue together [15:34] replore_ has joined the channel [15:34] davve: or do i need to kill / rerun process? [15:34] altamic has joined the channel [15:34] guybrush: davve: http://search.npmjs.org/#/run [15:35] boehm has joined the channel [15:35] dtan has joined the channel [15:36] davve: nice [15:36] davve: var run = require('run'); ? [15:36] davve: dont see many docs there :P [15:36] guybrush: davve: https://github.com/DTrejo/run.js [15:36] luke` has joined the channel [15:36] guybrush: well just click the links :p [15:36] louis_ has joined the channel [15:36] davve: ty [15:36] guybrush: get used to use those links! :D [15:38] baoist has joined the channel [15:39] caolanm has joined the channel [15:41] tjholowaychuk has joined the channel [15:42] stephank has joined the channel [15:43] ryah has joined the channel [15:43] ryah_ has joined the channel [15:44] admc1 has joined the channel [15:44] robertfw has joined the channel [15:44] mandric has joined the channel [15:45] Lorentz has joined the channel [15:45] tokumine: hey there - is there an idiomatic way to chunk large strings in node? [15:46] tjholowaychuk has joined the channel [15:46] guidocalvano has joined the channel [15:47] formasfunction has joined the channel [15:48] jj0hns0n has joined the channel [15:48] zomgbie has joined the channel [15:48] eee_c has joined the channel [15:48] ekryski has joined the channel [15:49] Yuffster_work has joined the channel [15:49] formasfunction: Node newbie here. Is there an easy way to overwrite console.log lines that have been echoed to the shell? Like for a bash progress bar, for instance. [15:52] tanepiper: Use \t [15:52] Ramosa has joined the channel [15:52] baudehlo: formasfunction: on Linux, you can just write \r and overwrite what you previously wrote. [15:52] SirFunk: isn't node_instpector supposed to have a --start-break option? it keeps telling me it's not an option [15:52] tanepiper: eh, \r even for output like that, but i think there is a module out there [15:52] baudehlo: s/linux/*nix/ [15:53] formasfunction: tanepiper, baudehlo: from what I saw, echo needs to be run with the -e flag. I assume console.log runs with that flag by default? [15:53] jetienne has joined the channel [15:53] RORgasm has joined the channel [15:53] bingomanatee has joined the channel [15:53] bingomanatee: When you do fs.read(fd, buffer, 0, buffer.length, file_position, _write_buffer); [15:54] baudehlo: formasfunction: echo has nothing to do with this. [15:54] bingomanatee: what messages does Buffer get sent ? [15:54] bingomanatee: does buffer get on("data"..)? [15:54] ryanfitz has joined the channel [15:54] formasfunction: bingomanatee: I just assumed that's what console.log ultimately ran on the backend. That's what I get for assuming. [15:55] towski_ has joined the channel [15:55] mfussy has joined the channel [15:56] baudehlo: no, it just talks to stdout... [15:56] baudehlo: so \r just brings the write position back to the start of the line. [15:56] baudehlo: but do note that if you write "food\r" then "bar\r" your terminal will show "bard". [15:57] baudehlo: plus you have no way of knowing how wide the terminal is. [15:58] larsvegas has joined the channel [15:58] henry- has joined the channel [15:58] bpierre: Does someone knows why Error.prepareStackTrace does not exist, despite this page: http://code.google.com/p/v8/wiki/JavaScriptStackTraceApi [15:58] JaKWaC: How does the \r work? I just ran a quick test and I can't get those results. Tried both with console.log and sys.puts [15:59] formasfunction: baudehlo: hmmm, I'm using console.log "\r" and it's showing up as a newline. [15:59] baudehlo: what OS are you on? [15:59] JaKWaC: Fedora 15 [15:59] formasfunction: baudehlo: Mac OS X [15:59] tbranyen: tjholowaychuk: express got a code review according to javascript weekly [15:59] JaKWaC: I'm uisng urxvt if that would make a difference [15:59] Tidwell has joined the channel [15:59] tbranyen: urxvt owns [16:00] delian66 has joined the channel [16:00] tjholowaychuk: tbranyen link? [16:00] infynyxx has joined the channel [16:00] tbranyen: http://javascriptweekly.us1.list-manage.com/track/click?u=0618f6a79d6bb9675f313ceb2&id=45e7d00343&e=fa41845ff6 [16:00] altamic_ has joined the channel [16:00] altamic_ has joined the channel [16:00] baudehlo: formasfunction: so it does. That's fucked up. [16:00] tjholowaychuk: oh yeah i saw that [16:00] baudehlo: maybe a Javascript-ism [16:00] tjholowaychuk: it's werid he doesn't talk about code too much in his "code reviews" though lol [16:00] nibblebot: anyone working with node-mongodb-native notice that it mangles Numbers? [16:01] rfay has joined the channel [16:01] tjholowaychuk: interesting idea though [16:01] nibblebot: specifically Numbers in the range of Date.now() [16:01] tbranyen: tjholowaychuk: lol, reading it [16:01] formasfunction: baudehlo: Yeah, stinks. Any ideas? [16:01] joshthecoder has joined the channel [16:01] tbranyen: lol tjholowaychuk you even commented on it xD [16:03] bnoordhuis: bpierre: i think that page is obsolete [16:03] bnoordhuis: bpierre: v8's bleeding edge no longer seems to have Error.prepareStackTrace() [16:03] tbranyen: http://www.reddit.com/r/javascript/comments/ig1ig/dae_think_coffeescript_is_ridiculously_overrated/?utm_source=javascriptweekly&utm_medium=email [16:03] tbranyen: lol another good link [16:03] tbranyen: js weekly is on a roll [16:03] bpierre: bnoordhuis: oh, thanks [16:04] bpierre: bnoordhuis: do you know a way to get a structured stack trace? [16:05] baudehlo: formasfunction: oh the problem is console.log puts \n on... [16:05] baudehlo: so you need to use process.stdout.write() [16:05] dtan: has anyone used mongoose-auth/everyauth and express successfully? [16:05] bnoordhuis: bpierre: like this maybe? https://github.com/v8/v8/blob/24af63f8f3681849ab3db68ac08460e7a9e4ef7c/src/messages.js#L934 [16:06] davvebot has joined the channel [16:06] davvebot: http://daveydave.no-ip.org:3000 [16:06] davve: i present nodebot 0.0002 :D [16:06] dshaw_ has joined the channel [16:07] henry-: Hey guys, noob question but how to should I work with a sealized string in node? i.e. ive grabed some form data in jquery with .serialize, whats the best way to turn this into a sexy js object? [16:07] jerrysv has joined the channel [16:07] bpierre: bnoordhuis: Mmm thanks, I will investigate now :-) [16:08] springmeyer has joined the channel [16:08] sandstrom has joined the channel [16:08] c4milo has left the channel [16:09] cccaldas has joined the channel [16:09] chrisjpowers has joined the channel [16:09] red5 has left the channel [16:09] pjacobs has joined the channel [16:09] seawise has joined the channel [16:10] formasfunction: baudehlo: that worked wonderfully, thanks for the help [16:10] tchype has joined the channel [16:10] unlink has joined the channel [16:10] unlink has joined the channel [16:10] derferman has joined the channel [16:11] bnoordhuis: bpierre: i take back the obsolete part but Error.prepareStackTrace doesn't seem to be enabled [16:11] baudehlo: np [16:12] mfussy has left the channel [16:13] michigan101 has joined the channel [16:13] michigan101: https://market.android.com/details?id=com.game.WarStrategy [16:13] slloyd has joined the channel [16:13] michigan101 has left the channel [16:17] sriley: im thinking his time could be better spent making the game better than spamming channels but maybe thats just me [16:17] Xano has joined the channel [16:18] TheJH: sriley, is he doing that in other channels, too? [16:19] sriley: i would assume so, but not in any channel im in [16:20] Corren has joined the channel [16:21] dguttman has joined the channel [16:21] le-1 has joined the channel [16:23] c4milo has joined the channel [16:24] Charuru has joined the channel [16:26] mundanity has joined the channel [16:26] felipellrocha has joined the channel [16:27] Hansy_ has joined the channel [16:29] blup has joined the channel [16:29] newy has joined the channel [16:29] ksheurs has joined the channel [16:30] SirFunk: anyone have any experiacne with everyauth or mongooseAuth [16:32] sivy has joined the channel [16:32] jakehow has joined the channel [16:32] jbpros has joined the channel [16:34] galaxywatcher has joined the channel [16:34] ekryski: SirFunk: a little bit [16:34] SirFunk: do you have any idea how to authenticate a user without using the builtin express helpers ? [16:34] ekryski: what's up? [16:35] ekryski: yes. You have to override the functions in everyauth. [16:35] SirFunk: i can't just do likek User.authenticate('password') or something? [16:35] cloudhead has joined the channel [16:35] Spion has joined the channel [16:36] k0ral: hi, I'm looking for a way to list all files in a directory recursively, is there any library that allows this ? [16:36] maushu has joined the channel [16:38] davve: what happened to multipart module? [16:38] SirFunk: ekryski: any idea:? [16:38] jacobolus has joined the channel [16:38] ekryski: you might. I'm not too sure. Haven't tried that since I am using the built in helpers. But I am overriding them like this [16:38] ekryski: https://gist.github.com/1072213 [16:39] Twelve-60` has joined the channel [16:39] wormphlegm has joined the channel [16:39] seawise_ has joined the channel [16:40] ekryski: You also might want to look at the last example of the README at https://github.com/bnoguchi/mongoose-auth. It shows overriding the actual authentication function [16:41] fattytuna has joined the channel [16:41] ccarella has joined the channel [16:41] SirFunk: yeah.. i don't see any need to override them [16:41] asabil_ has joined the channel [16:41] ekryski: so why do you not want to use the helpers? [16:41] SirFunk: i want to supply login/password... but i want to get it from a json request [16:42] ekryski: you can still do that and just compare it to the login/password of the user in the database. [16:43] tmedema has joined the channel [16:43] tmedema: How do I terminate an ongoing pipe process from stream1 to stream2? [16:43] bingomanatee has joined the channel [16:43] jerrysv has joined the channel [16:43] bingomanatee: I am getting "Process out of memory" errors in node on osx when I see a lot of system memory free on teh Activity monitor [16:44] SirFunk: ekryski: the database doesn't store passwords it stores hashes [16:44] towski has joined the channel [16:44] bingomanatee: Is there a way to allow node to use more memory ? [16:44] brettgoulder has joined the channel [16:44] bingomanatee: FATAL ERROR: JS Allocation failed - process out of memory [16:44] CrabDude has joined the channel [16:44] bingomanatee: is what I see on consolel. [16:44] fawxtin` has joined the channel [16:45] ekryski: SirFunk: you should be able to call the User.Authenticate and then pass in your login and password. I think. Let me check the everyauth code [16:45] SirFunk: that's what i'm trying.. it just returns undefined [16:48] ekryski: hmm. Well when I think about it it is the same as filling in a form except that everyauth has prebuilt functions to handle the login. This is what I had kind of discussed with Brain (the author) and that I thought that you would have to override the authenticate or the login function a lot. [16:48] davve: hey, i [16:48] shinuza has joined the channel [16:48] cloudhead has left the channel [16:48] davve: hey, id like to send a string from my client to node via a form.. any ideas on how to go about this? :) [16:49] davve: running a http-server. [16:49] ekryski: SirFunk: I will actually have to figure this out for my own stuff so let's keep in touch. I'll have to look into it in a little more detail later. I'm currently in a meeting [16:51] SirFunk: ekryski: ok, i'll try to play with it a bit more [16:52] wadey has joined the channel [16:52] ekryski: I'm looking at it and you might be able to set the key for your user name and pass to "loginFormFieldName" and "passwordFormFieldName" [16:53] jacobolus has joined the channel [16:54] ekryski: or override the extractLoginPassword() function [16:54] random123: When I visit in the browser with Node running this script it says "Served request." in the console twice. http://pastebin.com/z36gmAzi [16:54] random123: Why twice instead of once? [16:55] broofa has joined the channel [16:55] tjholowaychuk: favicon [16:55] ekryski: I like the features and the ability to customize everyauth but I'm not sold on some of the default settings. [16:55] random123: Oh, thanks [16:56] dguttman has joined the channel [16:57] SirFunk: ekryski: Actually User.authenticate() might work... i was trying to test it with the node_inspector console... might have been doing it wrong [16:57] ekryski: SirFunk: I think overriding the extractLoginPassword or the Authenticate functions are the best solution. [16:57] ekryski: but ya I think you can just call it and pass whatever you want. [16:58] _sorensen_ has joined the channel [16:58] SirFunk: i'm trying to write a quick post controller to test it (i'm new to node.. so it might take me a while :) ) [16:58] dnjaramba has joined the channel [16:59] creationix has left the channel [16:59] ekryski: you'll just have to point to a different controller functions for your AJAX compared to your regular login (because the default view is handled by everyauth) [16:59] ekryski: you could also override that too. :-) [16:59] pHcF has joined the channel [17:00] ekryski: It took me a bit to get used to but like I said I like the mechanism everyauth uses. It's easy to customize. I'm just not sold on all the defaults. [17:00] caolanm has joined the channel [17:02] dtan: ekryski, sirfunk, i've been trying to implmeent mongoose-auth/everyauth and keep on running into this issue: https://github.com/bnoguchi/mongoose-auth/issues/31 [17:02] tanepiper: tjholowaychuk: any idea why with expressjs on some machines we're getting headers in the body and no cookie set? [17:02] dtan: have you guys seen anything like this? [17:02] tjholowaychuk: tanepiper responding twice maybe? I've seen weird things like people doing res.render(...); res.end() [17:03] tjholowaychuk: could be something like that [17:03] tjholowaychuk: other than that i'm not sure [17:03] saschagehlich has joined the channel [17:03] tanepiper: for example yesterday, we tested on one mac - no matter what browser we used it happened, and killed that session [17:03] tanepiper: but it was limited to that mac only [17:03] tanepiper: but some other people are having the issue today, as far as i can tell mac users [17:03] tanepiper: nahh, i'm only using res.render [17:04] tjholowaychuk: interesting, I'm on osx and I've never seen that [17:04] thalll has joined the channel [17:04] tanepiper: yea, at first we thought it might be on that mac with webkit cos it happened in chrome and safari, but we tried it in FF as well and same thing happened :/ [17:04] tanepiper: but no one else had the issue [17:04] ajpiano: anyone around able to give me a gentle push with NVM? i've used it in the past, but now when i do an nvm sync, it can't pull a stable or latest, and even though v0.5.0 shows up when i do "nvm ls," it fails when i attempt to install it [17:05] mapleman has joined the channel [17:05] tjholowaychuk: try reproducing it with a small app [17:05] Skola has joined the channel [17:05] tjholowaychuk: then i can check it out [17:05] tanepiper: jerrysv is having the same problem (but i don't know if he's on a mac or not) [17:05] ajpiano: screenshot of recent terminal, if that helps at all: http://ajpiano.com/cap/335e25.png [17:07] SirFunk: hm,m i'm using bodyParser and i'm getting unexpected token ILLEGAL.. what am i doing wrong.. hmmm [17:08] tanepiper: passing invalid JSON ? [17:08] pen_ has joined the channel [17:08] tanepiper: that tends to be the exception thrown with JSON.parse [17:08] mraleph1 has joined the channel [17:09] SirFunk: whoa!!! [17:09] SirFunk: i didn't know that strings had to be in " not ' in json [17:09] SirFunk: mind=blown [17:09] dtan: ha [17:10] dtan: sirfunk, did you see my question earlier? [17:10] SirFunk: dtan: oh, nope, let me check the link now [17:10] tanepiper: SirFunk: http://i.imgur.com/b7vUM.gif ? [17:10] dtan: cool thanks [17:11] SirFunk: dtan: can i see your app.js ? [17:11] dtan: it's super messy hehe [17:11] Renegade001 has joined the channel [17:11] SirFunk: tanepiper: nice :) [17:11] SirFunk: dtan: that's fine [17:12] dtan: do you have a github account? [17:13] SirFunk: dtan: i do [17:13] dtan: ok it's on a private repo right now as i do dev work on it, what's your account and i can add you to it for now [17:14] vid_ has joined the channel [17:14] industrial has left the channel [17:14] Poetro__ has joined the channel [17:14] SirFunk: dtan: can you just pastebin it or something? i'm guessing your just missing something in the setup [17:14] heavysixer has joined the channel [17:15] dtan: well it's spread over a few files that's why i thought it'd be easier to see it in github than pastebin [17:15] newy has joined the channel [17:15] dtan: let me revert it and then i'll just do the two files that it concerns [17:16] SirFunk: ok [17:16] vid_ has joined the channel [17:16] theCole_ has joined the channel [17:16] slajax has joined the channel [17:16] SirFunk: ekryski: i almost got it. i can pass the username/pass through json but yeah.. it redirects the json request :-P so i do need to override something [17:17] tayy has joined the channel [17:18] bergie has joined the channel [17:18] dtan: sirfunk - here you go: http://pastie.org/2183845 http://pastie.org/2183849 [17:18] dtan: please forgive the setup [17:18] dtan: still just learning node/express [17:18] mustakes has joined the channel [17:18] dtan: brb though, need to grab some food real quick [17:19] mustakes has joined the channel [17:20] mendel_ has joined the channel [17:20] SirFunk: dtan: did you say you had tried this: app.use(mongooseAuth.middleware()); or no? [17:20] shanez has joined the channel [17:22] ekryski: sorry I had to step away for a sec. I'll look it over [17:22] bene1 has joined the channel [17:23] bene1 has left the channel [17:23] Cleer has joined the channel [17:23] dtan: sirfunk - first link, line 34 [17:23] dguttman has joined the channel [17:23] m4rcs has joined the channel [17:23] SirFunk: ekryski: thanks, no hurry. i just can't figure out where the redirect happens.. i want to return the user object instead of redirecting [17:24] SirFunk: dtan: oose missed that [17:24] dtan: np [17:24] dtan: ya weird setup b/c app.use was not working either [17:24] dtan: so i tried the README example [17:24] SirFunk: dtan: not really sure.. maybe try from a simpler setup like in the docs and then add in you other stuff bit by bit until it breaks? [17:24] dtan: but still same results [17:25] davve: how to i redirect someone? [17:25] SirFunk: dtan: jere [17:25] SirFunk: dtan: here is my working example http://pastie.org/2183895 [17:26] guidocalvano has joined the channel [17:26] dtan: cool thanks sirfunk [17:27] jvduf has joined the channel [17:27] langworthy has joined the channel [17:27] puffpio has joined the channel [17:27] m4rcs: hey guys! I just have short question. Is there any manual similar to php.net for javascript? [17:27] altamic has joined the channel [17:27] altamic has joined the channel [17:27] ekryski: SirFunk: so there are a couple things to note. Your login routes that you have defined inside of app.js will not be used because everyauth is hijacking them [17:28] ekryski: also. You would need to override respondToLoginSucceed() so that it returns an object (or whatever) instead of just redirecting [17:28] SirFunk: ekryski: everyauth just hijacks .get right? i'm usin g.post [17:29] SirFunk: i'm sure it's hitting my route [17:29] SirFunk: ahh! [17:29] SirFunk: let me look at the orig respondToLoginSucceed [17:29] postwait has joined the channel [17:29] ekryski: I don't think so but try taking out the route that you defined inside app.js. The one that you specified in the schema is the one that will be used [17:30] maushu has joined the channel [17:30] ekryski: everyauth hijacks login, register, and logout. [17:30] SirFunk: just .get for those [17:31] ekryski: by default they redirect to whatever path you specified in the model. If you so choose you can override them [17:31] felipellrocha has joined the channel [17:31] bradleymeck_ has joined the channel [17:31] ekryski: I don't think so. I think the post as well. [17:31] sourcode has joined the channel [17:32] SirFunk: ekes: i have a app.post('/login' that is definitely being hit [17:32] SirFunk: sorry ekryski i mean [17:32] othiym23 has joined the channel [17:33] ekryski: hence why login and register work. what is your path in the url? is it "/registration/register" or just "/register"? [17:33] amerine has joined the channel [17:33] enderwiggin has joined the channel [17:34] enderwiggin: hello [17:34] SirFunk: ekryski: i'm making a post request to /login [17:34] ekryski: yes. that is the one that is define in your model. [17:35] le-1 has left the channel [17:35] enderwiggin: I'm a nodejs noob with what i think is a simple question [17:35] dtan: eryski - which model? the UserSchema.plugin....password model? [17:35] ekryski: yes [17:36] SirFunk: ekryski: bingo.. got it working 100% [17:36] simenbrekken has joined the channel [17:36] dtan: gotcha [17:36] enderwiggin: I want to serve wikipedia from localhost and I wrote this https://gist.github.com/1072332 [17:36] enderwiggin: but apparently is must be the wrong host or something because its not working [17:36] ekryski: SirFunk: you had to override right? [17:36] CIA-110: node: 03Henry Rawas 07master * r1018e7d 10/ (lib/net_uv.js test/simple/test-net-isip.js): isIP test - http://bit.ly/pt3SZ1 [17:37] SirFunk: ekryski: oh, well.. 2 things.. 1.) your right, it does catch POST.. but i overrode respondToLoginSucceed to do res.send(user) and that works [17:37] SirFunk: not sure if i like doing that though... [17:37] cccaldas has joined the channel [17:37] jbpros has joined the channel [17:37] dtan: sirfunk, can you update your working example/ [17:37] dtan: ? [17:38] SirFunk: dtan: to do auth via json? [17:38] SirFunk: ekryski: i guess that's the only way to do it.. oh well [17:38] seawise has joined the channel [17:38] ekryski: That's how it works. It's how you are allowed to have customization. Kinda strange I know, but once you get used to it it works well [17:38] dtan: sirfunk, currently up in the air since i'm just prototyping stuff out [17:39] dtan: but would be good to see actual working examples [17:39] ekryski: I really have to get my blog going so that I can add these things. It will save peeps a bunch a time [17:39] ekryski: It took me a while to figure it out. I had to talk to Brian a couple times. [17:39] SirFunk: ekryski: well it would be nice to have the optoin of just catching the json stuff and handling it one way and handling get requests another way.. but for this project i don't need get [17:40] ekryski: ya true. The tough thing is that Brian wanted to right an API essentially that anyone could customize. So you need to keep it pretty minimal [17:40] ekryski: *oops write not right [17:41] CIA-110: node: 03Ryan Dahl 07master * r15286c8 10/ Makefile : Start 'make test-uv' command - http://bit.ly/o3YNVS [17:41] ekryski: glad you got it figure though. [17:41] ekryski: :-) [17:41] srid has joined the channel [17:41] blueadept has joined the channel [17:41] harth has joined the channel [17:42] isaacs has joined the channel [17:42] dawolf has joined the channel [17:42] sweetd has joined the channel [17:42] dawolf: hi [17:43] davve: yo. whats a quick and dirty way to redirect after a post? (is there a nodejs-way?) [17:43] SirFunk: ekryski: thanks for the help [17:43] ekryski: no problem [17:43] dawolf: getting started on my first node.js project. populating a twitter list with usernames from a text file or other source. should keep me busy for some time... [17:43] dtan: davve - i think you can do res.redirect(url) [17:44] davve: dtan: let me try [17:44] mandric has joined the channel [17:44] dtan: i think a twitter-based example should become the new "hello world" example [17:44] dtan: heh [17:44] `3rdEden has joined the channel [17:45] Skola: why? [17:45] mbrevoort has joined the channel [17:45] TooTallNate has joined the channel [17:45] mjijackson has joined the channel [17:46] ryan_ has joined the channel [17:46] dtan: idk, it's not hard to do something simple with pulling in the public twitter api stuff [17:46] smolyn has joined the channel [17:46] dtan: well, i also did one just as an excercise on top of express [17:48] Skola: sure, but it isn't very essential to node. Maybe it's "cool" for kids or something, but it's rather uninspired, even if it's kinda cute. [17:48] dtan: neither is a hello world example [17:48] Skola: gotcha [17:48] dtan: at least it goes beyond just printing "hello world" to the screen [17:48] davve: dtan: no such luck :/ [17:48] dtan: really, davve? [17:49] Skola: putting hello world in a browser is kinda cool to me though [17:49] dtan: i have this: http://pastie.org/2183997 [17:49] Skola: but I can see where you're coming from [17:49] dtan: you say potato i say tomato [17:50] reid has joined the channel [17:50] voodootikigod has joined the channel [17:51] Skola: maybe if you have a nice example that demonstrates specific features of the node API, you could put it forward for inclusion in the docs [17:51] Xeon06_ has joined the channel [17:51] Xeon06_: Hey all [17:51] davve: Object # has no method 'redirect' [17:51] davve: same with redirecturl. [17:51] dtan: ooh, wait, sorry, i think that's express specific [17:51] Xeon06_: I was wondering if someone could quickly tell me the status of node.js running natively on Windows? [17:52] Skola: it is yes [17:52] Skola: @ dtan/davve [17:52] dtan: skola, but like you said, it's not node-specific, but might be just another way to show something beyond printing out a single line of text to teh screen [17:52] Corren: o/ [17:52] Corren: anyone using typhoon [17:52] davve: dtan: ah ok. [17:52] Murvin has joined the channel [17:52] hassox has joined the channel [17:53] dtan: sorry about that [17:53] chrisjpowers has joined the channel [17:53] fly-away has joined the channel [17:53] theCole has joined the channel [17:54] davve: dtan: no problem [17:55] madsleejensen has joined the channel [17:55] mandric has joined the channel [17:55] Skola: dtan it's such a well-known example though [17:56] Skola: and in node it involves more than just printing to stdout [17:56] altamic has joined the channel [17:56] altamic has joined the channel [17:56] Skola: but the node team is looking for examples for the docs [17:57] dtan: skola, ya true, but mine was also just on top of express [17:57] Skola: you got it on github? [17:58] dtan_ has joined the channel [17:58] dgathright has joined the channel [17:58] dnjaramba has joined the channel [17:59] rfay has joined the channel [17:59] AvianFlu has joined the channel [18:00] cha0s has joined the channel [18:00] cha0s has joined the channel [18:00] highermath_away has joined the channel [18:00] gxdssoft has joined the channel [18:01] hij1nx has joined the channel [18:01] DTrejo has joined the channel [18:03] cognominal has joined the channel [18:04] tchype has joined the channel [18:07] bronson has joined the channel [18:07] MacDiva has joined the channel [18:08] Xeon06_ has joined the channel [18:08] corytheboyd has joined the channel [18:09] unomi has joined the channel [18:10] highermath_away has joined the channel [18:10] sweetd has joined the channel [18:10] Mrfloyd has joined the channel [18:11] galaxywatcher has joined the channel [18:11] tchype has joined the channel [18:11] bpierre: I come back with my prepareStackTrace problem. Does anyone knows why it does not work with runInNewContext? https://gist.github.com/1072408 [18:11] djcoin has joined the channel [18:12] blueadept: anyone know how i can turn a header like this: http://pastie.org/private/uikqtxta3dadeoakbdp0w into an object which i can reference by object['Content-Type'] ? or just a simple json array? [18:13] blueadept: split by the first colon, i guess? [18:13] tjholowaychuk: split on CRLF [18:13] tjholowaychuk: then colon etc [18:14] tmedema: Why is this an invalid Regular Expression? /size=\b*([0-9]+)kB/ [18:14] blueadept: cool, ty [18:14] tjholowaychuk: blueadept https://gist.github.com/1072420 [18:14] tjholowaychuk: the \r? was there for FF [18:14] tjholowaychuk: because it's lame and uses LF not CRLF [18:14] tjholowaychuk: for whatever reason [18:14] blueadept: tj: awesome [18:15] tmedema: getting Invalid regular expression: /size\=\b*([0-9]+)kB/: Nothing to repeat [18:15] tmedema: Eh, I mean: Invalid regular expression: /size=\b*([0-9]+)kB/: Nothing to repeat [18:15] simenbrekken has joined the channel [18:16] smtlaissezfaire has joined the channel [18:16] TheJH: tmedema, found it [18:16] tmedema: TheJH: you did? ;) [18:16] Wizek has joined the channel [18:16] TheJH: tmedema, \b means "beginning", and * (beginning multiple times doesn't make sense [18:17] mraleph1: bpierre: because runInNewContext runs things in (surprise!) new context. [18:17] TheJH: s/times/times)/ [18:17] temp01 has joined the channel [18:17] tmedema: TheJH: I believe \b means any word-spacing character, such as space or new line [18:17] mraleph1: bpierre: where new context means everything new including error object [18:17] corytheboyd: \s [18:17] bpierre: mraleph1: Yeah, but not the error? [18:17] tmedema: TheJH: https://developer.mozilla.org/User:quzi3/Guide/Regular_Expressions [18:18] tmedema: \b Matches a word boundary, such as a space or a newline character. [18:18] bpierre: mraleph1: Oh ok, let me test this :-) [18:19] highermath_away has joined the channel [18:19] highermath_away has joined the channel [18:19] TheJH: tmedema, then try these two examples on the REPL: `/\ba/.exec('za')` and `/\ba/.exec('az')` [18:19] Swizec has joined the channel [18:19] aheckmann has joined the channel [18:20] herbySk has joined the channel [18:22] bpierre: mraleph1: It works. Thank you! [18:22] mraleph1: mraleph: welcome [18:24] corytheboyd: are there any ongoing projects to parse BIND files into JS objects? I can't seem to find any JS implementations [18:24] mbrevoort has joined the channel [18:25] Wa has joined the channel [18:25] puffpio has joined the channel [18:26] tjholowaychuk: corytheboyd haven't seen one for node [18:27] temp01 has joined the channel [18:28] corytheboyd: I guess I'll finish mine then, thanks [18:28] smolyn: i'm trying to use jasmine-node to run some tests for some javascript code i've written as part of a bigger application. However, it's not all in node/commonjs format. Is there an easy way I can require('somefile') and let it pollute the global namespace? [18:28] mandric_ has joined the channel [18:28] smolyn: unfortunately it looks like node no longer has an include() function [18:30] ryah_: include is not possible [18:30] AvianFlu has joined the channel [18:31] felipellrocha has joined the channel [18:31] smolyn: huh, so there's nothing i can do? [18:31] mandric has joined the channel [18:31] SubStack: you have to write your code the good way I'm afraid [18:31] k0ral: hi guys, could someone brief me quickly on variables' range ? [18:32] k0ral: I've got troubles with getting a variable outside a function [18:32] dingomanatee has joined the channel [18:32] SubStack: smolyn: there's vm.runInNewContext [18:32] AvianFlu has joined the channel [18:32] dingomanatee: Morning SS [18:32] SubStack: you could read back the resulting context and do stuff with it [18:32] dingomanatee: I am getting memory errors with https://gist.github.com/1072455 [18:32] dingomanatee: is 184k too big for a buffer size? [18:33] dingomanatee: or a fs.read chunk? [18:33] smolyn: right that makes sense. i guess I could also somehow just eval() the code directly from the file [18:34] hornairs has joined the channel [18:35] doubletap has joined the channel [18:35] luke` has joined the channel [18:35] felipellrocha_ has joined the channel [18:36] smolyn: cool, just eval'ing the file from the fs worked [18:36] muhqu has joined the channel [18:36] tmedema: How can a call to require('util').debug possibly cause the following exception? process.binding('stdio').writeError('DEBUG: ' + x + '\n'); ^ TypeError: Object # has no method 'binding' [18:37] baudehlo: tmedema: what version of node? [18:37] luke`_ has joined the channel [18:38] tmedema: baudehlo: v0.4.8 [18:39] tmedema: looks like I am messing something up somewhere, as it works in a standalone call [18:39] tmedema: but not in my specific app [18:39] hellp has joined the channel [18:40] doubletap: NPM question: I cant seem to figure out the 'rm' signature. Is it like >npm rm zombie@0.6.2 ? when I do that, I keep getting the response that it is not installed even though I can see it in the ls. I also tried >npm rm zombie. [18:41] tchype has joined the channel [18:41] AvianFlu has joined the channel [18:41] langworthy has joined the channel [18:42] jmoyers has joined the channel [18:43] jvduf_ has joined the channel [18:43] sbrekken has joined the channel [18:44] tmedema: Does TypeError: Object # has no method 'nextTick' sound familiar to anyone? [18:45] davvebot has joined the channel [18:45] patzak has joined the channel [18:45] patzak has joined the channel [18:45] davvebot: http://daveydave.no-ip.org:8080/irc [18:45] davve: check out my bot :P [18:45] davve: you can write stuff! [18:45] tmedema: stack trace: https://gist.github.com/1072500 [18:46] JaKWaC: davve: Looks like it crashed :/ [18:46] davvebot has joined the channel [18:46] davve: JaKWaC: i restarted it [18:46] davve: :D [18:47] patzak has joined the channel [18:47] patzak has joined the channel [18:47] davvebot: Hello [18:47] davvebot: hiya [18:47] davvebot: Hello-node.js [18:47] JaKWaC: Looks like it doesnt handle spaces very well [18:48] davvebot: testing [18:48] Skola: davvebot boo [18:48] davve: JaKWaC: ah you [18:48] davve: re correct [18:48] davve: im on it. [18:48] davvebot: blieb [18:48] rajivn has joined the channel [18:49] davvebot: Skola%2B%2B [18:49] Skola: lol [18:49] davve: :) [18:49] Skola: you might wanna escape that [18:49] Skola: I WANTED FREE BEERS [18:49] davvebot: eval%282%2B2%29 [18:49] Skola: :[ [18:49] perlmonkey2 has joined the channel [18:49] CIA-110: libuv: 03Igor Zinkovsky 07master * re147155 10/ src/uv-win.c : fix in uv_insert_pending_req to work with multiple requests - http://bit.ly/qb1Mau [18:50] davvebot: you [18:50] davve: Skola: what were you trying to do? [18:50] Skola: ++ [18:50] Skola: Skola++ [18:50] v8bot: Skola: Don't cheat! You can't give a beer to yourself. [18:50] catb0t: Skola now has 3 beers [18:50] tmedema: I created a FFmpeg library today (it's open source), you can check it out here: https://github.com/tommedema/NodeBasicFFmpeg - However, when I try to run the first example (https://github.com/tommedema/NodeBasicFFmpeg/blob/master/example/audio/main.js) I get the following stack trace: https://gist.github.com/1072508 I cannot figure out what the issue is. Anyone can? [18:50] davve: ah. [18:51] dtan has joined the channel [18:52] tjholowaychuk: is pipe()ing to stdout supposed to close stdout [18:53] b_erb has joined the channel [18:53] tjholowaychuk: doesn't seem very desirable [18:54] mendel_ has joined the channel [18:54] muhqu_ has joined the channel [18:55] tmedema: tjholowaychuk: sorry were you talking to me? [18:55] tjholowaychuk: nope [18:55] tmedema: oh [18:55] tjholowaychuk: something.pipe(process.stdout) [18:55] tjholowaychuk: closes stdout [18:56] CrypticSwarm has joined the channel [18:56] tmedema: hmm is that related to my lib? [18:56] tjholowaychuk: no [18:56] tmedema: oh, alright, sorry I am confused because I believe I have a similar issue [18:56] davvebot has joined the channel [18:56] caiges has joined the channel [18:56] davvebot: hehe hehe [18:57] Skola: davve got source up somewhere? [18:58] davve: Skola: naw. not yet. [18:59] corytheboyd: anyone know of any good DNS management APIs? Just looking at the APIs to get an idea of their functionality. So far I have found one for Zerigo, which seems pretty well put together [19:00] tmedema: I created a new topic on the ML regarding my issue http://groups.google.com/group/nodejs/t/5defb7cf92c25260 [19:00] Skola: ok I wanna do a little bot myself [19:00] Skola: if you open-source it I would contribute to yours if you'd like [19:00] Skola: understand if you don't wanna, but lemme know [19:00] red5 has joined the channel [19:04] wdperson has joined the channel [19:05] davve: Skola: will do, its really basic. id give you the code now but id like to clean up the code and fix some bugs first :) [19:05] baudehlo: anyone here use couchdb? Experiences good/bad? [19:06] Skola: davve you can send me anyway if you'd like [19:06] ts__ has joined the channel [19:06] Skola: I could go through it tomorrow [19:06] Skola: or if you prefer, give me a shout when you cleaned it up [19:07] jameson has joined the channel [19:07] davve: ok [19:07] kytibe has joined the channel [19:10] dgathright_ has joined the channel [19:11] voodootikigod has joined the channel [19:12] dingomanatee: Does anyone have any suggestions as to why https://gist.github.com/1072455 should cause a memory overflow? is 184k too big for a buffer size or a file.read? [19:13] dingomanatee: Also, is Mongo potentially fighting for RAM when you put said chunks into it? [19:13] joshontheweb has joined the channel [19:14] voodootikigod has joined the channel [19:14] dtan: when retrieving documents from a mongodb, can you not modify the key/value pairs on the fly after retreiving them from the database? [19:14] dtan: for example, i have a 'date' property in the documents and i want to format the date before it hits the template [19:15] context-: so put a function in the object representing the doc or put it in some helper method ? [19:16] Skola: sure that's possible dtan [19:16] dtan: helper method [19:16] dtan: for some reason it's not chagning the property after running it through my helper method [19:16] Skola: I usually do that by adding a method to the model [19:16] dtan: oh? [19:17] dtan: do you have any examples, whether they are yours or just on the web, skola? [19:17] Skola: oh sorry didn't read correctly, I add methods to be used when entering them into the DB [19:17] context-: function my_formatted_date() { return format_date_magic(this.date); } [19:18] dtan: context- that is basically waht i'm doing [19:18] Skola: but just as well you might add a function to be used before processing them [19:18] dtan: right, that's what i was thinking actually [19:18] Skola: it should be good enough :) [19:18] Mrfloyd has joined the channel [19:18] context-: dtan: then <%= model.my_formatted_date() %> or whatevz in yoru view [19:18] dtan: right, i could have my raw date and then my formatted date [19:18] Murvin: hi. [19:18] doubletap: anyone know if express 2 works with node.5? [19:18] Skola: context- I prefer to do that kind of stuff in my routing [19:19] Murvin: in express, before I do res.render('my.html'); what can I do to check if the file exist? [19:19] context-: eh? [19:19] Skola: or in my resources to be precise [19:19] context-: i prefer to not put presentation specific stuff into the database [19:19] tjholowaychuk: Murvin fs.stat() [19:20] Skola: or path.exists, or is fs.stat() preferable? [19:20] dtan: but i'm not crazy thinking that i can modify a property after fetching it from teh db, right? [19:20] tjholowaychuk: Murvin though views should already be present, unless you passing a var as the view name [19:20] dtan: by doing a simple for loop, then when that is done pass off the modified content to my view [19:20] Skola: no of course not dtan [19:20] Murvin: tjholowaychuk: that's exactly what I'm doing.. [19:20] Skola: that's fine [19:20] dtan: then wtf is going on here.... [19:20] Nuck has joined the channel [19:20] dtan: it's not modifying the property for some reason [19:21] Skola: pm [19:21] tjholowaychuk: Murvin may I ask why? (just curious) [19:21] Murvin: tjholowaychuk: so, if file not exist in the view, i want to display 404. should I do app.error instead? [19:21] sreeix has joined the channel [19:21] tjholowaychuk: why wouldn't the view exist [19:21] Skola: never know! [19:22] tjholowaychuk: that's a dev error [19:22] tjholowaychuk: unless you are allowing users to specify views [19:22] tjholowaychuk: which is sketchy [19:22] Murvin: tjholowaychuk: because my coworker will put in pages in the view. and I don't want to define in code everytime he makes the change. [19:22] Wizek_ has joined the channel [19:22] tjholowaychuk: hmm.. [19:23] Murvin: tjholowaychuk: so, i just do app.get('/*') and display res.render(res.params[0] + '.html'); [19:23] Murvin: but if file not exist, it will throw "Internal server error" [19:23] tjholowaychuk: well if it's static like that [19:23] tjholowaychuk: why not just use express.static() [19:23] tjholowaychuk: or just an html site [19:23] tjholowaychuk: with no node [19:23] Skola: why use views for .html? [19:23] tjholowaychuk: yeah you shouldn't unless it's ejs etc [19:23] Murvin: express.static hmm [19:24] Murvin: i haven't looked at it.. let me take a look [19:24] brettgoulder has joined the channel [19:24] Skola: but what are you using views for? [19:24] Murvin: i use the static for the js. [19:24] tjholowaychuk: express.static(__dirname + '/pages'); [19:24] tjholowaychuk: define them in there [19:24] Skola: if it's not an actual template, serve it as a static resource [19:24] tjholowaychuk: GET /foo/bar.html [19:25] blup has joined the channel [19:27] jameson_ has joined the channel [19:27] rfay has joined the channel [19:27] JoshC1 has joined the channel [19:29] Wizek__ has joined the channel [19:29] rworth has joined the channel [19:30] dingomanatee: dtan: re mongo lookup update with $set and other atomic operations [19:31] dtan: dingomanatee , well i'm just trying to catch it before it hits the template view [19:32] socketio\test\49 has joined the channel [19:32] Determinist has joined the channel [19:34] bogomips2__ has joined the channel [19:34] Candid has joined the channel [19:36] superjudge has joined the channel [19:36] Wizek_ has joined the channel [19:39] mbrevoort has joined the channel [19:39] Wizek has joined the channel [19:40] cha0s has joined the channel [19:40] indexzero has joined the channel [19:41] indexzero: ARE YOU READY FOR SOME JAVASCRIPT MOTHER $&%*@#!? [19:41] Wizek__ has joined the channel [19:42] systemfault: JAVASCRIPT MOTHERFUCKER, CAN YOU WRITE IT? [19:42] tbranyen: JAVASCRIPT DO YOU SPEAK IT? [19:42] indexzero: haha [19:42] squeese: UNDEFINED [19:42] bogomips2_ has joined the channel [19:42] indexzero: MAXIMUM CALL STACK EXCEEDED [19:43] tbranyen: DOES JAVASCRIPT LOOK LIKE A RUBY? NO SO WHY YOU TRYING TO &%#^ IT LIKE ONE? [19:43] systemfault: Haha, the fact that tbranyen ignored me if fun [19:43] mustakes has joined the channel [19:43] dtan: hah [19:43] indexzero: back from vacation (Virgin Islands for a week), so I'm back in the coding groove [19:43] Mr_Wali has joined the channel [19:43] red5 has left the channel [19:43] indexzero: 2 new libraries, 3 minor version releases, ~10 bug fixes [19:43] tbranyen: nice [19:44] indexzero: my fingers needed the exercise :-D [19:44] Wizek_ has joined the channel [19:45] skapism has joined the channel [19:46] skapism: does anyone know how can I return a value from mongodb's driver's find? it seems the only way is to use a callback, but I'd like to write a wrapper function that simply returns the data [19:46] dtan: skapism, well i'm using mongoose and it seems that with the nature of node you need to do the callback [19:47] dtan: i didn't see any sort of sync way of doing the db request [19:47] bpierre: Is there a way to prevent variables reassignments in vm.Script.runInNewContext? [19:47] piscisaureus__ has joined the channel [19:47] skapism: dtan: I just have a server where I want the api to return the results of a find operation [19:47] bpierre: I tried with __defineSetter__, but it could be redefined too [19:47] bnoordhuis: bpierre: do you mean Object.freeze()? [19:48] smtlaissezfaire_ has joined the channel [19:48] tbranyen: Object.freeze blows [19:48] bpierre: bnoordhuis: I did not know it, I try [19:49] dtan: skapism - are you using straight mongo? not mongoose or anything? [19:49] skapism: dtan: mongodb on npm [19:49] bnoordhuis: tbranyen: ? [19:51] patcito has joined the channel [19:51] dtan: skapism, i'm no expert on this , but mongoose seems to be a good middleware for mongo [19:52] tbranyen: bnoordhuis: no unfreeze [19:53] tbranyen: or defrost [19:53] bnoordhuis: tbranyen: right, but that's kind of the point, isn't it? [19:53] tbranyen: is it? [19:53] skapism: dtan: hm... [19:55] rfay has joined the channel [19:56] level09 has joined the channel [19:56] puffpio_ has joined the channel [19:56] adambeynon has joined the channel [19:57] dtan: skapism - http://pastie.org/2184540 [19:57] dtan: that's a snippet of a fetching posts from a mongodb using mongoose [19:57] broofa has joined the channel [19:57] dtan: let me edit that a little bit so you can see where Post comes from [19:57] bergie has joined the channel [19:57] skapism: dtan: that's using a cb, no? [19:58] dtan: ya [19:58] dtan: but that's what i'm ssaying, i think you need to use a cb when you look up stuff from the db [20:00] b_erb has left the channel [20:01] skapism: dtan: yeah, the only problem is that this forces the caller, the client, to send a callback with what the do. if you just always want to return the values, it would be nice if it was already possible on the server side [20:01] skapism: dtan: but I guess you could wrap the requests on the server side with some assignment [20:01] dtan: right [20:01] emuyser has joined the channel [20:01] skapism: data = this[0] [20:01] skapism: or so [20:02] dtan: you get the client request, run it through your db wrapper with your predefined callback that does the roundtrip back to the client [20:02] level09: is there any modules to implement caching ? [20:02] skapism: yup [20:02] andyl has joined the channel [20:02] level09: specifically for the http server [20:03] level09: cache the response for some time [20:03] level09: does express has caching built in ? [20:03] dtan: skapism, that's basically waht i'm doing with that snippet i sent you [20:03] Murvin: tjholowaychuk: went for lunch.. thanks for the hints. :) so, can I have both express.static and app.set('view') work together? [20:04] tjholowaychuk: Murvin: well yeah most people have views and static content [20:04] tjholowaychuk: but they are completely different [20:04] dtan: when you load a page, it just calls the Posts model with a cb which has my predefined search params and then the results are passed back to the cb [20:04] tjholowaychuk: .html with nothing dynamic shouldn't be res.render() [20:05] Murvin: tjholoywachuk: ok. that really makes sense. let me work on it now. :) [20:05] skapism: dtan: yep [20:06] gozala has joined the channel [20:07] supster has joined the channel [20:07] CIA-110: node: 03Henry Rawas 07master * rff49299 10/ Makefile : add tests to "make test-uv" - http://bit.ly/pbQMct [20:07] onr has left the channel [20:07] pt_tr has joined the channel [20:12] unomi has joined the channel [20:12] rfay has joined the channel [20:13] markwubben has joined the channel [20:15] bradleymeck_: is there a way to use http.request with a unix domain socket? [20:15] bradleymeck_: or only tcp? [20:17] yoav1 has joined the channel [20:17] liquidproof has joined the channel [20:18] Swizec: anyone have any idea why daemonizing with forever works great, but when run from an init script it … doesn't? [20:18] Xeon06_ has joined the channel [20:18] AvianFlu: Swizec: I think there's work being done on forever to make that work [20:19] AvianFlu: I don't have specifics for you but I think you may be waiting on a forthcoming patch [20:19] Swizec: brilliant [20:19] Swizec: any known workarounds? [20:20] AvianFlu: not by me, but I'll ask at some point today and see what I can find out for you [20:23] bpierre: bnoordhuis: Object.freeze() works, thanks! I need to "use strict"; to trigger errors, but it’s good for the code quality :) [20:24] Xeon06_ has joined the channel [20:27] xeodox has joined the channel [20:27] igl1 has joined the channel [20:28] ngs has joined the channel [20:28] bradleymeck_: Swizec, yes there are things being done, do you have a gist of your error (most often there are permissions issues) [20:28] Xeon06_ has joined the channel [20:28] Swizec: bradleymeck_ nothing seems to go wrong, but the server responds to requests with "undefined" [20:29] Swizec: running the same server with forever start server.js works perfectly [20:29] bradleymeck_: swizec, did you set an explicit pid file and log file ? [20:30] Swizec: trying that now [20:30] bradleymeck_: next version coming up fixes and error that sounds like that by getting defaults for those outside of what it does now [20:30] baoist has joined the channel [20:30] bradleymeck_: s/and/an* [20:31] narayan82 has joined the channel [20:32] nibblebot: anyone using log.io? [20:32] nibblebot: the demo is really impressive, why is it not in npm? [20:33] Swizec: bradleymeck_ cool, great to know [20:35] Skola: nibblebot: it's very young : ) [20:35] mendel_ has left the channel [20:36] nibblebot: Skola: i don't have much ops experience but log.io should be really helpful [20:36] Swizec: bradleymeck_ apparently the problem is somehow with using the start-stop-daemon thing [20:36] taf2 has joined the channel [20:37] andyl has joined the channel [20:37] Skola: nibblebot: that was just an explanation for it not being on npm yet [20:37] bradleymeck_: swizec mmm not sure about that [20:38] Skola: it does look good though! [20:38] nibblebot: Skola: yep, i'm sure we'll help it get there if we use it for production [20:38] tdegrunt has joined the channel [20:38] Skola: personally don't have a use-case for it but development seems quite active [20:39] jmalina has joined the channel [20:39] dtan: taht seems pretty cool [20:40] JJMalina has joined the channel [20:41] AvianFlu has joined the channel [20:42] CIA-110: node: 03isaacs 07v0.4 * rfc80ee9 10/ doc/api/fs.markdown : docs for chown/chmod - http://bit.ly/r5yWYW [20:43] adrianmg has joined the channel [20:45] dshaw_ has joined the channel [20:46] indexzero has joined the channel [20:46] jmoyers: nom nom - https://github.com/jeremyw/stamp anything like this in node land? [20:48] brettgoulder has joined the channel [20:48] tjholowaychuk: http://travis-ci.org/ [20:48] bbttxu has left the channel [20:48] tjholowaychuk: is that the sort of thing npm is shooting for? [20:48] tjholowaychuk: looks like ruby ppl are already doing that [20:48] tjholowaychuk: s/already/finally/ [20:49] isaacs: tjholowaychuk: yeah, we're all ripping off perl [20:50] isaacs: tjholowaychuk: but yeah, eventually, stuff like this is what i'd like to see. i prefer cpants display to this, though [20:50] isaacs: oh, this is a build system, too [20:50] isaacs: not just test [20:50] isaacs: i get it [20:50] isaacs: yeah, this is rad. [20:50] tjholowaychuk: ah [20:50] jesusabdullah: What are we discussing? [20:50] tjholowaychuk: there are so many intricacies to this sort of thing [20:50] tjholowaychuk: might eventually work out [20:50] jesusabdullah: I like rad things but i think I missed a good chunk of the scrollback [20:50] isaacs: jesusabdullah: travis-ci.org [20:51] isaacs: jesusabdullah: http://travis-ci.org [20:51] isaacs: tjholowaychuk: i want to get something that actually sits on the npm registry _changes, though [20:51] jesusabdullah: hmm [20:51] tjholowaychuk: yeah for sure [20:51] isaacs: tjholowaychuk: looks like this is a github hook [20:51] jesusabdullah: Reminds me a little of testbedjs [20:51] tjholowaychuk: per release would make more sense [20:52] jesusabdullah: except testbed is testing, not building I guess (idk) [20:52] amerine has joined the channel [20:52] jesusabdullah: http://testbedjs.org/ [20:52] jesusabdullah: BIFF [20:52] jesusabdullah: Actually, it *does* say "continuous integration" [20:52] jesusabdullah: I should point some of my projects to testbedjs.org [20:53] infynyxx has left the channel [20:54] TechCel has joined the channel [20:54] pandeiro has joined the channel [20:55] m00p has joined the channel [20:56] EzeQL has joined the channel [20:57] shanez has joined the channel [20:57] jvduf has joined the channel [20:58] rfay has joined the channel [20:58] level09: is there a callback to console.log function [20:58] puffpio has joined the channel [20:59] Wali_ has joined the channel [20:59] m00p has joined the channel [21:00] guidocalvano has joined the channel [21:01] bnoordhuis: level09: what do you mean? [21:02] mandric has joined the channel [21:02] level09: console.log(message, function(err) { //print completed }); [21:03] tjholowaychuk: level09 i dont believe so [21:03] tjholowaychuk: the vargs are just printed [21:03] level09: so it is .. synchronous [21:04] pt_tr has joined the channel [21:04] level09: I was afraid the app is exiting before everything is printed [21:04] tjholowaychuk: nope [21:04] noryb009 has joined the channel [21:04] tjholowaychuk: .error() is sync [21:04] Determinist: bnoordhuis: any idea when the https 'end' behavior is going to get fixed? [21:05] bnoordhuis: Determinist: most effort is direct towards uv right now so it could be a while [21:06] bnoordhuis: Determinist: does the issue have a standalone test case attached? [21:06] Determinist: bnoordhuis: well, can't really upgrade to node 0.4.8 or above till the http(s) issues are remedied. [21:06] materialdesigner has joined the channel [21:07] Determinist: bnoordhuis: for me, all outgoing HTTP requests stop working when i upgrade to 0.4.8 or above. seems like a pretty fundemental breakage. i wouldn't treat this as something that can be delayed until uv stuff get sorted out. we're not talking about unstable versions here. [21:07] bnoordhuis: Determinist: what's the issue #? [21:08] Determinist: bnoordhuis: 'end' is never called for outgoing http requests [21:08] bnoordhuis: Determinist: i mean what is the number of the bug report? :) [21:08] Determinist: bnoordhuis: https://github.com/joyent/node/issues/728 [21:09] Determinist: bnoordhuis: :P url above [21:10] bnoordhuis: Determinist: thanks [21:10] hij1nx_ has joined the channel [21:10] Determinist: bnoordhuis: np [21:10] shumushin has joined the channel [21:10] bnoordhuis: Determinist: i'll try to look at it later tonight [21:11] FireFly has joined the channel [21:11] bnoordhuis: Determinist: if you can write a test case for node's test harness, that'd help tremendously [21:11] Determinist: bnoordhuis: thanks, this is really important for me. i need 0.4.9 for the openssl verify enhancements but i can't really upgrade because of this issue. [21:11] Determinist: bnoordhuis: sure, what am i looking for? [21:12] bnoordhuis: Determinist: test/simple/test-https-agents.js is probably best [21:13] bnoordhuis: Determinist: as a patch for, i mean [21:13] Determinist: bnoordhuis: so, fork, commit, add pull request? [21:13] hdon has joined the channel [21:14] bnoordhuis: Determinist: yes, please - you'll get extra karma points for making the test not require internet access (i.e. have it connect to a local https server, test-https-agent already sets up one) [21:14] bnoordhuis: Determinist: oh, and please sign the CLA if you haven't already [21:14] Determinist: bnoordhuis: CLA? :) [21:14] bnoordhuis: Determinist: http://nodejs.org/cla.html <- this one [21:14] bnoordhuis: we can only accept patches by people that have signed it [21:15] bnoordhuis: *patches from [21:15] systemfault has joined the channel [21:15] Determinist: cool [21:15] Determinist: sec, doing it [21:17] Melkor_2 has joined the channel [21:17] Determinist: bnoordhuis: ok, did it. how do you guys know that the patch if from me, tho? :P [21:17] Guest73641 has joined the channel [21:19] bnoordhuis: Determinist: we send people round to your home address to check [21:19] bnoordhuis: (i kid, i kid) [21:19] shumushin has left the channel [21:19] Melkor_2: with mongoose is there anyway to build your qry as a str and then model.find(str) ? [21:19] Determinist: :D [21:19] Determinist: go ahead [21:19] Determinist: could be a long flight tho :D [21:19] FireFly|n900 has joined the channel [21:20] bc has joined the channel [21:20] context: as a string? doesn't mongoose take json [21:20] fawxtin`: Why it breaks nodejs when I try to require a file that exports an object that is itself (like http://pastebin.com/P4gziPhV) ? Is this simply a commonjs feature/bug? [21:21] tmedema: When I create a writable stream, like fs.createWriteStream('./outputSong.ogg'), why is the fd (file descriptor) property null? [21:21] Guest73641 has joined the channel [21:21] Melkor_2: I believe it does.. but I can't figure out how to use / in the json object... for example if i want to find any document with "name" inside of it I'd find({/name/}) [21:22] Renegade001 has joined the channel [21:23] context: fawxtin`: i believe it has to do with using 'this' in that context. if you add new before it then it works [21:24] sveisvei has joined the channel [21:25] bnoordhuis: tmedema: because the fd is something you can pass in through the options object [21:25] rworth has joined the channel [21:28] _aron has joined the channel [21:29] theCole has joined the channel [21:30] jhurliman has joined the channel [21:30] jtrudeau has joined the channel [21:30] CIA-110: node: 03Henry Rawas 07master * r19f2484 10/ Makefile : test-uv: add more test cases - http://bit.ly/pj7JNZ [21:31] apardo has joined the channel [21:31] bergie has joined the channel [21:34] unomi has joined the channel [21:35] fawxtin`: context: hmm, but I want the proper object.. it works on the nodejs cli, but doesnt work while _requiring_ it [21:36] context: but there is no object. [21:37] DavidPesta has joined the channel [21:37] context: > var g = (function() {return this;})() [21:37] context: > g [21:37] context: {} [21:37] dgathright has joined the channel [21:38] context: you are returning emptyness [21:39] tmedema: bnoordhuis: are you sure? the docs say these are the options: { flags: 'w', encoding: null, mode: 0666 } [21:40] context: fawxtin`: what do you expect 'this' to be? that function has no 'parent' in a sense [21:40] context: so it cant return anything. [21:41] apardo: buenas [21:41] bnoordhuis: tmedema: it's undocumented, yes [21:42] guidocalvano has joined the channel [21:42] tmedema: bnoordhuis: so how do I tell it to create a new file descriptor? [21:43] hij1nx has joined the channel [21:44] DavidPesta: New node.js user here. I've been trying to get the "hexes" example to work from camp node.js and am having trouble because of things that have changed in various libraries since then. Are there any good examples for me to learn from that work with the current state of the libraries? I've tried fixing things for "hexes" but seem to have become stuck on one point. [21:44] bnoordhuis: tmedema: by writing to the stream, the file is lazily created/opened [21:45] bogomips has joined the channel [21:45] tmedema: bnoordhuis: but I need to pass the file descriptor to child_process.spawn [21:45] b_erb has joined the channel [21:45] jesusabdullah: Anybody in here know stuff about html canvas? Is there a sane way to flip and rotate images? [21:46] tbranyen: jesusabdullah: do you need to save it afterwards? [21:46] DavidPesta: I'm afraid there are a lot of old articles on the web that don't seem to work anymore as good examples. Any expert advice on a good place to start? [21:46] tbranyen: if not, use css rotate [21:46] jesusabdullah: tbranyen: No, I just want to use the same sprite for left and right [21:46] tbranyen: jesusabdullah: css rotation ;-) [21:46] jesusabdullah: Also, this is server-side canvas [21:46] tjholowaychuk: jesusabdullah rotate() [21:46] jesusabdullah: tjholowaychuk: so, node-canvas has this rotate? [21:46] jesusabdullah: tell me more :| [21:46] tbranyen: rotate is weird iirc [21:46] jesusabdullah: Yeah, well [21:47] tbranyen: you freeze the state, rotate, then resume or something [21:47] jesusabdullah: canvas is weird [21:47] tjholowaychuk: yes [21:47] bnoordhuis: tmedema: write an empty string to it [21:47] bnoordhuis: tmedema: but wouldn't you be better off with fs.open()? [21:47] tjholowaychuk: pff, canvas is pretty rad [21:47] jesusabdullah: my opinion of canvas so far: https://github.com/jesusabdullah/node-etchASketch [21:47] pt_tr has joined the channel [21:47] tmedema: bnoordhuis: is that the same thing as opening a stream? I need the streaming API [21:47] jesusabdullah: I mean, you can do some cool stuff with it definitely, but this is what it *feels* like [21:47] tbranyen: tjholowaychuk: i've been working on getting android camera data into a canvas element [21:47] tjholowaychuk: it's not confusing at all [21:47] _sorensen_: zomg etchasketch [21:47] tbranyen: pretty close atm [21:47] tjholowaychuk: tbranyen nice! [21:48] _sorensen_: are you going to make it so you can shake the window? [21:48] b_erb: i have web app and want to disseminate live data to all connected HTTP clients via socket.IO. having a single source of events in my app, is it worth using something like redis for pub/sub? or is okay pushing the message inside my app? [21:48] _sorensen_: and make the lines fade away? [21:48] jesusabdullah: _sorensen_: There's a .shake() method [21:48] scottj has joined the channel [21:48] _sorensen_: yes!! [21:48] _sorensen_: do i shake it with the mouse? [21:48] jesusabdullah: _sorensen_: It's a node-side module, so no web page interactions [21:48] _sorensen_: aww [21:48] jesusabdullah: though, it's not a big stretch to make a client-side interface [21:49] _sorensen_: :D [21:49] _sorensen_: with a classy red container for it [21:49] jesusabdullah: i mean, except for the image export it's pretty much the same as regular canvas [21:49] jesusabdullah: indeed [21:49] jesusabdullah: If you look at the code, you'll see it's pretty simple [21:50] bnoordhuis: tmedema: not the same thing, no - fs.open() is lower level [21:50] tmedema: bnoordhuis: I figured, so that doesn't really help me [21:50] jesusabdullah: Oh, but the thing I don't really like about canvas is that it's very stateful (you set your context's colors, etc. and they stay that way over time instead of having it be a parameter to, say, fillRect()) [21:50] jesusabdullah: well, also that it's strongly biased towards boxes [21:51] tjholowaychuk: a side from not having antialias settings and and masking it's a great little api [21:51] jesusabdullah: It works, sure, but it's just not my gig [21:51] tjholowaychuk: do you like anything? [21:51] jesusabdullah: I think raphael has the right idea, in terms of programmatic drawing apis [21:51] jesusabdullah: Hell yeah I like things [21:51] _sorensen_: isnt raphael SVG? [21:51] tjholowaychuk: yeah but you start with the lower-level stuff [21:51] tjholowaychuk: and build on that [21:51] tmedema: bnoordhuis: is it not possible to give a stream a file descriptor without writing something to it? [21:51] jesusabdullah: _sorensen_: It is [21:52] tjholowaychuk: canvas has many libs like that [21:52] _sorensen_: node-canvas is crazy cool [21:52] jesusabdullah: tjholowaychuk: That's true [21:52] Borgoluzzuo has joined the channel [21:52] tjholowaychuk: otherwise you pull a couchdb [21:52] tjholowaychuk: and only have http [21:52] bnoordhuis: tmedema: no [21:52] jesusabdullah: tjholowaychuk: and I like node-canvas. I'm bitching about the canvas api a little bit but I do like node-canvas. [21:52] Borgoluzzuo: Does anyone know how to run a node instance as a daemon and have no log outputs? [21:52] theCole: paper.js [21:52] jesusabdullah: Oh, I'd forgotten about paper.js [21:52] _sorensen_: theCole: did that just come out? [21:52] jesusabdullah: will google [21:53] bnoordhuis: tmedema: what do you want to do exactly? [21:53] tjholowaychuk: the only thing that bugs me about the canvas api is the drawImage() method [21:53] tjholowaychuk: has funky params [21:53] theCole: paper.js just came out [21:53] Chaoser has joined the channel [21:53] theCole: about 1.5 weeks ago [21:53] jesusabdullah: theCole: Do you know if paper.js will work server side with node-canvas? Because what I'd like to do is programmatically put together .png images server-side [21:53] tjholowaychuk: paper.js is sweet [21:54] tjholowaychuk: jesusabdullah: haven't tried, but we got flot etc working [21:54] tjholowaychuk: massive hack but hey [21:54] jesusabdullah: tjholowaychuk: word. [21:54] _sorensen_: always seems like flot takes massive hacks... [21:54] tjholowaychuk: the hack was mostly because we didnt use jsdom [21:54] jesusabdullah: Oh, speaking of things I don't like: Most javascript plotting libraries [21:54] _sorensen_: even in normal usage >.< [21:54] theCole: jesusabdullah: i have only used paper.js in the browser [21:54] jesusabdullah: I wanna give protovis a shot [21:54] jesusabdullah: and there's one other thing that's kinda based off protovis [21:54] jesusabdullah: but, yeah [21:55] tmedema: bnoordhuis: I am spawning a FFmpeg process. My library accepts an input stream (the incoming audio data) and an output stream (the stream to which converted audio has to be written). The input data has to be send to the ffmpeg process, and output of ffmpeg process has to be send to the output stream. I do not want the child process to create its own streams, as that'd only allow excessive overhead. I tried to pass both input stream [21:55] theCole: jesusabdullah: it is worth checking out [21:55] jesusabdullah: theCole: Thanks for the lead [21:56] jesusabdullah: If anybody is wondering why I'm asking about this stuff: I want to make webcomics, procedurally. [21:56] jesusabdullah: which is why I want to output .pdf in the end [21:56] jesusabdullah: and why I have sprites [21:56] jesusabdullah: and all that jazz [21:56] rvb has joined the channel [21:56] tmedema: bnoordhuis: Passing both FDs to spawn does not seem to be smart, because I do not think this will pipe correctly, so I did allow the child to create a stdin stream, and then I pipe input stream to stdin. However, I do not want it to create a new stdout stream, so I want to pass the output stream file descriptor instead. [21:57] Borgoluzzuo: Does anyone know how to run a node instance as a daemon and have no log outputs? [21:57] daveyjoe has joined the channel [21:57] tjholowaychuk: Borgoluzzuo you dont want logging?? [21:57] jesusabdullah: Ah, node.js is on their to-do list [21:57] jmoyers: forward stdout, stederr to dev/null, i would imagine [21:57] tjholowaychuk: jesusabdullah paper? [21:57] jesusabdullah: Yeah [21:58] Borgoluzzuo: tjholowaychuk: Or at least to run it as a daemon [21:58] tjholowaychuk: oh really [21:58] jesusabdullah: indeed [21:58] fawxtin`: context: if I say 'var g = (function() { return this; })(), f = 'lala'; ', when I say 'g.g.g.g.g.f' it gives me the value of 'f'. anyway, I got stuck why require behaves like that, since in the cli it lets you do that. In the browser this trick is used to get the window itself (I guess). [21:58] jesusabdullah: so, supposing I wanted that feature now, if I got it working I could probably pull request it and such [21:58] daveyjoe: Anybody have any opinions on whether to use `nvm` or `n` for isolating node versions? [21:58] mustakes_ has joined the channel [21:58] zeade has joined the channel [21:58] tjholowaychuk: i dont see it in their issues [21:58] jesusabdullah: It's http://paperjs.org/about/roadmap/ [21:58] jesusabdullah: They have a "roadmap" list [21:59] vnguyen has joined the channel [22:00] bnoordhuis: tmedema: you cannot do that in the current setup [22:00] bnoordhuis: tmedema: because the WriteStream may or may not be backed by a real file [22:00] jmoyers: Borgoluzzuo you can just use nohup, if im not mistaken [22:01] jmoyers: or a package like forever.js [22:01] jmoyers: http://blog.nodejitsu.com/keep-a-nodejs-server-up-with-forever [22:01] tmedema: bnoordhuis: file? it does not have to be a file, can be a socket too [22:01] Determinist: bnoordhuis: add the test case to test-https-agent.js? [22:01] hoodoos has joined the channel [22:01] Borgoluzzuo: jmoyers: I just stumbled upon that. Do you know if this includes ways to kill it if it gets insane memory consumption? [22:01] jmoyers: uh [22:01] hoodoos: hey guys, anybody uses cluser lib here? just wonder why it has to restart master process along with child ones? for what sake? [22:01] jmoyers: i doubt forever does [22:01] jmoyers: you could build a trigger pretty easily [22:01] bnoordhuis: tmedema: if your library accepts a WriteStream, then it's using the wrong abstraction [22:02] bnoordhuis: Determinist: yes, please [22:02] tjholowaychuk: hoodoos config etc [22:02] Borgoluzzuo: jmoyers: Cool, thanks. [22:02] tmedema: bnoordhuis: why is that? [22:02] Determinist: bnoordhuis: k, writing test [22:02] tjholowaychuk: hoodoos the second master signals the original when it's ready to go, so sometimes you have two [22:02] hoodoos: tjholowaychuk, changes to master config? it just ruins my upstart since pid of master process is being changed :( [22:02] smtlaissezfaire_ has joined the channel [22:02] cccaldas has joined the channel [22:03] tjholowaychuk: yes. that's the only reasonable way to have the master update [22:03] tjholowaychuk: well upstart is lame [22:03] jmoyers: there was some talk of having memoryUsage take a pid [22:03] jmoyers: i dont see it in the docs though [22:03] bnoordhuis: tmedema: because a WriteStream is an interface, it doesn't dictate what implementation to use [22:03] b_erb: is emitter.setMaxListeners(10) default only for preventing memory leaks? or is it acutally bad to have a huge number of listeners (i.e. pub/sub stuff)? [22:03] tmedema: bnoordhuis: I do not dictate what implementation to use, what made you think I do? [22:03] jmoyers: memory [22:04] hoodoos: tjholowaychuk, hmm, but, for some special case when I don't have any settings in master.. well, maybe it's not a case at all :) [22:04] tilgovi has joined the channel [22:04] tilgovi has joined the channel [22:04] bnoordhuis: tmedema: for example, you can have a WriteStream that buffers everything into memory - that one will never have a fd [22:04] bnoordhuis: tmedema: you want to step down to a lower levels and use plain fds, not streams [22:04] bnoordhuis: *a lower level [22:05] tmedema: bnoordhuis: I see what you mean, but I do want streams. In that case, I can create a new stream only if file descriptor is null [22:06] baoist has joined the channel [22:06] _sorensen_: b_erb: the memory leaks are likely a real problem [22:06] _sorensen_: b_erb: had the same problems myself, it was setting listeners to the same events for a single client too many times, otherwise you normally wont get those messages [22:08] b_erb: _sorensen_: ok, i just want to multiplex an event to multiple locations in my app (perhaps a few 100). so is it still a problem when I am dead serious about removing listeners when not needed anymore? [22:10] hoodoos: tjholowaychuk, it anyways strange for master to change pid.. when I restart it's okay, but it's a common issue when I need to reload workers only.. am I completely wrong? [22:10] ckknight has joined the channel [22:10] tjholowaychuk: hoodoos it's not uncommon to change config either [22:10] jesusabdullah: I hate reading client-side js because of the lack of require system [22:10] tjholowaychuk: it's not my fault upstart can't handle a pid changing [22:10] jesusabdullah: >_< [22:11] hoodoos: :) [22:11] tjholowaychuk: jesusabdullah yeah i hate that too [22:11] jesusabdullah: I'm spoiled I guess [22:11] tjholowaychuk: feels dirty [22:11] jmoyers: there are a few loaders out, now [22:11] jesusabdullah: Yeah, definitely [22:11] jmoyers: require-like [22:11] jesusabdullah: jmoyers: True! Or, with browserify, pretty much exactly require [22:11] jesusabdullah: jmoyers: but that doesn't change all the code that doesn't use a module system ;) [22:11] jmoyers: yeah, i have for some reason avoided browserify [22:12] jmoyers: it wasn't clear to me whether i had to make changes to libraries [22:12] jmoyers: the fact that there is a different jquery-browserify turned me off, for some reason [22:12] hoodoos: tjholowaychuk, well, but i guess no classic daemons restarts master on config change :) [22:13] SubStack: well if the jquery maintainer would just add a packagre.json... [22:13] tjholowaychuk: hoodoos this is 2011 [22:13] tjholowaychuk: haha [22:13] tjholowaychuk: :p [22:13] SubStack: erm, a browserify field in a package.json I mean [22:13] hoodoos: let's say nginx doesn't.. openssh or squid [22:13] hoodoos: :) [22:13] SubStack: jmoyers: you can pretend it's the regular jquery with aliases [22:13] jmoyers: ACTION nods [22:13] jmoyers: i realize it was probably my ignorance :-) [22:13] jesusabdullah: I think you necessarily have to make changes because most client-side libraries aren't really set up for a require system [22:13] hoodoos: tjholowaychuk, so it's just a matter of creating something new? like reloading master along with workers :) [22:13] tjholowaychuk: hoodoos yeah that's because nginx has a config language it's not literally re-loading a runtime script [22:13] jesusabdullah: y'know? [22:14] JKarsrud has joined the channel [22:14] seawise has joined the channel [22:14] tjholowaychuk: hoodoos they used to be the way you mention [22:14] tjholowaychuk: if you had 4 workers 4 more would spawn [22:14] tjholowaychuk: and the old 4 would die off [22:14] jesusabdullah: SubStack: Has anybody filed an issue with jquery? <_< [22:14] jmoyers: i usually put some boilerplate horseshit like [22:14] jmoyers: if typeof window etc etc [22:14] jmoyers: require [22:15] hoodoos: well, but handling this is soooo annoying :) [22:15] jmoyers: else U NO NEED REQUIRE [22:15] SubStack: yep that is silly [22:15] hoodoos: well, i need to find strength and make a pull request to override this behavour [22:15] JKarsrud: jesusabdullah: nope, but why? :) [22:15] jesusabdullah: JKarsrud: What do you mean, why? [22:15] tjholowaychuk: hoodoos we could have a separate signals for a master reload vs the rest [22:16] JKarsrud: why do you wonder if anybody has filed an issue with jquery? :) [22:16] jmoyers: SubStack erm, is the browser version of require synch? [22:16] jesusabdullah: because it would be nice to have the jquery on node have a browserify field so that jquery-browserify is redundant [22:17] jesusabdullah: I don't feel too strongly about it, but I find issues are a good way to make people aware of things like that [22:17] SubStack: jmoyers: the browser version works the same as the server version of require() [22:17] jmoyers: so synchronous [22:17] SubStack: but it's not doing synchronous i/o [22:17] JKarsrud: browserify? [22:18] tmpvar has joined the channel [22:18] jmoyers: well right, but its synchronous in that the next statements depend on the contents that you just required yes, so in fact if you have 3 require's in a row, it would load each one serially? [22:18] Murvin: I have a weird problem now.. if I use connect-mongo for the express-session, there is no problem. But if I just create another test script that create a connect-mongo datastore, it will say connection refuse. But both scripts are in the same server. and poiting to the same ip & port. [22:19] jesusabdullah: JKarsrud: http://substack.net/posts/24ab8c [22:19] jesusabdullah: It's pretty slick! [22:19] davvebot has joined the channel [22:19] davvebot: http://daveydave.no-ip.org:8080/irc [22:20] dscape has joined the channel [22:20] Determinist: bnoordhuis: dude, the question is whether or not the 'end' event *should* be used to indicate the end of the response or rather the 'close' event. [22:20] davvebot: waffles [22:20] robhawkes has joined the channel [22:20] davvebot: omni5cience++ :P [22:20] JKarsrud: jesusabdullah: hmm, sounds like requirejs to me [22:20] hoodoos: tjholowaychuk, well, anyways it would be an option, for those who used to dinos :) [22:21] bnoordhuis: Determinist: sorry? [22:21] tjholowaychuk: yup [22:21] Determinist: bnoordhuis: re: #728 [22:21] tjholowaychuk: would be a bit more annoying but meh not a huge deal [22:21] JKarsrud: but of course, the fact that you can use node modules is pretty nice [22:22] jhurliman: anyone had experience running "forever" (https://github.com/indexzero/forever) ? [22:22] jesusabdullah: JKarsrud: It's probably pretty similar, but more powerful in that it's designed to use npm modules directly. SubStack can of course tell you more. [22:22] jesusabdullah: jhurliman: Ask anybody from nodejitsu [22:22] jhurliman: i'm trying it out right now and it successfully daemonizes and spawns my node app in the background, but "forever list" reports that nothing is running and i can't find any sign of pid files being created [22:22] davvebot has joined the channel [22:23] jacobolu_ has joined the channel [22:23] jesusabdullah: jhurliman: In fact, you may want to go to #nodejitsu [22:23] jhurliman: thanks [22:23] Determinist: bnoordhuis: the docs indicate that 'end' should be used for such things. is it the right kind of event tho? the problem is that currently, no 'end' event is fired. is that ultimately the right behavior? a lot of https clients are using the 'end' event to identify the end of the response, but backwards compatiblity aside, is it "right" to do this? [22:23] bnoordhuis: Determinist: https://github.com/joyent/node/commit/75a0cf970fb48440a93a62796ab1f128fcbe7d76#commitcomment-383883 <- 'end', according to ryan [22:23] JKarsrud: jesusabdullah: yeah, that's what I figured :) [22:23] CIA-110: node: 03Ryan Dahl 07master * r0df2f74 10/ src/tcp_wrap.cc : [22:23] CIA-110: node: Add several asserts to tcp_wrap [22:23] CIA-110: node: OnAlloc and OnConnection should not be occurring after uv_close was [22:23] CIA-110: node: called on the handle. - http://bit.ly/mYewZ7 [22:24] jesusabdullah: JKarsrud: One difference is that browserify explicity eschews asyncronous module loading trickery [22:24] Determinist: bnoordhuis: yeah, so for backwards compatiblity, it is expected that 'end' get fired. but is it "right"? [22:24] jesusabdullah: JKarsrud: Are you the maintainer for the jquery npm module, perchance? If so, browserify is relatively popular, you may want to support it [22:24] bnoordhuis: Determinist: no :) [22:24] isaacs: jesusabdullah: npm owner ls jquery [22:24] Determinist: bnoordhuis: suspected as much. [22:24] JKarsrud: jesusabdullah: I am not [22:25] jesusabdullah: isaacs: yeah, I know :/ [22:25] JKarsrud: I love jQuery tho [22:25] JKarsrud: :P [22:25] jesusabdullah: We need an npm bot in heres [22:25] Determinist: bnoordhuis: well, my test checks for the 'end' event firing "correctly" for now. [22:25] bnoordhuis: Determinist: sweet [22:25] Determinist: bnoordhuis: indeed [22:25] brainproxy: anyone know what will be possible for node.js addons under the windows port? [22:26] brainproxy: iow, would they work the same way, would other things be possible like tying into other windwows-ish stuff like .Net or ... [22:28] JKarsrud: brainproxy: tying things to .NET should definitely be possible with IronJS [22:29] JKarsrud: infact, some guys at work are actually porting UglifyJS to Uglify.NET using IronJS, F# and C# [22:29] b_erb has left the channel [22:29] JKarsrud: IronJS is a pretty interesting project, too [22:29] jesusabdullah: Yessch, paper.js does not have very good docs [22:30] JKarsrud: paper.js doesn't make sense either [22:30] jesusabdullah: Like, in terms of paperscript it's great, but it doesn't really show a minimal example of actually webpaging it up [22:30] jesusabdullah: JKarsrud: In what sense? [22:30] JKarsrud: WHY would you make a vector framework in something that is bitmap? [22:30] jesusabdullah: Why not? ;) [22:30] brainproxy: JKarsrud: so the idea would be to sub out ironjs for v8? [22:30] skapism: hey, has anyone here used $unset with the mongodb native driver in update? [22:31] jesusabdullah: Vectors are useful for reasons other than future rescaling [22:31] tjholowaychuk: JKarsrud what lol [22:31] JKarsrud: brainproxy: yes, or use it as some sort of middlethingy to tie it up to .net [22:31] jesusabdullah: They also make for a handy api [22:31] JKarsrud: jesusabdullah: I am aware of that, but why not use SVG, which is made for this stuff? [22:31] JKarsrud: :P [22:31] JKarsrud: you see my point, I hope? [22:31] jesusabdullah: Oh, yeah, I do definitely [22:31] jesusabdullah: In my case, I want canvas since I want my end result to be a raster graphic [22:31] JKarsrud: but paper.js is cool, I'm not saying differently [22:32] jesusabdullah: and using svg adds a step, wherein I have to rasterise it [22:32] tjholowaychuk: who cares what the backend is [22:32] BillyBreen has joined the channel [22:32] JKarsrud: it just doesn't make 100% sense to me ;) [22:32] jesusabdullah: They claim that using canvas is more fasters [22:32] jesusabdullah: it might be, since canvas is pretty bare bones as compared to svg [22:32] JKarsrud: it probably is too, if you don't need the scaling part of it :) [22:32] JKarsrud: exactly [22:32] jesusabdullah: They also built their own dom system [22:33] scottj has joined the channel [22:33] jesusabdullah: I dunno, maan [22:33] tjholowaychuk: it's like fabric [22:33] tjholowaychuk: but better [22:33] mjr_: I like SVG in theory, but the canvas implementations keep getting faster. [22:33] brainproxy: isaacs: is it correct that you're in charge of node's REPL? have time for a mystery surrounding some weird stuff with REPL/global context and .clear? [22:33] JKarsrud: using some shadow dom stuff, or something? [22:33] jesusabdullah: I just wanna draw comics with javascript :( [22:33] JKarsrud: hehehehe [22:33] JKarsrud: easy [22:33] JKarsrud: :) [22:33] brainproxy: meant have time for a *question involving some weird stuff... [22:33] Mr_Wali: do you guys know any websites that are taking advantage of paper.js right now? [22:33] isaacs: brainproxy: i've had my hands in there a few times, yeah [22:33] JKarsrud: document.createElement("comic") [22:33] JKarsrud: BLAM [22:34] brainproxy: isaacs: so when tries to use the REPL in conjunction with joose, some weird stuff happens [22:34] JKarsrud: okay, giving this mongo thing another go, seems my previous installation wasn't completely nice :P [22:34] brainproxy: isaacs: the joose maintainer and I and others have tried to figure it out, but it's somewhat of a myster [22:35] JKarsrud: *heading into #jquery in the meantime* [22:35] jesusabdullah: HMM [22:35] brainproxy: basically, in the REPL: > require('task-joose-nodejs') [22:36] brainproxy: > Joose // -> ReferenceError [22:36] brainproxy: > clear [22:36] mustakes has joined the channel [22:36] brainproxy: > Joose // now it's there! [22:36] tuhoojabotti: Damn [22:36] isaacs: brainproxy: k, that's a bit odd.. [22:36] tuhoojabotti: I can't get udp working [22:36] tuhoojabotti: tcp works :D [22:36] isaacs: brainproxy: anyway, the problem is most likely due to the module expecting to have a shared global space. [22:36] liar has joined the channel [22:37] isaacs: brainproxy: you'd have the same problems if you set the NODE_MODULE_CONTEXTS=1 environ [22:37] isaacs: brainproxy: i think that the reason .clear works is that it might be copying in anything in the "normal" global into the sandbox [22:38] brainproxy: isaacs: that makes sense [22:38] Aria has joined the channel [22:39] Mrfloyd has joined the channel [22:39] brainproxy: isaacs: so to work properly, the library should not be putting stuff in the global outside the sandbox, but inside the sandbox [22:39] brainproxy: if that even makes sense [22:39] isaacs: brainproxy: it should not be putting stuff in the global space. [22:39] isaacs: brainproxy: it should be using the module/exports pattern [22:39] isaacs: brainproxy: shared global state across modules is an antipattern that we've lived with for far too long. [22:39] CIA-110: libuv: 03Ryan Dahl 07new-req * r1fce412 10/ (10 files in 3 dirs): [22:39] CIA-110: libuv: Better request API [22:39] CIA-110: libuv: Instead of uv_shutdown, uv_write, uv_connect taking raw uv_req_t we subclass [22:39] CIA-110: libuv: uv_req_t into uv_shutdown_t, uv_write_t, and uv_connect_t. [22:39] CIA-110: libuv: uv_req_init is removed. - http://bit.ly/pzU1hw [22:40] brainproxy: isaacs: yeah, doesn't follow that pattern; though perhaps it could be reworked [22:41] tmedema: When I run ffmpeg manually in the console, I get a certain amount of debug written to stderr. When I then run ffmpeg with the same commands using child_process.spawn, I get much less debug information written to stderr. What could possibly cause this? ffmpeg has a loglevel parameter, but it seems to have no effect. [22:42] brainproxy: isaacs: okay, well, that helps to clarify it a bit; nickolay and I were talking last night about joose and namespaces and the way forward, we'll just have to think harder :D [22:42] Aria: ffmpeg might be checking to see if stdin is a tty. [22:44] davvebot has joined the channel [22:44] isaacs: brainproxy: you could just do module.exports = Joose instead of setting it globally [22:46] arf77 has joined the channel [22:46] tmedema: Aria: tty? [22:46] BillyBreen has left the channel [22:47] Determinist: bnoordhuis: strange thing here. seems like node's https server doesn't allow closing a serverResponse without calling end(), while when making a request to Google, for example, no 'end' is ever called, just the 'close' event. [22:47] perlmonkey2 has joined the channel [22:47] brainproxy: isaacs: yes, but namespaces are a core concept in larger joose-based libraries, and I'm not sure yet how it will play out when you have a lot of components that need target essentially global namespaces [22:47] scottj has joined the channel [22:48] isaacs: i see [22:48] bnoordhuis: Determinist: eh.. so the test breaks with google.com but not on localhost? [22:48] Determinist: bnoordhuis: in effect, this means there's no way to reproduce real-world scenarios using a locally running https server [22:48] bnoordhuis: Determinist: okay, let's use an external server for now [22:48] BillyBreen has joined the channel [22:48] noryb009 has left the channel [22:48] Determinist: k [22:49] brainproxy: isaacs: in any case, it works fine when executing the scripts with `node whatev.js` (at least for now) but some of us joosers have always wanted to be able to bang around in the REPL w/o errors being thrown left and right [22:49] Aria: tmedema: teletype interface -- a "real terminal" rather than a dumb pipe. [22:49] tmedema: Aria: ah :/ that would be horrible [22:49] tmedema: do you know of a way to circumvent that? [22:49] yozgrahame has joined the channel [22:50] Aria: Well, spawn a tty rather than a pipe -- pty interface -- but it's OS-specific. [22:50] tmedema: Aria: that seems rather ugly, I bet it's less efficient too [22:50] sweetd has left the channel [22:51] Aria: Not particularly. A little more overhead in the kernel, but not horrible. [22:51] jesusabdullah: So, I solved the mystery of paper.js. It builds a dsl called paperscript that you use like,