[00:00] mraxilus has joined the channel [00:01] blueadept: anyone know of a way of achieving this synchronously written code in a good async form? http://pastie.org/private/mi2jhefnv3pchrcxir2lw [00:01] blueadept: do i have to put counters in each find call? [00:01] rlidwka has joined the channel [00:02] SubStack: blueadept: instead of return, just pass in a calback [00:02] SubStack: and you can just var pending = users.length [00:02] blueadept: the thing is each find is asyncronous, and i'm doing multiple loops on each find result [00:02] SubStack: then if (--pending === 0) cb(results) [00:03] blueadept: ah [00:03] zeade has joined the channel [00:04] blueadept: i see [00:06] blueadept: yeah because for instance if i just run this as it is, the second forEach will return null [00:06] blueadept: ok i think i have this [00:06] marcostoledo has joined the channel [00:07] tommyvyo has joined the channel [00:07] dodo__ has joined the channel [00:07] brianseeders has joined the channel [00:07] fermion has joined the channel [00:08] redir has joined the channel [00:09] sammmy has joined the channel [00:09] sammmy: is there a way to switch --debug on for a currently running process? [00:09] sammmy: This way I can debug on the fly in production. [00:09] tjholowaychuk has joined the channel [00:10] jetienne has joined the channel [00:10] CIA-19: libuv: 03Ben Noordhuis 07master * r1b6df97 10/ src/unix/linux/inotify.c : [00:10] CIA-19: libuv: linux: try inotify_init if inotify_init1 returns ENOSYS [00:10] CIA-19: libuv: The kernel may be older than the kernel headers that libuv is compiled against. - http://git.io/22l14A [00:10] CIA-19: libuv: 03Ben Noordhuis 07v0.6 * r6dcce92 10/ (test/test-ref.c test/test-tty.c): unix: replace C99/C++ comments, fix build - http://git.io/6OpLnA [00:10] CIA-19: libuv: 03Ben Noordhuis 07v0.6 * r66a959c 10/ src/unix/linux.c : [00:10] CIA-19: libuv: linux: try inotify_init if inotify_init1 returns ENOSYS [00:10] CIA-19: libuv: The kernel may be older than the kernel headers that libuv is compiled against. - http://git.io/XdvVBw [00:11] kyledr_ has joined the channel [00:11] pendlepants has joined the channel [00:11] RobWC1 has joined the channel [00:12] bkaney has joined the channel [00:12] bnoordhuis: sammmy: pkill -USR1 node [00:12] sammmy: bnoordhuis: doesn't that kill the node process? [00:13] bnoordhuis: sammmy: no, SIGUSR1 starts the debugger [00:13] Joeysomo has joined the channel [00:13] sammmy: bnoordhuis: why the pkill command? [00:14] bnoordhuis: sammmy: less typing. you can use `kill -USR1 $(pidof node)` instead [00:14] oal has joined the channel [00:15] RGoodfellow: mh... i really like node.js but sometimes this whole callback concept is terrible... [00:15] RGoodfellow: https://gist.github.com/2040626 [00:15] RGoodfellow: any ideas on that? [00:15] duncanbeevers has joined the channel [00:15] mraxilus has joined the channel [00:15] ryanrolds_w: Callback are awesomes [00:16] Crowb4r has joined the channel [00:16] niftylettuce_ has joined the channel [00:16] necromancer has joined the channel [00:16] ryanrolds_w: How people organize them is usually shit. [00:16] piscisaureus_ has joined the channel [00:16] benvie: trueness [00:16] RGoodfellow: ryanrolds_w: i am scraping data from about five urls and want to create one json file from them... [00:16] HeikkiV_ has joined the channel [00:16] lmjabreu has joined the channel [00:17] jemparing has joined the channel [00:17] patcito has joined the channel [00:17] benvie: I'd create a type representing a request, and a container type representing a collection of waitable events [00:17] RGoodfellow: and i have no idea how i could improve it in the gist i posted. [00:18] dleary has joined the channel [00:18] sammmy: Using node-mysql, is there a way to put my sql in separate files from my model files, and use them when calling db.query()? [00:18] ryanrolds_w: RGoodfellow: Use async (https://github.com/caolan/async) or one of the other similar libraries. [00:18] context: rgoodfellow: why is that troubling? [00:18] benvie: and I'd have them self manage and report to their container [00:18] context: rgoodfellow: saveStuff should be the easiest to read out of that gist [00:18] sammmy: Also, I'd need a way to pass locals to my sql files. Similar to how I can pass locals to my views. [00:19] RGoodfellow: i can't use any other npm modules... (i didn't create the project) [00:19] ryanrolds_w: RGoodfellow: async.parallel or async.queue would help with that. [00:19] myndzi\: how do i debug "object has no method 'on'" ? [00:20] sorensen__ has joined the channel [00:20] ryanrolds_w: RGoodfellow: Um, that doesn't make any sense. Why can you add an async flow control library? [00:21] ryanrolds_w: Adding a library is better then having a bunch of synchronous io like that. [00:21] lmatteis has joined the channel [00:21] mintbridge_ has joined the channel [00:21] RGoodfellow: my boss wrote the code and when i saw it, i nearly vomitted and he doesn't want any more libs. typical boss... [00:22] SubStack: wow... [00:22] SubStack: just wow [00:22] ryanrolds_w: Update your resume. [00:22] SubStack: "This one time, I used a module and it sucked! So I never use modules." [00:22] FilipeDias has joined the channel [00:22] kermitPT has joined the channel [00:22] SubStack: hilarious [00:22] crewmoss has joined the channel [00:23] chunhao_ has joined the channel [00:23] SubStack: ACTION draws some more dinosaurs [00:23] ryanrolds_w: Draw some turtles too please [00:23] SubStack: I am OVER turtles. [00:23] eeemsi: SubStack: new hobby? ;) [00:23] Lorentz: don't forget penguins [00:23] SubStack: this week, it's all dinosaurs [00:23] redir_ has joined the channel [00:23] eeemsi: penguins! [00:23] SubStack: and a few robots [00:23] eeemsi: xD [00:23] SubStack: for good measure [00:23] ryanrolds_w: RGoodfellow: You can do what async and similar librraries do, but you need to do a bunch of callback counting. [00:24] SubStack: http://substack.net/images/raptor.png [00:24] eeemsi: SubStack: pics or it didn't happen ;) [00:24] ryanrolds_w: RGoodfellow: This is a solve problem, to bad your boss is making you reinvent the wheel. [00:24] sammmy: If I use require('my_module') multiple times in my applications, does the module get cached or is there a new module object loaded each time I require it? [00:24] texinwien has joined the channel [00:24] bnoordhuis: sammmy: it's cached [00:24] sammmy: bnoordhuis: how does this effect the behavior then? [00:24] benvie: this one time I used eval and it somehow was a black hole that sucked everything in [00:24] RGoodfellow: ryanrolds_w: i thought more about using something like event emitter stuff.... [00:24] SubStack: this one time I used threads [00:24] RGoodfellow: but that seems just so overkill [00:25] SubStack: never again [00:25] ryanrolds_w: RGoodfellow: That works too, you will be counting events then [00:25] bnoordhuis: sammmy: that's a rather broad question... [00:25] ryanrolds_w: You're going to need to count the number of async ops you dispathed and then number you got back. When you get them all back then do some final operation on all of the responses. [00:25] copongcopong: RGoodfellow: use eventEmitter instead [00:25] sammmy: bnoordhuis: is there something I can read that clarifies this? [00:25] eeemsi: SubStack: art! … ^^ [00:25] Fabryz has joined the channel [00:26] sammmy: maybe a blog post from somone explaining and giving examples of how it behaves. [00:26] bnoordhuis: sammmy: i would just read the source if i were you [00:26] rwaldron has joined the channel [00:26] bnoordhuis: it's in src/node.js and lib/module.js [00:27] sammmy: It might go over my head at this point. I'll have to google for resources on this. If that fails, I will have to read the source. xP [00:27] robb1e_ has joined the channel [00:27] ryanrolds_w: SubStack: Could you do a picture of robot turtles riding dinos? [00:27] ryanrolds_w: Post it on reddit and you will be more famous. [00:27] _jzl has joined the channel [00:27] RGoodfellow: gotta run. thanks for your thoughts on the matter, guys. :) [00:28] Jaylee_ has joined the channel [00:28] SubStack: ryanrolds_w: to do that concept justice would take a lot of hours [00:28] ryanrolds_w: :( [00:28] ryanrolds_w: You will just have a write a module that needs that art. [00:29] SubStack: true~! [00:29] SubStack: this took about 20 hours: http://substack.net/images/browsers/war_of_the_browsers.png [00:29] SubStack: over 2.5 days is [00:29] _ralph has joined the channel [00:29] fcoury has joined the channel [00:29] ryanrolds_w: Damn. [00:29] SubStack: that raptor only took about 90 minutes [00:30] ryanrolds_w: only [00:30] benvie: I spent my whole life iterating on this piece of art http://bbenvie.com/img/the_more_you_know.jpg [00:30] eeemsi: war_of_the_browsers.png is nice [00:30] tez has joined the channel [00:31] dscape has joined the channel [00:31] benvie: the duck [00:31] benvie: will get you [00:31] majek has joined the channel [00:31] tez: hi, I have an issue with http.request [00:31] tez: when i set the connection: keep-alive headers [00:31] tez: i get econnreset [00:31] tez: if the response takes too long [00:32] pauls1 has joined the channel [00:32] tez: but according to api docs, connection: keep-alive should wait until the next request before closing? [00:32] ryanrolds_w: Any chance this is https/ssl/tsl? [00:32] tez: nope [00:32] tez: http [00:33] ryanrolds_w: tez: Node version? [00:33] tez: v0.6.8 [00:33] tez: running on linux [00:34] tez: I'm very confused as to why I'm getting ECONNRESET [00:34] dilvie has joined the channel [00:34] tomnewmann has joined the channel [00:35] _th_n has joined the channel [00:36] sveisvei has joined the channel [00:36] tortvanc has joined the channel [00:36] ryanrolds_w: tez: How long are you waiting between requests? [00:36] tez: over 30 seconds [00:36] ryanrolds_w: tez: The connection isn't held open indefinitely. [00:36] ryanrolds_w: Yeah, that's going to do that. [00:36] tez: but according to docs it should be..... [00:36] tez: until a new request is made [00:36] tez: which it is not [00:37] bnoordhuis: tez: ECONNRESET means the *other* end closed the connection [00:37] ryanrolds_w: tez: keepalive doesn't mean the connection will be held open forever. [00:37] ryanrolds_w: Yeah, either side can close it. [00:37] Rob__ has joined the channel [00:37] tez: quoting from docs: [00:37] tomh has joined the channel [00:37] tez: "Sending a 'Connection: keep-alive' will notify Node that the connection to the server should be persisted until the next request." [00:37] csprite has joined the channel [00:37] bnoordhuis: tez: reread what i wrote [00:37] tez: no next request is being made [00:38] nym has joined the channel [00:38] tez: is there any way I can ensure this doesnt occur? [00:38] ryanrolds_w: That's not how keepalive is supposed to work. The docs could be reworded. [00:38] ryanrolds_w: No way. [00:38] ryanrolds_w: The other end can disconnect at will. [00:38] relix has joined the channel [00:39] bnoordhuis: ryanrolds_w: the docs are fine, node is doing is exactly what it says [00:39] tez: the other end is a server written by me [00:39] jsurfer has joined the channel [00:39] tez: so I have control over the code [00:39] magn3ts has joined the channel [00:39] ryanrolds_w: And 30 secs is pretty long to hold open a request like that. [00:39] bartek has joined the channel [00:39] tez: its processing a very large file [00:40] tez: if the server is closing the connection as was suggested above, are there any server-side modifications I can make to hold the socket open indefinately until the request is replied to? [00:40] ryanrolds_w: bnoordhuis: You're right. [00:41] owenb has joined the channel [00:41] bnoordhuis: tez: have the server set the keepalive flag on the connection [00:41] tez: okay ill try that :) [00:41] bnoordhuis: tez: and if it's a node server, disable the timeout [00:41] strmpnk has joined the channel [00:41] tez: cool [00:41] tez: ya its a node server [00:41] tez: alright ill try that, thanks guys :) [00:41] bnoordhuis: good luck :) [00:42] ryanrolds_w: bnoordhuis: Wouldn't it be optimal to implement some way to notify the origin that doesn't involve something brittle like that? [00:42] bnoordhuis: ryanrolds_w: how would that work? [00:42] ^robertj has joined the channel [00:43] ryanrolds_w: Any sort of message queue or socket.io implementation would be better then hoping that something does hiccup that long connection. [00:43] broofa has joined the channel [00:43] kokotron has joined the channel [00:43] josh_wines has joined the channel [00:43] bnoordhuis: ryanrolds_w: there is a message queue but that's not the issue here [00:44] bnoordhuis: the server can close the connection at any time [00:44] BrianE has joined the channel [00:44] bnoordhuis: a robust application will just have to anticipate and deal with that [00:44] sammmy: According to the Module Caching Caveats section in the node docs, if I require('./path/foo.js') and then require('./path/../path/foo.js') (both are the same file, but have different paths), I would force the node to load two separate exported objects? [00:44] bnoordhuis: i say "the server" but it might as well be network errors [00:45] ryanrolds_w: Yeah, using keepalive like that seems like a brittle way to do what he is needed. [00:45] ryanrolds_w: *needing [00:46] bnoordhuis: sammmy: that's correct [00:46] _numbers has joined the channel [00:46] SubStack: sammmy: that file would only execute once [00:47] SubStack: node normalizes the paths [00:47] ziyadb has joined the channel [00:47] blissdev has joined the channel [00:47] SubStack: path.normalize() yo [00:47] Druid_ has joined the channel [00:47] idefine has joined the channel [00:47] remysharp has joined the channel [00:47] blahblahblah has joined the channel [00:47] bnoordhuis: oh wait, i'm thinking of NativeModule.require() [00:47] _numbers: so i want to use node.js for websockets with socket.io, but i want to use another language/sever for everything else. i want both to run on port 80 of the same domain so that there are no cross-domain issues. what can proxy that? [00:47] bnoordhuis: SubStack is right [00:47] Edler has joined the channel [00:47] SubStack: or actually it probs uses path.resolve() [00:47] sammmy: SubStack: So node would recognize that it's the same file so therefore it would use the cached exports object from the first require? [00:47] SubStack: but the effect is the same [00:47] Raynos has joined the channel [00:48] SubStack: sammmy: yes [00:48] sammmy: Yay! [00:48] Hosh has joined the channel [00:48] sammmy: I like that. If it did, I'd be like fuuuuuuck. [00:48] sammmy: If it didn't, I mean.. [00:48] sammmy: :S [00:48] ryanrolds_w: _numbers: socket.io should handle cross domain fine. Getting socket.io to work through a proxy isn't fun. [00:49] _numbers: ryanrolds_w: really? in that case, i tried configuring the socket.io example for port 8080 instead of port 80, but the js browser client didn't seem to make the connection in that case [00:50] achiu1 has joined the channel [00:50] jtsnow has joined the channel [00:51] blahblahblah has left the channel [00:51] ryanrolds_w: _numbers: It should work. Socket.io is supposed to handle cross-domain fine. What browser where you trying it in? [00:52] _numbers: chrome [00:52] ryanrolds_w: CORS is pretty well supported on modern browsers and socket.io falls back on other methods. [00:52] agnat_ has joined the channel [00:53] ryanrolds_w: Getting socket.io to work through a proxy is a huge pain in the pass and depending on the proxy may not work. [00:54] _numbers: ok looking again at config to see if it was my error [00:54] ryanrolds_w: Turn the logging up a bit and check the web inspector. [00:54] ryanrolds_w: If you getting bitten by CORS issues you should see it in the network area. [00:54] _numbers: right now the browser is including the wrong .js i think [00:55] ryanrolds_w: Ah. [00:55] _numbers: it says /socket.io/socket.io.js in the example [00:55] lmorchard has joined the channel [00:55] _numbers: i used the one from the npm install dir [00:55] slajax has joined the channel [00:55] ryanrolds_w: Don't know if that matters so much. [00:55] _numbers: but its calling a require() statement [00:55] dwhittle has joined the channel [00:55] _numbers: so browser console says 'require is undefined' [00:55] _numbers: 'io is undefined' [00:55] _numbers: so this must be the wrong file [00:55] ryanrolds_w: Oh, yeah [00:55] EyePulp has joined the channel [00:56] ryanrolds_w: socket.io should serve or setup routes to serve the js files on whatever port it's bound to. [00:56] Ragnok has joined the channel [00:56] EhevuTov_ has joined the channel [00:56] diva has joined the channel [00:56] ryanrolds_w: <3 socket.io [00:56] purr: Let it be known that ryanrolds_w hearts socket.io. [00:57] ryanrolds_w: Just don't try to get socket.io to work through express + vhost. [00:57] westg has joined the channel [00:57] jlank has joined the channel [00:57] conancat has joined the channel [00:58] _numbers: im following the socket.io + express example [00:58] BillyBreen has joined the channel [00:58] _numbers: darn i cant find the .js file that is supposed to be included by the client-side [00:58] wavded has joined the channel [00:58] _numbers: its not this one is it? https://github.com/LearnBoost/socket.io/blob/master/lib/socket.io.js [00:59] warz has joined the channel [00:59] ryanrolds_w: If you're going through express socket.io should set it up for you. [00:59] _numbers: all the examples reference a /socket.io/socket.io.js file [00:59] _numbers: well in this case i am going through apache on port :90 [00:59] _numbers: on port :80* and then socket.io + express + node.js is running on port :8080 [00:59] ryanrolds_w: You don't need to so anything special. http://host:port/socket.io/socket.io.js [01:00] ryanrolds_w: http://host:8080/socket.io/socket.io.js [01:00] konobi: what's the standard websocket (pure websocket) framework to go for these days [01:00] konobi: ie: no browsers involved [01:00] PsiliPharm has joined the channel [01:00] _numbers: oh ya thats a dif. file [01:01] cerebros has joined the channel [01:01] ryanrolds_w: konobi: I have been using socket.io-client [01:01] _numbers: the mistake i made was in copying that file to the project dir thinking i had to provide it [01:01] underport has joined the channel [01:01] _numbers: when i deleted it, you're right express already provides it i guess from the node_modules plugin dir [01:01] ryanrolds_w: Knowledge: But I don't know if that's really what your're looking for. [01:01] RobWC has joined the channel [01:01] RobWC has left the channel [01:01] konobi: also on the server side though [01:01] Aria has joined the channel [01:01] _numbers: now its working yay [01:02] ryanrolds_w: konobi: I use socket.io for interserver communication and I'm pretty sure it uses websockets all the way. [01:02] jesusabdullah: Question: Do objects have a built-in sense of order or is this a side-effect of the v8 implementation? [01:02] ryanrolds_w: socket.io + socket.io-client [01:03] jesusabdullah: nvm found answer [01:03] ryanrolds_w: _numbers: Awesome [01:03] _numbers: thx ryanrolds_w [01:04] SubStack: they actually have rather stable ordering but that effect shouldn't be depended on [01:04] konobi: ryanrolds_w: ah... https://github.com/Worlize/WebSocket-Node was the one i was thinking of [01:04] jesusabdullah: Yeah, I lucked out on my last google search [01:05] diva__ has joined the channel [01:05] jesusabdullah: most implementations order them [01:05] jesusabdullah: by order of attachment [01:05] ryanrolds_w: jesusabdullah: If you're going to json and back don't count on that. [01:06] jesusabdullah: http://stackoverflow.com/questions/280713/elements-order-in-a-for-in-loop [01:06] jesusabdullah: I'm used to not depending on it but it's a question I've always had [01:06] ryanrolds_w: hehe "In short: Use an array if order is important to you." [01:06] ryanrolds_w: This bit someone where I work. [01:07] ryanrolds_w: Had to go around turning objects in to arrays or strings or arrays of objects. It sucked. [01:07] jesusabdullah: [ {a: 1}, {b: 2} ] [01:07] ryanrolds_w: Yeah [01:07] jesusabdullah: that's how I do it [01:08] ryanrolds_w: *arrays of strings [01:08] _numbers: with socket.io when a client makes a connection, does it maintain state or session between page refreshes? [01:08] _numbers: or would i have to add that on the server-side app.js [01:09] neoesque has joined the channel [01:10] wdperson has joined the channel [01:11] stepheneb has joined the channel [01:11] Vespakoen has joined the channel [01:11] Brunoz has joined the channel [01:11] igl1 has joined the channel [01:12] jetienne_ has joined the channel [01:13] briancray has joined the channel [01:13] k1ttty has joined the channel [01:15] quackquack has joined the channel [01:16] ericmuyser has joined the channel [01:17] muddo has joined the channel [01:17] diogogmt has joined the channel [01:18] eboy: Does anyone know what I can do to mimic the functionality of Unix streams on Windows? [01:19] AI42 has joined the channel [01:19] patcito has joined the channel [01:19] kirbysayshi has joined the channel [01:19] jxson_ has joined the channel [01:20] kriskowal has joined the channel [01:22] ryanseddon has joined the channel [01:23] TroyMG has joined the channel [01:24] orlandovftw has joined the channel [01:24] CIA-19: libuv: 03Ben Noordhuis 07master * r7a2bd05 10/ (include/uv-private/ngx-queue.h include/uv-private/tree.h): [01:24] CIA-19: libuv: Fix include guard in tree.h and ngx-queue.h [01:24] CIA-19: libuv: The C99 standard reserves all identifiers (including macros) that start with an [01:24] CIA-19: libuv: underscore and a capital letter. [01:24] CIA-19: libuv: Fixes #260. - http://git.io/sAFDIw [01:25] AI42: Hi, i'am using postgresql, node module pg, can't find any realization of transactions please tell me which module should i use? [01:28] jacobolus has joined the channel [01:29] RobWC has joined the channel [01:32] Frostopher has joined the channel [01:32] jxson has joined the channel [01:33] myndzi\: zlib emits multiple end events, what am i supposed to do about that? how do i know when it's done? [01:34] tomnewmann has joined the channel [01:37] redir has joined the channel [01:37] myndzi\: hmmm nm [01:38] _numbers has joined the channel [01:39] dekub has joined the channel [01:40] sammmy: How would I go about separating my SQL from my js model files? I want to be able to put all my .sql files in /models/sql/ directory, but then how would I be able to inject parameters into the queries? [01:40] adamkittelson has joined the channel [01:41] tvw has joined the channel [01:44] cmwelsh: sammmy: you could have a separate file for each model for the database access layer [01:45] brianseeders has joined the channel [01:47] zivester has joined the channel [01:47] subbyyy has joined the channel [01:49] sammmy: cmwelsh: What do you mean? [01:50] cmwelsh: I mean putting your SQL queries in a file with .sql extension is not optimal in my book [01:50] cmwelsh: just put them in a separate js file [01:50] jzacsh has joined the channel [01:50] jzacsh has joined the channel [01:51] dwhittle has joined the channel [01:54] seanstickle has joined the channel [01:54] abraxas has joined the channel [01:56] redir has joined the channel [01:57] MartinCleaver has joined the channel [01:57] MartinCleaver has joined the channel [01:57] take_cheeze has joined the channel [01:57] sammmy: cmwelsh: I think it's optimal if you have large queries (transactions and whatnot). It would clean up my model files. [01:58] sammmy: Plus, I would also get syntax highlighting for SQL in my editor. [02:00] BillyBreen has joined the channel [02:02] robotblake has joined the channel [02:02] _numbers: so i am using node.js for socket.io functionality but the majority of the web app is written in php [02:03] _numbers: i want a way for php to notify node.js server of an event occurrance [02:03] _numbers: i guess the best way to do that would be a php websocket client connecting to the node.js server [02:03] Vespakoen has joined the channel [02:03] LuckySMack has joined the channel [02:04] al3xnull has joined the channel [02:04] _numbers: ok next q: trying to setup a subscriber broadcast structure with socket.io [02:04] _numbers: so clients will ask to subscribe to a certain id to receive broadcasts for only that id [02:05] al3xnull: Has anyone here happened to put together an OpenID provider at all? [02:05] _numbers: whats the easiest way to do that? maybe use socket.io namespaces one-per-id? its just that there could be several thousand different ids [02:08] RORgasm has joined the channel [02:08] _numbers: im reading that channel subscription is already built-in to socket.io [02:09] _numbers: how does the client subscribe to a channel in the latest version? is that what socket.on() is doing? will the server not broadcast to that client if it has not set to listen with socket.on() [02:10] stagas: http://live.stagas.com:3333/ [02:10] dilvie has joined the channel [02:11] infynyxx has joined the channel [02:17] tvw has left the channel [02:18] stepheneb has joined the channel [02:19] diogogmt has joined the channel [02:19] jtsnow has joined the channel [02:19] jxson has joined the channel [02:20] sammmy: I remember that I couldn't set exports to an singleton, but rather I had to use module.exports, or was it visa versa? [02:20] sammmy: What are the subtle differences between module.exports and exports? [02:21] pandeiro has joined the channel [02:21] Ragnok has joined the channel [02:22] crutex has joined the channel [02:22] crutex has joined the channel [02:22] unomi has joined the channel [02:24] chapel: exports is a helper [02:25] chapel: exports is like doing var exports = module.exports = {} [02:26] sleetdrop has joined the channel [02:26] sammmy: But are there any caveats with exports? [02:27] chapel: umm, if you use exports, and then module.exports in the same file, module.exports usually overrides it last I checked [02:27] sammmy: Could I do: exports = { exportedFunction: function(){..} } and have it still work properly vs if I used module.exports = {...? [02:27] gkatsev: yes, same thing [02:27] Hephaistos has joined the channel [02:28] gkatsev: yeah, use either one but not both in the same file [02:28] sammmy: I see. [02:28] sammmy: Thanks. [02:28] colinwd has joined the channel [02:28] sammmy: Why do I see exports = module.exports = {...? What's the point of setting both? [02:28] gkatsev: to guarantee that it is the same [02:29] gkatsev: for the paranoids among us [02:29] rwaldron has joined the channel [02:30] sammmy: http://stackoverflow.com/questions/7137397/module-exports-vs-exports-in-nodejs [02:31] sammmy: it was with functions that there is a caveat. [02:31] chjj: sammmy: because of the way variable assignment works in javascript, setting `module.exports` does not change `exports`. [02:32] chjj: sammmy: so if you wanted to use `exports` later, you need to explicitly set it [02:32] sammmy: I see now. The stackoverflow post helped me to understand. [02:32] babab00m has joined the channel [02:33] maletor has joined the channel [02:33] gr4yscal_ has joined the channel [02:33] babab00m has joined the channel [02:33] yosprey has joined the channel [02:34] sammmy: Node.js takes the properties of exports and adds them to module.exports if module.exports isn't null/undefined. This means that exports cannot export a single value, but module.exports can. To avoid bugs and confusion we set exports to module.exports so that way they remain the same. [02:34] Emmanuel` has joined the channel [02:35] yosprey: hello, just getting started with node and playing around with the guide on http://www.nodebeginner.org/, ran into an exception when i'm just running with an index.js and server.js and just tried copy-pasting to see if I just typed something wrong and same error, it's saying "Error: listen EADDRINUSE", what did i mess up [02:36] Lorentz: EADDRINUSE => E(rror) Add(ress) in use [02:36] mattgifford has joined the channel [02:36] Lorentz: guess it means the port you're trying to use is taken [02:37] Ragnok: yup, it seems you are listening in that port already [02:37] yosprey: that's what i assumed, it worked at first... what process should i look to kill [02:37] Lorentz: anything that you started with node [02:38] kokotron has joined the channel [02:38] sammmy: Why doesn't Node.js replace module.exports with exports' value if module.exports isn't set? [02:39] stagas: sammy: module.exports is the object that is exported [02:40] CarterL has joined the channel [02:40] githogori has joined the channel [02:40] stagas: sammy: internally, exports = module.exports; so exports.foo === module.exports.foo; but if you do exports = { something: 'else' }; you lose the reference so now exports.foo no longer points to module.exports.foo [02:42] conancat has joined the channel [02:43] yosprey: even when I change the port number I get EADDRINUSE [02:44] yogig has joined the channel [02:44] Edler has joined the channel [02:44] Edler: hey guys, is it possible to install node.js on a jailbroken iPhone ? [02:45] gkatsev: yosprey: what port are you trying to use? [02:45] brianseeders has joined the channel [02:45] yosprey: gkatsev, tried 8888 then 8889 [02:45] dthompso99 has joined the channel [02:46] bbenvie has joined the channel [02:47] westg: Edler: uhh, I would venture to say no because of the processor in an iphone but i may be wrong [02:49] Edler: westg: found it .. :D https://tootallnate.net/nodejs-on-ios [02:50] alejandromg has joined the channel [02:51] Avanine has joined the channel [02:53] pradeepbv has joined the channel [02:54] _numbers: is there an each() iterator function like jQuery.each() [02:54] jxson has joined the channel [02:54] _numbers: or should i just require('jquery') in my server-side app [02:55] jdeibele has joined the channel [02:56] bizniz98 has joined the channel [02:59] pizthewiz has joined the channel [03:00] Ragnok has joined the channel [03:00] Ragnok has joined the channel [03:00] a_suenami has joined the channel [03:00] gr4yscal_ has joined the channel [03:02] rtgibbons has joined the channel [03:03] DoNaLd`_ has joined the channel [03:05] cesar_ has joined the channel [03:06] jdeibele has joined the channel [03:07] yosprey: oh, i fixed it. editing wrong files ftl [03:09] chapel: _numbers: use forEach [03:10] chapel: array.forEach(function(item, i, array) { // code }) [03:10] _numbers: ok thx i'll try it [03:14] blueadept has joined the channel [03:15] jtsnow has joined the channel [03:18] jdeibele1 has joined the channel [03:18] nqbao has joined the channel [03:19] michaelmartinez has joined the channel [03:21] thinkt4nk has joined the channel [03:23] Ragnok: hey, i'm new to node, and i would like to know what would be the equivalent to the apache .htaccess file [03:26] jerrysv has joined the channel [03:27] reprisal: Ragnok: Best way to start might be to compare the html 5 boilerplate node server to their .htaccess [03:27] reprisal: https://github.com/h5bp/server-configs/blob/master/node.js [03:27] Ragnok: k, thanks [03:29] _numbers has left the channel [03:30] smorin has joined the channel [03:30] takumination has joined the channel [03:30] bicranial has joined the channel [03:30] killfill has joined the channel [03:31] technel has joined the channel [03:36] Spion_ has joined the channel [03:37] nqbao has left the channel [03:37] _jzl has joined the channel [03:40] shanebo has joined the channel [03:42] sammmy: Is it just more or does Node.js's error reporting kinda fail? [03:43] kmiyashiro has joined the channel [03:45] gkatsev: s/node.js/{{any language}} [03:46] kvda_ has joined the channel [03:47] blueadept has joined the channel [03:48] boltR has joined the channel [03:48] zemm has joined the channel [03:48] TooTallNate has joined the channel [03:48] kvda_: Hello, I'm looking for a HTML template builder that runs on Node, what are some of the better ones? [03:49] Hebo: Jade is pretty popular [03:50] kvda_: I had a look at that one, but i didn't like the way you have to write your source [03:50] Hebo: https://github.com/joyent/node/wiki/modules#wiki-templating [03:50] kvda_: Unless you can enter regular html into Jade? [03:50] kvda_: Thanks Hebo, this looks a comprehensive list [03:50] Hebo: you want something like erb? [03:50] dr0id has joined the channel [03:50] Hebo: where you're basically writing html [03:51] ningu has joined the channel [03:51] deedubs: kvda_: sounds like you might like http://twitter.github.com/hogan.js/ [03:51] ningu: another day, another npm [03:52] SubStack: http://substack.net/images/triceratops.png [03:52] kvda_: Yes I think so, you write html but you get the power of a scripting language.. to output static html again [03:52] dgathright has joined the channel [03:52] ningu: SubStack: new module? [03:53] Hebo: kvda_: mustache/hogan doesn't want you to have logic in your template--just string interpolation and _vary_ basic statements [03:53] Hebo: very* [03:53] kvda_: So it wouldn't be so useful for as HTML template builder? [03:54] warz has joined the channel [03:54] warz has joined the channel [03:54] tbranyen: mustache gives you some logic, but it sucks [03:54] kvda_: TO make it clearer, the html files need to be static, I just want a templat builder that lets me do basic things so that I can have one footer.html file for example [03:54] tbranyen: hey want to go through ridiculous hoops to make your template engine to work? I SURE DO!! [03:54] tbranyen: -to [03:55] kvda_: So i'd expect this template builder to have a directory watcher etc.. [03:55] SubStack: ningu: negatory, just new art for the browserling queue [03:55] SubStack: all dinosaurs this time [03:55] achiu1 has joined the channel [03:56] kvda_: Thanks for you recommendations guys :) [03:56] ningu: SubStack: do you mourn the loss of brontosaurus? [03:57] Hebo: kvda_: you can set up any of those templaters to render to a static html file with a small script [03:57] SubStack: why mourn something that never was? [03:58] kvda_: That's good to hear.. Hogan might be the one then [03:58] ericmuyser has joined the channel [03:58] kvda_: It seems to be what I'm looking for [04:00] myndzi\: any experience with async.js? how do you specify the callbacks when using async.series? [04:00] myndzi\: or does it just auto-insert them? i'm getting an error either way [04:01] Hebo: each function takes a callback param, which you have to call at the end of your fn [04:02] myndzi\: well, i'm using a library (zombie.js) [04:02] myndzi\: typically it's like [04:02] myndzi\: browser.visit("url", function(){}); [04:03] myndzi\: but when i use async.series([browser.visit("url"), ...]) i get an error from the second function in the chain [04:03] myndzi\: that seems to be indicating the first one isn't complete [04:03] myndzi\: (item doesn't exist on page) [04:03] AvianFlu has joined the channel [04:03] Hebo: you need to wrap browser.visit in a function [04:03] myndzi\: ah. [04:03] ningu: every function in async.series has to take a callback as its argument [04:03] myndzi\: too bad [04:03] myndzi: it was gonna look clean until you said that [04:04] Hebo: you can use async.apply to avoid that [04:04] kPb_in has joined the channel [04:05] myndzi: that's a little better, thanks [04:05] Hebo: if you do that, however, you will lose your .this reference, so you might need to use .bind() if .visit depends on .this [04:05] tommyvyo has joined the channel [04:05] blueadept has joined the channel [04:06] myndzi: yeah, i may just use this iced coffeescript thing [04:06] myndzi: i don't really want to [04:06] Hebo: haha [04:06] myndzi: but it sure makes the code look nice [04:06] Hebo: to avoid a few function declaractions, heh [04:06] myndzi: i'm just comparing [04:06] myndzi: code doesn't even work yet, i'll show you when it does [04:06] Hebo: cool [04:07] myndzi: i'm getting a "cannot read property length of undefined" error, gotta love how libraries disguise where the problem is [04:07] sh1mmer has joined the channel [04:08] illourr has joined the channel [04:09] illourr: ello there mates [04:09] Hebo: sup [04:09] myndzi: well whatever, you can compare without it even working yet [04:09] myndzi: :P [04:10] pckt has joined the channel [04:11] sammmy: I suppose it's not a good idea to block, but how do you do practically work in a non-blocking environment? Say I have a model function who's job is to create a new user. In order for model.create(..) to create a new user it must first query the database to see if that user exists, which means that you'd need to wait on this callback before model.create executes it's callback. Seems kind of like a hassle. Would it be a bad idea [04:11] sammmy: to block in this case? [04:12] myndzi: http://pastebin.com/4UJ2ywCk [04:12] Hebo: that's what libraries like asyn.js are for [04:12] Hebo: async* [04:12] myndzi: not ideal, wish i could ditch the defer call entirely [04:12] yogig has joined the channel [04:12] nqbao has joined the channel [04:12] nqbao has left the channel [04:13] konobi: sammmy: you're blocking _everything_ then [04:13] brianleroux has joined the channel [04:14] Hebo: myndzi: does that apply stuff work without bind? [04:14] sammmy: konobi: True. But, it feels kind of awkward, almost dumb, to put almost everything in a callback. :\ [04:14] myndzi: i did say it's broken :( [04:14] myndzi: probably not, which means bind adds more mess [04:15] myndzi: anyway i don't WANT to like it but ... yeah, that looks super clean [04:15] Hebo: myndzi: write it with functions at first to verify. bind would just be browser.visit.bind(browser) [04:15] myndzi: so it'd be like [04:16] myndzi: [function (callback) { browser.visit("url", callback) } ? [04:16] ningu: myndzi: what are the semantics of browser.visit()? [04:16] ningu: is it sync or async? [04:16] myndzi: browser.visit(url, callback) [04:16] myndzi: async [04:16] Hebo: that looks right [04:16] ningu: ok, then yeah, that should work [04:17] gavin_huang has joined the channel [04:17] illourr has joined the channel [04:17] myndzi: yay, made it work [04:18] konobi: sammmy: then you can use something other than node... but the whole point is to be async... therefore callbacks [04:18] sammmy: Right. [04:18] konobi: you can use stuff like the async library to help with that [04:18] sammmy: If only JavaScript allowed for non-blocking function returns of somekind. [04:19] myndzi: still so much repetition :\ [04:19] myndzi: i'll see where it takes me [04:19] myndzi: i don't want to pull in a ton of dependencies [04:20] mapreduce has joined the channel [04:21] sreeix has joined the channel [04:21] isaacs has joined the channel [04:22] polardude has joined the channel [04:22] mapreduce: I'm just starting reading docs, not tried anything out yet, but a question that pops into mind straightaway is.. if one typically listens on the HTTP port from within the node program, can you compose two or more node programs and have them running on the same port as you can with separate PHP clusterf.. programs? [04:23] polardude: ahh, I'm following through The Node Beginner Book… and my mind is blew... [04:23] polardude: Inversion of Control is quite interesting… any better examples on how this works (dependency injection) [04:24] _baton_ has joined the channel [04:24] polardude: From a procedural point of view, it looks like a black hole where it feeds itself and somehow the objects are passed backwards [04:24] pckt: Anyone familiar with hook.io know why something like this http://pastebin.com/2CUFBTZu won't work [04:25] mapreduce: polardude: From procedural (as in C) point of view, you get your dependencies via parameters. [04:26] redir has joined the channel [04:26] mapreduce: so if you use a FooBarBaz, you get one passed to you as a FooBarBaz *, instead of creating one yourself. Or possibly you get a factory instead of the pointer directly, depends on the design. [04:26] polardude: mapreduce: I just finished the portion where I add the ability for exec to do a function without blocking the event loop [04:27] polardude: *added [04:27] mapreduce: that it's a pointer is irrelevant to the point above, sorry. [04:27] polardude: Ah, gotcha [04:27] diva has joined the channel [04:27] polardude: It assumes that it would be passed as designed [04:27] mapreduce: I'm reading the same thing but luckily I'm already familiar with IoC so I skipped that. [04:28] polardude: mapreduce: how did you learn such concepts? through experience or what? [04:29] sphinxxx has joined the channel [04:29] mapreduce: Originally through reading elsewhere about IoC, but I did also notice that my own code was tending towards passing things in as parameters. [04:29] isaacs has joined the channel [04:31] warz has joined the channel [04:31] warz has joined the channel [04:34] thirdknife has joined the channel [04:36] kenperkins has joined the channel [04:37] petschm_ has joined the channel [04:38] polardude: mapreduce: lucky [04:38] kyledr_ has joined the channel [04:39] niloy has joined the channel [04:42] Avanine has joined the channel [04:42] polardude: mapreduce: this is dandy by the way, http://stackoverflow.com/questions/3058/what-is-inversion-of-control [04:49] onar_ has joined the channel [04:52] Joeysomo has joined the channel [04:55] OmidRaha has joined the channel [04:57] jergason has joined the channel [04:58] crewmoss has joined the channel [04:58] yawNO_ has joined the channel [04:58] zenethian has joined the channel [05:00] RobWC1 has joined the channel [05:00] RobWC1 has left the channel [05:03] yogig has joined the channel [05:05] Edler has left the channel [05:06] crew has joined the channel [05:06] SomeoneWeird has joined the channel [05:09] kPb_in has joined the channel [05:09] mattgifford has joined the channel [05:11] MagiC3PO has joined the channel [05:11] MagiC3PO has joined the channel [05:13] SomeoneWeird: is there a way to push info to a browser apart from socketio? [05:14] AdamGoodrich has joined the channel [05:18] Spion has joined the channel [05:22] jacobolus has joined the channel [05:23] brainss has joined the channel [05:23] noganex_ has joined the channel [05:28] zeade has joined the channel [05:29] SamuraiJack has joined the channel [05:29] rurufufuss has joined the channel [05:33] qjcg has joined the channel [05:33] r04r has joined the channel [05:33] r04r has joined the channel [05:34] alm0nd has joined the channel [05:37] kvda_ has joined the channel [05:42] ericmuyser has joined the channel [05:43] Joeysomo has joined the channel [05:43] jtsnow has joined the channel [05:47] sreeix has joined the channel [05:47] myndzi: grar [05:47] timoxley has joined the channel [05:47] myndzi: internet says you should be able to search by css selector in chrome's dev tools window but i can't work out how to do it [05:56] andrehjr has joined the channel [05:56] socketio\test\06 has joined the channel [05:57] maxogden: document.querySelectorAll() [06:01] syntaxiko has joined the channel [06:01] alejandromg: hey maxogden today I installed couchmail without success, then I went to archive.couchdb.org and I tried the search but a 404 error is show it up, what can it be? [06:04] pid1 has joined the channel [06:05] syntaxiko has joined the channel [06:07] michaelmartinez has left the channel [06:08] jetienne_ has joined the channel [06:09] Hanspolo has joined the channel [06:11] sreeix_ has joined the channel [06:13] orlandovftw has joined the channel [06:16] sreeix_ has joined the channel [06:17] syntaxiko has joined the channel [06:19] fred___ has joined the channel [06:19] disappearedng has joined the channel [06:21] thirdknife has joined the channel [06:23] achiu has joined the channel [06:24] syntaxiko has joined the channel [06:25] disappearedng: Anyone here uses heroku [06:27] kirbysayshi has joined the channel [06:27] nqbao has joined the channel [06:27] nqbao has left the channel [06:28] mendel_ has joined the channel [06:29] jkridner__ has joined the channel [06:29] syntaxiko has joined the channel [06:31] Joeysomo has joined the channel [06:40] joshontheweb has joined the channel [06:42] Ragnok has joined the channel [06:42] Ragnok has joined the channel [06:42] huggies has joined the channel [06:44] kokotron has joined the channel [06:45] cryptix has joined the channel [06:47] ditesh|cassini has joined the channel [06:48] toothr has joined the channel [06:48] EhevuTov has joined the channel [06:55] take_cheeze has joined the channel [06:56] simenbrekken has joined the channel [06:57] benvie has joined the channel [06:58] disappearedng: If anyone can help with this I would really appreciate it http://stackoverflow.com/questions/9715199/deploying-rails-and-nodejs [06:59] __doc__ has joined the channel [07:02] k1ttty_ has joined the channel [07:05] jesusabdullah: disappearedng: I don't use heroku (I work for nodejitsu) but here's my take: [07:05] jesusabdullah: disappearedng: First, check out https://github.com/nodejitsu/node-http-proxy for node-based proxying (similar to your haproxy approach) [07:06] jesusabdullah: disappearedng: Second, shared database is ghetto but more common than you'd think [07:06] jesusabdullah: disappearedng: Finally, the way I like to do these things is make as many json api's as possible and tie them together at the end. [07:07] grefven has joined the channel [07:08] EhevuTov has joined the channel [07:09] nicholas_ has joined the channel [07:09] disappearedng: jesusabdullah: thanks for the suggestion [07:09] disappearedng: yeah dude shared db is **ghetto** [07:10] dobber has joined the channel [07:11] skylamer` has joined the channel [07:11] jyp_ has joined the channel [07:11] samsonjs_ has joined the channel [07:12] jomoho has joined the channel [07:12] jol02 has joined the channel [07:12] descipher_ has joined the channel [07:12] gr4ysca__ has joined the channel [07:12] jesusabdullah: like I said though: More common than you realize. [07:13] jesusabdullah: oh, check out redis pubsub [07:13] jesusabdullah: similar arrangement, less ghetto [07:14] tobmastr has joined the channel [07:14] pradeepbv_ has joined the channel [07:14] saidinesh has joined the channel [07:15] jetienne__ has joined the channel [07:15] thisanda- has joined the channel [07:17] jesusabdullah: oh, and disappearedng, nodejitsu offers similar services to heroku, specific to node apps [07:18] graeme_f has joined the channel [07:20] ph^ has joined the channel [07:20] _main_ has joined the channel [07:21] philips_ has joined the channel [07:22] grefven_ has joined the channel [07:22] robhawkes has joined the channel [07:23] sammmy: I feel like Node needs another language than JS. One that's similar to JS, but enhances on the features most used in Node (lambda's and objects parameters). Anyone else ever think that? [07:23] djazz has joined the channel [07:24] jetienne: sammmy: some did the same principle in lua [07:24] YoY has joined the channel [07:24] jesusabdullah: sammmy: nope. [07:24] Skaag has joined the channel [07:25] jesusabdullah: sammmy: Also, coffeescript. [07:25] sammmy: I'm not sure how lua looks; I'll check it out. True about coffeescript. [07:25] jesusabdullah: when it comes to js though, I'm a staunch conservative [07:25] sammmy: you don't like coffeescript? [07:26] jesusabdullah: interesting as an experiment, but I don't like seeing it in production no [07:26] jetienne: i like my code to keep running, so i go for standard [07:26] sammmy: I see. [07:26] jesusabdullah: I don't feel like getting into it though [07:26] framlin: sammmy: whats wrong about lamda, parameters and JS? JS is great! [07:26] jesusabdullah: too tired [07:26] MerlinDMC has joined the channel [07:26] jetienne has left the channel [07:26] sammmy: framlin: Nothing is wrong with it, it's good. But I feel like it could be better. [07:27] framlin: what exactly could be better? [07:27] sammmy: Some ideas I have for a language (although nowhere completed), are as follows: [07:27] koo3 has joined the channel [07:28] TTSDA_ has joined the channel [07:28] framlin: anything what you are missing about JS-lambda-"support"? [07:28] TTSDA_ has joined the channel [07:28] Fabryz has joined the channel [07:28] tomh has joined the channel [07:28] tomh has joined the channel [07:28] tomh has joined the channel [07:29] meso_ has joined the channel [07:29] OmidRaha has joined the channel [07:29] sammmy: Statements: function arg, arg, arg. Lambdas: { } Callbacks: function arg, { }. [07:29] tokumine has joined the channel [07:29] framlin: ???? [07:29] sammmy: That's some basics there. Obviously it would remove the whole function(){} cruft. [07:30] framlin: I do not get your idea [07:30] traph has joined the channel [07:30] framlin: lambdas ARE about functions .... [07:30] sammmy: true [07:31] sammmy: Not every function is a lambda, though every lambda is a function. Am I correct on that? [07:31] jesusabdullah: depends on the language [07:31] sammmy: jesusabdullah: true too. But in js? [07:31] jesusabdullah: javascript doesn't make the distinction [07:31] jesusabdullah: at all [07:31] jesusabdullah: which is how it *should* be [07:32] sammmy: Good, cause in my language it is. [07:32] jesusabdullah: ACTION & zZz [07:33] sammmy: { } is a function literal, so to speak. To define variables in my language you'd use a function like say 'let': let x, { }. #this would set x to the value of { } and make it a function. [07:33] sammmy: But where is the parameter list you might ask? [07:35] framlin: until now I only see a little bit of syntactic sugar in your language [07:35] sammmy: Every function scope has a special args variable (similar to arguments in JS). You use it to access the arguments passed to a function like so: let x, { return args/0 }. x 'hello world'. [07:35] framlin: var x = function(){return y}(); [07:36] sammmy: framlin: for the most part, it would be sugar syntax, as it is IMO that JS got a lot of things right so it's heavly borrrowed from. [07:36] fangel has joined the channel [07:36] sammmy: However, there are some extra concepts that would make it even more useful. [07:37] framlin: semms not to bee a good idea to include your syntax into node, because nobody would be able to read it or toc write algorithms with it, because its extreemly unusual [07:37] myndzi: how can i increase the size of the call stack? [07:38] myndzi: is there some configuration parameter i can compile v8 with? [07:38] sammmy: Argument labels for example: let x, { return args/someLabel; }. x someLabel:23. [07:39] sammmy: framlin: it's only unusual at first. Once you get give it time (like any language) it becomes so obvious. [07:39] nym has joined the channel [07:39] framlin: sammmy: ONE of the reasons of the success of node.js so far is, that it uses a language that supports the event-loop "natively" and that it is known (at least syntactically) by a huge amount of coders all over the world [07:41] sammmy: framlin: True. The domination that JS has over the client-side has made it near impossible for a new language to come about. However, if you are inspired by JS with a new language that is design to serve as JS does only more, I don't see how JS coders wouldn't be able to adopt it. The learning curve wouldn't be steep especially with a JS to WhatEverMyLanguageWillByCalled tutoral [07:41] levi501d has joined the channel [07:42] stafamus has joined the channel [07:42] framlin: to proove your theory, take the sources of node and replace the V( with a VM of your choise .... maybe lisp or haskel or opal .... opal is a lot mor like your language as JS is. In two years you may compare the number of the users of node.opal with the number of users of node.js .... ;) [07:42] umren has joined the channel [07:43] framlin: .. V8 ... [07:43] mansoor has joined the channel [07:44] sammmy: I think there will always be more node.js people because it started first. But, not creating something that could be better because it wont be as popular isn't a strong argument against it. Look at the languages JS was inspired by, certainly not as popular as C. [07:46] sammmy: ugh. Opal looks ugly. >.< [07:46] kmiyashiro has joined the channel [07:46] stonebranch has joined the channel [07:46] sammmy: My language is more purly functional like lisp, only without the annoying paranthesis syntax. [07:46] framlin: no, as far as I know, are there today more node.js followers than rails followers,where node.js started years after rails ... [07:47] framlin: but opal is very very very lambda-ish ;) [07:48] framlin: opal is THE PURE functional language ... ask Prof. Dr. Peter Pepper ;) [07:48] AvianFlu has joined the channel [07:48] hipsters_ has joined the channel [07:48] framlin: .... opal was my first programming language .... ;) [07:49] sammmy: framlin: from what it looks like is that opal has operators. :\ [07:49] framlin: IMHO JS is a good compromise between a functional and a OO-Language and that is what is making its success, together with its commonly used syntax-style [07:51] groom has joined the channel [07:51] framlin: these ** -> "signs" are not "operators" they are "declarators" [07:51] SubStack: I like how JS doesn't have special scoping rules for classes [07:51] SubStack: fuck classes [07:51] sammmy: I think so too. But, I also think that some will consider a language that basically borrows all of JS's semantics with a little bit extra added on top. [07:52] framlin: yep ... I like that object-prototype-style .... [07:52] sammmy: agreed [07:53] sammmy: Like I said, my language would be prototypical too. The only difference with my language would be centered around functions even more than JS. Sense everything would be a function call. [07:54] sammmy: I should really think of a codename for it for now. Ideas? [07:54] dannyamey has joined the channel [07:54] framlin: some years ago I never had thaought, that it could be püossible to code business-critical enterprise applications with JS, but I have learned its not only possible, it works better than - e.g. - with java ... [07:55] insanoid has joined the channel [07:56] herbySk has joined the channel [07:56] framlin: sammmy: so you think, that mr. Eich has missed its target to code Lisp/Sceme for the browser? ;) [07:56] sammmy: Yeah. JS is my favorite language. [07:56] tornad has joined the channel [07:57] sammmy: framlin: what do you mean? [07:58] webben has joined the channel [08:00] emattias has joined the channel [08:01] levi501d has joined the channel [08:01] ph^ has joined the channel [08:01] chrisvwebdev has joined the channel [08:01] sammmy: What's a good way to report errors in my callbacks? Should I return error codes or something? Or should I just leave string messages? [08:01] lumgwada has joined the channel [08:01] jetienne has joined the channel [08:02] aliem has joined the channel [08:02] markwubben has joined the channel [08:02] SubStack: sammmy: strings or a new Error('string goes here') as a first parameter works pretty well [08:03] rendar has joined the channel [08:03] framlin: sammmy: was hired by netscape as a sceeme coder for a sceme project (AFAIK). Than he should implement a language for the browser, that looks like Java ... so he took its sceme-experiences and gave it some Java-Syntax .... [08:03] framlin: Mr. Eich was hired ... [08:03] madhums has joined the channel [08:04] sammmy: SubStack: Hmm. But if my models are internal APIs it doesn't seem like it makes much sense to have descriptive (human readable) strings if what I will most likely be doing is checking what type of error occured when I executed a model's method. [08:05] SubStack: why do you want to check types? [08:06] sammmy: Well, let's say I have users.create({firstName:..., lastName:..., email:...}, function(error) { /*do something according to the error*/ }); [08:06] SubStack: do something like... [08:06] sammmy: I'm making my models as lower level. [08:07] framlin: sammmy: http://yuiblog.com/crockford/ [08:07] SubStack: why do you need "models"? [08:07] neshaug has joined the channel [08:07] neshaug_ has joined the channel [08:07] sammmy: framlin: He's good. ;P [08:07] framlin: yepp ;) [08:07] SubStack: don't you just what a nice api that happens to save some state to disk? [08:08] SubStack: I think that's how this whole "models" business should be approached [08:08] SubStack: I don't even use those terms [08:08] sammmy: SubStack: I'll use models as an abstraction from my database. Rather than copying SQL queries everywhere I design an API to interface with the high-level concepts of my data. [08:09] ppcano has joined the channel [08:09] SubStack: why don't you just make a nice api that happens to talk to your database? [08:09] SubStack: don't need to call them models [08:09] disappearedng: Anyone know why I am getting "We are sorry but something went wrong" and the entry in error.log is cache: [GET /users/auth/facebook/callback?code=AQC-7o-BxqPp18L_0CGwAKDBP_79jR8hkpcl3hIM1GZYSlNCodC-KprzajdbWXKkqdMZZ7tLThFLI9d4JDEDwJ9gnSfNjDJNNGfEtjfnf8dw2ybOmUhAnjM6CXzqPidFysg-yU84zvE-zwHIu4yiaF8JD-93wGjz_pt1LGcK09ewbpGjs-RAg6SyXYQ6kXD0skI] miss ? [08:09] SubStack: and why do you need a special kind of error? what's wrong with strings? [08:10] k1ttty has joined the channel [08:10] [[zz]] has joined the channel [08:10] SubStack: if you are sending information through errors that informs the flow of the program then that's not really an error at all, that 's a normal result [08:10] ziro` has joined the channel [08:11] sammmy: SubStack: what difference does it make what I call them. I just call them models and put them in a models directory. In reality all they are is an interface between my application and my database. I'll use it to add/remove records, maybe even hold some non-persistent data, etc. [08:12] sammmy: SubStack: Well, if you try to create a new user with an email address that's already recorded in my db, then that's considered an error at some level. [08:12] SubStack: because you're just obscuring what you're trying to actually accomplish by calling them models [08:12] framlin: sammmy: right, thts *usually* calld a "model" ;) [08:12] SubStack: sammmy: then cb('user exists') [08:12] SubStack: bam [08:12] SubStack: done [08:13] SubStack: and bubble that up to the ui [08:13] sammmy: straight forward enough. But I suppose than I would use if (error == 'user exists') as my way to define what caused my error. [08:13] SubStack: why do you need to define what caused it? [08:14] joshgillies has joined the channel [08:14] SubStack: just render it in the ui [08:14] sammmy: eh. Not define. Wrong wording there ^ [08:14] SubStack: easy [08:14] Isolation has joined the channel [08:14] SubStack: I usually throw down a
for every form that could render errors [08:14] sammmy: I could use if (error == 1) or some number code. [08:14] westg has joined the channel [08:14] framlin: SubStack: sometimes you have business rules, so only rendering it in the ui may not be enough ... [08:14] SubStack: with display: none then I .fadeIn(200).text(err) [08:14] spolu has joined the channel [08:15] SubStack: sammmy: numbers are hellish because you have to keep a canonical mapping someplace [08:15] SubStack: and that mapping needs to stay in sync [08:15] SubStack: why not strings! [08:15] SubStack: I don't get this. [08:15] SubStack: framlin: such as? [08:15] sammmy: I'm thinking more in terms of opening the API up to other uses then my application, so making error codes or something would be a good design choice right now. Think why HTTP has error codes. [08:15] SubStack: until you can actually demonstrate that a particular case actually exists why kick yourself over this? just do it the easy way [08:16] SubStack: no! [08:16] SubStack: fuck those [08:16] sammmy: lol [08:16] SubStack: do it the easy way [08:16] framlin: if there occures an "eeror" you have to call some algorithms to inform soime subsystems about it and they have to run some algorithms concerning that "error" [08:16] SubStack: refactor it later if it's actually a problem which it probably won't be [08:16] sammmy: I'm not sure if that's good advice though. But, I'm assuming it worked for you this long? [08:17] framlin: but the "sync-problem" with error-codes is a real one ... [08:17] sammmy: sync-problem? [08:18] niloy has joined the channel [08:18] framlin: error codes tend to spread over the whole system [08:18] SubStack: not really [08:18] framlin: and they tend to become more [08:18] SubStack: just use strings [08:18] SubStack: easy [08:18] [AD]Turbo has joined the channel [08:18] SubStack: no error code database necessary [08:18] [AD]Turbo: hi there [08:19] SubStack: if something fucks up just bubble up the string to the ui [08:19] SubStack: you can log it if you want too [08:19] SubStack: and if the logs are annoying you can ignore the more frequent ones [08:19] framlin: so there is the danger, that there are many places an many subsystems where you have to map numbers to "meaning" and that tends to become a nightmare [08:19] sammmy: maybe just have a users.ERR_USER_EXISTS = 0. But I see now that typing ERR_USER_EXISTS in reality is the same as if I were to type a string "ERR_USER_EXISTS". So why not just come up with a convention for error messages that is consistent. [08:19] SubStack: that's silly [08:19] SubStack: just use a string [08:20] SubStack: no conventions necessary [08:20] sammmy: No I meant store the code in that property. [08:20] SubStack: why is this so hard it's never been an issue for me doing it this way [08:20] sammmy: I think a convention would be good for pretty easy too. [08:20] Morkel has joined the channel [08:22] SubStack: architecture astronaut syndrone [08:22] sammmy: SubStack: You're right. Thanks for convincing me. Most of my mistake when working is over complicating things. I'm just going to go with short, all lowercase error messages. [08:22] cosmincx has joined the channel [08:23] sammmy: How come nothing about the syndrom comes up on google? [08:24] sammmy: Oh damn google made it synonym. -.- [08:25] gavin_huang has joined the channel [08:25] hojberg has joined the channel [08:26] fangel has joined the channel [08:27] zinkem has joined the channel [08:27] Karmaon has joined the channel [08:27] Karmaon has joined the channel [08:30] erikzaadi has joined the channel [08:31] ccare has joined the channel [08:31] dpino has joined the channel [08:31] ccare_ has joined the channel [08:32] mansoor: Which cluster do you guys use? The one that comes native with Node.js or the one by LearnBoost? Or does learnboost's now use native one under the hood [08:32] ph^ has joined the channel [08:33] SubStack: mansoor: I just spin up multiple processes wheee [08:33] sammmy: ACTION is annoyed to have the choice of choosing between function() { and function() \n{ [08:33] shachaf_ has joined the channel [08:34] tokumine has joined the channel [08:34] SubStack: ACTION likes function () { [08:35] marlun has joined the channel [08:35] marlun has joined the channel [08:35] mansoor: SubStack, you live on the edge bro :p [08:35] SubStack: ACTION conserves vertical line space [08:36] AD7six has joined the channel [08:37] SubStack: that shit is a scarce commodity when you have 4 xterms tiled in a grid on a 1440x900 laptop tft lcd [08:37] whitman has joined the channel [08:37] jkarsrud has joined the channel [08:37] SubStack: with vim set to a hard-wrap at 80 cols [08:38] SubStack: I pretty much couldn't write java if I wanted to under these self-imposed constraints [08:38] SubStack: oh and 4 spaces [08:38] michaelhartau has joined the channel [08:38] mansoor: IDK how you can focus... for any amount of sustained coding period i can't have more than 1 thing on the screen at a time [08:38] mansoor: and i have a 24" monitor [08:41] campo has joined the channel [08:45] darkspe has joined the channel [08:50] sammmy: Who here created the mysql module? [08:50] pvankouteren has joined the channel [08:53] sammmy: I think that the ? convention in the mysql module could be usefully extended to support ?n for using the same parameter multiple times in a query. [08:53] salva has joined the channel [08:55] panosru has joined the channel [08:55] toothr has joined the channel [08:56] SubStack: sammmy: in other db modules there are named placeholders [08:57] sammmy: Is there a better db module for mysql? [08:57] SubStack: I mean in other languages [08:57] SubStack: something worth copying [08:58] zomg: Bah [08:58] ppcano has joined the channel [08:58] pickels has joined the channel [08:58] zomg: I seem to have again managed to put a memory leak in my node app :P [08:59] AndreasMadsen has joined the channel [08:59] zomg: Putting a forever restart into cron for fix... [08:59] zomg: har har [08:59] zomg: =) [08:59] sammmy: SubStack: I see. Well, I'm guessing not too many use mysql coupled with Node.js? [09:00] wingie: SubStack: do i either use testling or travis and not both together? [09:02] joshgillies has joined the channel [09:03] stonebranch has joined the channel [09:03] k1ttty has joined the channel [09:03] jetienne has joined the channel [09:03] pgte has joined the channel [09:04] hipsters_ has joined the channel [09:04] pid1 has joined the channel [09:06] krisu has joined the channel [09:07] kPb_in has joined the channel [09:07] aslant has joined the channel [09:08] Mulex has joined the channel [09:10] cha0s has joined the channel [09:10] cha0s has joined the channel [09:12] westg: anyone know what the difference betwen route param pre-conditions and route middleware is? [09:14] maritz has joined the channel [09:15] djcoin has joined the channel [09:16] shapeshed has joined the channel [09:16] Morkel has joined the channel [09:17] pickels has joined the channel [09:19] defts has joined the channel [09:20] mschneider has joined the channel [09:20] thirdknife has joined the channel [09:23] SuMarDi has joined the channel [09:23] mikedeboer has joined the channel [09:23] tvw has joined the channel [09:23] Vespakoen has joined the channel [09:24] disappearedng has joined the channel [09:25] Vainoharhainen has joined the channel [09:25] velo has joined the channel [09:27] rio{ has joined the channel [09:28] graeme_f has joined the channel [09:28] diegoviola has joined the channel [09:28] mansoor: NPM publish down? [09:29] riven has joined the channel [09:29] Astro-: yes :( [09:30] sreeix_ has joined the channel [09:30] beeviz has joined the channel [09:31] eldios has joined the channel [09:32] mansoor: Astro-, o_O how long have yo uhad that name? [09:32] robi42 has joined the channel [09:32] benwtvr has joined the channel [09:34] robhawkes has joined the channel [09:34] robi42 has joined the channel [09:36] markwubb_ has joined the channel [09:37] _olouv_ has joined the channel [09:37] riven` has joined the channel [09:38] madhums has joined the channel [09:39] kPb_in_ has joined the channel [09:39] robi42 has joined the channel [09:40] Rob- has joined the channel [09:40] SuMarDi has joined the channel [09:41] riven has joined the channel [09:41] riven has joined the channel [09:41] Astro-: mansoor: like 15 years? [09:42] stagas has joined the channel [09:42] jimmysparkle has joined the channel [09:42] mansoor: ahh ok [09:42] sreeix_ has joined the channel [09:42] hackband has joined the channel [09:42] er1c_ has joined the channel [09:42] thisandagain has joined the channel [09:43] JuanCri has joined the channel [09:43] stutter has joined the channel [09:43] zz_shykes has joined the channel [09:43] fangel has joined the channel [09:43] flazz has joined the channel [09:43] gshipley has joined the channel [09:43] mpereira has joined the channel [09:43] Chel: question: how to test file exists or not ? [09:43] Octayn has joined the channel [09:44] SubStack has joined the channel [09:44] pkrumins has joined the channel [09:44] Astro-: mansoor: registry.npmjs.org back up again! [09:44] stagas: Chel: path.exists [09:44] Chel: stagas: thanks [09:44] Chel: stagas: very easy =) [09:44] jimmy- has joined the channel [09:44] wamberg has joined the channel [09:44] SubStack: pesky amazonians [09:45] mansoor: Astro-, awesome thanks [09:45] jvolkman has joined the channel [09:46] JasonSmith: I began disaster-recovery on the NPM repo but EC2 is back up now so I've cancelled it [09:47] niloy has joined the channel [09:47] SubStack: it was as if half the internet cried out in pain and then went silent [09:47] cynicaljoy has joined the channel [09:48] mansoor: lolol [09:48] pradeepbv has joined the channel [09:49] epokmedi1: is the npm registry replicated at multiple places? [09:50] riven has joined the channel [09:50] riven has joined the channel [09:50] mikedeboer has joined the channel [09:50] elijah has joined the channel [09:51] nqbao1 has joined the channel [09:51] stevengill has joined the channel [09:51] nqbao1 has left the channel [09:52] alm0nd has joined the channel [09:52] bergie_ has joined the channel [09:55] maritz: hm, this seems super weird: http://www.reddit.com/r/node/comments/qwzan/nodejs_benchmarks_http_vs_https/c418ccc what is going on there? (not strictly a node.js question though) [09:58] al3xnull has joined the channel [09:59] TomY has joined the channel [10:00] diva has joined the channel [10:02] josh-k has joined the channel [10:03] nickky has joined the channel [10:03] nickky: hi [10:04] nickky: anybody [10:04] nickky: there [10:04] nickky: hello [10:04] bradleyg has joined the channel [10:04] joshfinnie has joined the channel [10:05] umren has joined the channel [10:05] robi42 has joined the channel [10:06] raydeo has joined the channel [10:06] maritz: no, apparently all gone. [10:06] sandfox has joined the channel [10:06] westg has joined the channel [10:07] niloy has joined the channel [10:08] kvda has joined the channel [10:08] kvda: Hello, is using npm install -g bad form these days? [10:08] kvda: ie. best to use local node_modules folder? [10:09] izepstan has joined the channel [10:10] blup has joined the channel [10:10] timoxley has joined the channel [10:10] anoop has joined the channel [10:13] maritz: depends on what you need the module for?! [10:13] nickky: what is thing all about??? [10:13] maritz: if you need it globally, install it globally [10:13] kvda: sure [10:13] maritz: nickky: it's about a man in a forest who didn't exactly know why the duck in his lap was bleeding out of its eyes. [10:14] nickky: so many people out here...no one to speak up [10:14] Mezriss has joined the channel [10:14] kvda: thanks maritz, the node docs are saying global module folders are for "historic reasons" [10:14] kvda: http://nodejs.org/docs/latest/api/modules.html#modules_loading_from_the_global_folders [10:14] thalll has joined the channel [10:14] enmand has joined the channel [10:14] AviMarcus has joined the channel [10:15] maritz: kvda: yes, dependencies should NOT be global [10:15] maritz: but for example tools you use for development or other stuff, why not? [10:15] kvda: I don't think I get the difference? [10:16] maritz: if you're writing some node.js code that has a dependency on another module, put that dependency into your package.json and use "npm install .". [10:17] maritz: if you want to install a tool that is unrelated to the node.js code you're writing, and your code doesn't depend on it, you can use -g [10:18] AviMarcus: Hey.. I've been playing with node.js and once I started getting a bit of a handle on callbacks/async stuff it's very, very cool. I'm using it a bit for command-line scripts.. but sometimes takes like 2 seconds to load.. or *best* case scenarios, loading cliff.js and colors.js takes 58ms.. and I might want to include more stuff. is there any way to compile the .js file for faster performance? [10:18] kvda: Great, thanks maritz [10:19] AviMarcus: erm faster startup. [10:19] maritz: AviMarcus: node version? because there have been constant improvements on startup times [10:19] maritz: and there will probably be more [10:19] maritz: also, are you absolutely sure it's the startup time? [10:19] AviMarcus: the ubuntu package, v0.6.12 [10:19] AviMarcus: yeah the one IO thing - a sql query - is *usually* 6ms [10:20] AviMarcus: but I'm not sure it's node.js startup time -- could be mostly the requires I have in it. [10:20] AviMarcus: load-cliff-colors: 476ms -- happened twice. [10:20] AviMarcus: I did a console.timer thing before and after [10:20] maritz: hm, the only thing i can for sure is that 0.8 will have startup improvements. [10:20] maritz: before what? [10:21] maritz: you can't do console.timer() before node.js is started up!? [10:21] AviMarcus: http://pastebin.com/jwf3dC47 [10:21] AviMarcus: the two requires [10:21] rauchg has joined the channel [10:21] maritz: well, that's not startup time [10:21] maritz: that's require time [10:21] DrPheltRight_ has joined the channel [10:22] AviMarcus: ok.. any way I can streamline that? [10:22] Vespakoen has joined the channel [10:22] Mezriss has joined the channel [10:22] cyphase has joined the channel [10:22] Vespakoen has left the channel [10:23] maritz: it might actually be a problem in the modules you're requiring [10:23] maritz: try requiring a file that just does "module.exports = 'hello world';" and time it [10:23] jacobolus has joined the channel [10:25] maritz: because that takes 0-2ms for me. with an average of below ~1. [10:26] Mezriss has joined the channel [10:27] Mezriss has joined the channel [10:27] dpino has joined the channel [10:27] maritz: -below [10:28] AviMarcus: yep, 0ms [10:29] AviMarcus: I specified the full path of the require [10:29] AviMarcus: and now it seems to be a consistent 40ms [10:29] AviMarcus: there was i/o sputtering while it was trying to find the module maybe. Now it's prolly system cached better.. [10:29] AviMarcus: 40ms I can live with.. :P [10:30] fearphage has joined the channel [10:30] AviMarcus: 131ms now. 50, 60, 50, 40... mm. [10:30] robhawkes has joined the channel [10:32] maritz: well, the modules can block in the requiring phase. i don't know what these modules you're importing actually do, so i can't give you any answer [10:34] AviMarcus: maritz, can I load them async? I suppose I'd have to make sure they are ready then when I need them.. [10:35] maritz: i believe at some point there was an async require... but no. [10:35] daniel_hu has joined the channel [10:35] AviMarcus: cliff is a module for pretty formatting for console.log output or watson logging. [10:36] maritz: yeah, i figured that much, but i don't wanna read through all that code :P [10:36] HardFu has joined the channel [10:37] caioketo: Hello there [10:37] caioketo: is there any tutorial about websocket and sockets? [10:37] dannyamey has joined the channel [10:38] dekroning has joined the channel [10:39] westg has joined the channel [10:43] level09 has joined the channel [10:45] enmand has joined the channel [10:45] Mezriss has joined the channel [10:45] AviMarcus: caioketo, did you check out the socket.io project? [10:50] aslant has joined the channel [10:51] djazz has left the channel [10:53] copongcopong has joined the channel [10:55] savudin has joined the channel [10:55] umren has joined the channel [10:55] vguerra has joined the channel [10:57] hellp has joined the channel [10:57] caioketo: not really [11:00] AviMarcus: caioketo, that's your place to start, I'd think. [11:00] AviMarcus: then dnode or now.js if you want to use those sockets to run commands. or use that to sync the backbone.js client side MVC [11:03] tomnewmann has joined the channel [11:03] larsschenk has joined the channel [11:04] kokotron: sockets still not supported by IE? [11:04] larsschenk1 has joined the channel [11:04] caioketo: what i need is a simple conversor.... [11:04] caioketo: from websocket to socket.... [11:05] Hanspolo has joined the channel [11:05] larsschenk1 has left the channel [11:05] micheil has joined the channel [11:07] dekub has left the channel [11:07] sandfox has joined the channel [11:08] dknstrkt has joined the channel [11:09] brainss has joined the channel [11:09] kvda: Is there a simple way to do colours for console.log? [11:09] Mezriss has joined the channel [11:10] TomY has joined the channel [11:10] ph^ has joined the channel [11:11] luismreis has joined the channel [11:11] redir has joined the channel [11:12] eldios: kvda, yes there are plenty indeed [11:12] eldios: let me give you some gh links [11:13] kvda: many thanks eldios [11:13] kvda: I found this method so far [11:13] kvda: but it would be nicer to extend console somehow [11:13] caioketo: how can I low the version of my node?^ [11:14] caioketo: i got 0.7.6 i need 0.7.0 [11:14] eldios: https://github.com/Marak/colors.js kvda from SubStack [11:14] maritz: caioketo: are you sure you need 0.7.0? [11:14] maritz: 0.7.x is unstable [11:15] noganex has joined the channel [11:15] caioketo: or less [11:15] caioketo: i need to use socket.io [11:15] caioketo: but i think i installed node worng [11:15] maritz: then install 0.6.12?! [11:15] caioketo: its 0.7.6 [11:15] caioketo: how can I do it? [11:15] yawNO has joined the channel [11:15] maritz: follow the readme [11:16] caioketo: its just download and install [11:16] caioketo: it will override the existing one? [11:16] maritz: what os? [11:16] chazor has joined the channel [11:17] caioketo: ubuntu [11:17] maritz: yes, it will. [11:17] timschristie has joined the channel [11:17] eldios: kvda, also this one https://github.com/flatiron/cliff [11:17] mikl has joined the channel [11:17] caioketo: ok, ill try it [11:17] maritz: there are also several node version managers that make this whole process simpler and more awesome [11:17] maritz: like nvm [11:18] kvda: awesome thank eldios ! [11:18] spolu has joined the channel [11:19] SubStack: http://substack.net/images/t-rex.png [11:19] yawNO: who pinged me tonight [11:19] eldios: SubStack, already seen.. awesome as always =) [11:20] eldios: btw, is it me or you're gettin better? maybe you only gave more time on this last one [11:22] SubStack: I'm going for a more detailed scary look for the carnivores [11:22] eldios: oooh [11:23] SubStack: land before time esque [11:26] scottdware has joined the channel [11:27] elio_ has joined the channel [11:28] xSmurf has joined the channel [11:28] Joeysomo has joined the channel [11:30] Cheery has joined the channel [11:30] Cheery: does node.js have webgl/webaudio? [11:30] stafamus has joined the channel [11:31] scottdware: there is an npm module 'webgl' [11:31] Cheery: just wondering because doing webgl apps into browser is horrible. [11:31] i42n has joined the channel [11:31] scottdware: head over to http://search.npmjs.org and look there [11:32] confoocious has joined the channel [11:33] spolu has joined the channel [11:34] AviMarcus: eldios, caioketo cliff is a formatter. It relies on colors.js to do the color part, anyway. [11:34] wankdanker has joined the channel [11:35] hkgrani has joined the channel [11:35] eldios: I see [11:37] Joeysomo has joined the channel [11:37] enmand has joined the channel [11:38] Goshlee has joined the channel [11:39] Raydiation has joined the channel [11:39] Goshlee: . [11:39] Raydiation: hi is stylus usable without node.js? [11:39] Goshlee: 05Not sure [11:41] Joeysomo has joined the channel [11:41] `3rdEden has joined the channel [11:41] yawNO has joined the channel [11:42] yawNO: http://addyosmani.com/resources/essentialjsdesignpatterns/book/ [11:42] yawNO: :Q___ [11:42] Raydiation: yawNO: looks great ty [11:42] yawNO: ur welcome [11:42] redir has joined the channel [11:43] jetienne has joined the channel [11:43] maritz: yawNO: guess who! [11:44] enmand_ has joined the channel [11:44] yawNO: maritz: ryan dahl? [11:44] maritz: close [11:44] yawNO: maritz: ? [11:44] maritz: oh, that wasn't your guess? [11:44] maritz: wait, what? [11:45] yawNO: i mean [11:45] yawNO: have you pinged me? [11:45] maritz: yes. [11:45] yawNO: then http://is.gd/UGL47i [11:45] joshgillies has joined the channel [11:46] i42n has joined the channel [11:46] maritz: okay [11:46] yawNO: btw why [11:46] Cromulent has joined the channel [11:46] insanoid has joined the channel [11:46] yawNO: inb4 to wake you up while you were sleeping [11:47] maritz: you were sleeping? you have your irc and sound on while sleeping? [11:47] yawNO: obv [11:47] maritz: holy shit, i know what i'll do tonight! [11:47] yawNO: lol [11:47] yawNO: i have irc and no sound [11:47] Goshlee has left the channel [11:48] yawNO: but display lights up when i get mentioned [11:48] yawNO: at 2 am its worse than a flashbang granade [11:48] erichynds has joined the channel [11:48] MartinCleaver has joined the channel [11:48] Raydiation has joined the channel [11:49] hackband has joined the channel [11:50] erichynds has joined the channel [11:50] icebox has joined the channel [11:51] maritz: i'll get home between 1am and 2am tonight. will i be sober enough to remember this? we'll see :P [11:51] yawNO: pfff [11:51] yawNO: swear [11:51] yawNO: i'll catch you and you'll become my pokemon if you do something like that [11:52] AntelopeSalad: would it be a wise decision to use bcrypt instead of the sha-xxx with the crypto module for storing passwords? [11:53] maritz: AntelopeSalad: i think so, bcrypt is generally considered one of the safest things you can do to store passwords [11:54] maritz: AntelopeSalad: i'm not a security expert though [11:54] bizniz98 has joined the channel [11:54] AntelopeSalad: i've just seen bcrypt used a lot lately in various projects [11:55] sfeu has joined the channel [11:56] dobber has joined the channel [11:57] heavysixer has joined the channel [11:57] fermion has joined the channel [11:58] tommyvyo has joined the channel [11:58] hipertracker has joined the channel [11:59] iangreenleaf has joined the channel [12:02] marcostoledo has joined the channel [12:03] stepheneb has joined the channel [12:05] insanoid has joined the channel [12:05] quasi has joined the channel [12:08] jetienne has left the channel [12:12] arvidkahl has joined the channel [12:13] tmike1 has joined the channel [12:14] thinkt4nk has joined the channel [12:14] dubenstein has joined the channel [12:14] dr0id has joined the channel [12:14] booo has joined the channel [12:16] c4milo has joined the channel [12:19] infynyxx has joined the channel [12:19] luismreis_ has joined the channel [12:19] TomY has joined the channel [12:22] stagas has joined the channel [12:22] pgte: kvda: http://search.npmjs.org/#/colors [12:23] kvda: thanks pgte , already got it working :) [12:23] kvda: Does fs.watch() work on OS X out of the box? Or do you need to install kqueue? [12:24] arduix has joined the channel [12:27] Shrink has joined the channel [12:27] jtsnow has joined the channel [12:28] Poetro has joined the channel [12:28] Poetro has joined the channel [12:28] chazor has joined the channel [12:30] maritz: it should work afaik [12:30] xippi has joined the channel [12:30] xippi has joined the channel [12:30] maritz: never tested it though and don't even own a device with os x [12:30] stepheneb has joined the channel [12:32] ditesh|cassini has joined the channel [12:32] mandric has joined the channel [12:32] mikl has joined the channel [12:33] smorin has joined the channel [12:34] jomoho2 has joined the channel [12:36] booyaa: heya pgte nice to see you on the irc :) [12:37] jetienne has joined the channel [12:38] pgte: booyaa: hey, I usually hand out here, but could be more active ;) [12:38] pgte: s/hand/hang [12:38] booyaa: heh cool! :) [12:38] crodas has joined the channel [12:38] fairwinds has joined the channel [12:38] booyaa: you planning to do any more tuts? i imagine you're fairly busy on other stuff though... [12:39] epokmedia has joined the channel [12:39] pgte: booyaa: yeah, I have a whole new series in the pipeline, but it will be a joint community effort [12:39] pgte: slightly different format, more complete, and recycled stuff [12:39] pgte: soon, just waiting for some design stuff [12:39] booyaa: nice! let me know if you want any reviewers and stuff [12:40] pgte: it will be an open process, github-driven :) [12:40] pauls1 has joined the channel [12:41] amigojapan has joined the channel [12:41] booyaa: excellent, if you decide to go down the video route can i make a request you stay on vimeo? [12:41] booyaa: i use spool to watch your tuts offline, youtube hates spool [12:41] Raydiation has joined the channel [12:43] CromeDome has joined the channel [12:46] andrehjr has joined the channel [12:47] brianseeders has joined the channel [12:47] vkareh has joined the channel [12:49] fumanchu182 has joined the channel [12:49] baudehlo has joined the channel [12:50] pgte: booyaa: yes, I intend to stay on vimeo :) [12:51] djcoin has joined the channel [12:51] medberry has joined the channel [12:51] medberry has joined the channel [12:52] TheDudeKnows has joined the channel [12:52] noganex has joined the channel [12:53] Daelin has joined the channel [12:56] CromeDome has joined the channel [12:57] insin has joined the channel [12:57] kwmiebach has joined the channel [12:58] MartinCleaver has joined the channel [13:01] skylamer` has joined the channel [13:01] AaronMT has joined the channel [13:02] lazyshot has joined the channel [13:03] Stoobles has joined the channel [13:05] jmar777 has joined the channel [13:06] vam3c has joined the channel [13:06] kjeldahl has joined the channel [13:07] bnoordhuis has joined the channel [13:08] briancray has joined the channel [13:09] pickels has joined the channel [13:12] BillyBreen has joined the channel [13:12] yogig has joined the channel [13:16] savudin has joined the channel [13:16] ceej has joined the channel [13:17] nphase has joined the channel [13:17] svnlto has joined the channel [13:17] chazor has joined the channel [13:19] tmike has joined the channel [13:21] c4milo has joined the channel [13:21] TheJH has joined the channel [13:22] crutex has joined the channel [13:22] crutex has joined the channel [13:23] davidsklar has joined the channel [13:25] IrishGringo has joined the channel [13:28] booo: if i'm writing my module/package code in coffee script should the actual package for npm contain only the coffee code or also (only?) the compiled js code? [13:29] jergason has joined the channel [13:30] MerlinDMC has joined the channel [13:32] luizlopes has joined the channel [13:32] gavin_huang has joined the channel [13:34] rwaldron has joined the channel [13:34] level09 has joined the channel [13:36] kirbysayshi has joined the channel [13:37] Blorb has joined the channel [13:40] maritz: that depends on the quality of the code :P [13:40] maritz: if it's so bad that no one should use it, keep the coffee script only version [13:40] maritz: (hint: require() can't read cs) [13:41] philips has joined the channel [13:41] deedubs: (hint: if you require('coffee-script') it can) [13:41] deedubs: but you still shouldn't use it ha [13:42] emattias_ has joined the channel [13:42] bergie_ has joined the channel [13:43] CarterL has joined the channel [13:44] DrPheltRight has joined the channel [13:44] plutoniix has joined the channel [13:44] josh-k has joined the channel [13:45] maritz: deedubs: no, in my world it can't (i'm in denial) [13:46] deedubs: okay well only you live in your world and in the real world that's incorrect [13:46] madtimber has joined the channel [13:46] maritz: yes. but my world is better [13:46] maritz: wait, you mean you have to first "require('coffee-script')" and that somehow overwrites require? [13:47] deitarion has joined the channel [13:47] boonrumor has joined the channel [13:48] deedubs: yes [13:48] bradleyg has joined the channel [13:49] Wizek has joined the channel [13:50] deedubs: ACTION doesn't support the use of cs but wants people to come to that conclusion based on truths [13:50] deitarion: I'm trying to add a password field to a model I'm defining using Sequelize (Only API I know which lets me choose between a scalable server (MySQL) and something end-user-proof (SQLite) at runtime. Suggestions welcome.) and I get the impression that foo#getBar is somehow the syntax for getters, but I can't Google for docs on a punctuation character. Little help? [13:51] deitarion: s/getters/setters/ (Why I'd use getters for storing passwords hashed, I don't know) [13:51] deitarion: s/#get/#set/ [13:51] karterk has joined the channel [13:53] louissmit has joined the channel [13:54] artusrocha has joined the channel [13:55] Leemp: In the category of libraries like RequireJS or Browserify (where they take working server code, and attempt to package them up in a usable way in the browser), are there any others one should be aware of? Or are those two basically the only ones? [13:56] artusrocha1 has joined the channel [13:56] Edy has joined the channel [13:57] snearch has joined the channel [13:57] JSONB has joined the channel [13:57] thomblake has joined the channel [13:57] thomblake has left the channel [13:57] madhums has joined the channel [13:57] SRH_ has joined the channel [13:59] al3xnull has joined the channel [14:00] gavin_huang has joined the channel [14:02] i42n has joined the channel [14:03] vam3c has joined the channel [14:06] larsschenk has joined the channel [14:06] pandeiro has joined the channel [14:06] larsschenk has left the channel [14:06] piscisaureus_ has joined the channel [14:06] Cheery: there was this one Bret Victor video about debugging: http://vimeo.com/36579366 [14:07] RLa has joined the channel [14:07] nudenode has joined the channel [14:07] Cheery: he calls a function with certain arguments and 'debug-prints' every value of variable assignment. [14:07] nudenode: is node-mysql slow? [14:08] Cheery: I wonder whether it's possible in javascript without a fancy compiler. [14:08] nudenode: im selecting 120k rows from a table. without any "row" listeners, the "end" event fires 2 seconds later [14:08] Raydiation has joined the channel [14:08] nudenode: the same query takes 0.01 seconds in php [14:08] nudenode: what im missing? [14:08] bnoordhuis: nudenode: what kind of row data? [14:08] RLa: nudenode, paste code for both [14:08] brainss has joined the channel [14:09] bnoordhuis: node-mysql has trouble with big text fields [14:09] nudenode: RLa please wait [14:09] nudenode: no they should be tiny rows with a couple of ints maybe [14:09] nudenode: pasting code soon, brb [14:09] RLa: in php, if you do not fetch rows (mysql_fetch_*) it does not transmit data [14:10] nudenode: http://pastebin.com/bg6xfsNq [14:11] rickibalboa has joined the channel [14:12] bnoordhuis: nudenode: profile your app with `node --prof app.js` and run it through nprof (see node-profiler), that should tell you where the bottleneck is [14:12] isaacs has joined the channel [14:12] yawNO has joined the channel [14:12] yawNO: damn internet [14:12] halfhalo has joined the channel [14:12] yawNO: pidgeons must be busy these days [14:12] carlyle has joined the channel [14:13] Topcat_ has joined the channel [14:13] bnoordhuis: ah, good ol' rfc 1149 [14:13] carlyle has joined the channel [14:13] AviMarcus: profiler? [14:14] nudenode: bnoordhuis: is this something i can add without npm? [14:14] nudenode: node-profiler [14:14] bshumate has joined the channel [14:14] bnoordhuis: nudenode: download the nprof script from github, it's standalone [14:14] RLa: nudenode, paste php code as well [14:15] nudenode: RLa: phpMyAdmin executes that query in no time [14:15] smorin has joined the channel [14:15] nudenode: i dont have the corresponding php code tho [14:15] maritz: yawNO: it's getting pretty warm so i guess a lot of them are going back north. [14:15] RLa: nudenode, and it actually displays *all* those rows? [14:15] rickibalboa: May be a long shot, but is there a way to pass an open tcp socket to a different process, while keeping it open and not closing it? [14:15] bnoordhuis: nudenode: phpmyadmin usually only fetches the first 30 rows or so... [14:15] yawNO: maritz: i shot em all [14:15] yawNO: :3 [14:16] RLa: 30 rows vs 120k :P [14:16] bnoordhuis: rickibalboa: yes but nothing that's officially supported [14:16] nudenode: wait, im trying with limit 0, 9999999 [14:16] bnoordhuis: rickibalboa: check out how the cluster module does it [14:16] nudenode: one monent [14:16] maritz: yawNO: THEN HOW DOES INTERNET WORK? [14:16] rickibalboa: bnoordhuis, ok thanks (Y) [14:16] yawNO: maritz: downloaded 65 mb in 3 mins [14:17] yawNO: 590k average [14:17] yawNO: not bad [14:17] RLa: it probably crashes your browser while trying to display them all [14:17] bnoordhuis: rickibalboa: that's the bundled cluster module btw, not tj's cluster module (confusing!) [14:17] maritz: well duuh, i get even better rates by carrying hard disks. [14:17] rickibalboa: Ok, I'll look into it, thanks. [14:17] bizniz98 has joined the channel [14:17] PPPaul has joined the channel [14:18] yawNO: maritz: i used to throw usb sticks [14:18] yawNO: bout 8 gb/sec [14:18] yawNO: depends on the usb stick [14:18] colinclark has joined the channel [14:18] yawNO: it works great on short distances [14:18] AndreasMadsen: rickibalboa: If its a TCP socket and not a TCP server handler I do not think the cluster module will help you. But what do you mean with keeping it open. [14:18] yawNO: but becomes useless when d > 25m [14:19] ohtogo has joined the channel [14:19] maritz: hm, time to invent the usb cannon. [14:19] nudenode: RLa: indeed, my browser crashed, being smarter now [14:19] AndreasMadsen: rickibalboa: you can send a socket to another process over IPC but you will have to close it in the parent. However the child can still write and read from it. [14:19] rickibalboa: AndreasMadsen, it's a TCP socket not a handler, I mean keeping it open, like, not disconnecting it so there is no downtime, I figured it wouldn't be possible. [14:19] rickibalboa: Will the client behind the other end of the socket notice anything? [14:19] RLa: yawNO, what about sending full 3TB hard drive by physical mail? [14:20] AndreasMadsen: rickibalboa: You can do that, but not with cluster ... sec [14:20] RLa: hm, how much bandwidth that gives? [14:20] tobias1 has joined the channel [14:21] maritz: build an arduino robot hand that is controlled by a node.js app. this will take a usb stick (that is filled with data by a node.js app) out of a usb port and put it in a cannon and aim it at another arduino hand somewhere in the distance that will then catch the usb stick and put it in another usb port where a node.js app will read the contents. e voila node.js powered wireless transfer rates as fast as you can shoot (or the robot). [14:21] AndreasMadsen: rickibalboa: you will have to take out the ._handle object and send it using fork().send() and then call ._handle.close() -> there is a pull request there make this easier https://github.com/joyent/node/pull/2772 [14:22] hipertracker has joined the channel [14:22] yawNO: RLa: u mad? [14:22] jacquestardie has joined the channel [14:22] jscheel has joined the channel [14:22] jscheel has joined the channel [14:22] RLa: yawNO, with 2 day delivery its 17MB/sec and about 139Mbit/sec [14:22] AndreasMadsen: rickibalboa: you can try to copy some code from that one. [14:23] yawNO: lol [14:23] kevwil has joined the channel [14:23] yawNO: id rather do it by hand [14:23] maritz: RLa: you forgot the read/write times [14:23] yawNO: take my car [14:23] AviMarcus: rickibalboa, you seen zeromq? that's a magic messaging queue thing. [14:23] yawNO: oh wait you mean regular mail [14:23] yawNO: not email [14:23] yawNO: yeah cool [14:23] yawNO: :P [14:23] RLa: yeah, you need to get data on the drive too :/ [14:23] AndreasMadsen: rickibalboa: and this is another example -> https://github.com/indutny/sticky-session/blob/master/lib/sticky-session.js#L47L60 [14:24] argami has joined the channel [14:24] rickibalboa: AndreasMadsen, I'll look into zeromq, and thanks! [14:24] AviMarcus: tab fail. [14:24] maritz: AndreasMadsen: what do you mean "tab fail."? [14:24] trevor_ has joined the channel [14:24] maritz: :P [14:24] argami_ has joined the channel [14:24] deedubs: +1 for zeromq AndreasMadsen [14:25] maritz: AndreasMadsen++ [14:25] AviMarcus: xchat doesn't even let me do "a-