[00:00] Draggor: wadey: err, that's still being shown as a Utf8Value type [00:00] wadey: you need to do *value [00:00] wadey: it's overloaded like we were discusssing above [00:00] nonnikcam has joined the channel [00:01] matyr has joined the channel [00:01] romainhuet_ has joined the channel [00:01] Draggor: I just read that from the doc, sorry [00:01] tjholowaychuk: its lots of magical fun [00:02] Draggor: also the *value is a char* I misread, due to useing *s in another context often :3 [00:03] wadey: haha, yeah I can see how that would be confusing :) [00:03] tshpaper has joined the channel [00:04] Xano has joined the channel [00:04] astropirate has joined the channel [00:04] daleharvey has joined the channel [00:04] mlncn has joined the channel [00:04] nail_ has joined the channel [00:04] Nacho has joined the channel [00:05] broofa_ has joined the channel [00:07] overra has joined the channel [00:08] tjholowaychuk: accessors are SUPER slow [00:08] tjholowaychuk: holy [00:08] tjholowaychuk: stylus is ~3x faster without them [00:08] balaa has joined the channel [00:08] tjholowaychuk: madness [00:08] ryah: not optimized [00:09] tjholowaychuk: i knew they were slower but that is a massive difference [00:09] ryah: good news is that when they are optimized we'll get a nice boost :) [00:09] tjholowaychuk: :D [00:09] tjholowaychuk: go v8 go [00:10] Draggor: wadey: So next question, how do I get a regular old int out of args? [00:10] sivy has joined the channel [00:10] ryah: we should probably fix process.std* and console to not be accessors [00:10] ryah: until v8 optimizes it [00:10] mraleph: there are actually two different things here. [00:11] mraleph: one is not bailing out from optimization pipeline when seeing global variable with accessor, other is optimizing getter and setter on real objects. [00:11] ryah: mraleph: tell us, benevolent overlord [00:12] tjholowaychuk: mraleph: so it *can* be done, it just hasn't ? [00:12] paulrobinson has joined the channel [00:12] mraleph: yes. [00:12] tjholowaychuk: i needed to switch anyway [00:13] tjholowaychuk: cool [00:13] piscisaureus: mraleph: do you now under what circumstances gcc can and can't optimize pointer accesses? [00:14] mraleph: first thing is easy to do. I even think someone in the team experimented with it already. the other is more difficult (you really want to inline smallish getters), but it is also doable. [00:14] davidascher has joined the channel [00:14] warz has joined the channel [00:15] pignata has joined the channel [00:15] mraleph: ryah: I feel more like a talkative parrot :-) [00:15] mraleph: or maybe talkative elephant. [00:16] piscisaureus: mraleph: you are like the oracle of delphi [00:16] mraleph: piscisaureus: that depends what kind of optimization you would like to see :-) [00:17] piscisaureus: mraleph: I was able to verify that it's smart enough to understand: [00:17] piscisaureus: int a, *pa = &a; [00:17] piscisaureus: *pa = 234; [00:17] piscisaureus: *pa = 23423; [00:17] piscisaureus: fprintf(stderr, "%d\n", a); [00:17] mraleph: piscisaureus: you mean I am like a girl who breathes in toxic fumes and exhales cryptic prophecies? [00:18] piscisaureus: mraleph: hehe. [00:18] piscisaureus: mraleph: well you're the one that always has advice :-) [00:18] hassox has joined the channel [00:19] mraleph: well this smallish sample should get optimized with O2. key thing here is aliasing analysis. GCC needs to understand which reads/writes alias each other. [00:19] wadey: Dragoor: sorry was afk [00:19] wadey: args[0]->ToUint32()->Value() [00:19] wadey: if it is a Uint32 [00:19] wadey: there is also ToNumber for doubles [00:20] wadey: as well as ToInt32 and ToInteger [00:20] piscisaureus: mraleph: you know if there is a convenient way to check if gcc actually did a good job? I mean, with this sample I was able to look at the disassembly but for larger programs with a lot of inlining that sucks [00:20] mraleph: piscisaureus: but the problem is aliasing analysis is hard even when strict aliasing is enabled, so GCC can be easily confused. so for really hot paths it makes sense to help GCC by caching results of dereference where it makes sense. [00:21] zachsmith has joined the channel [00:21] mraleph: piscisaureus: I guess looking at disassembly is really the only way. and in places where you _know_ it matters you should do it manually. [00:21] mraleph: but really you need to be sure that it matters. [00:22] piscisaureus: :-) [00:22] mraleph: on really hot tight paths. [00:23] hornairs has joined the channel [00:23] piscisaureus: mraleph: I always believed the rumors that c compilers generate really good assembly code. But I'm getting more and more disappointed... [00:24] btipling: is there a way to change the exit code when using process.on('exit' callback); within the callback? [00:24] mraleph: well. you need to help them and sometimes you need to write things in assembly. [00:24] mraleph: but usually it just does not matter. [00:24] mraleph: you just rent another server from amazon and you are done. [00:25] mraleph: :-) [00:25] jslearner has joined the channel [00:25] piscisaureus: :-) [00:25] piscisaureus: smash your money [00:25] btipling: before the process exits I want to check for something and if that something meets a certain criteria exit with value 1 [00:26] fumanchu182: I know the channel is mostly related to node.js core but I have a question about socket.io. I have been banging my brain against a wall trying to figure out how to disconnect a Client context from socket.io on the server side. I have looked at the Listener object and event set client.connected = false; but to no avail. Any ideas or hints on this one? [00:26] jslearner: Hi fellows. I'm researching NodeJS and wondering if anyone knows when approximately NodeJS originated. [00:26] Egbert9e9 has joined the channel [00:27] btipling: jslearner: contact joyent? [00:28] btipling: look at the git log? [00:28] btipling: :\ [00:28] jetienne: v8: ($=-[$=[]],$$=$/$+(!$+{}),_=-~-~-~$,__=$$[(_*_)+~$],$$[_*_]+__+$$[$]+$$[-~(_*_)]+__+$$[_+-~-~$]+$$[_+-~$]) [00:28] v8bot: jetienne: "boNjour" [00:28] piscisaureus: mraleph / anyone: Is there a way to test the caching efficiency of code? [00:28] piscisaureus: this is the last question for now :-) [00:28] jetienne: silly bot :) [00:29] alek_br has joined the channel [00:31] jetienne: jslearner: Mon Feb 16 01:02:00 2009 +0100 is the date of the first commit [00:31] jslearner: feb 2009 [00:31] jslearner: thanks [00:31] mraleph: caching efficiency? you mean like "CPU cache"? [00:31] piscisaureus: yes [00:32] zzak: lol [00:32] piscisaureus: I don't know, maybe count cache misses ? [00:32] mraleph: well you can profile it with something that can count Cache misses. [00:32] jetienne: valgrind does it no [00:32] mraleph: e.g VTune on windows [00:32] mraleph: cachegrind on linux [00:33] konobi: dtrace on OSX, FreeBSD and Solaris [00:33] mraleph: but cachegrind is really an emulator --- so it will count an approximation of cache behaviour (very slow, but pretty accurate). [00:33] pygi has joined the channel [00:33] pygi: hey folks [00:33] pygi: I was wondering if any of you runs any cool FOSS projects? [00:33] piscisaureus: ok. *googling for cachegrind*. thanks for the pointers :-) [00:33] pygi: I'm looking to sponsor some [00:34] piscisaureus: v8 is a FOSS project and google is prettly low on money I hear [00:34] rchavik has joined the channel [00:34] pygi: piscisaureus: :P [00:34] Draggor: wadey: thanks! I hope to actually have a couple of bigint functions working soon [00:34] tjholowaychuk: piscisaureus: cachegrind is with valgrind iir [00:34] tjholowaychuk: might be a separate install [00:34] pygi: piscisaureus: I mean offer servers :p [00:34] pygi: piscisaureus: dont be evil [00:34] paul_k has joined the channel [00:34] mraleph: on Linux there is "perf" [00:35] konobi: valgring --tool cachegrind [00:35] mraleph: it's kinda dtrace for Linux [00:35] konobi: lol [00:35] mraleph: capable of recording various hardware events. [00:36] btipling: process.binding('evals').Script; [00:36] mraleph: you need a recent kernel to use it. [00:36] btipling: what is that line doing? [00:36] btipling: process.binding Script stuff is not in the documentation [00:36] siculars has joined the channel [00:36] sivy_ has joined the channel [00:37] mraleph: but it is really helpful and much more usable then oprofile was [00:37] btipling: I do not see any documentation for 'binding' [00:38] konobi: btipling: see http://nodejs.org/docs/v0.4.2/api/vm.html instead [00:38] astropirate: Is there a way to remove a router from Connect's Router middleware? [00:38] piscisaureus: kewl. checking cachegrind and perf [00:38] pygi: so nobody eh? [00:38] pygi: : [00:38] pygi: :p [00:38] mike5w3c_ has joined the channel [00:39] btipling: konobi: yes, but I know about vm, but what is binding? [00:39] tjholowaychuk: astropirate: not at the moment, I would like to expand on the api some day [00:39] konobi: btipling: it's for accessing internals [00:39] piscisaureus: pygi: I guess everybody who needs one already has a no.de account ... [00:39] btipling: konobi: can I use binding to change the exit code during process.on('exit' ? [00:39] konobi: btipling: no [00:39] astropirate: tjholowaychuk, allrighty thanks [00:40] zeqeiroz has joined the channel [00:40] konobi: btipling: the exit code is what the process exits with... if you need to change it... change your child process to exit with an explicit exit code [00:40] matyr_ has joined the channel [00:40] AAA_awright has joined the channel [00:41] kmwallio has joined the channel [00:41] btipling: konobi: but I can't exit out of the process.on('exit' callback without recursion [00:41] davidascher has joined the channel [00:41] btipling: konobi: can I listen for when a vm finishes all execution? Is there some kind of event that fires? Do not see such a thing in the documentation. [00:41] konobi: btipling: hhhmmm... [00:41] btipling: konobi: I am running tests in a context and am trying to exit the node.js context with 1 instead of 0 if any of the tests in the context fail [00:42] konobi: btipling: exiting due to a signal? [00:42] btipling: I want all the tests to finish running [00:42] btipling: and see how many errors there are [00:42] btipling: and then exit with 1 if there are any errors [00:42] konobi: just wrap everything with a callback [00:43] konobi: if(errors){ exit(1) } else { exit(0) } [00:43] btipling: not sure how I can give the vm a callback [00:44] mikegerwitz: btipling: process.once( 'exit', function() { process.exit( 5 ); } ); [00:44] btipling: mikegerwitz: ! [00:44] btipling: I'll try that [00:44] rchavik_ has joined the channel [00:44] konobi: hhhmmm... that's new [00:44] mikegerwitz: $ echo $? [00:44] mikegerwitz: 5 [00:44] fumanchu182: I just learned a very import lesson. Socket.io implements event emitter on client so to disconnect the current client call client.emit('disconnect'); [00:44] brainless has joined the channel [00:44] fumanchu182: node.js++ [00:45] btipling: that worked! [00:45] btipling: mikegerwitz: thank you [00:45] mikegerwitz: btipling: There's also removeListener(), but once() is easier :) [00:45] btipling: I see it's just an event emitter [00:45] btipling: I get it now [00:45] btipling: yay [00:46] matyr has joined the channel [00:48] DevX101 has joined the channel [00:48] piscisaureus has joined the channel [00:48] mlncn has joined the channel [00:49] dnolen has joined the channel [00:50] pedrobelo has joined the channel [00:50] pygi has left the channel [00:52] throughnothing_ has joined the channel [00:52] Slashbunny has joined the channel [00:56] drudge: tjholowaychuk: how do vhosts work in express [00:56] tjholowaychuk: drudge: connect has a little vhost middleware you can try [00:56] tjholowaychuk: it wont work for everything though [00:57] tjholowaychuk: it's not a proxy, it basically just accepts a server object and maps to it via the host and invokes it's handler [00:57] TooTallNate: tj: what won't the vhost work for? [00:57] tjholowaychuk: so in a sense, all the servers become one [00:57] tjholowaychuk: TooTallNate: if you want one https and one http [00:57] tjholowaychuk: etc [00:57] tjholowaychuk: there are more cases [00:57] arpegius has joined the channel [00:58] tjholowaychuk: you could whip up a little proxy in no time though, or use nginx [00:58] harth has joined the channel [01:01] tjholowaychuk: drudge: you can check out the implementation in connect if you want [01:01] tjholowaychuk: its maybe 12 lines lol [01:01] drudge: yeah i'm looking at it [01:03] drudge: not much too it is right :P [01:03] drudge: to* [01:03] tjholowaychuk: :D [01:03] tjholowaychuk: its mostly a toy, but it does work out fine for some cases [01:05] sivy has joined the channel [01:06] ossareh has joined the channel [01:12] nodelover has joined the channel [01:14] gazumps has joined the channel [01:14] zentoooo has joined the channel [01:14] soulofpeace has joined the channel [01:16] dguttman has joined the channel [01:16] bartt has joined the channel [01:16] eshira has joined the channel [01:16] dguttman has joined the channel [01:18] eshira: I'm using christkv/node-mongodb-native. Does anyone know how I would pass in a sort or group option into mongo_client.find()? [01:18] mraleph has joined the channel [01:19] TooTallNate: Anyone here had luck with Stored Procedures and 'node-mysql-libmysqlclient'? [01:19] brapse has joined the channel [01:19] fusspawn has joined the channel [01:19] eshira: Mmm figured it out: find({...}, {sort:[['field','desc']]}, callback) [01:20] insin: ACTION just accidentally tried to install an Ubuntu package with npm [01:20] isaacs: haha [01:20] isaacs: i mix up git and npm commands a lot. [01:20] insin: the isaacs matrix has you! [01:22] matyr has joined the channel [01:23] Croms has joined the channel [01:23] bartt has left the channel [01:24] hassox has joined the channel [01:25] zpao has joined the channel [01:27] xla has joined the channel [01:28] Egbert9e9 has joined the channel [01:29] skm has joined the channel [01:29] Evet has joined the channel [01:29] blueadept2 has joined the channel [01:29] skm has joined the channel [01:32] TooTallNate: damn, no libmysql client users here? [01:32] lukegalea has joined the channel [01:33] Croms has joined the channel [01:33] zpao has joined the channel [01:35] lukegalea: hi all. Somewhat simple question I hope.. I need to send an EOF.. should "\0" do it? [01:35] lukegalea: (it's not).. [01:35] hornairs has joined the channel [01:37] Draggor: lukegalea: if you're dealing with streams, actually doing .end() should work [01:37] lukegalea: hmm.. I wonder what's up. Just trying to call the amazon SES script via exec.. it's never finishing, presumably because it doesn't know the message body is over. Will experiment a bit more. Thanks Draggor [01:38] DJBouche has joined the channel [01:38] Croms has joined the channel [01:41] tallica has left the channel [01:41] binaryjohn has joined the channel [01:42] mjr_ has joined the channel [01:42] Sorella has joined the channel [01:43] fayce has joined the channel [01:44] prettyrobots: What is the prettiest way to print JSON? [01:44] prettyrobots: I'd like to print JSON as pretty as sys.inpsect. [01:45] geoffeg_: I can't dedide which rpc system I wanna use with node.js. My network of rpc'd node.js instances will all have the same code base. I like dnode's simplicity but am concerned about having to make an API that's all continuation style. IPCNode looks cool but it hasn't had a commit since august of last year. [01:46] prettyrobots: geoffeg_: Network means callbacks. [01:47] SubStack: yeah for high-latency async calls there's no way of getting around continuations [01:47] eyesUnclouded has joined the channel [01:47] SubStack: although you can bolt on stuff like chaining on top of async apis [01:47] skm has joined the channel [01:48] geoffeg_: yea, i could develop an rpc-less API and then add a dnode wrapper. [01:49] asdfsafdsa: hello, i have the same question someone had a couple of days ago. is it possible to do the opposite of require()? I need to share a few variables with several scripts [01:49] lukegalea has joined the channel [01:50] SubStack: opposite of require? o_O [01:50] geoffeg_: asdfsafdsa: you might consider doing a singleton. it's like a global but without the ickyness [01:50] Evet: how to cluster node among servers? [01:51] AphelionZ has joined the channel [01:53] willwhite has joined the channel [01:53] asdfsafdsa: not sure what a singleton is :/ [01:54] matyr_ has joined the channel [01:54] davidascher has joined the channel [01:54] geoffeg_: here. i'll gist it [01:54] matschaffer has joined the channel [01:54] geoffeg_: https://gist.github.com/865335 [01:54] jiveB: Evet: you can just startup a node process everywhere and stick a load balancer infront [01:55] jiveB: eg. nginx with a few lines of configuration [01:55] geoffeg_: hmm, i haven't tested to verify that's actually a singleton [01:55] geoffeg_: asdfsafdsa: come to think of it, that's probably not what you want [01:55] Evet: jiveB: nginx will decrease performance [01:56] dominic_ has joined the channel [01:56] asdfsafdsa: i dont think so either [01:56] asdfsafdsa: when i use require(), i want to be able to pass in some variables that can be used within the required script [01:57] Evet: jiveB: is there a module for loadbalancing? cluster module seems to work local only [01:58] jiveB: Evet: not sure, I've only used nginx to scale node processed [01:59] jiveB: *processes [01:59] Evet: jiveB: but nginx doesnt support keepalive proxying. it decreases performance by half [02:00] Evet: and its http only, you cant use websockets, etc. [02:00] dyer has joined the channel [02:01] jiveB: true, but websockets is pulled from firefox4 so I don't really care [02:01] fayce: Evet: maybe a node app that acts like a loadbalancer... [02:01] fayce: Evet: just found this http://www.contentwithstyle.co.uk/content/nodejs-load-balancer-proof-of-concept [02:01] Evet: fayce: yes [02:02] fayce: (I was wondering the same thing as you..) [02:02] lukegalea has joined the channel [02:02] jiveB: fayce: is it safe now to put nodejs out front? [02:02] sivy has joined the channel [02:02] astropirate: asdfsafdsa, why not pass variables do it? var foo = require('bar').bar(paramHere); << so you are initializing it with the data if it an object. else, you can just export a helper function that would set the variables inside of the module and you can pass param into that. [02:04] fayce: jiveB: I'm very new to Nodejs... all what I know is that 0.4 is just too early..but with all the community interest and contributions I can only believe that it's quite promising. [02:04] asdfsafdsa: ty astropirate that should work (: [02:05] astropirate: :D [02:05] Evet: fayce: and its why im interested in nodejs :) [02:08] mikeal has joined the channel [02:10] dguttman_ has joined the channel [02:11] DEVX_ has joined the channel [02:11] luke` has joined the channel [02:12] luke`_ has joined the channel [02:13] lukegalea has joined the channel [02:13] harth has joined the channel [02:16] nwhite has joined the channel [02:19] Emmanuel_ has joined the channel [02:20] softdrink has joined the channel [02:23] papyromancer has joined the channel [02:23] lukegalea has joined the channel [02:24] Croms_ has joined the channel [02:25] Croms_ has joined the channel [02:27] Emmanuel_: I have some side effects using jasmine-node (warning: I'm a beginer) [02:27] Emmanuel_: if I call one function in the context of jasmine-node, it does not work at all (there is a dead-end somewhere, no error, nothing) [02:28] Emmanuel_: if I call the same function outside of jasmine-node (ie : like if I'm using my app) it works perfectly [02:28] Emmanuel_: anything I should know ? [02:30] gerad has joined the channel [02:32] gazumps has joined the channel [02:32] tladuke: how can i send one element of an object as JSON? [02:33] ParadoxQuine: object.elementName? [02:33] tladuke: like {"1":"2","3":"4"} => {"1":"2"} [02:33] ParadoxQuine: object.1 or object["1"] will get that element [02:34] tladuke: yeah, but that's just "2" [02:34] tladuke: i'm assuming there's some idiom [02:34] jgautier has joined the channel [02:35] jgautier: hey how long does it usually take to get a coupon for no.de? [02:37] ParadoxQuine: took me 4 days [02:37] FunkyFortune has joined the channel [02:38] jgautier: :( [02:38] konobi: tladuke: hash slice [02:38] tladuke: i was just looking at splice... [02:40] lukegalea has joined the channel [02:40] Lion2Leo has joined the channel [02:41] wav1 has joined the channel [02:42] doubletap has joined the channel [02:42] konobi: devinus: devinus maximus? [02:42] doubletap has left the channel [02:43] matyr has joined the channel [02:45] SubStack: > var Hash = require('hashish'); Hash.extract({ a : 1, b : 2, c : 3 }, ['a','b']) [02:45] SubStack: { a: 1, b: 2 } [02:46] SubStack: hash slicery! [02:46] tladuke: that's what i need. it's not built in [02:46] tladuke: ? [02:46] SubStack: it's clunkier to do that with builtins [02:47] malkomalko has joined the channel [02:47] SubStack: you can just `npm install hashish` though [02:47] tladuke: just did :) [02:47] SubStack: let's see, it would be... [02:47] malkomalko: hashish! [02:47] malkomalko: stick that in your corn cob pipe and smoke it [02:48] SubStack: indeed [02:48] konobi: "Not only did I inhale, I drank the bong water" [02:48] SubStack: js: var obj = { a : 1, b : 2, c : 3 }; Object.keys(obj).reduce(function (acc, key) { if (key == 'b') acc[key] = obj[key]; return acc }, {}) [02:48] gbot2: SubStack: {b:2} [02:49] tladuke: works good man [02:49] SubStack: or even [02:49] SubStack: js: var obj = { a : 1, b : 2, c : 3 }; ['b'].reduce(function (acc, key) { acc[key] = obj[key]; return acc }, {}) [02:49] gbot2: SubStack: {b:2} [02:51] possibilities has joined the channel [02:51] tladuke: how come [02:51] tladuke: x = "foo"; y = {x:"bar"} [02:51] tladuke: the key ends up being "x" [02:52] SubStack: because x is a bareword key [02:52] SubStack: javascript gets that from perl [02:52] lukegalea has joined the channel [02:52] tladuke: what if i don't want that.... [02:53] SubStack: unfortunately there's no way to inline that to an expression using {} syntax [02:53] konobi: y[x] would be "foo" as the key [02:53] SubStack: you've got to y = {}; y[x] = "bar" [02:53] tladuke: ah, easy enough [02:54] Emmanuel_: OMG i've got a Heisenbug [02:56] hornairs has joined the channel [02:57] doubletap has joined the channel [02:57] doubletap has left the channel [02:59] seanp2k has joined the channel [02:59] seanp2k: OK, I have a kind of crazy idea [02:59] seanp2k: make a web server in node that uses PHP via CGI [03:00] seanp2k: like, node gets request, launches a PHP instance of request with vars [03:02] malkomalko: has anybody seen stream sockets not closing down even when calling end/close? [03:02] seivan has joined the channel [03:08] Lion2Leo: I've seen the opposite... lol [03:08] Draggor: wadey: is there a ToUint64? [03:08] Lion2Leo: Recently my friend was getting random drops with his stream which forced him to represh the browser to reconnect [03:09] doubletap1 has joined the channel [03:09] doubletap1 has left the channel [03:09] doubletap has joined the channel [03:09] micheil has joined the channel [03:09] doubletap has left the channel [03:10] MikhX has joined the channel [03:11] doubletap1 has joined the channel [03:11] trotter has joined the channel [03:11] doubletap1 has left the channel [03:12] doubletap has joined the channel [03:13] doubletap has left the channel [03:14] ParadoxQuine: seanp2k: why? [03:18] possibilities has joined the channel [03:19] redmind has joined the channel [03:19] malkomal_ has joined the channel [03:21] matyr_ has joined the channel [03:22] darshanshankar has joined the channel [03:23] malkomalko has joined the channel [03:23] doubletap has joined the channel [03:24] doubletap has left the channel [03:24] davemo has joined the channel [03:25] admc has left the channel [03:26] eyesUnclouded has joined the channel [03:30] doubletap has joined the channel [03:30] harth has joined the channel [03:30] doubletap has left the channel [03:30] axfraxfr has joined the channel [03:33] zachsmith: so, what cool things are people working on? [03:33] possibilities has joined the channel [03:34] micheil has joined the channel [03:34] breccan has joined the channel [03:37] heavysixer has joined the channel [03:37] jgautier: how do ignore an error with javascript jslint.vim? [03:38] zachsmith: jgautier: do you want to ignore an entire type of error, or one particular one? [03:38] jgautier: just a particular one [03:39] Me1000 has joined the channel [03:40] Spion__ has joined the channel [03:44] brapse has joined the channel [03:45] piscisaureus: v8: var e=" ";var d="----------";var h=" | ";function gg(p){return JSON.stringify(p)||(""+p)}function g(p,m){var l=arguments.length>1?Math.max(7,gg(m).length+2):e.length;return(gg(p)+e).slice(0,l)}var t=[false,null,undefined,'',0,'0'];var b=[e+" "],c=[e+" .-"];var m=[];for(var i=0;i1?Math.max(7,gg(m).length+2):e.length;return(gg(p)+e).slice(0,l)}var t=[false,null,undefined,'',0,'0'];var b=[e+" "],c=[e+" .-"];var m=[];for(var i=0;i [04:07] Emmanuel_: anyone is familiar with jasmine/jasmine-node ? [04:07] Emmanuel_: how can you mock a function that calls a callback ? [04:07] Emmanuel_: (you can mock the return value, but there is no such thing here) [04:07] Yuffster_work has joined the channel [04:08] possibilities has joined the channel [04:08] Emmanuel_: in other word, if I understood, how can you mock asynchronous objects ? [04:08] brianc: Emmanuel_: I manually override methods when I want to "mock" them [04:09] brianc: Emmanuel_: let's say I want to "mock" a file system call in node.js [04:09] jiveB: Emmanuel_: have a look a jasmine spy objects to test callbacks [04:09] Emmanuel_: jiveB: I'm on it, but couldn't find relevant info so far [04:09] Emmanuel_: brianc: this is exactly my case [04:09] Emmanuel_: I want to mock a file read [04:09] Emmanuel_: but the fs.readFile function calls a callback [04:09] exitdescription: i usually mock them by saying look at my EBADF [04:09] jiveB: var callback = Jasmine.createSpy(); [04:09] jiveB: expect(callback).wasCalledWith('foo'); [04:09] jiveB: etc [04:10] yhahn has joined the channel [04:10] Emmanuel_: jiveB: I don't get it [04:11] brianc: Emmanuel_: I can try to gist it for you [04:11] CIA-75: node: 03Ryan Dahl 07v0.4 * r97853e0 10/ src/node.cc : Use default backend for __sun (event ports) - http://bit.ly/hVc21f [04:11] CIA-75: node: 03Ryan Dahl 07v0.4 * r6802c90 10/ deps/v8/src/platform-solaris.cc : [04:11] CIA-75: node: Sample correct registers on Solaris [04:11] CIA-75: node: http://codereview.chromium.org/6676019/ - http://bit.ly/fRM5mt [04:11] CIA-75: node: 03Ryan Dahl 07v0.4 * r12c02b3 10/ deps/v8/src/platform-solaris.cc : Use pthread_kill for V8/Solaris sampling - http://bit.ly/g1kKar [04:11] brianc: Emmanuel_: but it will be bastardized "off the top of my head" code [04:11] jiveB: Emmanuel_: say if your callback was for an xhr request, you create a spy callback in place of the real one [04:12] jiveB: then you call expect(callback).wasCalledWidth({xhrData:"something"}); [04:12] jiveB: *wasCalledWith, does it make a little more sense now? [04:12] Emmanuel_: I put the example code I'm working on here : http://pastebin.com/eJcbi8Qm and the spec here http://pastebin.com/b7AevErp [04:13] doubletap has joined the channel [04:13] doubletap has left the channel [04:14] Emmanuel_: it doesn't work because (I think), jasmine does not wait for the end of the execution of the file reading before concluding [04:14] Emmanuel_: then say it does not work, becaus the callback was not called [04:15] jiveB: Emmanuel_: you can always put your jasmine expect inside a small setTimeout to allow some response time [04:15] Emmanuel_: hm, isn't that a bit dirty ? [04:15] jiveB: sure is [04:15] Emmanuel_: what I don't get from your example, is that how do you name the callback [04:15] jiveB: thats why you should test it with the spy [04:16] jiveB: I'll have a look at the pastebin [04:16] Emmanuel_: in my example, the callback is a anonymous function [04:19] jiveB: Emmanuel_: is there a reason why the code you want to spy on is in a beforeEach block? [04:19] Emmanuel_: not really here [04:20] Evet_ has joined the channel [04:20] Emmanuel_: (I'm working on a much more complicated piece of code, I tried to isolate what could go wrong in this example -- and I kept the beforeEach()) [04:20] eventi has joined the channel [04:21] bentruyman has joined the channel [04:21] Emmanuel_: (and surprisingly, if I remove the beforeEach block, I got a Error: jasmine.Suite() required [04:22] gerad: is there a recommended way to get the full request url from a ServerRequest ? [04:22] gerad: not just the path + query string, but the full on "http://localhost:8000/foo" [04:23] jiveB: Emmanuel_: well if you want to spy on console.log, you have to move it to the "it" block [04:23] firedman has joined the channel [04:23] gerad: so far, the best I can do is something like: (request.socket.encrypted ? 'https" : 'http' ) + '://' + request.headers.host + request.url [04:24] jiveB: and it will work fine, just did sanity check and the expect works as should when placed there [04:24] piscisaureus has joined the channel [04:24] piscisaureus: isaacs: why are promises bad? [04:25] jiveB: Emmanuel_: the before blocks should really only be used for test state prep, thats why the spyOn there has no effect [04:25] isaacs: meh. they're complicated, and highly bikesheddable [04:25] isaacs: you don't need em. [04:25] Emmanuel_: I see [04:25] isaacs: i prefer functional approaches, myself. [04:25] piscisaureus: isaacs: so what would you suggest to use then? [04:26] isaacs: people spend all day debating APIs intead of writing programs. [04:26] isaacs: piscisaureus: callbacks [04:26] isaacs: read throiugh npm's codebase. not a promise in sight :) [04:26] Evet has joined the channel [04:26] isaacs: g'nite, dinner time [04:26] piscisaureus: isaacs: afaict ryan wants them back so you can get a list of stuff that is preventing your node from quitting [04:27] piscisaureus: anyway. 'nite [04:27] Emmanuel_: jiveB: it does not make a difference. I paste the new code : http://pastebin.com/nugn9w8S [04:27] Emmanuel_: result is similar [04:29] jiveB: Emmanuel_: mm strange, i have a working console.log wrapped in a closure that tests fine [04:29] jiveB: I'll look into it [04:29] matyr has joined the channel [04:30] msh_ has joined the channel [04:30] luke`_ has joined the channel [04:30] Emmanuel_: I had a Heisenbug earlier today [04:31] Emmanuel_: using several call to fs.readFile, for debugging [04:31] Emmanuel_: sometime, the function was call, with callback [04:31] Emmanuel_: sometime not [04:31] Emmanuel_: (exact same code, exact same process for running) [04:31] Emmanuel_: which lead me to think that this is some kind of a timing issue [04:31] Emmanuel_: jasmine does not wait for the call to fs.readFile to finish (and it's asychronous) [04:31] Emmanuel_: and therefore never get the call to console.log [04:32] jiveB: possible [04:32] Emmanuel_: but, as you said, if I put a timeout somewhere, it should work [04:32] davemo: i'm trying to access params from a POST request using express, _should_ they be in req.params? [04:32] p0ns has joined the channel [04:32] davemo: I shouldn't have to define the params on my route as well, right? [04:33] bentruyman_ has joined the channel [04:33] jiveB: Emmanuel_: yeah a small 20ms timeout shouldn't be to dirty, you can still get all your tests done sub second [04:33] jiveB: Emmanuel_: try wrapping the expect call in a small timeout and lemme know how goes [04:34] Emmanuel_: will do that [04:34] darshanshankar has joined the channel [04:35] Emmanuel_: but all in all, that might solve that particular problem [04:35] jiveB: ya timing bugs are gross [04:35] Emmanuel_: but it does not solve the issue of mocking a function that should call its callback [04:36] SubStack: davemo: server.use(connect.bodyParser()) to get those params [04:36] davemo: yeah i'm using that [04:36] SubStack: odd then! [04:36] davemo: doesn't seem to show up when i log out the params :| [04:36] jiveB: Emmanuel_: well with jasmine you could try spying on the fs read call, then injecting a spy callback [04:36] SubStack: oh I mean s/connect/express/ too [04:36] davemo: i just used the express binary skeleton app to get started [04:36] davemo: yeah [04:36] jiveB: Emmanuel_: and then do the callback testing I suggested earlier [04:37] jiveB: Emmanuel_: that would get around your callback being an anonymous one if you just replaced it [04:37] airhorns has joined the channel [04:37] Emmanuel_: ok, the timeout thing works [04:39] Emmanuel_: injecting a spy callback (spy on fs) would mean copy/paste the callback from the original function, no ? [04:39] Emmanuel_: because it is not named, I can not refer to it [04:40] jiveB: Emmanuel_: you would want something like this spyOn(x, 'method').andCallFake(function) [04:40] mbrochh has joined the channel [04:40] jiveB: in your fake test function, make the fs call with the spy callback [04:40] timmywil has joined the channel [04:42] davemo: weird, SubStack the params are showing up in req.body [04:42] sub_pop has joined the channel [04:43] _neil has joined the channel [04:43] Emmanuel_: how do I get the spy callback then ? ::) [04:43] Emmanuel_: oh wait [04:43] jiveB: you create one [04:43] Emmanuel_: argsForCall [04:46] soulofpeace_ has joined the channel [04:48] eddanger has joined the channel [04:48] andrewfff has joined the channel [04:48] soulofpeace_ has joined the channel [04:49] eddanger: Hi, I'm trying to figure out the proper use of package.json, npm bundle and what I use for require. [04:49] soulofpeace has joined the channel [04:50] astropirate: eddanger, you want to know how to require a package you installed through npm? [04:51] soulofpeace has joined the channel [04:52] eddanger: astropirate: I just want to know if the dependences I put in my package.json file need to a) be bundled with "npm bundle" and b) if they are bundled, how do I require them in the project. [04:53] astropirate: eddanger, no, i believe npm takes care of dependencies [04:53] astropirate: to require it: [04:54] astropirate: look at the connect package.json for example: https://github.com/senchalabs/connect/blob/master/package.json [04:56] eddanger: Anyway, I just pushed some experimental code of mine: https://github.com/eddanger/Multi-Touch-Multi-User-Canvas (maybe package.json doesn't apply to apps?) [04:57] sivy_ has joined the channel [04:57] Utkarsh has joined the channel [04:58] Me1000 has joined the channel [04:58] Astro has joined the channel [04:58] prettyrobots: What is the prettiest way to print JSON? [04:59] Emmanuel_: prettyrobots: comic sans [04:59] Emmanuel_: (sorry) [05:00] prettyrobots: Looking for something that will print formatted JSON like "sys.inspect". [05:00] matschaffer: Emmanuel_: no apology necessary, that was awesome [05:01] matschaffer: prettyrobots: sys.inspect(JSON.parse()) ? [05:01] zachsmith: sys.inspect wrapped in a pre tag? [05:01] meso_ has joined the channel [05:01] prettyrobots: No. sys.inspect does not emit JSON. [05:01] prettyrobots: At least not in 0.2.x. [05:02] matschaffer: right... [05:02] Aria has joined the channel [05:03] davidascher has joined the channel [05:03] matyr_ has joined the channel [05:03] matschaffer: prettyrobots: possibly JSON.stringify(JSON.parse(buffer), null, 2) based on http://code.activestate.com/recipes/577549-nicerest-pretty-print-json-output/ [05:04] prettyrobots: Guess I was looking for something that did the Node.js style, with the commas alligned to the braces. [05:05] dspree has joined the channel [05:06] prettyrobots: sys.inspect is very clever. [05:07] bentruyman has joined the channel [05:07] dthompson has joined the channel [05:09] eddanger has left the channel [05:10] matyr has joined the channel [05:13] murugaratham has joined the channel [05:13] Adman65 has joined the channel [05:14] luke` has joined the channel [05:14] seivan has joined the channel [05:15] dominic_: prettyrobots: i have a object rendering library that you could use to do that... [05:15] dominic_: (not quite out of the box, but i've already done that hard stuff) [05:15] mlncn has joined the channel [05:16] zentoooo has joined the channel [05:20] prof-freud has joined the channel [05:22] andrewfff has joined the channel [05:23] rfay has joined the channel [05:26] matyr_ has joined the channel [05:27] SamuraiJack has joined the channel [05:29] confoocious has joined the channel [05:29] confoocious has joined the channel [05:29] Vasyuta has left the channel [05:33] prettyrobots: dominic_: Object rendering? [05:34] dominic_: yes. i've just used if for display, but it's easily adaptable. [05:35] dominic_: you just pass a hash of functions which render each part of the object, the key the value, etc. [05:35] dominic_: https://github.com/dominictarr/render [05:37] richcollins has joined the channel [05:37] prettyrobots: dominic_: Thank you. I've bookmarked this. I'll have a look at it. [05:38] dominic_: if you have any questions, just ask. [05:39] harth has joined the channel [05:39] randallagordon has joined the channel [05:40] sleeplessinc has joined the channel [05:40] Utkarsh_ has joined the channel [05:41] matyr has joined the channel [05:42] meso__ has joined the channel [05:46] saikat has joined the channel [05:48] devaholic has joined the channel [05:49] GriffenJBS: Emmanuel_: the fs code with the timing problems, can you paste it somewhere? [05:49] devaholic: nodechat.no.de [05:50] Emmanuel_: sure [05:51] Emmanuel_: the code : http://pastebin.com/eJcbi8Qm [05:51] xer0x has joined the channel [05:51] Emmanuel_: the test : http://pastebin.com/nugn9w8S [05:51] Emmanuel_: (I couldn't figure a clean solution yet) [05:53] Emmanuel_: han, I just did ! [05:53] Emmanuel_: excellent [05:54] Emmanuel_: Yeah \o/ [05:54] GriffenJBS: details, but your not testing your errors, that's never good [05:54] eshira: Hi, I'm fairly new to JS. I'm a bit confused as to how closures close over local variables. I have the code here: https://gist.github.com/865517 At line 4, I set a local variable "msg". I use it in the callback (line 10). But it seems that the callback closure is only created ONCE, right? thus, only the first version of "msg" is ever used. What's the right approach here? I could just make "msg" global.. [05:55] GriffenJBS: I'm glad you got it working, there is a lot in the test that is not defined... :-) saves me from have to look it up [05:55] zentoooo has joined the channel [05:55] Emmanuel_: what do you mean ? [05:55] kiddphunk has joined the channel [05:55] Emmanuel_: (that's an example test, I'm just focusing on that one small bit -- I'm working on a much larger piece of code, I just wanted to isolate everything) [05:55] GriffenJBS: describe, it, spyOn, and expect, where are they defined? [05:56] GriffenJBS: I see, nvm then [05:56] Emmanuel_: oh [05:56] SubStack: eshira: docs.forEach(function (doc) { ... }) will be far less annoying [05:56] Emmanuel_: that's the jasmine-node environment [05:56] GriffenJBS: eshira: you *could* make it global, but that's usually bad, only make the scope as large as needed [05:56] Emmanuel_: (which is required somewhere else) [05:57] liar has joined the channel [05:57] SubStack: eshira: `for` updates `i`, it doesn't create a new `i` for each iteration [05:57] Emmanuel_: the updated, working test : http://pastebin.com/TgF5sqYu (jiveB: thanks, it works) [05:57] ryanfitz has joined the channel [05:58] jiveB: Emmanuel_: glad you got it working :) [05:58] eshira: SubStack: mm thanks. very ruby-like huh. [05:59] eshira: GriffenJBS: yeah, i definitely know there's a better way of doing it. im just getting used to the JS idioms =) [05:59] Emmanuel_: well, I hope that's the proper solution, and that it's not just because I added some code (which delay the final execution) [05:59] soulofpeace has joined the channel [05:59] SubStack: oh and what I said about `i` goes for `msg` too [06:01] mike5w3c has joined the channel [06:02] matyr has joined the channel [06:03] muk_mb has left the channel [06:04] mynyml has joined the channel [06:04] Chunk has joined the channel [06:05] saikat has joined the channel [06:05] GriffenJBS: eshira: line 3, are you sure delete/unused/bad/etc docs will be set to null? typically it's undefined [06:06] matyr has joined the channel [06:06] andrewfff has joined the channel [06:06] eshira: SubStack: So using forEach fixes it. But I'm not sure why... When using for, I print out `msg` (outside the innermost callback) and see it updated at each iteration, but `msg` inside the inner-most callback is not updated. [06:06] eshira: But when using forEach, everythign works. [06:06] eshira: GriffenJBS: no, i'm not. i need to fix that. it's just a hack for now ;) [06:06] GriffenJBS: eshira: k, just as long as your aware of it [06:07] tbranyen: eshira: have a code example? [06:07] SubStack: eshira: for uses the same scope for each iteration so by the time any of the async events get triggered you're using the scope from the last iteration of the for loop [06:08] astoon has joined the channel [06:08] tbranyen: yeah sounded closure related [06:08] SubStack: whereas forEach creates a new scope for each iteration, so `msg` and `i` are local to each iteration [06:08] eshira: tbranyen: old code: https://gist.github.com/865517 new code: https://gist.github.com/865525 [06:08] eshira: SubStack: ahh thank you. that makes sense now. [06:09] eshira: So with forEach, the inner closure is "redefined" and thus uses the latest context [06:09] tbranyen: yea each context is retained [06:10] Aikar: ryah: I've got a good update for net.Socket/Stream FD type detection and child_processes handling of FDs, I just finished and appears to be working great. however need to add some unit test for the update but ima hit the bed so ill add em tomorrow then send you the commits [06:11] Aikar: commit if you wanna just grab it ahead of time: https://github.com/Aikar/node/commit/a482013db35115e390ef52c03bfb6a3eddee3af7 [06:11] richcollins has joined the channel [06:12] AAA_awright has joined the channel [06:13] possibil_ has joined the channel [06:15] samcday: Before I bother wasting time coding up something, can anyone tell me if it's okay to signal another eio_custom from the main thread when I just came back from an EIO thread? [06:16] samcday: Like in the callback that is fired from EIO when you're back in the main V8 thread [06:16] forest has joined the channel [06:17] Draggor: bradleymeck: SubStack: I think I may have completed a set of c++ bindings for libgmp [06:17] Evet has joined the channel [06:19] saikat has joined the channel [06:19] SubStack: Draggor: how much of it? [06:20] Draggor: SubStack: I took everything that was in bigint.cc and just tried moving that over to an addon, so it still uses the .js file you have [06:20] Draggor: except tests aren't passing yet, so I need to look into this [06:20] Draggor: well, some are [06:20] SubStack: oh awesome! [06:20] Draggor: but some are reporting different numbers [06:21] Draggor: this was a fun mini project for the week [06:21] SubStack: I've so far just included stuff in bigint that I've needed for node-keyx [06:21] SubStack: which is itself just a piece of node-ssh-server [06:22] Draggor: SubStack: http://pastebin.com/p5hJKbvB [06:22] Draggor: I just need the basics, add, sub, mul, div, pow, so I can calculate kurtosis on a dataset :3 [06:23] AAA_awright: Draggor: I'm curious what are you working on? [06:23] tbranyen: samcday: you can't just do everything in the eio thread pool the first time? [06:23] jimt_ has joined the channel [06:23] samcday: V8 GC says no [06:24] SubStack: statistical sorcery! [06:24] Draggor: AAA_awright: Just some timing stuff, seeing where our pain points are [06:24] Draggor: and running this against kinda large data sets [06:24] AAA_awright: What about statistical sorcery?!? [06:24] AAA_awright: With Node.js? [06:24] SubStack: kurtosis [06:24] Draggor: Well, at the time I was using node.js to condition the files our app spat out into something usable, but as time went on little features kept getting added in. [06:25] yenz has joined the channel [06:25] Draggor: So finally, knowing that default JS numbers aren't great (and calculating kurtosis turned up NaN), I went for the bigint lib [06:25] Draggor: which worked, except on cygwin [06:26] Draggor: SubStack: I basically just added the node module/v8 syntactic sugar around everything you had to start with. [06:26] SubStack: with a pure-v8 approach you can also hook onto the destructor [06:26] SubStack: somehow [06:26] SubStack: I couldn't get OnCollect to work for that [06:26] Draggor: I'm still veeeeeeeeery green when it comes to v8, and it's been years since touching c++ [06:27] Draggor: until now that is [06:27] DEVX_ has joined the channel [06:28] briznad has joined the channel [06:28] dragunov11 has left the channel [06:29] matyr_ has joined the channel [06:30] dragunov11 has joined the channel [06:31] eshira has joined the channel [06:31] dominic_ has joined the channel [06:33] Draggor: Anywho, sleep time, SubStack can I bug you on this more tomorrow? [06:33] andrewfff has joined the channel [06:33] SubStack: sure [06:34] SubStack: or send a pull request on github once your updates pass all the tests [06:35] SubStack: and/or [06:38] mjr_: I just learned what kurtosis is. [06:38] mjr_: I mean, I TRIED to learn what it is from wikipedia, and I partially succeeded. [06:38] jesusabdullah: What's that? [06:38] mjr_: peaks! [06:39] jesusabdullah: Interesting. [06:39] jesusabdullah: What are you going to do with it? [06:40] possibilities has joined the channel [06:42] mjr_: I was just reading scrollback, and people were talking about it. [06:43] jesusabdullah: Hmm [06:43] forest has joined the channel [06:44] dnolen has joined the channel [06:44] fangel has joined the channel [06:45] astoon has joined the channel [06:47] andrewfff has joined the channel [06:48] matjas has joined the channel [06:51] makuchaku has joined the channel [06:51] abraham has joined the channel [06:56] FireFly has joined the channel [07:00] wadey has joined the channel [07:03] TomY has joined the channel [07:03] kriszyp has joined the channel [07:03] TomY_ has joined the channel [07:06] alek_br has joined the channel [07:06] asabil has joined the channel [07:08] devaholic: any better way to do this if (client.request === null || client.request === undefined) [07:08] pcardune has joined the channel [07:09] jesusabdullah: Is if !client.request good enough? [07:11] matyr has joined the channel [07:12] notostraca has joined the channel [07:13] EyePulp has joined the channel [07:13] memy has joined the channel [07:14] andrewfff has joined the channel [07:14] bergie has joined the channel [07:19] memy: hi @ all [07:20] yozgrahame has joined the channel [07:21] matyr_ has joined the channel [07:24] Utkarsh_ has joined the channel [07:26] bergie has joined the channel [07:28] muhqu has joined the channel [07:29] aabt has joined the channel [07:30] ngs has joined the channel [07:31] devaholic: hi memy [07:32] devaholic: jesusabdullah: i am checking if a message is null input [07:33] devaholic: i have like chat.message.text [07:33] jesusabdullah: ah [07:33] devaholic: do i have to check if chat is null and then check if chat.message is null ?? [07:33] harth has joined the channel [07:33] devaholic: text() [07:33] devaholic: * [07:34] ph^ has joined the channel [07:35] jesusabdullah: Is the problem that checking for chat.message would break if chat were undefined? [07:35] memy has joined the channel [07:35] devaholic: yes [07:35] SubStack: chat && chat.message && chat.message.text [07:35] devaholic: and crashes node [07:36] __tosh has joined the channel [07:36] jesusabdullah: Yeah, what SubStack said, I'd think [07:37] groom has joined the channel [07:37] tommoor has joined the channel [07:37] larsemil has joined the channel [07:39] qFox has joined the channel [07:39] tommoor: Hi all, quick issue im hoping i can get some help with, I have node running no problem and am setting up the connect middleware, I have cloned the latest code from github and followed an example however node cannot find the module 'mime' ? seems like this should be built in? [07:41] tommoor: any pointers appreciated [07:41] matyr has joined the channel [07:41] devaholic: sounds like you have to fine yourself a mime [07:43] Bonuspunkt: npm install mime [07:44] SubStack: mimesweeper [07:44] tommoor: hmm, cheers, i assumed something was wrong as no dependencies are mentioned anywhere [07:46] softdrink: 8.9 earthquake in japan just now [07:47] softdrink: live coverage: http://english.aljazeera.net/watch_now/ [07:48] dguttman has joined the channel [07:48] RusAlex has joined the channel [07:48] dominic_ has joined the channel [07:48] razvandimescu has joined the channel [07:49] mjr_: There is an actual tsunami heading to where I live. [07:49] SubStack: better head for the hills! [07:49] SubStack: unless you are already in the hills [07:49] softdrink: mjr_: where? [07:49] SubStack: that is, when the waves finally hit in 6+ hours [07:49] mjr_: I'm actually in Oakland at the moment, but my wife and kids are in Hawaii, on a hill, thankfully. [07:50] SubStack: hills++ [07:50] v8bot: SubStack has given a beer to hills. hills now has 1 beers. [07:50] Emmanuel_: mjr_: my brother is in NZ [07:50] Emmanuel_: it's night already there, right ? [07:50] softdrink: oh man… footage of that wave [07:50] devaholic: on a hill, thankfully. -< lol'd [07:50] mjr_: earlier there than Pacific time [07:50] Emmanuel_: (and my parents are flying right above the tsunami, to meet me in Hong Kong) [07:50] dominic_: yeah, it's 8:48 here in NZ [07:50] shiawuentan has joined the channel [07:51] Emmanuel_: well, I assume everybody will be warned in NZ [07:51] Emmanuel_: (my brother is probably close to the beach, he's travelling in a van) [07:51] devaholic: wow thats a large earthquake, yeah? [07:51] softdrink: yeah [07:52] tc77 has joined the channel [07:52] emattias has joined the channel [07:52] devaholic: anybody else watching al jazeera? [07:52] Emmanuel_: me [07:52] softdrink: i am [07:52] Emmanuel_: what is that thing leaking and burning, oil ? [07:53] devaholic: what the hell is this on the screen...... [07:53] stagas has joined the channel [07:53] Emmanuel_: mud ? [07:53] devaholic: HOUSES? [07:53] yenz: i'm watching AJE too [07:53] yenz: this shit is crazy [07:53] mjr_: I know. It's nuts [07:53] softdrink: just tearing through the landscape [07:53] mjr_: are those cars then? [07:53] mjr_: Or like, debris? [07:53] softdrink: debris [07:53] softdrink: looks like 2 cars at top [07:53] softdrink: just went out of frame [07:54] mjr_: oh right [07:54] softdrink: they're looping it [07:54] Utkarsh__ has joined the channel [07:54] mjr_: That boat is going to end up in farmland [07:54] shiawuentan: :S scary [07:54] yenz: already is, by the looks of it [07:55] dominic_ has joined the channel [07:55] devaholic: why are they not talking about if there are people in that house thats being engulfed [07:55] softdrink: big reddit thread: http://www.reddit.com/r/worldnews/comments/g1qpy/massive_79_earthquake_in_northeastern_japan/ [07:56] dominic_ has joined the channel [07:56] tommoor: seems like a lot of the documentation assumes you are using npm - from a newcomer perspective [07:57] yenz: tommoor: npm works pretty well, so there's not much reason not to use it... [07:57] mytrile has joined the channel [07:57] mjr_: Yeah, npm is what you use. [07:58] jesusabdullah: I met a guy that didn't use npm once [07:58] jesusabdullah: I still don't really understand why [07:58] ttpva has joined the channel [07:58] yenz: YC thread here: http://news.ycombinator.com/item?id=2312474 [07:58] ajnasz has joined the channel [07:59] tommoor: heh, well its all gone down well using npm now [07:59] kal-EL_ has joined the channel [08:01] tommoor: Second question... im looking at this example of using socket.io to create 'rooms' (http://stackoverflow.com/questions/4445883) the code is obvious enough, but im not sure on where the best practice place to put this would be? [08:01] tommoor: Just slapped in the main js file node doesnt know of the existance of 'Client' [08:02] fangel has joined the channel [08:04] aways|bnc: ACTION Bonjour [08:05] devaholic: are you requiring socket-io? [08:08] andrewfff has joined the channel [08:12] tommoor: devaholic: yep [08:12] Druid_ has joined the channel [08:12] ttpva has joined the channel [08:12] tommoor: i have standard broadcast messages working np [08:13] herbySk has joined the channel [08:14] Emmanuel has joined the channel [08:14] floby has joined the channel [08:14] mAritz has joined the channel [08:14] fayce_ has joined the channel [08:16] __tosh has joined the channel [08:17] emattias has joined the channel [08:18] yenz: http://wcatwc.arh.noaa.gov/2011/03/11/lhvpd9/01/webetalhvpd9-01.txt [08:19] softdrink: yenz: good link, thanks [08:19] yenz: np! [08:20] fayce_: can somebody explain me why when (using mongoose) I insert data into "Address" I can only read it from "addresses" ... is that a mongodb stuff or I'm doing something wrong ? [08:21] astropirate has joined the channel [08:21] fly-away has joined the channel [08:23] richcollins has joined the channel [08:23] matyr_ has joined the channel [08:23] torg_ has joined the channel [08:23] devaholic: tommoor: have your code up somewhere? [08:24] vilhonen_: fayce_: it's a feature [08:24] vilhonen_: if you use mongoose models you don't even have to know what's underlying collection's name [08:24] Emmanuel: rrah [08:24] Emmanuel: no more HK -> US internet [08:25] fayce_: can I link my mongoose model to an existing mongo collection ? [08:25] softdrink: eek [08:25] devaholic: vilhonen_: isnt the name of the model the same as the collection name? [08:25] matyr__ has joined the channel [08:26] mjr_: Emmanuel: tsunami took out your internet? [08:26] vilhonen_: in my experience mongoose makes just the kind of modifications to the name as fayce described [08:26] devaholic: vilhonen_: are you saying that mongoose ORM automatically removes capitalization and adds plurality to variables? [08:26] vilhonen_: devaholic: yes [08:26] fayce_: devaholic, yes ! :S [08:27] devaholic: thats a bit weird [08:27] troessner has joined the channel [08:27] Emmanuel: mjr_: I'm gonna kill it [08:27] Emmanuel: but that's not unlikely [08:27] vilhonen_: devaholic: many of the ORM frameworks on different languages do it [08:27] Emmanuel: most of the connection from HK goes through US West coast [08:27] devaholic: i have used mongoose twice. i dont remember that but i might have already had my variables in that format [08:27] Emmanuel: (even to reach Singapour apparently...) [08:28] astoon has joined the channel [08:28] devaholic: interesting, maybe my newbness coming through then, but i havent seen it (or at least been aware of it_ [08:28] devaholic: ) [08:28] mape: promises are back? [08:28] devaholic: vilhonen_ the name of the model IS the collection name by default though [08:29] fayce_: Emmanuel, shit I'm in Taiwan :/ [08:29] fayce_: ...I would have then used mongoose only once in my life :) [08:29] devaholic: fayce_: what if you just change your variable to addresses [08:29] Emmanuel: maybe you have a better connection [08:29] Emmanuel: well [08:29] vilhonen_: devaholic: for me it has generated plural names and I haven't configured anything related to that [08:29] Emmanuel: though, if something broke between Asia/US, you're fucked too [08:30] fayce_: Emmanuel, the problems are in the East.. [08:30] devaholic: the names are generated by the model name though, i'm sure of it [08:30] aabt has joined the channel [08:30] devaholic: i guess i just didnt realize it was making them plural [08:31] softdrink: http://www.boingboing.net/2011/03/11/japan-sendai-quake-a.html [08:31] devaholic: its already on wikipedia [08:31] Emmanuel: fayce_: ? [08:32] devaholic: softdrink: somehow i get the feeling that building isnt going to spontaneously collapse a la 9-11 [08:32] Utkarsh_ has joined the channel [08:33] [AD]Turbo has joined the channel [08:34] fayce_: devaholic, actually my model is tied to "Address" , I've only implemented the read on that resource, so I do the writes directly from the mongo shell, into "Address"... after having spent an hour trying to understand why my node app could not read the "Address" collection, I figured out that there was an empty "addresses" collection in my db, when I filled it, my node app started to display those data [08:34] [AD]Turbo: hi there [08:35] fayce_: Emmanuel, Japan and East of Taiwan... I'm in the center of TW [08:35] devaholic: fayce_: lol >.> i thought the problem wasnt just with collections, but mere variables in the model in node, my bad [08:37] arclite has joined the channel [08:43] andrewfff has joined the channel [08:47] felixge has joined the channel [08:47] felixge has joined the channel [08:47] JimBastard has joined the channel [08:48] msucan has joined the channel [08:49] terite has joined the channel [08:52] matyr has joined the channel [08:53] stagas has joined the channel [08:54] FireFly|n900 has joined the channel [08:59] tbassetto has joined the channel [08:59] adambeynon has joined the channel [09:00] eschnou has joined the channel [09:03] gredman has joined the channel [09:03] eevin has joined the channel [09:05] ntelford has joined the channel [09:06] void_ has joined the channel [09:07] pyrotechnick has joined the channel [09:08] pyrotechnick: question: is there any library which syncs a js object to redis or the disk? [09:08] SubStack: permafrost! [09:08] yozgrahame has joined the channel [09:08] seivan has joined the channel [09:09] pyrotechnick: sweet [09:09] pyrotechnick: this all in working order substack? [09:09] JimBastard: SubStack: uhh wtf [09:09] JimBastard: tsunami coming? [09:09] JimBastard: i knew i shouldnt have left ny [09:10] mraleph has joined the channel [09:10] matyr_ has joined the channel [09:10] pyrotechnick: where are you? [09:10] pyrotechnick: SubStack: this is why i think you're a good person [09:10] pyrotechnick: because you've implemented what i've been looking for slash trying to hack up for the last few weeks [09:11] pyrotechnick: SubStack: i think there needs to be a way to graphically browse node modules [09:11] pyrotechnick: the wiki and npm aren't bad [09:11] pyrotechnick: but i think there needs to be a more subjective listing [09:11] andrewfff has joined the channel [09:11] pyrotechnick: so that i can find the heading: "object persistance" and see 4 or 5 modules under it [09:11] pyrotechnick: or something like that you know [09:12] felixge has joined the channel [09:12] tommoor has joined the channel [09:12] __tosh has joined the channel [09:12] devaholic: lol [09:13] SubStack: pyrotechnick: there is that one site... [09:13] chapel: http://search.npmjs.org/ [09:13] SubStack: the other one [09:13] pyrotechnick: its ok [09:13] SubStack: pyrotechnick: the supermarket adapter works pretty well [09:13] SubStack: the other ones not so much [09:13] pyrotechnick: ok [09:13] SubStack: you can hack me up a redis one! [09:14] unomi has joined the channel [09:14] chapel: pyrotechnick: you doing toe stuff atm or work stuff? [09:14] floby: http://npm.mape.me/ [09:15] pyrotechnick: chapel: toe [09:15] chapel: cool [09:15] disq has joined the channel [09:15] disq has joined the channel [09:16] SubStack: pyrotechnick: redis would make a pretty good fit for permafrost I think since it's just a lot of key set()s [09:16] SubStack: and then it reads in all the data when it fires up [09:16] pyrotechnick: yeah [09:16] pyrotechnick: i wanna try use redis [09:16] pyrotechnick: what i really needed was the harmony proxies [09:16] aklt has joined the channel [09:17] SubStack: later I'll make permafrost have the ability to mount at a certain path from the root on initialization [09:17] SubStack: and perhaps have a nice api for mounting subtrees so you don't need to load the whole db into memory [09:17] JojoBoss has joined the channel [09:17] davidc__ has joined the channel [09:18] SubStack: and once I hack in recursive links I'll have a pretty sweet graph db [09:18] david_ has joined the channel [09:18] SubStack: a couch adapter would be nifty too [09:19] chapel: hey SubStack [09:19] SubStack: I pretty much want a database that I don't need to think about very much [09:19] SubStack: ahoy [09:19] pyrotechnick: yeah [09:19] chapel: did you get dnode/browserify working together? [09:19] SubStack: where it's really amazingly trivial to just get some basic in-memory persistence going [09:19] mike5w3c has joined the channel [09:19] pyrotechnick: i want like node-dirty with proxy harmonies [09:19] pyrotechnick: thats about it [09:20] pyrotechnick: if i had that with some kind of map-reduce i'd be stoked [09:20] SubStack: chapel: yep they work together great in the v0.6 branch but I'm still waiting on guillermo to push out a socket.io-node with the updated socket.io code that has my var io = this.io = ... patch in it [09:20] chapel: ah [09:20] SubStack: and once that happens I'll publish dnode v0.6 [09:21] redmind: pyrotechnick: that could be hacked up in less than an hour, if you are just writing json to a stream from proxies [09:21] redmind: *file stream [09:21] pyrotechnick: you think so? [09:21] SubStack: redmind: if only harmony proxies were so easy [09:21] pyrotechnick: other day for the brisbane js group i hacked up a game substack [09:21] pyrotechnick: like you said you were doing / did [09:21] SubStack: a game! [09:21] redmind: recursion in harmony proxies can be... annoying though [09:22] SubStack: yeah permafrost has the recursion part figured out well enough it seems [09:22] pyrotechnick: http://www.meetup.com/BrisJS/ [09:22] pyrotechnick: they seemed to like it [09:22] pyrotechnick: what i had is a game you could play [09:22] redmind: <- is in bris [09:22] pyrotechnick: for real? [09:22] SubStack: http://blago.dachev.com/modules # another pretty npm viewer thing [09:22] pyrotechnick: you ever been to the js meetu[s [09:22] SubStack: what I meant to paste earlier [09:22] pyrotechnick: brisbane australia? [09:22] redmind: yeah, and nope [09:22] pyrotechnick: lol ok [09:23] pyrotechnick: this site [09:23] pyrotechnick: is nice SubStack [09:23] redmind: thought about it but too busy atm unforunately [09:23] pyrotechnick: yeah [09:23] seivan has joined the channel [09:23] pyrotechnick: anyway substack it was sick [09:23] pyrotechnick: im doing some backbone over dnode [09:24] SubStack: rock [09:24] matyr has joined the channel [09:25] pyrotechnick: https://gist.github.com/865667 [09:26] SubStack: then I was also thinking a replication system over dnode could tie into permafrost too [09:27] SubStack: would be pretty wicked sweet since you could then just mount the user modifiable data and update it directly [09:27] pyrotechnick: just updated it [09:27] pyrotechnick: https://gist.github.com/865667 [09:27] gozala has joined the channel [09:27] insin has joined the channel [09:35] Astro has joined the channel [09:35] jelveh has joined the channel [09:36] pastak has joined the channel [09:40] katspaugh has joined the channel [09:41] luke` has joined the channel [09:43] luke` has joined the channel [09:43] hoodoos: hey guys, what is http.Agent abstraction? does it have to do anything with user-agent? [09:43] hoodoos: :) [09:44] hoodoos: I just wander what is the number 5 of max concurrent reqeusts. Why 5? [09:46] eventi has joined the channel [09:46] incon_ has joined the channel [09:47] chapel: nothing to do with user-agent [09:47] hoodoos: i'm almost broke my head now, why my code wasn't working with 5 concurrent requests and worked perfectly fine with 4 :) [09:48] swistak has joined the channel [09:48] hoodoos: those 5 was recursivly calling same http client and there it got stuck :) [09:48] dominic_: yeah, it's 8:48 here in NZ [09:49] Augi has joined the channel [09:49] Augi: hi all [09:50] astropirate: Greetings [09:52] nwhite has joined the channel [09:56] romainhuet has joined the channel [09:57] saschagehlich has joined the channel [09:58] erikcorry has joined the channel [09:58] devaholic: dominic_: when is the tsunami? [10:00] matyr_ has joined the channel [10:00] dominic_: devaholic:...arriving in NZ? apparently at north cape at 6 am. [10:01] dominic_: though apart from creating some strong currents it's not going to be dangerous. [10:01] astropirate: what time is it now? [10:01] dominic_: 22:59 [10:01] pyrotechnick: 7 hours [10:03] dominic_: last time there was a tsunami (quake in tonga) there was like nothing. the tsunami wave was smaller than the normal waves. [10:03] redmind has left the channel [10:04] TomY has joined the channel [10:04] yenz: was the tonga quake 8.9 tho? :\ [10:04] redmind has joined the channel [10:05] dominic_: no, but it was also way closer. the natural hazards people always over estimate this stuff too. [10:05] devaholic: smaller than the other waves, lulz [10:05] yenz: heh [10:06] yenz: http://27.media.tumblr.com/tumblr_lhvyntKSqL1qawjc8o1_500.png [10:06] yenz: hopefully that's not true! :\ [10:07] devaholic: sand bars? [10:07] tc77 has joined the channel [10:07] dominic_: japan for 10 metre waves, from an earth quake 360 km away. [10:07] bzinger has joined the channel [10:07] devaholic: NZ is a pretty long ways away i guess [10:08] tc77 has left the channel [10:08] yenz: <3 hipsterhacker: http://twitter.com/hipsterhacker/status/45686716668968960 [10:08] devaholic: cant forget those tsunamis from a few years ago though [10:08] devaholic: in indonesia or wherever that was [10:09] astropirate: i thought you said you couln't foget it :S [10:09] astropirate: jk [10:09] devaholic: (as i forget the details of that very thing) [10:09] devaholic: lol [10:09] redmind: yenz: hey i have this great idea... its like facebook and ebay and goodle... COMBINED! i cant pay you right now but you can put your name in the footer :P [10:09] disq has joined the channel [10:10] disq has joined the channel [10:10] redmind: *google [10:10] case__ has joined the channel [10:11] case__: hi guys, what is the recommended module for xml parsing ? [10:11] devaholic: hispter hacker has a point maybe but he also sounds lame [10:11] yenz: heheh [10:11] dominic_: now if your a hacker and an ideas guy... that is what they call, uh, synergy? [10:12] redmind: isnt being a hipster pretty anti-hacker, i mean... social movement and all... [10:13] yenz: i think that's the joke ;) [10:13] soulofpeace has joined the channel [10:13] devaholic: "spraying us with dumb" [10:13] devaholic: g.t.f.o. [10:14] devaholic: my 14 y/o sister talks like that [10:15] yenz: standard internet idiom [10:16] devaholic: really? google finds 4 results [10:16] devaholic: though... maybe thats where she gets it from [10:16] aho has joined the channel [10:17] dream has joined the channel [10:17] devaholic: oh, they are all that same post too [10:20] dream: i still faced the err#2 problem even after i follow the instruction can anyone help me with it [10:21] fayce_: hey guys, I'm new to javascript, and I have a little question, to POST and process ONE JSON object (for instance {"user": "fayce"}) - I simply do a "var user = new User(req.body);" then I save it.... how would I do if I want to Batch process/save a JSON with multiple objects ( [{"user":"fayce"},{"user":"joe"},{"user":"vicky"}]) ? [10:22] fayce_: should I manually loop on the array or there is a little shortcut for that ? [10:26] charlenopires has joined the channel [10:26] matyr has joined the channel [10:26] gozala has joined the channel [10:28] charlenopires has joined the channel [10:29] mraleph has joined the channel [10:29] saschagehlich_ has joined the channel [10:29] McMAGIC-- has joined the channel [10:30] Emmanuel__ has joined the channel [10:31] Ori_P has joined the channel [10:31] Nietecht has joined the channel [10:32] xla has joined the channel [10:34] daglees has joined the channel [10:35] dominic_: fayce_: list.map(JSON.stringify) [10:35] fayce_: anyway, I did it this way http://pastebin.com/eua8zn2q and it works can anybody tell me if there is any better way to do it ? [10:36] fayce_: dominic_, thanks, I'll try that [10:36] V1 has joined the channel [10:40] matyr_ has joined the channel [10:51] suckerpunch has joined the channel [10:54] Jonasbn_ has joined the channel [10:54] katspaugh has left the channel [11:02] squeeks_ has joined the channel [11:03] hellp has joined the channel [11:07] Utkarsh__ has joined the channel [11:11] d0k has joined the channel [11:13] eventi has joined the channel [11:13] SamuraiJack_ has joined the channel [11:14] Spion has joined the channel [11:16] mekazu has joined the channel [11:19] davidcoallier has joined the channel [11:20] Sorella has joined the channel [11:21] redmind has joined the channel [11:21] skm has joined the channel [11:21] disq has joined the channel [11:21] disq has joined the channel [11:24] skm has joined the channel [11:24] breccan has joined the channel [11:29] disq has joined the channel [11:29] disq has joined the channel [11:31] f1lt3r_ has joined the channel [11:31] _npm_ has joined the channel [11:38] Utkarsh has joined the channel [11:40] felixge has joined the channel [11:40] felixge has joined the channel [11:42] hoodoos: guys, does https has it's separate agents from http? [11:46] lukus has joined the channel [11:48] fusspawn: cygwins font mad me giggle when compiling node one of the args was -DEV-FORK-ENABLE it took me forever to notice that it wasnt saying dev pork.. I was wondering why there was an option to enable the devs to have pork O.o [11:50] samcday: lmao [11:50] squeeks_: That depends, are they observant or do they seek enjoyment from epic meal time? [11:51] walfisch has joined the channel [11:52] walfisch: Hi [11:52] echosystm has joined the channel [11:52] insin: git pull pork [11:52] astoon has joined the channel [11:53] walfisch: How do I determine in the code if I am server side or in a browser? [11:53] tommoor: walfisch: have a look at this [11:53] tommoor: http://caolanmcmahon.com/posts/writing_for_node_and_the_browser [11:55] walfisch: thanks [11:56] V1: All i got to say to that ^ is leave your cross browser patches out of the code you use on the server side. [11:56] echosystm: anyone understand how the event loop in node.js works? [11:57] V1: echosystm: http://blog.mixu.net/2011/02/01/understanding-the-node-js-event-loop/ [11:58] insin: ACTION just whacked a module.exports = blah into his existing browser-based code :) [11:58] lukegalea has joined the channel [11:59] echosystm: i'd specifically like to know how events are multiplexed between select/epoll/etc and timers or general thread pool jobs [12:00] echosystm: i mean, you have three kinds of events - real asynchronous IO (select etc.), timers and arbitrary code run in thread pools (eio_custom) [12:00] echosystm: how does "the event loop" multiplex between these three without starvation? [12:01] erikcorry: echosystm: Are you sure it does? [12:01] echosystm: ? [12:01] erikcorry: Perhaps there is a risk of starvation? [12:01] echosystm: well there is always going to be starvation [12:02] echosystm: eg. timers in node.js can never be perfect [12:02] echosystm: but how is it minimised? [12:02] echosystm: ie. how is it guaranteed that one event source isnt prioritised over another? is there a queue? [12:02] erikcorry: Don't know. [12:04] felixge_ has joined the channel [12:04] felixge_ has joined the channel [12:05] V1: Doesn't libev take care of the most of that? [12:05] echosystm: no [12:05] larsemil has left the channel [12:05] stylus has joined the channel [12:05] echosystm: it needs libeio as well [12:05] echosystm: for the things that cant be handled by select etc. [12:05] ph^ has joined the channel [12:05] V1: Yeah your right [12:06] Croms has joined the channel [12:06] daglees has joined the channel [12:09] shaunau has joined the channel [12:09] c4milo has joined the channel [12:09] wav1 has joined the channel [12:10] shaunau: hi [12:10] shaunau: can anyone tell me what the correct way to test filesystem for write? [12:11] shaunau: i'm going to write a nodejs command line app.. [12:11] Utkarsh_ has joined the channel [12:12] shaunau: user will be able to enter a dir path and i want to check if it's writable [12:12] eventi has joined the channel [12:14] saschagehlich has joined the channel [12:17] saschagehlich_ has joined the channel [12:18] shaunau: i guess i just have to do fs open and check for an error. [12:18] hoodoos: guys, I have a question about agent in https.. Is it correct that it always says port 80 when I supply it random other ports? [12:18] hoodoos: https://gist.github.com/865818 [12:19] disq has joined the channel [12:19] disq has joined the channel [12:21] hoodoos: and later in when I do https.request it returns request with wrong agent, which has only 5 maxsockets [12:22] weepy has left the channel [12:25] broofa has joined the channel [12:25] Utkarsh has joined the channel [12:25] FireyFly has joined the channel [12:26] muhqu_ has joined the channel [12:27] hoodoos: damn, this agent thing is somewhat buggy, or I just can't figure out how it should work.. I can't get request to have a proper agent with normal maxSockets value :( [12:27] hij1nx has joined the channel [12:27] shaunau: hoodoos maybe ask on the mail list... with version numbers etc. [12:27] hoodoos: maybe.. [12:27] hoodoos: 0.4.2 I have here.. [12:28] shaunau: hoodoos i dont know about it, no help. [12:28] hoodoos: shame on you.. [12:28] shaunau: :) [12:28] hoodoos: j/j :) [12:29] shaunau: i was looking for a nice filesystem api - dont know of one do you? [12:29] hoodoos: i'm using raw fs [12:29] shaunau: something like isWriteable(path) or whatever.. [12:30] hoodoos: nope, i'm not that much about files using, most of time i just to readFileSync to read config :) [12:30] shaunau: yeah i might write something to make it more paletteable [12:30] shaunau: i guess it's not really node's forte is it.. [12:31] shaunau: ok, well - good luck with your https prob :) ciao \0 [12:31] hoodoos: thanks, good luck with writable paths.. [12:31] shaunau: cheers [12:31] hoodoos: let all paths be writable for you [12:31] hoodoos: sounds better [12:32] dubbe has joined the channel [12:33] eee_c has joined the channel [12:34] fairwinds has joined the channel [12:34] FireFly|n900 has joined the channel [12:34] mytrile has joined the channel [12:35] hoodoos: NO WAY! it was an outdated API docs.. [12:36] hoodoos: you should do getAgent({host: host, port: port}) instead of getAgent(host, port).. [12:38] secoif has joined the channel [12:38] fernandezpablo85 has joined the channel [12:40] secoif: Mongoose question: if I want to define a schema for a field like 'gender', where the value can be 'Male', 'Female', how woudl I do this [12:40] secoif: mongoose/mongodb noob here [12:40] secoif: ie, I want something like an enum [12:41] secoif: or an array of possible values [12:41] secoif: or something [12:41] hoodoos: and btw, it's getAgent(host, port) in 0.5.0-pre. holy sun of a fish [12:43] saschagehlich_: secoif: just use a string. I don't think there is enum support in mongo [12:44] liar has joined the channel [12:45] jmar777 has joined the channel [12:46] framlin: what module should I take, if I want build a "reverse proxy" with node, that dispatches to diffrent servers/ports concernig the URL that is passed? [12:48] adamt has joined the channel [12:49] adamt: hello [12:49] adamt: Would this be an appropriate place to ask a question regarding jade? [12:49] squeeks_: framlin: you know, varnish is probably a better choice for that sort of thing [12:50] __tosh has joined the channel [12:52] notostraca: adamt, what jade are you referring to? [12:53] notostraca: if it's in the npm registry, I'm sure it wouldn't hurt to ask :-) [12:53] secoif: framlin: varnish is the perfect tool for what you're asking, it's designed to do exactly that [12:53] Utkarsh_ has joined the channel [12:54] tiemonster has joined the channel [12:55] devrim has joined the channel [12:57] jashkenas has joined the channel [12:57] framlin: ok, thanx a lot, I will have a look at varnish [12:58] Ori_P has joined the channel [12:58] tktiddle has joined the channel [12:58] disq has joined the channel [12:58] disq has joined the channel [12:59] MrTopf has joined the channel [12:59] eee_c has joined the channel [13:00] themcgruff has joined the channel [13:02] tmm1 has joined the channel [13:02] fernandezpablo85: hey guys [13:02] fernandezpablo85: while trying to follow the example on: [13:03] fernandezpablo85: http://nodejs.org/docs/v0.4.2/api/http.html [13:03] jetheredge has joined the channel [13:03] fernandezpablo85: (the one that requests data to google) [13:03] fernandezpablo85: I'm getting [13:03] fernandezpablo85: ReferenceError: http is not defined [13:03] fernandezpablo85: note that I've added require('http') in the file [13:03] fernandezpablo85: what am I missing? [13:05] fernandezpablo85: nevermind I'm an idiot [13:05] reznor has joined the channel [13:06] eventi has joined the channel [13:06] tiemonster: lol [13:07] eventi has joined the channel [13:08] squeeks_: framlin: May I suggest you investigate Rubber Duck programming as a future methodology? [13:09] floby has joined the channel [13:09] squeeks_: http://en.wikipedia.org/wiki/Rubber_duck_debugging [13:09] framlin: squeeks_: ??? [13:10] jelveh has joined the channel [13:14] btipling has joined the channel [13:14] piscisaureus has joined the channel [13:14] iFire` has joined the channel [13:14] framlin: ahh, no, I have one server-hardware running many software-server, that should be called via http://bla:80 [13:14] reznor has left the channel [13:14] floby: squeeks_: haha [13:14] matschaffer has joined the channel [13:14] framlin: the server ar diffrent pieces of software e.g one node-instance, one couchdb-instance and one apache [13:14] liquidproof has joined the channel [13:14] masahiroh has joined the channel [13:14] eevin has joined the channel [13:16] V1: and they alll need to listen to the same port? [13:16] V1: how efficient ;) [13:17] btipling_ has joined the channel [13:17] xla_ has joined the channel [13:17] luke_ has joined the channel [13:17] ericemm has joined the channel [13:18] ericemm: I'm trying to make a fairly simple modification to the node-chat application on ry's github [13:18] ericemm: but it seems that no matter what i do [13:18] ericemm: it breaks it [13:18] lukus has joined the channel [13:18] V1: than don't do what you where doing [13:19] ericemm: what I'd like to do is have it so that it doesn't announce Users, and also doesn't show who is saying what [13:19] ericemm: but for example if I comment out the function that announces users, the server cant even start [13:19] fernandezpablo85: hey guys quick question [13:19] fernandezpablo85: is there a way in node to lauch simultaneous http requests? [13:19] ericemm: or if i instead comment out the line that updates the link that announces users, the server runs but you cant talk [13:19] boaz has joined the channel [13:19] mscdex: awsum, opera 11 supports websockets -- but it's disabled by default [13:20] ericemm: yeah, i just feel like every single time i poke it, i get bitten lol [13:20] ericemm: tried maybe 15 things and none of them have worked at all [13:20] ericemm: is there a simpler chat app that i could fool around with instead? [13:20] ericemm: or is that about is simple as you can make it [13:20] hobs: there are a bunch [13:20] hobs: for node [13:20] Ori_P has joined the channel [13:21] fernandezpablo85: like for example [13:21] fernandezpablo85: check this out: [13:21] hobs: http://nodetuts.com/tutorials/6-simple-chat-with-nodejs-and-websockets.html#video [13:21] eee_c1 has joined the channel [13:21] fernandezpablo85: https://gist.github.com/865873 [13:21] ericemm: hobs: thanks :) [13:22] hobs: no problem, there are a bunch more, it looks like a lot of people use the chat server as their first noding [13:22] fernandezpablo85: if you run that, the requests seem to be sent one by one [13:23] V1: mscdex: Same counts for FF4 [13:23] fernandezpablo85: I'd like to run them in pararllel [13:23] fernandezpablo85: if possible [13:23] fernandezpablo85: :) [13:23] prof-fre_ has joined the channel [13:23] Sembiance: massive 8.9 earthquake hits near japan causing big tsunami. Just in case you just woke up and haven't heard yet [13:23] boaz has joined the channel [13:23] hobs: hey fernandezpablo85 [13:23] hobs: I am not a node master, but I have heard of the Do library which might help you [13:23] hobs: Do.parallel(actions) {...} [13:23] hobs: Takes an array of actions and runs them all in parallel. You can either pass in an array of actions, or several actions as function arguments. [13:24] hobs: http://howtonode.org/do-it-fast [13:24] framlin: V1 no, the servers listen on diffrent ports, so I thought about a reverse proxy in front of them ... [13:24] fernandezpablo85: hobs: will check that out [13:24] fernandezpablo85: thanks [13:24] hobs: no problem [13:24] aabt has joined the channel [13:24] mscdex: V1: yeah, i just didn't think opera would ever implement websockets [13:25] fernandezpablo85: I'm new to node, I though those would run in parallel [13:25] mscdex: it's about time :) [13:25] V1: Yeh, but it's gonna take while before they enable it.. We gotta wait before the new WebSocket specification is out again.. [13:26] mscdex: too bad there aren't any 06 clients yet, i'd like to start implementing but have nothing to test against [13:26] V1: Opera is the new IE, stopping technical development :! [13:26] floby: fernandezpablo85: they do actually. what to you mean when you say they seem to run in sequence ? [13:26] altamic has joined the channel [13:27] floby: V1: Disabled in FF4 too. FF is the new IE :D that's because of a security breach with proxies (as usual) [13:27] eventi has joined the channel [13:27] hobs: hey fernandezpablo85 https://github.com/Tim-Smart/node-parallel [13:27] hobs: I checked https://github.com/joyent/node/wiki/modules [13:27] fernandezpablo85: floby: can you run the gist I posted? [13:28] V1: floby: There will always be security issues.. If we can't native WebSockets we are forced to use Flash or some other wacky fallback that has even more holes [13:28] fernandezpablo85: They return quite sequentially I'm not sure they are being run in parallel [13:28] kristsk: isnt paralelism in node imaginary ? [13:29] fernandezpablo85: floby: here's the gist again [13:29] fernandezpablo85: https://gist.github.com/865873 [13:29] floby: V1: didn't say I agreed with it. That's why I keep on using chromium. The breach is in the UPGRADE http command which is one of the method used to pass websockets through proxies. proxies don't understand it. but another method use the CONNECT command which works with almost all proxies because it's the same as with HTTPS [13:31] floby: fernandezpablo85: well I thought I could run it, but I'm behind a proxy so node can't connect (I've been meaning to patch node for this) [13:31] Aikar: fernandezpablo85: the actual request can run in parralel as the kernel makes the data request over the network, but only 1 thread runs your apps code. so if latency of request is same for bot hrequest, prolly will be sequential [13:32] floby: fernandezpablo85: but I can assure you that none of these request are sent before you get out of the for loop. because the event loop starts at the end of your script. [13:33] fernandezpablo85: so should I add a setTimeout(0) or something [13:33] fernandezpablo85: to kick the event loop? [13:34] floby: fernandezpablo85: chech this gist https://gist.github.com/850083 it's one of my scripts that runs several whois requests in parallel (with child processes) and you can see that they are often out of sequence [13:35] Aikar: fernandezpablo85: process.nextTick(function(){}); [13:35] Aikar: is more effecient than setTimeout 0 [13:35] bluegene has joined the channel [13:35] Aikar: ++ on idea to reroute a setTimeout 0 to process.nextTick [13:35] floby: fernandezpablo85: you could, but it wouldn't change anything since you for loop will happen in the same loop iteration [13:36] perlmonkey2 has joined the channel [13:36] floby: Aikar: -1 on this. It encourages to write setTimeout(0) in browser code which doesn't work in all browsers [13:37] admc has joined the channel [13:37] Aikar: floby: unless person is told to not use it, its not gonna change anything. at least if we reroute the people who do it in node will least get the better performance. not doing it isnt going to magically make them know to use nextTick [13:38] fernandezpablo85: floby: seeing your example you create a new process for each request [13:38] fernandezpablo85: isn't this what we are trying to avoid while using node? [13:38] dominic__ has joined the channel [13:39] fernandezpablo85: I need to launch a big amount of parallel requests, and can't pay the cost of a new process for each [13:39] floby: fernandezpablo85: yes, didn't feel like rewriting whois =) but the I/O principles are the same from node's point of view [13:39] fernandezpablo85: oh I see [13:40] fernandezpablo85: that's because whois is blocking right? [13:40] floby: fernandezpablo85: yes [13:40] fernandezpablo85: cool [13:40] floby: fernandezpablo85: I wrote it in bash before it was taking forever [13:40] tiemonster: yay for falsiness [13:41] floby: tiemonster: ?? [13:41] fumanchu182 has joined the channel [13:41] unlink has joined the channel [13:41] unlink has joined the channel [13:42] kriszyp has joined the channel [13:42] tiemonster: floby: http://groups.google.com/group/nodejs-dev/browse_thread/thread/99be284cb7939f1d [13:42] tiemonster: falsiness bit me in the rear yesterday, too [13:42] tiemonster: I really wanted to trap for null, but 0 was triggering error handling as well [13:43] tiemonster: I went all the way and did variable !== null [13:44] matschaffer has joined the channel [13:44] floby: fernandepablo85: the point is that you can more or less send as many requests as you want, the only risks are performance and hitting the TOO MANY OPEN FILES [13:44] floby: tiemonster: it happens, type checking should be automated ^^ [13:45] fernandezpablo85: floby: too many open files? [13:45] sivy has joined the channel [13:46] floby: fernandezpablo85: it's an OS limit for the number of open FD's [13:46] tiemonster: no, the real issue is that *nix like file descriptors that equal 0 [13:47] floby: tiemonster: never been a problem in 40 years :D [13:47] mlncn has joined the channel [13:47] floby: tiemonster: but I did have bugs with this when I used 2 as a dummy FD value... which I forgot was stderr [13:48] astoon has joined the channel [13:48] tiemonster: nice [13:49] davidsklar has joined the channel [13:49] liquidproof has joined the channel [13:51] floby has joined the channel [13:55] abrahamwilliams has joined the channel [13:56] TomY has joined the channel [13:57] zachsmith has joined the channel [14:01] dnolen has joined the channel [14:01] raphdg has joined the channel [14:02] yibter has joined the channel [14:03] mlncn has joined the channel [14:03] Utkarsh__ has joined the channel [14:03] yyamano has joined the channel [14:03] ocirs has joined the channel [14:03] hij1nx has joined the channel [14:04] beawesomeinstead has joined the channel [14:04] Sami_ZzZ_ has joined the channel [14:04] dominic__ has joined the channel [14:04] pHcF has joined the channel [14:04] arpegius has joined the channel [14:05] gozala has joined the channel [14:07] dnolen has joined the channel [14:09] cgerold has joined the channel [14:10] jlecker has joined the channel [14:11] sivy has joined the channel [14:12] Vertice has joined the channel [14:13] cgerold has left the channel [14:13] xandrews has joined the channel [14:14] cgerold has joined the channel [14:16] heavysixer has joined the channel [14:16] cgerold has joined the channel [14:16] kriszyp has joined the channel [14:16] eee_c has joined the channel [14:19] pandeiro has joined the channel [14:19] locks has joined the channel [14:20] dyer has joined the channel [14:20] adamt has joined the channel [14:20] locks has joined the channel [14:21] sivy has joined the channel [14:22] rfay has joined the channel [14:23] forest has joined the channel [14:25] astoon has joined the channel [14:27] siaoeh2 has joined the channel [14:29] siaoeh2: Is there any multi chat rooms using socket io samples? [14:29] V1: Yup. [14:29] siaoeh2: Where can I get it? [14:29] willwhite has joined the channel [14:29] siaoeh2: Multiple chat rooms? [14:30] V1: I have hacked in channels in my own Socket.IO fork; https://github.com/3rd-Eden/Socket.IO-node/tree/master/example/channel [14:31] V1: But rauchg and I are working on brining a realms / channel implementation to Socket.IO but thats gonna take a while.. [14:31] tiemonster: I'm trying to create a web services aggregator. Any ideas on how to securely store credentials for all the different web services? [14:31] siaoeh2: Oo nice v1 [14:32] __tosh has joined the channel [14:32] floby: V1: that'd be cool [14:32] bx2 has joined the channel [14:32] V1: I don't know if it will be in Socket.IO 0.7 but it will probably be there soon :p [14:32] mpoz2 has joined the channel [14:33] mlncn has joined the channel [14:33] sonnym has joined the channel [14:33] mikegerwitz: tiemonster: crypto api? [14:33] datenaoto has joined the channel [14:34] tiemonster: so file based? [14:34] siaoeh2: tiemonster: y dun u do an auth ws that returns a token for all other methods? [14:34] tiemonster: I was thinking of storing the credentials in the current session [14:34] DevX101 has joined the channel [14:34] siaoeh2: Can do sliding expiration [14:34] fernandezpablo85 has left the channel [14:34] tiemonster: but then every time you log into the dashboard, you'd have to log into all of the other services as well [14:35] tiemonster: which would defeat the purpose to begin with [14:35] mikegerwitz: tiemonster: nothing wrong with a file. Just don't store the key on disk where it's accessible. Prompt for the key on startup or store it on removable media [14:35] tiemonster: my original thought was to do auth with username==filename and password=AES key [14:35] tiemonster: but you'd have to completely administer your web services from the web frontend [14:36] tiemonster: which would require sending credentials plaintext [14:36] tiemonster: so I'd have to require SSL [14:37] c4milo has joined the channel [14:37] eventi has joined the channel [14:40] sivy has joined the channel [14:40] ceej has joined the channel [14:42] q_no has joined the channel [14:42] msch has joined the channel [14:43] bentruyman has joined the channel [14:44] strmpnk has joined the channel [14:47] Lion2Leo has joined the channel [14:47] matschaffer has joined the channel [14:47] eyesUnclouded has joined the channel [14:47] flou has joined the channel [14:48] jscheel has joined the channel [14:48] jscheel has joined the channel [14:51] eee_c has joined the channel [14:56] dwww has joined the channel [14:58] piscisaureus_ has joined the channel [14:59] Ori_P has joined the channel [15:00] davidwalsh has joined the channel [15:00] Utkarsh has joined the channel [15:01] danyork has joined the channel [15:03] sveisvei has joined the channel [15:03] Draggor: SubStack: around? [15:04] mAritz: holy moly, why are getters/setters so extremely slow? according to my tests they are 2.5 times slower than using an obj.get() function. :( [15:05] mikegerwitz: :O [15:05] mAritz: and that's only for one property defined with a getter/setter. if i define get/set for 2 propteries and only use one of them, it instantly adds to 3 times as slow. [15:06] davemo has joined the channel [15:06] mAritz: plus this does not take instantiation into account, pure getting/setting. [15:08] mikegerwitz: mAritz: Yeah I'm seeing the same results. Methods are significantly faster than getterse.. [15:08] mikegerwitz: getters* [15:08] colinclark has joined the channel [15:08] mAritz: sucks :( [15:08] mAritz: oh well, at least i don't have to refactor now :D [15:08] michaellcs has joined the channel [15:09] michaellcs: hi guys [15:09] timmywil has joined the channel [15:09] michaellcs: i have a problem here [15:09] mikegerwitz: Well I'd definately like to know why that's the case [15:09] michaellcs: task failed err 1 [15:09] yyamano has joined the channel [15:09] kriszyp has joined the channel [15:10] michaellcs: task: cc ares_strcasecmp.c -> ares_strcasecmp_1.o [15:10] mikegerwitz: michaellcs: for master? [15:10] michaellcs: i am building node.js by using cygwin [15:10] michaellcs: not really [15:11] mikegerwitz: michaellcs: Did you clone from git? [15:11] michaellcs: ya i did [15:11] mikegerwitz: michaellcs: try: $ git checkout v0.4.2 [15:11] muhqu has joined the channel [15:11] mikegerwitz: michaellcs: then see if you get the same error. That looks a lot like what I've seen others state here in the chat. It may just affect master [15:12] mAritz: mikegerwitz: apparently it's v8: http://jsperf.com/getter-setter/3 according to this ie9 and opera are pretty good with getters/setters compared to chrome, safari and ff [15:12] zemanel has joined the channel [15:12] pietern has joined the channel [15:12] michaellcs: hmmm [15:12] michaellcs: i see [15:12] michaellcs: how do i know that im on master mode or something [15:13] michaellcs: coz i was helping my fren to compile node.js [15:13] mikegerwitz: michaellcs: easiest way is to type `git status` [15:13] mikegerwitz: mischief: it'll tell you what branch you are on [15:13] michaellcs: i noticed that there was a master thingy stated there [15:13] michaellcs: but mine dont have [15:13] michaellcs: ok [15:13] michaellcs: ooh [15:13] jmar777: so i was playing around with some horrible, horrible code, and noticed that i was getting very non-descriptive error messages when recursion hit anywhere in the 4-18K depth range. [15:13] michaellcs: im on branch master [15:13] gerad has joined the channel [15:14] Utkarsh_ has joined the channel [15:14] mikegerwitz: michaellcs: Yep :) So try `git checkout v0.4.2`, to check out node version 0.4.2, which hopefully will build fine [15:14] jmar777: i wonder if there's a way we can expose some better error messaging around that [15:14] michaellcs: so i guess i have to change it to something else? [15:14] michaellcs: oh ok [15:14] michaellcs: thanks in advance [15:14] michaellcs: let me give it a try [15:14] mikegerwitz: michaellcs: Yep. you may have to run `make distclean` (if you're using make...not sure what you use under cygwin) before you try building again [15:15] michaellcs: ok [15:15] bradleymeck: Draggor: nice [15:16] Draggor: bradleymeck: Heyo. It's a first effort, though there's some biiiig things wrong with it, ha [15:16] kriszyp2 has joined the channel [15:16] mikegerwitz: mAritz: Ah, interesting.. [15:17] michaellcs: mikegerwitz: thnks for your info [15:17] mikegerwitz: mAritz: Never thought I'd say IE9 is impressive with any implementation [15:17] mscdex: mikegerwitz: it's make under cygwin too ;) [15:17] michaellcs: it is still in making process [15:18] michaellcs: btw jus wondering how about err 2? [15:18] mAritz: mikegerwitz: the testlink i provided has very few benchmarks though. version one had a few more that make seem a little less extreme. (but it's still quite a margin) [15:18] michaellcs: mikegerwitz: task: libv8.a SConstruct -> libv8.a [15:18] mikegerwitz: mAritz: Yes, good point. [15:18] mscdex: michaellcs: gist the entire output [15:19] michaellcs: oooh i see [15:19] mikegerwitz: michaellcs: Are you still getting that? Or was that the first time, before v0.4.2? [15:19] davidvanleeuwen has joined the channel [15:19] michaellcs: before i got err 1 [15:19] Draggor: bradleymeck: here's the updated version: http://pastebin.com/WquFFbLH [15:19] michaellcs: but my fren was facing the err 2 [15:20] michaellcs: mikegerwitz: coz we are currently working on kinecthack for sch project [15:20] michaellcs: kind of new to all these [15:20] mikegerwitz: michaellcs: That error is fairly generic. If 0.4.2 fails to build, I'd post the entire error (gist, pastebin, etc). It could mean many things [15:20] mikegerwitz: (as mscdex said) [15:20] ncb000gt has joined the channel [15:20] ncb000gt has left the channel [15:21] ncb000gt has joined the channel [15:21] michaellcs: mikegerwitz: ok [15:21] michaellcs: mikegerwitz: btw jus nw u mentioned about gist the output [15:21] michaellcs: mikegerwitz: jus wondering what is the command for that? [15:21] mscdex: gist.github.com [15:21] michaellcs: mikegerwitz: sorry im new to this [15:21] nonnikcam has joined the channel [15:22] mikegerwitz: np [15:22] michaellcs: mikegerwitz: coz i have to build node.js to link up my flash with c++ project [15:22] michaellcs: mikegerwitz: thanks man [15:23] michaellcs: mikegerwitz: problem solved [15:23] mikegerwitz: michaellcs: great :) [15:23] Draggor: oh much nicer, gist version: https://gist.github.com/866004 ( bradleymeck ) [15:23] Utkarsh__ has joined the channel [15:24] losing has joined the channel [15:25] wav1 has joined the channel [15:25] bradleymeck: draggor nice, if i had more time i could help, but if you have any questions on c++ v8 stuff i can prolly help [15:25] davidascher has joined the channel [15:26] Draggor: bradleymeck: well right now I'm not entirely sure what's going wrong, but even basic adds aren't working [15:27] mlncn has joined the channel [15:28] brianc has joined the channel [15:28] aways|bnc: ACTION By all [15:29] bradleymeck: draggor no error messages? just silent? [15:29] Draggor: for instance: BigInt(2).add(BigInt(3)) gives me a BigInt of value 4 [15:29] dominic__ has joined the channel [15:29] ncb000gt: Draggor: whats wrong with that [15:29] ncb000gt: ? [15:30] ncb000gt: >.> [15:30] Draggor: and BigInt(2).add(3) will return a new BigInt that still has value 2 [15:30] fusspawn: ncb whats wrong with 2+3 == 4? [15:31] sivy has joined the channel [15:31] ncb000gt: fusspawn: it was supposed to be a joke [15:31] fusspawn: ^_^ [15:32] stepheneb has joined the channel [15:32] fernandezpablo86 has joined the channel [15:33] fernandezpablo86: any idea why this is hanging? [15:33] fernandezpablo86: https://gist.github.com/866027 [15:33] fernandezpablo86: on localhost:8124/?10 [15:34] jmar777: would someone mind verifying this gist on a non os x machine? https://gist.github.com/866025 [15:35] ncb000gt: fernandezpablo86: setTimeout itself is usually (function, time) i'm not sure if the timers object is the same [15:35] ncb000gt: but you might want to check that api [15:35] rfay has joined the channel [15:36] tfe_ has joined the channel [15:37] fernandezpablo86: Ok I'm an idiot [15:37] fernandezpablo86: it was the argument order [15:37] fernandezpablo86: sorry :$ [15:37] ncb000gt: haha all good, i only know because i've done that too many times ;D [15:38] fernandezpablo86 has left the channel [15:38] ncb000gt: jmar777: with v0.5.0-pre it crashes at about 16000 [15:38] ncb000gt: on my ubuntu box [15:38] DevX101 has joined the channel [15:39] Astro has joined the channel [15:39] jmar777: ncb000gt: thanks [15:39] mlncn-agaric has joined the channel [15:40] ncb000gt: i'm rebuilding 0.2.6 right now [15:40] sub_pop has joined the channel [15:40] ncb000gt: since i need it for what i'm doing anyway ;D [15:40] jmar777: ncb000gt: hah, i appreciate it. i think a fix for this would be out of my territory, but it seems like there should be some way to provide a better message [15:41] yibter has joined the channel [15:42] jmar777: perhaps "enhancement" is a better word. dono't think this technically counts as broken [15:42] ncb000gt: jmar777: 16000 again on 0.2.6 [15:42] ncb000gt: but less of an error [15:42] Polysics has joined the channel [15:42] ncb000gt: and yea, the stack hits a limit [15:42] Polysics: raargh [15:43] pdelgallego has joined the channel [15:43] ncb000gt: which is why it crashes [15:43] jmar777: ncb000gt: aight - so sounds like it's probably a v8-in-general kind of thing. maybe something we can adress in the node/v8 bindings [15:43] dwww has joined the channel [15:43] Polysics: someone keep me from killing a few IE developers [15:43] ncb000gt: jmar777: possibly [15:43] Polysics: is anyone using socket.io? [15:43] ncb000gt: Polysics: go for it [15:43] ncb000gt: :) [15:43] fangel has joined the channel [15:43] Polysics: i have tested our event system with about 10 browsers [15:44] Polysics: and it hans on IE only [15:44] Polysics: after a few events, the browser stops receiving them [15:45] ncb000gt: jmar777: good analysis of what you're seeing [15:45] ncb000gt: http://voodootikigod.com/paul-barry-shows-how-to-accomplish-tail-call [15:45] jelveh has joined the channel [15:47] brianc: I got an npm question: if I have a module named 'foo' with 'main' at /lib/ (so it includes index.js if you require('foo')) how can I get "require('foo/baz') to include the file /lib/baz.js? [15:47] bergie has joined the channel [15:47] tiemonster: how do I see the raw request in express? [15:47] mlncn has joined the channel [15:47] ncb000gt: Polysics: you're using the client lib from learnboost? [15:48] mikegerwitz: brianc: you don't. Do require( 'foo' ).baz, using index.js [15:48] Polysics: ncb000gt: served directly off my node.js isntance, yes [15:49] brianc: mikegerwitz: thank you sir [15:49] Spion_ has joined the channel [15:49] ncb000gt: tiemonster: you can print out the object using util.inspect() [15:49] mlncn-agaric has joined the channel [15:50] dominic__ has joined the channel [15:50] benjamin-agaric has joined the channel [15:51] boaz has joined the channel [15:51] softdrink has joined the channel [15:51] seivan has joined the channel [15:52] tiemonster: thanks [15:52] tiemonster: it appears as if chrome is sending random junk instead of the actual HTTP BASIC auth credentials... [15:53] ncb000gt: eww [15:53] losing has joined the channel [15:53] daglees has joined the channel [15:54] jmar777: ncb000gt: wow - great article. thanks for the link [15:54] hij1nx has joined the channel [15:54] ncb000gt: jmar777: aye [15:54] mlncn has joined the channel [15:54] heavysixer has joined the channel [15:54] tiemonster: it's literally sending blank credentials ":" [15:55] ncb000gt: that's bizarre [15:55] yhahn has joined the channel [15:55] mAritz: can i pass the current file context (what would be document in browser js) to a function that is defined in another file and modify it there? [15:57] dguttman has joined the channel [15:57] squeeks_: too many damn mysql clients. [15:58] Dark_Sun has joined the channel [15:58] Dark_Sun: hello everyone. [15:58] tiemonster: ah - you can't initiate via xhr. You have to request credentials on an actual page first. [15:59] akahn has joined the channel [15:59] akahn has left the channel [15:59] Dark_Sun: i have a little question... in createServer function, this.connections return the number of connected clients. how to get them ? where are them stored ? [15:59] kenbolton has joined the channel [16:00] matjas has joined the channel [16:00] mscdex: they aren't stored anywhere [16:00] mscdex: you have to keep track of them [16:00] ncb000gt: tiemonster: makes sense [16:00] Dark_Sun: oh ok [16:00] Lion2Leo: Newb question: Currently trying express and in jade I simply create an img but it doesn't display : img(src='../public/images/logo.png', alt='logo') [16:01] tiemonster: ncb000gt: but that behavior isn't observed in firefox or IE [16:01] Dark_Sun: thank you mscdex [16:01] ncb000gt: tiemonster: yea, standards...heh :) [16:01] Lion2Leo: I had a similar issue with regular node using a standard img tag, I have no idea what I have to do in order to display a picture, do I have to read it to the server first? [16:01] yyamano has joined the channel [16:02] tiemonster: you have to have some sort of static file server [16:02] tiemonster: express includes one [16:02] Lion2Leo: Do I have to explicitly ask for it? [16:03] tiemonster: app.use(express.staticProvider('./path/to/static/files/')); [16:03] Lion2Leo: Alright, I shall try this out :) [16:03] tiemonster: this isn't Apache. It's a real application server. [16:03] steph021 has joined the channel [16:03] dominic__ has joined the channel [16:03] Lion2Leo: I have no experience in network programming [16:04] Lion2Leo: I've coded in c++ and qt for 3 years [16:04] Lion2Leo: But only in interface departement [16:04] tiemonster: ah - ok [16:04] Lion2Leo: I've been reading about it though [16:04] tiemonster: yeah - you need a dedicated route to serve static content [16:05] Lion2Leo: That is good to know [16:05] tiemonster: Node.js is a great place to start with web application development if you can do C++ [16:05] tiemonster: because you can build wicked fast services in C++ and use Node to attach them to a REST API [16:06] Polysics: technical question: my socket.io system, IE gripes apart, works like a charm [16:06] Lion2Leo: Thanks for giving me some of your wisdom tie [16:06] ncb000gt: yea, but even still, the JS side is quite fast as well [16:06] Polysics: what is the best way to send events from other systems? [16:06] Polysics: so far i have an Express POST action that accepts events to be sent [16:06] Polysics: i do not need a queue as it is all real-time [16:07] ossareh has joined the channel [16:07] mytrile has joined the channel [16:08] tiemonster: Lion2Leo: maybe you can impart some C++ wisdom ;-) [16:08] ncb000gt: and making proper use of the the event emitters can make sure you're keeping things fast [16:09] redmind: kinda forced to since things get a little messy if you rely solely on continuation passing/callbacks :P [16:09] Muon has joined the channel [16:09] Muon has joined the channel [16:09] ncb000gt: haha [16:09] bmavity has joined the channel [16:13] onar_ has joined the channel [16:13] Muon: how can I use SSL with http.request()? [16:15] adamt: does express have its own channel somewhere? [16:16] ntr0py has joined the channel [16:16] hobs: well its not #express or #express.js [16:17] tiemonster: #node.js [16:19] briznad has joined the channel [16:19] ncb000gt: adambeynon: it's this channel for now :) [16:19] ncb000gt: doh [16:19] adamt: well i'll shoot here then. i have a (simple) question about templating with jade [16:19] ncb000gt: adamt: it's this channel [16:19] adamt: i want to do something like "- each link in links \n a(href='#{link.value.url}')= link.value.name" but i can't figure out how to get link.value.url inserted in the href [16:20] ncb000gt: href=link.value.url [16:20] ncb000gt: no '#{}' [16:21] adamt: oh and no quotes. thx a bunch. [16:21] ncb000gt: yep [16:21] matjas has joined the channel [16:22] adamt: being new with node and the libraries built in it, is it still sensible to spend time with express, or has something cooler spawned? [16:23] adamt: *on it [16:23] timmywil has joined the channel [16:23] losing has joined the channel [16:23] AAA_awright: adamt: If you're question is about Jade it woulndn't be in an Express-dedicated channel anyways [16:24] ncb000gt: adamt: express/connect are in the process of a massive rewrite [16:24] Lion2Leo: I hope they don't change things too much [16:24] Lion2Leo: Tutorials gets outdated by the week ;) [16:24] ncb000gt: Lion2Leo: there were a number of things removed [16:24] ncb000gt: haha [16:25] ncb000gt: welcome to the node community [16:25] ncb000gt: ;D [16:25] tc77 has joined the channel [16:25] Lion2Leo: It's good learning for new people like me though [16:25] ncb000gt: yea [16:25] Lion2Leo: Everytime I run something it doesn't work so I try figuring out what has changed since the diff versions [16:26] ncb000gt: yea [16:26] adamt: so you wouldn't make anything critical with express for the time being? [16:26] yenz: just stick to a particular version and you should be fine [16:26] ncb000gt: adamt: i already have been [16:26] arthabaska has joined the channel [16:26] yenz: but if you like to stay current... it's a fast-moving target [16:26] ncb000gt: express has been nice, but it needed an overhaul [16:26] ncb000gt: cut some of the fat from it [16:27] Augi has left the channel [16:27] Lion2Leo: As long as it makes it more stable for the future I'm up for it :) [16:27] ncb000gt: yep [16:28] froak has joined the channel [16:28] pcardune has joined the channel [16:29] colinsullivan has joined the channel [16:31] colinsullivan: What is the most mature OAuth client module? [16:32] colinsullivan: Also, is anyone working on a framework for synchronizing Backbone.js models via sockets like this: http://bit.ly/hkewkt ? [16:33] Draggor: I would like to announce that I am a derp, and copy paste is what has been screwing me over [16:33] adamt: ncb000gt, well, express still seems way more slim than stuff like *cough* rails. [16:34] tiemonster: adamt: slim == lack of features [16:34] adamt: or lack of magic (some people don't particularly like magic) [16:34] ncb000gt: adamt: it's more slim for sure [16:35] ncb000gt: it doesn't have all the "features" [16:35] ncb000gt: but it' [16:35] tjholowaychuk has joined the channel [16:35] ncb000gt: it doesn't need them [16:35] ncb000gt: and there he is now [16:35] ncb000gt: tjholowaychuk: just in time for a discussion on express [16:36] ncb000gt: ;D [16:36] tjholowaychuk: haha [16:36] tjholowaychuk: woot [16:36] adamt: not going to be with me, i'm eating (while trying to keep the food safe from the cat) and i haven't studied enough of express to say anything intelligent anyways :P [16:37] redmind: colinsullivan: pyrotechnick posted this earlier, https://gist.github.com/865667 somewhat what you are talking about? [16:37] Draggor: bradleymeck: SubStack: Whee, copy paste errors. I'm now running through the test files to clean up other issues. If both of those test files pass, I think I'm going to push this up to a git repo. [16:38] colinsullivan: redmind: yep, very similar idea. I will be writing a framework in the near future, and am hoping to avoid running into someone else doing the same thing [16:39] redmind: they are using it for an mmo i believe [16:39] Kryckan has joined the channel [16:39] sjbreen has joined the channel [16:40] davidascher has joined the channel [16:40] yyamano has joined the channel [16:41] jakehow has joined the channel [16:41] brianloveswords has joined the channel [16:42] gerad has joined the channel [16:42] ii has joined the channel [16:42] razvandimescu has joined the channel [16:42] altamic has joined the channel [16:42] altamic has joined the channel [16:46] tiemonster: tjholowaychuk: so when is express going to get pluggable authentication? [16:46] tjholowaychuk: tiemonster: whenever someone makes it [16:47] tjholowaychuk: wont ever be in core [16:47] tiemonster: why not? [16:47] tjholowaychuk: its just not a goal, maybe for a higher level framework built on express [16:47] tjholowaychuk: but not express itself [16:47] tjholowaychuk: I want it to remain as more of a toolkit [16:47] tiemonster: maybe I should do that [16:48] tjholowaychuk: I have a bit of one started called "flow" but other priorities right now [16:48] tiemonster: on github? [16:48] dominic__ has joined the channel [16:49] noahcampbell has joined the channel [16:49] tjholowaychuk: private repo [16:49] tiemonster: awe :-( [16:50] smit4608 has joined the channel [16:50] cincinnatus has joined the channel [16:50] fangel has joined the channel [16:50] Draggor: Anyone know how to extract an int64_t and a uint64_t out of Arguments& args? [16:51] cleaner has joined the channel [16:54] losing has joined the channel [16:54] tiemonster: Draggor: yes [16:55] Draggor: tiemonster: do tell! [16:56] tiemonster: didn't say it was me ;-P [16:56] Draggor: Oh, well then [16:57] tiemonster: Draggor: http://bespin.cz/~ondras/html/classv8_1_1Value.html [16:58] tiemonster: so you have const Arguments& args [16:58] tiemonster: Local arg0 = args[0]; [16:58] tiemonster: right? [16:58] tiemonster: Localarg0_value = arg0->ToUint32(); [16:59] Draggor: well to pull an int32_t out, for example, I'm doing args[0]->ToInt32()->Value() [16:59] tiemonster: er uh [16:59] tiemonster: ->Uint32Value(); [16:59] tiemonster: sure [16:59] redmind: why is it that when im at work things break but when im half-asleep writing something the first implementation works without problems... grrr [17:00] alek_br has joined the channel [17:00] warz has joined the channel [17:00] tiemonster: redmind++ [17:00] v8bot: tiemonster has given a beer to redmind. redmind now has 1 beers. [17:01] BillyBreen has joined the channel [17:02] tiemonster: I think my IQ goes down by 40 points when I put on a tie [17:03] Draggor: tiemonster: oh I see, Integer->Value() gives an int64_t, which I should be able to just cast to uint64_t, yeah? [17:03] eee_c1 has joined the channel [17:03] Lion2Leo: tiemonster: Yet you are a tie monster :) [17:04] tiemonster: they make me wear a tie [17:04] redmind: id say wear hideous ties to spite them but now days thats trendy :| [17:04] tiemonster: which makes me a pariah among the students [17:05] Lion2Leo: I don't wear a tie at my job, the fact that I don't interact with our customers is good enough of an argument to wear w/e I want [17:05] MikhX has joined the channel [17:06] Lion2Leo: Though they do try to persuade me from time to time with diabolical shemes ... ha [17:07] estrathmeyer has joined the channel [17:08] flou has joined the channel [17:09] broofa has joined the channel [17:09] zachsmith has joined the channel [17:09] seutje has joined the channel [17:10] mpoz2 has joined the channel [17:10] Intrrpt has joined the channel [17:11] colinsullivan: Is anyone familiar with templating engines for node that have template inheritance? [17:11] traivs has joined the channel [17:11] traivs: anyone here [17:11] traivs: got a quick question when building using cygwin [17:11] tiemonster: traivs: shoot [17:11] shiawuentan has joined the channel [17:12] Draggor: bradleymeck: SubStack: updated gist to fix some bugs: https://gist.github.com/866004 [17:12] traivs: got a "Build failed: -> task failed (err #2) {task: libv8.a SConstruct -> libv8.a} [17:12] tiemonster: crap. how did I fix that? [17:13] ximo has joined the channel [17:13] tiemonster: traivs: it's a missing dep [17:13] tiemonster: in cygwin [17:13] traivs: that's what i figured [17:13] traivs: is there a way to better determine which dep it is? [17:15] zpao has joined the channel [17:15] jiggliemon has joined the channel [17:16] beawesomeinstead has joined the channel [17:17] tiemonster: install everything? [17:17] tiemonster: :-D [17:18] traivs: lol [17:18] dguttman_ has joined the channel [17:18] tiemonster: traivs: trying installing an earlier version of node first [17:18] traivs: yeah, that's my next trick ;) [17:18] traivs: ok [17:18] traivs: i'll try that quickly, before i install more DEVEL pkgs for cygwin [17:20] dyer has joined the channel [17:20] atiti has joined the channel [17:21] gozala has joined the channel [17:22] brianc: Draggor: are you sure you want to be calling malloc before checking the v8 arguments for their correct types? [17:23] eventi: hey - trying to get my head around JSON objects posted to a node.js script [17:23] Draggor: brianc: that's a good point [17:23] eventi: it seems to be traversing the object and creating key pairs based on that insted of stringifying the object - is that what I should expect? [17:24] eventi: appologies in advance - i'm a sysadmin trying to get someone elses code to work [17:24] tiemonster: you know that crappy short variables in C++ don't improve performance, right? [17:24] tiemonster: I don't understand why this practice is so common [17:24] Draggor: tiemonster: it's called code for a reason [17:24] tiemonster: lol [17:24] Draggor: if it were easy to read it gets slower [17:24] tiemonster: not at all [17:24] brianc: Because::AreSOOO youHaveToSaveSpaceSomehwere; [17:25] eddanger has joined the channel [17:25] tiemonster: declare and set on separate lines [17:26] russell_h has joined the channel [17:26] brianc: tiemonster: i just joking. :) I try to use descriptive variable & function names in c++ [17:26] Utkarsh_ has joined the channel [17:26] Me1000 has joined the channel [17:26] jessycatz has joined the channel [17:27] jetienne has joined the channel [17:27] jessycatz: hey. i was just wondering: is there a way to compile node as a library? I simply'd like to use the awesome libev integration in combination with some other node features for some project... [17:27] russell_h has joined the channel [17:28] Utkarsh_ has joined the channel [17:28] tiemonster: jessycatz: how? [17:29] stephank has joined the channel [17:29] tiemonster: meaning you have other C++ code you want to integrate? [17:29] jessycatz: yes. [17:29] jessycatz: but I want the user to execute my c++ code and then that c++ core would spawn the node-js shell. [17:29] tiemonster: make a thin wrapper around your existing API that allows it to be called from v8 [17:29] Draggor: brianc: thanks for the tip! [17:30] pcardune has joined the channel [17:30] jessycatz: tiemonster: i know that but i want it the other way round :) [17:30] Utkarsh_ has joined the channel [17:30] tiemonster: what does your code do? [17:30] brianc: Draggor: no problemo [17:31] tommoor has left the channel [17:31] jessycatz: tiemonster: think of an app which would be controlled from js but relying heavily on evented callbacks [17:31] tiemonster: and why can you not use my approach for that? [17:32] Venom_X has joined the channel [17:32] jessycatz: because i need the app to boot up before node boots. [17:32] tiemonster: boot? [17:32] jessycatz: start [17:32] tiemonster: is it a daemon? [17:33] jessycatz: No. I am aware that i could basically achieve this by having the app communicate with node via sockets but I'd like to avoid it. [17:33] tiemonster: not at all [17:33] jessycatz: mh k [17:33] tiemonster: I'm talking about embedding your code in v8 [17:33] tiemonster: http://nodejs.org/docs/v0.4.2/api/addons.html [17:34] jessycatz: Well, I know that. But, as I said, I'd just like to embed node in my app just like I'd embed v8. [17:34] tiemonster: seems like a backwards way to do it [17:35] tiemonster: it's a web app? [17:35] jessycatz: it is. [17:35] jessycatz: eeh it is a backwards way [17:35] jessycatz: but no, it's no web app. [17:35] tiemonster: I don't understand [17:35] kiddphunk has joined the channel [17:35] tiemonster: why not just take advantage of the existing architecture? [17:36] jessycatz: No, no. I basically want to use node as an addon in my app. [17:36] jessycatz: My app is in c++ [17:36] tiemonster: I'm aware [17:36] Muon: why node? [17:36] ximo has joined the channel [17:37] tiemonster: jessycatz: are you going to write any javascript code at all? [17:37] tiemonster: if not, just rip off the event loop and be done with it [17:37] fusspawn has joined the channel [17:38] jessycatz: I am going to write javascript code. [17:38] tiemonster: the ideal, IMHO, it to have node handle the socket and REST API, and simply expose services in C++ [17:38] mytrile has joined the channel [17:38] jessycatz: I'm not talking about a web app here. What i basically want to do is: Use JS as a scripting language with node's event system. [17:38] tiemonster: So Node.js becomes the liaison between the client and your C++ code [17:39] tiemonster: it's a web app? [17:39] tiemonster: it is. [17:39] tiemonster: ? [17:39] jessycatz: 18:35 < tiemonster> it's a web app? [17:39] jessycatz: 18:35 < jessycatz> it is. [17:39] jessycatz: 18:35 < jessycatz> eeh it is a backwards way [17:39] jessycatz: 18:35 < jessycatz> but no, it's no web app. [17:39] jessycatz: you were too quick. [17:39] jessycatz: or i too slow [17:39] jessycatz: It all boils down to creating a libnode.so is that possible? [17:39] tiemonster: double negative threw me [17:39] jessycatz: sorry :) [17:39] tiemonster: yeah - rip off the event loop and embed v8 [17:40] jessycatz: ok. Guess I'll do that then. Thanks. [17:40] tiemonster: http://www.google.com/url?sa=t&source=web&cd=1&ved=0CBUQFjAA&url=http%3A%2F%2Fcode.google.com%2Fapis%2Fv8%2Fembed.html&ei=el56TZyYL87ngQfl7bjOBw&usg=AFQjCNHWGPp4_m7HkNCWwXDJO5tG34d4Uw [17:40] tiemonster: ack [17:40] tiemonster: http://code.google.com/apis/v8/embed.html [17:40] jessycatz: Yeah, I know how to embed v8. [17:40] jessycatz: So long :) [17:40] Utkarsh_ has joined the channel [17:40] tiemonster: k [17:41] adamt has joined the channel [17:42] dwww has joined the channel [17:43] __tosh has joined the channel [17:44] prof-freud has joined the channel [17:44] darshanshankar has joined the channel [17:46] adrian_berg has joined the channel [17:46] Chunk has left the channel [17:47] yozgrahame has joined the channel [17:47] sivy_ has joined the channel [17:49] Utkarsh has joined the channel [17:51] perezd has joined the channel [17:51] qFox has joined the channel [17:52] hobodave has joined the channel [17:53] weepy has joined the channel [17:53] weepy: hi - I'm trying to publish to npm [17:53] weepy: keep getting [17:53] tommoor has joined the channel [17:54] weepy: {"error":"unauthorized","reason":"Name or password is incorrect."} [17:54] weepy: is isaacs about ? [17:56] tiemonster: no [17:56] tiemonster: and you're sure your credentials are correct? [17:57] abraham has joined the channel [17:57] adambeynon has joined the channel [17:58] eddanger has left the channel [17:58] tjholowaychuk: anyone remember the wscript thing to hint at paths? [17:58] tjholowaychuk: AH! libpath [17:59] technoweenie has joined the channel [18:00] Aikar: ryah: you around? [18:00] mjr_ has joined the channel [18:01] alek_br has joined the channel [18:02] eddanger_ has joined the channel [18:04] tjholowaychuk: ACTION hates waf [18:04] aho: fles [18:04] tbranyen: tjholowaychuk: yea dude it blows [18:04] tjholowaychuk: python makes less sense than a makefile to me lol i dont want to learn py just for this thing [18:04] Aikar: we need a nake [18:05] Aikar: maybe complete it to naked for the lulz [18:05] tbranyen: i had a dependancy that used waf so naturally i figured waf could easily build and link a local lib that uses waf [18:05] tbranyen: cou;dn't [18:05] vipaca has joined the channel [18:05] vipaca has joined the channel [18:05] tbranyen: find anything on making that happen [18:05] Lion2Leo: What should I do if I get Error: EADDRINUSE, Address already in use [18:05] doki_pen: any idea why this fails: http://pastebin.com/YUgVH89n [18:05] tbranyen: ended up piping the waf build commands manually [18:06] doki_pen: but when I add a second parameter to the function on line 72, it succeeds [18:06] doki_pen: but no second param is passed [18:06] Aikar: also, my coworker thought it was hilarious you have to install/compile python (an interpreted language), to compile a C++ program, in order to run JavaScript (an interpreted language) [18:06] tjholowaychuk: tbranyen: I cant figure out how to make it check localized deps first [18:06] technoweenie: Lion2Leo: change the port, or stop whatever else is using that port [18:06] Utkarsh has joined the channel [18:07] tbranyen: tjholowaychuk: you want to check if you have a dependancy within the project first, if not check the system or something? [18:07] tjholowaychuk: yeah [18:07] technoweenie: fwiw coffeescript has cake. i have no idea how well it works, but you could always try that [18:07] tjholowaychuk: ew [18:07] tbranyen: i was doing that before, but now i just include my dep and link that way [18:07] tjholowaychuk: make is fine lol [18:07] tbranyen: just in case the system dep isn't quite the right version [18:07] dyer has joined the channel [18:07] tjholowaychuk: tbranyen: its for node-canvas, so then you have libpng, pixman, cairo, libjpeg blah blah [18:08] patcito has joined the channel [18:08] Lion2Leo: technoweenie: I killed all the processes and ended up closing my shell, didn't do much help which I find odd, changed port... thanks [18:08] tbranyen: why would those ever be local then? [18:08] tjholowaychuk: tbranyen: because it's less annoying [18:08] tbranyen: than using your systems package manager to fetch them in one go? [18:08] Aikar: Lion2Leo: what ver of node? [18:08] Lion2Leo: Latest [18:09] Lion2Leo: 0.4.2 I believe [18:09] Aikar: odd, node forces SO_REUSEADDR on [18:09] Aikar: Lion2Leo: do sudo netstat -nltp [18:09] Aikar: and see what process owns the port [18:09] tbranyen: also wouldn't it make more sense to look at the system level first and then failing that use local? [18:10] tjholowaychuk: tbranyen: yeah that is what I wanted [18:10] tjholowaychuk: then I could just write a quick script to install them locally [18:10] Lion2Leo: pid/program : 0 [18:11] ncb000gt: tjholowaychuk: typically i prefer to use the systems package manager for those things [18:11] Aikar: Lion2Leo: try service net restart ? [18:11] Aikar: (that will restart your network connection FYI!) [18:11] tjholowaychuk: ncb000gt: yeah its great when it works [18:12] pdelgallego has joined the channel [18:12] Lion2Leo: Aikar: Is that the command as-is? [18:12] weepy: if you link to relative paths within index.js of an npm package => problem time ... [18:12] Aikar: Lion2Leo: sudo it [18:12] ncb000gt: tjholowaychuk: haven't had much of a problem with it yet, but i can see needing specific versions and such [18:12] weepy: anyone else seen that prob ? [18:12] tjholowaychuk: ncb000gt: I hate package managers lol [18:12] Lion2Leo: Aikar: net: unrecognized service [18:12] Aikar: hmm [18:12] Aikar: what distro? [18:12] ncb000gt: weepy: not i [18:12] Lion2Leo: Aikar: Btw, I'm on fedora [18:12] Twelve-60: can anyone else see a problem with this code? stdout doesn't seem to output O_o: http://pastebin.com/RZGcf6Cq [18:13] weepy: tjholowaychuk: T_T [18:13] Aikar: i believe i did that on centos... [18:13] ncb000gt: tjholowaychuk: aptitude rocks [18:13] tbranyen: tjholowaychuk: if not conf.check(lib='jpeg', libpath=['/usr/local/lib'], uselib_store='JPEG'): # now check local [18:13] tbranyen: something like that maybe? [18:13] tbranyen: and make sure you export the uslib env vars [18:13] colinclark has joined the channel [18:13] weepy: Cannot find module './uglifyjs/parse-js' [18:13] weepy: BUT it's there ! I tell you [18:13] Aikar: Lion2Leo: sorry its service network restart, not net [18:14] Lion2Leo: Aikar: Thanks for those handy commands :) [18:14] yyamano has joined the channel [18:14] eee_c has joined the channel [18:14] dylanbeattie has joined the channel [18:14] Aikar: Lion2Leo: that work? i thought that would disconnect you lol [18:14] Lion2Leo: Aikar: Last time I did bash was 2 years ago, need to re-check ss64 [18:14] Aikar: service i think is a shortcut command to the /etc/init.d/ commands [18:15] pcardune has joined the channel [18:15] Lion2Leo: Aikar: Shutting down loopback interface: [ OK ] [18:15] Lion2Leo: Bringing up loopback interface: [ OK ] [18:15] dylanbeattie: hey all. I'm trying to build node.js on Cygwin using instructions from https://github.com/joyent/node/wiki/Building-node.js-on-Cygwin-(Windows) [18:15] Aikar: it only reset local? [18:15] Lion2Leo: Aikar: That was the output [18:15] Aikar: thats odd... [18:15] Lion2Leo: Indeed [18:15] dylanbeattie: and getting "Error: waf-light requires wafadmin -> export WAFDIR=/folder" from ./configure [18:15] Lion2Leo: Aikar: Which is good in this case haha [18:15] tbranyen: more waf fun :D [18:16] dylanbeattie: build is v0.4.2 cloned from Github [18:16] ncb000gt: weepy: you sure? [18:16] Aikar: dylanbeattie: serious suggestion - install VirtualBox and Ubuntu 10.10 Server instead. [18:16] ncb000gt: what's your directory structure look like> [18:16] dylanbeattie: Git clone is in /d/projects/ndoejs/node [18:16] doki_pen: found this: https://github.com/cloudhead/vows/issues/closed#issue/24 [18:16] Lion2Leo: Yeah dylan, get yourself a virtualbox [18:17] tbranyen: node should install fine [18:17] tbranyen: in cygwin [18:17] dylanbeattie: @Aikar did that already - got a VirtualBox / Turnkey server running [18:17] Lion2Leo: Maybe but still, unix ftw :) [18:17] tbranyen: dylanbeattie: did you grab all the dependancies like it said? [18:17] Aikar: dylanbeattie: then why are you bothering with cygwin? [18:17] dylanbeattie: yep [18:17] tbranyen: Lion2Leo: yeah cygwin is slow as :( [18:17] tbranyen: i use it in windows tho for testing [18:17] Lion2Leo: Well on my win7 machine downstairs I just installed the 100mb debian image [18:18] dylanbeattie: @Aikar I use Windows for everything else and want to see what's involved in node.js running side-by-side with IIS / .NET stuff. [18:18] ximo has joined the channel [18:18] Lion2Leo: Although on my work laptop I have fedora only and everything is working fine [18:18] Aikar: develop on the platform you intend to deploy on, and if your intending to deploy node on windows for anything serious, reconsider your plans lol [18:18] Aria has joined the channel [18:18] Lion2Leo: Yeah but once you host is there a windows based node host? [18:18] Lion2Leo: Or does it even matter? lol [18:19] Aikar: node is not stable for compiling on windows [18:19] dylanbeattie: doesn't matter. Right now I'm experimenting. :) [18:19] Aria has joined the channel [18:19] Aikar: dylanbeattie: and maybe fixing the 'I use windows for everything' should be the top priority task :P [18:19] Lion2Leo: Lol^ [18:19] Lion2Leo: I did some bash before jumping to unix so my transition wasn't too bad [18:20] Lion2Leo: I did get frustrated with drivers though [18:20] Aikar: node is designed to be its own http server. so running it beside IIS vs apache isnt really any diff [18:20] dylanbeattie: C'mon, guys. I'm a Javascript coder. I'm interested in your project. I'm curious. I've followed the instructions, they didn't work, the last thing they recommend is to try out the IRC channel. [18:20] dylanbeattie: If it's not stable / not supported, that's cool. And good to know. [18:21] Aikar: dylanbeattie: youd have to talk to the few people who actually work with node on windows, most people dont use windows :/ [18:21] Lion2Leo: Did you follow the windows guide? [18:21] dylanbeattie: Switching to Linux would be frikkin' awesome if I could do it 15 years ago. To do it right now would mean quitting my job. [18:21] Aikar: but we are trying to make your life easier by telling you to not bother lol [18:21] dylanbeattie: And I like my job :) [18:22] herbySk has joined the channel [18:22] tbranyen: dylanbeattie: tbqh i just recently installed via cygwin on a clean windows box [18:22] tbranyen: and it went flawless [18:22] tbranyen: so perhaps your cygwin is outdated [18:22] tbranyen: rebase your cygwin dlls [18:22] dylanbeattie: @tbranyen which version? [18:22] Aikar: im not saying switch your desktop OS, i msaying install Linux server into a VM and SSH into it from your windows machine [18:22] tbranyen: dylanbeattie: latest [18:22] tbranyen: 0.4.2 [18:22] Aikar: then just issue commands in putty [18:22] adamt: i found some binary releases for windows. didn't work at all. :P [18:22] dylanbeattie: Cool, OK [18:22] dylanbeattie: VirtualBox FTW, then :) [18:22] Aikar: although, I just switched to Linux from Windows as my desktop OS 1.5 months ago and trust me, if your a developer, its not hard and makes things so much more friendlier :) [18:22] tbranyen: dylanbeattie: http://vagrantup.com/ [18:22] tbranyen: ^^ check that out [18:23] dylanbeattie: My development platform is C#, Microsoft.NET and SQL Server. I've been using Linux on and off since RedHat 4... [18:23] joshholt has joined the channel [18:23] Aikar: well if your a .NET dev then yeah i guess your stuck [18:23] saikat has joined the channel [18:23] dylanbeattie: Not stuck, I just like it here :) [18:23] tbranyen: dylanbeattie: why???? [18:23] tbranyen: masochist [18:24] creationix has joined the channel [18:24] dylanbeattie: Maybe I'm wrong in the head - who knows... :) [18:24] dylanbeattie: anyway. [18:24] Aikar: im a web dev, so ssh = critical part of my job all day. so much friendlier to do on ubuntu than windows [18:24] Utkarsh_ has joined the channel [18:24] tbranyen: Aikar: i disagree, putty or mintty/openssh is [18:24] tbranyen: easy [18:24] dylanbeattie: Virtualbox for node.js it is. Thanks for your time, guys. [18:24] joshholt has joined the channel [18:24] dylanbeattie: I appreciate it. [18:25] tbranyen: i was doing open source dev with windows for a solid two months, till i bit the bullet and just went full reta--- linux [18:25] Aikar: tbranyen: doesnt help when the native windows apps are not designed around the ssh support of cygwin... ;) [18:25] tbranyen: ssh.exe works fine in cmd.exe :) [18:26] Aikar: yes but stuff like Tortoise is not using it :P [18:26] tbranyen: yeah that's a mess [18:26] Aikar: in linux apps know SSH is there so they all use it, not the same for windows [18:26] rhdoenges has joined the channel [18:26] Aikar: so you got every app implementing it differently [18:27] Utkarsh_ has joined the channel [18:27] tbranyen: point being i think cygwin is sufficient to develop open source, its just not optimal [18:27] Aikar: if i setup an .ssh/config alias to a server, it just works on all things in linux. setup an alias on cygwin, itll barely work on any app in windows that uses SSH [18:27] tbranyen: don't use the windows app then [18:27] tbranyen: isolate yourself to cygwin [18:27] Aikar: agreed, but you will go through alot of headaches trying to get things to work [18:27] Aikar: headaches you can avoid by simply running a VM [18:28] Aria: VM++. I run mine headless and then SSH into it. [18:29] tbranyen: are you the same person? nicks are too similar [18:29] Aikar: no lol [18:29] Aria: Hee. No. [18:29] Utkarsh_ has joined the channel [18:31] dguttman has joined the channel [18:31] adam_ has joined the channel [18:31] technoweenie has joined the channel [18:31] Utkarsh_ has joined the channel [18:31] mikegerwitz: cmd.exe is a complete joke, anyway [18:32] adamt: worst terminal-thingy ever. [18:32] brianc: just published new version of node-postgres (pg) to npm with native bindings to libpq. in my initial benchmarks this is a 2x performance boost. ymmv :) [18:33] doubletap has joined the channel [18:33] Adman65 has joined the channel [18:34] Utkarsh has joined the channel [18:35] brianc: 12:28 VM++. I run mine headless and then SSH into it. [18:35] brianc: whoops [18:35] brianc: copy/paste fail [18:35] halfhalo: lol [18:36] bartt has joined the channel [18:36] Utkarsh has joined the channel [18:38] onar has joined the channel [18:39] Utkarsh has joined the channel [18:39] broofa_ has joined the channel [18:40] eyesUnclouded has joined the channel [18:40] broofa_ has joined the channel [18:41] doubletap has left the channel [18:42] Xano has joined the channel [18:43] fangel has joined the channel [18:43] prof-freud has joined the channel [18:45] bingomanateeIpho has joined the channel [18:46] bingomanateeIpho: ACTION is rockin SxSW [18:46] Utkarsh has joined the channel [18:46] noahcampbell has joined the channel [18:47] Country has joined the channel [18:47] ximo has joined the channel [18:51] mraleph has joined the channel [18:53] pedrobelo has joined the channel [18:54] throughnothing has joined the channel [18:56] tilgovi has joined the channel [18:57] isaacs has joined the channel [18:57] NickP: tjholowaychuk: how dependent is stylus on node? Could it work in the browser? [18:58] tjholowaychuk: NickP: yeah it could [18:58] tjholowaychuk: it will get there, I removed a bunch of the accessors (which also happened to speed it up ~3x) [18:58] tjholowaychuk: but will help aid in the browser support as well [18:58] NickP: sweet [18:59] bx2 has joined the channel [19:00] isaacs: tjholowaychuk: hey, what is tobi? [19:00] isaacs: tjholowaychuk: and why is it gigantic? [19:00] tjholowaychuk: isaacs: it shouldnt be, i think we put the .npmignore in there [19:00] isaacs: hm... [19:00] tjholowaychuk: the first few might be huge [19:01] isaacs: could well be that the .npmignore is a little broken, too [19:01] isaacs: i rebuilt that all in npm 1.0. it's super slick now :) [19:01] isaacs: works exactly like git, same syntax, same logic. [19:01] tjholowaychuk: shit lol i had simple stuff in just to ignore the test/support/examples directories [19:01] tjholowaychuk: support was the bloated one due to node-jscoverage [19:02] isaacs: there were also some cases where if you listed things in certain ways, you'd end up with some files in the tarball more than once. [19:02] tjholowaychuk: hm [19:02] isaacs: { directories : { lib: "./lib", doc:"./lib"}, files:["lib"]} would include the "lib" folder 3 times [19:02] zpao_ has joined the channel [19:02] isaacs: which tar totally lets you do [19:02] tjholowaychuk: hahaha [19:02] tjholowaychuk: awesome [19:03] isaacs: yeah, the latest version of tobi is sma.. [19:03] isaacs: small [19:03] mikegerwitz: isaacs: heh, how does that extract? Or are they different paths in the tarball? [19:03] tjholowaychuk: feel free to remove the older big ones [19:03] isaacs: mikegerwitz: they're the same paths. [19:03] marcosvm has joined the channel [19:03] isaacs: mikegerwitz: it extracts one, then it extracts the second one. [19:03] mikegerwitz: isaacs: overtop the first? [19:04] isaacs: mikegerwitz: yeah, unless you tell it to only grab the first one, or whatever. [19:04] mikegerwitz: isaacs: haha, solid [19:04] isaacs: mikegerwitz: the tar *format* supports this because it's a Tape ARchive format. [19:04] bentruyman has joined the channel [19:04] isaacs: so it's sort of intended to allow you to copy the same file to an archive incrementally [19:04] mikegerwitz: isaacs: makes sense [19:05] isaacs: different versions of it or whatever. and it is dead-simple, so there's no index, no going back and forth, because with a tape, shifting the data around is super painful. [19:05] mikegerwitz: isaacs: Yeah it makes much more sense in that context. Sounds ridiculous for what we normally use tarballs for [19:05] isaacs: npm 1.0's approach just walks over the file tree once, checking each file/folder as it goes (and not diving into excluded folders) so the result is a lot more precise and efficient. [19:06] altamic has joined the channel [19:06] isaacs: and it was a good excuse to write a little glob parser, which is always fun :) [19:06] mikegerwitz: isaacs: absolutely :) those small things help to keep you sane [19:07] razvandimescu has joined the channel [19:07] mikegerwitz: ("you [19:07] mikegerwitz: being collective*) twitchy finger [19:08] froak_ has joined the channel [19:08] warz has joined the channel [19:09] Utkarsh has joined the channel [19:11] kriszyp has joined the channel [19:11] AAA_awright: Is there any shortcut to the master branch documentation? [19:11] isaacs: mikegerwitz: they are also what keep me personally sane :) [19:11] piscisaureus has joined the channel [19:11] isaacs: tjholowaychuk: any objection to removing tobi@<=0.0.7 from the registry? [19:11] tjholowaychuk: isaacs: nope go nuts [19:11] isaacs: awesome [19:12] dyer has joined the channel [19:12] piscisaureus: ACTION ola [19:14] tfe_ has joined the channel [19:15] dyer has joined the channel [19:15] creationix has left the channel [19:15] yyamano has joined the channel [19:17] timmywil_ has joined the channel [19:18] tfe_ has joined the channel [19:18] mikeal has joined the channel [19:19] vipaca has joined the channel [19:19] vipaca has joined the channel [19:19] tfe_ has joined the channel [19:22] mxp has joined the channel [19:22] mxp: is there a way to no how many people npm installed my package? [19:22] isaacs: nope. [19:23] mjr_: That'd be a fun stat. [19:23] isaacs: yeah, it would. [19:23] dragunov11 has joined the channel [19:23] isaacs: i'm kinda hoping someone else writes it for me :) [19:23] Lion2Leo: Newbie question: How do I in jade: div(id console) inside input(type text, id entry) [19:23] mxp: isaacs: how can i deteremine if my library is stable now ? I mean wat time should wait before declaring it stable? [19:24] isaacs: mxp: hahaha that's a great question! [19:24] tjholowaychuk: Lion2Leo: ? [19:24] tjholowaychuk: Lion2Leo: how do you nest it? [19:24] isaacs: mxp: i don't think time really is the indicator. [19:24] isaacs: mxp: why do you ask? [19:24] mxp: isaacs: I can really volunteer for writing that stat part and [19:24] tjholowaychuk: Lion2Leo: input#entry(type='text') [19:25] isaacs: mxp: http://github.com/isaacs/npmjs.org [19:25] mxp: isaacs: I want to decide if i should do some bug fixes if there are [19:25] springmeyer has joined the channel [19:25] isaacs: mxp: how's your couchdb skillz? [19:25] mxp: in my reston package [19:25] Lion2Leo: Ah so the id goes between parenthesis and input thanks [19:25] springmeyer has joined the channel [19:25] isaacs: mxp: i usually just list a place to report bugs, and then fix the bugs that get reported. [19:25] mxp: isaacs: worked before on couch should not be a problem [19:25] isaacs: users are great qa [19:25] tjholowaychuk: Lion2Leo: you can do foo.bar.baz#raz for ids/classes [19:25] tjholowaychuk: Lion2Leo: or foo(id: 'something') etc [19:25] isaacs: download stats are... tricky, though [19:26] mxp: isaacs: i know ;) [19:26] tjholowaychuk: isaacs: they are? [19:26] Lion2Leo: I had [19:26] Muon: tjholowaychuk: sessions aren't object-safe, right? as in methods and type aren't preserved? [19:26] Lion2Leo: Alright thanks. [19:26] isaacs: a) they're actually more challenging to gather than you'd think, for something like this, and b) they're a very reliable indicator of "installs" [19:26] mxp: but isaacs i've got watches on ma github for Reston [19:26] isaacs: i definitely am not ok with npm "phoning home" any time it installs stuff. [19:26] mxp: people used it [19:26] sridatta has joined the channel [19:26] tjholowaychuk: Muon: no they are not, well.. some MIGHT but it would be best practice to rely on JSON only [19:26] fly-away has joined the channel [19:26] isaacs: mxp: sure. [19:26] mxp: and i helped them solve problems as well on this same channel [19:27] mxp: but i cant see any bug reports [19:27] Lorentz: Maybe a local repository cloner of some kind, for people who deploy massively and often? [19:27] mxp: its been month an I am rolling towards new features so wat should I do? [19:27] sridatta: hey #node.js, I am trying to package my project for npm. what is the format for the dependency hash in the package.json file? [19:28] isaacs: mxp: the custom in node-land is: roll out the new features, try your best to cover them with tests, write tests when you fix bugs, and otherwise, just ride the edge. [19:28] isaacs: or at least, that's my custom :) [19:28] V1 has joined the channel [19:28] mxp: isaacs: lol nice lol [19:28] isaacs: software has bugs. it's not the end of the world. [19:28] mxp: isaacs: :P [19:28] mxp: any nosql fan here? [19:29] ncb000gt: mxp: i'm a fan of the right tool for the job [19:29] mxp: ncb000gt: lol clever :P [19:29] tilgovi has joined the channel [19:29] teemow has joined the channel [19:29] ncb000gt: but i do like things such as riak and couchdb for certain jobs [19:30] mxp: right redis fans here? [19:30] ncb000gt: redis is very good for some things too :) [19:30] isaacs: mxp: mjr_ wrote node-redis. [19:30] ncb000gt: using that here in production [19:30] V1: fans and users are 2 different things mxp ;) [19:30] zeqeiroz has joined the channel [19:30] isaacs: mxp: i use couchdb a lot [19:30] isaacs: likeit [19:30] ncb000gt: haha [19:30] ncb000gt: V1: very true [19:30] mjr_: We use couchdb and redis in production. [19:31] mjr_: Each have their own unique character. [19:31] mxp: so redis users how big ur production size is with redis and wats the persistence options that u used [19:31] mxp: ? [19:31] V1: I'm using Redis, MongoDB and HBase in production [19:31] wink_: i use mongo in production [19:31] isaacs: i think a lot of people over-estimate the cost of bugs in software. but, i mean, if you design for flexibility, then they're usually easy to fix, and if you use tests wisely, then you don't often fix the same bugs over and over again. [19:31] mxp: production size = user using db size transaction / dau [19:31] ncb000gt: V1: hbase hurts my brain [19:32] isaacs: "stable" just means "i haven't touched that in a long time" [19:32] ncb000gt: V1: trying to work with pig right now :) [19:32] ncb000gt: and it's making me want to punch kittens [19:32] V1: ncb000gt: hbase has it's pros and cons.. :p like any nosql db [19:32] ncb000gt: haha yes [19:32] ncb000gt: very much so [19:32] mxp: isaacs: thats exactly what i am thinking of how long should i wait to call it Stable? [19:32] isaacs: mxp: again, really depends on the program. [19:33] isaacs: mxp: node users have a very high tolerance for new software, i've found. [19:33] mxp: isaacs: u have seen Reston right? [19:33] isaacs: no, is it like resty? [19:33] ncb000gt: mxp: o.0 Reston is the city i'm in right now [19:33] jennings has joined the channel [19:33] Draggor: bradleymeck: SubStack: I tried running test/big.js on the original bigint lib, and got test failures. Is this a known thing? [19:34] mxp: https://github.com/maxpert/Reston [19:34] mxp: ncb000gt: lol ya [19:34] mxp: isaacs: https://github.com/maxpert/Reston [19:34] isaacs: neat [19:34] isaacs: you should make the Reston object match the Stream api. [19:35] isaacs: maybe even inherit from it. [19:35] MikhX has joined the channel [19:35] isaacs: it'd be rad to do {... blah blah blah set up request etc add files blah blah } Reston.pipe(fs.createWriteStream("response.txt")) or something [19:35] mxp: isaacs: I am looking forward for such API changes but question always is should i make current stable and move on or wat? [19:35] isaacs: meh. release early, release often. [19:36] isaacs: stability is a design choice, not somethign that happens at some point in the future. [19:36] Sembiance: hrm, I think my idea 'early' is much later than yours [19:36] mxp: so nodejs community is API change agnostic or wat? [19:36] wink_: no one likes it, but we're pretty forgiving as a whole i'd think [19:36] isaacs: i often release new versions of npm when i'm the only who has ever used them. [19:36] ncb000gt: isaacs: i don't exactly agree with that, stability is when you feel comfortable that your stuff wont break with your existing code [19:37] ncb000gt: that's not really a design choice [19:37] isaacs: well, there's stability, and then there's backwards-compatibility, which is one specific sort of stability that you may or may not care about. [19:37] Sembiance: oh, I was talking about website releases. first impressions and all that. libraries/geek apps are different :) [19:37] ncb000gt: mxp: ryah has set a nice precedent of changing apis (when are promises coming back?) and the node community has adapted well to it [19:38] lolninja has joined the channel [19:38] mxp: lol ncb000gt all developers are not like us and if we want to grow huge i think its something worth pondering [19:39] mxp: otherwise we would be considered the same ruby monkeys [19:39] isaacs: npm 1.0 is about a week or two from being what i'd call stable, but backwards compatibility is not an option. [19:39] isaacs: (in many ways) [19:40] guillermo has joined the channel [19:41] MrTopf has joined the channel [19:41] gozala has joined the channel [19:41] FMJag has joined the channel [19:43] aabt has joined the channel [19:43] jpick has joined the channel [19:44] alek_br has joined the channel [19:44] Evet has joined the channel [19:44] Evet has joined the channel [19:45] eaton has joined the channel [19:45] losing has joined the channel [19:46] eyesUnclouded has joined the channel [19:47] ncb000gt: isaacs: ahh yes you're right, in terms of api stability, that is more about design, i was thinking more towards product stability :) [19:47] nciagra has joined the channel [19:48] isaacs: right, the "internal consistency" sort of stability [19:48] isaacs: "does this thing accurately do what it says it does?" [19:48] yyamano has joined the channel [19:49] isaacs: then there's also the "correct approach" sort of stability. "Does this program do the right thing in the right way?" [19:49] isaacs: that's the hardest one to get right, and you usually can only get it right once you've gotten it wrong a few times, in my experience. [19:49] ncb000gt: mxp: agreed. it can cause issues, but it's it's also nice to be working with something that adapts fast to the needs of the community [19:49] ncb000gt: isaacs: absolutely [19:52] doki_pen: I'm doing a try { JSON.parse(text) } catch(e) { //do something} but it seems that that doesn't catch the SyntaxError exception [19:52] doki_pen: any tips? [19:53] colinclark has joined the channel [19:53] isaacs: v8: try { JSON.parse("asdfh93ha") } catch (e) { e } [19:53] v8bot: isaacs: {stack:"SyntaxError: Unexpected token ILLEGAL\n at Object.parse (native)\n at eval at (evalmachine.:26:5)\n at evalmachine.:26:9\n at evalmachine.:30:2\n at Socket.run (/home/inimino/v8bot/lib/sandbox/shovel.js:76:19)\n at Socket.emit (events.js:39:17)\n at Socket._onReadable (net.js:629:51)\n at IOWatcher.onReadable [as callback [Output truncated...] [19:53] isaacs: $ node -e 'try { JSON.parse("asdfh93ha") } catch (e) { e.message }' [19:53] isaacs: Unexpected token ILLEGAL [19:54] isaacs: doki_pen: you sure the syntax error is in the JSON and not in your code? [19:54] mscdex: well, now we know who runs the bot [19:54] mscdex: :p [19:54] mxp: is it a wise idea to put a node server behind nginx [19:54] mxp: ? [19:54] isaacs: v8: new Error().stack [19:54] v8bot: isaacs: "Error\n at eval at (evalmachine.:26:5)\n at evalmachine.:26:9\n at evalmachine.:30:2\n at Socket.run (/home/inimino/v8bot/lib/sandbox/shovel.js:76:19)\n at Socket.emit (events.js:39:17)\n at Socket._onReadable (net.js:629:51)\n at IOWatcher.onReadable [as callback] (net.js:156:10)" [19:54] insin: try { ... } catch (e) { ... } reallyCatch (e) { ... } noSeriously (e) { ... } [19:54] ncb000gt: mxp: better nginx than apache [19:54] ncb000gt: :) [19:55] isaacs: not if you want to do any sort of streaming [19:55] isaacs: nginx is a brilliantly optimized file server. but that's about it [19:55] doki_pen: here is output : events.js:23 - throw arguments[1]; // Unhandled 'error' event - SyntaxError: Unexpected token ILLEGAL [19:55] mxp: lol using it for file upload [19:55] isaacs: the other stuff it does, it doesn't do nearly as well. [19:55] isaacs: in particular, it does not stream http 1.1 through proxy_pas [19:55] isaacs: proxy_pass [19:55] mxp: so chucked upload streams to nodejs via nginx [19:55] mxp: isaacs: exactly [19:55] isaacs: so if you put it in front of node, forget about websockets or streaming etc [19:56] mscdex: anything you put in front of node you can forget about websockets [19:56] mscdex: :) [19:56] doki_pen: isaacs: if text is valid, it doesn't happen [19:56] mxp: isaacs: right [19:56] mscdex: until browsers and clients start implementing recent versions of the websocket spec [19:56] mxp: isaacs: lighttpd? [19:56] isaacs: doki_pen: english sucks. gist code. [19:56] doki_pen: haha [19:56] isaacs: mxp: i dunno how lighttpd does as a proxy for streaming and whatnot. [19:56] isaacs: never used it. [19:56] isaacs: as a file server, nginx is way leaner. [19:57] mxp: but nginx does the uploading with multiparts with proxies? [19:57] mxp: right [19:57] mikegerwitz: isaacs: what do you suggest if a proxy is a requirement? [19:57] isaacs: get a dedicated web proxy [19:57] isaacs: squid is pretty nice [19:58] isaacs: i've also heard good and bad things about HAProxy and varnish [19:58] isaacs: but never used either [19:58] ncb000gt: varnish is nice [19:58] brapse has joined the channel [19:59] lolninja: does anyone know if https://github.com/kof/node-qunit works with v0.4.2? I've been trying to get it working but it keeps erroring, example at http://pastebin.com/qPGfxAxz [19:59] hoodoos: nginx is incredibly good at config files.. [19:59] adamt: isn't squid like so last millenium? [19:59] dguttman has joined the channel [19:59] doki_pen: isaacs: ok, I'm trying to refactor the embedly-node library to use emitters, here is where it fails: https://github.com/embedly/embedly-node/blob/emitters/lib/embedly.js#L326 [20:00] mjr_: Yeah, I sort of forgot that squid was still a thing. [20:00] doki_pen: isaacs: pay no attention to the comments about the methods, since I'm changing the way the api works and haven't updated yet [20:00] isaacs: mjr_: i use it to test proxy requests in npm. [20:00] isaacs: mjr_: it was *alarmingly* easy to set up [20:00] ncb000gt: doki_pen: you forgot your semi-colons... [20:00] ncb000gt: ACTION ducks [20:00] mjr_: I've used squid quite a lot in days gone by. [20:00] doki_pen: isaacs: this test fails: https://github.com/embedly/embedly-node/blob/master/test/objectify-test.js [20:01] doki_pen: ncb000gt: ah, no wonder! [20:01] ngs has joined the channel [20:01] isaacs: doki_pen: well, you're emitting an "error" event, which throws if it's not handled. [20:01] isaacs: so that could be it :) [20:01] void_ has joined the channel [20:01] MrTopf has joined the channel [20:02] doki_pen: isaacs: wrong version : https://github.com/embedly/embedly-node/blob/emitters/test/objectify-test.js [20:02] doki_pen: isaacs: ah!!! [20:02] doki_pen: isaacs: thank you, I was being retarded [20:02] isaacs: np :) [20:02] doki_pen: isaacs: lol, I hate when I'm that stupid [20:02] yozgrahame has joined the channel [20:03] ncb000gt: doki_pen: hmmm embed.ly. i hadn't seen this service before [20:03] ncb000gt: this is pretty damn useful [20:03] ncb000gt: doki_pen: i was in the process of reimplementing something similar to this for a forum i was writing, might just have to use this instead [20:03] astrolin has joined the channel [20:04] doki_pen: ncb000gt: http://bitdrift.com/post/3553420066/dont-try-this-at-home-just-get-embedly [20:04] losing has joined the channel [20:04] doki_pen: ncb000gt: yeah, free service is pretty awesome, although I'd love it if you paid ;-) [20:05] ncb000gt: haha [20:05] doki_pen: ncb000gt: if you need any help, feel free to ping me [20:05] ncb000gt: the forum would be free so unless i had donations coming in, i'd likely stick to the free stuff [20:05] doki_pen: ncb000gt: yeah, I figured that, but it's still nice to see it in the wild [20:05] ncb000gt: but yes, it's funny, i was writing the code and thinking, there has to be something that takes care of all this crap for you... [20:06] ncb000gt: and voila! [20:06] doki_pen: I've been loving node though, I picked it up for this lib and now I'm using it for a few sites [20:07] atmos has joined the channel [20:07] ncb000gt: sweet :) [20:07] doki_pen: http://explore.embed.ly/ is node [20:07] atmos: anyone know where stuff like (150).seconds came from in old express apps ? [20:07] ncb000gt: oh no, you're a gentoo guy? [20:07] atmos: or was that coming from some other library and i had no clue? [20:07] isaacs: npm registry down... just a second... [20:07] ncb000gt: heh how is gentoo these days? [20:07] doki_pen: ncb000gt: me, yeah. I'm using funtoo now [20:07] isaacs: and we're back [20:08] doki_pen: ncb000gt: still love it. We use ubuntu in production, and it makes me miss gentoo [20:08] ncb000gt: doki_pen: i stopped using gentoo after college, switched to ubuntu [20:08] ncb000gt: :) [20:08] doki_pen: ncb000gt: I guess it's for people who like to endlessly turn dials [20:08] doki_pen: ACTION likes to turn dials [20:09] ncb000gt: doki_pen: I don't mind turning dials, but I don't want it to be a requirement [20:09] mikegerwitz: How can you not have a place in your heart for Gentoo [20:09] mrinner has joined the channel [20:09] ncb000gt: I have a place there [20:09] mikegerwitz: :) [20:09] ncb000gt: it's next to the part that is owned by hell [20:09] ncb000gt: <.< [20:09] mikegerwitz: ncb000gt: heh [20:10] mikegerwitz: Gentoo is still by far my favorite distro. I just lack the time : / [20:10] doki_pen: things I love: many versions of packages available and dead simple to create ebuilds [20:10] q_no has joined the channel [20:10] ncb000gt: ebuilds are very nice, emerge and portage are great [20:10] doki_pen: I'm using chef for deployments, ubunut makes that much simpler [20:10] ncb000gt: i will give that to the gentoo folks [20:10] saschagehlich_: did anyone ever have the problem that socket.io websocket connections get closed without any error message? [20:11] V1: On the client on or on the server side saschagehlich_ [20:11] saschagehlich_: on the client the disconnect event gets fired, on the server I get "Client xxxx disconnected" [20:12] V1: Are you running through a proxy? [20:12] saschagehlich_: Nope [20:12] jashkenas has joined the channel [20:13] arthabaska has joined the channel [20:13] zemanel has joined the channel [20:13] vipaca has joined the channel [20:13] vipaca has joined the channel [20:14] sonnym has joined the channel [20:14] mjr_ has joined the channel [20:14] adamt: (btw. is it recommended to host node apps behind a proxy?) [20:14] V1: on the client you can add .on('error',function(){}) listener, does it emit anything? And did you make any modifications to the heatbeatInterval or timeout options? [20:15] mjr_: adamt: many people recommend that. I like opening node up to the world. [20:15] brianc: adamt: most proxies do not support web sockets protocol [20:15] maritz has joined the channel [20:15] brianc: adamt: if you need web sockets you pretty much can't put it behind a proxy [20:16] mjr_: Which sadly makes ws a lot less useful. [20:16] V1: adamt: it really depends on the type of application you are building [20:16] brianc: isaacs: ever considered extracting the npm logger as a stand alone package? [20:16] V1: there isn't really a "general" advice that can be applied to all node deployments [20:16] isaacs: brianc: yeah [20:16] maritz: so... i'm stupid. what could cause my object instances to share the same this? [20:16] isaacs: brianc: hij1nx is working on splitting out the config [20:16] brianc: isaacs: lovely! [20:17] isaacs: brianc: the logger would be nice, too. and in npm 1.0, it's *very very quiet*, but writes everything to ./npm-debug.log on failure. [20:17] tjholowaychuk: isaacs: yay [20:17] saschagehlich_: V1: I'll implement the error event and try to reproduce that (this issue doesn't come up often). no, I didn't change the heartbeat/interval options [20:17] adamt: thx for the answers. [20:17] Muon: tjholowaychuk: that screws me up... a lot. [20:17] tjholowaychuk: Muon: what does? [20:17] Muon: tjholowaychuk: scroll up a few screens [20:17] kmwallio has joined the channel [20:18] V1: saschagehlich_: if the issue persists you can post it to the socket.io google group :) http://groups.google.com/group/socket_io [20:18] Muon: tjholowaychuk: sessions aren't object-safe, right? as in methods and type aren't preserved? [20:18] tjholowaychuk: Muon: why would you expect them to be preserved lol [20:18] tjholowaychuk: redis cant store js objects [20:18] tjholowaychuk: neither can most stores [20:19] tjholowaychuk: memory store WAS an exception [20:19] Muon: I'm using MemoryStore [20:19] tjholowaychuk: but that was stupid [20:19] paulrobinson has joined the channel [20:19] tjholowaychuk: dont lol [20:19] doubletap has joined the channel [20:19] tjholowaychuk: this is why I changed it to use JSON, because people were relying on it [20:19] dragunov11 has joined the channel [20:19] zachsmith has joined the channel [20:19] atmos: tjholowaychuk: is there an easy way to set a global before filter in express 2.0 ? [20:19] Muon: now what? [20:19] maushu has joined the channel [20:19] atmos: i basically wanna protect all actions [20:20] tjholowaychuk: Muon: just dont rely on the state of a single process [20:20] tjholowaychuk: thats really bad practice [20:20] Muon: sure, but it means I can't use a certain specific library [20:20] tjholowaychuk: atmos: you can just use middleware and place it before app.use(app.router), or app.get('*') or app.all('*') placed whereever [20:20] colinsullivan has joined the channel [20:20] tjholowaychuk: should do the trick [20:21] atmos: hmm, ok [20:21] atmos: i'll playw ith it some, thanks [20:21] Muon: since I'm keeping my tokens in sessions for caching's sake [20:21] atmos: and i just call next if it passes ? [20:21] tjholowaychuk: there isnt really a "before filter", it's just a route placed before the others that calls next [20:21] tjholowaychuk: yup [20:21] Muon: tjholowaychuk: actually [20:21] tjholowaychuk: or next(err) if you are doing some kind of validation [20:21] Muon: tjholowaychuk: this one is only important during 2 subsequent requests [20:22] Muon: *certain consecutive [20:22] saschagehlich_: V1: does the error event give any arguments to the callback? [20:22] Muon: hrm [20:22] V1: Yup, the error [20:22] Muon: maybe, just maybe... [20:22] aabt has joined the channel [20:22] saschagehlich_: an Error object or a string? [20:23] Lion2Leo: Hey, does socket.io propose more properties from the client object, such as ms or ip? [20:23] adamt: using express and sass, do i need to do anything after editing my sass-files? [20:23] V1: saschagehlich_: It's an error object, the 'error' event receives the error object from the onerror method of the WebSocket. [20:23] maritz: heeeeelp: https://gist.github.com/866502 what would usually cause this? [20:24] deauxbie1gillis has joined the channel [20:24] V1: But the onerror event i'm talking about is on the client side, not in socket.io-node [20:24] tjholowaychuk: adamt: if you have the compiler() middleware it should just work [20:24] adamt: oh nvm syntax-error on my part. [20:24] tjholowaychuk: adamt: my sass.js sucks though, check out stylus http://learnboost.github.com/stylus/ [20:24] V1: Lion2Leo: You can access the ip through the client object [20:25] adamt: but but but :( [20:25] tjholowaychuk: adamt: its wayyyyy better [20:25] Lion2Leo: V1: Alright, but the boost doc only displays a few properties [20:25] adamt: oh yeah it does look neat. [20:26] adamt: thx, dude with the weird name. ;) [20:26] mrinner has left the channel [20:26] tjholowaychuk: adamt: haha it's just tj [20:26] V1: Lion2Leo: The documentation only states the "public" properties :) [20:26] ngs has joined the channel [20:26] tjholowaychuk: adamt: I wrote stylus and sass [20:26] Lion2Leo: V1: Indeed, but then where are the private ones... and are getters avail? [20:26] adamt: i know you did :) [20:27] mrinner has joined the channel [20:27] V1: Lion2Leo: It's probably best to checkout the client source code to see what's all available https://github.com/LearnBoost/Socket.IO-node/blob/master/lib/socket.io/client.js. Better documentation is coming ;) [20:27] alek_br has joined the channel [20:28] jimt has joined the channel [20:28] Lion2Leo: V1: I knew you would say that... haha [20:28] V1: Lion2Leo: I already converted the whole client library to JSDocs ;) [20:30] eschnou has joined the channel [20:30] paulrobinson has left the channel [20:31] dwww has joined the channel [20:31] mrinner has left the channel [20:31] tjholowaychuk has joined the channel [20:33] maritz: can someone help me with this abstract problem: https://gist.github.com/866502 what would usually cause this? [20:33] broofa has joined the channel [20:34] bx2 has joined the channel [20:34] reid has joined the channel [20:34] pifantastic has joined the channel [20:34] jamesarosen has joined the channel [20:35] mikegerwitz: maritz: Whatever p() is doing is either setting the value on the prototype or sharing a value somewhere else [20:36] atmos: anyone used connect-auth with express 2 ? [20:36] maritz: mikegerwitz: it's really just doing this.properties[name].value = newValue; (and some checks that don't have any sideeffects) [20:38] maritz: i think i still haven't understood the stupid prototype inheritance [20:38] atmos: yeah, it looks like it from that example [20:39] mikegerwitz: maritz: if you had a method, testModel1.prototype.p( name, value ) = function() { this.properties[ name ] = value; }, it should work [20:39] mikegerwitz: maritz: something odd's going on that we cannot see from that example :) [20:39] astropirate has joined the channel [20:39] yyamano has joined the channel [20:39] mikegerwitz: erm [20:39] mikegerwitz: .p = function( name, value )*, rather [20:39] maritz: mikegerwitz: yeah, it's a little complicated... i'm trying to un-complicate it right now to find the problem. [20:40] maritz: testmodel itself does not have the p method but gets it from another object through the prototype chain [20:40] alek_br has joined the channel [20:40] V1: tjholowaychuk: Is there an easy way to allow dox to parse @constructor? It shows it @constructo: r [20:40] teemow has joined the channel [20:40] tjholowaychuk: V1: oh weird [20:40] mikegerwitz: maritz: 'this' should still be bound to the instance, as long as it's part of the prototype chain. Unless you're doing .call(), or .apply(). In which case make sure you pass in the correct context [20:41] tjholowaychuk: V1: probably a quick fix, I havent used @constructor [20:41] maritz: mikegerwitz: no .call() or .apply() [20:41] V1: tjholowaychuk: Same counts for @static basically everything that isn't followed by a description [20:41] mikegerwitz: maritz: unfortunately, without seeing the code, there's not much I can say [20:41] tjholowaychuk: V1: ah ok that makes more sense [20:42] maritz: i had this problem previously and wrote a unit test for it and fixed it. now i'm completely refactoring it and get this issue again :( [20:42] maritz: mikegerwitz: yeah. thanks anyways. i'll probably ask again later. [20:42] broofa has joined the channel [20:43] hosh_work has joined the channel [20:43] Lion2Leo: V1: Had a rapid look at the source and I've only found sessionId >.> [20:44] V1: which source are you looking at Lion2Leo [20:44] Lion2Leo: V1: The link you provided me earlier client.js [20:44] Draggor: bradleymeck: SubStack: I now have all the tests in test/big.js passing [20:45] doki_pen: node-syslog is full of fail, does anyone have any suggestions for a lightweight logging lib? [20:45] V1: Oh on line 68 you see that this.connect is added with a references to the current "request.connection" you can use this to read out the remoteAddr [20:45] tjholowaychuk: doki_pen: visionmedia/log.js [20:45] doki_pen: tjholowaychuk: ty [20:45] Lion2Leo: V1: Thanks my lord [20:46] V1: so you can basically do client.connection.remoteAddress and connection.remotePort etc [20:46] yyamano has joined the channel [20:47] tilgovi has joined the channel [20:47] Lion2Leo: Grrreat [20:51] MrTopf has joined the channel [20:52] wadey has joined the channel [20:52] jimt_ has joined the channel [20:52] admc has joined the channel [20:53] adamt: tjholowaychuk: does stylus have an alternative to "a \n :foo bar \n &:hover .."-notation? [20:53] tjholowaychuk: adamt: "a\n foo bar\n &:hover ..." [20:53] tjholowaychuk: adamt: or foo: bar, or foo: bar; its all optional [20:54] adamt: okay, thx. [20:54] tilgovi has joined the channel [20:54] arpegius has joined the channel [20:55] adamt: okay, this is either way too easy to use (and possible forgiving) or i got really lucky getting it to work first try. hmm. [20:56] tjholowaychuk: haha [20:57] johans_ has joined the channel [20:57] TomY has joined the channel [20:57] saschagehlich_: V1: Hm I can't reproduce the bug now... when exactly is the client-side disconnect event emitted on websocket connections? [20:58] ph^ has joined the channel [20:58] saschagehlich_: I suppose it's emitted twice and that's the reason why some "clients disconnect" too early [20:58] V1: When there's no heartbeat [20:58] atmos has joined the channel [20:59] saschagehlich_: (my users are redirected to an error page if the disconnect event is emitted) [20:59] TomY_ has joined the channel [20:59] johans_: npm installing jade@0.8.5 gives ERR!... tar: unexpected EOF in archive - all other packages install fine any suggestions? [21:00] isaacs: johans_: `npm cache clean` might make it work. or you could do this: npm view jade dist.tarball | xargs curl > jade.tgz; npm install ./jade.tgz [21:00] V1: saschagehlich_: I wouldn't really do that, as the new version of Socket.IO-client will have build in reconnection support, so a disconnect event is emitted socket.io will automatically try to restore a connection [21:00] johans_: installing jade@0.6.3 works fine but nothing newer [21:00] isaacs: oic [21:00] johans_: will try that [21:00] saschagehlich_: V1: so what is the better solution for telling users the remote server hung up? [21:01] V1: saschagehlich_: Maybe the connection_failed event [21:01] zachsmith has joined the channel [21:01] kriszyp has joined the channel [21:01] saschagehlich_: V1: never heard of that one [21:01] zachsmith_ has joined the channel [21:02] V1: what version of socket.io are you running? [21:02] themiddleman_itv has joined the channel [21:02] saschagehlich_: I'm on the master branch [21:03] V1: thats 0.6.16 with client 0.6.2, anyways the connection_failed event is documented here: https://github.com/learnboost/socket.io [21:04] losing has joined the channel [21:05] alek_br has joined the channel [21:05] mlncn has joined the channel [21:06] saschagehlich_: V1: okay, I'll try that one. thanks a lot! [21:07] jimt has joined the channel [21:08] johans_: isaacs: many thanks second option using curl worked [21:09] timmywil has joined the channel [21:10] Utkarsh_ has joined the channel [21:10] ryah: example of suck https://github.com/joelthelion/autojump [21:10] ryah: good idea - bad programmer [21:11] zzak: no way bro [21:11] zzak: he's part lion.. [21:11] Muon: pull request sent [21:12] Muon: I hope he checks his github/email/whatever [21:12] tjholowaychuk: i use https://github.com/rupa/z [21:12] tjholowaychuk: seems fine [21:12] Muon: patch ain't polished but it will do the trick [21:12] zzak: that is a pretty ugly readme tho [21:12] frodenius: kind of useless, just use ctrl-r [21:12] Muon: ryah: thanks for motivating me to think further about porting that lib to 0.4 [21:13] fk1blow has joined the channel [21:13] zzak: ACTION prefers ctrl+z [21:13] Muon: OAuth isn't that scary :P [21:15] fk1blow: hey guys. Can someone tell me if node could do something like __autoload from php? [21:15] frodenius: fk1blow: no [21:15] insin: ACTION resets his PHP alarm [21:15] fk1blow: :D [21:16] isaacs: fk1blow: nope. [21:16] isaacs: ACTION misses __autoload [21:16] isaacs: even if it is candy that causes diabetes and tooth decay. [21:16] ryah: tjholowaychuk: looks much better [21:16] fk1blow: so if i need to require a bunch of files i'll just have to require them [21:17] reid has joined the channel [21:17] jimt has joined the channel [21:17] fk1blow has left the channel [21:18] dylang has joined the channel [21:18] ryah: annoying, invokes anger: https://github.com/joelthelion/autojump. pleasant, and invokes happiness: https://github.com/rupa/z [21:18] isaacs: i have a little php script i wrote that keeps a history but doens't do any of that fancy learning/jumplist business, and hten just a CDPATH [21:18] bbguitar has joined the channel [21:19] jelveh has joined the channel [21:19] isaacs: but it lets me do "cd -" to go back, and hten "cd _" to go forward [21:19] isaacs: instead of cd - just being a hop back-and-forth kinda thing [21:19] ryah: people who write little script should remember that they are being judged [21:19] isaacs: yeah, godir isn't pretty, but it's a hell of a lot simpler than j or z [21:20] isaacs: and, of course, requires php, but meh. whatever. [21:20] adamt: at least he documented some of his unreadable non-pythonic code, that autojump dude. [21:21] saikat has joined the channel [21:22] ryah: isaacs: just don't distribute it [21:22] ryah: :) [21:23] ryah: autojump dude spamed the internet with so much i couldn't find z [21:24] isaacs: ryah: yeah [21:24] losing has joined the channel [21:25] isaacs: if i ever do distribute it, ti'll probably just be a thing in my dotfiles repo [21:25] Spion__ has joined the channel [21:25] isaacs: autojump is python? [21:25] isaacs: i thought it was written in GPL? [21:25] insin: he used the clever SEO hack of using words to name his project [21:26] insin: ACTION shakes his fist [21:26] insin: that z-burying bastard [21:28] sub_pop has joined the channel [21:29] possibilities has joined the channel [21:30] jimt has joined the channel [21:33] korbatz has joined the channel [21:35] jimt_ has joined the channel [21:36] ocirs has joined the channel [21:36] brianc: lol [21:36] Ori_P has joined the channel [21:36] tomb_ has joined the channel [21:37] lolninja has left the channel [21:37] bmavity has joined the channel [21:38] pcardune_ has joined the channel [21:39] Bonuspunkt has joined the channel [21:42] _npm_ has left the channel [21:42] breccan has joined the channel [21:42] mattikus has joined the channel [21:42] Hello71 has joined the channel [21:42] Hello71 has joined the channel [21:43] MattJ has joined the channel [21:43] Dantas has joined the channel [21:44] Croms has joined the channel [21:45] doubletap has left the channel [21:45] jimt has joined the channel [21:45] Evet_ has joined the channel [21:46] cloudhead has joined the channel [21:46] Lion2Leo has joined the channel [21:46] Draggor: Hmm, having issues building a c++ module on cygwin now, it can't find my v8.h, node.h, and node_events.h [21:47] Connorhd has joined the channel [21:47] blueadept has left the channel [21:47] aklt has joined the channel [21:49] romainhuet_ has joined the channel [21:50] eaton has joined the channel [21:50] langworthy has joined the channel [21:51] unlink has joined the channel [21:51] unlink has joined the channel [21:52] pascalopitz has joined the channel [21:54] pHcF has joined the channel [21:55] losing has joined the channel [21:55] jimt has joined the channel [21:56] kiddphunk has left the channel [21:57] EyePulp has joined the channel [21:57] yyamano has joined the channel [21:57] doubletap has joined the channel [21:58] McMAGIC-- has joined the channel [21:58] doubletap has left the channel [21:59] bentruyman has joined the channel [22:01] hornairs has joined the channel [22:05] davida has joined the channel [22:05] stagas has joined the channel [22:05] sridatta has left the channel [22:05] forest has joined the channel [22:07] springmeyer has left the channel [22:08] prof-freud has joined the channel [22:11] possibilities has joined the channel [22:14] onar_ has joined the channel [22:15] matschaffer1 has joined the channel [22:18] eaton has joined the channel [22:19] eaton has joined the channel [22:22] Horofox has joined the channel [22:22] malkomalko has joined the channel [22:22] FMJag has joined the channel [22:23] BillyBreen has joined the channel [22:23] possibil_ has joined the channel [22:23] malkomalko: schwing [22:23] Horofox: does anybody know a good tutorial to begin learning express and some nosql db? i've been a month into node and couldn't do anything yet. [22:24] malkomalko: Horofox: dailyjs.com has a good series [22:25] ParadoxQuine has joined the channel [22:25] losing has joined the channel [22:25] jamesarosen has joined the channel [22:26] tjholowaychuk: Horofox: the examples in the repo should help [22:26] tjholowaychuk: and they are always up to date at least [22:26] TomY has joined the channel [22:26] TomY_ has joined the channel [22:27] malkomalko: http://dailyjs.com/2011/02/28/node-tutorial-15/ [22:28] jimt_ has joined the channel [22:30] estrathmeyer has left the channel [22:31] CodenameKT has joined the channel [22:32] heda has joined the channel [22:32] heda has left the channel [22:32] heda has joined the channel [22:32] liquidproof has joined the channel [22:33] ximo has joined the channel [22:33] dgathright has joined the channel [22:33] heda: hi all, was wondering if there was any way to test express.js apps with vows? i.e in terms of mimicking requests to the server, etc [22:34] Horofox has joined the channel [22:34] malkomalko: heda: for functional testing, why not use something like tobi or zombie.js? [22:35] heda: malkomalko: that might work, i guess i'd need to start up a server manually, etc? [22:35] Lion2Leo: Anyone know how I could access the ip and latency from a socket.io client object? [22:36] malkomalko: well, either you can point it at your app object in the case of tobi, or just point it to your localhost:port [22:36] malkomalko: and if you wanted to, you could spin up a server on a different port in the NODE_ENV=test, and then set some different databases for use in your testing env [22:36] malkomalko: there's lots of things you could do [22:36] heda: malkomalko: fair point and a good idea [22:37] sub_pop has joined the channel [22:37] heda: malkomalko: never heard of tobi, only discovered zombie today...new to node in general [22:37] malkomalko: they are very similar, depends on the api you like, I know I was having some problems with tobi recently with express 2.0.x but I'm not sure if that was finished [22:38] malkomalko: node is awesome, I hope you enjoy the stay [22:38] cloudhead: heda: express might have mock-requests, or at least it should [22:38] tjholowaychuk: malkomalko: I havent tried it with 2.x yet [22:38] tjholowaychuk: cloudhead: pff, never! [22:38] tjholowaychuk: I dont mock anything [22:38] cloudhead: tjholowaychuk: : | [22:38] malkomalko: tjholowaychuk: there are some issues that document the problem, something with the cookie.sid or something [22:38] tjholowaychuk: and its not overly easy yo mock node's requests right now [22:39] tjholowaychuk: mocking is lame and error prone anyway [22:39] heda: malkomalko: thanks a million [22:39] malkomalko: I tried mocking out being logged in, then gave up, because I couldn't get at the req object, and then just decided to go functional testing [22:39] malkomalko: node is fast enough where mocking may be semi pointless in a lot of cases [22:39] malkomalko: no prob heda [22:40] tjholowaychuk: yeah if you run your tests parallel its not a huge deal [22:41] bentruyman has joined the channel [22:42] jacobolus has joined the channel [22:42] Wizek has joined the channel [22:42] heda: zombie might be the best idea for me as I come from a .net and rails background and i like cucumber [22:42] atiti has joined the channel [22:44] malkomalko: I'm actually planning on building out cucumber for node.js [22:44] sechrist has joined the channel [22:44] malkomalko: I don't think it exists right now [22:44] tjholowaychuk: yuck [22:44] malkomalko: shaddup [22:44] malkomalko: lol [22:45] heda: tjholowaychuk: you don't like cucumber? [22:45] tjholowaychuk: not at all no, but I dont really work with clients I guess [22:45] malkomalko: he's much rather write documentation [22:45] malkomalko: he'd [22:45] tjholowaychuk: that stuff is pretty overrated IMO [22:45] heda: tjholowaychuk: yep, was going to say you must never work with clients [22:45] colinsullivan has joined the channel [22:45] heda: tjholowaychuk: the idea of readable stories is superb [22:46] tjholowaychuk: meh [22:46] cloudhead: malkomalko: there's https://github.com/nodejitsu/kyuri [22:46] cloudhead: could be a start [22:46] ntr0py_ has joined the channel [22:46] malkomalko: yah I saw that, but it just generates nested vows stubs I think [22:46] heda: tjholowaychuk: creates a line of traceability the whole way from iteration start to product delivery [22:46] cloudhead: malkomalko: yea but it has the parser [22:46] malkomalko: truth, I could just steal it :) [22:47] Draggor: Can someone here try doing a pull and building this on cygwin? https://github.com/draggor/node-bigint [22:47] malkomalko: I don't think it'd be hard to take the parsers, and just have it look into a steps directory [22:47] cloudhead: ya [22:47] yibter has joined the channel [22:47] malkomalko: build up some callback chain or something maybe for each scenario [22:47] richcollins has joined the channel [22:48] cloudhead: cucumber is great when you have good step definitions [22:48] cloudhead: the problem is writing those step definitions [22:48] heda: malkomalko: yeah it would be superb to have a command line app like vows to run feature files [22:48] heda: cloudhead: i don't find the step definitions to be the problem [22:48] malkomalko: yah, but you could build up a good set that you re-use very quickly [22:48] cloudhead: for sure [22:49] cloudhead: it's a lot of upfront work [22:49] malkomalko: just wrap up a basic set of tobi/zombie steps by default [22:49] saschagehlich has joined the channel [22:49] malkomalko: just like web_steps [22:49] cloudhead: but then it makes things really fast [22:49] Nevtus has joined the channel [22:49] Nevtus has joined the channel [22:49] malkomalko: I'd want to release it with those default web_steps included [22:49] heda: cloudhead: but you only need a few steps really for most data entry apps [22:49] malkomalko: giving you the option to pick either tobi/zombie [22:49] malkomalko: oh well, let's see if I have time [22:50] cloudhead: heda: sure, but that's just one kind of app [22:50] stepheneb has joined the channel [22:50] alek_br has joined the channel [22:50] heda: malkomalko: well cucumber can put out step_definitions in javascript to run on v8 [22:50] heda: malkomalko: i haven't tried but i guess you could just use zombie with it then [22:51] malkomalko: interesting [22:51] malkomalko: so maybe the tools already exist [22:52] heda: malkomalko: possibly, i haven't tried it yet though [22:52] heda: malkomalko: i know it can output js steps though, have seen that [22:52] Sorella has joined the channel [22:53] saschagehlich_ has joined the channel [22:53] bbguitar has joined the channel [22:54] davidascher has joined the channel [22:55] losing has joined the channel [22:56] Aria has joined the channel [22:57] forest has joined the channel [22:58] saschagehlich has joined the channel [22:58] forest has joined the channel [22:59] bartmax has joined the channel [22:59] bartmax has joined the channel [23:00] malkomalko: you know, this might do it [23:00] malkomalko: https://github.com/sstephenson/execjs [23:00] malkomalko: + cucumber [23:00] malkomalko: could work [23:00] sivy has joined the channel [23:00] heda: + hyuki? [23:00] pascalopitz has joined the channel [23:01] kevinliu has joined the channel [23:01] squeeks-drunk: hyuki? [23:01] davemo: isaacs: i was watching some node camp videos and i think it was grauchs talk, there was a little app that came up on his screen that let him resize windows in mac os using some grid or something, any idea what it was? [23:01] heda: whats it called again [23:01] EyePulp: screen? [23:02] softdrink: BetterTouchTool has some functionality [23:02] malkomalko: kyuri lol [23:02] softdrink: windows 7-style snapping [23:02] ParadoxQuine: it's divvy probably [23:02] davemo: it was like he hit a command and this grid popped up, then he dragged out like 4x3 cubes and the window was that relative size [23:02] ParadoxQuine: http://www.mizage.com/divvy/ [23:02] sechrist: divvy yea [23:02] davemo: cool, thanks! [23:02] sechrist: it's a little much for a small utility app though [23:03] sechrist: oh it dropped in pricing [23:03] sechrist: it was $30 iirc [23:03] malkomalko: I like SizeUp better [23:03] softdrink: still, $14 for a handful of window management tricks? [23:03] sechrist: i'll pop on $15. I already have Window Keys and love it [23:03] q_no has joined the channel [23:03] malkomalko: http://www.irradiatedsoftware.com/sizeup/ [23:04] sechrist: why do you like it more than divvy> [23:04] sechrist: or have you tried divvy [23:04] malkomalko: I have [23:04] malkomalko: I think it's faster, and I like the keyboard shortcut customization better [23:04] malkomalko: I never much used the "draw a rectangle around the boxes" divvy thing [23:04] softdrink: Zooom/2 is 20 bucks [23:06] vipaca has joined the channel [23:07] ParadoxQuine: you can also just get something like keyboardmaestro and make your own macros for window arranging [23:07] ParadoxQuine: more power but less flexibility in the moment [23:08] davemo: bah, it doesn't play nice with fireworks cs5, although i'm guessing not much does :( [23:08] softdrink: ACTION writes his own [23:08] davemo: that's what i was trying to tame :P [23:08] softdrink: i think most adobe apps /don't/ use Cocoa [23:08] possibil_ has joined the channel [23:08] Draggor: bradleymeck: SubStack: https://github.com/draggor/node-bigint [23:08] zorzar has joined the channel [23:09] ParadoxQuine: yea nothing plays well with adobe apps., though keyboard meastro does a pretty good jjob since it essentially simulated mouse/keyboard actions [23:09] SubStack: Draggor: checking it out [23:09] sechrist: what hotkey do people use with divvy [23:10] s0l1dsnak3123 has joined the channel [23:10] davemo: cmd + shift + space [23:10] davemo: is what i set it to [23:10] s0l1dsnak3123: hey guys and gals! :) [23:10] davemo: i've been using ShiftIt 1.2, it's just a basic keyboard macro [23:11] davemo: but it subdivides into 1/2 (top, bottom, left, right) and quadrants easy [23:11] Draggor: SubStack: I had to change powm in index.js, one of the tests was failing as it didn't know how to deal with a string being passed in as num with a bigint as a mod [23:13] powdahound has joined the channel [23:13] __tosh has joined the channel [23:16] zeqeiroz has joined the channel [23:17] jimt has joined the channel [23:19] msch has joined the channel [23:22] maushu has joined the channel [23:22] doubletap has joined the channel [23:22] doubletap has left the channel [23:24] mlncn has joined the channel [23:25] isaacs: davemo: no idea. maybe ask rauchg :) [23:25] s0l1dsnak3123: Is it possible to use NodeJS to POST files to a server,then retrieve the response? The API docs have post requests, but I can't see anything about uploading files? [23:25] gazumps has joined the channel [23:26] davemo: found it out from the intrepid channel goers isaacs thanks (i was looking through the user list for grauch) :P [23:26] isaacs: kewl :) [23:26] isaacs: guillermo puts his last name firce [23:26] isaacs: *first [23:26] davemo: yeah i could see why maybe grauch wouldn't be appealing :P [23:27] davemo: people might think he was angry all the time :) [23:27] Lone_Rifle has joined the channel [23:27] Horofox has joined the channel [23:28] sechrist: yep [23:28] yyamano has joined the channel [23:28] Lone_Rifle: is it a fair comment to say that Node.js is more suited to applications that involve intensive I/O and light computations? [23:28] sechrist: isaacs: do you go to node meetups? [23:28] tjholowaychuk: Lone_Rifle: fair, but you could still use other processes for anything heavy [23:28] tjholowaychuk: as you would with ruby etc anyway [23:29] Lone_Rifle: tjholowaychuk: so, you'd have to use something else that Node.js can pass messages to for the heavy lifting? [23:29] eventi has joined the channel [23:29] [[zzz]] has joined the channel [23:29] isaacs: sechrist: yeah, most of them that are in SF or Oakland [23:30] tjholowaychuk: Lone_Rifle: I would still use node, but I wouldnt leave any heavy processes in my main server nodes [23:30] s0l1dsnak3123: anybody have any advice on my question above? :) [23:30] tjholowaychuk: Lone_Rifle: you could use webworkers etc [23:30] isaacs: Lone_Rifle: yes, that is fair. if your app is highly compute-bound, you would be wise to write it in C or something [23:30] isaacs: Lone_Rifle: but the vast majority of apps are IO bound. [23:30] isaacs: IO is slow. [23:30] sechrist: You write a distributed mapreduce function in erlang! [23:30] Lone_Rifle: isaacs: thanks, I figured as much [23:30] Lone_Rifle: use case as follows: I have an embedded x86 platform whose performance makes the Intel Atom look good. very good. [23:31] sechrist: ew [23:31] isaacs: ok [23:31] SubStack: if your app is compute bound it's usually a good idea to write c++ modules for that part [23:31] SubStack: and glue everything together with javascript [23:31] eventi: so who here has done any ajax stuff [23:32] davemo: ... [23:32] sechrist: I do websockets stuff [23:32] sechrist: ajax is so 2004 [23:32] Lone_Rifle: I'm looking to see if I can prove a point, that since most apps are more IO bound, said platform + Node.js = excellent appliance [23:32] eventi: specifically in facebook - I'm a sysadmin, and I'm a little lost with some encoding issues [23:32] sechrist: er what [23:32] eventi: sechrist: unfortunately no choice [23:33] sechrist: facebook does a stupid about of XHR [23:33] Lone_Rifle: unfortunately, it might have to involve porting Node.js to an obscure OS, since the mainstream Linux distros will kill the platform; it even struggles with Puppy Linux [23:33] saschagehlich has joined the channel [23:33] eventi: so - I'm getting something that looks like event%5Btype%5D back from something that I pass a javascript object to [23:33] sechrist: Lone_Rifle: why is it x86 then [23:34] sechrist: sounds like you want a risc [23:34] Lone_Rifle: sechrist: I collect x86 CPUs. [23:34] sechrist: I was hoping you would say it's a space shuttle [23:34] sechrist: nodejs in spaaaaaaace [23:34] eventi: I want a real json encoded string, but it seems to be digging into the object and making name value pairs and url escaping them [23:35] Lone_Rifle: http://www.vortex86mx.com if you care [23:35] sechrist: Lone_Rifle: if you're not on a platform v8 compiles on [23:35] sechrist: you are shit of out luck tbqh [23:35] sechrist: and v8 is picky [23:35] eventi: the problem is PHP handles it, node does not [23:35] Lone_Rifle: luckily, v8's primary arch is x86, no? [23:35] sechrist: there's a lot of os things going on for JIT etc [23:36] sechrist: for example the iphone can't run it even though it's an arm chip [23:36] Lone_Rifle: true [23:36] sechrist: due to the kernel [23:36] sechrist: nodejs on a 40mhz thing? [23:36] Lone_Rifle: no, not the 40Mhz thing [23:36] sechrist: man you're better off writing your own C evented server at that point [23:36] eventi: I pass an object, like { event: { type: foo,name:bar }} and it sends event[type]=foo&event[name]=bar [23:36] Lone_Rifle: the 1GHz thing. [23:37] Lone_Rifle: which btw, struggles to best a P4 1.6GHz. [23:37] sechrist: lol [23:37] sechrist: this is a neat little embedded thing though [23:37] sechrist: does the cpu even need a heat sink? [23:37] Lone_Rifle: it's interesting, to say the least [23:37] Lone_Rifle: er... yes it does, but only because it's in a plastic (as opposed to ceramic) package [23:38] sechrist: does it need a fan on that heatsink [23:38] sechrist: this looks good for like solid state daemons or something [23:38] Lone_Rifle: depends on the OS: with Puppy it manages about 1hour before the CPU becomse suicidal [23:38] Lone_Rifle: with KolibriOS it lasts indefinitely [23:39] sechrist: kolibrios is like [23:39] Lone_Rifle: both cases without the fan [23:39] sechrist: ridiculous [23:39] alek_br has joined the channel [23:39] tim_smart has joined the channel [23:39] Lone_Rifle: i guess my plan, given infinite time and resources, is to port V8, somehow, to SanOS, and take Node along for the ride [23:40] Lone_Rifle: ah yes, I have to probably write the SanOS driver for the embedded network card too. fun. [23:40] sechrist: sounds like a pointless project, and I'm a guy that compiled node for the kindle [23:40] sechrist: unless you actually have a real purpose to do this outside of just something to do [23:40] Lone_Rifle: node for the kindle? motiviations? [23:40] sechrist: I used it for an http proxy [23:40] sechrist: so I could abuse the free 3g [23:41] Lone_Rifle: would you consider "rooting for the underdog" and "ensuring a taiwanese company gets business it doesn't deserve" as real purposes? [23:41] sechrist: no [23:41] Evet has joined the channel [23:41] Utkarsh_ has joined the channel [23:41] sechrist: you're going to end up finding that porting v8 isn't something you want to do [23:41] Lone_Rifle: yes, i figured as much [23:41] sechrist: and likely can't do due to jit and stuff [23:42] sechrist: especially to an obscure os [23:42] isaacs: eventi: npm install qs and then require("qs") [23:42] eventi: isaacs: i'm already decoding it [23:43] isaacs: eventi: or you can pull the one i wrote out of YUI3 or Narwhal [23:43] Lone_Rifle: sechrist: i -could- strip a mainstream distro... [23:43] sivy has joined the channel [23:43] Lone_Rifle: sechrist: anyway, thanks for the advice [23:43] eventi: problem is that it's in that weird class[member]=value&class[anothermember][anditschild]=anothervalue format [23:44] eventi: which I can tell what it means, but can't really parse without some wicked kung fu [23:44] isaacs: eventi: yeah, the one i wrote does that [23:44] zachsmith has joined the channel [23:44] eventi: oh.... [23:44] isaacs: eventi: it has the wicked kung fu :) [23:44] eventi: isaacs++ - another beer for you [23:44] isaacs: i wrote it originally to be 100% compliant with how php does it, because that's whati was doing, passing objects between js and php :) [23:45] tjholowaychuk: eventi: qs can parse that [23:45] insin: ACTION resets his PHP alarm again, ah must have been that square bracket name thing - you people! [23:45] eventi: ok, ok - so we're proxying an ajax call in fb, and that's what it sends [23:45] fisted has joined the channel [23:45] eventi: like i said, i'm a sysadmin - don't wanna get too bogged down in stupid facebook things [23:46] Lone_Rifle: btw, i can't make out who the devs are in here, but I have to say that I'm pretty excited about your offering! [23:46] yyamano has joined the channel [23:47] eventi: so after concatenating the chunks in the on data handler, just JSON.parse(qs.parse(data)) ? [23:47] tjholowaychuk: eventi: yeah that should work [23:48] Lone_Rifle: it's a pity that the firm I work at have heavily bought into FIX/SOAP/JSON-based services with an emphasis on heavy compute tasks, but I'm sure Node can find a place even in financial services... someday [23:48] jiggliemon has joined the channel [23:48] Lone_Rifle: s/have/has/ [23:48] eventi: so - will this still work even though facebook adds fb_somebullshit=12345&fb_comeothershit=foo to the end of my post data? because that's exactly what I'm trying to do [23:49] technoweenie has joined the channel [23:49] eventi: beer for tj too, btw [23:49] slickplaid has joined the channel [23:49] tjholowaychuk: eventi: yeah it will just give you { fb_somebullshit: '12345', fb_comeothershit: 'foo' } [23:49] mlncn has joined the channel [23:50] jesusabdullah: Lone_Rifle: You can write such services in node [23:50] eventi: heros [23:50] jesusabdullah: Lone_Rifle: You can even write things that coordinate and use those services in node! [23:50] eventi: #winning - thanks guys [23:50] s0l1dsnak3123: Is it possible to use NodeJS to POST files to a server,then retrieve the response? The API docs have post requests, but I can't see anything about uploading files? [23:50] jesusabdullah: Lone_Rifle: Though, I don't think there are FIX or SOAP bindings yet. Hop to it! [23:52] bradleymeck: s0l1dsnak3123 yes, look into node-formidable [23:52] s0l1dsnak3123: thanks bradleymeck! [23:52] Lone_Rifle: jesusabdullah: i guess it would be interesting to see a shootout between a Node implementation and what we already have (C++-based FIX-passing services) [23:52] forest_ has joined the channel [23:53] jesusabdullah: What is FIX anyway? [23:53] Lone_Rifle: Financial Information eXchange protocol [23:53] bradleymeck: http://en.wikipedia.org/wiki/Financial_Information_eXchange [23:54] Lone_Rifle: I imagine the showstopper is the non-deterministic nature of GC, although since Node uses minimal heap.... [23:54] jesusabdullah: Lone_Rifle: You should write a node module to encode and decode FIX messages. It looks doable! [23:54] Lone_Rifle: but who would use it? [23:54] bradleymeck: if only we had a good number system for whole numbers :/ [23:54] jesusabdullah: You [23:54] Lone_Rifle: lol. I'm afraid that's unlikely [23:54] bradleymeck: fix isnt too hard to implement, but wouldnt see it too often [23:55] Lone_Rifle: guess the hedgies might be keen on the idea [23:55] jesusabdullah: tsk tsk [23:55] [[zz]] has joined the channel [23:55] jesusabdullah: Could you, umm [23:55] jesusabdullah: buy shit with FIX? [23:55] jesusabdullah: Like, yourself? [23:56] Lone_Rifle: okay... so.... [23:56] jesusabdullah: heh [23:56] jesusabdullah: Sorry, my head's a bit fried [23:56] Lone_Rifle: off-topic, but, the idea is that most of the financial firms in the industry talk to each other in FIX. [23:56] fisted_ has joined the channel [23:57] Lone_Rifle: Orders will be sent from the buy-side (pension funds, asset and investment mgmt, hedge funds) to brokers and exchange clearing members [23:57] Lone_Rifle: these in turn get sent to the exchange [23:57] eventi: tjholowaychuk: isaacs[away] - serious about those beers - next time you're in NYC [23:57] Lone_Rifle: where the buy and sell orders are matched at say, the London Stock Exchange. [23:57] tjholowaychuk: eventi: haha, sounds good [23:58] jesusabdullah: So, how hard is it to become a buy-side? [23:58] jesusabdullah: That is, to get the hookups with the brokers and shit? [23:58] Lone_Rifle: jesusabdullah: well you need a reputation to begin with.. [23:58] doubletap1 has joined the channel [23:58] jesusabdullah: Ah, I see [23:58] jesusabdullah: So not trivial to, say, write a node.js program to buy and sell small amounts of stock for you [23:58] jesusabdullah: ;) [23:58] Lone_Rifle: and that begins with one of the established firms, usually. [23:58] jesusabdullah: At least, not so directly. [23:59] davidascher has joined the channel [23:59] doubletap1 has left the channel [23:59] Lone_Rifle: and established firms, having lots of investment in existing tech, usually move pretty slowly due to the risk and logistics involved in changing [23:59] charlenoqueirozp has joined the channel [23:59] doubletap has joined the channel [23:59] doubletap has left the channel