[00:00] namelessnotion has joined the channel [00:05] siong1987 has joined the channel [00:09] MichalBe: > Could someone helps me with sending POST data to the another server using node.js? I have such a code build using doc's example, and I tried to send two variables (a with 123 value, and anotherVar with 'bleble) but it doesn't seems to work. What am I doing wrong? code: http://ideone.com/1VoFV [00:11] teddy_ has joined the channel [00:12] Alex3000 has joined the channel [00:13] aguynamedben has joined the channel [00:14] kawaz_home has joined the channel [00:18] ryah: spetrea: hi [00:19] ryah: MichalBe: something like that [00:21] MichalBe: ryah: So I send my data in proper way? Everything looks good in that code? [00:21] ryah: MichalBe: yes [00:22] unomi has joined the channel [00:22] TomC has joined the channel [00:23] MichalBe: ryah: ok, so i will search for mistakes in other parts of the code, thx [00:23] TomC: MichalBe: try adding Content-Type: application/x-www-form-urlencoded to your headers? [00:24] hdx_ has joined the channel [00:31] skohorn has joined the channel [00:31] langworthy has joined the channel [00:36] sechrist: is 3ms to convert a 720p ARGB32 buffer to YUV on an i7 slow? [00:36] sechrist: I don't know much about video tolerances [00:37] mojombo has joined the channel [00:38] prettyrobots has joined the channel [00:42] Aron has joined the channel [00:55] mraleph has joined the channel [00:56] dguttman has joined the channel [01:00] unomi has joined the channel [01:01] jvolkman_ has joined the channel [01:04] twoism has joined the channel [01:04] jacobolus has joined the channel [01:05] tlrobinson has joined the channel [01:05] xSmurf has joined the channel [01:06] xSmurf: Hey all, I'm trying find some documentation on POST uploads from http client, all the info I find is about receiving uploads, looking at posting a file [01:11] torvalamo: a file post is an upload... [01:11] torvalamo: oh nvm [01:12] torvalamo: i re-read [01:13] torvalamo: basically you just send a request the normal way using multipart, where each part is the given file data and its meta data.. you should read up on how http requests are formatted [01:13] torvalamo: specifically multipart [01:15] jchris has joined the channel [01:15] cardona507 has joined the channel [01:20] stepheneb has joined the channel [01:24] tahu has joined the channel [01:26] xSmurf: torvalamo: is there something to generate boundery keys? [01:27] torvalamo: ? [01:27] torvalamo: you specify the file or part size before each part, so no need for boundaries [01:28] xSmurf: ah ok [01:28] torvalamo: just read the http specification [01:28] markwubben has joined the channel [01:29] augustl has joined the channel [01:29] jpld has joined the channel [01:29] possibilities has joined the channel [01:30] dgathright has joined the channel [01:31] Aria: ... Except that multipart/form-data /does/ use boundaries. [01:31] torvalamo: oh [01:31] torvalamo: it does? [01:31] torvalamo: fuck... _I_ need to read the http spec [01:32] Aria: It's RFC 2388. [01:32] Aria: The length-based encoding is HTTP Chunked encoding. [01:32] torvalamo: i thought it used a similar format to chunked [01:32] Aria: Yeah, sadly not. [01:32] Aria: The RFC suggests that such things should be invented, but doesn't specify it. [01:33] Aria: (and, if you have strong random boundaries, collisions are really unlikely, and it supports streaming that a length-first encoding does not.) [01:33] torvalamo: i could totally see it being a doubly 'length encoded' thing.. multipart & chunked, where the collective multipart data is then split up into chunks [01:33] Aria: Yeah. Also doable. [01:34] torvalamo: so the rfc basically says "do that" [01:34] torvalamo: ? [01:34] Aria: Nah, but it's allowed, I believe. [01:34] torvalamo: obviously you need both the client and server in on it [01:34] torvalamo: otherwise there's no point [01:35] Aria: Ayep. [01:35] xSmurf: and also, do I pass all the headers in a row in the request method, or does the request object have some setHeader() method I'm failing to see in the API doc? [01:35] brianmario has joined the channel [01:36] Aria: You do it in a row. [01:36] torvalamo: you sure there's no library for this? [01:36] xSmurf: I haven't found one [01:36] torvalamo: there's a library for receiving multipart [01:36] torvalamo: you could try to 'reverse' it [01:37] torvalamo: it's called 'multipart' [01:37] torvalamo: :P [01:37] zorzar_ has joined the channel [01:37] xSmurf: and writing messages! [01:37] Aria: Multipart formats are REALLY easy to generate ;-) [01:37] Aria: So a whole library might be overkill. [01:38] torvalamo: well a module [01:38] torvalamo: is what i meant [01:38] Aria: Same deal. It's that simple. [01:38] torvalamo: it's about collecting code that does the same thing, in the same place [01:39] torvalamo: reuse and abuse! [01:39] torvalamo: isn't that the plan? [01:41] enotodden has joined the channel [01:42] Aria: No, hell no. Not at a cost of additional dependencies. It's a trade-off. The people who always choose to modularize make for some very difficult code to follow. You have to keep all those things in your head. [01:42] Aria: And linked properly. [01:43] sechrist has joined the channel [01:45] pHcF: o bagulho é doido [01:45] pHcF: brasileiros? [01:46] torvalamo: how is modularization hard to follow? even if the modules won't be reused anywhere, it makes for smaller code that IS easier to follow [01:46] torvalamo: i'm not advocating java style 4000 classes for a menu system, though [01:46] torvalamo: that's just sick in the head [01:47] dgathright has joined the channel [01:48] sechrist has joined the channel [01:50] jvolkman_ has joined the channel [01:52] hdx: pHcF: iai truta firmeza? [01:53] AndroUser2 has joined the channel [01:55] xSmurf: yeah this doesn't work [01:56] xSmurf: can't have more than one of the same header in the hash map passed to request() [01:58] xSmurf: plus my request.write(data) is sent after connection: close [02:02] arpegius has joined the channel [02:02] stagas has joined the channel [02:02] kriszyp_ has joined the channel [02:04] aconbere has joined the channel [02:05] peritus_ has joined the channel [02:06] arpegius has joined the channel [02:08] xSmurf: still a no go... http://pastie.textmate.org/private/krodbamduyxnrvpkudeja [02:11] wdperson has joined the channel [02:14] mape: Anyone tried http://kodapp.com/ ? [02:15] kawaz_home has joined the channel [02:18] chapel: mape: nope, is it available for download? [02:18] mape: chapel: Doesn't seem like it [02:18] mape: But if it is TM with node.js support I'm a happy person [02:18] hdx has joined the channel [02:20] hobodave has joined the channel [02:20] chapel: well the node.js seems to be scripting based [02:20] chapel: not that its a bad thing [02:21] chapel: looks interesting to me [02:21] cjm has joined the channel [02:22] SubStack: Scripting! That will never catch on. [02:22] halfhalo: inorit [02:22] stagas has joined the channel [02:24] sechrist has joined the channel [02:24] masahiroh has joined the channel [02:25] Aikar: ryah: found a memory leak https://github.com/ry/node/issuesearch?state=open&q=memory+leak#issue/520 [02:29] UHMA has joined the channel [02:36] Hello71 has joined the channel [02:36] Hello71 has joined the channel [02:38] rauchg_ has joined the channel [02:39] Me1000 has joined the channel [02:42] torvalamo has joined the channel [02:44] CIA-93: node: 03Ryan Dahl 07master * r41d73e0 10/ lib/tls.js : cleartext.socket always exists - http://bit.ly/guStJ3 [02:44] CIA-93: node: 03Ryan Dahl 07master * rfca713e 10/ doc/api/buffers.markdown : Add doc for Buffer.isBuffer - http://bit.ly/eDigB6 [02:44] ryah: Aikar: okay. will look at it soon [02:45] stagas has joined the channel [02:45] wasabist_ has joined the channel [02:49] pHcF: hdx: opa [02:49] pHcF: hdx: firmeza ai na comuna node jota esse? :P [02:55] sechrist: Has anybody gotten v8/node to run under iOS? [02:56] torvalamo has joined the channel [02:56] stagas has joined the channel [02:57] AndroUser2 has joined the channel [02:57] pHcF: sechrist: i've been trying to build it on my iPad yesterday [02:57] pHcF: BUT [02:58] pHcF: i had a problem [02:58] pHcF: with V8 [02:58] sechrist: Yeah v8 is where the first problem would be [02:58] pHcF: just do a ./configure --without-ssl with iphone g++ installed [02:58] InsDel has joined the channel [02:58] pHcF: and you'll get the error [02:59] sechrist: It's probably in hairy arm-specific optimization code [02:59] sechrist: and a lack of real kern headers [03:00] jvolkman_ has joined the channel [03:04] mraleph: you cannot run v8 on iphone afaik [03:05] Hello71 has joined the channel [03:05] Hello71 has joined the channel [03:05] mraleph: kernel does not allow you to map executable pages [03:08] stagas has joined the channel [03:11] DewBoy3d has joined the channel [03:14] DewBoy3d: somewhat of a noob question. How do I use git to get an older version of node.js? and can I have 2 different versions running at the same time? [03:14] themiddleman has joined the channel [03:14] sechrist: the former question's answer is probably git reset --hard [03:15] sechrist: second depends, there's libs and stuff that will probably give you trouble [03:15] DewBoy3d: thanks [03:15] sechrist: I'm not sure if there's a more elegant way to check out a tagged git version [03:15] sechrist: I just use git reset [03:15] Aria: Regarding the second, mind your paths. [03:16] Aria: Regarding the first, git checkout theoldertagname [03:16] sechrist: hah, really? just git checkout? [03:16] sechrist: wow [03:17] herbySk has joined the channel [03:17] hellp has joined the channel [03:24] Zebra10 has joined the channel [03:24] sudoer has joined the channel [03:26] DewBoy3d: Aria: thank you. checkout worked to get the older tagname but it still compiled the master branch. when I do git branch is see * (no branch) and then a second line that says master. i'm very new to git and version control in general [03:27] Aria: Hm. [03:27] Aria: git checkout theoldertag should work for that. [03:27] Aria: Perhaps that only works on the branch. Grr. [03:27] Aria: (though make clean before changing -- the build system hates version goes backwards) [03:27] DewBoy3d: ok i'll try that [03:29] DewBoy3d: nope. i'll try the reset and see if that works [03:32] DewBoy3d: looks like that did the trick for me [03:33] DewBoy3d: all this just to try out a single app [03:36] stagas has joined the channel [03:37] xSmurf: try as I might, I cannot get http.Client to post a file [03:42] hornairs has joined the channel [03:43] hornairs: can anyone in here recommend any of the sqlite orms? [03:45] hornairs: i cant find anything more complex than lawnchair that looks well put togethet [03:47] MattDiPasquale has joined the channel [03:49] Zebra10: anyone know what the correct format for form data is in a POST body? [03:50] SubStack: uri encoded I think usually [03:50] heavysixer has joined the channel [03:50] SubStack: but it can be all sorts [03:50] Zebra10: so im learning... [03:50] Zebra10: haha [03:50] Zebra10: thx [03:50] Zebra10: im actually trying to emulate 1 type of multipart-form post [03:51] cnus8n has joined the channel [03:51] SubStack: there are libs for that [03:52] Zebra10: yeah, cant seem to do it quite the right way with http.createClient [03:53] Hello71 has joined the channel [03:53] Hello71 has joined the channel [03:55] murz has joined the channel [03:56] richcollins has joined the channel [03:56] hdx has joined the channel [03:57] stagas has joined the channel [03:57] DewBoy3d has joined the channel [04:03] Zebra10 has joined the channel [04:05] heavysixer has joined the channel [04:06] softdrink has joined the channel [04:06] micheil has joined the channel [04:06] Zebra10: any ideas on what lib to use? [04:06] Zebra10: to create a client and post multipart with bounderies [04:06] micheil: felixge has a multipart parser [04:08] aconbere has joined the channel [04:09] Zebra10: not really a parser i need - i am wanting to post the data from node [04:09] Zebra10: any ideas? [04:10] cognominal has joined the channel [04:13] micheil: nope. [04:13] hdx_ has joined the channel [04:13] blowery_ has joined the channel [04:15] AcidicChip has joined the channel [04:16] yanick_ has joined the channel [04:20] rauchg_ has joined the channel [04:25] Aria: Zebra10: https://gist.github.com/747099 [04:25] Zebra10: Aria: epic. thanks - so simple [04:25] Aria: Sure thing! [04:26] Aria: It's a really simple protocol. There's more you can do past that of course, but it works. [04:28] bruce_ has joined the channel [04:28] yanick_: hi, I'm storing some config data in a .js file that I include via require(). Now, I'd like to watch that config file and hot reload it whenever it changes. The problem is that require() (seems to) cache the files. I've tried to use the vm module, but it just won't work like require() (I'd need to return some value from the config file instead of useing this.properties = value;). The question is now; is it possible to require() a same file again? [04:30] Blink7 has joined the channel [04:30] stagas has joined the channel [04:31] Aria: With 0.2.x, not easily. [04:31] Aria: With 0.3.x, you can hack with the cache. [04:31] Aria: (though you might just consider a more load/eval rather than require sort of loading there.) [04:31] yanick_: I have 0.3.2 [04:32] SubStack: yanick_: I would JSON.parse instead of require() [04:32] SubStack: if it's just data it doesn't need the whole javascript engine [04:32] Aria: That too. [04:33] yanick_: SubStack, where is the JSON module? [04:33] yanick_: (doc) [04:33] SubStack: it's built-in to V8 [04:33] yanick_: k [04:33] SubStack: v8: JSON.parse('[1,2,3]') [04:33] v8bot: SubStack: [1, 2, 3] [04:33] yanick_: if I have comments in the .js, does JSON.parse() remove them? [04:34] SubStack: v8: JSON.stringify({ a : 1, b : [2,3], c : 4 }) [04:34] v8bot: SubStack: "{"a":1,"b":[2,3],"c":4}" [04:34] SubStack: json doesn't have comments [04:34] yanick_: well... then I'd have manually strip them... and what if the .js needs to store some config in the global namespace? [04:34] jvolkman_ has joined the channel [04:34] SubStack: yanick_: don't do that [04:37] yanick_: alright, though even if I "don't do that", I still need to put comments in the config files, so manually remove them would just an hassle [04:38] yanick_: why doesn't require have a second parameter; ie: var foo = require(path, [cache]); ? if cache is false, require the file but skip cache at all [04:38] SubStack: contents.replace(/^\s*#.*/mg,'') [04:39] SubStack: or // or whatevs [04:40] jacobolus has joined the channel [04:41] jchris1 has joined the channel [04:42] jakehow has joined the channel [04:43] jacobolus has joined the channel [04:48] stagas has joined the channel [04:54] shimondoodkin has joined the channel [05:01] yanick_: hmm... JSON.parse() throws an Unexpected token ILLEGAL on the string "{LOG_LEVEL: LOG_ALL}" (where "LOG_ALL" is define "global.LOG_ALL = 255;") ... O_o [05:02] shimondoodkin: what you want to do is eval [05:02] shimondoodkin: but i think it might be not good to do eval [05:02] Aria: Yeah, that's not JSON [05:02] Aria: eval is fine if you can trust the data. [05:02] Aria: (json requires quoted keys and values) [05:02] yanick_: I thought eval() should be avoided as much as possible? there's all those functions to load files, and in the end, everything fails and I need to resort to eval() ?? [05:03] Aria: (or at least no symbolic values) [05:03] Aria: Why avoid eval() ? [05:03] Aria: What do you think require() does? [05:03] yanick_: Aria, what would be a valid JSON string then? Why isn't "{LOG_LEVEL:LOG_ALL}" valid? [05:03] shimondoodkin: doublequoted [05:03] Aria: Because {"LOG_LEVEL": "LOG_ALL"} is JSON [05:03] jvolkman__ has joined the channel [05:04] yanick_: shimondoodkin, the string is loadef rom a file, and LOG_ALL is a global constant [05:04] shimondoodkin: but you will get "LOG_ALL" as text not 255 [05:04] Aria: JSON isn't JS ;-) [05:04] Aria: It's strictly a subset. [05:04] shimondoodkin: is it a config file of yours? [05:04] yanick_: well, that what I need; to load a config file WITHIN the Node.Js scope [05:04] Aria: yeah, you want eval. [05:04] Aria: You want to avoid caching, you want to use real JS [05:05] Aria: (though I might change the problem and use json myself) [05:05] stagas has joined the channel [05:05] yanick_: I don't know what require() does, but if it uses eval... I guess I won't argue and just use eval() then [05:07] Aria: 'eval' /is/ a code smell -- often means you're trying too hard to be clever. [05:07] Aria: But this is what it's for. [05:07] yanick_: Aria, JSON is no use, I need to use constants [05:07] Aria: Yeah, if you need constants, then yeah. [05:08] yanick_: I still think that require() should be able to accomplish this using a second parameter to prevent caching [05:08] shimondoodkin: require loads a js file, executes its contents and returns the 'this.exports' or 'this' object [05:09] shimondoodkin: or module.exports [05:09] yanick_: shimondoodkin, yeah, that's what I need :) but I need to "re-require" that file when it changes [05:09] Aria: And it caches it. [05:09] yanick_: yes [05:09] shimondoodkin: waht version of nodejs do you use? [05:09] shimondoodkin: what [05:09] yanick_: 0.3.2 [05:10] yanick_: require(path, [cache]) would be a nice feature if you ask me [05:10] shimondoodkin: you can do delete require.cache[require.resolve???('./mymodule')] [05:10] shimondoodkin: i do not remember the corrent function name of require.resolve??? [05:10] yanick_: "require.resolve???" ? [05:11] yanick_: yes, it's require.resolve(path) [05:11] yanick_: so, the cache is exposed? [05:11] shimondoodkin: yes [05:11] yanick_: nice [05:11] SubStack: yanick_: bullshit, just use JSON already [05:11] shimondoodkin: https://github.com/ry/node/commit/e27418ca3f1f4700a457145de899c0d67343ee77#comments [05:12] SubStack: if you want "constants" just do config.someConstant [05:12] SubStack: var config = JSON.parse(fs.readFileSync(__dirname + '/config.json')) [05:12] SubStack: and set the watch the update config etc [05:12] Aria: That still doesn't get you references to a numeric value [05:13] shimondoodkin: i have my thing https://github.com/shimondoodkin/node-hot-reload [05:13] shimondoodkin: but it use old code [05:13] shimondoodkin: uses [05:14] yanick_: SubStack, I'm sorry, but what I'm using only uses 2 lines of code and uses require() [05:14] yanick_: shimondoodkin, it works [05:15] shimondoodkin: what? requre.cache? [05:15] SubStack: http://xkcd.com/292/ [05:15] wilmoore has joined the channel [05:16] herbySk has joined the channel [05:16] yonkeltron: SubStack: based on a true story [05:16] yanick_: shimondoodkin, since I'm already getting the module file through require.resolve() to monitor the file change, I can simply do "delete require.cache[configPath]; global.Config = require(configModule);" and it hot reloads it fine [05:16] pHcF: guys, all requests i do to www.twitter.com from my server i get Your browser sent a request that this server could not understand [05:16] pHcF: but from my local machine, it works [05:16] pHcF: :X [05:17] pHcF: any idea? [05:17] technoweenie has joined the channel [05:18] technoweenie: hey anyone know about kodapp? i'm curious about the supposed node integration [05:18] shimondoodkin: pHcF: can you share some code ,i do not understand your question [05:19] pHcF: shimondoodkin: when i do a http.createClient() and then a client.request to twitter.com, I always get the your browser sent a request that this server couldnt understand, but in my local machine, it works [05:19] shimondoodkin: maybe yoiu have to add headers of a browser [05:20] pHcF: yeah [05:20] mgutz: kodapp looks like skywriter in a standalone webkit [05:20] shimondoodkin: but usualy this error occurs when you do a wrong command like GETT /goo [05:20] pHcF: yeah [05:21] pHcF: but the thing is that it works locally [05:21] jwcooper has joined the channel [05:21] shimondoodkin: see if you can use this: https://github.com/mikeal/node-utils/tree/master/request [05:21] mgutz: which db are guys using for small VPS? mongodb seems memory hungry [05:22] shimondoodkin: have you tested couchdb? [05:22] mgutz: also looks like they recommend 64-bit OS. Linode recommends 32-bit OS for small vps [05:22] mgutz: have no tried couch [05:23] mgutz: is there a good orm for it? [05:23] pHcF: shimondoodkin: i got error 400 too [05:23] jwcooper: could use mongohq too...have your mongo hosted, and use mongoose [05:23] AAA_awright_ has joined the channel [05:23] mgutz: i'm using mongoose now, i hardly have any free memory on a 512MB VPS [05:24] technoweenie: i dont think kod is an in browser editor though [05:24] shimondoodkin: see couchdb in node modules [05:24] technoweenie: it looks like chrome which threw me off at first [05:24] mgutz: will check it out, thanks shimon* [05:24] technoweenie: but why would an in browser editor have node integration [05:25] mgutz: have you seen cloud9, seems ok skywriter based ide .. if they get Vim bindings, I'll use it [05:25] shimondoodkin: pHcF: maybe your server is blocked... [05:26] shimondoodkin: or you have a proxy on your server or fire wall [05:26] shimondoodkin: some good pracices suggest block with firewall outgoing connections [05:26] technoweenie: yea but cloud9 and skywriter are browser based, why would i ever use that [05:26] technoweenie: anyways, nevermind [05:26] mgutz: i can use cloud9 locally [05:26] mgutz: i do it to debug [05:27] technoweenie: awesome [05:27] mbrochh has joined the channel [05:29] shimondoodkin: pHcF:' you can try to access another website for example google [05:51] softdrink has joined the channel [05:52] shinmei has joined the channel [06:00] JojoBoss has joined the channel [06:00] JojoBoss has joined the channel [06:01] dgathright has joined the channel [06:02] stagas has joined the channel [06:03] skm has joined the channel [06:05] pHcF has joined the channel [06:12] skm has joined the channel [06:13] cnus8n has joined the channel [06:13] aconbere has joined the channel [06:14] skm_ has joined the channel [06:18] stagas has joined the channel [06:20] HAITI has joined the channel [06:21] skm has joined the channel [06:23] skm has joined the channel [06:29] cafesofie has joined the channel [06:30] slaskis has joined the channel [06:36] wilken has joined the channel [06:38] jwcooper has left the channel [06:42] JojoBoss has joined the channel [06:42] Aria has joined the channel [06:44] Aredridel has joined the channel [06:49] okuryu has joined the channel [06:55] webyay has joined the channel [06:56] webyay has joined the channel [07:01] CrypticSwarm has joined the channel [07:01] dnolen has joined the channel [07:03] aaronblohowiak has joined the channel [07:03] wasabist_ has joined the channel [07:03] fangel has joined the channel [07:04] aaronblohowiak: grrrrr [07:04] aaronblohowiak: how come node -I doesnt work anymore? [07:05] themiddleman has joined the channel [07:05] aaronblohowiak: is this an API change or could i just be an idiot [07:07] aaronblohowiak: oh, that was an expresso thing [07:07] aaronblohowiak: whoops [07:11] bob_ has joined the channel [07:11] herbySk has joined the channel [07:13] linac has joined the channel [07:32] aaronblohowiak has joined the channel [07:34] micheil has joined the channel [07:36] micheil: ryah: do you know of anyone actually implementing a Stream? [07:40] micheil: found one. fs.WriteStream [07:40] micheil: or ReadStream [07:50] daglees has joined the channel [07:50] daglees has joined the channel [07:51] iszak has joined the channel [07:54] wilken has joined the channel [07:55] mikeal has joined the channel [07:56] tprice: miksago? [07:56] micheil: ? [07:56] micheil: what's up? [07:56] tprice: i have an issue with the websocket [07:57] tprice: soemthing like Error: ETIMEDOUT, Connection timed out [07:57] tprice: is there a keepAlive option? [07:57] micheil: hmm, I don't currently implement a timeout/keep-alive, but it' [07:57] micheil: it's easy to do. [07:58] tprice: so like a setTimeout maybe? [07:58] micheil: on connection, set a timer, store a reference to it on the connection, send messages of "" [07:58] micheil: so, probably setInterval [07:59] tprice: and this should stop the server from crashing? [07:59] micheil: maybe. [07:59] micheil: just remember to clean-up [07:59] micheil: you can also listen for the [07:59] micheil: "error" event on the server [08:00] tprice: whats the timeout time that throws the error? [08:00] tprice: 5min 10min 2min? [08:01] micheil: 30seconds [08:01] micheil: is regularly used for keep-alives [08:02] tprice: ok ill set up a setInterval and see if the server crashes [08:04] aaronblohowiak: t row price? [08:04] aaronblohowiak: ACTION has had too much caffiene [08:04] tprice: lol [08:06] SubStack: ACTION doesn't have enough caffeine [08:07] aaronblohowiak: SubStack++ [08:07] v8bot: aaronblohowiak has given a beer to SubStack. SubStack now has 2 beers. [08:07] aaronblohowiak: hmmm [08:09] wilken has joined the channel [08:10] eboyjr has joined the channel [08:11] eboyjr: Is there a way I can modify an object from another context (Script.runInNewContext) [08:11] eboyjr: ? [08:14] monokrome has joined the channel [08:16] eboyjr: Bleh nevermind I don't need to anyway lol [08:19] sudoer has joined the channel [08:23] aaronblohowiak: is there a way to specify test-only dependencies? [08:25] mikeal has joined the channel [08:27] wilken has joined the channel [08:28] liar has joined the channel [08:31] SamuraiJack has joined the channel [08:35] tekky has joined the channel [08:37] eboyjr has left the channel [08:39] qFox has joined the channel [08:40] shimondoodkin: you have to use dependency injection like make a function with arguments inside a module and that functin returns a module [08:41] mikeal has joined the channel [08:42] shimondoodkin: aaronblohowiak: module.exports=function (app){ var co={}; co.myfunction=function(){}; return co;}; , in other file you do require('mymodule')(app) [08:43] aaronblohowiak: shimondoodkin: ah i meant just with the package.json [08:44] aaronblohowiak: shimondoodkin: in your example, you would have to modify some property of app though, right? [08:44] shimondoodkin: app is like a global variable it is adependency injection [08:44] shimondoodkin: you will have app in the local scope [08:45] shimondoodkin: sure you can modify the app [08:45] muk_mb: has anyone written something decently complicated in node yet? [08:45] shimondoodkin: if you like [08:45] femtoo has joined the channel [08:46] muk_mb: something like a forum or bug tracker or some such [08:46] shimondoodkin: muk_mb> has anyone written something decently complicated in node yet? [08:46] shimondoodkin: [10:45] [10:50] tmedema: > = ? [10:50] tprice: cloud9 [10:50] tprice: its amazing [10:50] chapel: has it got better? [10:50] muk_mb: ACTION votes textmate [10:50] stride: vim [10:50] chapel: I mean, when I used it last, it was not usable in chrome [10:50] chapel: I use textmate [10:50] sveimac has joined the channel [10:50] Figaroo: I'm just running node on cygwin/windows [10:50] chapel: though kod or whatever looks good [10:50] pdelgallego has joined the channel [10:50] SubStack: tehe [10:51] tmedema: tprice: I tried cloud9 once, it forced me to use a browser (thus significantly reducing screen space) and it had this vertical line through my code. Did not quite understand the debug feature either : ) [10:51] muk_mb: textmate+bundle to use jslint = great [10:51] tprice: cloud9 is good to start with.. [10:51] tmedema: muk_mb: jslint bundle> [10:52] tprice: thats all i can say [10:52] tmedema: ? [10:52] tprice: oh and for snips of code [10:53] muk_mb: tmedema: https://github.com/johnmuhl/javascript-tools-tmbundle [10:53] muk_mb: validate syntax = I use a ton [10:54] chapel: idk, I dont like using semi colons [10:54] chapel: and some other random quirks [10:54] muk_mb: hehe [10:54] chapel: so its easier to not use jslint or other validators [10:54] tmedema: muk_mb: thanks [10:54] tprice: what about this https://github.com/grumdrig/node-sqlite [10:54] tprice: has anyone got it to work? [10:54] muk_mb: I'm a fan of jslint cause it's the closest thing to compiler warnings we got. [10:55] chapel: I run my code [10:55] chapel: if i get an error, I fix it :P [10:55] muk_mb: not everything errors nicely [10:55] Somebi: notepad++ and winSCP sync/dirWatch [10:56] Evet has joined the channel [10:56] chapel: well I haven't been doing client code much lately [10:56] tprice: to much node ^^ [10:56] tprice: what about this https://github.com/felixge/node-mysql [10:57] tprice: i might give the mysql a try [10:57] muk_mb: all the js I write has code to test it and passes jslint's checks [10:57] Evet: minimum hardware reqs to run simple node.js apps efficiently? [10:57] muk_mb: and even then I spend hours tracking down weird crap [10:58] chapel: tprice: why do you need sql? [10:58] chapel: out of curiosity [10:59] tprice: im been pushed to use a db on the server [10:59] tprice: right now its all client side [11:00] chapel: but why sql? [11:00] muk_mb: any of you guys have an opinion about what blogging platform to use? wordpress? [11:00] chapel: not to say sql is bad, or whatever [11:00] chapel: but just curious what you are doing to need it [11:01] stride: muk_mb: looking for a self hosted solution or the wordpress.com thing? [11:01] muk_mb: I'd rather not host it myself, but I -could- [11:01] tprice: data store really [11:01] stride: muk_mb: with all the plugins & stuff available a self hosted wordpress is pretty nice imho [11:02] tprice: if the client goes down then there is no data archive [11:02] tprice: its kinda just a bit of a problem [11:02] stephank has joined the channel [11:02] chapel: tprice: check out node chaos for simplicity [11:02] mr_daniel has joined the channel [11:03] chapel: it is just a key value store on file system [11:03] chapel: couchdb is my preference for full blown databases [11:03] Figaroo has left the channel [11:03] muk_mb: stride: the only real requirement I have is that MarsEdit works with it, hehe [11:03] muk_mb: I'll just be posting stuff I figured out in code [11:03] chapel: posterous [11:03] chapel: posterous.com [11:04] chapel: simple, can be posted from email easily [11:04] chapel: full customizability theme wise [11:04] muk_mb: ooo [11:04] tprice: chapel: yeah i looked at couchdb but have not used it befor [11:04] tprice: but i think if i wnet with couchdb then i might go with mysql [11:04] muk_mb: let's see if it works with MarsEdit [11:05] chapel: if you went with couchdb, you would go with mysql [11:05] chapel: that doesn't make sense [11:06] tprice: if i was to go with couchdb.. i would reather go with mysql [11:06] muk_mb: aww, no support for Posterous [11:07] Jonasbn_ has joined the channel [11:08] chapel: tprice: why would you rather have mysql? how are you storing the data clientside? [11:08] chapel: what kind of data? [11:10] tprice: tprice> if the client goes down then there is no data archive [11:10] tprice: its sqlite and all kindas of data [11:10] tprice: really its a lot of data [11:10] chapel: okay, so you are using sql on the client side? [11:10] tprice: over the life of the app it would be masive [11:11] tprice: im sorry dude but third time its sqlite on the client [11:12] muk_mb: looks like only free blogs this supports are Blogger, Wordpress, Tumblr and Typepad [11:12] muk_mb: and others that I would have to host [11:12] Spion_ has joined the channel [11:12] tprice: but if i add a DB on the server then im ending up with 3 DB sets [11:12] chapel: eh, using sqlite doesn't explicitly mean you are using sql in your app [11:12] tprice: 2 client and one server [11:13] chapel: and for couchdb I wasn't recommending you run a local install [11:13] chapel: couchone.com [11:14] tmedema: vim is available on ubuntu right? [11:15] stride: yep [11:15] mgutz: how is couchdb on memory? mongodb is a hog. not good for small vps [11:16] chapel: idk about local installs, I dont use it locally [11:16] tprice: chapel: couchone.com its a nice idea but a local db is maybe 100X better [11:16] muk_mb: tumblr it is! [11:17] chapel: maybe 100x better, I highly doubt that, but you do what you think is best [11:17] mgutz: hard to beat the tried and true relational DBs on standard hardware, i can only dream of scaling to where mongodb and couchdb matters [11:18] tprice: its getting to become an abstraction and less of a core aspect [11:19] tprice: oh yeah i want it to be a core aspect [11:20] chapel: honestly the way couchdb works, I dont use it like many people use relational dbs [11:20] AndroUser has joined the channel [11:21] chapel: in that case, it is a data store, but no so much for reading performance [11:21] chapel: I am working in redis as my main reading data store [11:21] chapel: couchdb being the end data store, in case of failure [11:22] chapel: though, I am working on a couchapp, which uses couchdb as the application [11:22] mgutz: you must have decent hardware, i build stuff for small businesses with less than 2GB VPS [11:22] chapel: eh, personal pet projects [11:23] chapel: couchdb being hosted by couchone [11:23] mgutz: o i c [11:23] chapel: redis is light [11:23] chapel: well what I have used of it [11:23] chapel: I host on webfaction on their cheapest plan atm [11:23] tprice: im fdcserver [11:24] tprice: 256mb of ram [11:24] chapel: I get 80mb [11:24] chapel: but it doesnt count the OS [11:24] mgutz: webfaction has node? [11:24] chapel: webfaction lets you install anything you want [11:24] chapel: on your home directory [11:24] adambeynon has joined the channel [11:24] mgutz: wow for that cheap? [11:24] mgutz: nice [11:25] tprice: how much a month? [11:25] chapel: $8~ [11:25] tprice: and bandwidth? [11:25] chapel: I dont have anything node related in full production [11:25] tprice: HD space? [11:25] chapel: just pet projects [11:25] chapel: 600gb/m [11:25] chapel: 10gb/hd [11:26] aaronblohowiak: chapel: do you have a compiler and shell? [11:26] tprice: 10 is kinda small [11:26] mgutz: i pay $20/mo 512MB/16GB at Linode and its been great [11:26] tprice: are they usa based? [11:26] chapel: I like that I can easily expand to more machines for cheap and manage them all right there [11:27] aaronblohowiak: tprice: not for a small webapp [11:27] aaronblohowiak: mgutz: ooh, that is better than slicehost [11:27] chapel: aaronblohowiak: have full bash access to your home directory [11:27] chapel: can make new users [11:27] tprice: fdcservers is 256mb/ram 100gb/hd and unmetterd bandwidth [11:28] tprice: for 19$ [11:28] aaronblohowiak: "unmetered" [11:28] tprice: point been [11:28] chapel: for the price, it is comparable, because it is somewhat managed, meaning you have support to call on if needed [11:28] chapel: and its based in dallas [11:29] chapel: a full vps probably would be best if you have any kind of requirements, but for my hobby stuff it is really cheap [11:29] mgutz: i heard this is worth it, but you are on your own http://prgmr.com/xen/ [11:29] muk_mb: oh man, express does some awesome stuff that I definitely didn't notice [11:29] mgutz: one man shop [11:29] chapel: that I do host a lightly popular vbulletin based forum (which if you know anything about vb its a hog) [11:30] tprice: oh and fdc you can torrent :P [11:33] aklt has joined the channel [11:33] mgutz: you know why i like node? unit tests are blazing fast! tests in rails take forever [11:34] aaronblohowiak: mgutz: s/tests are/everything is/g [11:34] mies has joined the channel [11:35] mgutz: i've taken apart expresso so it emits status and you can run unit test as a connect plugin [11:35] sveimac has joined the channel [11:35] mgutz: easier to create any format you want [11:35] mgutz: working on the gui right now [11:35] chapel: hmm [11:35] chapel: I might be interested in that [11:35] chapel: I haven't been working with tests [11:36] chapel: but I am getting to a point where it makes sense to use them [11:36] mgutz: testing is everything :) [11:37] wasabist__ has joined the channel [11:37] fly-away has joined the channel [11:38] stagas has joined the channel [11:38] AndroUser2 has joined the channel [11:39] spolu has joined the channel [11:42] JojoBoss has joined the channel [11:43] unomi has joined the channel [11:55] sveimac has joined the channel [12:03] femtoo has joined the channel [12:08] sveimac has joined the channel [12:09] sveimac_ has joined the channel [12:15] SubStack: mikeal: you're in temescal eh? [12:15] Gruni has joined the channel [12:16] SubStack: so says the twitter [12:16] chapel: hmm, SubStack, question, if I were to use a loop to iterate through an array, and lets say inside the loop I .shift() the array, do the values stay numbered the same, just 0, then 1, then 2 get removed leaving 3 and so on? [12:17] sveimac_ has joined the channel [12:17] chapel: v8: Date.now() [12:17] v8bot: chapel: 1292761033096 [12:17] frodenius: chapel㇀ they do not [12:18] SubStack: a for loop or a forEach? [12:18] tmedema: stride: did you have to install any addons for vim for javascript/node? [12:18] chapel: so foreach or some actually iterate [12:19] frodenius: v8: a=[1,2,3]; s=""+a; for(i=1;i--;)a.shift(); s+='-'+a; s [12:19] SubStack: v8: var xs = [1,2,3,4]; var ys = []; xs.forEach(function (x,i) { xs.shift(); ys.push([x,i]) }); ys [12:19] v8bot: frodenius: "1,2,3-2,3" [12:19] v8bot: SubStack: [[1, 0], [3, 1]] [12:19] chapel: though if you used a for loop, the array shift would cause 1 to become 0? [12:19] SubStack: ^ surprising [12:19] SubStack: but you could just .slice() it [12:19] SubStack: v8: var xs = [1,2,3,4]; var ys = []; xs.slice().forEach(function (x,i) { xs.shift(); ys.push([x,i]) }); ys [12:19] v8bot: SubStack: [[1, 0], [2, 1], [3, 2], [4, 3]] [12:19] frodenius: err, toString has no indices :/ [12:20] chapel: okay, looks good [12:20] stride: tmedema: nah, I use a pretty basic setup with syntax highlighting, 2-spaced tabs and a keyboard shortcut for running 'node ' [12:20] chapel: how does .slice().forEach work, guess I am not familiar doing stuff like that [12:21] chapel: is the forEach with the shift sending the slice which to remove? [12:21] sveimac has joined the channel [12:21] langworthy has joined the channel [12:21] tmedema: stride: so does vim tell you about javascript errors etc.? [12:21] SubStack: slice() makes a copy with no args [12:22] stride: tmedema: nope, I only see them when I run stuff or my testcases. thought about adding some jslint shortcut to my config though [12:22] chapel: v8: var xs = [1,2,3,4]; var ys = []; xs.slice().some(function (x,i) { if(xs[i] != 3) {xs.shift(); ys.push([x,i])} }); ys [12:22] v8bot: chapel: [[1, 0], [3, 2], [4, 3]] [12:22] wilken has joined the channel [12:23] frodenius: why do you xs.shift() anyway? [12:23] tmedema: stride: is that easy, to add jslint to vim? [12:23] chapel: v8: var xs = [1,2,3,4]; var ys = []; xs.slice().some(function (x,i) { if(xs[i] == 3)return true; xs.shift(); ys.push([x,i]) }); ys [12:23] v8bot: chapel: [[1, 0]] [12:23] chapel: hmm [12:24] chapel: v8: var xs = [1,2,3,4]; var ys = []; xs.slice().some(function (x,i) { if(x[i] == 3)return true; xs.shift(); ys.push([x,i]) }); ys [12:24] v8bot: chapel: [[1, 0], [2, 1], [3, 2], [4, 3]] [12:24] wilken has joined the channel [12:25] stride: tmedema: didn't have time to really look into it but https://github.com/hallettj/jslint.vim looks okay [12:25] tmedema: okay [12:25] tmedema: thanks [12:26] chapel: hmm SubStack, I am wanting to remove array items in order from first to last, while stopping if I hit a specific variable [12:26] SubStack: why remove them? [12:26] chapel: I am using the array as a queue basically [12:26] SubStack: sounds like you want dropWhile? [12:26] chapel: hmm [12:26] chapel: never heard of it :P [12:27] Wizek: What kind of regexp would match everything except if the string is exactly "login.html" or "logout.html"? [12:28] wao: ! [12:30] SubStack: v8: Array.prototype.dropWhile = function (f) { for (var i = 0; i < this.length; i++) { if (!f(this[i])) break } return this.slice(i) }; [1,2,3,4,5].dropWhile(function (x) { return x < 3 }) [12:30] v8bot: SubStack: [3, 4, 5] [12:30] SubStack: or however [12:31] SubStack: it's from this: http://zvon.org/other/haskell/Outputprelude/dropWhile_f.html [12:31] Somebi has joined the channel [12:32] chapel: mochikit has dropwhile [12:33] Wizek: v8: "login.html".match(/[^(login\.html)]/) What am I doing wrong? [12:33] v8bot: Wizek: SyntaxError: Unexpected identifier [12:33] Wizek: v8: "login.html".match(/[^(login\.html)]/) //What am I doing wrong? [12:33] v8bot: Wizek: null [12:33] SubStack: brackets do not work that way [12:34] SubStack: v8: "login.html".match(/^(login\.html)/) [12:34] v8bot: SubStack: ["login.html", "login.html"] [12:35] chapel: v8: /^(login\.html)/.test('login.html') [12:35] v8bot: chapel: true [12:35] chapel: :) [12:35] SubStack: but why is your search string exactly the same as your regex? [12:35] chapel: I think he wanted to test the regexp [12:36] SubStack: but why test on that particular case? [12:36] Wizek: v8: /^(login\.html)/.test('logggin.html') [12:36] v8bot: Wizek: false [12:36] chapel: https://github.com/mochi/mochikit/blob/master/MochiKit/Iter.js#L324 << dropwhile [12:36] SubStack: but why use a regex at all for that? [12:36] SubStack: why not === 'login.html' ? [12:37] chapel: I think he wants to check if people are trying to use that [12:37] Wizek: SubStack: I use connect's router [12:37] chapel: and exclude it somehow [12:37] Wizek: and it't input is regexp [12:37] sveimac has joined the channel [12:37] SubStack: also you don't need the parens if you're not going to capture [12:37] SubStack: and what of trailing characters? [12:37] shimondoodkin: v8: /^(log+in\.html)/.test('logggin.html') [12:37] v8bot: shimondoodkin: true [12:38] Wizek: v8: /^(log+in\.html)/.test('login.html') [12:38] v8bot: Wizek: true [12:38] femtooo has joined the channel [12:38] SubStack: v8: /^login\.html/.test('login.htmlxlnns') [12:38] v8bot: SubStack: true [12:38] nail_: that is not a good way to use regexp for thatr but something like /^((?!^(login.html|logout.html)$).)*$/ should do it [12:38] spolu has joined the channel [12:39] shimondoodkin: nail_:thats better in general , im just playing [12:39] SubStack: what? that's not even valid [12:39] nail_: v8: /^((?!^(login.html|logout.html)$).)*$/.test('bonjour') [12:39] v8bot: nail_: true [12:39] SubStack: you can't anchor at the end of a capture group [12:39] shimondoodkin: i ment to match exectly with or [12:39] nail_: v8: /^((?!^(login.html|logout.html)$).)*$/.test('login.html') [12:39] v8bot: nail_: false [12:39] SubStack: ACTION is proven wrong [12:39] Wizek: nail_: Hah, I knew a regexp wizard will be here! Thanks :) [12:39] SubStack: still [12:40] shimondoodkin: v8: /^login.html|logout.html$/.test('login.html') [12:40] v8bot: shimondoodkin: true [12:40] shimondoodkin: v8: /^login.html|logout.html$/.test('logout.html') [12:40] v8bot: shimondoodkin: true [12:41] SubStack: I'm sure there's a better way to do it [12:42] Wizek: like : ^((?!^(login|logout)\.(html)$).)*$ :) [12:42] pwk0 has joined the channel [12:42] pwk0: hau [12:42] Wizek: or even ^((?!^(log)(in|out)\.(html)$).)*$ [12:43] femtoo has joined the channel [12:43] Wizek: how expensiv RegExps are in general? [12:43] pwk0: somebody willing to colaborate in a little node project? :D [12:43] SubStack: or if (path === '/login.html' || path === '/logout.html') [12:43] d0k has joined the channel [12:43] Wizek: SubStack: Nah, I already said that I cannot really do that [12:44] SubStack: if this is just a connect route [12:44] SubStack: then well [12:44] SubStack: sure you can [12:44] MattJ has joined the channel [12:44] Wizek: SubStack: how would you do it? [12:45] SubStack: ['login','logout'].forEach(function (file) { app.get('/'+file+'.html', function (req, res) { /* ... */ } }) [12:45] pwk0: maybe i should explain the idea: youtube videos to shoutcast; anything done before? [12:47] Wizek: SubStack: My internal parser tells me that this code does the opposit of what I want :) [12:47] Wizek: SubStack: Remember, true only if neither is found [12:48] Wizek: pwk0: What is a shoutcast? [12:48] SubStack: routes are fall-through so [12:48] SubStack: if you just have defined routes you can make a catch-all [12:48] pwk0: ejem, i know it sound noobie, just wanted to make it easy [12:49] sveimac has joined the channel [12:49] pwk0: i mean i want to let my friends commit youtube urls, download the videos, convert them and stream them in a common platform like shoutcast is [12:50] pwk0: i find the youtube playlists a pain and i also like to enjoy the music synchronously with my friends so we can comment etc [12:50] pwk0: basically would be a social radio platform [12:50] Wizek: SubStack: And can I somehow pass arguments through this fall-through arcitect? Like Session id... [12:52] Wizek: pwk0: So you want node to make sure video is in sync, and send comments to all watchers like in a chat? [12:52] chapel: hmm [12:52] pwk0: no, video is deprecated, just the sound will be streamed [12:53] pwk0: as a really bunch of software support shoutcast streams will be ideal [12:53] pwk0: anyways it can easily stream in different formats [12:54] pwk0: in a more advanced state we can also stream the video and make it a social tv :) [12:56] SubStack: Wizek: testing [12:57] Evet_ has joined the channel [12:57] stagas has joined the channel [12:57] sveimac has joined the channel [12:59] pwk0: Wizek: interested or just curious? :D [13:00] alek_br has joined the channel [13:00] SubStack: Wizek: https://gist.github.com/747312 [13:02] Wizek: pwk0: It would be a great chance to gain experience by participating in a Node project, but I'm not particularly interested in making a shoutcast. [13:02] Wizek: SubStack: checking out [13:03] stagas_ has joined the channel [13:03] derren13 has joined the channel [13:03] pwk0: Wizek: I'm open to new ideas, I would just like to start a project that is not a todo app :D [13:04] mraleph has joined the channel [13:04] SubStack: I'd love to hack up a todo app [13:04] pwk0: :D [13:04] pwk0: with all my respects to the todo app foundation :D [13:04] SubStack: nice break from all this other stuff I've had to write [13:05] SubStack: I seem incapable of pacing myself [13:06] Wizek: SubStack: 1) Shouldn't app.get's fns have a next argument? 2) Where is the argument passing which I talked about? :D [13:06] SubStack: argument passing? [13:06] SubStack: next? [13:06] SubStack: not needed [13:08] Wizek: SubStack: "And can I somehow pass arguments through this fall-through arcitect? Like Session id..." <-- This line. [13:08] SubStack: I'm not sure what you mean [13:08] Wizek: I'll explain: [13:12] Wizek: SubStack: SID (session ID) is stored in cookie. Every request which hits my server is checked against valid SID the client provides. If missing or invalid, all requests are bounced res.writeHead(302, {'Location': "login.html", Set-Cookie':'SID=EXPIRED;Expires=Mon, 01-Jan-1990 00:00:00 GMT'}) to login.html. So, I need to exclude login.html from SID checking obviously. If the SID validates to be OK, the request is let through to be handled [13:13] jashkenas has joined the channel [13:13] Evet has joined the channel [13:15] stagas_ has joined the channel [13:15] daglees has joined the channel [13:16] shinmei has joined the channel [13:16] unomi has joined the channel [13:17] chapel: hrm [13:17] chapel: SubStack: I am trying to use your dropWhile, but it doesn't seem to have the expected behavior [13:18] pwk0: unit testing to the rescue... [13:19] SubStack: Wizek: like this? https://gist.github.com/747324 [13:19] chapel: v8: Array.prototype.dropWhile = function (f) {for (var i = 0; i < this.length; i++) {if (!f(this[i])) break}return this.slice(i)}; [{id: 1, date: Date.now()+1},{id: 2, date: Date.now()+5},{id: 3, date: Date.now()+20},{id: 4, date: Date.now()-4}].dropWhile(function (x) { return x['date'] < Date.now()+4 }) [13:19] v8bot: chapel: [{"id": 2, "date": 1292764776359}, {"id": 3, "date": 1292764776374}, {"id": 4, "date": 1292764776350}] [13:20] chapel: my intent is to check the date [13:20] d7777777 has joined the channel [13:20] stagas has joined the channel [13:20] SubStack: yep what's wrong with that output? [13:21] stagas: in express you can do app.get('/', middleware, middeware, ..., handler) [13:21] Wizek: SubStack: taking a look [13:21] chapel: is the output the ones that don't match the check? [13:21] SubStack: chapel: no [13:22] SubStack: v8: Array.prototype.dropWhile = function (f) { for (var i = 0; i < this.length; i++) { if (!f(this[i])) break } return this.slice(i) }; [1,1,2,5,4,1,0,4].dropWhile(function (x) { return x < 3 }) [13:22] v8bot: SubStack: [5, 4, 1, 0, 4] [13:23] chapel: yeah it stops dropping at the first positive result? [13:23] chapel: err [13:23] chapel: opposite of whats in the annon function right? [13:24] SubStack: drops elements while the predicate it true [13:24] saschagehlich has joined the channel [13:24] saschagehlich: what exactly does the error "Cannot read property 'instrumentLineNumber' of undefined" in jade mean? [13:29] smh has joined the channel [13:31] chapel: hmm SubStack well I need to do something with the array items I am removing [13:31] cognominal has joined the channel [13:32] chapel: that is why I was using shift() [13:32] SubStack: then you want takeWhile? [13:33] chapel: well I want to both drop the values, but also capture them for a one time use [13:33] chapel: so as I drop them, I want to send the value to do something else [13:34] SubStack: so some sort of find() that returns an index for the first predicate that returns true [13:37] chapel: hmm, so looking at your dropWhile, it loops through the array checking to see if the argument in the anon func matches, as long as it does, it keeps looping, the moment it doesn't match, it breaks out and you send back the array spliced from the array item that wasn't true? [13:37] stbuehler: Array.prototype.span = function(f) { for (var i = 0; i < this.length; i++) { if (!f(this[i])) break; } return [ this.slice(0,i), this.slice(i) ]; }; [13:38] SubStack: oh right, span [13:38] chapel: hmm, so the first will be the array of items that were removed, and the second are whats left? [13:39] stbuehler: there is nothing modified, so i wouldn't call them "removed" [13:39] chapel: hmm [13:39] stbuehler: you could of course use splice in you dropWhile, and modify the original array [13:40] stbuehler: but then i would rename it to removeWhile, so it is clear to the reader that the array gets modified [13:41] chapel: seems like span works like I am wanting [13:41] SubStack: don't mutate without a good reason at the same time [13:41] mbrochh has joined the channel [13:42] stbuehler: "performance" can be a good reason, but it should be obvious what is happening in the context :) [13:43] chapel: well at this point I am just figuring out things I can do with js, still fairly new, I dont have a great background in any other language other than php, and then its fairly hackish [13:51] altamic has joined the channel [13:54] pwk0: v8: Array.prototype.discriminate = function(f){ return [this.filter(function(x){return f(x)}),this.filter(function(x){return !f(x)})] }; [1,2,3,4].discriminate(function (x){ return x<3 }); [13:54] v8bot: pwk0: [[1, 2], [3, 4]] [13:54] pwk0: i was looking for a non breaker way :) [13:56] dipser has joined the channel [13:58] chapel: interesting [14:00] pwk0: yea, but maybe will not suit your problem [14:00] chapel: well it could, how efficient is filter? [14:01] pwk0: it should be efficient enough :) nah, I'm really not an expert, dunno if is a native implementation or? [14:02] stbuehler: slice has at least the chance to use copy-on-write, filter doesn't :) [14:03] pwk0: > Array.prototype.filter.toString(); [14:03] pwk0: 'function filter() { [native code] }' [14:03] pwk0: at least is native yea :) [14:03] pwk0: oops, true stbuehler [14:03] stbuehler: and discriminate will call f twice on each element [14:03] pwk0: yes, also true [14:04] pwk0: I suppose it can archieve better results implemented as recursive [14:04] dipser has joined the channel [14:04] stbuehler: uhmm.. recursive? doubt that :) kills the stack :D [14:06] pwk0: hmm then how this can be done? [14:06] pwk0: without filter [14:06] stbuehler: similar to how you would implement filter, just that you need two result lists [14:07] pwk0: so its not possible to direct return the result without allocating the lists? [14:09] stbuehler: i guess [14:10] stbuehler: btw ArrayFilter: http://code.google.com/p/v8/source/browse/trunk/src/array.js?r=6075#868 [14:13] pwk0: that returns the deprecated items? [14:15] Hello71 has joined the channel [14:17] pwk0: well, I can no better than https://gist.github.com/747353 :( [14:18] enotodden has joined the channel [14:19] stagas has joined the channel [14:19] linac: http.response.write accept string/buffer/array, why array here? [14:19] stbuehler: looks good enough (i don't know whether a.push(x) or a[old_length++] = x is faster) [14:20] enotodden has joined the channel [14:21] enotodden has joined the channel [14:21] pwk0: yeah, but that makes me keep track of old length? [14:22] pwk0: or target_array.length? [14:22] hlindset has joined the channel [14:24] stbuehler: pwk0: keeping track of the length, like the ArrayFilter does [14:25] pwk0: aha, also arrayfilter implements fool-proof function checking, but I like the raw mode :D [14:29] saschagehlich: how can I use the inline replacement syntax (#{myvariable}) without escaping the content in jade? [14:30] hellp has joined the channel [14:31] PyroPeter has joined the channel [14:34] InsDel has joined the channel [14:38] aaronblohowiak: saschagehlich: have ou tried ${} [14:38] saschagehlich: nope, not yet. will this work? never heard of that one [14:40] aaronblohowiak: i dunno, looks like it from the source [14:45] demolithion has joined the channel [14:46] aaronblohowiak: *shrug* [14:46] aaronblohowiak: actually [14:46] aaronblohowiak: hmm [14:46] aaronblohowiak: there may not be a way [14:46] jvolkman_ has joined the channel [14:48] mbrochh: damn... i'm so tired, my brain refuses to work... how do you call it when you add another repo to your git repo? [14:48] Hello71 has joined the channel [14:48] Hello71 has joined the channel [14:48] aaronblohowiak: submodule or adding another origin? [14:49] mbrochh: aaronblohowiak, thanks man. submodule was what i need to google for :) [14:49] aaronblohowiak: k [14:49] aaronblohowiak: night! [14:56] arpegius has joined the channel [14:57] Evet_ has joined the channel [14:59] cheney has joined the channel [15:00] cheney: I am attempting to execute http://prettydiff.com/prettydiff.js in http://prettydiff.com/api.js [15:00] cheney: i know prettydiff.js is solid, but when executed by node this error is returned: "object is not a function" [15:01] temp01: you're using something dom specific? [15:01] cheney: i know prettydiff.js is solid, because I am constantly using it and working on it from the client side [15:01] cheney: and it passes jslint [15:02] cheney: there is only one DOM call in prettydiff, and it is intentionally isolated inside a condition [15:02] temp01: what object is it complaining about? [15:02] temp01: check the stacktrace and line [15:03] cheney: the error says [15:03] cheney: at Object.CALL_NON_FUNCTION (native) [15:04] cheney: at IncomingMessage. (/pathto/api.js:147:14) [15:06] cheney: the error appears to point to "p" of "prettydiff" on the line where that function is referenced [15:07] temp01: oh yes [15:07] temp01: you need to export it [15:08] temp01: check the modules/require documentation [15:08] cheney: oh? I am using require("./prettydiff") because the filename is prettydiff.js [15:08] temp01: in the prettydiff.js, you need to exports.prettydiff = prettydiff; at the end of the file [15:09] cheney: ah ok [15:09] cheney: thank you [15:11] AAA_awright_ has joined the channel [15:17] MattDiPasquale has joined the channel [15:18] Evet has joined the channel [15:24] cheney: node doesn't have a document object does it? [15:25] cheney: i am just trying to think of a way to add exports to my file conditionally if a DOM is not available [15:26] MikhX has joined the channel [15:27] temp01: if(typeof exports != "undefined") [15:27] vineyard: if(typeof(document) == 'undefined')) [15:27] temp01: don't do that [15:27] vineyard: why? [15:28] cnus8n has joined the channel [15:29] temp01: what he really wants to do is add it to exports if exports object is available.. not if 'dom is not available' [15:29] vineyard: oh, that's true [15:29] maushu: var undefined; if (exports !== undefined) doSomething(); [15:29] temp01: 'undefined' [15:30] temp01: oh wait. without typeof, it'll error out [15:30] vineyard: yups [15:30] enotodden has joined the channel [15:30] stride: maushu: if I ever encounter a script that overwrites undefined so that the var undefined; step is necessary in my code I'll hunt down the person responsible for it.. :) [15:30] maushu: HUNT! [15:31] sid3k has joined the channel [15:31] stride: too lazy. [15:32] rburhum has joined the channel [15:34] cheney: thanks again temp01 [15:36] altamic has joined the channel [15:37] liar has joined the channel [15:37] [[zz]] has joined the channel [15:38] liar has joined the channel [15:43] neynenmo has joined the channel [15:49] enotodden has joined the channel [15:53] Blackguard has joined the channel [15:55] JimBastard has joined the channel [15:55] JimBastard: where is cramfroce [15:55] JimBastard: cramforce [15:56] markwubben has joined the channel [15:59] chapel: hola JimBastard [15:59] JimBastard: hey chapel [15:59] JimBastard: morning [15:59] JimBastard: ive been going crazy trying to get streamie going [15:59] JimBastard: again [15:59] chapel: morning, it is my evening, but same difference [15:59] chapel: streamie? [16:01] JimBastard: streaming twitter client by malte uble [16:01] JimBastard: ubl [16:01] JimBastard: craaaamforce [16:03] chapel: dont think he is here [16:06] shinmei: chapel where are you ? [16:06] chapel: where am I? [16:06] chapel: washington state [16:06] chapel: Spokane, WA / Cloudy / 21°F -6°C / Humidity: 92% / Wind: NE at 6 mph [16:06] shinmei: oh ok [16:06] shinmei: thought you were in Europe, it's evening here ;) [16:06] chapel: Weather for Spokane, WA · 21°F (-6°C) · Humidity: 92% · Mostly Cloudy · Wind: North at 0 mph · Last Updated on December 19, 6:53 AM PST [16:06] chapel: better script [16:06] chapel: I made both :P [16:07] shinmei: nice :) [16:07] shinmei: does is work for : Saint-Denis, Reunion Island, Indian Ocean ? [16:07] chapel: Weather for Indian, AK · 6°F (-14°C) · Humidity: 87% · Partly Cloudy · Wind: ESE at 4 mph · Last Updated on December 19, 6:53 AM AKST [16:07] chapel: Weather for Ile Europa, Reunion Island · 89°F (32°C) · Humidity: 49% · · Wind: SW at 7 mph · Last Updated on December 18, 4:00 PM RET [16:08] chapel: Weather for Saint-Denis, France · 43°F (6°C) · Humidity: 87% · Mostly Cloudy · Wind: SW at 15 mph · Last Updated on December 19, 5:00 PM CET [16:08] shinmei: the second is better [16:08] shinmei: 32°C, seems nice ;p) [16:08] shinmei: 8:08 pm [16:11] jvolkman_ has joined the channel [16:14] sivy has joined the channel [16:20] stagas has joined the channel [16:29] herbySk has joined the channel [16:32] MrTopf has joined the channel [16:32] nonnikcam has joined the channel [16:32] Gruni has joined the channel [16:34] esigler has joined the channel [16:36] jstemmer has joined the channel [16:39] Yuffster has joined the channel [16:43] Yuffster_ has joined the channel [16:47] gf3 has joined the channel [16:55] bingomanatee: Has anyone used geddy? [16:57] arpegius has joined the channel [16:59] gl1 has joined the channel [17:01] jason: hello [17:01] Guest77651: Are there any modules for consistent hash? [17:03] daniello_ has joined the channel [17:04] derren13 has joined the channel [17:04] daniello_: Greetings, What version of javascript is Node.js using? I've been trying to find Object.create in the lib directory, but can't find it. I thougth ECMAScript 5 wasn't here yet... [17:04] daniello_: ? [17:05] drudge: https://github.com/ry/node/wiki/ECMA-5-Mozilla-Features-Implemented-in-V8 [17:06] Guest77651: nick jason.green [17:06] daniello_: drudge++ [17:06] v8bot: daniello_ has given a beer to drudge. drudge now has 1 beers. [17:06] daniello_: drudge: thank you!!!! [17:06] drudge: no problem [17:06] jasongreen: hi all [17:07] jasongreen: Which module could help me to use CRC32 algorithms [17:14] AAA_awright has joined the channel [17:15] steffkes has joined the channel [17:18] JimBastard has joined the channel [17:21] wilken has joined the channel [17:21] femtoo has joined the channel [17:23] gf3` has joined the channel [17:26] peritus_ has joined the channel [17:26] bingomanatee: does google app engine support node? [17:28] stride: nope [17:29] peritus_ has joined the channel [17:29] hornairs has joined the channel [17:33] siong1987 has joined the channel [17:33] chapel: drudge++ [17:33] v8bot: chapel has given a beer to drudge. drudge now has 2 beers. [17:33] pHcF: my node.js blog system http://67.202.108.169:3000/ :) [17:34] chapel: looks nice pHcF [17:34] pHcF: :) [17:34] chapel: did you make the back end code yourself too? [17:34] stride: eh? [17:34] pHcF: yeah [17:34] pHcF: all the code is mine [17:34] pHcF: and it is mysql based :D [17:34] chapel: except the theme? [17:34] pHcF: yeah, except the theme :P [17:34] pHcF: im not a good designer at all [17:34] pHcF: actually, i used a wordpress theme [17:35] daniello_ has left the channel [17:35] pHcF: but the blog system supports plugins, themes, multiple users, comments, etc [17:36] chapel: you gonna open source it? [17:39] bingomanatee_ has joined the channel [17:40] pHcF: chapel: it is opensource :D [17:40] pHcF: https://github.com/pedrofranceschi/Blogode [17:41] cardona507 has joined the channel [17:43] vandenoever has joined the channel [17:43] vandenoever has joined the channel [17:44] Throlkim has joined the channel [17:45] ben_alman has joined the channel [17:45] bingomanatee: are there any no.de people here? I was taken through the program in node camp but I was kind of brain-stoned at that point. [17:48] pHcF: v8bot: i removed the code from the old template [17:48] v8bot: pHcF: Use v8: to evaluate code or "`v commands" for a list of v8bot commands. [17:48] pHcF: http://67.202.108.169:3000/ [17:49] pHcF: stride: i removed the code from the old tempalte [17:49] pHcF: template (the wordpress one) http://67.202.108.169:3000/ [17:49] shimondoodkin has joined the channel [17:49] stride: :) looks great, I prefer to stay at wordpress for blogging though, love all the available plugins, admin stuff, the api, .. [17:50] AAA_awright_ has joined the channel [17:50] pHcF: stride: the idea is to have all the wordpress featuers in the future [17:50] pHcF: API, etc [17:50] pHcF: im gonna start writing a documentation [17:51] pHcF: oh, to use the admin panel, go to http://67.202.108.169:3000/admin user testuser passwd betatest [17:51] teemow has joined the channel [17:51] stride: you know how many workhours are in the current wordpress version? :) [17:51] pHcF: betatester* [17:51] pHcF: stride: yeah, i know [17:52] stride: not to discourage you though :) good luck with it [17:52] stride: oh nice, TinyMCE, isn't it? [17:52] pHcF: yeah [17:52] dguttman has joined the channel [17:52] pHcF: the thing is that is scales multiple requests nicely [17:53] pHcF: like 500 simultaneous requests using no more than 100mb. of ram [17:53] teddy_ has joined the channel [17:53] pHcF: normaly using 20mb. [17:53] ceej has joined the channel [17:54] stride: :) nice [17:55] spetrea has joined the channel [17:56] shimondoodkin: I think there is a strange bug, can it be posible that nodejs or v8 make function execution between processes , i see a log recorded on one domain, and execution log on another [17:58] arpegius_ has joined the channel [17:59] shimondoodkin: the difference betrween the two ambigues function is file path and process, the file i node might be the same, i did copy -al [17:59] jpld has joined the channel [17:59] shimondoodkin: ryah: any idea? [18:00] larssmit has joined the channel [18:01] MattDiPasquale has joined the channel [18:02] larssmit has joined the channel [18:03] jakehow has joined the channel [18:04] siong1987 has joined the channel [18:04] softdrink has joined the channel [18:06] vandenoever: what is a good db for use with node.js? [18:06] drudge: mongodb, couchdb [18:06] shimondoodkin: vandenoever:whatether but not mysql [18:06] shimondoodkin: vandenoever:whatever but not mysql [18:06] vandenoever: is there one that can just open a file like sqlite? [18:07] vandenoever: without separate process [18:07] shimondoodkin: ther eis sqlite [18:07] shimondoodkin: there is sqlite [18:07] jbergstroem: vandenoever: the question is rather "which db is best for storing this kind of data: ... , and how do i use it from node.js" :-) [18:08] vandenoever: jbergstroem: well, i'm storing a proxy log, all headers and data send and retrieved [18:08] vandenoever: ideally it has good querying speed and text indexing [18:08] shimondoodkin: it is very convinient to use mongodb or couchdb because the data is stored and retrived as a javascript object [18:09] jbergstroem: text indexing is a nail biter here, but perhaps read this post: (related to both couch and mongo) http://blog.mongodb.org/post/1200539426/archiving-a-good-mongodb-use-case [18:09] vandenoever: well, i can always us another program for indexing and searching [18:09] shimondoodkin: mongodb is momory based so it is for consideration [18:10] jashkenas has joined the channel [18:10] shimondoodkin: there are indexes in both databases [18:10] q_no has joined the channel [18:10] jbergstroem: vandenoever: perhaps related is also this: http://jira.mongodb.org/browse/SERVER-380 [18:11] q_no: Hi, I just upgraded nodejs,socket.io and socket.io client libs and now the xhr responses contain weird character like "~m~16~m~7822033911943436~m~55~m~~j~" [18:11] q_no: has anyone seen something like this? [18:14] donny has joined the channel [18:18] vandenoever: since the proxy can save large blobs 10 - 100 mb, i'm not sure mongodb is the best choice [18:20] jbergstroem: vandenoever: what about plain ol' tcpdump? [18:21] drudge: huh http://kodapp.com/ [18:22] vandenoever: jbergstroem: as a caching proxy? [18:22] jbergstroem: vandenoever: no, as intercepting traffic and being able to work with it [18:23] vandenoever: jbergstroem: the usecase is to have a proxy that can be outside of the lan that logs, filters and caches [18:24] ewdafa has joined the channel [18:24] brianmario has joined the channel [18:24] jbergstroem: vandenoever: haven't worked very often with storing huge blobs based on above premises (well, intercepting based on filters) - so i'm not much help in datastore. If you have little traffic i guess any will do [18:25] vandenoever: jbergstroem: yes, it's for personal use [18:25] vandenoever: jbergstroem: i want to make all my web access logged and searchable [18:26] vandenoever: so i can search for things more targeted and with more privacy then when using google [18:26] jbergstroem: vandenoever: i'd probably use a mix of mongodb (for simplicity and reliability - see http://blog.mongodb.org/post/183689081/storing-large-objects-and-files-in-mongodb ) , and xapian for searching/indexing. [18:26] vandenoever: jbergstroem: i cannot use xapian for indexing, i'd use strigi [18:26] jbergstroem: the upside of using mysql/postgres (as stated above, for personal use, any will do) - you'll get a basic search for "free" [18:27] jchris has joined the channel [18:27] isaacs has joined the channel [18:27] vandenoever: if i download an rpm or tar or mail, strigi will index the contents too [18:27] vandenoever: it uses lucene type storage [18:28] peritus_ has joined the channel [18:31] vandenoever: i think i'll try mongodb for metadata and filesystem for the file contents [18:31] joemccann has joined the channel [18:31] joemccann: sup ya'll [18:34] cjm has joined the channel [18:37] shimondoodkin: vandenoever: casandra is good for larga data but i think there are bad bindings yet and casandra is might be complicated to start [18:37] shimondoodkin: also it requires a binlog disk [18:39] tapwater has joined the channel [18:42] jchris has joined the channel [18:48] BrianTheCoder has joined the channel [18:52] sugardave has joined the channel [18:52] pjackson has joined the channel [18:52] liar has joined the channel [18:55] boaz has joined the channel [18:55] wilken: does anyone know if anyone is maintaining the node-couchdb lib? [18:55] bluegene has joined the channel [18:58] sriley_ has joined the channel [18:59] Throlkim has joined the channel [19:00] jacobolus has joined the channel [19:00] Me1000 has joined the channel [19:02] mikedeboer has joined the channel [19:05] jacobolus has joined the channel [19:06] tekky has joined the channel [19:08] steffkes: when forever doesn't respond with _any_ message on ubuntu, running within an AWS EC2 Instance .. where to start searching!? [19:09] AAA_awright_ has joined the channel [19:09] muk_mb has joined the channel [19:10] steffkes: ah, now it's working .. well =) [19:10] sudoer has joined the channel [19:12] jpld has joined the channel [19:14] marko has joined the channel [19:15] marko: I'm having a really weird problem.. I have a script that start server but now when I try to connect, I get connection refused. [19:16] marko: The script worked great few days back but now this.. I wonder if there's some new bug in 0.3.2 because that's the only thing I have updated in the past few days. [19:16] mikeal has joined the channel [19:18] Wizek: How can I make an input type="submit" not to reload the page, but let javascript deal with what should be done when clicked? [19:19] tek has joined the channel [19:19] MattDiPasquale has joined the channel [19:20] arrty: onclick="function()" [19:20] arrty: return true in that function if you want it to submit [19:20] arrty: false to cancel [19:20] Wizek: oh [19:20] Wizek: good [19:20] Wizek: so, I can also have onclick=false right? [19:21] arrty: are you trying to never submit the form ? [19:21] Wizek: it will be handled by custom JS [19:22] arrty: maybe you shouldn't even surround the input elements in a form then [19:22] arrty: and i misspoke,
... function onEnter() { if(event.keyCode == 13) { // on enter } [19:23] marko: you might want to avoid inline JS [19:24] BrianTheCoder has joined the channel [19:24] marko: inline JS is something that's always going to bite you when you need to debug the thing like 2 months later. [19:25] Wizek: marko: Then how to do it other way? [19:25] arrty: what would you recommend? [19:25] arrty: all serverside ? [19:25] marko: the easiest way would be using jquery and doing simple $('#button_id").click(function(){ .. your code here .. }) [19:25] marko: ah, serverside [19:26] marko: well, that's a bit different then :) [19:26] Wizek: marko: No, it's client side [19:26] Wizek: and also, I already have that [19:27] arrty: basically he has a form that he doesn't ever want submitted to reload the page [19:27] Wizek: the problem is that it actually tries to POST the info to the server, but I don't want that [19:27] marko: yeah, just use return false to skip it [19:27] Wizek: (or PUT, I never know the diff between these two) [19:27] marko: but you have to bind the event to something [19:27] marko: and jQuery offers the easiest crossbrowser way to do it [19:27] arrty: honestly i do this everywhere just without any form tags [19:27] namelessnotion_ has joined the channel [19:28] arrty: but return false works [19:28] marko: Wizek: you might want to read about something called REST [19:28] marko: you are going to need to know the difference between PUT, POST, DELETE, GET and HEAD if you ever need to do a modern webapp :) [19:28] Wizek: marko: Thanks young jQuery advocate, but I already use (and love) that one. :) [19:29] marko: heh, I'm actually moving to Dojo from jQuery :) [19:29] Wizek: why? [19:29] stride: marko: you need REST for a modern webapp? come on, nobody with money cares if you kill other developers cats by using SOAP and WS* stuff.. :) [19:29] marko: I just recommend jQuery to everybody because it's generally easier for normal frontend guys :) [19:30] Nacho has joined the channel [19:30] marko: Wizek: well, let's just say that jQuery is awesome for your average UI stuff but when you start to use JS for let's say processing & manipulating data, jQuery lacks tools for that (it wasn't designed for that either). [19:31] Wizek: hmm, you made me interested :) [19:31] marko: heh [19:31] Wizek: so they aren't a replacement for each other [19:31] marko: if you need to do simple AJAX & etc. basic form stuff, stick with jQuery [19:31] marko: no [19:32] marko: you can pretty much do everything with Dojo you could with jQuery but jQuery is bit easier sometimes [19:33] marko: then there's Prototype which has better inheritance stuff than Dojo :) [19:33] cafesofie has joined the channel [19:33] teemow has joined the channel [19:33] SamuraiJack_ has joined the channel [19:34] Wizek: okay, okay, enough already, this will take my attention from my main project which is more back end :D [19:34] marko: but one thing I see too often is that people who argue about frameworks don't really know javascript so they depend on specific framework without understanding why certain framework is designed the way it is and why & when you would want to use them :) [19:35] hoeru has joined the channel [19:36] marko: and that's when you people who are trying to use jQuery in NodeJS [19:36] marko: "when you _get_" [19:36] marko: Wizek: if you want a great backend framework to help you out, check out Underscore [19:37] marko: works great with Node [19:37] marko: or it's more like a collection of helper methods :) [19:39] matjas has joined the channel [19:40] Alex3000 has joined the channel [19:41] pandark_ has joined the channel [19:42] tg has joined the channel [19:43] tobeytailor has joined the channel [19:48] AAA_awright: Jade is html encoding my things that weren't previously html encoded, what's going on here? [19:48] AAA_awright: (I'm pretty sure it's Jade) [19:50] softdrink has joined the channel [19:50] SamuraiJack__ has joined the channel [19:50] marko has joined the channel [19:51] jchris1 has joined the channel [19:54] marko: nice.. now my Node is crashing with Segmentation Fault everytime :/ [19:54] mcarter has joined the channel [19:54] AAA_awright_ has joined the channel [19:56] muk_mb: lol @ HTTP error 418 [19:58] AAA_awright: Who changed Jade on me? [19:59] sveimac has joined the channel [20:00] Gruni has joined the channel [20:05] enotodden has joined the channel [20:07] hornairs has joined the channel [20:07] aconbere has joined the channel [20:08] Vertice has joined the channel [20:08] wilmoore has joined the channel [20:09] muk_mb: does anyone have a clean example of file upload handling? or is there a module that does that nicely? [20:12] marko: muk_mb: let me know if you find any :) [20:12] bingomanatee_ has joined the channel [20:12] bingomanatee_: Made my first node thing! http://narrative.mylinkedface.com/ [20:13] marko: congrats [20:14] muk_mb: marko: found https://github.com/felixge/node-formidable, gonna try it [20:14] marko: heh, I actually have that installed but I've only used it for POST parsing [20:15] namelessnotion has joined the channel [20:15] bingomanatee_: Is there any self contained node email server yet? [20:16] marko: nice. I just found a bug in V8.. [20:17] bingomanatee_: WTF! Register is spamming my site! [20:18] AAA_awright: muk_mb: That library was really hard for me to try and figure out but it does work [20:19] muk_mb: sweet [20:19] noahcampbell has joined the channel [20:23] unomi has joined the channel [20:26] intacto has joined the channel [20:26] intacto: hello [20:26] intacto: I asked it also on mailing list without a response [20:27] intacto: I have a multiplayer game with 2000 average users. After a few minutes the server is started, the uncaughtException log is getting full of errors like below: [20:27] intacto: Error: assertion errorat node.js:27:17at Timer.callback (timers.js:92:28) [20:28] marko: are you using HTTPS? [20:28] intacto: no [20:28] marko: ok.. that's been causing some problems lately [20:28] intacto: using v0.3.1 [20:29] intacto: i switched to stable branch now [20:29] marko: have you tried 0.3.3-pre? [20:29] intacto: no [20:29] intacto: will try it right now [20:29] marko: ok.. maybe you get lucky and the bug has been fixed already :) [20:30] intacto: in stable branch there is no error like that, but seems like some of my timeouts work async [20:30] intacto: I mean cleartimeout works after the function under it [20:31] intacto: so settimeout callback runs even if I canceled it with cleartimeout [20:31] intacto: nevermind I will try my luck with 0.3.3 now .) [20:33] arrty_ has joined the channel [20:33] sechrist has joined the channel [20:36] intacto: I can download it with this link right? https://github.com/ry/node/tarball/master [20:38] yonkeltron: i've created my package.json file to the point where i believe it to be correct but i'm unsure about why, after an npm link, i wouldn't be able to require it from node [20:45] yonkeltron: hooray! i just published my first npm module! [20:46] perlmonkey2 has joined the channel [20:47] dguttman has joined the channel [20:47] baoist has joined the channel [20:47] stagas has joined the channel [20:48] d0gie: stagas: is that your geoip service in the wargamez bot? thanks for that! [20:48] arrty has joined the channel [20:50] thecoon_ has joined the channel [20:51] perlmonkey2: How would you do DB access from node.js? [20:52] AAA_awright: perlmonkey2: With a module that does database access [20:56] Aria has joined the channel [20:58] thecoon has joined the channel [21:06] sepehr has joined the channel [21:06] muk_mb: who was it that got formidable working? [21:09] muk_mb: my fs.rename is failing inside form.parse's callback, but when I look in the /tmp/ directory, the file is there like it should be [21:10] AAA_awright: muk_mb: You lost your backlog already? [21:11] muk_mb: couldn't find it [21:11] AAA_awright: muk_mb: This is what I ended up needing to do http://pastebin.com/9Xvgscpz [21:12] muk_mb: This is what I have: https://gist.github.com/747688 [21:12] AAA_awright: And actually that doesn't support file uploads at all [21:13] stagas has joined the channel [21:14] muk_mb: oh? [21:14] sh1mmer has joined the channel [21:15] FMJaggy has joined the channel [21:16] kkaefer has joined the channel [21:17] bartt has joined the channel [21:18] r00s has joined the channel [21:19] Druide_ has joined the channel [21:20] mrkurt___ has joined the channel [21:20] sstephenson has joined the channel [21:20] ebii has joined the channel [21:20] wang_ has joined the channel [21:20] torvalamo has joined the channel [21:20] skohorn has joined the channel [21:20] dguttman has joined the channel [21:20] intacto has joined the channel [21:20] wilmoore has joined the channel [21:20] enotodden has joined the channel [21:20] Gruni has joined the channel [21:20] AAA_awright has joined the channel [21:20] hoeru has joined the channel [21:20] jpld has joined the channel [21:20] ewdafa has joined the channel [21:20] vandenoever has joined the channel [21:20] bingomanatee has joined the channel [21:20] nonnikcam has joined the channel [21:20] markwubben has joined the channel [21:20] Blackguard has joined the channel [21:20] [[zz]] has joined the channel [21:20] altamic has joined the channel [21:20] hlindset has joined the channel [21:20] dipser has joined the channel [21:20] saschagehlich has joined the channel [21:20] d7777777 has joined the channel [21:20] Jonasbn_ has joined the channel [21:20] maushu has joined the channel [21:20] rwhitby has joined the channel [21:20] linac has joined the channel [21:20] tprice has joined the channel [21:20] themiddleman has joined the channel [21:20] blowery has joined the channel [21:20] kawaz_home has joined the channel [21:20] xSmurf has joined the channel [21:20] d0gie has joined the channel [21:20] janne has joined the channel [21:20] mqt has joined the channel [21:20] beawesomeinstead has joined the channel [21:20] Dreamer3_ has joined the channel [21:20] DoNaLd` has joined the channel [21:20] ajpiano has joined the channel [21:20] sprout1 has joined the channel [21:20] eee_c has joined the channel [21:20] sonnym has joined the channel [21:20] unlink has joined the channel [21:20] maqr has joined the channel [21:20] stalled has joined the channel [21:20] marienz has joined the channel [21:20] CIA-93 has joined the channel [21:20] termie has joined the channel [21:20] Lorentz has joined the channel [21:20] zhesto has joined the channel [21:20] mgc has joined the channel [21:20] Guest52176 has joined the channel [21:20] xmux has joined the channel [21:20] m3nt0r^aw has joined the channel [21:20] siong1987_ has joined the channel [21:20] nail_ has joined the channel [21:20] slickplaid has joined the channel [21:20] zz_raja has joined the channel [21:20] timemachine3030 has joined the channel [21:20] pzich has joined the channel [21:20] yrashk has joined the channel [21:20] EGreg has joined the channel [21:20] tmzt has joined the channel [21:20] rednul has joined the channel [21:20] case__ has joined the channel [21:20] marlun has joined the channel [21:20] castral has joined the channel [21:20] KyleXY has joined the channel [21:20] polyrhythmic has joined the channel [21:20] jimt has joined the channel [21:20] sideshow has joined the channel [21:20] Epeli has joined the channel [21:20] jan____ has joined the channel [21:20] dantalizing has joined the channel [21:20] adamholt has joined the channel [21:20] rbranson has joined the channel [21:20] circut has joined the channel [21:20] comster1 has joined the channel [21:20] ddollar has joined the channel [21:20] sth has joined the channel [21:20] sefton has joined the channel [21:20] wattz has joined the channel [21:20] papyromancer has joined the channel [21:20] pquerna has joined the channel [21:20] nefD has joined the channel [21:20] Sami_ZzZ has joined the channel [21:20] thebigbad has joined the channel [21:20] ashleydev has joined the channel [21:20] nlacasse has joined the channel [21:20] yonkeltron has joined the channel [21:20] er1c_ has joined the channel [21:20] chewbran1a has joined the channel [21:20] pekim has joined the channel [21:20] eirikur has joined the channel [21:20] naneau has joined the channel [21:20] izz has joined the channel [21:20] mif86 has joined the channel [21:20] Atmoz has joined the channel [21:20] jb55 has joined the channel [21:20] gwoo has joined the channel [21:20] broquaint has joined the channel [21:20] MrWarGames has joined the channel [21:20] Draggor has joined the channel [21:20] inimino has joined the channel [21:20] keeran has joined the channel [21:20] zmack has joined the channel [21:20] dnyy has joined the channel [21:20] sitron has joined the channel [21:20] crodas has joined the channel [21:20] MikeW has joined the channel [21:20] olegp has joined the channel [21:20] deoxxa has joined the channel [21:20] Cainus has joined the channel [21:20] maru_cc_ has joined the channel [21:20] slpsys has joined the channel [21:20] konobi has joined the channel [21:20] rphillips has joined the channel [21:20] chrisdickinson has joined the channel [21:20] meder has joined the channel [21:20] rubydiamond has joined the channel [21:20] themcgruff has joined the channel [21:20] chilts_ has joined the channel [21:20] russell_h has joined the channel [21:20] shaver has joined the channel [21:20] tk has joined the channel [21:20] steadicat has joined the channel [21:20] walkah has joined the channel [21:20] lianj has joined the channel [21:20] joshthecoder has joined the channel [21:20] zentooo has joined the channel [21:20] brianc has joined the channel [21:20] roger_raymond has joined the channel [21:20] sadiq has joined the channel [21:20] Noya_ has joined the channel [21:20] _alex has joined the channel [21:20] adrienf_ has joined the channel [21:20] Sembiance has joined the channel [21:20] chapel has joined the channel [21:20] lstoll has joined the channel [21:20] mediacod1r has joined the channel [21:20] cce has joined the channel [21:20] DoubleV has joined the channel [21:20] elliottcable has joined the channel [21:20] joshpeek has joined the channel [21:20] sstephenson has joined the channel [21:20] mrkurt___ has joined the channel [21:20] scoates has joined the channel [21:20] xSmurf: AAA_awright: it's not the RFC I have issues with, it's the usage of the request object I'm struggling with [21:20] kkaefer has joined the channel [21:20] xSmurf: ouch... [21:20] torvalamo: now that's just rude [21:21] xSmurf: AAA_awright: nah it's easy, the data is plain text CSV containing relatively small strings [21:21] xSmurf: bit of rand + time and I'm done [21:21] AAA_awright: It should work just like any other stream [21:22] AAA_awright: I haven't done that much myself though [21:22] xSmurf: as I mentioned, I don't think this is right that Content: close is sent before my request.write(), but I might be wrong... [21:22] xSmurf: me neither, I'm a 4 day old nodejs noob [21:22] stagas: d0gie: well I didn't do anything I just exposed kuno's geoip module. you should install and use that in case mine goes down [21:22] aconbere has joined the channel [21:23] Druide_ has joined the channel [21:24] torvalamo: now i remembered what your nick reminded me of [21:24] torvalamo: zappa [21:24] torvalamo: cleetus awreetus-awrightus [21:24] torvalamo: http://www.youtube.com/watch?v=iSFOro0qOdo [21:24] stagas has joined the channel [21:24] chrisdickinson: isaacs: btw, I got a fair bit done on that native node git client i mentioned like forever ago: https://github.com/chrisdickinson/tempisfugit [21:25] fly-away has joined the channel [21:25] chrisdickinson: (it's a little gross, but it reads odbs of either loose commits or v2 packfiles, commits, and ofs-deltas) [21:26] elijah-mbp has joined the channel [21:28] d0gie: stagas: thanks for the tip man, thats good to know [21:28] stagas_ has joined the channel [21:28] xSmurf: AAA_awright: that's what I have right now, maybe I'm just not seeing the bluntly obviously http://pastie.textmate.org/private/qqmzuqxdivj4h6omgworwq [21:30] bartt1 has joined the channel [21:30] robtmr has joined the channel [21:31] stagas has joined the channel [21:31] PyroPeter has joined the channel [21:32] perlmonkey2: Why is this project so huge? node.js seems so new that there can't be many sites using it. [21:32] perlmonkey2: By huge I mean there are ~400 people on the irc channel and git shows heavy dev on it. [21:32] xSmurf: sites? huh what? [21:32] xSmurf: ACTION is writting an asterisk manager xmpp bot [21:33] stagas__ has joined the channel [21:33] stbuehler: it is easy to put some code together [21:33] perlmonkey2: xSmurf: hah, that's awesome [21:33] xSmurf: ^ +1 other than so far in my noobish experience, the libraries aren't yet so mature and need a little tweaking to work just right [21:33] muk_mb: sweet, got it working [21:34] xSmurf: could explain the heavy dev on github [21:34] xSmurf: perlmonkey2: thanks :) [21:34] perlmonkey2: Yeah, I'm looking through the modules on github and it seems like DB support is still mostly beta. [21:35] ceej has joined the channel [21:35] Aria: Whatever 'beta' means ;-) [21:35] xSmurf: well I'm using four libraries, one really needed a wrapper class to work, that wrapper class needed some tweaking, the other lib also did, and the last one just didn't work (though I didn't try very hard) [21:36] indexzero has joined the channel [21:36] xSmurf: but if I get this file upload sorted, I'm in business! [21:36] perlmonkey2: Aria: I see latest comments like 'Beginning of bindings to libpg'. That doesn't strike me as the description of a rock solid lib. [21:36] perlmonkey2: xSmurf: congrats. Sounds like fun [21:37] enotodden_ has joined the channel [21:37] xSmurf: yeah it's a nice project to get started on node [21:37] bartt has joined the channel [21:37] xSmurf: my JS was very very rusty hehe [21:37] xSmurf: but this is just making me want to renew with JS so much more [21:40] xSmurf: I'm pretty darn sure the issue is that Content: close is sent before request.write(); [21:40] xSmurf: but I can't put the multipart data in the request headers argument [21:46] teemow has joined the channel [21:47] cjm has joined the channel [21:51] bingomanatee_: Is there any more effective way of loading a block of JSON data than just including a javascript file that makes it? [21:52] Aria: Read and then JSON.parse [21:52] chrisdickinson: bingomanatee: JSON.parse() [21:52] Aria: But I'm not sure what you mean by 'effective' [21:58] skohorn has joined the channel [21:59] aconbere has joined the channel [22:00] sriley_ has left the channel [22:02] dbrock has joined the channel [22:04] dbrock: I'm new to Node.js, and to V8, I guess --- can anyone explain this? [22:04] dbrock: > (function () { return this }).bind(1)() [22:04] dbrock: {} [22:04] dbrock: > (function () { return this + 1 }).bind(1)() [22:04] dbrock: 2 [22:05] dbrock: I guess it's simply a bug? in V8? [22:06] robtmr: dbrock: why would that not return 2? [22:06] dbrock: the second example behaves as expected; the first does not [22:06] robtmr: dbrock: sorry, missed the first part [22:09] dipser has joined the channel [22:09] mikeal has joined the channel [22:10] robtmr: dbrock: just a guess, but maybe "this" is by default some kind of wrapper object, and the second example coerces it to a number [22:10] jakehow has joined the channel [22:10] dbrock: interesting theory [22:11] slaskis has joined the channel [22:11] robtmr: (function() { return this.valueOf() }).bind(1)() [22:11] robtmr: 1 [22:11] isaacs has joined the channel [22:11] dbrock: yes, that seems to be the case: [22:11] dbrock: > (function () { return this }).bind(1)() + 1 [22:11] dbrock: 2 [22:11] dbrock: great, thanks! :D [22:12] bingomanatee_: Is there a simple "file exists" test function other than stats [22:12] dbrock: robtmr: yes, I already noticed that if you do something with it inside the function, it behaves as expected [22:12] siong1987 has joined the channel [22:13] dbrock: bingomanatee: require("path").exists("/foo/bar/baz") [22:13] robtmr: dbrock: yeah, I'm glad I know it does that now, too [22:13] bingomanatee_: thx [22:14] chrisdickinson: dbrock: belatedly -- bind(1) would bind 'this' to 1, and when you call the bound function, it evaluates to function() { return 1 + 1; } [22:15] dbrock: chrisdickinson: yes, that's not the quirky example though [22:15] chrisdickinson: or maybe something like function() { return {valueOf:function() { return 1; }} + 1; } [22:15] chrisdickinson: v8: (unction() { return {valueOf:function() { return 1; }} + 1; })() [22:15] v8bot: chrisdickinson: SyntaxError: Unexpected token { [22:16] chrisdickinson: v8:(function() { return {valueOf:function() { return 1; }} + 1; })() [22:16] v8bot: chrisdickinson: 2 [22:16] xSmurf: grrrrrrrrr [22:17] chrisdickinson: dbrock: yeah -- the first param gets coerced to an object to fill the value of `this`, subsequent calls would unbox that object using valueOf [22:17] markwubben1 has joined the channel [22:17] chrisdickinson: (sorry if i'm totally missing the boat or anything) [22:18] dbrock: oh, so the node REPL doesn't know how to unbox objects? [22:19] chrisdickinson: dbrock: basically -- it's not calling 'valueOf' when it prints out the value of the result [22:19] chrisdickinson: it's more or less doing an inspect on your object to see what member properties it has [22:20] dbrock: hmm, okay [22:21] chrisdickinson: if you did this: (function () { return this }).bind(1)().valueOf() it'd return the unboxed '1' [22:21] chrisdickinson: fun with boxing! [22:22] dbrock: v8: function Foo() {}; Foo.prototype.valueOf = function () { return 1 }; new Foo().toString() [22:22] v8bot: dbrock: "[object Object]" [22:22] dbrock: v8: (function () { return this }).bind(1)().toString() [22:22] v8bot: dbrock: "1" [22:22] dbrock: hmm [22:22] charlenopires has joined the channel [22:23] twoism has joined the channel [22:23] dbrock: I guess boxed objects are hella magical [22:25] chrisdickinson: dbrock: well, number literals and string literals are by default unboxed [22:25] chrisdickinson: v8: "asdf" instanceof String [22:25] v8bot: chrisdickinson: false [22:26] chrisdickinson: v8: (new String('asdf')) instanceof String [22:26] v8bot: chrisdickinson: true [22:26] chrisdickinson: v8: a = 'asdf'; a.someValue = 3; console.log(a.someValue); [22:26] v8bot: chrisdickinson: CONSOLE: [undefined], OUTPUT: undefined [22:26] chrisdickinson: v8: a = new String('asdf'); a.someValue = 3; console.log(a.someValue); [22:26] v8bot: chrisdickinson: CONSOLE: [3], OUTPUT: undefined [22:27] dbrock: v8: new String("asdf") [22:27] v8bot: dbrock: {"0": "a", "1": "s", "2": "d", "3": "f"} [22:27] dbrock: haha [22:27] chrisdickinson: weird, huh? [22:27] dbrock: yeah [22:27] chrisdickinson: when you perform an operation on a boxed object it'll attempt to unbox it [22:27] dbrock: v8: new String("asdf").toString() [22:27] v8bot: dbrock: "asdf" [22:28] chrisdickinson: v8: {valueOf:function() { return 3; }} + 2 [22:28] v8bot: chrisdickinson: SyntaxError: Unexpected token ( [22:28] dbrock: v8: ({ valueOf: function valueOf:function() { return 3 } }) + 2 [22:28] v8bot: dbrock: SyntaxError: Unexpected token : [22:28] dbrock: haha what [22:29] stbuehler: v8: {valueOf:(function() { return 3;})} + 2 [22:29] v8bot: stbuehler: 2 [22:29] stbuehler: :) [22:29] dbrock: oh! [22:29] chrisdickinson: v8: a = {}; a.valueOf = function() { return 3; }; a + 2; [22:29] v8bot: chrisdickinson: 5 [22:29] chrisdickinson: stbuehler: thanks :) [22:29] dbrock: v8: ({ valueOf: function () { return 3 } }) + 2 [22:29] v8bot: dbrock: SyntaxError: Unexpected token ILLEGAL [22:29] dbrock: :( [22:30] chrisdickinson: v8: {valueOf: (function() { return 3; })} + 2 [22:30] v8bot: chrisdickinson: 2 [22:30] stbuehler: strange [22:30] chrisdickinson: (parens around member function. gotta remember that one.) [22:30] dbrock: v8: ({ valueOf: function () { return 3 }, foo: 123 }) + 2 [22:30] v8bot: dbrock: 5 [22:30] dbrock: hmm [22:31] dbrock: I guess a single-member object literal can be confused with a block containing a labeled expression statement [22:31] xSmurf: really, can anybody spot what's wrong??? http://pastie.textmate.org/private/5smnkwkcfqnpvv45jsm5a [22:31] d0k has joined the channel [22:31] xSmurf: I don't get it, it just won't upload [22:32] chrisdickinson: dbrock: even more fun: [22:32] xSmurf: I'm pretty much matching 100% what I get posting through curl [22:33] stbuehler: so parens around member functions are not a good idea as they hide the real problem :) [22:33] chrisdickinson: v8: { valueOf:(function() { return { valueOf:(function() { return 2; }) }; })} [22:33] v8bot: chrisdickinson: function () { return { valueOf:(function() { return 2; }) }; } [22:33] chrisdickinson: v8: { valueOf:(function() { return { valueOf:(function() { return 2; }) }; })} + 2 [22:33] v8bot: chrisdickinson: 2 [22:33] stbuehler: v8: ({ valueOf:(function() { return { valueOf:(function() { return 2; }) }; })} + 2) [22:33] v8bot: stbuehler: "[object Object]2" [22:33] chrisdickinson: stbuehler++ [22:33] v8bot: chrisdickinson has given a beer to stbuehler. stbuehler now has 1 beers. [22:33] stbuehler: v8: ({ valueOf:function() { return { valueOf:function() { return 2; } }; }} + 2) [22:33] v8bot: stbuehler: "[object Object]2" [22:34] stbuehler: v8: ({ valueOf:function() { return ({ valueOf:function() { return 2; } }); }} + 2) [22:34] v8bot: stbuehler: "[object Object]2" [22:34] stbuehler: v8: ({ valueOf:function() { return ({ valueOf:function() { return 2; } }); }}).valueOf().valueOf() [22:34] v8bot: stbuehler: 2 [22:34] chrisdickinson: when the valueOf doesn't return an unboxed value, it tries 'toString' [22:34] stbuehler: looks like it doesn't want to apply valueOf more than one [22:34] stbuehler: ah [22:35] stbuehler: v8: ({ valueOf:function() { return ({ toString:function() { return 2; } }); }} + 2) [22:35] v8bot: stbuehler: "[object Object]2" [22:35] stbuehler: nope [22:36] strixv has joined the channel [22:36] hunterloftis: This might be a stupid question but why is it that sometimes when I console.log() a function, I get a string representation of that function, while other times I get [Function]? [22:36] Aria: Native vs Javascript implementation might be one reason [22:36] dbrock: v8: ({ valueOf: function () { return { valueOf: function () { return 1 } } }, toString: function () { return "foo" }) + 2 [22:36] v8bot: dbrock: SyntaxError: Unexpected token ) [22:37] chrisdickinson: oo. got it. [22:37] dbrock: v8: ({ valueOf: function () { return { valueOf: function () { return 1 } } }, toString: function () { return "foo" } }) + 2 [22:37] v8bot: dbrock: "foo2" [22:38] hunterloftis: gotcha, thanks [22:38] chrisdickinson: v8: a = {}; a.valueOf = function() { return { valueOf:(function() { return 2; })}; a.toString = a.valueOf.bind(a); a + 2 [22:38] v8bot: chrisdickinson: SyntaxError: Unexpected end of input [22:38] micheil has joined the channel [22:38] chrisdickinson: aw dang. [22:39] hunterloftis: Aria: I guess I'll have to read up on how V8 handles native (C++?) bindings [22:39] dbrock: if valueOf doesn't return an unboxed value, it ignores valueOf, I guess? [22:39] Aria: That's one option. Though lots of people have luck just implementing protocols to talk to other things. [22:39] chrisdickinson: dbrock: you can make it throw an exception, actually :\ [22:40] dbrock: chrisdickinson: what do you mean? [22:40] hunterloftis: Related - anybody ever tried using .group() with the mongodb-native driver? I can't find docs/examples/argument lists anywhere [22:41] chrisdickinson: dbrock: one sec -- formatting it for v8bot... [22:41] dbrock: v8: ({ valueOf: function () { return { valueOf: function () { return 1 } } }, toString: function () { return 3 } }) + 2 [22:41] v8bot: dbrock: 5 [22:43] chrisdickinson: v8: a = {}; a.valueOf = function() {return {valueOf:(function() {return 2;})};};a.toString = function() {return this.valueOf();};a + 2; [22:43] v8bot: chrisdickinson: TypeError: Cannot convert object to primitive value [22:43] chrisdickinson: woooo. [22:43] hunterloftis: ah nm, found the .group() method is in JS... weird that I couldn't output it [22:43] chrisdickinson: it basically looks at valueOf, if valueOf says "no I can't grab that." it tries toString. if that doesn't return an unboxed value either, it gets angry. [22:43] Evet has joined the channel [22:43] chrisdickinson: dbrock: ^^ [22:43] Evet has joined the channel [22:44] dbrock: chrisdickinson: ah, right [22:44] dbrock: funky [22:44] pt_tr has joined the channel [22:45] chrisdickinson: v8: a = {}; a.valueOf = function() {return {toString:(function() { return this.valueOf(); }), valueOf:(function() {return 2;})};};a.toString = function() {return this.valueOf().toString();};a + 2; [22:45] v8bot: chrisdickinson: 4 [22:46] chrisdickinson: (this proves that it does not attempt to recurse into the child object for a valueOf / toString method -- you've gotta call them explicitly) [22:47] Aikar: um, im confused. i have ./conf/db.js with contents exports = { blah: "foo"} [22:47] Aikar: require('./conf/db'); is giving me an empty object [22:47] Aikar: plain {} [22:47] [[zz]] has joined the channel [22:48] isaacs: Aikar: you cannot set exports to a new object. [22:48] isaacs: Aikar: doing so simply loses the reference. [22:48] isaacs: Aikar: you can either do: module.exports = {blah:"foo"}, or exports.blah = "foo" [22:49] isaacs: Aikar: note that if you set module.exports to a new object, then the `exports` free var is now lost. [22:49] xSmurf: fuck I'm DUMB... \r\n =/= \n\r [22:49] Aikar: k that fixed it thanks [22:52] jashkenas has joined the channel [22:53] pdelgallego has joined the channel [22:53] eee_c has joined the channel [22:56] felixge has joined the channel [22:56] felixge has joined the channel [22:57] ChosenOne has joined the channel [22:57] ChosenOne: hey folks [22:57] JimBastard has joined the channel [22:57] JimBastard: sup SubStack [22:58] ChosenOne: I have a rather javascript related question: how would I create a binary string "\xff\xaa" from a string containing "FFAA"?. using Sring.fromCharCode, of course, adds nullbytes because strings are utf16 [23:00] strmpnk_ has joined the channel [23:00] SubStack: JimBastard: ahoy [23:02] SubStack: JimBastard: Error: Cannot find module 'dnode' [23:02] SubStack: on nodejitsu with this app: https://github.com/substack/hexhack-server [23:02] [[zz]] has joined the channel [23:03] CrypticSwarm has joined the channel [23:05] felixge: I have a node process that spawns another node process and then does process.exit(0); [23:05] felixge: shouldn't the child process die at this point as well? [23:06] felixge: (I'm not listening to signals) [23:06] jchris has joined the channel [23:08] d0k has joined the channel [23:08] pHcF has joined the channel [23:10] teddy_ has joined the channel [23:12] brianmario has joined the channel [23:12] Spion__ has joined the channel [23:14] sh1mmer has joined the channel [23:14] brianc: isaacs: are you there? [23:14] isaacs: yo [23:15] JimBastard: SubStack: hrmm it didnt resolve? [23:16] JimBastard: i can take a look [23:16] JimBastard: it would be nice to get stackvm access to each machine [23:16] brianc: isaacs: hey dood. I be having ANOTHER issue with npm not loading modules. I am 100% sure it's my lack of understanding of where npm puts the modules and where to update the paths, but I cannot, for the life of me, figure out how to get the path stuff set up correctly. I think my problem mostly stems from me using nvm or nave and lots of versions of node to test all the versions but I always run into this issue and kinda twist knobs until it wor [23:16] isaacs: brianc: ok, noted. [23:16] isaacs: brianc: (you may want to take notes on this) [23:16] isaacs: npm config ls [23:16] brianc: isaacs: i been looking for documentation on the exact load paths of everything. NPM has fantastic documentation about a lot of topics but I just cannot find the documentation for this one...could you point me in right direction? [23:17] isaacs: brianc: that shows your configs ^ [23:17] isaacs: npm help config [23:17] isaacs: brianc: that shows what each config means ^ [23:17] brianc: isaacs: okay awesome. will do that. [23:17] stepheneb has joined the channel [23:17] isaacs: brianc: in particular, root = node modules (and the .npm folder), binroot = executables, manroot = manpages. [23:18] JimBastard: SubStack: hrmmm [23:18] isaacs: brianc: if you have installed node and/or npm with homebrew, all bets are off. it will result in broken things. we're working on it. [23:19] skohorn has joined the channel [23:19] brianc: isaacs: BOOM! That's my problem. bad homebrew. okay. Sorry to nag you directly about this, just couldn't find what i was lookin' for in documentation [23:19] isaacs: brianc: np [23:20] JimBastard: SubStack: i got it! [23:20] JimBastard: well, it said it started [23:20] JimBastard: ahaha [23:21] isaacs: JimBastard: you were asking about setting configs in the package.json, right? [23:21] JimBastard: isaacs: yeah [23:21] JimBastard: i think im just gonna do "config" [23:21] JimBastard: and thats it [23:21] isaacs: kew [23:21] JimBastard: with the new require('foo/package.json') its good to go [23:21] isaacs: oh, right, huh [23:21] JimBastard: require('foo/package.json').config [23:22] brianc: isaacs: it's fantastically easy to publish modules to NPM. that is +++awesome. I my elementary understanding of paths and not knowing exactly where to LOOK for documentation was the issue. thanks [23:22] marko: can anybody comment on this: https://github.com/ry/node/issues#issue/521 ? [23:22] isaacs: brianc: np, and thanks for the compliment. yeah, the docs are kinda big. that's a continual problem. [23:22] isaacs: JimBastard: well, the thing is, i want the "config" hash to basically be something that you can do stuff like: npm config set package.foo = "bar" [23:23] JimBastard: isaacs: it should do that too maybe [23:23] isaacs: JimBastard: and then have it track that a) across package upgrades, and b) overwriting the require("package.json"), and c) available in both modules and scripts [23:23] JimBastard: yeah [23:24] isaacs: but yeah, maybe require("foo/package.json").config should be the *local* config hash, and changed via npm config set foo.bar ="baz" [23:24] aconbere has joined the channel [23:25] isaacs: but that gets.... hairy [23:25] isaacs: also, maybe you want ot set something for a different version.. [23:25] JimBastard: SubStack: does hexhax have a web server running? [23:26] mojombo has joined the channel [23:27] HAITI has joined the channel [23:27] HAITI: Cheers #node.js [23:27] isaacs: cheers, HAITI [23:29] SubStack: JimBastard: it provides a web server if that's what you mean [23:29] Throlkim has joined the channel [23:29] JimBastard: hrmmm [23:29] JimBastard: where is it [23:30] eee_c1 has joined the channel [23:30] Aikar: anyone got an example of starting an app into the background and getting its PID too? ie starting up mongo, and write pid to file, then exit [23:31] SubStack: web.js gets required by server.js [23:32] deepthawtz has joined the channel [23:32] isaacs: Aikar: run-some-script & echo $? > some-script.pid ; disown ; exit [23:33] JimBastard: SubStack: did you just delete? [23:33] JimBastard: im playing around trying to get it to work [23:33] isaacs: er, whoops, not $?, that should be $! [23:33] isaacs: Aikar: ^ [23:34] isaacs: $? is the exit code value [23:34] SubStack: JimBastard: yeah just deleted and fetched again [23:34] JimBastard: ahh [23:34] SubStack: it was telling me document conflict or some such [23:34] JimBastard: prob caus i manually edited it [23:35] JimBastard: im ssh into that box so i can get some better details [23:35] JimBastard: logging isnt public yet [23:35] SubStack: ok I'll stop messing with it then [23:35] JimBastard: console might reveal better error messages too [23:35] JimBastard: youw ant me to try to start it [23:35] JimBastard: ? [23:35] SubStack: sure [23:37] felixge: does anybody know if sending a file descriptor works through stdin ? [23:37] Aria: Only unix domain sockets [23:37] Aria: It would if stdin is one, sure. [23:38] felixge: Aria: But I guess stdin is not a unix socket normally? [23:38] felixge: I'm trying to figure out if I can spawn a new process and give it an FD without creating a temporary socket just to send the FD [23:39] Aria: Not normally, no. Fun from a terminal, it's a pty/tty, run from another process, it'd inherit that process's stdin (possibly null, if it's a daemon, or closed) [23:39] JimBastard: SubStack: http://hexhack.nodejitsu.com/ ? [23:39] Aria: The usual unix way is to socketpair, fork, dup the socket fd as stdin, and exec. [23:39] Aria: node doesn't really give you that control. [23:39] felixge: Aria: : / [23:40] Aria: Yeah. [23:40] SubStack: JimBastard: not sure what that is about! [23:40] felixge: Yeah, what's the problem with fork at this point? Did ryan not want it for windows support? [23:40] comster has joined the channel [23:40] Aria: (I still just want a plain ol' fork for node.) [23:41] felixge: Aria: I'm working on isolating each upload into an own process for transloadit right now [23:41] felixge: (I know that seems overkill, but I think it's sensible given that each of our upload spawns a handful of other processes anyway) [23:41] micheil_mbp has joined the channel [23:41] felixge: But I'm having a hard time to figure out a simple way to do it [23:41] Aria: Yeah. Mrr. [23:42] felixge: simple as in: No crazy master process needed with it's own IPC stuff [23:42] Aria: Yeah. [23:42] Aria: I'm wondering how hard it'd be to just write a fork binding. [23:42] Aria: libev's a small pisser, but not too hard, it looks like. [23:42] Aria: Just gotta define the simplest semantics for what'll work in the parent and child. [23:43] Aikar: isaacs: exec('mongod --configsvr --dbpath /starlisdb/config --port 20000 & 1> /starlisdb/logs/config.log 2>&1 && echo $! >/starlisdb/test.pid && disown'); close but its still holding up node [23:43] Aria: 'holding up' ? [23:43] brianc: isaacs: I am no longer using homebrew installed npm (and no homebrew installed node now either) and it's all working. thanks for the tip [23:43] Aikar: process doesnt end [23:43] isaacs: Aikar: oic, you want to disown the child_process [23:43] Aikar: yea [23:43] Aikar: checks if its running, spawns if not, detach [23:44] JimBastard: SubStack: something is borked with resolving the dnode dep [23:44] Aikar: then ima run it on cron [23:44] felixge: Aria: having fork would be super awesome :) [23:44] JimBastard: ill look into it [23:44] SubStack: k [23:44] JimBastard: im working on getting some better support and logging tools going [23:44] isaacs: Aikar: i seem to remember some daemonize/disown thing once upon a time... [23:44] felixge: Aria: but libev scares me after having tried to debug it once : ) [23:44] Aria: Hehe. libev scares me less than V8. [23:44] isaacs: Aikar: you know, you can just run your program with nohup, and then do `process.exit()` [23:45] felixge: Aria: V8 scares me enough to not even try to debug it :) [23:45] felixge: If v8 is broken I go to the v8 guys and cry : ) [23:45] Aria: Hehe [23:45] Aria: Me too at this point. [23:45] felixge: but luckily neither v8 nor libev seem too broken [23:45] felixge: : ) [23:46] felixge: Aria: I guess you've read this? http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod#code_ev_fork_code_the_audacity_to_re [23:46] Aria: I have. [23:47] maushu has joined the channel [23:47] JimBastard: SubStack: there might be an issue with installing dnode, i just tried stackvm locally, and the dnode dep didnt resolve automatically [23:47] JimBastard: i had to manually install it [23:47] Aikar: there is a fork module on npm that works good [23:47] isaacs: Aikar: awesome [23:47] SubStack: JimBastard: maybe because dnode has dependencies itself? [23:47] Aikar: i didnt mean to solve my issue lol [23:48] felixge: Aria: So in a forked child all watchers would be gone? All you'd have left are the server objects and the fd's attached to them? [23:48] JimBastard: does npm not recurse? [23:48] JimBastard: isaacs? [23:48] isaacs: JimBastard: define. [23:48] mischief has joined the channel [23:48] isaacs: JimBastard: it does install grandchildren of dependents [23:48] JimBastard: SubStack: hrmm npm ERR! Error: No satisfying version found for 'cart'@'>=1.0.6' npm ERR! Valid install targets for cart: "latest", "1.0.0", "1.0.1", "1.0.2", "1.0.3" [23:49] JimBastard: isaacs: got ya [23:49] SubStack: oh that [23:49] Aikar: isaacs: exec('nohup mongod --configsvr --dbpath /starlisdb/config --port 20000 1> /starlisdb/logs/config.log 2>&1 && echo $! >/starlisdb/test.pid'); followed by process.exit is spawning it but not writing the pid to file [23:49] SubStack: JimBastard: but what about hexhack-server? [23:49] isaacs: SubStack: bug pkrummins to publish [23:49] JimBastard: SubStack: im coming back to that [23:50] perlmonkey2 has joined the channel [23:50] JimBastard: its hard without real logging [23:50] isaacs: Aikar: at this point, you'er better off writing it to a sh file and just execing that [23:50] FransWillem: Is there a wrapper around http.createClient that will take care of actually creating the client and such? e.g. I just want to request an URL, and want something else to keep track of connection-keep-alive stuff if need be [23:50] isaacs: FransWillem: check out `request` [23:50] isaacs: FransWillem: npm install request [23:51] Aria: I think that libev's default behavior makes sense. Continue the event loop in both processes. [23:51] isaacs: FransWillem: https://github.com/mikeal/node-utils/tree/master/request#readme [23:51] SubStack: isaacs: no that bug was from a package.json with a bad version but I forget where the issue was [23:51] isaacs: i see [23:52] felixge: Aria: yeah, but that won't work well for most node apps, would it? [23:52] Aria: Why not? [23:52] FransWillem: Thanks :) [23:52] JimBastard: SubStack: stackvm install is failing hard btw [23:52] JimBastard: lol [23:52] JimBastard: sorry [23:52] Aria: (I think we should also make sure that FD_CLOEXEC gets set properly for things -- there are existing semantics for all this.) [23:53] chapel: so someone mentioned Kod here yesterday I think it was (OSX based 'text' editor using node.js for scripting) [23:53] felixge: Aria: Well, let's say you communicate with a tcp client. Wouldn't both of the new process randomly drain the socket for new connections, resulting in neither of them receiving the full dialog? [23:53] chapel: guess the guy behind it is Rasmus Andersson [23:53] felixge: * drain the socket for new data [23:53] chapel: who happens to be the design guy behind spotify [23:53] chapel: makes me even more excited about Kod [23:53] SubStack: JimBastard: the setup is rather involved too right now [23:54] SubStack: we've been focusing effort on getting browserling working [23:54] JimBastard: SubStack: i got to png module [23:54] JimBastard: and that failed [23:54] JimBastard: it would be nice to use to for ssh to our cluster [23:54] JimBastard: we've got a bunch of machiens [23:54] JimBastard: too manies [23:55] SubStack: too many! [23:55] Aria: Sure. (I suppose the regular way that works is that it's a select() loop and only the "right" process read()s it; since node automatically reads, that's problematic. That said, you'd just want to set it up so that those FDs are closed in the child..) [23:56] SubStack: use for ssh? not sure how that would work [23:57] JimBastard: does it not do terminal lol [23:57] JimBastard: ahaha [23:57] JimBastard: nm [23:57] SubStack: nah [23:57] JimBastard: pizza time then [23:57] SubStack: JimBastard: oh but you might like this thing I'm building on top of forever right now [23:57] beta has joined the channel [23:58] SubStack: it's a remote multi-system process control/monitor [23:58] felixge: Aria: right, but I think the default behavior of copying the watchers will surprise some people :) [23:59] felixge: Aria: but I guess it's better to keep the watchers by default as we could always expose a way to nuke them : ) [23:59] Aria: Sure, but which one can you continue from? If you close them, it's hard to get back; if you continue them, you can close 'em. [23:59] Aria: Exactly.