[00:00] brianseeders has joined the channel [00:00] joshontheweb has joined the channel [00:03] redir has joined the channel [00:03] westg has joined the channel [00:05] blendedbychris has joined the channel [00:05] bingomanatee_ has left the channel [00:06] ksys has joined the channel [00:07] blendedbychris: tlack: any insight on waht i'm trying to do? sorry for the delay [00:07] whaley has joined the channel [00:08] Clordio has joined the channel [00:08] willwhite has joined the channel [00:08] synesp has left the channel [00:09] evilnate has joined the channel [00:09] justicefries has joined the channel [00:09] PPaul has joined the channel [00:09] jimmyy111 has joined the channel [00:10] tlack: blendedbychris: some people use websockets.. i have done similar stuff with polling.. you could update the whole 'pane' the user is looking at (by using the same template you rendered it with) or just add new items and return them to the client like {'addToPage':'
  • ..
  • ').. depends on how much work you want to put in [00:10] SeanH_ has joined the channel [00:11] SeanH_: is there any way to handle node-redis not being able to connect (server down) without crashing your node app? [00:12] ioscale has joined the channel [00:12] ioscale: hyhi [00:12] Steven_ has joined the channel [00:12] tlack: SeanH_: did you try client.on('error', function(err) {}); ? [00:12] blendedbychris: tlack: i'm using polling currently and it's a beating on the server [00:12] ioscale: has anyone build an akka-style framework with nodejs?!? [00:13] tlack: blendedbychris: you are doing long polling or regular? (in long polling you do the server side work in a loop and wait, say, 3-4 minutes before disconnecting the client) [00:13] ioscale: and got some good / bad experience on how well it works performance wise compared to akka / scala / java [00:13] SeanH_: tlack: Yes, I handle the error event [00:13] blendedbychris: tlack: regular… does long polling require socket.io ? [00:13] SeanH_: tlack: problem is, there seems to be no way to tell node-redis to stop trying to connect [00:13] blendedbychris: i'm kinda just falling into this crap… and found that socket.io is the most real-time method [00:13] blendedbychris: so now i'm here [00:14] tlack: SeanH_: why dont you set a global flag so that your code stops trying to call redis if it cant connect? [00:14] SeanH_: tlack: My code isn't, node-redis appears to have auto-rety behavior built in [00:14] tlack: blendedbychris: i havent used websockets so i cant speak to that approach but i have found long polling to be pretty simple/efficient for a small # of clients [00:14] djQuery has joined the channel [00:15] djQuery: anyone found a tutorial on using geddy with mongodb? [00:15] blendedbychris: tlack: what server software is used to "hold" the request on the server? [00:15] redir has joined the channel [00:16] blendedbychris: tlack: my understanding that something like socket.io might use long polling if web sockets aren't available? [00:16] denom has joined the channel [00:16] tlack: blendedbychris: anything.. php, node, whatever. with node you'd just do a series of setTimeout(function(res) { check_db(res); }, 5000); and then one master timeout that would do res.end() after, say, 3 minutes [00:16] cipher___: will forloops in any method not be guaranteed order? [00:16] tlack: blendedbychris: check_db() would, in turn, do res.send() if it can find something, or re-trigger the timeout otherwise [00:17] tlack: blendedbychris: how many users are hitting your thing? [00:18] domo1 has left the channel [00:19] mehale: folks, is this a good way to check if a named pipe still readable and reopen it if needed? How can I have stream.addListener reused on new pipe? http://pastebin.com/MiNcbbAz [00:19] blendedbychris: tlack: a couple hundred [00:20] pixel67 has joined the channel [00:20] gavin_huang has joined the channel [00:21] jimw_ has joined the channel [00:23] JmZ_ has joined the channel [00:24] trbotime has joined the channel [00:25] SiGe has joined the channel [00:26] st_luke has joined the channel [00:29] theCole has joined the channel [00:29] mehale: is this a good way to check if a named pipe still readable and reopen it if needed? How can I have stream.addListener reused on new pipe? http://pastebin.com/MiNcbbAz [00:29] mehlah has joined the channel [00:31] joshsmith has joined the channel [00:32] jamesd has joined the channel [00:32] jryans has joined the channel [00:33] skm has joined the channel [00:34] HacDan has joined the channel [00:34] divoxx has joined the channel [00:35] dylang has joined the channel [00:35] arthurdebert has joined the channel [00:36] diogogmt has joined the channel [00:37] payara has joined the channel [00:37] localhost has joined the channel [00:37] BillyBreen has joined the channel [00:37] philips has joined the channel [00:39] sammmy: How can I redirect to the page that made the post request? [00:40] ninjerz has joined the channel [00:40] ninjerz: am i allowed to emit more than once in the same function? [00:41] FuzzYspo0N has joined the channel [00:41] FuzzYspo0N: arg, tjholowaychuk isn't around much [00:41] mikeal has joined the channel [00:41] timoxley: FuzzYspo0N probably for the best, lets the man get work done [00:42] sawgij has joined the channel [00:43] FuzzYspo0N: he does so much, hah. [00:43] FuzzYspo0N: I just wanted to thank him for Mocha, and show him how i have abused it [00:44] AaronMT has joined the channel [00:44] jrundquist has joined the channel [00:44] elguapo99 has joined the channel [00:45] jimw_: sammy: req.headers.referer? [00:45] halfhalo has joined the channel [00:45] timoxley: FuzzYspo0N hit him up on the twitters [00:45] FuzzYspo0N: i couldn't find his twitter account on his pages [00:45] seanstickle has joined the channel [00:45] FuzzYspo0N: i was guessing visionmedia [00:45] timoxley: FuzzYspo0N https://twitter.com/#!/tjholowaychuk [00:46] FuzzYspo0N: oh cool [00:46] FuzzYspo0N: thanks [00:47] panchot has joined the channel [00:48] Druid_ has joined the channel [00:49] Destos has joined the channel [00:49] KingJamool has joined the channel [00:51] ninjerz_ has joined the channel [00:52] mikeal has joined the channel [00:55] igl1 has joined the channel [00:55] guidocalvano has joined the channel [00:55] isaacs has joined the channel [00:55] dylang has joined the channel [00:56] AaronMT has left the channel [00:56] isaacs: timoxley: hey [00:56] isaacs: timoxley: i'm reviewing those pull reqs. are they all relevant, or is there one specific branch where you've got the changes you'd like to see? [00:57] timoxley: isaacs that last one [00:58] timoxley: isaacs https://github.com/isaacs/npm/pull/2308 [00:58] isaacs: oic, "All of the other pull requests (#2304, #2305, #2306, #2307) merged for your convenience." [00:58] isaacs: great! [00:58] hardwalker has joined the channel [00:59] timoxley: isaacs I've been using my fork for the past few days and it's really bumped up the utility of npm search… at least for me [00:59] crodas has joined the channel [01:00] bartt has joined the channel [01:01] timoxley: isaacs side by side comparison of lastest changes http://imgur.com/5S0uc,uXiK1#1 [01:01] jgornick has joined the channel [01:02] evilnate: hey [01:02] kvda has joined the channel [01:02] isaacs: timoxley: hm... purple plus on a green background makes my eyes twitch a little [01:03] timoxley: isaacs yeah I struggled picking the right colour for that [01:03] brianseeders has joined the channel [01:04] jsulak has joined the channel [01:04] Lorentz: I used to have my colour set so that it was green on blue [01:04] isaacs: maybe just a purple background [01:04] isaacs: with no character [01:04] crutex has joined the channel [01:04] Lorentz: in like, 16 colour days, or whatever [01:04] blendedbychris: tlack: with long polling what server software have you used? [01:05] isaacs: timoxley: so, haven't looked at the code yet, just playing with it... the rating is based solely on updated date? or is there some other metric? [01:05] timoxley: isaacs just updated at [01:06] timoxley: isaacs I was thinking perhaps using different characters, you could potentially represent different stuff [01:06] timoxley: isaacs nethack style [01:07] isaacs: timoxley: there are some weird effects of this... like, looking at `npm search =isaacs`, proto-list, abbrev, and inherits are all read [01:07] isaacs: *red [01:07] isaacs: but those are all a lot more stable than any of the stuff in my green section [01:07] jimmy has joined the channel [01:07] timoxley: isaacs they haven't been updated in < 6 months. We could work on tuning the variables [01:08] postwait has joined the channel [01:10] timoxley: isaacs could also base rating on compatibility with the current node version [01:10] timoxley: isaacs or stars [01:11] sheenobu has joined the channel [01:11] timoxley: or whatever, though I think restricting the colours to green yellow red is a good idea since, in my mind at least, they're fairly well understood as "good, maybe, bad" what does purple mean in the context of "goodness" [01:12] achiu has joined the channel [01:13] isaacs: right, but... a lot of the most "good" packages are shown with a red marker here. [01:15] isaacs: and since deprecation bumps the updated date, *deprecating* a package makes it go from red to green [01:16] trotter has joined the channel [01:16] oldsplice has joined the channel [01:17] timoxley: isaacs yeah. so perhaps the naive approach needs some work [01:18] trotter has joined the channel [01:18] wilmoore has joined the channel [01:18] tlack: blendedbychris: just php but the concept is universal [01:18] isaacs: timoxley: i think that maybe it's just my terminal, but the colors are a bit harsh, as well. i don't know... [01:19] timoxley: isaacs that's why I was asking about the 256 colors [01:19] isaacs: timoxley: i see [01:20] isaacs: also, i'm a little hesitant to add any more manual color code stuff, since it'd be nice to push that all out to a dep or something [01:20] timoxley: isaacs I wanted to do that but I was hesitant to go about adding extra deps to npm [01:20] isaacs: deps are fine [01:20] isaacs: as long as they pay rent [01:20] warz has joined the channel [01:20] warz has joined the channel [01:21] timoxley: isaacs cool. [01:21] isaacs: marak's color thing is pretty nice and basic, i just haven't gotten around to using it [01:21] timoxley: isaacs I think old mate has a decent one too [01:21] timoxley: SubStack [01:21] isaacs: that would not surprise me [01:21] Juan77 has joined the channel [01:22] dekub has joined the channel [01:22] isaacs: timoxley: oh, you're thinking of charm, maybe? [01:23] ioscale has joined the channel [01:23] francisl_ has joined the channel [01:23] isaacs: timoxley: so, i'd had this idea of building a really awesome ansi logging thing [01:24] timoxley: isaacs yep, charm [01:24] isaacs: timoxley: so you could have a few multimeter things going, and still have regular log messages scrolling by [01:24] timoxley: isaacs ooo [01:24] Clordio: Weird question… does anyone have the .vimrc file ryan uses? His setup looked nice [01:24] isaacs: but it'd be a project [01:24] isaacs: ryah: ^ [01:24] isaacs: ryah: care to share your .vimrc? [01:25] Clordio: Oops :\ sorry [01:25] ioscale has joined the channel [01:25] timoxley: isaacs is that something you're thinking about for npm [01:26] isaacs: timoxley: yeah [01:26] timoxley: isaacs what would be multimetered [01:26] isaacs: timoxley: you know how there's those "http" logs? [01:26] isaacs: timoxley: i'd like to have a little progress bar for each of them [01:26] timoxley: isaacs yep they'd just be a status line [01:26] timoxley: ahh [01:26] timoxley: nice [01:26] isaacs: instead of just showing when they're done [01:26] ningu has joined the channel [01:27] timoxley: isaacs along those lines, I've been tempted to check out what can be done with curses [01:27] RockPaperNode has joined the channel [01:27] RockPaperNode: whats the equivalent of #{value} which is in jade for html? [01:28] timoxley: RockPaperNode that's substituting a variable, you can't do that in straight html [01:28] cipher___: on line 131, templine is apparently not be populated correctly. this.data[u] though does exist, and is correct? http://pastie.org/private/8pj207e0bpde93zixanjg [01:29] RockPaperNode: timoxley, what topic can i read about the substitution under? [01:29] chadskidmore has joined the channel [01:30] timoxley: RockPaperNode best way to get your head around jade is to check out the examples https://github.com/visionmedia/jade/tree/master/examples [01:30] warz: i was going to try out not using semi colons, but idk. just feels strange. haha. [01:30] timoxley: RockPaperNode that's true of most tj modules [01:30] timoxley: warz end the semicolon plague [01:30] timoxley: warz totally unnecessary. [01:31] ningu: must; use; semicolons;;;;;; [01:31] CIA-19: node: 03Nathan Rajlich 07master * re7065ea 10/ lib/repl.js : repl: ensure that 'repl.useGlobal' is a boolean - http://git.io/OqOudA [01:31] CIA-19: node: 03Nathan Rajlich 07master * r228dddd 10/ lib/repl.js : repl: ensure that 'repl.ignoreUndefined' is a boolean - http://git.io/SJ87mw [01:31] RORgasm has joined the channel [01:31] CIA-19: node: 03Nathan Rajlich 07master * rb187e96 10/ (doc/api/repl.markdown lib/repl.js): [01:31] CIA-19: node: repl: add a 'writer' option to the repl [01:31] CIA-19: node: Previously this was a module-level setting, meaning that all REPL instances [01:31] CIA-19: node: had to share the same writer function. Turning it into one of the options [01:31] CIA-19: node: allows individual REPL instances to use their own writer function. - http://git.io/RDkwqQ [01:31] CIA-19: node: 03Nathan Rajlich 07master * ra33d1c9 10/ test/simple/test-repl-options.js : repl: add test case verifying the repl options usage - http://git.io/qF-4EQ [01:31] CIA-19: node: 03Nathan Rajlich 07master * r208b230 10/ (5 files in 4 dirs): [01:31] CIA-19: node: repl: add a 'useColors' option to the repl [01:31] CIA-19: node: This should only be minimally used, since the `terminal` value will usually be [01:31] CIA-19: node: what you are expecting. This option is specifically for the case where `terminal` [01:31] CIA-19: node: is false, but you still want colors to be output (or vice-versa). - http://git.io/IwU4dA [01:31] timoxley: warz I dropped semis 6 months ago and not once had an issue. not once. [01:31] ningu: what if you want more than one statement on a line? :P [01:31] isaacs: timoxley: i'd stay away from curses [01:31] isaacs: timoxley: every terminal is ansi these days, and the ones that aren't, aren't actually terminals [01:32] tjholowaychuk has joined the channel [01:33] timoxley: isaacs it was my understanding that curses outputs ansi codes [01:33] ningu: I have never had to seriously deal with any terminal stuff while coding. thankfully. [01:34] timoxley: isaacs "The curses library on the executing system sends the correct control characters based on the terminal type" [01:34] ningu: I never even wore a termcap [01:34] timoxley: isaacs so in fact, it's MORE compatible [01:34] gregmoreno has joined the channel [01:34] timoxley: ACTION never used curses though [01:34] ningu: timoxley: are you like mormons who say darn, gee whiz, etc.? [01:35] isaacs: timoxley: node already translates ansi codes for the windows command prompt [01:35] criswell has joined the channel [01:35] isaacs: all node supported unices handle ansi [01:35] ningu: is the windows terminal its own thing or does it follow another standard? [01:36] yhpark has joined the channel [01:36] mandric has joined the channel [01:36] neoesque has joined the channel [01:36] robhawkes has joined the channel [01:37] Kyril has joined the channel [01:40] luigy has joined the channel [01:42] timoxley: isaacs regardless, what do you think about the idea as a whole [01:43] isaacs: well, the search output can use some cleanup, that's for sure [01:43] isaacs: i'm not sure how i feel about the colors. [01:43] RockPaperNode: timoxley, do you know of an example using #{}? [01:43] k1ttty has joined the channel [01:43] Hebo has joined the channel [01:43] gr4yscale has joined the channel [01:44] isaacs: timoxley: it somewhat takes away from the color highlighting in the results [01:44] thinkt4nk has joined the channel [01:44] blueadept has joined the channel [01:45] pendlepa1ts has joined the channel [01:45] timoxley: isaacs yeah, I was trying to combat that by taking up only a single column [01:45] isaacs: timoxley: maybe it could just change the color of the text in the date column, since that's really what it is regarding? [01:45] isaacs: without the background being affected? [01:46] isaacs: ACTION this is truly npm's finest bikeshed. [01:46] timoxley: isaacs that was my first idea, the reason I moved it to a single column was because it interfered with the color highlighting in the results too much [01:46] isaacs: i see [01:47] isaacs: well.... we could maybe use a color that's not used for highlighting [01:47] timoxley: isaacs then I figured it could operate more generally as a rating [01:47] isaacs: like cyan for recent, and "bright black" (grey) for old ones [01:47] timoxley: isaacs or perhaps make the highlighting not use red/gree/blue [01:47] tbranyen: has anyone heard of an npm module that can generate a tree in the cli from a json object? [01:47] pendlepa_ has joined the channel [01:47] tbranyen: kind of like unix tree [01:48] isaacs: tbranyen: https://github.com/substack/node-archy#readme [01:48] timoxley: isaacs hmm [01:49] tbranyen: isaacs: ziiing [01:49] tbranyen: thats awesome [01:49] timoxley: isaacs perhaps, though then you lose the abilty to potentially thow in more info. I was really getting off on the whole idea of being able to communicate stuff about a module in a single character [01:49] slurp has joined the channel [01:50] isaacs: timoxley: sure. [01:50] isaacs: timoxley: what i'd really love is for some kind of kwalitee-like thing that ranges from 0-100 [01:50] timoxley: isaacs eg, perhaps modules that are 'stable' or 'recommended by the core team' get a # or a $ or some other signifier [01:50] timoxley: isaacs that's not a bad idea [01:51] isaacs: timoxley: and then a way to automatically only show the top n results, sorted by kwalitee [01:51] isaacs: timoxley: with a note that says "more results found, but not displayed do xyz to see them" [01:51] yaymukund has joined the channel [01:51] isaacs: timoxley: but it has to be algorithmic [01:51] isaacs: and we aren't yet set up to do that [01:51] timoxley: isaacs perhaps it can use 256 colors to represent kwalitee if 256 colors is supported by your terminal [01:51] timoxley: isaacs numbers otherwise [01:52] bingomanatee_ has joined the channel [01:52] bingomanatee_: Is there any noSQL database that is especially suited for semantic data structures? [01:52] FuzzYspoON has joined the channel [01:53] timoxley: isaacs human brain good at visual grouping and evaluation, not so good at lots of numerics [01:53] timoxley: bingomanatee_ what is a semantic data structure [01:53] jerrysv has joined the channel [01:53] bingomanatee_: Basically a serves function b for object c [01:54] bingomanatee_: as in Task is a Requirement for project Foo [01:54] timoxley: bingomanatee_ sounds like relational data [01:54] zdk has joined the channel [01:55] timoxley: bingomanatee_ postgres good [01:55] Druid_ has joined the channel [01:56] bingomanatee_: to some extent, but the concept for semantic mapping is that all fields are semantic maps - so essentially you end up with two tables, things and relationships, and that doesn't scale well in databases. [01:56] vkandy has joined the channel [01:56] bingomanatee_: neo4j is one known player in that field but I was wondering if anyone had successes with other stores. [01:58] timoxley: bingomanatee_ yeah not built such a thing before. chiming out. [01:58] bingomanatee_: thanbks anyway [01:59] broofa has joined the channel [02:00] tbranyen: urgh isaacs substacks code requires a specific format for the objcet [02:00] tbranyen: i'm gonna just write something that works with an object [02:00] tbranyen: regardless of how its structured [02:00] jaxzin has joined the channel [02:00] a_suenami has joined the channel [02:01] pandeiro has joined the channel [02:04] devongovett has joined the channel [02:04] thetristan has joined the channel [02:07] ningu_ has joined the channel [02:07] qjcg has joined the channel [02:08] orlandovftw has joined the channel [02:08] st_luke has joined the channel [02:09] Skaag has joined the channel [02:09] st_luke has joined the channel [02:10] st_luke has joined the channel [02:11] ditesh|cassini has joined the channel [02:11] luigy has joined the channel [02:11] rurufufuss has joined the channel [02:12] brngardn_ has joined the channel [02:14] cjm has joined the channel [02:16] eli-away has joined the channel [02:18] MartinCleaver has joined the channel [02:18] MartinCleaver has joined the channel [02:19] adamkittelson has joined the channel [02:19] dtrejo has joined the channel [02:19] palmerek_ has joined the channel [02:20] jdeibele has joined the channel [02:20] timoxley: tbranyen should be easy to modify SubStack's code to simply use the object key instead of label [02:24] DaegAway has joined the channel [02:25] Emmanuel` has joined the channel [02:28] perezd has joined the channel [02:29] thetony: Montes: the response to the riddle [02:31] dgathright has joined the channel [02:31] xtianw has joined the channel [02:31] hdon- has joined the channel [02:31] Brandon_R has joined the channel [02:32] Brandon_R: hey guys [02:32] thetony: yo [02:33] tttthet has joined the channel [02:34] literal_username: Help me out please: in Unicode, there are two kinds of characters: ones that are valid in names, like alphanumerics, and other ones like control characters and some nonalphanumeric symbols. What are the names of those two classes? [02:35] disappearedng has joined the channel [02:36] chjj has joined the channel [02:36] thetony: literal_username: referring to general characters and abstract characters? [02:37] sorensen__ has joined the channel [02:37] cipher___: are there any async conflictions in the method loadLines? for some reason templine is always blank? http://pastie.org/private/8cuo7xliljovhmg182qkcw [02:37] TheFuzzball has joined the channel [02:37] thetony: are you still trying to solve the most ultimate email verification problem? [02:37] zodiak has joined the channel [02:37] cipher___: sorry still right off the boat in terms of asynchronous programming* [02:39] thetony: cipher___: i'd check what 'self' is referring to on line 130 [02:39] cipher___: ok [02:41] Doikor has joined the channel [02:41] cipher___: thetony, self is declared in the "main?" scope, so it should be referring to the correct instance? [02:41] Brandon_R: hi cipher [02:42] literal_username: thetony: I don't know for sure... still investigating. [02:42] cipher___: Brandon_R, hi? [02:42] Brandon_R: what's up? [02:42] thetony: cipher___: should, so should iii - what if you do a console.log(templine) inside of that function [02:42] Brandon_R: cool nmame [02:42] tttthet has joined the channel [02:42] cipher___: Brandon_R, ? [02:43] literal_username: thetony: I think I might mean "scripts" vs. "symbols". [02:43] cipher___: Brandon_R, do I know you :P [02:43] thetony: literal_username: why are you looking for the proper names? [02:43] Brandon_R: no, but i know you [02:44] cipher___: Brandon_R, well that's occult, care to be less facetious lol? [02:44] Brandon_R: :P [02:44] literal_username: thetony: Long story. But "symbols" seem like they may not include ASCII control charaters... weird. [02:44] tttthet has joined the channel [02:45] mattp_ has joined the channel [02:46] thetony: cipher___: this looks like you're just getting an array of lines - why don't you just do data.split(/\n/g) ? [02:47] enjalot has joined the channel [02:48] thetony: besides that, you might check the data type of templine after line 131 too.. [02:49] carlyle has joined the channel [02:49] TheFuzzball has joined the channel [02:50] cipher___: thetony, alright. [02:53] alejandromg has joined the channel [02:56] meso_ has joined the channel [02:58] thinkt4nk has joined the channel [02:59] SubStack: tbranyen: it's worse with using keys as labels [02:59] SubStack: the data structures are deeper [02:59] SubStack: but you can just write a recursive transform [03:00] tbranyen: i guess for my needs it was easier just writing a quick recursive function [03:00] tbranyen: http://pastie.org/3682130 [03:01] owen1: SubStack: i am coming to your talk on thursday. any code/tutorials/packages I should read to understand it ? (node begginer) [03:02] gozala has joined the channel [03:03] Guest13460 has joined the channel [03:04] jesusabdullah: Talk? Where? [03:06] SubStack: jesusabdullah: los angeles [03:07] SubStack: owen1: you could take a look at dnode and seaport ahead of time [03:07] SubStack: fleet too [03:07] Clordio has joined the channel [03:08] SubStack: I was thinking of starting off with an airport+fleet demo and working down the stack from there [03:08] langworthy has joined the channel [03:10] TheFuzzball has joined the channel [03:12] dshaw_ has joined the channel [03:14] TheAlphaNerd has joined the channel [03:15] TheAlphaNerd has joined the channel [03:15] TheAlphaNerd has joined the channel [03:15] baudehlo has joined the channel [03:15] michaelmartinez has joined the channel [03:17] TheFuzzball has joined the channel [03:17] kejun has joined the channel [03:17] Mortchek: thetony, a regex for splitting across lines? Why not just data.split('\n') ? [03:18] BillyBreen has joined the channel [03:18] tbranyen: isaacs: i have an npm package that is actually a collection of small scripts that have their own dependencies [03:18] Mortchek: Besides which, the g flag is redundant with split. [03:18] tbranyen: https://github.com/tbranyen/build-tasks/tree/master/server [03:18] tbranyen: is one of those sub scripts that have their own package.json files [03:18] tbranyen: npm doesn't pick those up and install the deps [03:18] tbranyen: is there a way to do this? [03:19] isaacs: tbranyen: you have a collection of npm packages. [03:19] isaacs: tbranyen: separate them [03:19] thetony: Mortchek: just a habit [03:19] isaacs: or combine them properly [03:19] xtianw has joined the channel [03:19] tbranyen: isaacs: urgh [03:19] isaacs: marriage, or separate homes. none of this roommate business. [03:19] isaacs: at least, that's how i roll with it [03:20] trbotime has joined the channel [03:20] jrundquist has left the channel [03:20] tbranyen: yeah i'm not making separate packages... maybe i'll just leave the node_modules folders there [03:20] iksik has joined the channel [03:20] isaacs: tbranyen: i know mikeal and maxogden like to develop their modules in the node_modules folder of a main repo, and then split them out when they're ready [03:20] tbranyen: it needs deps at specific versions anyways [03:20] isaacs: tbranyen: nothing wrong with checking your deps, if you're deploying the thing [03:21] jamesd: isaacs lets keep this on topic prehaps he has multiple girl friend and a non caring wife thus he is in non-blocking relationships. [03:21] warz has joined the channel [03:22] Mortchek: thetony, it's a good idea to use a string and not a regex when just a string will do. It's both faster and clearer. [03:22] Mortchek: (see http://jsperf.com/string-split-regex-vs-string for the speed argument) [03:22] isaacs: jamesd: as long as all the modules are consenting, and understand their role, and are getting their needs met, it doesn't sound like a problem. [03:22] Sadin has joined the channel [03:23] dr0id has joined the channel [03:23] thetony: Mortchek: i trust you, it's just a habit and i'm not emotionally invested but thank you - i'll keep that in mind in the future [03:24] orlandovftw has joined the channel [03:24] tellnes: I have an application that should download an average of 100 files in one action. The total size of the files are expected to be several hundred MB. Will I take any advantage of downloading more than one file at a time? (The files stored in Amazon S3 and the application is running on Amazon EC2) [03:26] jamesd: tellnes, need more details are the application running more than one instance possibly using load balancing, does the instance have enough cpu and a properly desgined io subsystem.. is your instance having a good day or not... probably doesn't hurt to try it out [03:26] joshholt has joined the channel [03:26] tlack: would be a fun blog post either way - you could show how your app changes when switching to async [03:28] nateps has joined the channel [03:28] OmidRaha has joined the channel [03:29] tellnes: james, the files are a set of images to be used to gennerere a movie with ffmpeg. [03:30] Trapick has joined the channel [03:30] tellnes: I do not expect the load to be so large that I need multiple instanses [03:31] RORgasm has joined the channel [03:32] Karmaon has joined the channel [03:32] Trapick has left the channel [03:32] jamesd: from what i have heard is EC3 has terrible IO... and latency varies a lot... so starting multiple streams may help or it may hurt probably best to test or better yet try kicking off one download, get the dl speed, start off a second watch combined dl speed if its more than N download start another stop when your speed decreases... because you are exceeding the IO and wasting time and memory [03:32] ljharb: jamesd: ec2, or s3? [03:33] pizthewiz has joined the channel [03:34] jamesd: i watched these videos... http://www.youtube.com/results?search_query=surge+2011 its where i learned pretty much all i know about amazon cloud [03:34] ljharb: there's no such thing as EC3 - so do you mean EC2, the compute cloud, or S3, the storage cloud [03:35] Montes: cloud files rocks ec2 [03:35] tellnes: jamesd: thanks, bookmarking [03:35] rurufufuss has joined the channel [03:36] jamesd: when bored search youtube or bryan cantrill and you will find lots of funny good videos, bryan cantrill has been described as a master engineer and tigger on speed when doing presentations [03:37] tellnes: jamesd, Do you mean that i should implement a test in the application or that I will do a test before I implement it and make the decision based on the results? [03:38] Karmaon has joined the channel [03:38] myndzi\: anybody care to explain or link to some error control best practices? [03:38] myndzi\: i have a bunch of if-thens that i suspect are unnecessary but i'm not sure how to structure things to make them so [03:39] mikeric has joined the channel [03:42] thetony: myndzi: using ?: instead of if thens makes your code much more readable [03:43] myndzi: it's not about readability, it's about functionality [03:43] thetony: myndzi: also, are you just looking at how to structure your try catches around the if thens or something else? [03:43] myndzi: say i want to read 2 bytes from a socket, then X bytes more where X is represented by the first two [03:44] myndzi: it seems to me that there's a better way than testing if there are two+ bytes, if the bytes form a valid value, if there are X+ bytes, reading those, testing if the result of THAT is a valid value.... [03:45] myndzi: probably try/catch, if that's the best alternative, i'm just looking for what to read about [03:45] myndzi: so i can write the cleanest code i can [03:45] myndzi: (but still with full input validation) [03:45] thetony: isNaN or if you want to set a default you can do try{ somevar = parseFloat(crapshoot); }catch(e){ somevar = defaultValue; } [03:46] thetony: or if you don't like try catch you can do somevar = isNaN(crapshoot)?defaultValue:parseFloat(crapshoot); [03:46] myndzi: my question pertains to the rather broader subject of code structure [03:46] dylang has joined the channel [03:46] myndzi: not any one individual case [03:46] ehazlett has joined the channel [03:47] myndzi: surely there's some common forms that node.js programs take to deal with these common problems? [03:47] myndzi: they probably even have names to describe them [03:47] myndzi: but i don't know what the names are to google them :P [03:48] thetony: if you're just validating input then just check the input using whatever method makes sense, if you want a block of code to handle errors then use try catch... why would anyone write a library to do error handling when it is built into the language? [03:48] myndzi: i'm not asking about a library [03:48] myndzi: i'm asking about how people structure their code commonly [03:48] thetony: yes [03:48] Vennril2 has joined the channel [03:49] myndzi: since i am not an expert on javascript, node.js, async programming, OR try/catch, i presume there is lots of information i don't know :) [03:49] myndzi: so if there isn't, that's fine [03:50] myndzi: maybe i can try from a different angle: [03:50] thetony: ahh, i don't know of any resources - i do error handling by using the built in funcionatlity to check types and value ranges if it's just a one line thing or a simple data type, otherwise i surround the block where it will fail with try catch and handle it gracefully [03:50] myndzi: to what extent can one plow ahead making assumptions without causing poor functionality or vulnerability [03:51] EyePulp has joined the channel [03:51] RockPaperNode: why cant i use #{value} inside a function after doing res.render('home.jade', {value : req.session.value}); . #{value} works fine in the body of the jade code [03:51] tjholowaychuk: ? [03:51] tjholowaychuk: #{value} where? [03:51] mikeal has joined the channel [03:51] tjholowaychuk: that's a jade thing not a js thing [03:51] myndzi: i do understand that i can wrap code in a try block, but how much code? is there a point where it needs to be broken down finer inside? [03:52] RockPaperNode: inside a function surrounded by script tags [03:52] RockPaperNode: illegal? [03:52] tjholowaychuk: RockPaperNode can you show me a gist [03:52] RockPaperNode: ok [03:53] thetony: myndzi: yea - you do try catch around the block that makes sense - so if you're going to read from a socket, put it around the read and then everything you do with the data that comes from the read. you need to break it into chunks that you can handle gracefully - because if some operation relies on a successful read then you need it to skip to the }catch(e){} beyond that so you can handle it without the program crashing [03:54] petschm_ has joined the channel [03:54] recur has joined the channel [03:55] thetony: on the other hand if you want to try to read and want to do the same operation on something data read in from a file (for example) then you'd try catch the read operation, and in the catch you'd read in data from the file and continue about your business [03:55] RockPaperNode: tjholowaychuk, https://gist.github.com/2223479 [03:55] RockPaperNode: line 14 [03:55] thetony: so it's a highly situational decision and something you figure out based on how you want your program to handle certain errors [03:56] Hebo has joined the channel [03:56] tjholowaychuk: RockPaperNode ah ok I see what you're saying now [03:56] RockPaperNode: can i change #{value} without having to refresh the page? if i cant use javascript [03:57] myndzi: thetony: here, have an example: http://pastebin.com/N686c2v1 [03:57] tjholowaychuk: RockPaperNode you would have whatever the value is on render [03:57] tjholowaychuk: it doesn't auto-update or anything [03:57] tjholowaychuk: #{} is just interpolation [03:57] thetony: myndzi: ? [03:57] rtgibbons has joined the channel [03:57] tjholowaychuk: #{foo + bar} basically just becomes escape(foo + bar) [03:57] myndzi: you can see there's a lot of validation going on in there, i don't necessarily need that level of detail [03:58] myndzi: but neither am i confident that i can process the entire sequence of things all in one try block and not have problems [03:58] ningu_: too bad js doesn't have interpolation inside strings [03:58] timoxley: RockPaperNode you can't change a html page without refreshing it, without js [03:59] justicefries has joined the channel [03:59] thetony: myndzi: it's tedious but that doesn't look so bad [04:00] myndzi: i don't mind tedious, i just got to wondering if that was the best way [04:00] myndzi: it seemed awfully verbose, but on the other hand it may be because i don't generally want or need to write that much error correction into stuff [04:01] meandi110 has joined the channel [04:01] thetony: myndzi: it is verbose but it needs to be if a user is going to see it : - ) [04:01] myndzi: it's heartening to hear that i'm not writing awful code though [04:01] Sadin_ has joined the channel [04:01] myndzi: :P [04:01] myndzi: a user isn't going to see this part, i just want it to work without problems [04:01] RockPaperNode: tjholowaychuk, but when i try to pass value to the function its not defined [04:02] myndzi: i know that the vast majority of the time, the data will conform to the expected format [04:02] myndzi: but i don't want it to go bonkers if it doesn't [04:02] TheFuzzball has joined the channel [04:02] timoxley: RockPaperNode show your code [04:02] RockPaperNode: ok [04:02] tjholowaychuk: RockPaperNode i think what you're meaning to do [04:02] tjholowaychuk: is [04:02] tjholowaychuk: #{JSON.stringify(value} [04:02] tjholowaychuk: instead of [04:02] tjholowaychuk: JSON.stringify(#{value}) [04:03] dodo has joined the channel [04:03] RockPaperNode: alert(#{JSON.stringify(value}); [04:05] myndzi: thetony: http://pastebin.com/G0d80KFJ [04:05] myndzi: anything wrong with doing it like that, for example? [04:05] neumino has joined the channel [04:05] kvda has joined the channel [04:06] thetony: myndzi: nope, if the user isn't going to see the error and you don't care to know where it failed then there is nothing wrong with it [04:06] Sadin has joined the channel [04:06] myndzi: ah, great [04:06] myndzi: thank you :) [04:06] k1ttty_ has joined the channel [04:06] myndzi: now i just need to understand how errors propagate etc. [04:07] myndzi: come to think about it, it's far from vital that it's a properly conformant socks5 server anyway [04:07] TheNumb has joined the channel [04:07] myndzi: since the only thing connecting to it will be of my own creation :P [04:07] ditesh|cassini has joined the channel [04:08] thetony: and inquiring minds that might use your other creation [04:08] RockPaperNode: tjholowaychuk, (value}) . are you sure you used the right brackets? [04:08] myndzi: nah, they're two parts of a whole [04:08] myndzi: the idea is to have the remote server do the work when possible [04:08] argami has joined the channel [04:08] myndzi: but also to be able to provide a standard proxy to utilize [04:08] myndzi: in which case it'd just pass back the data all dumb [04:08] eviltwin_ has joined the channel [04:09] myndzi: but for the proxies that i configure, i can save a lot of bandwidth [04:09] thetony: i know but i'd be lying if i said i didn't try telnetting to the exchange server or try to take it down even though outlook works fine [04:09] myndzi: and the client code doesn't have to differ much [04:09] tjholowaychuk: RockPaperNode typo [04:09] jbpros has joined the channel [04:09] recur_ has joined the channel [04:09] TheFuzzball has joined the channel [04:10] RockPaperNode: alert(#{JSON.stringify(value)}); [04:10] Guest66129 has joined the channel [04:13] RockPaperNode: didnt work [04:14] M1stFu has joined the channel [04:14] mikeal has joined the channel [04:15] zackattack has joined the channel [04:16] criswell has joined the channel [04:16] RockPaperNode: https://gist.github.com/2223569 [04:18] tommyvyo has joined the channel [04:19] niloy has joined the channel [04:22] halfhalo has joined the channel [04:24] michaelmartinez has joined the channel [04:26] jakehow has joined the channel [04:27] kremlon has joined the channel [04:28] kremlon: can u geise ship the moon laser to my P.O. box? [04:28] thinkt4nk has joined the channel [04:28] kremlon: hellloo [04:28] dilvie has joined the channel [04:29] kremlon: i did make; make install [04:29] kremlon: someone ship me a damn moon laser [04:29] kremlon: please ;) [04:30] tlack_ has joined the channel [04:30] kremlon has left the channel [04:33] ksys has joined the channel [04:33] michaelmartinez: how come none ya told me bout this: http://toolbox.no.de/ [04:34] TTSDA has joined the channel [04:34] michaelmartinez: Awesome. [04:34] briancray has joined the channel [04:36] iangreenleaf has joined the channel [04:37] jbpros has joined the channel [04:38] skylamer` has joined the channel [04:43] mattgifford has joined the channel [04:45] jaxzin has joined the channel [04:46] argami has joined the channel [04:47] rwaldron has joined the channel [04:49] Lady`GirL has joined the channel [04:50] TheFuzzball has joined the channel [04:50] gr4yscale has joined the channel [04:52] nicholas_ has joined the channel [04:55] kickingvegas has joined the channel [04:57] mattgifford has joined the channel [05:01] RockPaperNode: can functions be interpolated with jade? [05:02] Spion has joined the channel [05:04] njain has joined the channel [05:04] bulatshakirzyano has joined the channel [05:04] cconstantine_ has joined the channel [05:05] diogogmt has joined the channel [05:07] halfhalo has joined the channel [05:07] tommyvyo has joined the channel [05:11] astropirate has joined the channel [05:11] hardwalker has joined the channel [05:12] jgornick has joined the channel [05:14] whitglint has joined the channel [05:14] munichlinux has joined the channel [05:14] k1ttty has joined the channel [05:15] rt7 has joined the channel [05:16] mikeal has joined the channel [05:16] MT_ has joined the channel [05:17] TheFuzzball has joined the channel [05:17] yaymukund has joined the channel [05:17] yumike has joined the channel [05:19] dshaw_ has joined the channel [05:22] sechrist has joined the channel [05:23] cjm has joined the channel [05:23] tonymilne has joined the channel [05:24] michaelmartinez: RockPaperNode: no idea about jade, but def in ejs [05:24] tonymilne: does anyone have experience with node-redis and using master/slave configuration? [05:25] Skaag has joined the channel [05:30] UnCO has joined the channel [05:32] RORgasm has joined the channel [05:33] isaacs has joined the channel [05:33] admc has joined the channel [05:35] markq has joined the channel [05:35] lzskiss has joined the channel [05:37] pootietang has joined the channel [05:39] bearnard has joined the channel [05:41] maletor has joined the channel [05:42] Guest66129 has joined the channel [05:43] mattgifford has joined the channel [05:43] kmiyashiro has joined the channel [05:43] mikeal has joined the channel [05:43] TheEmpath has joined the channel [05:44] simenbrekken has joined the channel [05:44] nrub has joined the channel [05:48] jryans has joined the channel [05:49] MerlinDMC has joined the channel [05:52] vbabiy has joined the channel [05:54] njain has joined the channel [05:56] gr4yscale has joined the channel [05:56] graeme_f has joined the channel [05:58] sreeix has joined the channel [06:00] mikeal has joined the channel [06:00] djbell has joined the channel [06:02] klaustsen has joined the channel [06:03] TheFuzzball has joined the channel [06:05] khrome has joined the channel [06:09] hackband has joined the channel [06:10] dragansah has joined the channel [06:12] fangel has joined the channel [06:14] xtro has joined the channel [06:15] recycl3_ has joined the channel [06:15] rio{ has joined the channel [06:16] antz291 has joined the channel [06:16] nerdy has joined the channel [06:17] SiGe has joined the channel [06:18] scientes has joined the channel [06:23] SamuraiJack has joined the channel [06:24] mdel has joined the channel [06:25] admc has joined the channel [06:28] ph^ has joined the channel [06:32] conancat has joined the channel [06:32] TheFuzzball has joined the channel [06:33] mikeal has joined the channel [06:34] efazati has joined the channel [06:35] pkrumins: is there moderation on node.js mailing list on google groups? i posted a question about 15 minutes ago but i don't see it in the list yet. [06:36] jerng has joined the channel [06:36] scientes: is there any api compability between HTML5 localstorage and node.js storage? [06:36] maxogden: scientes: node.js storage? [06:37] kirbysayshi has joined the channel [06:37] scientes: well like sqlite or something [06:38] scientes: cause it would be slick if lots of software worked both on the client and on the server [06:38] timoxley: scientes in reality, there's not really a lot of *useful* crossover [06:38] timoxley: validations [06:39] timoxley: object fields [06:39] scientes: if you validated with regular expressions that wouldn't even be neccicary [06:39] scientes: "object fields"? [06:39] rio{ has joined the channel [06:40] timoxley: scientes as in, models [06:40] markq: anyone have a good explanation for singletons in javascript. I came across the term and I don't fully understand it yet it seems that it utilizes closures and private vars [06:42] astropirate: markq, singleton means you only have one instance of an object [06:42] nateps has joined the channel [06:42] timoxley: markq http://addyosmani.com/resources/essentialjsdesignpatterns/book/#singletonpatternjavascript there's not really much to it. [06:43] xtro has joined the channel [06:43] TheFuzzball has joined the channel [06:43] timoxley: markq and they're typically a fairly shit pattern anyway [06:44] kahlin has joined the channel [06:44] astropirate: my java loving professor will stab me if he heard me say "instance of an object" :( [06:44] kranius: java is serious business [06:45] antz29: @astropirate in javascript that is all you have :) [06:45] timoxley: markq http://misko.hevery.com/code-reviewers-guide/flaw-brittle-global-state-singletons/ [06:45] admc1 has joined the channel [06:45] timoxley: antz29 no, you have instances of types/classes. instances == objects [06:45] scientes: so its like a static array in C++? [06:46] timoxley: antz29 though I'm not sure whether to call it a type or a class [06:46] astropirate: timoxley, Object :) [06:46] RockPaperNode: https://gist.github.com/2224350 why does this give a syntax error when i try to store value? jade [06:46] scientes: lets just call them all "thingymajigs" [06:47] jerng has left the channel [06:47] timoxley: astropirate type [06:47] timoxley: astropirate https://developer.mozilla.org/en/JavaScript/Reference/Operators/new [06:47] timoxley: "The new operator creates an instance of a user-defined object type or of one of the built-in object types" [06:47] rendar has joined the channel [06:47] astropirate: huu [06:48] timoxley: isaacs when you are all like "javascript has classes" perhaps it's more accurate "javascript has types" [06:48] timoxley: isaacs that might change peoples expectation of how inheritance works and whatnot [06:48] jesusabdullah: javascript has motherfuckers :) [06:48] aranw has joined the channel [06:49] jesusabdullah: js dont need no classes, it went to the school of hard knocks [06:49] antz29: @jesusabdullah :D [06:50] jesusabdullah: ACTION tweets that for karma [06:50] groom has joined the channel [06:51] timoxley: jesusabdullah I estimate 3 retweets and 2 favourites [06:51] Hebo has joined the channel [06:51] jesusabdullah: haha [06:51] jesusabdullah: sounds about right [06:52] jesusabdullah: favorites always throw me for a loop [06:52] jesusabdullah: like [06:52] jesusabdullah: someone would want to look that tweet up later? Alright [06:52] timoxley: hahah [06:52] antz29: lol [06:52] jesusabdullah: I mean, I guess it's possible [06:53] guidocalvano has joined the channel [06:53] TheFuzzball has joined the channel [06:53] huggies has joined the channel [06:53] jesusabdullah: like [06:53] jesusabdullah: https://twitter.com/#!/marak/status/71911996051824640 this is one I've looked up a few times [06:54] jesusabdullah: so sure, I'll fave it RIGHT NOW [06:54] jesusabdullah: git push it good [06:54] jesusabdullah: git push it REAL good [06:54] jesusabdullah: antz29: You *accidentally* founded a thing? How the even?? [06:55] antz29: :) [06:55] antz29: over a weekend. it just happened :) [06:55] jesusabdullah: Explain. [06:55] jesusabdullah: How do you accidentally an entire website? [06:55] astropirate: I accedently deleted my website last week :( [06:55] jesusabdullah: Whoops, my hand slipped and I registered geeks.io! [06:56] antz29: it was like, I made the site, as a bit of a joke. then people actually liked it. so it turned into a viable business. by accident. [06:56] jesusabdullah: hahaha [06:56] jesusabdullah: that's actually kinda awesome [06:56] antz29: :) [06:57] antz29: well, that also means I actually have to build the thing [06:57] antz29: which is interesting, but happening [06:57] jesusabdullah: sure, I hear you there [06:58] ljharb: jesusabdullah: i use favorites as "stuff to read later" [06:58] jesusabdullah: ljharb: You can't be assed to read 140 characters RIGHT NOW? ;) [06:58] ljharb: ha. when it's a link, silly. [06:58] jesusabdullah: haha XD [06:59] jesusabdullah: Yeah, that makes sense [06:59] jesusabdullah: like, link to a blog post [06:59] jesusabdullah: I can buy that [06:59] ljharb: i can scan through a LOT of tweets in my feed if i just star things i want to read later [06:59] emattias has joined the channel [07:00] mehlah has joined the channel [07:00] jesusabdullah: sure [07:01] ioscale has joined the channel [07:01] TheFuzzball has joined the channel [07:01] hipsterslapfight has joined the channel [07:02] skeptic has joined the channel [07:02] robotblake`alt has joined the channel [07:03] meelash_ has joined the channel [07:03] disappea_ has joined the channel [07:03] isaacs: timoxley: javascript has special things that can be used to instantiate instance objects that inherit from them. those special things can inherit from other special things like them. they have a constructor, properties, and methods. that sounds a LOT like a class to me. [07:03] jesusabdullah: ljharb: Do you un-fave when you're done? [07:03] maletor has joined the channel [07:03] ljharb: yep [07:03] jesusabdullah: isaacs: but they're post-de-facto classes [07:04] timoxley: isaacs it also sounds a lot like a type [07:04] jesusabdullah: they're like classes that you define *later* [07:04] isaacs: timoxley: "boolean" is a type [07:04] ljharb: isn't a class using classical inheritance by definition? things with prototypal inheritance aren't classes, they're prototypes [07:04] timoxley: .. new Boolean() [07:04] isaacs: there's only two booleans. every "true" is the same as any other [07:04] isaacs: timoxley: new Boolean() is not a boolean, it's an object [07:04] isaacs: typeof new Boolean() === "object" [07:04] jesusabdullah: idk man, util.inherits is kinda like classical inheritantz [07:04] ljharb: ick, i wish "new Primitive" had never been put into the language [07:04] timoxley: gotcha [07:05] jesusabdullah: isaacs: That sounds like a bunch of bullshit to me. I asked for a new boolean not an object -_-;; [07:05] isaacs: jesusabdullah: in that it's inheritance of classes? yes. [07:05] jesusabdullah: ಠ_ಠ [07:05] bergie has joined the channel [07:05] isaacs: jesusabdullah: well, no one said js is a good language [07:05] timoxley: ljharb necessary for some things eg dynamic regexes [07:05] ljharb: i find systems designed without inheritance tend to be nicer to work with than those with. [07:05] conancat has joined the channel [07:05] jesusabdullah: inheritance has its place [07:05] isaacs: being able to treat primitives as objects is kinda neat, though [07:05] isaacs: like "asdfasdf".split("a") [07:05] ljharb: timoxley: new RegEx yes, but none of the others are beneficial imo, including new Array [07:05] jesusabdullah: but it's a sometimes food. [07:06] ljharb: isaacs: yes, but you shouldn't and don't need the "new" keyword to be able to do that. [07:06] timoxley: jesusabdullah a food [07:06] isaacs: ljharb: new Array is the fastest way to create an array if you know the size up front [07:06] jesusabdullah: yes. [07:06] jesusabdullah: I eat prototypes for breakfast. [07:06] jesusabdullah: That's how we roll at nodejitsu yo. [07:06] isaacs: ljharb: as an implementation detail, javascript has an internal "toObject" method on all things [07:06] mikeal has joined the channel [07:07] ljharb: isaacs: so rarely is that the case, that i'd rather see that be abstracted out of us programmers' knowledge into the engine. [07:07] isaacs: ljharb: and the object that "asfsadf" casts to is an instanceof String [07:07] isaacs: ljharb: that's why, for exampel, you can put a method on String.prototype, and then call it from "asdfasdf" [07:07] jesusabdullah: That's it I'm using haskell and haskell only for now on [07:07] jesusabdullah: ACTION starts memorizing his haskell textbook [07:08] jesusabdullah: at least it has pictures [07:08] jesusabdullah: good ol' BONUS [07:08] timoxley: I'm considering trying out this clojurescript thing, can compile to js [07:08] isaacs: jesusabdullah: i memoized my haskell textbook [07:08] ljharb: isaacs: true - i understand there are benefits, but i've never had to augment prototypes nor use "this", "new", or "instanceof" to solve a problem in JS elegantly [07:08] isaacs: jesusabdullah: i've never called it, though, so it's still undefined. [07:08] kyledr has joined the channel [07:08] jesusabdullah: Og [07:08] jesusabdullah: Oh* [07:08] jesusabdullah: I just bought mine from No Starch [07:08] jesusabdullah: seemed easier [07:08] isaacs: ljharb: you've never used "new" or "this" in js? [07:09] efazati has left the channel [07:09] isaacs: i've actually been recently using "this" like a madman. i kinda love it. [07:09] ljharb: isaacs: i have certainly used it when modifying existing code, or in jquery event handlers, but whenever i start from scratch, or have refactor control? nope. [07:09] isaacs: now that we have .bind(), it's so lovely [07:09] jesusabdullah: I find that prototypes are nice for stateful things that have a strong sense of "instances" of some Thing [07:09] jesusabdullah: like, if the abstraction fits it's great [07:09] ljharb: i don't like stateful things [07:09] jesusabdullah: if not, well, you have choices [07:09] isaacs: new and this are good for problems where OOP is a good fit [07:09] timoxley: isaacs bind() is slow vs self = this [07:09] jesusabdullah: Yeah, but some things are inherently stateful [07:09] isaacs: OOP is sometimes a good fit [07:09] isaacs: timoxley: profile before optimizing [07:09] Hebo has joined the channel [07:09] ljharb: isaacs: for what things is OOP a good fit? i'd bet far fewer things than it's actually used on. [07:10] isaacs: timoxley: if youer' going to read a file, or hit a network server, then the overhead of "bind" is negligible. [07:10] jesusabdullah: ljharb: stateful things that have a strong sense of category and instance [07:10] jesusabdullah: Things that can be thought of better as transforms? Just use a function [07:10] isaacs: ljharb: every software tool is abused and overused. don't blame the victim [07:10] nsolsen has joined the channel [07:10] SubStack: ljharb: when you need a container for mutable state with a collection of operations on that state [07:10] SubStack: but probably you should just use builtins [07:10] jesusabdullah: ^^ this [07:10] chrisdickinson: i've found that the more careful you are about what you're closing over, the easier it is to read your code later. [07:10] jesusabdullah: well, the first line of that anyway [07:10] ljharb: isaacs: that is a fair point :-) [07:10] milani has joined the channel [07:10] jesusabdullah: If builtins fit, rock 'em [07:11] isaacs: ljharb: so, i have this library "fstream" [07:11] chrisdickinson: that is, javascript-as-it's-commonly-written optimizes heavily for the writing case, but very poorly for the "reading" case. [07:11] ljharb: SubStack: you mean a closure via the module pattern? [07:11] isaacs: ljharb: you can wrap a dir, and then pipe it to another dir [07:11] `3rdEden has joined the channel [07:11] Aiden has joined the channel [07:11] isaacs: ljharb: it does this using a bunch of OOP [07:11] SubStack: builtin data types are nice because you can use general-purpose functions to manipulate them [07:11] xippi has joined the channel [07:11] xippi has joined the channel [07:11] SubStack: ljharb: I mean you probably shouldn't be using classes unless you need to encapsulate over some state [07:11] ljharb: isaacs: i guess i'd prefer the mixin approach, where i pass the dir data object into functions that expect it, rather than calling methods on the dir instance [07:11] isaacs: ljharb: but a file or a symlink or a dir can be thought of as a thing [07:11] isaacs: ljharb: then, i can *not actually know or care* what the thing is, and just pipe to it [07:11] chrisdickinson: that being said, (crockford's) module pattern can DIAF. ): [07:12] jesusabdullah: You can do similar things with closures but they're different in important ways. [07:12] timoxley: isaacs i read that aloud in my head at "fist ream" [07:12] timoxley: sa [07:12] SubStack: ljharb: you should watch this video http://pyvideo.org/video/880/stop-writing-classes [07:12] milani: Is there any way to compile a js module like a C module? So it will be a complete .node package? [07:12] timoxley: omg [07:12] timoxley: as [07:12] ljharb: chrisdickinson: i love crockford's module pattern :-) [07:12] ljharb: SubStack: i'll do that now [07:12] isaacs: ljharb: so, a tarball is like a dir [07:12] jesusabdullah: It's like the difference between a skilsaw and a sawzall [07:12] jesusabdullah: and a table saw [07:12] jesusabdullah: all saws but, like [07:12] jesusabdullah: you'd never use a sawzall to cut a straight line [07:12] SubStack: isaacs: I think thinking in terms of things is mostly a confusion [07:12] jesusabdullah: and you'd never try to hold a table saw with one hand [07:12] isaacs: ljharb: so, node-tar uses fstream, and you can do tarball.pipe(tar.Parse()).pipe(somedir) [07:13] isaacs: SubStack: it's not about nouns vs verbs. [07:13] ljharb: isaacs: well sure, anything's like an anything if you have a loose enough definition of "like". [07:13] ablomen has joined the channel [07:13] isaacs: SubStack: it's about interfaces vs guts. [07:13] jaxzin has joined the channel [07:13] ljharb: isaacs: so why not "tar.extract(tarball, somedir)" or something [07:13] isaacs: ljharb: nono, they're really very similar. [07:13] chrisdickinson: ljharb: i've found that it ends up making things more complicated in the long term, with very few actual gains. [07:13] isaacs: ljharb: you can do that, too, but it's clumsier [07:13] isaacs: ljharb: i'm not saying functional programming doesn't have its place. [07:13] jesusabdullah: streams are pretty rad homie [07:14] isaacs: this is not a either-or [07:14] chrisdickinson: jesusabdullah: the refrain of node.js in a line. [07:14] SubStack: isaacs: things make you think about the "what" when really all you should need to care about is "how" you can trick some piece of software to do what you want [07:14] ljharb: i guess i find it clumsier to use a classical approach than i do to use a functional approach [07:14] isaacs: SubStack: again, it's about internal vs external. [07:14] jesusabdullah: the strength of javascript is that you can combine new Thing(hugeOptionsObject) and list.map(thing).filter(thing2).reduce(thing3) [07:14] chrisdickinson: ljharb: don't get me wrong, i write nested code all the time, but i always take care to rewrite it in a flat manner that exposes all the bits to unit tests. [07:14] jesusabdullah: javascript don't care. javascript don't give a shit. [07:14] jesusabdullah: It just codes what it wants. [07:15] jesusabdullah: Look, there it calculates in slow motion. [07:15] isaacs: SubStack: it's a very convenient abstraction to think of a tarball as a stream of files, and to pipe that stream of files into a directory writer object that will nicely lay them out on the fs. [07:15] chrisdickinson: that is to say, function.prototype.bind is amazing at flattening out code. [07:15] ppcano has joined the channel [07:15] jesusabdullah: I'd kinda like something where I could fix the nth arguments [07:15] jesusabdullah: for certain problems anyway [07:15] mikedeboer has joined the channel [07:15] isaacs: and the file writer thing doesn't need to know where the entries are coming from, as long as they fit the right shape. [07:15] isaacs: SEPARATE ALL THE CONCERNS! [07:16] chrisdickinson: jesusabdullah: i'd like something where i could rewrite the scope chain of an external function :\ [07:16] thirdknife has joined the channel [07:16] SubStack: isaacs: sure that could be 2 separate modules [07:16] jesusabdullah: The use case I have in mind is derivatives along a certain axis [07:16] isaacs: SubStack: it is [07:16] chrisdickinson: (you know, like the `Function` rewriting, but without getting rid of the original scope chain) [07:17] jesusabdullah: like, dy = f.fix({0: y0, 2: z0}) [07:17] chrisdickinson: ACTION apologizes for jumping on the stylistic dogpile [07:17] isaacs: SubStack: but, because it's the *shape* i've defined, rather than the implementation, and because classes can be extended via inheritance, i can make another shape that behaves slightly differently but also works [07:17] jesusabdullah: not that this is something you would do with jabbascripts [07:17] jesusabdullah: really I should just find the time to fuck around with julia, like, a lot [07:17] chrisdickinson: jesusabdullah: https://github.com/chrisdickinson/jabbascript [07:17] chrisdickinson: :| [07:17] SubStack: isaacs: I'm less convinced of that second claim [07:18] chrisdickinson: ACTION loosens collar. [07:18] jesusabdullah: SPEAKING OF there's a PR for julia involving libuv so I'm HOPING that means julia's standard library involves being able to throw together gut servers like a mo'fucker [07:18] isaacs: SubStack: so i took that "read a dir" thing, and extended it to "read a dir, ignoring files matching specific patterns" [07:18] SubStack: why not pass the writer a function to handle writing to files? [07:18] SubStack: it could define to fs.writeFile [07:19] SubStack: or fs.createWriteStream [07:19] isaacs: SubStack: because they're not just files [07:19] jesusabdullah: chrisdickinson: nice [07:19] SubStack: but if you want to ignore things you could make that function do nothing on certain inputs [07:19] chrisdickinson: SubStack: it's a useful convention in that it takes the place of "configuration"-style APIs. [07:19] isaacs: SubStack: they wrap fs.createWriteStream and fs.symlink and fs.mkdir [07:19] jesusabdullah: chrisdickinson: Now there's some javascript changes potentially worth something! [07:19] chrisdickinson: jesusabdullah: haha, thanks. [07:19] isaacs: SubStack: why is "certain function" better than "function with certain prototype features? [07:19] chrisdickinson: (saw "jabbascripts" and couldn't resist linking.) [07:20] jesusabdullah: I can dig it [07:20] hackband has joined the channel [07:20] isaacs: SubStack: "When there's a thing like this, behave that way" [07:20] efazati has joined the channel [07:20] SubStack: isaacs: because when you extend methods through inheritance you've got to care about far more implementation details [07:21] dmilith_ has joined the channel [07:21] efazati: i cant install jsclass with npm recieve error npm: symbol lookup error: npm: undefined symbol: SSL_CTX_set_next_proto_select_cb how fix it? [07:21] isaacs: SubStack: why? [07:21] chrisdickinson: SubStack: imho, the prototype-style API lets you offload a lot of potentially not-used-very-often configuration elsewhere, so that the functions you're presenting and returning can take simpler arguments. [07:21] jesusabdullah: As long as my method's there why do I have to give a shit? [07:21] SubStack: and if the internals of your prototype change, you break all the modules that depend on those implementation details [07:21] tttthet has joined the channel [07:21] isaacs: SubStack: you still only have to care about the interface signature. [07:21] isaacs: SubStack: then youer' writing classes badly :) [07:21] milani: efazati: It's not the time for question:)) They are at the middle of a war!! [07:21] ljharb: isaacs: why not care about the data schema instead of the interface? [07:21] isaacs: SubStack: i mean, if the function internals change, then you break the modules calling that function, too [07:22] timoxley: ^^ this [07:22] jesusabdullah: efazati: gist ALL the logs and then paste the gist here. [07:22] efazati: milani, :D hi morteza ;) [07:22] isaacs: SubStack: unless that function's contract was well defined. [07:22] isaacs: SubStack: it's all the same, really. [07:22] jetienne has joined the channel [07:22] jesusabdullah: but you can have a well-defined contract involving any ol' construct amirite [07:22] milani: efazati: hi! [07:22] SubStack: isaacs: function composition and passing functions around to handle custom functionality gives you much more freedom over how it works internally and what api you expose to other pieces of code that use your interface [07:22] isaacs: SubStack: you can pass functions to instances of a class. [07:23] SubStack: contract programming is silly [07:23] efazati: jesusabdullah, http://www.pasteit.com/17299 [07:23] salva has joined the channel [07:23] jesusabdullah: Or, pass instances of a class to a function? [07:23] isaacs: SubStack: that's basically what the event pattern IS [07:23] isaacs: SubStack: sure, i mean, you can get silly with it. [07:23] disappea_ has left the channel [07:23] isaacs: SubStack: contract programming, i mean [07:23] jesusabdullah: isaacs: shortest npm output evar http://www.pasteit.com/17299 [07:24] ljharb: SubStack: i do like this video so far :-) [07:24] isaacs: jesusabdullah: problem with openssl [07:24] jesusabdullah: isaacs: efazati wants to know not I [07:24] milani: efazati: do you get this error only for jsclass? it seems your npm is not functioning properly [07:24] isaacs: efazati: ^ [07:24] benjixx has joined the channel [07:25] isaacs: SubStack: i got pretty far along writing a tar implementation that was primarily functional in nature. it was way too clumsy and tedious to use. [07:25] SubStack: isaacs: using classes internally is usually fine, I'm just arguing against exposing those classes to any code that lives outside the module [07:25] chrisdickinson: i've been leaning towards the side that one should expose a simple function contract, while still exposing the underlying class structure as a member on the function. [07:25] isaacs: SubStack: at *some* point, you have to have an actual parser, and manage all these streams of data, and they have a bunch of state associated with them, and you need to take actions based on that state [07:25] SubStack: because when you write a module you have complete control over all the files [07:26] isaacs: SubStack: but i WANT to extend the classes. that's the point. [07:26] efazati: milani, no all package is same ... i think its from npm ... its git instance [07:26] isaacs: efazati: your node install is broken. how'd you install it? [07:26] [AD]Turbo has joined the channel [07:26] milani: efazati: may be you updated your node, but not npm [07:26] timoxley: isaacs do you? JS tends to lend more to extending via composition [07:26] disappearedng has joined the channel [07:26] TheFuzzball has joined the channel [07:26] milani: efazati: did you compiled it without npm? [07:27] chrisdickinson: having to fork or include a modified version of someone's lib because i need to change one piece of functionality consistently ruins my day. [07:27] SubStack: isaacs: but that makes your class internals very difficult to change because all the consumers of your module will get access to a lot of internal bits and will start depending on them [07:27] josh-k has joined the channel [07:27] benvie: js works really well with its kind of classes [07:27] incon has joined the channel [07:27] benvie: not classes classes [07:27] timoxley: SubStack +1 to that [07:27] shinuza has joined the channel [07:27] isaacs: SubStack: i change those class internals a lot. i don't expose the internals. [07:27] efazati: isaacs, milani used package manager [07:27] disappearedng: Any socket.io user here? If i have my server running on port 8888, does my users need their port 8888 to be opened in order to connect to my server? [07:27] isaacs: efazati: npm -v [07:27] isaacs: efazati: er, node -v [07:27] sectionme: disappearedng: no, they dont. [07:27] [AD]Turbo: hi there [07:28] benvie: I tend to make classes that expose an interface and not their internals [07:28] efazati: isaacs, 1.1.12 [07:28] SubStack: isaacs: how can you not expose the internals while offering the prototype up as an export? [07:28] isaacs: SubStack: things that start with _ aren't for dicking around with [07:28] SubStack: hahaha [07:28] isaacs: SubStack: it's a rule, and i follow it. those who don't get what's coming to them. [07:28] benvie: if you really don't want to expose them you can not use properties in that way [07:28] isaacs: SubStack: i'm not handing this code off to hardened criminals, here. i'm using it in my own programs. [07:29] chrisdickinson: jesusabdullah: belatedly related, thanks for the inspiration to include http://neversaw.us/media/popcollar.jpg on my JS style guide. [07:29] stride: isaacs forces people that use _-methods to write enterprise java for a week [07:29] disappearedng: sectionme: what about universities? [07:29] hgg has joined the channel [07:29] timoxley: So basically, use classes if you will but they shouldn't be the *primary* interface to your module, if exposed at all [07:30] SubStack: exposing classes will just give you more bug reports when you change things [07:30] chrisdickinson: isaacs: +1 on the underscore-prepended methods. [07:30] bondar has joined the channel [07:30] sectionme: disappearedng: ah, your tlking proxy use, then you'd be best off sticking to standard used web ports, as some out going ports are blocked in places like uni's. [07:30] isaacs: SubStack: meh. i already get the maximum number of bug reports when i don't change things. [07:30] milani: everybody, how can I compile a js module into .node package?! is it possible? [07:30] disappearedng: well I will use port 64k+ then [07:30] disappearedng: just to make sure it doesn't clash [07:30] isaacs: SubStack: seriously, though, i mean, if you change a function, it's the same [07:30] hkjels has joined the channel [07:30] isaacs: SubStack: you bump the version number. no big deal. [07:30] isaacs: that's what versions are for. [07:31] chrisdickinson: also tests. [07:31] sectionme: disappearedng: no, they'll more than likely be blocked, stick to 80 or 8080 or 443 [07:31] SubStack: isaacs: or worse, when you write code that depends on the internals and then you want to change the internals and now you've got to update the code that uses your module in dozens of places to get on the latest version [07:31] isaacs: it's not like changing the behavior of a class is somehow more or less hazardous than changign the behavior of a function [07:31] isaacs: SubStack: again, version numbers. [07:31] isaacs: SubStack: why do you think i wrote npm? [07:31] chrisdickinson: SubStack: django manages pretty well with isaacs approach. [07:32] aliem has joined the channel [07:32] sectionme: disappearedng: you can mount your socket.io on the same port as your app in node you know? or setup addition ip addresses and port forward the data at the OS kernel level from 80 to app port. [07:32] isaacs: SubStack: besides, the prototype of Function and Object are exposed. [07:32] jesusabdullah: chrisdickinson: That's awesome [07:32] isaacs: SubStack: it's not as if js is a safe language anyway [07:32] SubStack: anyways I don't want to extend things, I just want to accomplish some other ends [07:32] RORgasm has joined the channel [07:32] SubStack: isaacs: and haskell has unsafePerformIO and boxed type classes [07:33] jesusabdullah: chrisdickinson: You on twitter dude? [07:33] chrisdickinson: jesusabdullah: thanks B) [07:33] isaacs: SubStack: i think you've been burned by too many "Lookit my awesome class builder thingie" wanks. [07:33] chrisdickinson: jesusabdullah: @isntitvacant [07:33] isaacs: SubStack: it's just another tool, man [07:33] isaacs: use it for what it's good for, don't use it if it isn't. [07:33] isaacs: this isn't religion [07:33] SubStack: isaacs: class builders? I don't even run in to that kind of stuff [07:34] isaacs: SubStack: oh, the "JS doesn't have classes so we made a Class function for making classes" bullshit [07:34] SubStack: what I have been bitten by is interfaces that expose too much of their internals [07:34] isaacs: SubStack: almost every JS lib has one [07:34] isaacs: SubStack: oh, that too [07:34] isaacs: SubStack: if there's "too much internals" then your class is too big, anyway [07:34] jesusabdullah: Can't you just ignore the internals? [07:34] SubStack: and exporting a class tends to expose a lot of internals [07:34] Hebo_ has joined the channel [07:34] SubStack: far more than a simple functional api would, even if that functional api uses classes internally [07:35] isaacs: SubStack: that would have been unnecessarily difficult for streaming directories and tarballs. [07:35] disappearedng: sectionme: I am currnetly using nginx for reverse proxying [07:35] disappearedng: not ideal [07:35] isaacs: SubStack: but, you can pretend that those things are functions, because i sniff the instanceof in the ctor [07:35] disappearedng: I also use node-http-proxy [07:35] disappearedng: also not ideal due to omniauth problems [07:35] isaacs: SubStack: so that i can do fstream.Reader(...).pipe(tar.Pack()).pipe(zlib.Gzip()).pipe(fstream.FileWriter()) [07:35] SubStack: isaacs: you could just write a functional wrapper around what you already have and expose that probably [07:36] mukealicious has joined the channel [07:36] bergie has joined the channel [07:36] stagas has joined the channel [07:36] isaacs: SubStack: why, though? that's more code, and extra mental gymnastic [07:36] AD7six has joined the channel [07:36] timoxley: to reduce the surface area [07:36] SubStack: ^^^ [07:37] isaacs: but it doesn't really. [07:37] isaacs: it just makes more code. [07:37] SubStack: reducing surface area isn't about how much code there is [07:37] isaacs: if it doesn't make the implementation smaller or more elegant, then it's not actually an *improvement* [07:37] isaacs: surface area is a heuristic [07:37] isaacs: not dogma [07:37] jesusabdullah: I'm with isaacs on this one [07:37] SubStack: writing lots of modules is often far more code than just hacking all the functionality into an app from scratch [07:37] chrisdickinson: it seems like that leads to a situation where you've either got a horrendous configuration object, or lower levels of your code -- the parts you might want to tweak -- are completely inaccessible from the surface api. [07:38] isaacs: SubStack: sure, but it's more elegant and less complicated to reason about [07:38] benvie: how does that reduce surface area though. If you ever give one of those internal anythings back you are exposing surface area by that reasoning [07:38] isaacs: SubStack: less code is a heuristic, as well ;) [07:38] chrisdickinson: ACTION is with isaacs though somewhat against the ctor sniffing, for some weird reason. [07:38] benvie: I don't feel inclined to store all state using function scope [07:38] tomasztomczyk has joined the channel [07:38] benvie: and local vars [07:38] SubStack: chrisdickinson: if there are too many opts that is a sign that it should be split up into multiple modules [07:39] chrisdickinson: SubStack: but that topmost module may need to allow configuration of submodules. [07:39] timoxley: isaacs a single file that hides unneccessary details and creates useful helpers isn't exactly a complicated piece of functionality, i probably wouldn't even bother with tests on it [07:39] SubStack: instead of tweaking code you can just recombine tiny modules that expose simple interfaces to accomplish what you need [07:39] timoxley: *with extensive tests [07:39] chrisdickinson: i mean, i love the function-as-contract API. i don't think it's a binary either/or between that and exposing classes, though. [07:39] isaacs: SubStack: so, here's the problem set: i have a bag of properties, and maybe some amount of data coming soon. this bag of properties needs to go into that folder. i don't want to have to look too closely at it [07:40] jesusabdullah: a'ight homies, as intellectually stimulating as this all is I'm turning in [07:40] isaacs: SubStack: it's about moving impelemntation details *away* from the consumer code. [07:40] isaacs: SubStack: you can do that in some cases with classes. you can do that in some cases with functions. every tool should be at one's disposal. [07:40] chrisdickinson: rather, as a client of that code, i look at it as being able to subscribe to different levels of immutability between my code and the library's. [07:41] chrisdickinson: if i'm using the function contract -- that's great! i have the highest assurance that future versions will work with my code. [07:41] isaacs: chrisdickinson: you pick one version, and you upgrade carefully [07:41] dannyamey has joined the channel [07:41] isaacs: there's no silver bullet here. [07:41] whitman has joined the channel [07:41] chrisdickinson: if i need to tweak things -- that's okay! so long as i stick to their public-ish methods (exposed as a constructor on the function contract), i should be okay. [07:42] mauritslamers has joined the channel [07:42] isaacs: even "version numbers" relies on people not being stupid, and you knowing what youer' doing [07:42] chrisdickinson: true. [07:42] chrisdickinson: but as a user of a library, i can assign different amounts of faith to ways in which i use that library. [07:42] SubStack: isaacs: but if you expose a class with the intent that users will extend it I don't see how that moves the implementation away from consumer code [07:43] efazati: isaacs, i was installed again npm but problem exists 1.1.13 and 0.6.14 [07:43] chrisdickinson: if you've got a contract, i *know* the author should be able to keep that in order. if i'm using a class, i'm *fairly sure* they can. and so on. [07:43] chrisdickinson: but the worst case situations are that i can't modify behavior of that library at all, and must include it in a (blegh) vendors/ dir, or... [07:43] isaacs: SubStack: think of the public methods on the class as something like a set of custom methods that you can pass to a functional API [07:43] isaacs: SubStack: or listeners on an event [07:44] whitglint has joined the channel [07:44] chrisdickinson: .. or if there's no clearly delineated "public" or "private" class API. [07:44] Axsuul has joined the channel [07:44] Axsuul has joined the channel [07:44] argami has joined the channel [07:44] isaacs: SubStack: by splitting functionality up into reasonable pieces, you can pick and choose what bits to swap out, as long as you follow the defined expectations [07:44] chrisdickinson: (not necessarily strictly enforced as in java-style public/private, but no clues given as to what might change in the future -- which isaacs "_" prepended methods give). [07:45] isaacs: chrisdickinson: you CAN define methods in the module, and only call them via fooBarr.call(this, arg, arg) [07:45] SubStack: isaacs: the expectations and being thrust into a world of state is what I balk at [07:45] isaacs: i've experimented a bit with that. it's more trouble than it's worth [07:45] chrisdickinson: isaacs: yeah, but in practice i absolute disdain having "private" private methods. [07:45] chrisdickinson: if i can't expose it, i can't test it. [07:46] timoxley: ^^ +1 [07:46] isaacs: SubStack: the world is state, man [07:46] cedeon has joined the channel [07:46] maxogden: ACTION puts on tinfoil hat [07:46] isaacs: SubStack: stateless things are easier to debug, because they don't do much that's interesting. [07:46] SubStack: humans are pretty bad at reasoning about stateful operations [07:47] jesusabdullah: Are they? [07:47] isaacs: SubStack: the period goes before "about" [07:47] maxogden: yea debugging oop is poop [07:47] jesusabdullah: Most numerical algorithms are stateful in nature [07:47] jesusabdullah: or, at least, are described in stateful terms [07:47] jesusabdullah: admittedly, a lot of that is for performance reasons [07:48] jesusabdullah: but, like, iterative methods have been my bread and butter [07:48] jesusabdullah: oh right I was going to bed [07:48] isaacs: same here. good night [07:48] gasbakid has joined the channel [07:48] maxogden: sweet dreams sweet holbrook [07:48] flou has joined the channel [07:48] maxogden: sweet dreams sweet schlueter [07:49] chrisdickinson: may a flight of angels sing thee to thy rest? [07:49] jesusabdullah: I'd be down [07:49] chrisdickinson: ACTION orders 2 flights of angels. [07:50] markwubben has joined the channel [07:50] chrisdickinson: still, somewhat ironic that there's a debate about classes introducing too much statefulness in javascript, while (nearly) every conversation i've had elsewhere has been "how do you deal with all the statefulness of closures in javascript?" [07:51] SiGe has joined the channel [07:53] cosmincx has joined the channel [07:54] pgte has joined the channel [07:54] hz has joined the channel [07:54] dobber has joined the channel [07:55] ljharb: what needs dealing with? [07:56] rlidwka has joined the channel [07:56] booyaa: whoops [07:56] confoocious has joined the channel [07:57] TomY has joined the channel [07:57] fangel has joined the channel [07:58] djcoin has joined the channel [07:59] booyaa: anyone know of any github projects that are being tested on travis that involve an api and oauth keys i.e. twitter, google. right now the only way i can think of making these tests is to create a test account for the webservice i'm testing again and embed those keys [07:59] SubStack: chrisdickinson: part of why I am so suspicious of classical-code is that I've had to refactor a lot of that style lately [07:59] SubStack: some older code of mine written in that style that sucks [07:59] TheFuzzball has joined the channel [07:59] booyaa: mind you if i'm tdd-ing i shouldn't being testing the api url end point anyhoo [08:00] chrisdickinson: SubStack: there are definitely pitfalls. [08:00] SubStack: booyaa: tdd is silly [08:00] SubStack: just write tests [08:00] chrisdickinson: but, on the other hand, i really, really hate to have to include modules in a vendor directory just to modify one small part of them [08:00] SubStack: tests are just there to save you time verifying that what you wrote actually works [08:00] booyaa: SubStack: i've been finding it useful, i'm still fairly green when it comes to writing code. well in my head i feel green. tdd's a nice way of combining both [08:00] booyaa: SubStack: true [08:01] SubStack: you don't need an overarching philosophy to write tests [08:02] cosmincx has joined the channel [08:02] chrisdickinson: i feel like using classes has helped to flatten out my code more, while at the same time exposing more individual pieces of my code to unit tests. [08:02] SubStack: chrisdickinson: it's easy to do that with npm, you can just put the github fork url in the dependency field [08:02] ljharb: chrisdickinson: how do classes expose things that modules don't? you still have to choose public/exposed versus private/hidden [08:03] chrisdickinson: i'm also a hardcore advocate of rewriting code using function(){}.bind as much as possible. [08:03] graeme_f has joined the channel [08:03] chrisdickinson: (over simply closing over variables in current scope.) [08:03] ljharb: bind just constrains the context of "this" [08:03] SubStack: ljharb: there are internal implementation reasons why you might have methods or attributes exposed when you write a class [08:04] chrisdickinson: ljharb: well, it's a semantic thing, i suppose. you've got three choices, as of right now, with javascript modules -- export a function, export a constructor, or your module *is* the class. [08:04] SubStack: but when you decide what pieces you want to exports, you have more control over that [08:04] ljharb: SubStack: more control in a class? [08:04] ljharb: i just add more stuff to the object literal i return at the end [08:04] robi42 has joined the channel [08:04] SubStack: more control when you assign exports [08:04] chrisdickinson: ljharb: bind doesn't just constrain `this`. [08:04] ewalker has joined the channel [08:04] chrisdickinson: ljharb: bind lets you curry in additional arguments -- "explicitly" closing over them, if you will. [08:05] ljharb: ok, i do use curry - but how does that affect exposure of anything? [08:05] chrisdickinson: ljharb: you are explicitly passing one variable to the next function, instead of implicitly declaring the next function in the current function's scope to gain that closure. [08:05] nrub has joined the channel [08:06] ljharb: but that's a style choice regardless of which design pattern you use, and you have the same control with either [08:06] sectionme has joined the channel [08:07] hipsterslapfight has joined the channel [08:07] chrisdickinson: ljharb: i use it like so: https://gist.github.com/7e0effc118637ac97784 [08:07] chrisdickinson: totally contrived example. [08:07] chrisdickinson: (sorry!) [08:08] chrisdickinson: so, a disclaimer. [08:08] chrisdickinson: i like to expose a contract -- a la SubStack -- that simply sets up my module internals. [08:09] chrisdickinson: i like to also expose whatever constructor it may (or may not) be invoking as a property on that function. [08:09] chrisdickinson: that way, if i *need* to subclass in the future -- or specially modify a single instance of that module -- i can do so without having to leave the context of, say, vim (in my case.) [08:10] ljharb: chrisdickinson: i find the first example more explicit [08:10] ljharb: if i call x, it returns a function. and z can't be accessed any other way [08:10] chrisdickinson: ljharb: and what happens when there's about fifteen variables in the enclosing function? [08:10] ljharb: then you have way too complex a function :-) [08:11] chrisdickinson: in theory, yes. in practice… it happens. [08:11] TheFuzzball has joined the channel [08:11] tonymilne has left the channel [08:11] ljharb: sure, but why code for it? [08:11] booyaa: FUCK YEAH! just got my first pull request accepted for a real live node module :D [08:11] booyaa: <-- is a real man now [08:11] sectionme has joined the channel [08:11] graeme_f has joined the channel [08:12] chrisdickinson: ljharb: because it happens. ideally, yes, fifteen variables in and things should be refactored. [08:12] chrisdickinson: in practice, no -- sometimes a function really *does* need fifteen variables. [08:12] SubStack: booyaa: hooray for contributing! [08:12] chrisdickinson: or you're refactoring someone else's code. [08:12] ljharb: chrisdickinson: yes but until it happens, you shouldn't solve a problem that doesn't exist yet, and if it happens, that's a huge signal that its time to refactor [08:12] ljharb: chrisdickinson: i would argue that a properly written function never needs that many variables [08:13] SubStack: chrisdickinson: you can just stuff all those args in an object or some sort [08:13] chrisdickinson: lemme rephrase. [08:13] ljharb: also true [08:13] SubStack: functions really shouldn't have more than about 3 arguments [08:13] chrisdickinson: this style optimizes for later readers. [08:13] ljharb: optimizing for the future isn't generally a good idea [08:14] ljharb: later readers, how so? [08:14] chrisdickinson: they see a function, they see bind, and they know what is being closed over, and they know why. [08:14] chrisdickinson: (because they can read the function-to-be-bound's argument list). [08:14] ljharb: i find your first example to provide the exact same information, without polluting the scope with the z function [08:15] Emmanuel` has joined the channel [08:15] ljharb: i can certainly see your point, if you find a bind call to be more readable [08:15] chrisdickinson: in the other case, once you get more than, say, one to two functions deep in nesting, it becomes very hard to say why anything is being closed over. [08:15] milani: who is interested in nodejs for desktop apps? [08:15] benvie: me [08:15] aranw has joined the channel [08:15] chrisdickinson: SubStack: true, in the case that what's going on is argument passing and binding -- specifically i'm thinking of when you get about 2-3 nested function calls in and state is beginning to pile up in the form of unintentionally closed-over variables. [08:16] lperrin has joined the channel [08:16] TheFuzzball has joined the channel [08:16] chrisdickinson: ACTION digs up his most horrible example of nesting... [08:16] milani: benvie: what is your ideal? do you want to package everything in a simple executable file? [08:16] milani: or you don't mind if all source be available? [08:16] chrisdickinson: ljharb: https://github.com/chrisdickinson/tempisfugit/blob/master/lib/repository.js#L27 [08:17] benvie: I don't really care about that being provided because I'd handle it myself [08:17] chrisdickinson: could be refactored so that each step was a simple "was there an error?" call, and then calling a provided "next". [08:17] sawgij has joined the channel [08:17] ljharb: chrisdickinson: looks like a case for promises [08:17] benvie: integration with the gui is the part that has value [08:17] milani: benvie: Ok think you have no problem with gui ( assume a module can handle it ) [08:18] milani: benvie: what do you mean by I'd handle it myself? [08:18] ccare has joined the channel [08:18] chrisdickinson: ljharb: honestly, i like event emitters + node style callbacks much more than the concepts presented in commonjs promises. [08:18] milani: benvie: do you mean preparing a good directory structure? [08:18] benvie: I'd either make something that handles packaging or defer to a module specializing in it [08:18] benvie: I don't see that as necessarily linked with a desktop app because it can be completely separate and useful outside that context [08:18] chrisdickinson: also hopefully i haven't invalidated my argument by posting the worst code known to man. [08:18] benvie: and would be better done split into a separate thing [08:19] ljharb: chrisdickinson: either way it'd be better than the nesting you've got - but i still don't necessarily think bind is the way to do it. altho your technique wouldn't bother me if you didn't use the "this" keyword - ie you passed "null" as the context into the bind call [08:19] milani: benvie: I'm working on a platform on top of nodejs [08:19] ljharb: chrisdickinson: bad code never really validates or invalidates an argument :-) [08:19] chrisdickinson: haha :) [08:19] misza222 has joined the channel [08:19] dragansah has joined the channel [08:19] milani: benvie: my ideal is to compress everything in a single executable file ( I know it's not possible at the moment) [08:19] benvie: it sure is [08:20] rio{ has joined the channel [08:20] chrisdickinson: ljharb: in the case of seeing a bunch of methods attached to a prototype object, i feel like the "this" problem fades a bit. [08:20] chrisdickinson: (what else is "this" going to be?) [08:20] chrisdickinson: (… if everyone is doing everything correctly.) [08:20] ljharb: true - but there's very few cases i've seen where even the prototype approach was the cleanest way to do it imo [08:21] efazati: milani, fix it finally https://github.com/joyent/node/issues/3015 [08:21] ohcibi has joined the channel [08:21] benvie: node has tar built in if you can't get it all inside the binary itself you can at worst do it with a single loader file and then everything else stuffed into a resources file [08:21] efazati has left the channel [08:21] HardFu has joined the channel [08:22] chrisdickinson: ljharb: basically, i feel like if i can pull nested functions out into the main scope whenever possible, i've increased the surface area available to my unit tests, with a side effect of making explicit the values that i am closing over. [08:22] benvie: but you could compile a version of node that has an additional module compiled in for the loader and then the last bit is being able to dynamically change some resources part of the binary which I don't know how to do but I know it can be done, just haven't looked into it [08:22] benvie: er not tar but gzip [08:22] benvie: and there's a nodetar [08:22] benvie: or does it have tar now? [08:22] chrisdickinson: prototypes aren't required for either of these situations, but they seem to aid in the effort. [08:22] stagas: how do you guys handle coffeescript in the frontend? is there a middleware or something? [08:23] thirdknife has joined the channel [08:23] milani: benvie: I could compile node with a build in module added, [08:23] Aiden has joined the channel [08:23] chrisdickinson: anyway, i've gotta pass out. good chat / thanks SubStack, ljharb for the brain food. [08:23] milani: benvie: so I can now run: node and get my stuff working [08:23] ljharb: stagas: i handle it by purging it from my codebase? [08:23] ljharb: chrisdickinson: night, good chat [08:23] milani: benvie: I mean I can run my code without providing node mywork.js, I only type node and it runs my code [08:23] stagas: ljharb: I wished [08:24] ljharb: stagas: if you must use that monstrosity, there's a coffee.js i believe to transpile it on the frontend [08:24] milani: benvie: but the problem is that in complex works, I can not handle dependencies, third party modules etc [08:24] benvie: oh well I mean [08:24] mikedeboer has joined the channel [08:25] benvie: if you have it setup in say the _third_party_main [08:25] benvie: it'll run after node inits internal stuff [08:25] benvie: and then what you'd do is basically a virtual file kind of thing [08:25] milani: benvie: yes I used third_party_main [08:25] maritz has joined the channel [08:25] benvie: you'd just use node's internal module system [08:25] benvie: but add an extra loader to it [08:25] benvie: for loading from the combined file [08:25] benvie: and use node's module system as is [08:26] benvie: if there's dependencies you'll need to baically invoke npm or make a downloader [08:26] benvie: but most of the pieces are there [08:26] milani: ok what if I use a module like express ( for example, its a big module ) [08:26] milani: and I don't want the user to see node_modules folder [08:26] milani: then I compress it in a tarball [08:27] benvie: well relatively but when you compress it all it's not big. And for this I'd say you would compress it all at a frozen version [08:27] milani: or any kind of compressed archive [08:27] vguerra has joined the channel [08:27] benvie: so you're not downloading it [08:27] milani: yes. [08:27] TheFuzzball has joined the channel [08:27] benvie: I mean node's got a lot of source in it [08:27] benvie: like 10k lines of js [08:27] milani: but users can always decompress it;) [08:27] tokumine has joined the channel [08:27] M1l3n1um has joined the channel [08:27] benvie: or maybe 20k i forget [08:27] ccare has joined the channel [08:28] benvie: well [08:28] pksunkara has joined the channel [08:28] dragansah has joined the channel [08:28] rlidwka: it's 44k lines actually :) [08:28] benvie: if you're asking how to secure it like really good then I don't have much of an asnwer [08:28] rlidwka: without deps [08:28] HardFu: guys, if a process terminates, where can I see what went wrong [08:28] pksunkara has left the channel [08:28] xbayrockx has joined the channel [08:28] benvie: because v8 will have to see it uncompressed at some point anyway [08:28] rlidwka: oops... i counted c++ code too [08:28] benvie: but for a mostly contained level [08:29] milani: I was thinking on if it is possible to compile all modules I use as a builtin module! [08:29] antdillon has joined the channel [08:29] fangel has joined the channel [08:29] ljharb: wait, secure it? like, prevent users from seeing your code? [08:29] dragansah: "/msg nickserv help [08:29] benvie: I'm pretty sure there's a way to dynamically change some sort of thing in the binary [08:29] benvie: that you just stuff things into [08:29] rlidwka: milani: yeah, but what is the point? [08:29] milani: no it's not about security. [08:29] benvie: and then have it all as part of the exe [08:29] benvie: I mean that's what node itself does basically, what v8 does [08:30] benvie: just need to sort of separate out that and make a way to dynamically modify it [08:30] milani: emmm, you see it's more complicated than that. [08:31] milani: if I use node js2c and compile everything, then I can not handle file dependencies. [08:31] milani: some modules use require('./lib/index.js') stuff! [08:31] ljharb: that sounds like your problem :-) [08:32] benvie: yeah I'm thinking of a more dynamic way to change what's included. But otherwise no not an issue with what you just said [08:32] benvie: you basically need to make that compressed stuff a virtual node_modules folder [08:32] benvie: and you wouldn't need to change much to do that [08:32] pgte has joined the channel [08:32] milani: rlidwka: the point is that it will be usable by everyone interested in node to build enterprise desktop applications [08:33] skm has joined the channel [08:33] milani: what do you mean by virtual? do you mean decompressing in a temprory file? [08:33] benvie: so then the remaining thing is dynamically modifying the resources in a compiled exe so you don't have to compile [08:33] rlidwka: hmmm... that's a good idea, i dont actually thought about that [08:33] guidocalvano has joined the channel [08:33] benvie: you could do it all in memory [08:33] benvie: node's module system has loaders defined [08:34] benvie: Module._extension['.js'] [08:34] benvie: so change that [08:34] milani: benvie: can you show me how? I can not get how to build a virtual filesystem. [08:34] benvie: well so imagine that it's just a tar file, which it could be [08:34] milani: yes.then? [08:34] benvie: that is a virtual filesystem already [08:34] benvie: the format has built in information about folders [08:35] benvie: so using nodetar you can navigate and read it simiilarly to using fs [08:35] milani: yes, can node use it without decompressing it in a folder? [08:35] benvie: so you load a file using that, the source [08:35] benvie: yeah [08:35] benvie: it'll be in memory [08:35] benvie: it'll be in js itself actually [08:35] benvie: just a string of the code [08:35] benvie: so you modify node's js loader [08:36] benvie: and have it use load the source from the tar [08:36] benvie: and return the source and the module system will handle it like normal [08:36] milani: It's a good idea [08:36] milani: thank you:) [08:36] benvie: so then like I said you just need to be able to pack the binary dynamically with a resource [08:36] benvie: no problem =D [08:37] milani: I already did that! [08:37] benvie: oh there ya go [08:37] milani: I made a custom builder for node [08:37] benvie: is it able to change the resources after node is compiled? That's the goal I'm guessing [08:37] benvie: and would be awesome [08:38] milani: so I can dynamically add my _third_party_main to node [08:38] milani: I can add my loader into it. [08:38] milani: and compress user files in a tar file. [08:39] mehlah has joined the channel [08:39] benvie: exactly [08:39] ppcano has joined the channel [08:39] milani: benvie: should I add the tar itself in node executable?! [08:39] benvie: that's what I was talking about, it's harder [08:40] benvie: not sure how to do it but it'd be cool [08:40] benvie: not necessary exactly [08:40] benvie: having the .exe plus a single resources.pak is fine [08:40] master5o1 has joined the channel [08:40] benvie: or whatever [08:40] master5o1: hai [08:40] McMAGIC--Copy has joined the channel [08:40] milani: yeah but containing tar in node is better! [08:40] ppcano has joined the channel [08:40] ppcano has joined the channel [08:40] benvie: I'm not sure what would be needed to get the resource file into the binary without recompiling [08:41] benvie: looking it up now actually [08:41] milani: why it should be hard? we don't need to change tar after compilation. [08:41] benvie: pretty sure it can be done [08:41] benvie: oh [08:41] erikzaadi has joined the channel [08:41] ppcano has joined the channel [08:41] milani: recompiling the source is enough. [08:41] benvie: well there ya go no problem then [08:41] enjalot has joined the channel [08:42] milani: ok let's review the process, [08:42] benvie: yeah I guess you only need to do that for making the distributable [08:42] milani: developer comes and get my platform, say appjs [08:42] benvie: your sdk essentially [08:42] milani: yes sdk. sorry. [08:42] ppcano has joined the channel [08:43] milani: my appjs has a cli [08:43] milani: developer goes to his project folder and types [08:43] milani: $ appjs package [08:43] ppcano has joined the channel [08:43] milani: I create a tarball and recompile node with the custom loader [08:44] dpino has joined the channel [08:44] ppcano has joined the channel [08:44] benvie: out pops new node [08:44] milani: and user would have a nice executable ;) [08:44] benvie: only thing is, when you say compile [08:44] benvie: do you mean full compile of node? [08:44] benvie: or some lesser process [08:44] slaskis has joined the channel [08:44] benvie: that won't work very well for windows [08:45] benvie: I mean it can but just a lot less people have the necessary tools to compile it [08:45] milani: we can provide object files. and compiler only links them to gether. [08:45] milani: together [08:45] benvie: oh that's better [08:45] benvie: didn't think of that [08:45] disappearedng has joined the channel [08:46] milani: we can also install what is necessary to compile node. [08:46] whitglint has joined the channel [08:47] benvie: I did a bit of stuff with setting up a builder using node that built wxWidgets and then wxNode on windows [08:47] benvie: worked pretty good [08:48] milani: can you show me the source? [08:48] benvie: yeah sec [08:48] Skaag_ has joined the channel [08:49] benvie: https://github.com/Benvie/wxNode/blob/windows/build-win32.js [08:49] bearnard has joined the channel [08:49] everton has left the channel [08:49] briancray has joined the channel [08:49] master5o1 has left the channel [08:49] literal_username: What's going on with the Node documentation? Every time I visit it, it looks less and less like it's targeted at programmers. [08:49] benvie: it uses node-mnm for the node module [08:50] hellp has joined the channel [08:50] robi42 has joined the channel [08:50] disappearedng has joined the channel [08:50] milani: you know, for gui stuff, I was thinking [08:51] dragansah has joined the channel [08:51] milani: to use gtk [08:51] milani: and webkit [08:51] benvie: yeah [08:51] benvie: I've been chasing that part [08:51] benvie: well not webkit and gtk but [08:51] benvie: chromium embedded [08:51] Vespakoen has joined the channel [08:51] sammmy has joined the channel [08:51] milani: the only things user need is a window,menu,tray icon, webkit view and notification [08:51] benvie: but generally, the web view [08:52] benvie: it's the perfect match [08:52] milani: he can do everything with these widgets. [08:52] milani: for everything else, he would use html css [08:52] milani: ;) [08:52] literal_username: Nevermind, I guess I was looking at nodemanual.org. What an eyesore. [08:52] benvie: yeah I mean [08:53] milani: chromium embedded? [08:53] benvie: the web view is the most powerful and awesome platform there is [08:53] Emmanuel` has joined the channel [08:53] benvie: combines all that stuff together into an easy to use runtime [08:53] benvie: http://code.google.com/p/chromiumembedded/ [08:53] benvie: it's basically that [08:54] benvie: chromium with just the webview [08:54] milani: oh, I can not use code.google.com! [08:54] vvo has joined the channel [08:54] milani: it asks me for signing in, when I do, it redirects me again to login page. [08:54] benvie: hmmm weird [08:54] milani: I don't know what's wrong with it;) [08:54] DuoSRX has joined the channel [08:55] benvie: hmm [08:55] milani: ok, what's the benefit of chromiumembedded over webkitgtk+? [08:55] benvie: everything except the forum is on google code [08:55] benvie: well first off it's chrome which is better [08:55] benvie: second, it's focused specifcially on the web view [08:55] milani: aha. [08:55] benvie: and is pretty easy to set up with a bit of c++ [08:55] robi42 has joined the channel [08:55] benvie: third it uses v8 obviously without having to modify it [08:56] milani: does it contain anything else other than webview? [08:56] benvie: it contains all the plumbing to use everything that's in there [08:56] sammmy: 28 Mar 01:55:27 - [nodemon] exception in nodemon killing node [08:56] benvie: all the apis that are in that which are extensive [08:56] sammmy: Error: use fs.watch api instead [08:56] sammmy: at Object.watchFile (fs.js:734:11) [08:56] sammmy: at C:\Users\Holmes\AppData\Roaming\npm\node_modules\nodemon\nodemon.js:195:8 [08:56] sammmy: at Object.oncomplete (path.js:412:19) [08:56] benvie: file system api, proxy api, ability to tap into v8, etc. [08:56] benvie: just tons of stuff [08:56] sammmy: Anyone have any ideas? [08:56] IlskenLabs has joined the channel [08:57] perezd_ has joined the channel [08:57] benvie: also one other thing is [08:57] benvie: chrome's webkit is far and away the best in terms of working well on windows [08:58] benvie: the whole package [08:58] milani: ok I will use it. do you think it's good to write code in front-end js? I mean filesystem stuff etc. [08:59] benvie: well that's a complicated question [08:59] _sri has joined the channel [08:59] nbari has joined the channel [08:59] benvie: it depends on target audience [09:00] milani: https://github.com/rogerwang/node-webkit [09:00] benvie: like I could see many web developers basically wanting a webview with node APIs and a loader [09:00] benvie: where others might want a distinct separation between "front-end" being the UI [09:00] benvie: which talks to the back-end [09:00] benvie: regardless of what actually separates those two things [09:00] benvie: or doesn't [09:00] milani: this project modifies webkit to call nodejs functions and modules right in front-end js [09:00] benvie: yeah that's another thing I was going to say [09:01] benvie: the way that works is because it uses a modified webkit using v8 [09:01] avalanche123|h has joined the channel [09:01] benvie: so that's one less step to do if you use chromium [09:01] benvie: the modifications made to webkit are portable to chromium embedded [09:01] milani: actually I don't want to tell developer to create a webserver and talk to front-end throw http. [09:02] benvie: and it already has v8 obviously so you don't need to go through the process he had to for putting v8 into webkit [09:02] milani: so there remains two ways: using node-webkit [09:02] benvie: well no i wasn;t suggesting that [09:02] milani: creating a wrapper from nodejs to webkit so we can handle events. [09:02] benvie: it would be more tightly integrated [09:02] benvie: but basically it's the same [09:02] benvie: either you're in the same thread, the main thread like node-webkit [09:02] benvie: and it can be synchronous [09:02] benvie: or it's callbacks, whether it's in the same process or across the world [09:03] benvie: it's just a matter of latency thn [09:03] benvie: but the coding constaints are the same [09:03] benvie: aka synchronous vs. non-synchronous [09:03] milani: no, it's not about sync vs async [09:03] SiGe has joined the channel [09:04] milani: I'm talking about handling front-end events, like clicking a button [09:04] benvie: well that's kind of what I mean [09:04] benvie: say you are making a file browser [09:04] milani: yes. [09:04] benvie: click handler on a folder to load its contents [09:04] milani: yes. [09:04] benvie: obviously that's a callback but what about the part that loads the actual file list [09:05] benvie: you have to make it asynchronous to bridge the gap unless you're doing what node-webkit does [09:05] skm has joined the channel [09:05] benvie: fs.readdirSync isn't possible [09:05] milani: ok. stop here. [09:06] milani: How can I find that user clicked on folder to load its content? [09:06] benvie: the other way would be [09:06] take_cheeze has joined the channel [09:06] benvie: you attach events from node over a mini-bridge [09:06] benvie: and then the callback is also in node [09:06] tvw has joined the channel [09:06] benvie: and it gets called over that bridge kind of like a proxy [09:07] milani: that's it! the problem is to manage that bridge. [09:07] benvie: that will work for a lot of stuff pretty smoothly but it still prevents some things directly [09:07] benvie: although I hear you on making a transparent bridge [09:07] milani: do you think it's easy to develop that bridge? [09:07] benvie: I've put a lot of work into researching various ways to attack this [09:08] perezd has joined the channel [09:08] reprisal has joined the channel [09:08] milani: and what was the outcome? [09:08] benvie: attaching and listening for the events is easy, the DOM bridge is where it gets complicated [09:08] neumino has joined the channel [09:08] Fabryz has joined the channel [09:08] milani: manipulating DOM right in nodejs you mean? [09:08] necromancer has joined the channel [09:09] benvie: yeah or providing an interface that looks liek you are [09:09] coderarity has joined the channel [09:09] milani: like adding a button to DOM? [09:09] benvie: well more like traversing it but yeah [09:09] benvie: I mean basically [09:10] benvie: you can provide subsets or ones with limitations/caveats pretty easy [09:10] benvie: and the closer you want to be to perfect, like loading jquery in node and having it work out of the box [09:10] benvie: the more you have to do some crazy things like mirror the whole dom [09:11] benvie: which I looked into to [09:11] michaelhartau has joined the channel [09:11] benvie: and did to an extent but didn't seem to be worth it [09:12] benvie: with proxies it gets more feasible to provide an itnerface that's closer to ideal without a lot of overhead but it's still going to have leaks [09:12] benvie: chrome has proxies now with a flag so you can proxy both ways [09:12] milani_ has joined the channel [09:12] milani_: sorry benvie I lost my connection. [09:12] benvie: but basically I ended up just wanting to get it running in thread [09:13] benvie: oh hah [09:13] milani_: the last thing I got was: [09:13] milani_: attaching and listening for the events is easy, the DOM bridge is where it gets complicated [09:13] benvie: ok [09:13] benvie: [05:10] and the closer you want to be to perfect, like loading jquery in node and having it work out of the box [09:13] benvie: [05:10] the more you have to do some crazy things like mirror the whole dom [09:13] benvie: [05:11] with proxies it gets more feasible to provide an itnerface that's closer to ideal without a lot of overhead but it's still going to have leaks [09:14] benvie: [05:12] chrome has proxies now with a flag so you can proxy both ways [09:14] benvie: that was it [09:14] EyePulp has joined the channel [09:14] milani_: aha. I should try it. are you interested in this project? [09:14] __doc__ has joined the channel [09:14] benvie: you have no idea my friend. I've been working on related concepts for a year now [09:14] milani_: :)) [09:15] TheFuzzball has joined the channel [09:15] milani_: ok lets put together on what you did [09:15] benvie: what I've been working on recently is loading chromium embedded using ffi directly from js [09:15] disappearedng has joined the channel [09:15] benvie: I've been trying to hit that gold standard that node-webkit did [09:16] benvie: of getting it using the same v8 and same thread [09:16] benvie: in windows that's less straightforward but I have all the puzzle pieces now [09:16] milani_: did you put it together in a repo? [09:16] benvie: it's all ended up as spun into different projects [09:17] milani_: ok let's put everything together to build a perfect sdk [09:17] benvie: what happens is I end up exploring one piece to its logical conclusion and it ends up as a library of its own [09:17] benvie: the recent stuff I've been doing is with making better tools for working with data structures, like ctypes [09:17] milani_: we can use that builder we talked about, gtk stuff and chromium embedded. [09:18] milani_: aha. [09:18] quijote has joined the channel [09:18] benvie: like this is the foundational library that's going to be worked into a new version of node-ffi soon https://github.com/Benvie/reified [09:19] benvie: and I even have a Proxy wrapper for that lets you make objects that look like regular js objects, but they write and read directly from an underlying buffer instead [09:19] benvie: https://github.com/Benvie/chrome-nodium [09:19] benvie: and I did extensive work with generating ffi bindings from headers [09:20] benvie: which resulted in this (node usable, but it gives the idea) https://github.com/Benvie/chrome-nodium/blob/master/compiled/bindings.js [09:20] benvie: CEF (chromium embedded) is particularly hard to interact with using ffi [09:20] milani_: I'm bombarded with a lot of repos:)) [09:20] markwubben has joined the channel [09:20] benvie: that last one is golden though [09:20] conancat has joined the channel [09:21] benvie: you'll see that it is closely related to this by the names of the stuff in it =D [09:21] milani_: I'll come back in a minute. [09:21] benvie: CEF_V8CONTEXT_HANDLER CEF_WEB_URLREQUEST CEF_DOMDOCUMENT [09:21] milani_: I'm really interested in what you did. [09:22] literal_username has left the channel [09:22] benvie: I wish I had a working prototype but not yet. I did make one that communicated over a socket and I built the stuff needed to transport circular structures using JSON [09:22] benvie: but that's what lead me to wanting the tighter integration [09:23] benvie: if i had just iterated on that one I'd have a whole platform by now [09:23] fangel has joined the channel [09:23] benvie: because the in-process goal has been a long chase [09:23] DrPheltRight has joined the channel [09:25] k1ttty_ has joined the channel [09:26] JmZ_ has joined the channel [09:30] robi42_ has joined the channel [09:30] milani_: aha. [09:32] TheFuzzball has joined the channel [09:32] milani_: benvie: does benefits of in-process binding worth it? [09:32] milani_: benvie: does benefits of in-process binding worth this effort? [09:32] xSmurf has joined the channel [09:33] RORgasm has joined the channel [09:33] benvie: it opens up a lot of options that otherwise require a one compromise or another [09:34] benvie: maybe maybe not worth it but it's what a lot of people want [09:34] jimmysparkle has joined the channel [09:34] hzin has joined the channel [09:34] benvie: there's a cool factor to basically having a the browser directly exposed to node and vice versa [09:34] milani_: yeah I know. [09:35] larsschenk has joined the channel [09:35] milani_: ok so you are working on that. ha? [09:35] zobi8225 has joined the channel [09:35] larsschenk has left the channel [09:36] benvie: parts of it, preconditions. Stuff related to it anyway, which has taken me to a lot of unrelated end points [09:36] benvie: but generally I've been chasing that concept, of building a desktop app platform with node and web view [09:36] sharkbird has joined the channel [09:37] milani_: ok I want to work on that as I said, gtk+ menu, tray icon [09:37] milani_: and a notification system [09:37] zobi8225: hi [09:37] zobi8225: i got problems with npm, ehre can i cry ? [09:37] milani_: and if you like your node webview [09:37] benvie: yeah there's a lot of party to the idea, because it's not just a module [09:37] stafamus has joined the channel [09:38] benvie: it really needs to a platform with those apis as you said [09:38] milani_: and I want to start with that compiler we thought about;) [09:38] benvie: which also is why I've worked on the ffi stuff [09:38] benvie: to allow providing for access to system apis without having to make a c module every time [09:38] milani_: aha, [09:38] benvie: like I made a wrapper for the windows clipboard [09:38] merlin83 has joined the channel [09:38] milani_: and in what state is node-ffi? [09:38] benvie: that calls winapi stuff to do it [09:39] benvie: node-ffi is awesome [09:39] benvie: it works on all the platforms [09:39] milani_: you know, actually directly calling os APIs does not make sense. you should provide wrappers;) [09:39] vvo has left the channel [09:39] benvie: it's needed an overhaul on the js API it provides but I've worked on that extensively as well [09:39] milani_: but the whole project is cool. [09:39] vvo has joined the channel [09:40] jetienne has joined the channel [09:40] benvie: like take a look at this https://github.com/Benvie/node-clipboard/blob/master/lib/win32.js [09:40] benvie: it's not too bad [09:40] benvie: and I've made stuff for automating the process of generating the basic bindings from header files [09:41] milani_: it's a little complicated! [09:42] milani_: does it work only in windows? [09:42] benvie: that was from before I had the generator too, and once you get past the bindings part where you define the structures it's not too bad. But anyway it's not required [09:42] benvie: just something I like [09:42] benvie: ffi itself works across mac, linux, windows [09:42] benvie: this specific thing [09:42] milani_: no, I mean clipboard [09:43] benvie: I have it set up to abstract out the platform specific part [09:43] benvie: but I haven't added stuff for mac or linux yet [09:43] jetienne has joined the channel [09:43] milani_: aha. [09:43] benvie: the main file is agnostic to platforms [09:43] benvie: and requires you expose a handful of functions [09:43] milani_: ok if ffi works on all platforms, why not using it for chromium? [09:44] benvie: that's what I'm been working on but the CEF works is more complicated than most stuff is [09:44] milani_: yeah I can imagine how big it is. [09:44] benvie: I've been working on improving the underlying parts in node-ffi [09:44] benvie: that's where reified and the c data structures come into play [09:45] benvie: because all the communication with external libs requires dealing with this data [09:46] milani_: like Enums you defined in chrome-nodium binding.js [09:46] benvie: yeah [09:46] benvie: part of the process was making a generator for that code [09:46] benvie: and part was improving the actual things that convert to and from binary data [09:47] benvie: I generated a 30,000 line binding to windows.h and the entire windows api [09:47] benvie: so that part is fine =D [09:47] benvie: https://gist.github.com/1973743 [09:47] milani_: and it was dynamically generated? [09:47] benvie: yeah [09:47] benvie: so it works with any c header files [09:48] benvie: that's what made this as well https://github.com/Benvie/chrome-nodium/blob/master/compiled/bindings.js [09:48] jetienne_ has joined the channel [09:48] benvie: and this https://github.com/Benvie/node-ffi-tools/blob/master/codegen/libclang-bindings.js [09:49] milani_: wow. [09:49] conancat has joined the channel [09:49] milani_: cool. you did a great job. [09:49] jetienne_ has joined the channel [09:50] benvie: but it became apparent that I needed tools for node-ffi that did a better job of handling pointers/indirection automatically which is why I've been working on the binary data part [09:50] benvie: thanks =D [09:50] TheFuzzball has joined the channel [09:50] pgte has joined the channel [09:50] jetienne_ has left the channel [09:51] benvie: every place where there's a 'pointer' is a place where something more complicated needs to be handled automatically [09:51] jetienne_ has joined the channel [09:51] antz29 has joined the channel [09:51] milani_: ok. so I start working on compiler [09:52] milani_: I mean builder. [09:52] milani_: and embed GUIs I require [09:52] milani_: I hope you complete chromium. [09:52] benvie: this week I'll be adding the last bits to the binary data lib so that it handles pointers and then I'll be redoing node-ffi to use my stuff which should be quick [09:53] benvie: since I already rewrote it once [09:53] milani_: aha. [09:53] benvie: and then it should be a lot easier to make those chrome bindings actually work [09:53] milani_: nice. [09:53] benvie: and since this is loading from in js, it'll be a lot easier to get it integrated in process [09:53] milani_: Till then, I can prepare builder and other guis. [09:53] jsurfer has joined the channel [09:53] benvie: yeah =D you have a good chunk to do [09:53] tokumine has joined the channel [09:53] benvie: do this if you haven't `npm install tar` [09:53] benvie: cause it's good stuff [09:54] benvie: it's isaacs one used in npm [09:54] benvie: basically custom built for exactly what you need to do [09:55] milani_: and one more thing [09:55] milani_: do you think a simple tar does the job? [09:56] benvie: tar and node's builtin gzip I think is all you need for storing any file structure [09:56] pid has joined the channel [09:57] benvie: you can build a wrapper for it that exposes the same api as fs does easily [09:57] benvie: and then any existing stuff that uses fs can work with it [09:57] milani_: I will. [09:58] milani_: I'm on it; [09:58] milani_: ;) [09:58] benvie: =D [09:58] milani_: thank you for your help really. [09:58] sreeix has joined the channel [09:58] hellp has joined the channel [09:58] benvie: just happy to talk to someone else interested in the same goal! [09:59] milani_: me too. since you are working on this, you may know a good gui module. I'm working on node-gui [09:59] milani_: is it good enough? [09:59] vvo has left the channel [09:59] vvo has joined the channel [10:00] benvie: yeah it won't really work on windows but it'll work for other platforms while working on apis and stuff [10:00] benvie: but none of them really work on windows anyway [10:00] benvie: I'd probably use node-webkit just for the in-process stuff [10:01] benvie: but that also means [10:01] benvie: if you make code for it then you depend on that ability [10:01] benvie: which isn't going to be in any other gui stuff since the rest necessarily use async for any communication [10:03] milani_: they should work on windows. [10:03] milani_: gtk is cross platform. isn't it? [10:03] benvie: yeah but most of them use one thing or another that isn't [10:04] uchuff has joined the channel [10:04] meso has joined the channel [10:04] benvie: most are set up as compiled node modules with bindings to load the window and stuff [10:04] benvie: and don't paya ttention to cross platform concerns [10:04] benvie: I don't recall if node-gui does [10:05] njain has joined the channel [10:05] astropirate has joined the channel [10:06] timoxley: How would you indent this? https://gist.github.com/2225171 [10:06] milani_: benvie: I didn't tried on windows [10:06] pickelsss has joined the channel [10:07] milani_: but it one can compile it if he has headers. [10:08] benvie: yeah it should be doable unless they have some complicated dependencies which for example is an issue with node-webkit [10:08] milani_: https://github.com/milani/appjs [10:08] benvie: its reliance on libev [10:08] benvie: libev is the windows killer in terms of dependencies [10:08] benvie: and node [10:09] benvie: ha there it is! [10:09] benvie: it begins [10:09] benvie: lol [10:09] milani_: take a look at the repo. the problem is that each time it compiles everything! [10:09] milani_: :D [10:09] milani_: I made a mistake in Makefile but I don't know what it is. [10:10] fermion has joined the channel [10:10] milani_: timoxley: I prefer method 3 [10:11] Alpha|_| has joined the channel [10:11] benvie: hmm [10:11] shinuza has joined the channel [10:11] maritz: timoxley: i mostly do method 1, just because it's clearer. and if there are any cases where the indention goes too far, i refactor that shit :P [10:11] timoxley: milani_ Though I feel a bit funny about having a closing brace in-line with something it doesn't actually close, i.e. the Step( call [10:12] benvie: I would guess something with the directory structure, with node being in a different spot [10:12] benvie: lot of stuff working based on paths [10:12] timoxley: maritz hmm, my coworker is in your boat [10:13] milani_: benvie: yeah it took me a lot of time to put this together! [10:13] milani_: benvie: handling directory dependencies , you know;) [10:13] benvie: I bet lol, there's a ton of stuff in node's tree to begin with [10:13] maritz: timoxley: WAT? [10:13] maritz: ACTION throws random stranger dude out of his boat and shouts "I DIDN'T INVITE YOU!" [10:14] benvie: yeah that's why I ended up building a whole mini-lib for just handling that part of it in the wxnode builder [10:14] benvie: it gets ridiculous [10:14] timoxley: maritz he's a nice guy I swear [10:14] timoxley: maritz even if he indents his code ugly [10:14] maritz: i don't care, this is my boat! [10:14] ioscale has joined the channel [10:15] maritz: unless he has boobs and is a she. in that case, me boata es su boata [10:15] ioscale1 has joined the channel [10:15] maritz: (or whatever) [10:16] timoxley: hah [10:17] milani_: benvie: what's your suggestion?! [10:17] benvie: maybe like [10:18] benvie: run the build process itself from the node directory [10:18] milani_: I think it's better than creating a node module because we don't know if users have it installed. [10:18] benvie: keep same structure [10:18] milani_: I can't! [10:18] benvie: but start it from there and reference outward [10:18] milani_: I need to edit node.gyp [10:18] milani_: to compile my built in modules. My goal here is not to change node it self. [10:18] benvie: make like a mini runner that either copies the .gyp file or something [10:18] benvie: yeah [10:19] benvie: something that cleans up and only makes the smallest changes needed to on run [10:19] benvie: I dunno, maybe not [10:19] benvie: I was able to make my thing basically run the files where they were in place [10:19] benvie: not for node [10:19] milani_: It works fine right now, but I only need to find my mistake. It was ok then I changed it and it does not work after iterations:)) [10:20] benvie: oh hah [10:20] benvie: yeah then stick with it [10:20] benvie: just find that issue =D [10:20] spcshpopr8r has joined the channel [10:20] theCole has joined the channel [10:20] milani_: I think I would keep it for someone else:)) I prefer to work on custom loader [10:20] Poetro has joined the channel [10:21] benvie: yeah [10:21] milani_: maybe after we attract more developers, they fix it=)) [10:21] benvie: I do what's interesting usually too =D [10:21] benvie: there's always stuff to get done so it's a choice on what to work on [10:21] milani_: just kidding. It takes a lot of time compiling the whole node again and again. I should fix it as soon as possible. [10:22] benvie: how long does it take you? [10:22] milani_: for what? [10:22] benvie: I mean I wouldn't want to do it every time to run a js file [10:22] sawgij has joined the channel [10:22] benvie: compile node [10:22] milani_: aha. [10:22] benvie: also I'd probably make a minimal loader that loaded an external file [10:22] benvie: so I could just compile once and then edit the external file while testing [10:22] milani_: you know, the way we planned, does not need to compile after each js change. [10:23] benvie: yeah but for getting to that point [10:23] benvie: unless you already did [10:23] milani_: no no, develpers develop their projects like everyone else, after they are ready, they will compile it. [10:23] benvie: yeah I meant for you, developing that very loader [10:24] benvie: ha [10:24] milani_: aha:)) [10:24] benvie: it's a bit different [10:24] milani_: yeah I was kidding about not fixing this issue. I'm going to fix it first. [10:24] benvie: yeah [10:26] disappearedng has joined the channel [10:33] kmiyashiro has joined the channel [10:34] bnoordhuis has joined the channel [10:35] piscisaureus_ has joined the channel [10:39] gavin_huang has joined the channel [10:46] luigy has joined the channel [10:48] milani_: benvie: followed you on github:) [10:48] TheFuzzball has joined the channel [10:48] pgte has joined the channel [10:48] Astro-: and me? [10:49] milani_: and you?!! what?! [10:49] Astro-: follow me too: https://github.com/astro [10:50] milani_: you have enough followers 222:)) [10:50] milani_: I like the number so I don't mess it! [10:50] milani_: :D [10:50] BombStrike has left the channel [10:50] Astro-: :'( [10:50] BombStrike has joined the channel [10:51] dubenstein has joined the channel [10:51] redir has joined the channel [10:51] socialhack has joined the channel [10:53] milani_: Astro-: followed you. because you had mozilla BrowserQuest! [10:53] milani_: Now follow me back:D [10:53] Astro-: played it only yesterday [10:53] Astro-: it's lovely [10:53] Astro-: alright [10:54] mschneider has joined the channel [10:55] skm has joined the channel [10:56] milani_: who can help me fix my problem with Makefile? https://github.com/milani/appjs [10:56] milani_: It's a custom node Makefile. it recompiles everything each time. [10:59] Radium has joined the channel [11:00] versicolor has joined the channel [11:01] PeeterWork has joined the channel [11:01] PeeterWork: Hello [11:01] PeeterWork: Does anyone have any thoughts on using globals at nodejs? [11:02] TheJH has joined the channel [11:02] PeeterWork: For example, a DB connection, the logger [11:02] enmand has joined the channel [11:02] thomaschaaf has joined the channel [11:02] dubenstein has joined the channel [11:03] NetRoY has joined the channel [11:03] NetRoY_ has joined the channel [11:03] dekub has left the channel [11:03] Astro-: PeeterWork: what's the scope more broad than a module in node? [11:03] thomaschaaf: Hi I am trying to install node-ffi but am having trouble getting it installed with npm. My log says the following: http://pastie.org/3684723 [11:03] zdk has left the channel [11:04] PeeterWork: Astro-: I'll be using the DB connection in most my modules, and I'd like to log stuff from moduels also :P [11:05] milani_: PeeterWork then you don't need a global thing. just a module is enough [11:05] PeeterWork: How would I go about that? [11:05] milani_: create an object named logger in logger module. and require it everywhere you need. [11:05] PeeterWork: The logger requires initiation [11:06] milani_: thomaschaaf: ask benvie [11:06] mschneider has joined the channel [11:06] PeeterWork: For example: http://pastebin.com/MhLtkheB [11:06] thomaschaaf: benvie: are you here? [11:06] PeeterWork: Same for the database connection, I have to actually open it. [11:06] benvie: hmm [11:06] dob_ has joined the channel [11:06] PeeterWork: (Using mondodb) [11:06] benvie: yeah someone else had that issue too [11:06] benvie: I think nate must have broken it [11:07] benvie: or something with npm changes did [11:07] milani_: PeeterWork: Ok what's the problem here? [11:08] milani_: PeeterWork: you should use exports.logger = logger then. [11:08] elio_ has joined the channel [11:08] PeeterWork: Oh [11:08] salva has joined the channel [11:08] milani_: PeeterWork: then you can use it everywhere. [11:08] PeeterWork: What about a database connection, wont that create a new connection every time? [11:08] milani_: No it won't. [11:09] CIA-19: node: 03mstarzinger@chromium.org 07master * reb1ff03 10/ deps/v8/src/mark-compact.cc : [11:09] CIA-19: node: v8: Fix missing initialization of mark-compact flags. [11:09] CIA-19: node: R=svenpanne@chromium.org [11:09] CIA-19: node: Review URL: https://chromiumcodereview.appspot.com/9662056 [11:09] CIA-19: node: Cherry-pick of https://v8.googlecode.com/svn/branches/bleeding_edge@11006 - http://git.io/69qTtg [11:09] guidocalvano has joined the channel [11:09] milani_: requiring modules does not re-run everything. it just opens a whole for you;) [11:09] milani_: * hole. a bridge to use that module. [11:09] PeeterWork: So basically they're singletons unless I use the new keyword? [11:10] PeeterWork: Bah I somewhat get it :p [11:10] milani_: yes but you can not use new keyword for modules. [11:10] rlidwka: they are always singletons [11:11] PeeterWork: Well this makes a lot more sense now :P [11:11] simenbrekken: Can anyone recommend a fast XML parser? [11:11] rlidwka: unless you are messing up require.cache of course [11:11] PeeterWork: Thanks :) [11:14] thomaschaaf: benvie: anyway I can help and debug it? [11:16] herbySk has joined the channel [11:18] erikzaadi has joined the channel [11:18] Vennril has joined the channel [11:18] MartinCleaver has joined the channel [11:20] aranw has joined the channel [11:20] PeeterWork: milani_: How would I go about exporting an open connection? [11:20] TheFuzzball has joined the channel [11:20] PeeterWork: http://pastebin.com/d7Aij7Va [11:20] milani_: I can't get you. do you want open a connection upon user request? [11:21] PeeterWork: I want to have a persistent DB connection [11:22] milani_: ok just use exports.connection = connection. [11:22] PeeterWork: I did that, it exports undefined [11:22] PeeterWork: .open call is async [11:22] Wizek has joined the channel [11:23] Radium has joined the channel [11:24] milani_: yeah I see. does it provide any sync open function? [11:25] thomaschaaf: benvie: it does work with 0.4.2 [11:25] milani_: PeeterWork: using sync function instead of async one makes no difference here. Just open it synchronously [11:26] milani_: of course you can make a callback but it gets complicated: [11:26] djcoin has joined the channel [11:26] milani_: exports.open = client.open; [11:27] milani_: then you should open it somewhere. but it's not a good idea. [11:27] nsolsen has joined the channel [11:28] Nopik has joined the channel [11:31] Advatar has joined the channel [11:32] dubenstein has joined the channel [11:33] RORgasm has joined the channel [11:33] Juan77 has joined the channel [11:35] hzin has joined the channel [11:35] krnl has joined the channel [11:36] krnl: is there an easy way to determine disk utilization from nodejs in a cross platform way? (ubuntu/osx) [11:36] redir_ has joined the channel [11:37] dylang has joined the channel [11:38] booyaa: isn't there a xplatform npm called shelljs or unixjs? [11:38] booyaa: it might have a df method [11:38] booyaa: one sec [11:39] ioscale has joined the channel [11:39] booyaa: nah no df in shelljs :( [11:39] tonymilne has joined the channel [11:39] Radium has joined the channel [11:40] shinuza has joined the channel [11:41] whaley has joined the channel [11:41] pgte has joined the channel [11:41] milani_: benvie: I think I fixed make issue:) [11:41] milani_: benvie: ready to code loader \o/ [11:44] crutex has joined the channel [11:44] _rockbot_ has joined the channel [11:44] baudehlo has joined the channel [11:49] TheFuzzball has joined the channel [11:51] skomski has joined the channel [11:51] stagas has joined the channel [11:52] [[zzz]] has joined the channel [11:53] ovaillancourt has joined the channel [11:53] webguynow has joined the channel [11:54] Radium has joined the channel [11:54] rahul has left the channel [11:56] milani_ has joined the channel [11:56] SuMarDi has joined the channel [11:56] bearnard has joined the channel [11:57] bkaney has joined the channel [11:58] TheFuzzball has joined the channel [11:59] dubenste1n has joined the channel [12:00] piscisaureus_ has joined the channel [12:01] thomblake has joined the channel [12:01] thomblake has left the channel [12:03] gaurav_ has joined the channel [12:03] thinkt4nk has joined the channel [12:04] pid has joined the channel [12:04] Guest42139: hi [12:05] dubenste1n has joined the channel [12:05] TheJH has joined the channel [12:07] erichynds has joined the channel [12:07] erikzaadi has joined the channel [12:07] dr0id has joined the channel [12:09] Inoperable has joined the channel [12:09] vipaca has joined the channel [12:11] Inoperable has joined the channel [12:17] simenbrekken: Can I have the node debugger halt execution on exceptions and inspect the current state? [12:19] Sulfur has joined the channel [12:20] dreen has joined the channel [12:20] tuhoojabotti: With a breakpoint? [12:20] tuhoojabotti: no wait exception [12:21] tuhoojabotti: dunno [12:21] jmar777 has joined the channel [12:21] robhawkes has joined the channel [12:21] kejun has joined the channel [12:22] dreen: anyone know why i could get node: src/unix/core.c:149: uv_close: Assertion `0' failed. when nodemon tries to restart node after file changes? [12:23] tornad has joined the channel [12:27] fumanchu182 has joined the channel [12:28] Radium has joined the channel [12:28] LeftWing__ has joined the channel [12:32] dragansah has joined the channel [12:33] infynyxx has joined the channel [12:34] vkareh has joined the channel [12:34] k1ttty has joined the channel [12:35] sadjow has joined the channel [12:36] sadjow has left the channel [12:39] jimmyrcom has joined the channel [12:40] vereteran has joined the channel [12:41] horofox has joined the channel [12:43] TheFuzzball has joined the channel [12:43] jspiros has joined the channel [12:44] brianseeders has joined the channel [12:45] k1ttty has joined the channel [12:46] wendall911 has joined the channel [12:48] xsace has joined the channel [12:49] AviMarcus has joined the channel [12:51] joshfinnie has joined the channel [12:58] guidocalvano_ has joined the channel [12:58] hunterloftis has joined the channel [12:58] lperrin has joined the channel [13:00] k1ttty has joined the channel [13:00] lazyshot has joined the channel [13:01] luigy has joined the channel [13:01] AaronMT has joined the channel [13:02] pgte has joined the channel [13:03] TomY_ has joined the channel [13:04] briancray has joined the channel [13:09] hz has joined the channel [13:10] MartinCleaver has joined the channel [13:11] stagas has joined the channel [13:11] yawNO has joined the channel [13:11] Venom_X has joined the channel [13:11] MartinCleaver has joined the channel [13:13] davidsklar has joined the channel [13:14] elguapo99 has joined the channel [13:14] indy3 has joined the channel [13:17] lduros has joined the channel [13:17] k1ttty has joined the channel [13:18] milani_ has joined the channel [13:20] madtimber has joined the channel [13:20] mschneider has joined the channel [13:21] pandeiro has joined the channel [13:22] boehm has joined the channel [13:22] vargle has joined the channel [13:23] TheFuzzball has joined the channel [13:26] luigy has joined the channel [13:27] bkaney has joined the channel [13:27] milani_: any module to list files of an archive? [13:27] snearch has joined the channel [13:27] chadskidmore has joined the channel [13:28] slajax has joined the channel [13:29] divoxx has joined the channel [13:31] HacDan has joined the channel [13:32] skm has joined the channel [13:33] TheFuzzball has joined the channel [13:33] k1ttty has joined the channel [13:33] HacDan has joined the channel [13:34] RORgasm has joined the channel [13:34] mattgifford has joined the channel [13:35] c4milo has joined the channel [13:35] edwardmsmith has joined the channel [13:35] savudin has joined the channel [13:36] tonymilne has left the channel [13:36] bnoordhuis: dreen: what version of node? [13:36] bergie has joined the channel [13:37] dreen: v0.5.11-pre [13:37] bergie_ has joined the channel [13:38] devdazed has joined the channel [13:38] mikeric has joined the channel [13:39] bnoordhuis: dreen: consider upgrading :) [13:40] dreen: lol ok [13:42] rwaldron has joined the channel [13:42] tuhoojabotti: :D [13:42] Radium has joined the channel [13:43] luigy has joined the channel [13:43] ditesh|cassini has joined the channel [13:46] CIA-19: libuv: 03Bulat Shakirzyanov 07master * r31ff986 10/ src/unix/process.c : unix: fix TARGET_OS_IPHONE conditional - http://git.io/zgOgfg [13:46] epokmedia has joined the channel [13:46] jxie has joined the channel [13:47] mandric has joined the channel [13:47] ehazlett has joined the channel [13:47] garrensmith: with mocha is there a global beforeAll and AfterAll? [13:48] vargle has joined the channel [13:49] robo has joined the channel [13:49] carlyle has joined the channel [13:50] kejun has joined the channel [13:51] pendlepa1ts has joined the channel [13:52] arthurdebert has joined the channel [13:52] MrTopf has joined the channel [13:55] HacDan has joined the channel [13:56] theCole has joined the channel [13:56] sharkbird has joined the channel [13:57] TheFuzzball has joined the channel [13:57] Guest12401 has joined the channel [13:58] Radium has joined the channel [13:58] ewalker has joined the channel [14:00] robhawkes has joined the channel [14:00] argami has joined the channel [14:04] vicapow has joined the channel [14:05] marclar has joined the channel [14:05] divoxx has joined the channel [14:06] marclar: hey, everyone -- trying to install Hubot on Ubuntu but got the wrong npm version [14:06] marclar: anyone know how to select a specific npm version? [14:06] fhemberger has joined the channel [14:06] SamK1975 has joined the channel [14:07] SamK1975: does anyone know how you send post parameters using request.js? (request.post) [14:07] SamK1975: having a hard time [14:08] wendall911 has joined the channel [14:08] gauloises has joined the channel [14:10] marclar has left the channel [14:14] jaxzin has joined the channel [14:14] diogogmt has joined the channel [14:14] stafamus has joined the channel [14:15] michaelmartinez has joined the channel [14:16] bkaney has joined the channel [14:16] larsschenk has joined the channel [14:18] bartt has joined the channel [14:18] Skaag has joined the channel [14:19] joshfinnie has joined the channel [14:19] trbotime has joined the channel [14:22] willwhite has joined the channel [14:23] TheFuzzball has joined the channel [14:23] dubenstein has joined the channel [14:24] TomY_ has joined the channel [14:25] Skaag has joined the channel [14:27] t0nic has joined the channel [14:27] t0nic has joined the channel [14:28] denom has joined the channel [14:29] PeeterWork: Hello [14:29] PeeterWork: I got an issue with Step and the mongodb driver [14:29] PeeterWork: http://pastebin.com/erwD7LYC [14:29] PeeterWork: Am I doing something wrong? [14:30] dylang has joined the channel [14:31] jdeibele has joined the channel [14:31] McMAGIC--Copy has joined the channel [14:32] BillyBreen has joined the channel [14:32] thomaschaaf has joined the channel [14:32] yaymukund has joined the channel [14:33] boltR has joined the channel [14:33] cburyta has joined the channel [14:34] larsschenk has left the channel [14:34] thomaschaaf: Hello I am trying to get the network mask with node.js with the following code: http://pastie.org/3685733 sadly this [ '[object Object],[object Object]': null ] is the output [14:35] shafire has joined the channel [14:35] shafire: hi [14:35] thomaschaaf: forgot I am using iced coffee script [14:35] shafire: require("mootools").apply(GLOBAL); do not work anymore in nodejs 0.6.x. What do I need to do? [14:35] bradleymeck has joined the channel [14:36] pizthewiz has joined the channel [14:36] rlidwka: thomaschaaf: switch parameters in for loop -_- [14:36] rlidwka: for i, networkInterface of ... [14:36] rlidwka: "in" and "of" have somewhat different semantics [14:38] dthompso99 has joined the channel [14:38] dthompso99 has left the channel [14:38] rtgibbons has joined the channel [14:38] rlidwka: does iced work faster than async.js by the way? [14:39] bindr has joined the channel [14:40] thomaschaaf: rlidwka: that is not the problem. I want networkInterface to be "eth0" etc like I had it before [14:40] dubenstein has joined the channel [14:40] thomaschaaf: rlidwka: the problem is that the array at the end does not contain the info I want. [14:41] karellen has joined the channel [14:42] sorensen__ has joined the channel [14:43] qbit_: qbit@h3x[0]:~/Development/node[ᛘ v0.7.6]$ uname -rms; ./node --version [14:43] qbit_: OpenBSD 5.1 amd64 [14:43] qbit_: v0.7.6 [14:43] qbit_: wew! [14:44] rlidwka: hm... right, my mistake [14:45] jbpros has joined the channel [14:45] thomaschaaf: rlidwka: no problem :) just thought maybe some iced coffee guru was in here :/ [14:45] joemccann has joined the channel [14:45] dubenstein has joined the channel [14:45] rlidwka: i usually waiting "i" to be an index -_- [14:46] thomaschaaf: rlidwka: as far as I understood iced coffee was based on async.js [14:46] jbpros_ has joined the channel [14:46] paulwe has joined the channel [14:47] herbySk has joined the channel [14:47] yawNO has joined the channel [14:47] meso_ has joined the channel [14:48] meso__ has joined the channel [14:48] shinuza has joined the channel [14:48] paulwe has joined the channel [14:49] gozala has joined the channel [14:49] halfhalo has joined the channel [14:49] devongovett has joined the channel [14:49] nickfargo has joined the channel [14:50] baudehlo has joined the channel [14:51] hackband_ has joined the channel [14:52] automata has joined the channel [14:52] hackban__ has joined the channel [14:52] shafire has left the channel [14:53] arvidkahl has joined the channel [14:54] dubenstein has joined the channel [14:54] milani_: benvie: We can not use tar. [14:54] milani_: file format does not allow random access. [14:55] milani_: and also node-tar is async. we need sync functions. [14:55] lohkey has joined the channel [14:56] fatjonny has joined the channel [14:56] dve has joined the channel [14:57] brainss has joined the channel [14:57] Vespakoen has left the channel [14:57] antz291 has joined the channel [14:57] WarheadsSE has left the channel [14:57] benvie: hmm well to we just need to load it once basically into memory initially, so the random access thing should be fine [14:58] TheFuzzball has joined the channel [14:59] dve: afternoon all... any Matlab users around? [15:00] milani_: dve is this like a Matlab channelD [15:00] milani_: dve is this like a Matlab channel?:D [15:00] lperrin has joined the channel [15:00] RandallKent has joined the channel [15:01] dve: milani_: meh there isnt a matlab channel on freenode [15:01] EvRide has joined the channel [15:01] milani_: benvie: should we uncompress the whole archive in memory? [15:01] milani_: then it takes a lot of space. [15:01] milani_: I was thinking about random access to resource.pkg file. [15:02] s0urce has joined the channel [15:03] fhemberger: does fs.writeFileSync provide a return value on error? [15:04] benvie: it would be better to have the option [15:04] colinclark has joined the channel [15:04] s0urce has left the channel [15:04] benvie: but I think it's not out of the question to load everything for the majority of applications [15:04] colinclark has joined the channel [15:04] s0urce has joined the channel [15:04] s0urce has joined the channel [15:05] benvie: and failing that, using the system's temp directory for media maybe [15:05] s0urce: hi [15:05] benvie: the code itself is so small [15:05] Qalqi has joined the channel [15:05] jakehow has joined the channel [15:05] s0urce: is there a way to use the filesystem module in a sync way, with no callback? [15:05] fhemberger: hmm. it just throws an exception [15:05] fhemberger: s0urce: yepp. [15:06] fhemberger: s0urce: http://nodejs.org/api/fs.html#fs_fs_readfilesync_filename_encoding [15:06] milani_: benvie: big projects contain lots of modules [15:06] s0urce: fhemberger: ty [15:06] cjm has joined the channel [15:06] hij1nx has joined the channel [15:06] milani_: and node itself requires 10MB [15:07] swestcott has joined the channel [15:07] benvie: hmm I wonder what else is out there besides tar [15:07] s0urce: fhemberger: do you know how to get the errors in this way? [15:07] kevwil has joined the channel [15:07] benvie: that might be an issue with all of those kinds of formats [15:08] totallymike has joined the channel [15:08] dubenstein has joined the channel [15:08] jocafa has joined the channel [15:08] milani_: benvie: we can use .zip [15:08] benvie: I'm sure there's a reader [15:08] fhemberger: s0urce: use try/catch [15:09] Epeli has joined the channel [15:09] thetony: benvie: zip, rar, 7z, bz, there are plenty [15:09] benvie: yeah I just meant [15:09] jimmysparkle has joined the channel [15:09] benvie: stuff that has node module not relying on a compiled binding [15:09] milani_: rar is not possible it needs commercial license [15:09] thetony: milani_: to create and distribute? [15:10] milani_: rar creation needs license. but reading does not. [15:10] krnl has joined the channel [15:10] maletor has joined the channel [15:10] milani_: benvie: zip has a module named adm-zip [15:10] milani_: https://github.com/cthackers/adm-zip [15:10] milani_: it's buggy. [15:11] krnl: i'm listening on '0.0.0.0', all interface. how can i determine the ip-s i'm listening on, so all interfaces' ip? [15:11] sorensen__ has joined the channel [15:12] milani_: I don't know which way is better: compressing resource file and loading it into memory. [15:12] milani_: * archiving resources without compressing and load it into memory [15:13] justicefries has joined the channel [15:13] milani_: * archive resources without compress on disk and read it everytime. [15:13] dubenstein has joined the channel [15:13] benvie: yeah you have to make the tradeoff I think [15:13] benvie: one way or another [15:14] DrPheltRight has joined the channel [15:14] milani_: benvie: I think we do not need to have it in RAM. because node itself uses disk. [15:14] milani_: naturally. [15:15] jgornick has joined the channel [15:15] benvie: what do you mean? [15:15] rtgibbons has joined the channel [15:16] benvie: if we can have random access then yeah I think if i get uour meaning [15:16] benvie: it'll be loaded as needed [15:17] milani_: I mean when we develop apps in standard node it reads modules from disk. [15:17] benvie: oh yeah [15:17] Renegade001 has joined the channel [15:17] benvie: I mean you could do that [15:17] milani_: so it is not a big deal in performance. [15:18] MerlinDMC: krnl, tried require('os').networkInterfaces() ? [15:18] benvie: and just have the loader extract to a temp directory or system app directory [15:18] brngardner has joined the channel [15:18] krnl: im going to try thnx [15:18] milani_: beside, after initialization, node keeps module in RAM itself. [15:18] benvie: yeah that's what I was basically getting at before [15:18] milani_: oh it's not needed to extract it. [15:18] benvie: as long as we can read it into the module system it'll be in memory just by node's normal way of doing it [15:19] benvie: we don't need to keep two copies in memory [15:19] benvie: that's not really an issue with code itself [15:19] benvie: moreso of media files [15:19] milani_: yeah. so we should use a archiver that gives us random access ( file table at archive header ) [15:19] rickibalboa has joined the channel [15:20] benvie: and I guess a compiled on is fine as line as we can compile into node and node have compatability issues [15:20] milani_: because we need resolve path against this archive we need to have access to list of files. [15:20] benvie: but I suspect that's a headache [15:20] jscheel has joined the channel [15:20] illourr has joined the channel [15:20] benvie: so it's preferable if it can be js [15:20] benvie: the compatability is what's the killer [15:21] fangel has joined the channel [15:21] milani_: do you think we should archive files in json format? [15:21] benvie: even just tar was an ongoing battle for npm for a year and a half lol [15:21] iaincarsberg: hey, is it possible for a global function to get the __dirname for the calling script without manually parsing it? [15:21] benvie: I mean yeah we could just [15:21] benvie: compress it using something like that [15:21] benvie: and then node's gzip [15:21] arvidkahl has joined the channel [15:21] benvie: that wouldn't be too bad [15:21] milani_: we can also do something else, we can use tar, but we need to process it and create a listing of files first. [15:21] flagg0204 has joined the channel [15:22] benvie: hell we might as well just do that, because then we can set up whatever organization we want [15:22] milani_: I prefer not to compress it. decompression needs time. [15:22] benvie: well it'd be an option [15:22] benvie: because it's easy [15:22] whaley has joined the channel [15:22] benvie: but yeah [15:22] benvie: hmm [15:23] benvie: the problem is that for the most part single file virtual filesystem type things are part of compression stuff [15:23] milani_: you see there is another problem. if we use tar, node-tar is async. [15:23] milani_: we need sync functions. [15:23] benvie: tar is one of the few I can think of that's not related to tar [15:23] benvie: er [15:23] benvie: to compression [15:23] milani_: tar actually is not a compression format. [15:24] benvie: yeah that's what I was saying [15:24] milani_: it only archive files together as a single file. [15:24] milani_: yeah. [15:24] benvie: it's one of the few multi-file archivers that ISN'T compression [15:24] milani_: OK I'm convinced to use tar. [15:24] milani_: but what about node module to read it?! [15:24] milani_: :D [15:25] benvie: I wonder if though if I couldn't be made to work sync [15:25] benvie: the async part is mainly for IO [15:25] benvie: we can create read and write streams that are sync [15:25] dubenstein has joined the channel [15:25] nsolsen has joined the channel [15:25] jj0hns0n has joined the channel [15:26] milani_: emm, so we need a wrapper. [15:26] benvie: adm-zip [15:26] benvie: A Javascript implementation of zip for nodejs. Allows user to create or extract zip files both in memory or to/from disk [15:26] benvie: hmm [15:26] milani_: adm-zip is good but it has some bugs. [15:26] benvie: oh [15:26] milani_: it's in early days:) [15:26] rewolf has joined the channel [15:27] ovaillancourt has joined the channel [15:27] jimt_ has joined the channel [15:27] rewolf: how can i use jade"s interpolation to change a value without reloading the page? [15:28] TomY_ has joined the channel [15:28] pootietang has joined the channel [15:29] thinkt4nk has joined the channel [15:29] EyePulp has joined the channel [15:29] enjalot has joined the channel [15:29] milani_: benvie: what do you mean by "we can create read and write streams that are sync"? [15:30] cconstantine_ has joined the channel [15:30] thetony: what are you guys trying to do? [15:32] blendedbychris has joined the channel [15:32] toothr has joined the channel [15:32] milani_: thetony: we are trying to compress a whole node project in a single file:) [15:32] guiapprentice has joined the channel [15:33] milani_: https://github.com/milani/appjs [15:33] blendedbychris: hey guys i've pretty much decided on using socket.io for a "push" notification system on my site. Can I poll mysql. [15:33] milani_: The plan is to use it as a sdk [15:33] milani_: to develop desktop apps. [15:33] thetony: to build installers or something? [15:34] milani_: no it's actually a way to develop enterprise desktop applications. [15:34] thetony: blendedbychris: you can poll server side and use an interval on the client side to check for updates [15:34] Spion_ has joined the channel [15:34] RORgasm has joined the channel [15:34] blueadept has joined the channel [15:34] thetony: milani_: so why are you zipping anything, wouldn't it make sense to make it compile for different architectures? [15:35] thetony: and 10mb is small fries :) [15:35] milani_: It's better to have a single executable file with another file beside it. [15:35] milani_: you know;) [15:35] thetony: blendedbychris: sorry, i misread that question - i'll need to defer [15:36] chadskidmore has joined the channel [15:36] milani_: instead of node_modules, lib, src, public etc. they get only a single executable file. [15:36] robotmay has joined the channel [15:37] broofa has joined the channel [15:37] ewalker has joined the channel [15:37] thetony: enterprise desktop apps implies the user won't have to do anything but click a button to make it launch, noone cares how many folders you put into their program files folder, or their /usr/ folder [15:38] milani_: thetony: I know. [15:38] thetony: i find it disturbing if i go into a program directory and find a single executable because that means my settings aren't easy to back up [15:38] milani_: are you speaking as a user or as a developer? [15:39] Destos has joined the channel [15:39] thetony: not that a lot of files means otherwise, but it makes me hopeful. i'm speaking as a user - i write scripts to make my life easier and not much else. i haven't developed anything in years [15:39] thetony: but i've scripted my butt out of some very complex problems [15:40] milani_: thetony: I myself don't like to install an app and see all it's source code [15:40] milani_: no no, I wanted to answer you not denying you as a developer:) [15:40] thetony: how often do you go look? after i install something i just click the icon it made for me on the start menu [15:41] milani_: but if I do, I try to change it to see what happens:D [15:41] ByronK has joined the channel [15:41] thetony: inquiring minds do, i often try to break things [15:41] milani_: and about your settings, it doesn't relate to packaging source in a single file. [15:41] arvidkahl has joined the channel [15:42] yogig has joined the channel [15:42] DraftDay has joined the channel [15:42] Destos has joined the channel [15:42] thetony: ah, i see what you're trying to do.. just use zip and call it a day. you only need to zip it up once for distribution anyway [15:42] milani_: you know, it's better for everyone to not show users what is not necessary. [15:42] thetony: quit playing God and just give them the app, man! [15:42] milani_: thetony, I don't want to zip my own code. I'm developing a sdk [15:42] perezd has joined the channel [15:42] thetony: [or woman] [15:43] CIA-19: node: 03Nathan Rajlich 07master * r48bbdde 10/ lib/repl.js : [15:43] CIA-19: node: repl: don't write a newline on the readline 'end' event [15:43] CIA-19: node: In the case of the input stream *actually* having been closed, then we [15:43] CIA-19: node: can't write to a closed socket. [15:43] CIA-19: node: Fixes test/simple/test-repl.js - http://git.io/QsSLxg [15:43] milani_: a developer comes and gets my sdk, packages his project using it. [15:43] milani_: It will include GUI stuff and everything else. and when he compiles his project using this sdk, he gets a [15:44] milani_: resource folder and an executable file. [15:44] mattgifford has joined the channel [15:44] milani_: this way, end users does not need to have node installed. [15:45] thetony: you're going to end up with system dependent gui stuff, doing the same with the zipping mechanism shouldn't be so bad. i'd think folks who develop in *nix or osx are used to installing things like zip [15:45] s0urce: i got a strange bug, if i send "res.end('');" then all works fine, but if i read the html from file (sync) and the call "res.end(file_content);" my broser hangs up and don't close connection to server [15:46] milani_: there is not a good zip module for npm:) [15:46] Zzaichik has joined the channel [15:46] yhpark has joined the channel [15:46] jerrysv has joined the channel [15:46] thetony: milani_: why bother with it in node? there are plenty of cli utilities for zipping [15:46] jtsnow has joined the channel [15:47] dob__ has joined the channel [15:47] thetony: it's re-re-re-re-re-recreating the wheel [15:47] benvie: browser views aren't system dependent [15:47] DraftDay: any recommendations for server specs for a node.js server, cpus?, ram? [15:48] DraftDay: i know it all dependant on what i'm doing, i'm exploring moving our fantasy sports site stat tracking to node.js [15:48] milani_: thetony: you don't know the whole story man:) [15:49] DraftDay: for dev testing i'll be setting up a load balanced scenario using haproxy and vm server [15:49] DraftDay: in our datacener we have a hardware load balancer sitting in front of 4 webservers and a 16core vm server [15:51] thetony: milani_: i just know developers think anything outside of their application can be "rewritten better by me" and it's easy to get sucked into that [15:51] DraftDay_ has joined the channel [15:52] mattgifford has joined the channel [15:52] jaha has joined the channel [15:52] milani_: thetony: I don't want to reinvent the wheel nor I say I can do it better. [15:53] djbell has joined the channel [15:53] milani_: I want the node process ( developer executable program ) be able to read node_modules from that archive [15:53] milani_: in runtime. [15:53] Jygga has joined the channel [15:53] s0urce: do i need to set the length of responds in "red.end"? [15:53] milani_: so I should do it in node. [15:54] milani_: and I'm overloading module.js to load files from that archive instead of file system. say a virtual file system. [15:54] Byronk2 has joined the channel [15:54] milani_: so I need node to be able to handle archive stuff like resolving path against it, getting contents of a single file [15:54] milani_: and so on. [15:55] alejandromg has joined the channel [15:56] rauchg has joined the channel [15:56] kenperkins: o/ hello [15:57] DraftDay has joined the channel [15:57] justicefries has joined the channel [15:58] briancray has joined the channel [15:58] der| has joined the channel [15:58] tornad has joined the channel [15:59] jn: is 'npm update npm -g' the correct way of updating npm itself? [16:00] guidocalvano has joined the channel [16:00] der|: jn: I think so, yes [16:00] dodo has joined the channel [16:00] der|: jn: You can also do: `sudo npm install -g npm` [16:01] Blorb has joined the channel [16:01] r1ngzer0 has joined the channel [16:02] jsurfer has joined the channel [16:02] meso_ has joined the channel [16:03] meso_ has joined the channel [16:03] jtsnow has joined the channel [16:03] dragansah has joined the channel [16:03] blendedbychris: when running a node app do i set the path for the node_modules somehow? [16:04] milani_: blendedbychris: no you can't [16:04] thetony: yes you can, but you don't need to [16:04] dannyamey has joined the channel [16:04] isaacs has joined the channel [16:04] geetarista has joined the channel [16:04] milani_: it was long ago that you could change node_modules path. [16:04] thetony: blendedbychris: are you having trouble with require() ? [16:04] milani_: It's impossible now. [16:04] thetony: nothing is impossible [16:04] milani_: then how do you do that? [16:05] Neil__ has joined the channel [16:05] blendedbychris: well i know right now I am having trouble just understanding where everything should go [16:05] thetony: blendedbychris: if you're trying to include another file you created you should just use require("./otherfile.js"); [16:05] blendedbychris: no just including socket.io [16:05] kriskowal has joined the channel [16:06] milani_: thetony: it's not changing node_modules path:) [16:06] mattgifford has joined the channel [16:06] milani_: blendedbychris: do you use npm? [16:06] s0urce: blendedbychris: you rand use: require('./any/path/file.js') or if i want it like require('myfile') then u need to put in into node_modules, or check thetonys dirty tricks ;) [16:06] thetony: milani_: i'm fully aware, i'm just done arguing inanely [16:06] blendedbychris: milani_: yes … hang on i'll explain what i've done [16:07] thejefflarson has joined the channel [16:07] thetony: maybe i'm just using old node, i just don't trust anything milani_ is doing anymore :) [16:07] blendedbychris: I've just copied the chat example from /usr/local/lib/node_modules/socket.io/examples/chat [16:07] slaskis_ has joined the channel [16:08] horofox has joined the channel [16:08] blendedbychris: to somewhere else… but that relies on a relative link to socket.io (../../.. [16:08] blendedbychris: /socket.io) [16:08] s0urce: blendedbychris: there are 2 ways to install modules: npm install [module] -g, the means global, or with -g then it is installed into your project folder [16:08] sreeix has joined the channel [16:08] blendedbychris: ah okay [16:08] s0urce: just use require('socket.it') for socket.io and global installtion [16:08] s0urce: io* [16:08] milani_: blendedbychris: change it to require('socket.io') [16:09] milani_: blendedbychris: and then try `npm install socket.io` [16:09] s0urce: afkeacting, lata [16:09] thetony: and yes, doing a relative path to a module allows you to change node_modules path [16:09] blendedbychris: milani_: no -g? [16:09] milani_: thetony: he copied the file to somewhere else so he can not use relative path:) [16:10] milani_: no -g. [16:10] thetony: milani_: lol. [16:10] milani_: -g means global. [16:10] patcito has joined the channel [16:10] blendedbychris: what's the best practice? to include the modules with your app.js ? [16:10] blendedbychris: or use -g [16:11] milani_: I prefer using npm without -g:) [16:11] blendedbychris: milani_: which dumps it in your "project" directory? [16:11] antz29: @blendedbychris your best option is to create a package.json specifying your deps. then you just run npm install to grab them [16:11] milani_: yes in your projects directory/node_modules [16:11] jerrysv: -g could go wrong if some other module monkey punches something installed -g without you knowing it. [16:12] caolanm has joined the channel [16:12] Zoramite has joined the channel [16:12] blendedbychris: antz29: i saw this… the chat example included with socket.io doesn't actually include socket.io heh [16:12] ekryski has joined the channel [16:12] mr_smith has joined the channel [16:13] blendedbychris: http://pastie.textmate.org/private/bo98in5oh6xraj5m9vosrw [16:13] antz29: well it depends if it 'needs it to run' or if it is just compatible with it. [16:13] Zoramite: Is there a way to pass a pipe through to an internal variable? [16:13] antz29: you can always just add socket.io in there [16:14] artusrocha has joined the channel [16:14] milani_: blendedbychris: it's because it uses relative path to access socket.io [16:15] Zoramite: For instance having a myObject.pipe() really pipe to a variable inside of myObject ? [16:15] milani_: so it does not depends on it. it uses itself:) but when you copy it to somewhere else, you need to include [16:15] milani_: socket.io [16:15] blendedbychris: okay [16:15] blendedbychris: thanks alot guys [16:16] milani_: :) [16:16] arduix has joined the channel [16:16] dtrejo has joined the channel [16:17] dreen has joined the channel [16:19] robhawkes has joined the channel [16:19] jryans has joined the channel [16:20] wibby has joined the channel [16:20] ItsDan has joined the channel [16:20] ItsDan has left the channel [16:21] avalanche123|h has joined the channel [16:21] wibby: Hi, I've installed underscore with npm. Why does _.difference([ 133654626701619 ], [ 133654626701619, 133654626701619 ]) incorrectly yield [ 133654626701619 ] in node? However, in the browser, it yields [], which is correct. [16:21] wibby: (the numbers are all the same) [16:22] RobWC has joined the channel [16:22] RobWC has left the channel [16:22] Sembiance: wibby: haven't used underscore myself, but I would set a breakpoint in their difference function and see what it's doing. I'd see on the browser side first, then go and check the node side [16:23] blendedbychris: is socket-io.js different than the client? [16:24] blendedbychris: https://github.com/LearnBoost/socket.io/tree/master/lib << so that's not the client [16:24] jn: der|: thx [16:24] blendedbychris: indeed [16:24] blendedbychris: i'll stop asking stupid questions [16:24] ramitos has joined the channel [16:24] antz29: :) [16:25] sreeix has joined the channel [16:25] antz29: @wibby what browser are you using? Chrome or Firefox? [16:25] kevwil has joined the channel [16:26] wibby: antz29: chrome [16:26] sreeix_ has joined the channel [16:26] TomY_ has joined the channel [16:26] antz29: ok just thinking if it was V8 or not [16:27] bhelx: looks like it is supposed to flatten [16:27] bhelx: https://github.com/documentcloud/underscore/blob/master/underscore.js#L407 [16:27] bhelx: wibby: ^ [16:27] s0urce: i rly dont get it, why my res.end() wont work if i get the html from file [16:28] divoxx has joined the channel [16:28] TheAlphaNerd has joined the channel [16:28] TheAlphaNerd has joined the channel [16:28] sreeix has joined the channel [16:28] blendedbychris: antz29: https://github.com/LearnBoost/socket.io << why is it in that example it loads the server it seems [16:28] tilgovi has joined the channel [16:28] hlomas: can anyone give this a run and tell me if they also get a huge failure rate on base64 [16:28] hlomas: https://gist.github.com/2227976 [16:29] s0urce: lol, now i removed my not existing js includes from html, now it works [16:29] robi42 has joined the channel [16:29] sreeix_ has joined the channel [16:29] s0urce: wtf, does res.end() valitate the js includes? [16:29] dylang_ has joined the channel [16:29] Destos has joined the channel [16:30] orlandovftw has joined the channel [16:30] antz29: blendedbychris: I don't really know socket.io all that well [16:30] orlandovftw has joined the channel [16:30] trose has joined the channel [16:30] s0urce: blendedbychris: get the socket.io client from server, getting it client side is compliacted, but no time now, sry [16:31] benvie has joined the channel [16:31] blendedbychris: s0urce: i'm trying to serve it from another file though? [16:31] jaha has joined the channel [16:31] blendedbychris: i downloaded the client and loaded io.js [16:31] sreeix_ has joined the channel [16:31] blendedbychris: now i get Uncaught TypeError: Cannot call method 'parseUri' of undefined [16:31] wibby: bhelx: I fail to see how that is relevant. I'm using _.difference as it is supposed to be used [16:32] joshthecoder has joined the channel [16:32] dylang_ has joined the channel [16:32] gf3: rtgibbons: YO [16:32] bhelx: wibby: right, not saying you are using it incorrectly, just saying the problem is likely in the flatten routine [16:32] rtgibbons: gf3: sup [16:32] gf3: rtgibbons: MOTHERFUCKER, I didn't know you were on IRC [16:32] hlomas: can anyone please give this a run and tell me if they also get a huge failure rate on base64 encoding of http.get responses, https://gist.github.com/2227976 [16:33] rtgibbons: gf3: it comes in spurts. I try to stay on it [16:33] milani_: blendedbychris: what are you doing?:) did you copied chat folder into somewhere else? [16:33] gf3: rtgibbons: oh god, your wording [16:33] gf3: rtgibbons: bahahaha [16:33] rtgibbons: :) [16:33] dragansah has joined the channel [16:33] sreeix_ has joined the channel [16:34] wibby: I just can't wrap my head around it. been trying to fix this for hours. [16:34] nrub has joined the channel [16:34] sreeix_ has joined the channel [16:34] bhelx: wibby: I'd definitely use a debugger as suggested and step through each operation comparing the results [16:34] bhelx: might be a bug [16:34] milani_: hlomas: what should I see? [16:34] tohava has joined the channel [16:35] tohava: Question, I use https.request to get an http stream from the server [16:35] sreeix_ has joined the channel [16:35] blendedbychris: milani_: hah… no actually I am just piecing crap together at this point… I have a server with just this code http://pastie.textmate.org/private/yy5paoqdkzlzpgatrkki1a running… now i'm trying to retrofit an existing "html" file to be able to connect with the server…. http://pastie.textmate.org/private/bz6lyvwwplofwosfj5n9nq [16:35] wibby: bhelx Sembiance I don't know how to debug with node :| [16:35] blendedbychris: i know most of that won't work [16:35] tohava: is there any recv() timeout for the stream [16:36] blendedbychris: but i wanted to see some log stuff happen [16:36] Sembiance: wibby: https://github.com/dannycoates/node-inspector [16:36] bhelx: node-inspector is pretty simple [16:36] mikeal has joined the channel [16:36] milani_: hlomas: What should I see? [16:37] mattgifford has joined the channel [16:37] AndreasMadsen has joined the channel [16:37] milani_: blendedbychris: you don't need to tell socket.io where the js file is. [16:37] halfhalo has joined the channel [16:37] dennisjbell has joined the channel [16:38] sreeix has joined the channel [16:38] milani_: blendedbychris: [16:38] thirdknife has joined the channel [16:38] milani_: socket.io server creates a route to handle this request itself. [16:38] achiu has joined the channel [16:39] rtgibbons has joined the channel [16:39] skeptic_ has joined the channel [16:39] antz29: @blendedbychris you might want to try #socket.io as well ;) [16:39] dilvie has joined the channel [16:39] Sembiance: also, sockjs is a good alternative to socket.io [16:39] blendedbychris: milani_: how in the world what that work? [16:40] milani_: when you tell socket.io to listen to port 3000, [16:40] milani_: it creates a server and watches for a request /socket.io/socket.io.js [16:40] dwhittle has joined the channel [16:40] gde33 has joined the channel [16:40] blendedbychris: oh okay [16:40] blendedbychris: so point it to chat.fellowshiplive.com/socket.io/socket.io.js [16:40] blendedbychris: (different servers here) [16:40] blendedbychris: or i should say vhosts [16:40] bergie_ has joined the channel [16:41] kmiyashiro has joined the channel [16:41] milani_: what's your webserver? [16:41] milani_: apache nginx? [16:41] blendedbychris: i'm just proxying with nginx [16:41] milani_: oh I see. the problem is that you can not do it with vhost:) [16:41] sreeix has joined the channel [16:41] blendedbychris: yes you can :) [16:42] larsschenk has joined the channel [16:42] larsschenk has left the channel [16:42] milani_: no you can't! nginx does not support websocket [16:42] blendedbychris: yes 1.1 does [16:42] milani_: aha. yes newer versions can. [16:42] divoxx has joined the channel [16:42] milani_: anyway. [16:42] blendedbychris: it serve the js though [16:42] blendedbychris: service* [16:42] blendedbychris: sklajdflsaf'lj [16:42] milani_: so is your problem fixed? [16:43] cedric303 has joined the channel [16:43] blendedbychris: yep [16:44] milani_: congratulation! [16:44] incon has joined the channel [16:44] scottdware has joined the channel [16:45] blendedbychris: now to make it do something useful [16:45] ramitos has joined the channel [16:45] milani_: good. have a nice hack!!!! [16:47] kmiyashiro_ has joined the channel [16:47] achiu has joined the channel [16:49] tracker1 has joined the channel [16:49] ditesh|cassini has joined the channel [16:49] yawNO has joined the channel [16:49] hz has joined the channel [16:49] hlomas: @milani_ sorry for slow response, was writing a bug report... you should see most of the base64 result in a failure to match the data received vs the data written to file [16:50] enmand has joined the channel [16:51] hlomas: here is the bug report i just created https://github.com/joyent/node/issues/3026 [16:51] milani_: hlomas: do you think getting false length received ? [16:51] milani_: Matched: false Length received: 5208 [16:51] hlomas: i don't understand your question [16:51] milani_: I ran your code [16:51] hlomas: ok [16:52] milani_: this is the output: [16:52] milani_: a bunch of 49 'utf8' [16:52] milani_: with the number increasing [16:52] milani_: then 50 'base64' [16:52] milani_: again with increasing number [16:52] hlomas: ok [16:53] milani_: Matched: false Length received: 5208 md5: 4f58984b112cc3ac342a28b4d1a0c280 Failed: 26 of 26 Encoding: base64 [16:53] wibby: bhelx Sembiance thanks. [16:53] hlomas: that's the only thing you saw? [16:53] hlomas: with the word Matched? [16:53] hlomas: one single output? [16:54] hlomas: you should have seen 100 requests [16:54] denom has joined the channel [16:54] milani_: Actually I stopped the process because you didn't answer. I try again. [16:55] t0mmyvyo has joined the channel [16:55] djbell has joined the channel [16:55] milani_: ok I ended up with a captcha image. [16:56] qjcg has joined the channel [16:56] hlomas: if you remove the line that says `console.log( i, encoding )` it will remove the 100 lines of irrelevant output such as `0, utf8` [16:56] josh-k has joined the channel [16:56] hlomas: yes but having a captcha image isn't the point, the point is how many times did the base64 encoding fail [16:57] hlomas: versus how many times did the utf8 encoding fail [16:57] adamkittelson has joined the channel [16:57] milani_: let me send you the whole output [16:57] hlomas: pastebin ? [16:57] milani_: http://www.pasteit.com/17303 [16:58] enjalot has joined the channel [16:58] hlomas: weird so it worked 100% for you [16:58] traph has joined the channel [16:58] hlomas: but then earlier you pasted this ==== Matched: false Length received: 5208 md5: 4f58984b112cc3ac342a28b4d1a0c280 Failed: 26 of 26 Encoding: base64 [16:58] hlomas: so there it failed 26 of 26 times.. [16:58] dve has joined the channel [16:59] hlomas: note the length of 5208 versus the 5204 on the "Matched: true" output [16:59] milani_: yes the previous one it returned false [16:59] wibby: bhelx Sembiance in case you're interested, I can no longer claim that underscore behaves differently in node than in a browser. The issue has to do with nested underscore methods that I didn't use in the browser [16:59] milani_: but this time it doesn't [16:59] hlomas: ok, thank you for running that [16:59] milani_: :) [17:00] dve has joined the channel [17:01] hackband has joined the channel [17:01] benvie: var self = this instanceof Ctor ? this : Object.create(Ctor.prototype); [17:03] retornam has joined the channel [17:03] trbotime has joined the channel [17:03] damiano has joined the channel [17:03] diogogmt has joined the channel [17:03] damiano: hello [17:03] dve has joined the channel [17:03] damiano: TypeError: object is not a function [17:03] damiano: at Object.CALL_NON_FUNCTION (native) [17:04] damiano: doing: require('./routes')(app) [17:04] damiano: in routes.js i have: [17:04] damiano: exports.module = function(app){ .... } [17:04] damiano: why do i get this error? [17:04] Poetro has joined the channel [17:04] Poetro has joined the channel [17:05] MT_ has joined the channel [17:05] damiano: someone could help me? [17:05] kickingvegas has joined the channel [17:06] chrishyle has joined the channel [17:06] ramitos has joined the channel [17:07] hij1nx has joined the channel [17:07] nail_: damiano: it's module.exports [17:08] mattgifford has joined the channel [17:08] flou has joined the channel [17:08] ditesh|cassini has joined the channel [17:09] alvaro_o has joined the channel [17:09] damiano: grrrrrrrrr [17:09] damiano: :) [17:10] ekryski has joined the channel [17:10] paulwe has joined the channel [17:10] khrome has joined the channel [17:10] brngardner has joined the channel [17:12] marcuswestin has joined the channel [17:12] gregpascale has joined the channel [17:14] blueadept has joined the channel [17:15] trotter has joined the channel [17:15] maletor has joined the channel [17:15] richcollins has joined the channel [17:16] richcollins: I've created my own package that I want to use in another project. How do I reference it from my project's package.json? [17:16] richcollins: I see the dependencies key in package.json [17:16] richcollins: Where does it look for those dependencies? [17:16] richcollins: npm only? [17:17] EuroNerd has joined the channel [17:17] EuroNerd has joined the channel [17:17] TooTallNate has joined the channel [17:17] isaacs: richcollins: yes. [17:17] isaacs: richcollins: but you can do "dependencies": { "foo":"http://blahblahblah/foo.tgz"} as well [17:17] isaacs: richcollins: or a git repo [17:17] isaacs: richcollins: see the faq: `npm faq` [17:17] chrishyle has joined the channel [17:17] richcollins: isaacs: how about a path to a local directory? [17:18] isaacs: richcollins: nope [17:18] richcollins: ATM I'm only using the package in this one project [17:18] incon has joined the channel [17:18] isaacs: richcollins: but you can just list the name and version, and do `npm link ../foo` to symlink it in for dev. or you can just put it there. [17:18] franciscallo has joined the channel [17:18] isaacs: in node_modules [17:18] richcollins: but I wanted to separate it into a package in case I wanted to use it elsewhere [17:18] isaacs: (npm link not supported on windows for various reasons) [17:18] isaacs: richcollins: sure [17:18] isaacs: richcollins: why not just publish it? [17:18] richcollins: isaacs: just wanted to do the fastest thing to get started [17:19] tracker1: wankdanker: greetings... [17:19] michaelmartinez has joined the channel [17:19] richcollins: while keeping things well organized [17:19] isaacs: richcollins: publishing is fast :) [17:19] isaacs: richcollins: it's on par with `git push` [17:19] hipsterslapfight has joined the channel [17:19] briancray has joined the channel [17:19] richcollins: isaacs: https://github.com/richcollins/crux [17:20] richcollins: so I can just do "crux:"git url"? [17:20] isaacs: richcollins: sure [17:20] isaacs: git://github.com/... [17:20] milani_ has joined the channel [17:20] richcollins: but then I'd need to push every time I make a change that I want to test ... [17:20] isaacs: richcollins: yeah [17:20] isaacs: richcollins: you can also do crux:version, and npm link it [17:21] isaacs: richcollins: or just check it out into node_modules [17:21] richcollins: I suppose I could just require "./lib/crux/lib/crux.js" while testing? [17:21] isaacs: richcollins: you have an embarrassment of riches with respect to the options here :) [17:21] langworthy has joined the channel [17:22] richcollins: yes options are nice but make it harder to do the simple thing [17:22] damiano: guys i'm using express [17:22] richcollins: sounds like I want to link it for dev [17:22] damiano: and i have seend that if i use layout [17:22] richcollins: thanks for your time and help :-) [17:22] xtianw has joined the channel [17:22] damiano: layout.jade will be called automatically [17:23] Hebo has joined the channel [17:23] damiano: can i change that name? 'layout.jade' can i name it: frontend.jade ? (i would like to set it globally without set the layout in each .render() [17:23] damiano: is this possible? [17:23] dgathright has joined the channel [17:24] milani_: if I use a library like libsomething.so does it remain in memory? [17:24] bkaney has left the channel [17:24] milani_: ( sorry to ask a system question here ) [17:24] Morkel has joined the channel [17:24] vicapow has joined the channel [17:26] damiano: ? [17:26] wavded: question about node_redis if anyone know, does it matter if I connect to a master or slave (does it know to redirect to the master for writes) or do I have to connect to the master? or any recommendations on that (its a small project for now, data just needs to be synced) [17:27] wavded: i suppose i could just do it and see what happens :) [17:27] wavded: couldn't find any docs on it [17:28] nerdy_ has joined the channel [17:28] milani_: damiano: try express.set('layout','something.jade') [17:28] milani_: express is the instance of express.createServer [17:29] langworthy has joined the channel [17:29] jrundquist has joined the channel [17:29] milani_: sorry I mean server.set('layout','something.jade'); [17:29] bkaney has joined the channel [17:29] damiano: app.set('view engine', 'jade') [17:29] damiano: so [17:29] damiano: then.set('layout') [17:29] damiano: right? [17:30] damiano: app.set <--- [17:31] context: try it ? [17:31] context: damiano: if its not correct you will NOT start ww3. i promise. [17:31] context: and you never know, you might even learn something if its wrong [17:31] arturadib has joined the channel [17:32] context: or were you asking for permission to write your code like that? [17:32] context: in which case, i dont think anyone here will have a problem with that if you do. but thank you for asking [17:32] Rister has joined the channel [17:32] Witnes5 has joined the channel [17:33] Edy has joined the channel [17:33] s0urce: any1 knows how modules like express decides between get request and static file requests like client side javascript ,css or images?? [17:33] gauloises has joined the channel [17:34] jdeibele has joined the channel [17:35] RORgasm has joined the channel [17:35] wankdanker: tracker1: greetings to you! [17:35] edwardmsmith has left the channel [17:36] yawNO has joined the channel [17:36] tylerstalder has joined the channel [17:36] PElshoff has joined the channel [17:36] kmiyashiro_ has joined the channel [17:36] TheFuzzball has joined the channel [17:36] IlskenLabs has joined the channel [17:36] dshaw_ has joined the channel [17:37] damiano: it does NOT work [17:37] damiano: i get: Error: failed to locate view "layout" [17:38] jomoho has joined the channel [17:39] halfhalo has joined the channel [17:41] hackband has joined the channel [17:41] sectionme has joined the channel [17:41] gauloises has joined the channel [17:42] nateps has joined the channel [17:42] CoverSlide: s0urce: fs.exists() possibly? [17:43] kriskowal has joined the channel [17:43] CoverSlide: s0urce: https://github.com/senchalabs/connect/blob/master/lib/middleware/static.js#L147-156 [17:45] vikign has joined the channel [17:47] TheFuzzball has joined the channel [17:48] gauloises has joined the channel [17:48] pickels has joined the channel [17:49] ppcano has joined the channel [17:50] khrome has joined the channel [17:52] kordless has joined the channel [17:52] jwoah has joined the channel [17:54] gauloises has joined the channel [17:55] halfhalo has joined the channel [17:56] RandallKent has joined the channel [17:56] mattgifford has joined the channel [17:57] kinginky has joined the channel [17:57] conancat has joined the channel [17:57] zodiak has joined the channel [17:57] polardude has joined the channel [17:58] yawNO has joined the channel [17:58] cjm has joined the channel [17:58] TheFuzzball has joined the channel [17:58] kinginky: im here for some help. i guess im asking general javascript help. anyhow, i have this set of classes that, up until now, has functioned fine. strangely, i have two arrays, and from one function they appear empty while in others they appear as they should. [17:58] kinginky: i have the code on pastebin at http://pastebin.com/NH1Dd1gn if anyone would be kind enough to take a look [17:59] kinginky: in particular it is the rebuildArrays function that isn't working right [17:59] aranw has joined the channel [18:00] aranw has joined the channel [18:00] mattgiff_ has joined the channel [18:00] adrianF has joined the channel [18:00] cjm has joined the channel [18:01] dylang has joined the channel [18:01] zackattack has joined the channel [18:01] mc: is anyone in here using mysql and not just writing queries by hand? this is getting tiring and most of the ORMs i've come across seem to be not done [18:02] c4milo has joined the channel [18:02] kinginky: mc: why would you not write them by hand? it's simple enough [18:02] mc: because i have one with 5 left joins in it and it's getting hard to keep track of [18:02] kinginky: damn [18:02] kinginky: lol [18:02] automata has joined the channel [18:03] kinginky: to my knowledge there aren't a lot of great mysql modules. i always use the "mysql" one [18:03] mc: yeah, that's what i've been doing [18:03] kinginky: but there is a list of modules somewhere. i'm sure you've found that? [18:03] mc: i have [18:03] Zharktas: how do you query the mysql module with joins [18:03] context: mc: learn what the return key and proper indentation are [18:04] Zharktas: maybe i failed something but my queries only seem to return data from the first table [18:04] context: if you stop treating an sql query like a run on sentence on a single line you will find they are much easier to read and follow [18:04] context: s/an sql query/your sql queries/ [18:05] kinginky: context: i agree, but we really don't know if he's failing to do that. it's really a matter of personal preference and what the requirements of his project are. *shrug* [18:05] sammmy has joined the channel [18:05] dragansah has joined the channel [18:05] mc: it's a project i inherited [18:05] context: and an ORM might not necessarily help if you are joining 5 tables. [18:05] mc: and i'm not a sql expert by any means [18:06] kinginky: you don't need to be an sql expert to utilize it to a very reasonable extent, though, mc. [18:06] Zharktas: if i can't get these queries to work, i just might change to mongo or something [18:07] kinginky: Zharktas: what is your project? [18:08] Zharktas: simple web service for personal use, so database can be pretty much everything [18:08] Zharktas: but i would like to use mysql since i allready know sql :p [18:08] michaelmartinez_ has joined the channel [18:09] bingomanatee_: Zharktas - try checking out cloud9 [18:09] isao has joined the channel [18:09] kinginky: Zharktas: dude seriously i know how it is to feel comfortable with a specific piece of software, but you'd really be better off with mongo [18:09] clu3 has joined the channel [18:09] kinginky: if you don't need a DB that is [18:10] kinginky: oh wait i read your sentence wrong [18:10] kinginky: but still, mongo [18:10] kinginky: mongo is pretty easy to get going too [18:10] mikeal has joined the channel [18:10] Zharktas: yeah i figured that it would be useful to learn it anyway :p [18:10] kinginky: its architecture is pretty simple from what i recall [18:10] bingomanatee_: with all due respect king inky, if you are learning a new tool, then it does make sense to focus your learning on the part you don't know. [18:10] Zharktas: especially since these mysql modules seem to be still work in progress [18:11] kinginky: bingo: i think maybe i came off wrong, i was saying the same thing. [18:11] kinginky: bingo: he said he knew SQL already and was comfortable, and i suggested he try something new [18:11] mc: i may end up just changing the schema to make more sense [18:11] retornam has joined the channel [18:11] kinginky: Zharktas: i think nearly everything node.js is a WIP [18:11] dylang has joined the channel [18:12] jamiep has joined the channel [18:12] kinginky: Zharktas: which is annoying because you'll get 1000-2000 lines into a project and then realize some module is gonna fuck you over [18:12] kinginky: or in my case 1000-2000 lines in you start having incredible difficulty with the fact that "this" is contextual in JS [18:13] larsschenk1 has joined the channel [18:13] Zharktas: true [18:13] kinginky: i hate that about JS. it's made me consider going over to ruby for my project, but ruby doesn't have any good socket.io type package (that i know of) [18:13] Zharktas: most of the last week been dealing with mysql modules and everyone of the has some problems :p [18:13] kinginky: and i really have to have socket.io for this [18:14] ThatDudeGuy_ has joined the channel [18:14] kinginky: i don't understand why JS couldn't just act like c/c++ lol [18:14] PPaul has joined the channel [18:14] richcollins has joined the channel [18:14] DraftDay: ruby eventmachine [18:14] jdeibele has joined the channel [18:14] kmiyashiro has joined the channel [18:15] Poetro_ has joined the channel [18:15] milani_ has joined the channel [18:15] Radium has joined the channel [18:15] milani_: benvie: may I consult with you again? [18:15] bitcoin has joined the channel [18:15] kinginky: DraftDay: ruby eventmachine, will check that out. would it work alongside socket.io client-side?? [18:16] dylang has joined the channel [18:16] shanem has joined the channel [18:16] DraftDay: no clue, came across it in my own research [18:16] maletor has joined the channel [18:16] kinginky: DraftDay: thanks bro [18:17] kinginky: ACTION hands DraftDay a shot of Johnny Walker [18:17] Fuu`: kinginky: http://www.infoq.com/presentations/Chloe-and-the-Real-Time-Web [18:17] kinginky: enjoy [18:17] kinginky: ACTION hands Fuu` one, too [18:17] shinuza has joined the channel [18:17] kinginky: thanks, Fuu [18:17] retornam has joined the channel [18:17] kinginky: wow, Fuu, this looks intriguing [18:18] Fuu`: just found it last night, it gives interesting perspective [18:18] ullmark has joined the channel [18:18] isaacs has joined the channel [18:19] pquerna has joined the channel [18:19] larsschenk1 has left the channel [18:20] PPaul has joined the channel [18:21] Hebo has joined the channel [18:21] milani_: what does process.binding do? [18:21] sammmy: nodemon kills me. :( [18:23] coderarity: url.parse('localhost:8080') is very broken, lol [18:23] coderarity: requires a protocol to work properly =S [18:23] coderarity: not sure if this is intended or not [18:24] admc has joined the channel [18:25] achiu has joined the channel [18:26] benvie: process.binding is the link to get access to native stuff [18:26] jerrysv has joined the channel [18:26] benvie: process.binding('natives') is the source code for all the built in modules [18:27] EhevuTov has joined the channel [18:27] EyePulp has joined the channel [18:27] totallymike has joined the channel [18:27] TooTallNate: coderarity: that is expected; it matches how web browsers work with it [18:27] TooTallNate: milani_: it's internal; don't use it [18:28] milani_: TooTallNate: I know. I want to understand the code. [18:28] milani_: Does it bind a native module to a javascript one? [18:28] benvie: he's compiling stuff for _third_party_modules [18:28] TooTallNate: ahh, cool [18:28] benvie: it exposes the objects from c++ [18:28] benvie: that's where they all originate [18:28] richcollins: I have a node (heroku) project that depends on a package that I've npm linked [18:28] TooTallNate: what benvie said :) [18:29] richcollins: when I type npm list it says "UNMET DEPENDENCY crux 0.0.1" [18:29] richcollins: Any idea why node doesn't see it? [18:29] benvie: you'll usually see it used at the top of the various libs [18:29] langworthy has joined the channel [18:29] isaacs: richcollins: npm ls [18:29] isaacs: what does that output? the full thing? [18:30] richcollins: isaacs: https://gist.github.com/2b65029f759fdab16fd2 [18:30] benvie: buffer.js is a good example of it in use [18:30] milani_: benvie: so there are two types of fs module. one javascript wrapper and one c++ one. [18:30] coderarity: TooTallNate: interesting, thanks [18:30] benvie: SlowBuffer starts out as a binding and then a lot is added to it [18:30] benvie: yeah [18:30] richcollins: If I do it from the linked project: [18:30] benvie: same for a lot of things [18:30] milani_: benvie: but I can not figure out where they defined. node_fs.cc defines itself as node_fs [18:30] milani_: not fs. [18:30] benvie: the minimal/raw c++ interface is wrapped with a lot of js [18:31] richcollins: isaacs: https://gist.github.com/4349e9f24420f9805be1 [18:31] milani_: NODE_MODULE(node_fs, node::InitFs) [18:31] benvie: it's node_extensions or something [18:31] Vespakoen has joined the channel [18:31] benvie: node_extensions.h [18:32] kevwil has joined the channel [18:32] benvie: or wait [18:32] TooTallNate: milani_: are you trying to add built-in modules? [18:32] TooTallNate: milani_: just dump js files into the lib/ dir [18:32] TooTallNate: and add them to the list in node.gyp [18:32] milani_: TooTallNate yes. I know:) [18:33] robhawkes has joined the channel [18:33] milani_: I want to overload module.js to create a virtual file system. The story is too long:) [18:33] skm has joined the channel [18:33] benvie: oh yes [18:33] murvin has joined the channel [18:33] benvie: so [18:33] thetony: TooTallNate: he is trying to reinvent a bunch of crap [18:33] gauloises has joined the channel [18:33] murvin: should I just do "body.length" for calculating the Content-Length for the http header? [18:33] TooTallNate: why not use fuse or something and implement the virtual fs directly? [18:34] MrTopf has joined the channel [18:34] TooTallNate: then it would "just work" with module.js [18:34] milani_: thetony: please do not tell something that you don't know man. [18:34] benvie: I wouldn't want call wanting to create a bundled up module loader with node binary reinventing stuff [18:34] benvie: when your goal is to provide a toolset to make distributables [18:34] benvie: cause that doesn't exist for node as far as I know [18:34] thetony: milani_: i've engaged in inane argument enough [18:35] milani_: TooTallNate: I want to compile ones project's node_modules into node's executable for a reason. [18:35] benvie: and fuse would be a poor choice for anything meant to work cross platform [18:36] richcollins: isaacs: ah I needed to npm link crux [18:36] benvie: it's more like using a .zip file or .tar for a mini filesystem, than an actual userland mounted one [18:36] thetony: he is doing it so that he can distribute source with a node.exe to run the source and not show users the source unless they unzip it and look at it. it's neither an enterprise solution nor is it not reinventing a solution [18:36] milani_: benvie: I thought about your suggestion json file. [18:37] milani_: It can be a simple js file that is compiled into node as a native module. [18:37] thetony: milani_: you could just create your own file type for the fs, it'd be easier and you'd have more control over it than just a simple zip [18:37] benvie: I thought the word enterprise may indicate something but what he is trying to do is actually more useful and cooler than that [18:38] shinuza has joined the channel [18:38] benvie: I think you'll not want to require the sdk users to have a compiler [18:38] thetony: enterprise would imply that you might deploy it to an aix cluster and use it to do business with, deploying source inside a zip to use with a node controller is neither enterprise and it's needlessly complicated [18:39] thetony: or at least deploy to expensive equipment [18:39] milani_: thetony: I told you. It's not a simple project it should be usable by other developers. I can not tell everyone do my way. [18:39] milani_: thetony if you have problem with enterprise, it doesn't mean its reinventing everything. forget about enterprise. ok? [18:39] thetony: sure [18:39] jomoho has joined the channel [18:40] thetony: i'm not hung up on that, really. my argument is that it seems complex without a good reason :) [18:40] benvie: what it actually is is the overall thing I've been working toward for a while which is an sdk to build desktop apps with node, using a web view as the renderer and providing an integrated loader and distributable tool [18:40] jxson has joined the channel [18:41] milani_: benvie: yes. they will need compiler what ever we do if we want to add this resource package in node executable. [18:42] thetony: milani_: benvie: if you create the project as a hosted solution (ie it packages on your servers) then you can control the environment it runs in and then they don't need compilers [18:42] milani_: thetony ok I will learn a lot of stuff about node source. think this way and forget about enterprise or good reasons. I want to learn its enough for me. [18:42] thetony: then you can use shared disk, like drop box or git or etc [18:43] trivol has joined the channel [18:43] jj0hns0n has joined the channel [18:43] thetony: milani_: that's good enough for me too, and i'll drop it :) [18:43] benvie: I personally have no aims at anything related to enterprise. The value of this idea is in making desktop developers out of web developers using the tools and and environment they know and like [18:44] milani_: benvie: his problem is with packaging source into a single file. [18:44] thetony: have you looked at using cappuccino for front end components? http://cappuccino.org/ [18:44] benvie: well here's my thought on that [18:44] PPaul has joined the channel [18:45] thetony: benvie: he wants to learn, that's a good enough reason to do just about anything. [18:45] milani_: thetony if you where in a channel they thought about cappuccino you told them: [18:45] benvie: one way or another it'll be possible to set it up such that you can dynamically pack in a resource pak without recompiling the exe [18:45] milani_: hey you don't reinvent the will. use gtk+ and its enough!! [18:45] Poetro1 has joined the channel [18:45] thetony: gtk+ isn't a web framework a [18:46] robi42 has joined the channel [18:46] milani_: but it has a webkitgtk+ you told them! [18:46] milani_: ;) [18:46] benvie: they may mean having a transparent unpacker or something but since you're not recompiling anything it's absolutely possible to do it either directly in the binary or by wrapping the binary in a self-deflating exe [18:46] thetony: haha [18:47] benvie: and it'll be trivial to set up some custmo format to pack all the source together [18:47] benvie: and keep it all essentially in one file [18:47] benvie: and it might be possible to reuse some stuff from chromium/webkit fort hat [18:47] benvie: like the debugger in webkit is in one .pak file [18:47] milani_: benvie: what I think is to only include js files and node_modules. [18:48] milani_: other files like video and images does not require to be in the package. they can handle it themselves using fs. [18:48] benvie: yeah that's what I mean [18:48] benvie: the debugger is an *insane* amount of code [18:48] milani_: we can provide a manifest file, there they define what files they want to be packaged. [18:48] benvie: it's like 1mb minified [18:49] fangel has joined the channel [18:49] benvie: for just the js [18:49] benvie: and then it has stylesheets [18:49] benvie: and a small amount of images [18:49] dylang has joined the channel [18:49] benvie: it packs into like 3megs total [18:49] shinuza has joined the channel [18:50] benvie: it's park of the webkit build process where it's combined and stuff [18:50] benvie: but it doesn't require compilation [18:50] benvie: just changing the .pak file [18:50] thetony: are you going to modify the require() to look in the custom file? [18:50] benvie: that's easy [18:50] milani_: benvie: I was thinking on to reduce the package size and include it in node executable. [18:51] benvie: all you have to do is modify require('module')._extensions['.js'] [18:51] milani_: but as you said it requires compilation. [18:51] benvie: not necessarily [18:51] njain has joined the channel [18:51] benvie: you can pack resources into an exe or turn it into an auto unpacking one [18:52] milani_: how can I? [18:52] colinclark_ has joined the channel [18:52] milani_: benvie: forget about everything and tell me is this good or possible or not: [18:53] AdamGoodrich has joined the channel [18:53] TheFuzzball has joined the channel [18:53] milani_: we include files that user requests in a js file ( js file is dynamically generated and includes a simple function [18:53] milani_: to handle something like fs.stat , fs.exists ) [18:54] kahlin has joined the channel [18:54] milani_: and we compile it using node_js2c [18:54] Poetro has joined the channel [18:54] benvie: yeah that's how I would do it if I were to compile it [18:54] milani_: then we compile the c generated output ( like Natives.h ) as a native module and we modify require to [18:55] benvie: well here's the thing [18:55] benvie: yuo don't need to do any of that [18:55] milani_: look into this module for finding files. [18:55] benvie: adding new libs to node's libs is really easy [18:55] milani_: yes I know. [18:55] markq: can you develop in node-inspector? [18:55] benvie: you add it in like two places total [18:55] milani_: I know this. [18:55] markq: over ssh tunnel for example [18:55] markq: idk if that's normal [18:55] shinuza has joined the channel [18:55] milani_: but we should generate js file dynamically. [18:55] stafamus has joined the channel [18:55] benvie: well yeah but [18:56] artusrocha has joined the channel [18:56] benvie: once it's in the node build process the rest is basically automate. require will automatically find it first so you don't even have to do anything more [18:56] plato: Hey guys, do I need to define my prototypes before my object definition? I'm getting no method errors in lines 21 and 25: http://codepad.org/uA4KkKVy [18:57] milani_: so it requires compilation. as you said user should have a compiler then. [18:57] benvie: if you do it that way then it's pretty easy but has the compilation step [18:57] milani_: am I right? [18:57] benvie: so yeah [18:57] benvie: that's the tradeoff [18:57] milani_: hmmm. [18:57] benvie: so the other idea is [18:58] milani_: I think beside creating a clean project, it has a kind of security in it. [18:58] colinclark has joined the channel [18:58] benvie: without going into figuring out how to dynamically change a compile binary [18:58] munro: plato: yes you do, JS can hoiste the Vertex function, but at line when constructing at line 20, the prototypes haven't been attached yet, so move that after the Vertex object definition [18:58] dgasson has joined the channel [18:58] munro: s/at line when/when/ [18:58] benvie: if you have a single file with all the stuff packed then you can still provide the functionality rather easily with _third_party_main [18:58] TheFuzzball has joined the channel [18:58] benvie: so i guess [18:58] benvie: I'd provide both options [18:58] pgte has joined the channel [18:59] milani_: aha. [18:59] TooTallNate: milani_: there's 0 security in compiling the js files into the binary [18:59] milani_: yeah [18:59] benvie: cause you will lose people off the bat if they have to compile it [18:59] milani_: TooTallNate: thank you for the hint:) [18:59] thinkt4nk_ has joined the channel [18:59] plato: munro, so when the interpreter reaches line 20 for the first time, it says "Oh, gotta make a Vertex", but at that point in time, a Vertex doesn't have the prototypes attached? [18:59] thetony: just make the compilation a webservice the developer uses [19:00] milani_: TooTallNate: But if something is in executable, simple users wont investigate to change the source to see what happens;) [19:00] munro: plato: that's correct, but JS did hoist the Vertex function so that's why calling Vertex works [19:00] skomski has joined the channel [19:00] benvie: I mean that is an angle for turning it into an actual business [19:00] benvie: one of them [19:00] TooTallNate: milani_: that's just paranoia talking. let people tinker if they want [19:00] artusrocha has joined the channel [19:01] benvie: I just like it for the sheet convenience [19:01] milani_: thetony: I don't use appcelerator only because I should tell them each time I create a project. [19:01] plato: munro: so I must move my main program logic after all my object definitions? [19:01] benvie: having node.exe just work is such a nice thing [19:01] milani_: thetony: and some other people are out there that don't feel comfortable with it. [19:01] Hebo has joined the channel [19:01] robi42 has joined the channel [19:02] thetony: milani_: what if it's just a completely anonymous service? where you would do wget compiler.com/ and it responds with a download link? [19:02] benvie: https://github.com/shoes/shoes/wiki/A-Developer's-Tour-Through-The-Magic-Packager [19:02] yawNO has joined the channel [19:02] munro: plato: try it and see what happens! [19:03] plato: yeah, it works, I just am trying to understand the internals as much as possible [19:03] milani_: TooTallNate: There are sdks out there that allow users to build css js html desktop apps like appcelerator [19:04] t4nk196 has joined the channel [19:04] milani_: TooTallNate: but I can not stand projects written with them because they seems messy! [19:04] benvie: that uses a ruby implementation of tar [19:04] milani_: I want to clean the process, the directory structure and simplify it for developers and end users. [19:05] geetarista has joined the channel [19:05] `3rdEden has joined the channel [19:06] cjm has joined the channel [19:06] milani_: benvie: :) [19:06] salva has joined the channel [19:07] benvie: I am a follower of the church of accessibility [19:07] willwhite has joined the channel [19:08] jeffhorton has joined the channel [19:08] benvie: binject [19:08] thetony: milani_: couldn't you just use one written in C and compile it as a node module? or does that not work anymore either? [19:08] mikedeboer has joined the channel [19:08] thetony: one being a zipping mechanism [19:09] Schnitzel has joined the channel [19:10] milani_: thetony: yes I can. but its my problem that I don't know c that much. [19:10] munro: .. console.log("hello", "world") [19:10] milani_: benvie: does Shoes uses a similar approach as we are doing? [19:11] Hebo has joined the channel [19:12] benvie: no way more advanced [19:12] benvie: lol [19:12] thetony: milani_: http://zpp-library.sourceforge.net/ [19:12] munro: I encountered something interesting in the node repl today: `console.log)('hello', 'world'` works, is that expect behavior? :) [19:12] insin has joined the channel [19:12] thetony: this actually talks about the problem you're trying to solve [19:12] milani_: benvie: OK at leas is it similar:D [19:13] Schnitzel: Hello everybody, short question for the gurus: I'm running a nodejs Server which provides a telnet server, an Arduino connects to it. Every time a logfile of the local server is changed (with fs.watchFile) it sends a char to the Arduino. Now I want to do this from multiple Servers, but the Arduino connects only to 1 NodeJS Server. How can the NodeJS find out if a file changes on a remote server? [19:13] ryan_stevens has joined the channel [19:13] ryan_stevens: anyone had any luck using shadow-npm https://github.com/dominictarr/shadow-npm [19:14] benvie: http://ashbb.github.com/green_shoes/Shoes.html [19:14] skeptic_ has joined the channel [19:14] shinuza has joined the channel [19:14] milani_: thetony: yes it's what I want. thank you. [19:15] benvie: yeah seems similar base idea [19:15] benvie: like you can create guis and then pack it all into a binary [19:15] milani_: benvie: I mean packaging and compilation. [19:15] benvie: yeah that's part of it [19:16] milani_: aha. so the whole idea is implemented and used before. [19:16] hunterloftis has joined the channel [19:16] benvie: in ruby =D [19:16] milani_: so it's not a bad idea as thetony insists it is;) [19:16] benvie: I don't see any mention of web view stuff [19:16] dnyy has joined the channel [19:16] benvie: it's basically cairo with built in libs and a way to package it [19:16] benvie: and windowing stuff [19:17] TooTallNate: personally i think your whole packaging approach is overly-compilcated. NodObjC can package up .app bundles using the vanilla node and js files [19:18] jdeibele has joined the channel [19:18] kinginky: writing a server that needs to be able to handle multiple "operators" & "guests". guests can have 1 chat open, operators can have multiple. messages do need to be stored (at least the last 10-20) to be able to re-send on socket failure. [19:18] milani_: TooTallNate: what is your approach? [19:18] arturadib has joined the channel [19:18] benvie: I would focus on implementing something using isaacs tar compiled in and then just using a single packed file as a starting point [19:18] kinginky: please suggest methods, modules, etc. any input appreciated, because im startling to lose hope. [19:18] kinginky: im having lots of problems with scope. [19:18] thinkt4nk_ has joined the channel [19:18] TooTallNate: milani_: just dirs and files (an .app bundle is just a directory) [19:19] TooTallNate: milani_: personally i would make keeping the vanilla node a priority. nobody likes custom builds [19:19] AviMarcus: kinginky, have you used socket.io or similar ? [19:19] pendlepa2ts has joined the channel [19:19] diogogmt has joined the channel [19:20] milani_: TooTallNate: https://github.com/milani/appjs [19:20] benvie: is .app a mac thing? [19:20] kinginky: Avi: that's what ive been using, which has been working fine. i'm really having problems with scope more than anything, for instance one of the methods in my class can "see" two arrays of said class, yet one cannot "see" them (they appear empty) [19:20] Brandon_R has joined the channel [19:20] TooTallNate: benvie: ya [19:20] milani_: I don't want to change node. I'm just using its third_party_main [19:21] Axsuul has joined the channel [19:21] TooTallNate: milani_: right, but that's still a custom build [19:21] kinginky: i have a class (extendning the Base.js class) called MsgLive. MsgLive has two arrays, operators and guests. MsgLive also has several methods, some of which report "seeing" the arrays fine, while another method may not "see" them (not undefined, but empty) [19:21] benvie: actually what I would do [19:21] TooTallNate: milani_: there's no difference between third_party_main and a .bat file (or .sh file) that calls $ node main.js [19:22] AviMarcus: kinginky, people might need to see some code to help. Sorry, I gotta go. [19:22] milani_: TooTallNate: technically there is no difference I know [19:22] milani_: TooTallNate: take the case of writing a node app. you develop everything as you did before [19:22] kinginky: Avi: damn, thanks man ur the first to offer help. i'll post the pastebin in here if u have a few more minutes/someone else can take a quick look [19:22] kinginky: Avi: thanks again [19:23] dve has joined the channel [19:23] milani_: but after you finished your job, you just call a cli command and it will leave you a simple package. [19:23] milani_: that's all I'm doing:) [19:23] AviMarcus: kinginky, you can try highlighting me -- full name -- when you post something. Although I'm somewhat new to node. [19:23] benvie: use the whatever [19:23] benvie: the existing extension package thing [19:23] milani_: custom node is my job. developers won't see that. [19:23] milani_: benvie: then? [19:24] benvie: since it's already specifically made for combining html/js/css into a file [19:24] benvie: I dunno but it's better to use existing standards when they exist [19:24] benvie: that would mean [19:24] kinginky: http://pastebin.com/ac6jph4a [19:24] benvie: you have the ability to load browser extensions as apps [19:24] kinginky: AvIMarcus, pastebin: http://pastebin.com/ac6jph4a and thanks again man :] [19:25] milani_: benvie: ok. thank you. what thetony introduced was good. I should go deeper in that. anyway thank you. [19:25] kinginky: if anyone wants to take a gander and help a poor soul with a seemingly abstract problem, i could really use your help [19:25] kinginky: i just pasted the pastebin here [19:26] kinginky: basically, my MsgLive.rebuildArrays() method doesn't see aything in this.guests or this.operators [19:26] kinginky: but when an operator/guest connects, it logs the arrays just fine. [19:27] kinginky: coffeescript: http://pastebin.com/ac6jph4a [19:27] kinginky: javascript: http://pastebin.com/We2JGdmJ [19:27] benvie: lol if you have chrome [19:27] benvie: go to this chrome://extensions [19:27] benvie: pack extension [19:28] shinuza has joined the channel [19:28] hackband has joined the channel [19:29] TheFuzzball has joined the channel [19:29] langworthy has joined the channel [19:30] benvie: npm install crx [19:30] kinginky: if i have classes under a class, i.e. a MsgLive class and then a MsgLive.Client class, do I need to export the child class i.e. exports.MsgLive.Client = MsgLive.Client [19:30] kinginky: or are those exports when I do exports.MsgLive = MsgLive [19:30] astropirate has joined the channel [19:30] tijmencc has joined the channel [19:31] Brandon_R: hi [19:31] s0urce has joined the channel [19:31] s0urce: any1 knows how modules like express decides between get request and static file requests like client side javascript ,css or images? [19:32] milani_: benvie: ! [19:32] benvie: lol use that [19:32] recycl3 has joined the channel [19:32] milani_: :) [19:33] merlin83 has joined the channel [19:33] milani_: really? [19:33] benvie: or at least maybe something dervived from it [19:33] benvie: it needs like [19:34] benvie: it needs to respect package.json as well as/instead of the browser stuff [19:34] benvie: it's a small amount of code [19:34] sechrist: is there a simple way to resolve // in urls to / in express before the URL router? [19:34] benvie: at least it can be learned from [19:35] Brandon_R: hey guys [19:35] milani_: yeah [19:35] Brandon_R: i have a lisensing question [19:35] Brandon_R: am i allowed to statically link libuv in my program? [19:35] RORgasm has joined the channel [19:35] milani_: what does that private key do? does it protect the package from being edited by third party ones? [19:36] richcollins: How can I get a list of the keys in the scope for a file (module)? [19:36] benvie: it's for signing it and encrypting it [19:36] richcollins: global? [19:36] benvie: so you can distribute it securely [19:36] boehm has joined the channel [19:37] milani_: benvie: this.loadContents = function(cb) { [19:37] milani_: var command = "zip -qr -9 -X - . -x key.pem" [19:37] richcollins: ah it looks like objects added to global are visible from other modules [19:38] Swaagie has joined the channel [19:38] benvie: can replace that with node's gzip easily enough [19:38] ryan_stevens has joined the channel [19:39] dreen has left the channel [19:39] PPaul has joined the channel [19:39] richcollins: Is there any way to add properties only to the current module? [19:39] richcollins: So this would work: aModule.someProperty = "someValue" [19:39] richcollins: console.log(someProperty) [19:40] luigy has joined the channel [19:40] igl has joined the channel [19:40] benvie: I wonder why he's using zip and using openssl frmo spawn [19:41] benvie: when 5 lines below it he uses crypto [19:41] benvie: so he obviously knows hot to use modules [19:41] totallymike has joined the channel [19:41] disappearedng has joined the channel [19:41] dodo_ has joined the channel [19:42] milani_: because node gzip can not create an archive. [19:42] Vespakoen has joined the channel [19:42] milani_: each file should be compressed then packaged into a zip file. but node gzip only inflates a string. [19:43] tttthet has joined the channel [19:44] SamK1975 has joined the channel [19:44] isao has left the channel [19:46] benvie: ah so it lacks the file format spec, I imagine someone's implemented that [19:46] arturadib has joined the channel [19:46] milani_: adm-zip [19:46] polardude has joined the channel [19:47] benvie: node-native-zip [19:47] richcollins: Looks like it's not "this" either [19:47] PPaul has joined the channel [19:47] richcollins: Anyone know how to get a reference to the object that contains the "module" property within a file? [19:48] sadjow has joined the channel [19:48] Brandon_R: am i allowed to statically link libuv in my program? [19:48] milani_: benvie: Unzipping is more complex because of all the different compression algorithms that you may encounter in the wild. So it's not covered. Use existing libraries for that. [19:48] milani_: :)) [19:49] milani_: node-native-zip says! [19:49] wilmoore has joined the channel [19:49] Tijmen has joined the channel [19:49] benvie: well I mean if you're writing stuff which you will be unzipping [19:49] benvie: but looking at this [19:50] benvie: it allows you to do stuff like archive.addFiles([ { name: "images/sam.jpg", path: "./test/images.jpg" } [19:50] milani_: ok it creates zip files. but we need unzipping. [19:51] sadjow has left the channel [19:51] benvie: oh I thought it did [19:52] trbotime has joined the channel [19:53] benvie: I've spent way too much time making various buffer classes recently, I need to not do data lol [19:53] joshontheweb has joined the channel [19:55] milani_: ok I'm going to put my things together. I will use adm-zip for now and zip files upon user request ( manifest ) [19:55] jsulak has joined the channel [19:55] milani_: and I build a loader. [19:56] chasefarmer has joined the channel [19:56] benvie: it sure would be awesome to build s zip library using one of these nifty tools [19:56] milani_: yes. later we can find a better tool or file format. [19:57] milani_: I care about wrapping zipping stuff so we can change the underlying modules any time. [19:57] milani_: ;) [19:57] benvie: yeah [19:58] jsurfer has joined the channel [19:58] milani_: do you have gtalk account? [19:59] NetRoY has joined the channel [19:59] tomasztomczyk has joined the channel [20:00] TheJH has joined the channel [20:00] TheFuzzball has joined the channel [20:01] dgathright has joined the channel [20:02] jdeibele has joined the channel [20:02] erikzaadi has joined the channel [20:03] LarsSmit has joined the channel [20:03] LarsSmit1 has joined the channel [20:04] LarsSmit1 has joined the channel [20:05] rybnik has joined the channel [20:05] Brandon_R: yes [20:05] jryans has joined the channel [20:05] Neil___ has joined the channel [20:05] jimmysparkle has joined the channel [20:06] redir_ has joined the channel [20:07] trbotime has joined the channel [20:07] redir_ has joined the channel [20:07] Wizek has joined the channel [20:07] kevwil has joined the channel [20:08] trivol has joined the channel [20:09] QiBala has joined the channel [20:11] guidocalvano has joined the channel [20:11] warz has joined the channel [20:11] warz has joined the channel [20:11] admc has joined the channel [20:12] Renegade001 has joined the channel [20:13] rybnik has left the channel [20:13] orlandovftw has joined the channel [20:13] erikz has joined the channel [20:14] elguapo99 has joined the channel [20:14] delusr has joined the channel [20:15] `3rdEden: isaacs is there a sync api npm installations? [20:15] rybnik has joined the channel [20:15] isaacs: `3rdEden: npm has no sync api [20:15] Billbad has joined the channel [20:15] epokmedi1 has joined the channel [20:15] robi42 has joined the channel [20:16] `3rdEden: isaacs i'll hack around it than with sync child processes =/ [20:16] Trindaz has joined the channel [20:16] blendedbychris: socket.io + eval() = hahaha [20:18] isaacs: `3rdEden: you could also just use the async api ;) [20:19] `3rdEden: isaacs that did cross my mind, but as it's just for a command line application it's not that useful :) [20:21] meelash has joined the channel [20:21] `3rdEden: hmz, nvm i'll got with the async api anyways.. i'll just display and error msg [20:22] argami has joined the channel [20:24] artusrocha has joined the channel [20:24] Byrox has joined the channel [20:25] tg has joined the channel [20:25] dragansah has joined the channel [20:27] crescendo|work has joined the channel [20:27] crescendo|work has joined the channel [20:28] s0urce has left the channel [20:28] mattgifford has joined the channel [20:29] argami has joined the channel [20:30] langworthy has joined the channel [20:30] PPaul has joined the channel [20:30] Aria has joined the channel [20:31] spcshpopr8r has joined the channel [20:31] Brondoman has joined the channel [20:31] argami_ has joined the channel [20:32] Brondoman: quick question: Anyway to get node_mdns to compile on Windows in order to run hook.io on a Windows machine? [20:32] elguapo99_ has joined the channel [20:32] guidocalvano has joined the channel [20:33] Brondoman: ANy ideas? [20:34] MrTopf has joined the channel [20:34] argami has joined the channel [20:35] lazyshot has joined the channel [20:35] wink_: brondo: mdns depends on libdns_sd, if that can be built on windows then a port is probably pretty easy and just getting everything built [20:35] adrianF has joined the channel [20:35] Brondoman: ah. [20:35] wink_: if not, you're probably SOL unless you reimplement dns_sd on win32 [20:35] Brondoman: ok. [20:35] Brondoman: crud. :-( [20:36] tomasztomczyk has joined the channel [20:36] wink_: that said, if you're absolutely stuck using windows, you may want to consider cheating and running a vm on your windows host [20:37] Brondoman: yah. that's what i'm doing now. running TinyCoreLinux on virtualbox [20:38] Brondoman: I really want to be able to use hook.io to create a simple ESB across our enterprise and across different systems. [20:39] mcluskydodallas has joined the channel [20:39] Brondoman: Thanks for the info! [20:39] Brondoman: l8r [20:39] wink_: you probably could, but you'd have to do the same thing the node port did, which is to reimplement whatever functionality is missing on win32, which in this case would be the mdns lib [20:40] lperrin has joined the channel [20:40] yogig has joined the channel [20:40] djbell has joined the channel [20:43] PElshoff has joined the channel [20:43] bergie_ has joined the channel [20:44] Renegade001 has joined the channel [20:44] chasefarmer has joined the channel [20:47] IlskenLabs has joined the channel [20:48] ekryski has joined the channel [20:48] davemo has joined the channel [20:49] patcito has joined the channel [20:49] palmerek_ has joined the channel [20:51] PPaul has joined the channel [20:51] TheDahv has joined the channel [20:52] Trindaz: creationix: are you available for a Step question? [20:53] Trindaz: Yesterday we talked about being able to use Step to be able to 'wrap' calls to request so that it behaves like a synchronous function - my attempt at that hasn't worked [20:53] lduros has left the channel [20:54] thetony: Trindaz: was this the multiple requests question where you were asking about passing a reference to the original request to each async new request? [20:54] thetony: (if that makes sense) [20:54] Trindaz: thetony: yes [20:54] thetony: do you have your code? [20:54] Trindaz: thetony: I actually haven't used Step yet, I used caolan/async, but it didn't work [20:54] thetony: [somewhere i can check it out] :) [20:54] thetony: let's take a look at it [20:55] wankdanker: wink_: hi! i got binding.gyp working for node-odbc [20:55] Trindaz: thetony: my work: https://gist.github.com/2230431 [20:55] jgaui has joined the channel [20:56] Swaagie: join #neo4j [20:56] Swaagie: oeps :P [20:56] thetony: how is it behaving and how are you expecting it to behave? [20:56] Trindaz: for some reason I assumed that .series would 'hold' control flow until all it's functions had completed, but that's not the case, so now i'm confused - it it's asynchronous too, then how was it a candidate solution to make request synchronous? [20:56] nateps has joined the channel [20:57] mauritslamers has joined the channel [20:57] scientes has joined the channel [20:57] Trindaz: (did I answer your question?) [20:57] thetony: Trindaz: yes, give me a second to look at the async page again [20:58] CIA-19: node: 03Mikael Bourges-Sevenier 07master * r67fc1da 10/ (3 files in 3 dirs): typed arrays: add Uint8ClampedArray - http://git.io/LMnBEw [20:58] thetony: Trindaz: so the series thing will run them all async IE not block your application but each function you pass will run after the one prior finishes [20:58] cedric303 has joined the channel [20:59] thetony: if you want them to block within that application then you should just call the functions, no need for async [20:59] cedric303 has left the channel [20:59] Trindaz: thetony: but that's the problem - my call to request is asynchronous too - I *need* to wait until it has completed before proceeding [21:00] thetony: the problem async corrects for you is running all of your requests at once - and then finally being able to close the request [21:00] timoxley has joined the channel [21:01] Trindaz: In this simple example it seems silly to have that requirement - why not just 'eventify' my code? I was able to do that yesterday for my simple example, however my application walks a tree of objects, each object possibly requiring multiple calls to async, and when they do I need to guarantee that request has completed before continuing my walk of the tree [21:01] thetony: Trindaz: ahh, so this is where the async stuff gets tricky - all of the functions you pass in param 1 will run in series, AND then the second parameter will be called [21:01] vicapow: thetony: also helps clean up your code [21:01] tvw has joined the channel [21:01] vincible has joined the channel [21:01] vicapow: it's ugly to have callback inside of callback inside of callback [21:01] thetony: vicapow: good point [21:02] devdazed: hi all, any idea why map and forEach dont work on an array that is created like this: new Array(50) [21:02] pizthewiz has joined the channel [21:02] Trindaz: thetony: It's kind of cool that I'm guaranteed that the final arg (the callback function) will only be called after all functions are complete, but I get that feature using request by itself with the callback function I pass to it to complete once the response is returned from the server. So from where I sit now it seems I'm back to square one - async and Step only help out with managing the concurrency of asynchronous functions, [21:02] thetony: Trindaz: so you'd do async.series([func1,func2,func3],function(e,r){ /* write to and close socket here */ }); [21:02] Trindaz: usly [21:03] bnoordhuis: devdazed: map and forEach skip over undefined values [21:03] devdazed: bnoordhuis: thanks [21:03] vicapow: devdazed: maybe what your interested in is _.range(10).each... [21:03] Trindaz: thetony: i don't understand how your suggestion is different to what i've written already [21:03] devdazed: vicapow: not using underscore [21:03] Inoperable has joined the channel [21:03] vicapow: devdazed: and not interested in using it? [21:04] thetony: Trindaz: it differs in that you're expecting the sync_function to return a result, it's not going to so you need to pass to it a reference to your socket that you'd use and close in your callback function rather than trying to return the 'results' from the async [21:04] devdazed: vicapow: not really, its a lightweight app and I don't see a reason to import an entire library that will be used once for one function [21:06] Trindaz: thetony: I think understand your argument (don't try to get the callback function you give to async to return something, just get it to do some final work asynchronously) - but that doesn't help. If I was happy to just have some work performed asynchronously then I would have just defined it in the callback I gave to request [21:06] diogogmt has joined the channel [21:07] Trindaz: I think I might have to face the more difficult (yet more 'node') problem of event-ifying my whole tree walk, using a series of callbacks to make sure each call to request is completed before navigating to any nested levels of the tree [21:07] Trindaz: thetony: brb - thanks very much for your help [21:07] thetony: Trindaz: try this example - i'll write one up [21:07] chrishyle has joined the channel [21:07] _unary has joined the channel [21:08] Venom_X_ has joined the channel [21:08] recur has joined the channel [21:08] jsulak` has joined the channel [21:09] halfhalo has joined the channel [21:10] Trindaz: thetony: thanks (eagerly waits) [21:10] bengl has joined the channel [21:11] mattgiff_ has joined the channel [21:12] roger_raymond has joined the channel [21:13] ivan` has joined the channel [21:13] theCole has joined the channel [21:13] thetony: Trindaz: https://gist.github.com/2230607 [21:14] antz29 has joined the channel [21:14] rlidwka: Trindaz: node-fibers provide sync calls for node btw [21:15] thetony: Trindaz: when you run that you should see it run the f1 request 3 times in series (it will wait 1500 between requests) and then at the end you will see it print out what is passed as the sockRef. so in that callback function is where you will process the results of the functions you passed async, pass the results to the user, and then finally close the request [21:15] vincible_ has joined the channel [21:15] michaelhartau has joined the channel [21:16] pgte has joined the channel [21:17] denom has joined the channel [21:17] thetony: if you change that async.series to async.parallel then you will see all 3 f1's run at the same time and then the callback called at the very end [21:18] hunterloftis: Managing cloud deployments: What do you guys use? We have a collection of homebrew scripts but I'd like to start using something legit. Considering puppet, although I hate that it's Ruby. [21:19] dgathright has joined the channel [21:19] qjcg has joined the channel [21:20] mr_smith: chef worked better for us. [21:20] artusrocha has joined the channel [21:20] thetony: mr_smith: link? [21:20] hunterloftis: mr_smith: Any particular comparison between the two, esp regarding node deployments? [21:20] Radium has joined the channel [21:20] jamesbathgate has joined the channel [21:21] mr_smith: http://www.opscode.com/chef/ [21:21] mr_smith: i haven't used Chef for node, only for enterprise java deployments. [21:21] mr_smith: just learning node. [21:22] wingie: is there a way to check when VowsJS has finished running the tests programmatically? [21:22] rlidwka: for node processes there are fleet and haiku [21:22] delusr has left the channel [21:22] dgathright has joined the channel [21:23] TheDahv has left the channel [21:23] maxogden: haibu [21:23] hunterloftis: rlidwka: fleet? [21:23] maxogden: hunterloftis: http://search.npmjs.org/ [21:24] brianseeders has joined the channel [21:24] rlidwka: hunterloftis: https://github.com/substack/fleet [21:24] josh-k has joined the channel [21:25] jrundquist has left the channel [21:25] Trindaz: thetony: forgive me - i can't see how your solution helps me. It looks to me like your example is just showing how that final function is guaranteed not to be called until all other functions are completed in order [21:25] Trindaz: rlidwka: thanks, checking it out now [21:26] hunterloftis: Thanks for the fleet & haibu info but I don't think they really equate to puppet/chef... which are more interested in provisioning & deploying resources to servers [21:26] thetony: Trindaz: it does, but within that final function is where you'll consolidate the results and give them to the end user - you don't need to block your application while everything happens in order [21:26] Trindaz: thetony: so basically you can argue it is synchronous in that the final callback won't run until all other functions are complete, but by that stage it doesn't help me because there is no way of getting it's result in a synchronous way, besides just using console.log, or having some other timed interval to check another object where it would save its result [21:27] hgg has joined the channel [21:27] maxogden: hunterloftis: look at substacks other deployment related modules : propagit, seaport, airport, etc. they all tie together modularly and offer provisioning + deployment [21:27] hunterloftis: maxogden: thanks, will do [21:28] Trindaz: thetony: we might be having a communication problem. The user has to wait until all requests are finished, *and* some requests are dependent on the response for earlier requests, that's why the requirement for synchronous calls, and why i suggested rewriting my walk of the object containing instructions on when to do requests to use inner callbacks, rather than trying to force the synchronous issue here [21:28] thetony: Trindaz: i may be misremembering the requirement. iirc the requirement is to run a bunch of subrequests (after a client has requested some info), process those subrequests, write the results out to the user, and then close the connection [21:28] graeme_f has joined the channel [21:29] kbhit has joined the channel [21:29] Trindaz: thetony: that's correct, but the subrequests are dependent on each other. if it weren't for that dependency then my very first attempt probably would have worked to - just pass in a reference to res as the callback function for request and have it call res.end and be done with it! [21:29] Trindaz: thetony: thanks for all your time on this [21:30] thetony: Trindaz: no problem, that's correct - so the problem here is how do you pass the data from one function to the next in the async.series ? i'm not sure i understand how the async.series isn't solving the problem [21:30] JoshRWeinstein has joined the channel [21:30] langworthy has joined the channel [21:30] omolina has joined the channel [21:30] JoshRWeinstein: anyone have experience launching a node app on heroku? [21:30] JoshRWeinstein: using postgres [21:31] jimmysparkle has joined the channel [21:31] vguerra has joined the channel [21:31] IlskenLabs has joined the channel [21:31] tlrobinson has joined the channel [21:32] elguapo99 has joined the channel [21:32] Trindaz: thetony: i have an array with an unknown number elements, each of those with an array of indeterminate number of functions that i want to use with async. if i can't 'synchronize' my calls to request, then I have to rewrite my code that iterates all these arrays to use internal callbacks, which is going to be a pain because of all the other logic included. [21:32] briancray has joined the channel [21:32] Trindaz: if i could just make request synchronous (as urllib2 is in Python) then the port of my code would have been *much* easier [21:32] tlrobinson has joined the channel [21:33] thetony: oh i see, inside of your sync'd functions you have asynchronous functions that you need to return results [21:33] thetony: prior to the next sync function kicking off, and it's not waiting for that [21:33] Trindaz: thetony: yes [21:34] thetony: async doesn't solve that problem - i don't think any of us from yesterday understood that part :) [21:35] DraftDay: aaaahh i can't get a flipping example to work [21:35] thetony: Trindaz: let me think about that, that's another kind of problem [21:35] DraftDay: fails [21:36] DraftDay: it connected once in firefox but then starting looping errors [21:36] RORgasm has joined the channel [21:36] milani_: DraftDay: what is your server? [21:36] DraftDay: is ther some magic i have to do cross domain [21:36] milani_: is it a nginx proxy ? [21:36] thetony: Trindaz: what type of request are you using? an http request? [21:36] DraftDay: the app is on dev.draftday.com [21:36] DraftDay: that's not public [21:37] antz29: ACTION is amazed at how much socket.io support goes on in here and away from #socket.io ;) [21:37] DraftDay: well shit, i'll go there then [21:37] milani_: DraftDay if you use older nginx servers, you can not use websockets behind subdomains [21:37] isaacs has joined the channel [21:37] DraftDay: it's apache2 [21:37] antz29: :) [21:38] milani_: oh I think that's the problem. use an straight address. it will work. [21:38] antz29: @DraftDay no worries, just noticed quite a few people talking socket.io today [21:38] milani_: for example: draftday.com:3000 [21:38] milani_: if node is listening to this port. [21:38] DraftDay: it's not, it's on a separate server subdomain [21:38] DraftDay: on 80 [21:38] eugs51 has joined the channel [21:39] DraftDay: it likes sits there and times out90 [21:39] DraftDay: 90% of the time [21:39] DraftDay: while trying to get the js [21:39] EhevuTov_ has joined the channel [21:40] ljharb has joined the channel [21:40] DraftDay: so is it bad to have a node.js server on a different domain than the web app [21:41] couhc has joined the channel [21:41] DraftDay: the app is php site, that i need to update some player stats to [21:41] couhc has left the channel [21:41] Nss has joined the channel [21:41] DraftDay: the main site is already sitting behind a hardware load balancer [21:41] arturadib has joined the channel [21:41] DraftDay: so i'm trying to setup node along side it [21:41] DraftDay: driving me nutz [21:42] thetony: DraftDay: you can portforward draftday.com port 3000 to port 80 on whatever machine node is on [21:42] thetony: then you don't need the subdomain [21:42] DraftDay: ok i can try that [21:44] karellen has joined the channel [21:44] DraftDay: if i use node.js and don't have the same origin, is that an issue? [21:44] tracker1: DraftDay, the bigger issue is that a differing port is considered a different domain as far as JavaScript's security model on the client (see JSONP). You are better off having an authorative server that makes reverse proxy requests to the other server... [21:45] DraftDay: even if i use th esame domain and change the port, that wouldn't be the same origin [21:45] tracker1: DraftDay, If you need Web Sockets, it should probably be node as origin, and pass unknown requests to the PHP host server.. [21:45] tracker1: DraftDay, correct, different ports are different origin. [21:46] brainss has joined the channel [21:46] tracker1: DraftDay, the most you can do via different origins is JSONP requests. [21:46] tracker1: (in the browser) [21:46] DraftDay: i guess i'm getting lost in setting this all up to look like the same origin [21:47] DraftDay: rtfm on the load balancer i guess [21:47] dwhittle has joined the channel [21:47] DraftDay: if i have to make everything work on the same port [21:47] DraftDay: to use a socket [21:47] tracker1: DraftDay, if you have a load balancer that can split requests on the same domain based on the style of path, that will work. [21:47] bhelx: DraftDay: I think you are supposed to get the js file FROM your node server [21:48] tracker1: also, if you need websockets, your load balancer will need to support them. [21:48] DraftDay: should i do like draftday.com/node/ [21:48] bhelx: not statically [21:48] tracker1: DraftDay, you could do that... reverse-proxy for applications on a domain is pretty common. [21:48] DraftDay: a thought, if i'm serving the js file from node1.draftday.com and that where the node server is, but the php page is loaded via www.draftday.com, would the js play nice as same origin? [21:49] automata has joined the channel [21:49] tracker1: DraftDay, not usually. [21:49] DraftDay: i can dram [21:49] DraftDay: dream [21:49] thetony: you might also be able to do a modrewrite on the apache server to the node server [21:49] bhelx: DraftDay: https://github.com/LearnBoost/socket.io/blob/master/lib/static.js#L120 [21:49] EyePulp: dram a little dram. [21:49] tracker1: DraftDay, IIRC, IE supported some settings for this, but it was hackish, and require configuration. [21:50] mikedeboer has joined the channel [21:50] tracker1: EyePulp, do not drive while taking dram. [21:50] thetony: DraftDay: you could try something like this too: http://arguments.callee.info/2010/04/20/running-apache-and-node-js-together/ [21:50] DraftDay: thx [21:51] thetony: as tracker1 highlighted earlier, i'm not super familiar with socketio so i'm just making blind suggestions to try [21:51] karellen has joined the channel [21:51] DraftDay: forward the port with mod_rewrite, i will try [21:52] robi42 has joined the channel [21:52] tracker1: thetony, When you want to support socket (websocket) communication, the server that the user connects to needs to know how to "upgrade" the socket.. most proxies, and load balancers don't, so NodeJS should be the front end app, and proxy unknown requests to the other server. [21:53] ramitos has joined the channel [21:53] thetony: tracker1: should his node server then sit in between the client and the load balancer? [21:53] tracker1: afaik, Node and the next IIS (winserver 8) are about the only options in this role. [21:53] thetony: if it's only failing 90% of the time it would indicate the load balance might be part of the problem [21:53] tracker1: thetony, depends on how the load balancer works. [21:54] tracker1: socket.io has fallback methods to polling, and longscrolling iframes iirc... [21:54] thetony: or at least some mechanism between his client and server is failing [21:54] DraftDay: none of it is working, i'm failing at even serving the js lib [21:55] tracker1: if the "load balancer" is acting as an http proxy, then it probably won't upgrade a socket... if it's just a transport tunnel, it may. [21:55] DraftDay: well first try at socket.io sucked [21:55] tracker1: DraftDay, sorry it's been rough.. sockets in web apps is a bit of a pain in some contexts... [21:55] DraftDay: so i'm guessing socket.io starts up a webserver to serve the js file [21:55] maxogden: tracker1: check out https://github.com/bumptech/stud + https://github.com/mikeal/stud-proxy [21:55] tracker1: DraftDay, generally it's tightly coupled to the node.js server it's running from. [21:55] DraftDay: what if i just throw the js file statically somewhere [21:56] DraftDay: server the js from apache instead of node [21:56] tracker1: DraftDay, that gets the file out, but may well still have issues serving other files. [21:56] tracker1: or the socket/rpc requests themselves. [21:57] bhelx: DraftDay: are you getting a static client js file? I thought socket.io node server was supposed to build it [21:57] DraftDay: [21:57] DraftDay: i tried that [21:57] DraftDay: then i tried the cdn [21:57] DraftDay: but i guess the cdn is deprecated [21:58] bhelx: why the explicit version? [21:58] DraftDay: i was just trying everything [21:58] DraftDay: first i tried without the version [21:58] bhelx: from that line i linked earlier, it looks like the server builds the appropriate js client file for the given transports [21:58] maxogden: when you attach socket.io hijacks your node server's http handler and handles requests to /socket.io [21:58] bhelx: ^ right [21:59] jxson has joined the channel [21:59] tracker1: DraftDay, could you put the node.js server on the net, without the load balancer etc in front? and use one of the proxies (within node) that maxogden mentioned? [21:59] DraftDay: yes [21:59] tracker1: DraftDay, that is likely your best bet... [21:59] DraftDay: i would just have to figure out how to release this live, since draftday.com is fairly busy [21:59] DraftDay: live site [21:59] DraftDay: fantasy sports betting [22:00] maxogden: like unicorn races? [22:00] DraftDay: i'd have to drive to the datacenter and plug a rack in [22:00] maxogden: i put 5,000 quid on fantasia the narwhale [22:00] tracker1: DraftDay, here's another to consider... https://github.com/nodejitsu/node-http-proxy [22:00] jsulak` has left the channel [22:01] DraftDay: right now our site is getting killed in IO, because we are just polling data which kicks off intesive queries each poll [22:01] blendedbychris: how can i run "emit" on a node (socket.io) from another application (or even from another web request) [22:01] DraftDay: and we are growing 100 users a day so i need to get something push in 2 weeks [22:01] DraftDay: <-- shoots himself in head [22:02] vincible has joined the channel [22:02] dannyamey has joined the channel [22:02] konobi: DraftDay: quick... to the cloud! [22:03] DraftDay: i've thought about it, then i have have to justify the costs with the boss [22:03] maxogden: availability is a pretty good justification [22:04] tracker1: blendedbychris, well, you can have other sockets bound listening for incomming traffic, or file system watchers/handlers... [22:04] DraftDay: yeah i ran into node.js when the twisted chat server i made started to fail on the site [22:04] DraftDay: so they boss is complaining [22:04] FredC has joined the channel [22:04] DraftDay: well off to read thanks for the inputs [22:04] tracker1: blendedbychris, or you could use a message queue server. [22:05] DraftDay: 0mq [22:05] blendedbychris: tracker1: hrmm… can you explain option 1? [22:06] thetony: Trindaz: what kind of async requests are you making insde of your function? [22:06] blendedbychris: i need php to somehow run "emit" [22:06] JSONB has joined the channel [22:06] tracker1: blendedbychris, have a server/socket TCP listening for connections, then have the other systems push into node. [22:06] levi501d has joined the channel [22:06] joshfinnie has joined the channel [22:07] tracker1: blendedbychris, you can do more than just a single http server in a node process. [22:07] indy3 has joined the channel [22:07] blendedbychris: hrmm… i mean i get the concept i think but i don't know how php is going to run js [22:08] maxogden: blendedbychris: make an http api in node that php calls [22:08] blendedbychris: ah okay [22:08] DraftDay: and call it via ajax [22:08] bhelx: blendedbychris: or use ipc or tcp socket if local [22:08] SubStack: or there's http://bergie.iki.fi/blog/dnode-make_php_and_node-js_talk_to_each_other/ [22:08] blendedbychris: SubStack: ooh [22:08] maxogden: php: hey node wanna come over and play video games together [22:08] garann has joined the channel [22:09] bhelx: lol [22:09] maxogden: node: im too busy smoking cigarettes in the bathroom and making fun of old web frameworks [22:09] Country has joined the channel [22:09] dve has joined the channel [22:10] jsurfer has joined the channel [22:11] pgte has joined the channel [22:13] shinuza has joined the channel [22:13] karellen has joined the channel [22:13] karellen has joined the channel [22:13] sammmy: Does Node.js support quasi-literals? [22:13] sammmy: Specifically... [22:13] sammmy: Does Node.js's JS engine (V8) support quasis? [22:15] caolanm has joined the channel [22:15] dylang_ has joined the channel [22:15] maxogden: js doesnt have interpolated templating [22:16] maxogden: but there are approximately 9 billion third party modules that provide such functionality [22:18] average_drifter has joined the channel [22:19] Renegade001 has joined the channel [22:19] PPaul has joined the channel [22:20] benvie: quasis are syntax level too though [22:20] owen1: SubStack: thanks. i'll take a look at those packages [22:20] lzskiss has joined the channel [22:21] brainss has left the channel [22:21] jesusabdullah: what are quasis? [22:21] jesusabdullah: "quasis" sounds like a type of zebra [22:21] jesusabdullah: ah [22:21] jesusabdullah: I'm thinking of quaggas [22:21] jayne has joined the channel [22:21] jesusabdullah: but that's what I think of! [22:21] argami has joined the channel [22:21] jesusabdullah: Does V8 support quaggas? [22:22] benvie: http://wiki.ecmascript.org/doku.php?id=harmony:quasis [22:22] SubStack: > (function (s, vars) { return s.replace(/(^|[^\\])\$(\w)/g, function (_, x, v) { return x + vars[v] }) })('beep $x i am a $y', { x : 'boop', y : 'computer' }) [22:22] SubStack: 'beep boop i am a computer' [22:22] SubStack: easy to roll your own [22:22] tvw has joined the channel [22:22] jesusabdullah: wait [22:22] jesusabdullah: you mean util.format ? Which console.log uses? [22:22] benvie: it's more embedded [22:22] benvie: but yeah [22:23] jesusabdullah: console.log('beep %s i am a %s', 'boop', 'computer'); ? [22:23] jesusabdullah: CLOSE ENOUGH [22:23] sammmy: Duude!!!!!!!...nodemon ignore files failf or me. :\ [22:23] kevwil has joined the channel [22:23] SubStack: IT'S NOT THE SAME WAH WAH WAH [22:23] benvie: tthe benefit is that you don't run the risk of malformed input doing stuff [22:24] jesusabdullah: sure [22:24] rtgibbons has joined the channel [22:24] rlidwka has joined the channel [22:24] benvie: and just more concise, which is nice [22:26] tommyvyo has joined the channel [22:27] rambocoder_ has joined the channel [22:27] owen1: is there a goood ping library? https://github.com/danielzzz/node-ping ? [22:27] owen1: (ping if a site is alive) [22:29] karellen has joined the channel [22:30] plato: I am trying to debug an infinite loop [22:30] plato: Is there a way to sleep or wait [22:30] niftylettuce: anyone know of module that utilizes uglifyjs to auto mangle JS files? e.g. like express middleware? [22:30] langworthy has joined the channel [22:30] plato: my console.log is spitting out so much information that it's filling up my terminal buffer [22:31] context: niftylettuce: the search.npmjs.org site shows you what other packages depend on a package [22:31] plato: I just want to be able to hit control-C after one or two loop iterations [22:31] niftylettuce: context: yea i did [22:33] niftylettuce: I wonder if this still works https://github.com/JakeWharton/uglify-js-middleware [22:33] niftylettuce: hmm gonna try [22:33] dennisjbell has joined the channel [22:34] shinuza has joined the channel [22:34] MrTopf has joined the channel [22:35] timoxley: plato setTimeout? [22:36] karellen has joined the channel [22:36] PPaul has joined the channel [22:36] timoxley: plato or put a 'debugger' statement in and use node --debug ./app.js [22:36] thinkt4nk has joined the channel [22:39] timoxley: owen1 you should be able to write your own 'ping library' pretty easily. use http.head [22:40] yaymukund has joined the channel [22:47] tttthet has joined the channel [22:47] karellen has joined the channel [22:47] karellen has joined the channel [22:47] owen1: timoxley: looking into this. thanks@ [22:48] paulwe has joined the channel [22:48] qubit[0|1]: xvfb for the win! [22:50] PPaul has joined the channel [22:50] crescendo|work has joined the channel [22:50] crescendo|work has joined the channel [22:50] ehazlett has joined the channel [22:50] owen1: timoxley: is it part of http://nodejs.org/api/all.html#all_class_http_server ? [22:51] c_t_montgomery has joined the channel [22:51] DraftDay: oh you know what, i got it working [22:52] Wa has joined the channel [22:52] DraftDay: i had a proxy running locally to inspect requests as i dev, and i shut it off and the websocket connected [22:52] DraftDay: son of a bitch [22:53] warz has joined the channel [22:53] warz has joined the channel [22:54] Naked has joined the channel [22:55] karellen has joined the channel [22:55] karellen has joined the channel [22:57] dragansah has joined the channel [22:58] zivester has joined the channel [22:58] jj0hns0n has joined the channel [22:59] kyledr has joined the channel [22:59] ag4ve has joined the channel [23:01] whaley has joined the channel [23:02] evilnate has joined the channel [23:03] devaholic has joined the channel [23:03] ag4ve: any obfuscation libraries that can run under node - ie, to be run in a build script? [23:03] PPaul has joined the channel [23:03] ag4ve: i see this: http://stackoverflow.com/questions/194397/how-can-i-obfuscate-javascript but all the links looked like web apis that do it [23:03] argami has joined the channel [23:05] benbro has joined the channel [23:05] thinkt4nk_ has joined the channel [23:05] Corey has left the channel [23:05] benbro has left the channel [23:06] ctp6360 has joined the channel [23:06] evilnate: hello? [23:08] maxogden: yes this is dog [23:08] brianseeders has joined the channel [23:08] evilnate: maxogden: oh max, you nailed it :) [23:08] gzmask has joined the channel [23:09] TooTallNate: ag4ve: why obfuscate? [23:10] mattgifford has joined the channel [23:10] amar has joined the channel [23:10] argami has joined the channel [23:11] maxogden: to protect valuable algorithms duh [23:11] gzmask: sup folks, do anyone knows what's the name of that new rails like framework I just saw from HN? [23:11] robotmay has joined the channel [23:12] mehr has joined the channel [23:12] mehr: hi [23:13] ehazlett has joined the channel [23:13] thinkt4nk__ has joined the channel [23:13] dubenstein has joined the channel [23:14] mehlah has joined the channel [23:16] mehr: hi , What is the difference between node.js and Nginx [23:16] richcollins has joined the channel [23:17] mehr has left the channel [23:17] karellen has joined the channel [23:18] wao: o\ [23:18] Aria has joined the channel [23:18] dubenstein has joined the channel [23:18] jgaui has joined the channel [23:21] denom has joined the channel [23:23] Joeysomo has joined the channel [23:23] dubenste1n has joined the channel [23:23] karellen has joined the channel [23:25] dragansah has joined the channel [23:27] Joeysomo has joined the channel [23:30] hunterloftis has joined the channel [23:31] langworthy has joined the channel [23:31] mattgifford has joined the channel [23:33] k1ttty has joined the channel [23:34] dubenstein has joined the channel [23:36] RORgasm has joined the channel [23:37] andrewdeandrade has joined the channel [23:38] sheenobu has joined the channel [23:40] myndzi: does there exist a decent way to enumerate local ip addresses? [23:40] PPaul has joined the channel [23:41] milani_ has joined the channel [23:43] brngardner has joined the channel [23:43] marcuswestin: ag4ve: check out uglifyjs. It's not intended for obfuscation but gives you access to a full parse-tree of your javascript that you can mangle as you please. [23:43] jj0hns0n has joined the channel [23:43] bnoordhuis: myndzi: require('os').networkInterfaces() [23:44] hunterloftis: Anybody know of a node.js foreman-equivalent? [23:45] ramitos has joined the channel [23:45] sammmy: Where can I find red bull for like $1 each? [23:45] CIA-19: node: 03Ben Noordhuis 07master * rb031671 10/ (lib/readline.js lib/tty.js): tty, readline: fix style errors - http://git.io/ntknxA [23:45] CIA-19: node: 03Ben Noordhuis 07master * r285d8c6 10/ lib/buffer.js : [23:45] CIA-19: node: buffer: align fast buffers on 8 byte boundary [23:45] CIA-19: node: Prevents alignment issues when people create a typed array from a buffer. [23:45] CIA-19: node: Unaligned loads or stores are less efficent and (on some architectures) unsafe. - http://git.io/4j1R5A [23:45] CIA-19: node: 03Erik Lundin 07master * r973bbec 10/ (src/v8_typed_array.cc test/simple/test-typed-arrays.js): typed arrays: prevent unaligned typed array views on top of buffers - http://git.io/OUKlDw [23:46] mattgifford has joined the channel [23:48] myndzi: bnoordhuis: ahh that's where it is, thanks [23:48] mattgiff_ has joined the channel [23:48] myndzi: that was suprisingly annoying to google [23:49] bartt1 has joined the channel [23:51] elguapo99 has joined the channel [23:51] SubStack: what is a good name for a recursive merge that combines keys from nested elements? [23:51] SubStack: pretty sure there are libs that do this already [23:51] enmand has joined the channel [23:51] markwubben has joined the channel [23:52] SubStack: oh there's a deepmerge on npm, boss [23:52] lukstr: anyone going to molyjam in sf? [23:54] automata has joined the channel [23:55] SubStack: beh deepmerge uses instanceof [23:55] st_luke has joined the channel [23:55] arnexmx has joined the channel [23:56] Clordio_ has joined the channel [23:57] Hebo has joined the channel [23:58] heavysixer has joined the channel [23:58] jacobolus has joined the channel [23:59] piscisaureus_ has joined the channel