[00:00] kurmangazy: you can have closures without prototypes. it's not one or the other. [00:00] kurmangazy: I mean, you don't need one to have the other. [00:00] AvianFlu: right [00:00] Brandon_R: i don't like how js oop feels hacky [00:01] AvianFlu: that's cause it is [00:01] Brandon_R: :( [00:01] AvianFlu: it's a functional language more than object-oriented [00:01] AvianFlu: but really, prototypes work fine [00:01] AvianFlu: they're just not classe [00:01] AvianFlu: s [00:01] Brandon_R: should js have gone full functional or full oop [00:01] Brandon_R: or a mix is better? [00:01] AvianFlu: why would anyone go full anything? [00:01] harthur has joined the channel [00:01] AvianFlu: take good ideas and use them until they break [00:01] Brandon_R: to precent too much context switching [00:01] AvianFlu: then tell other people how far they can be stretched [00:01] Brandon_R: prevent* [00:02] kurmangazy: you can't really have full functional. then there would be no side effects. a program without side effects does nothing. [00:02] AvianFlu: yeah, that too [00:02] Brandon_R: what do u mean side effects [00:02] Brandon_R: bugs? [00:03] AvianFlu: no, output [00:03] kurmangazy: no, a fully functional program just computes a result. it can't alter anything. [00:03] jsurfer has joined the channel [00:03] tmzt: var stuff = "nothing"; function() { blah(); blah(); blah(); stuff = "something"; blah(); }(); console.log(stuff); [00:04] jaminja has joined the channel [00:04] jaminja has joined the channel [00:04] tmzt: kurmangazy: php 5.3 does, you can use functions directly in a function call [00:04] kurmangazy: I don't think JS should have been as functional as scheme or SML. those languages can be difficult [00:05] catb0t has joined the channel [00:05] kurmangazy: tmzt: I have tried to use closures in PHP and had it not work. I'm not sure if it was a bug in PHP or if I did something wrong. but I decided not to depend on those features. [00:06] replore has joined the channel [00:06] replore_ has joined the channel [00:07] javier_: someone with experience working with VC++ 2010 Express ?? [00:08] javier_: I think I need to reference, bind, add, or something the node.lib to the addon but the project dependencies are readonly :? [00:08] kurmangazy: I realized something about OO classes. They're an attempt to add data types to everything. And data types serve no purpose other than to prevent you from doing things. [00:09] kurmangazy: Weak typing gives you simpler code that's easier to read. [00:09] Brandon_R: console.log [00:10] kurmangazy: Because you're not constantly climbing over the barriers put up by types. [00:10] AvianFlu: kurmangazy++ [00:10] v8bot_: AvianFlu has given a beer to kurmangazy. kurmangazy now has 1 beers. [00:10] [[zzz]] has joined the channel [00:10] kurmangazy: thanks for the beer :) [00:11] EndangeredMassa has joined the channel [00:13] javier_: done... I used #pragma comment( lib, "mylib" ) [00:13] javier_: ok, I got the damn node addon compiled on windows with VC++ 2010 Express [00:15] TooTallNate has joined the channel [00:16] javier_: BAMMMMMMMMMMMM [00:16] javier_: it works ;) [00:17] javier_: finally I got the damn node addon working on windows hah [00:17] kurmangazy: that was quick javier [00:17] piscisaureus: javier_: please share what you did to get it working [00:18] piscisaureus: javier_: unless you were using cygwin, but I suppose that's not the case [00:18] javier_: hah I don't think so! it took me 4 hours or something, that's too much to get something this simple just compiled and running [00:19] javier_: ok, I think I have to take some minutes more to write down the steps [00:19] kurmangazy: it would have taken me longer, but then, I would have been staring at VC documentation [00:20] AvianFlu: javier_ bmeck (bradleymeck on irc) will want to hear about that for sure [00:20] CarterL has joined the channel [00:21] javier_: well, in fact, didn't know he already have made the windows support for DLLs, early this day I thought I have to patch for myself node [00:23] javier_: until you pointed me that he did, and by what I see, he have made it work at least a week or 2 weeks ago [00:23] javier_: may be he had no time to document the process yet [00:23] AvianFlu: he's a very busy guy [00:24] kurmangazy: bbl [00:24] zmbmartin has joined the channel [00:24] tauren: I often see "module.exports" and just "exports" used, sometimes in the same project. Is one recommended over the other? [00:24] no0n has joined the channel [00:24] piscisaureus: javier_: I'd like to just get a high-level overview of the steps you took [00:24] catb0t has joined the channel [00:25] piscisaureus: javier_: We still haven't gotten around to figure this out, it would be great if you could help up bootstrap "the" way to build addons on windows. [00:26] no0n: i was trying to install an app that required node-waf the other day so I installed node from source to the latest unstable version. now npm is broke. i'd like to revert to stable (which is still installed) but calling node always uses the 0.5.10 version. so i deleted /usr/local/bin/node but now i get "no such file found" cause it still looks there for it. /usr/bin has node 0.4.x installed [00:27] no0n: not sure how to get back [00:28] javier_: sure, basically I downloaded the fork of mbeck, compiled it, created a dll with VS and pasted the code from the c/c++ addon documentation chapter, compiled it, renamed as .node and thats all, but it has a variety of details to make all that work, so I will take some minutes and post a solution so everyone can get it working [00:30] no0n: fwiw, sudo make uninstall in src directory spits out: The project was not configured: run "waf configure" first!. tried that but it errord. now sudo make uninstall spits out "error: Could not read the file '/home/noon/node/src/node/wscript'" [00:30] jmalina has joined the channel [00:32] mandric has joined the channel [00:32] ronnieboy has joined the channel [00:34] DualDetroit: Yo dawgs! [00:35] DualDetroit: I found the problem! It was my code :p [00:36] SubStack: hoora [00:36] SubStack: y [00:36] tmzt: javier_: compiled it as a dll? [00:36] langworthy has joined the channel [00:36] javier_: sure [00:37] DualDetroit: Does nginx support different server blocks based on the HTTP method? [00:37] tmzt: if should be able to with conditions of some sort [00:38] joshkehn has joined the channel [00:38] tmzt: since REQUEST_METHOD shoudl be a variable [00:38] DualDetroit: tmzt: That's what I think :p [00:38] DualDetroit: ACTION can't find anything though :-/ [00:39] DualDetroit: Wait a minute!!!! [00:39] DualDetroit: if ($request_method = GET) I think will work [00:39] DennisRas has joined the channel [00:39] DualDetroit: nginx rocks :) [00:40] kerx has joined the channel [00:40] ronnieboy has joined the channel [00:41] Sorella has joined the channel [00:45] jacobolus has joined the channel [00:45] erichynds has joined the channel [00:46] zmbmartin has left the channel [00:48] no0n: hmph, rebuilt from source and reinstalled. works fine. did sudo make uninstall and it uninstalled fine. /usr/bin still contains old ubuntu package installed node stable. but running node -v returns can't find [00:50] neilk_ has joined the channel [00:50] neilk_ has joined the channel [00:50] enmand_ has joined the channel [00:50] cmeiklejohn has joined the channel [00:54] JakeyChan has joined the channel [01:02] neurodrone has joined the channel [01:03] TRUPPP: hi. i want to use bogart and just want to make sure that instead like with express i dont have to build up directory structure like express builds up for itself. am i right? thank you [01:03] tmzt: express doesn't build anything [01:03] tmzt: you can write express in one file if you want [01:04] TRUPPP: ah okay so its free choice? i always thought, that express needs this structure [01:04] tmzt: var express=require('express'); var app = express.createServer(); app.get('/test/', function(req,res){res.send("Hi!");}); app.listen(8888); [01:04] erichynds has joined the channel [01:05] tmzt: try pasteing that in app.js and run it [01:05] stagas has joined the channel [01:06] dthompso99: anyone know if cloud9 in npm is broken? (wrong place to ask, i know) [01:06] sdwrage has joined the channel [01:06] Aphelion has joined the channel [01:07] cody_ has joined the channel [01:09] dubenstein has joined the channel [01:10] fzzzy has joined the channel [01:10] AD7six has joined the channel [01:11] dubenste1n has joined the channel [01:13] dubenste1n has joined the channel [01:13] zmbmartin has joined the channel [01:14] dubenste1n has joined the channel [01:15] franciscallo has joined the channel [01:17] Brandon_R has joined the channel [01:17] Brandon_R: hgi [01:18] fzzzy has joined the channel [01:20] dingomanatee has joined the channel [01:20] dingomanatee: Hi there [01:21] dingomanatee: what is the creation profile for an AssertionError in node assert? [01:21] zmbmartin: can anyone explain to me why --> = registry_form.registry_form.sections[0].fields[0][0].number <-- works in a jade template and I am using i and j and indexes in the loops but as soon as I do --> = registry_form.registry_form.sections[i].fields[j][0].number <-- it no longer works. But if I view i and j it is 0 and 0 respectivly? [01:22] tmzt: what about =i =j ? [01:22] tmzt: in the same level of indent [01:26] pizthewiz has joined the channel [01:26] roryW has joined the channel [01:26] ninjapig has joined the channel [01:27] trotter has joined the channel [01:27] zmbmartin: tmzt: are you asking what =i and =j show or to try using the = sign in front of them? [01:28] tmzt: what they show at the same level of idnent [01:28] tmzt: also what happens, not output at all from the template? [01:28] tmzt: undefined is handled just fine, it's syntax errors that stop the parsing [01:28] tmzt: (jade is a little broken in that sense) [01:29] Kunda has joined the channel [01:29] zmbmartin: tmzt: as I want them to i = 0 and j = 0 in that seqeunce and trying to use the = in there says syntax error [01:29] tmzt: what? [01:29] skyl has joined the channel [01:30] tmzt: I mean on a line by itself, above that one with the correct indentation [01:30] tmzt: = i [01:30] tmzt: = j [01:30] tmzt: does that give the value you expect [01:30] tmzt: are i and j passed in the data object or params to the res.view() ? [01:30] tmzt: are you using express 1.0 or 2.0 [01:31] enmand_ has joined the channel [01:31] tmzt: jade doesn't automatically get variables that are assigned in the js file [01:31] tmzt: they have to be passed to it [01:32] piscisaureus has joined the channel [01:34] zmbmartin: tmzt: here is a snippet of what I am trying to do --> https://gist.github.com/1290399 [01:35] dubenstein has joined the channel [01:37] Brandon_R: hey [01:37] Brandon_R: do you guys think jade and stylus are good? [01:37] Brandon_R: or there is a better solution out there [01:37] CarterL has joined the channel [01:37] Brandon_R: dom [01:38] kenperkins has joined the channel [01:38] Wa has joined the channel [01:39] dubenstein has joined the channel [01:40] dubenstein has joined the channel [01:41] zmbmartin: tmzt: anything look off on my gist? [01:42] Brandon_R: k [01:46] neoesque has joined the channel [01:46] n8ji has joined the channel [01:47] catb0t has joined the channel [01:49] kriszyp2 has joined the channel [01:49] chrislorenz has joined the channel [01:50] cjm has joined the channel [01:51] gregmoreno has joined the channel [01:54] catb0t has joined the channel [01:56] MUILTFN has joined the channel [01:57] astropirate has joined the channel [01:57] AphelionZ has joined the channel [01:59] roryW has left the channel [01:59] mandric has joined the channel [02:00] zmbmartin: tmzt: are you still around? [02:01] ciupaciups has joined the channel [02:02] digman543 has joined the channel [02:02] dreamdust has joined the channel [02:03] Casan has joined the channel [02:04] shipit has joined the channel [02:06] goodoo has joined the channel [02:09] kriszyp has joined the channel [02:11] Determinist has joined the channel [02:11] digman543 has joined the channel [02:17] devongovett has joined the channel [02:19] chrislorenz has joined the channel [02:20] airportyh has joined the channel [02:20] stagas has joined the channel [02:22] joshkehn has joined the channel [02:24] avalanche123 has joined the channel [02:25] joshkehn has left the channel [02:27] k1ttty has joined the channel [02:30] bronson has joined the channel [02:31] JdpB42 has joined the channel [02:36] EndangeredMassa has left the channel [02:38] ximus has joined the channel [02:38] Wizek has joined the channel [02:39] avalanche123 has joined the channel [02:40] ximus: Hi, new to node. I get an unexpected output when I read from a file using require('fs').readFileSync(filename, "utf-8") [02:40] intel_ix has joined the channel [02:41] ximus: it returns as a string the first line or so of the file and ends short with (… length:1777) [02:41] ximus: and the rest of the file is not in the string, any thoughts?? [02:42] intel_ix: How do I increase the max memory of node? I run into out of memory after trying to parse a few books [02:42] intel_ix: it says "FATAL ERROR: JS Allocation failed - process out of memory" [02:45] LuckySMack_ has joined the channel [02:46] mandric has joined the channel [02:47] andrewff1 has joined the channel [02:47] tmzt: zmbmartin: sure [02:47] up_the_irons has joined the channel [02:48] zmbmartin: tmzt: nevermind I figured it out. Thanks for the help. [02:48] tmzt: can you add the js part? [02:48] tmzt: oh ok [02:48] tmzt: what was it? [02:48] tmzt: oh, j is not a number [02:48] tmzt: it's an object [02:49] zmbmartin: I forgot that not all Objects had a number field so as it was looping when it hit a object without number it borked as undefined. [02:49] tmzt: no, I mean j is itself one of the objects in .fields [02:49] tmzt: or is that wrong? I don't know what abstraction jade uses for each [02:50] tmzt: same as .forEach(obj,idx) ? [02:50] zmbmartin: no i and j were right it was jut my data that was the problem [02:51] zmbmartin: if you do - each obj in objs you don't have access to the index but - each odj, i in objs i increments each loop [02:52] franciscallo has joined the channel [02:56] issackelly_ has joined the channel [02:59] githogori has joined the channel [03:01] deedubs has joined the channel [03:01] mikeycgto has joined the channel [03:01] Ax1 has joined the channel [03:02] up_the_irons has joined the channel [03:03] Guedes has joined the channel [03:05] Guedes has left the channel [03:07] sonnym1 has joined the channel [03:08] mikolalysenko: Is there a way to log when a garbage collect occurs in node? [03:09] boltR has joined the channel [03:09] mikolalysenko: I'm getting these random and dramatic ping spikes in my app, and I wonder if that could be the cause [03:10] javier_: ok I finished the instructions to build a node.js windows c/c++ addon, since I don't have a blog I'm publishing it as an article on my website, so you can check it out at http://coderesearchlabs.com, under the Articles section [03:11] k1ttty has joined the channel [03:11] cmeiklejohn has joined the channel [03:14] smathy has joined the channel [03:16] zmbmartin has left the channel [03:16] dexter_e has joined the channel [03:17] dshaw_ has joined the channel [03:18] airportyh: Hello all, I want the most efficient way to create a string of length n containing all spaces [03:18] airportyh: is this close? Array(this.cols + 1).join(' ') [03:18] airportyh: or Array(n + 1).join(' ') [03:19] SubStack: most efficient? [03:19] airportyh: yeah [03:19] SubStack: who cares? [03:19] SubStack: computers are fast now [03:19] airportyh: :) [03:19] tmzt: cool hack though [03:20] airportyh: SubStack: since you are here, I am using node-charm [03:20] airportyh: and was trying to determine the terminal size [03:20] SubStack: yep there's something in there to do that [03:21] airportyh: ended up calling out to the "resize" program and parsing its output [03:21] airportyh: there is? [03:21] airportyh: how? [03:21] towski has joined the channel [03:22] Danielpk has joined the channel [03:22] SubStack: oh wait [03:23] SubStack: haha I meant to implement this but I guess I forgot to [03:23] airportyh: ha ok [03:23] airportyh: well how would you have done it? [03:24] zmbmartin has joined the channel [03:28] EndangeredMassa has joined the channel [03:30] stagas has joined the channel [03:35] k1ttty has joined the channel [03:37] matyr has joined the channel [03:37] goodoo has joined the channel [03:39] Spion_ has joined the channel [03:40] mikolalysenko: Anyone know how to trace memory allocations in node.js? [03:40] mikolalysenko: I seem to have a small leak in my server.... [03:41] jackbean has joined the channel [03:42] yozgrahame has joined the channel [03:44] javier_: mikolalysenko: mmm no, but you can trace the garbage collecting by using --trace-gc, that might show you when it is cleaning to check again your memory usage [03:44] mikolalysenko: yeah, I tried that... [03:44] mikolalysenko: I also tried --log_gc, but that doesn't tell you where the object got created at [03:44] javier_: in any case I'm not sure if there is no a flag under --v8-options listing that might help you, I don't know v8 enough yet [03:44] mikolalysenko: I was wondering if there was some (even slow) way to track line numbers with --log_gc [03:46] javier_: it has something called --trace_alloc but seems not to be helpful in your case [03:47] shedinja has joined the channel [03:49] JakeyChan has joined the channel [03:49] karmakillernz has joined the channel [03:50] mikolalysenko: log_gc seems useful, but it is missing line numbers for objects... [03:55] CrankyMonkey has joined the channel [03:57] jtsnow has joined the channel [04:00] Nuck: Just tried to install forever, got npm ERR! Unresolveable cycle detected [04:00] Nuck: o_O [04:00] Nuck: On winston, apparently [04:03] AvianFlu: nuck: forever@0.7.1 just installed for me fine [04:03] johnnychimpo has joined the channel [04:04] mikolalysenko: are there any heap profilers for node out there that actually work? [04:05] Nuck: AvianFlu: Hmmm I had some issues with NPM and Sudo, I'm gonna try reinstalling and trying again [04:07] mandric has joined the channel [04:09] isaacs has joined the channel [04:10] towski has joined the channel [04:10] dexter_e has joined the channel [04:15] Nuck: Hup it worked [04:15] Sorella has joined the channel [04:16] gavin_huang has joined the channel [04:19] socketio\test\68 has joined the channel [04:21] criswell has joined the channel [04:26] up_the_irons has joined the channel [04:27] dexter_e has joined the channel [04:28] skm has joined the channel [04:29] Jabbers has joined the channel [04:32] massivebiz has joined the channel [04:34] chrislorenz has joined the channel [04:38] langworthy has joined the channel [04:39] secoif has joined the channel [04:39] ditesh|cassini has joined the channel [04:39] cainus: hey all...anyone know how to sort in mongoose? all I can find are random outdated blogs [04:40] stagas has joined the channel [04:43] chrislorenz has joined the channel [04:45] yozgrahame has joined the channel [04:45] massivebiz has joined the channel [04:45] CrankyMonkey1 has joined the channel [04:48] goodoo_ has joined the channel [04:51] JSManiacs has joined the channel [04:52] JSManiacs has left the channel [04:54] up_the_irons has joined the channel [04:56] avalanche123 has joined the channel [04:56] mrryanjohnston has joined the channel [04:56] infynyxx has joined the channel [05:01] elliottcable: Nuck › Awake? [05:02] elliottcable: Nuck › I have good news; I’ve decided to address your concerns by splitting from.js into a series of entirely disconnected modules, if I can. [05:02] Nuck: elliottcable: Which you prolly can't :P [05:03] jtsnow has joined the channel [05:03] confoocious has joined the channel [05:03] confoocious has joined the channel [05:03] elliottcable: Nuck › `from-resolver` for the core ResolutionMutator machinery, `from-async` for the actual asynchronous loader, `from-sync` for the synchronous version, `from-wharf` for the imports/exports, `from-magic` for the globals-modification machinery [05:03] d_low has joined the channel [05:04] kenperkins has joined the channel [05:04] elliottcable: `from-compiler` for the for-web compiler, and `from` itself as a meta-module that installs all of the above [05:04] jetienne has joined the channel [05:04] Nuck: wow [05:04] Nuck: elliottcable: I'm impressed [05:04] Nuck: Beyond impressed [05:04] elliottcable: Nuck › why’s that? [05:05] Nuck: elliottcable: The sheer amount of modularity you got [05:05] elliottcable: … lol, it’s far more than that, bro [05:05] elliottcable: you should *see* the ResolutionMutator algorithm [05:05] elliottcable: it really is sheer genius; and yet I’m also yanking it out and completely replacing it [05:05] nerdy has joined the channel [05:06] elliottcable: beause at the moment there’s only really a single tree of mutators, and that means anybody extending the system with their own mutators (which is ridiculously easy to do) has to directly modify the mutators that *everybody else uses* [05:06] elliottcable: after my rewrite, a single file, a single `Acquisition`, or an entire project’s worth of files, can share a unique tree of `ResolutionMutator`s that won’t affect the global package of them that ships with `from-resolver` itself [05:07] dexter_e: Should models have access to the session object ? [05:07] elliottcable: dexter_e › er, what? [05:07] dexter_e: I wonder if in strikt MVC models should see the session [05:07] dexter_e: or should controllers only see the session [05:08] Nuck: elliottcable: I want you to reread the last two messages as somebody who is just thinking of trying out from.js and tell me whether you'd choose that or require() just by the apparent learning curve. [05:08] Nuck: ;P [05:08] joshkehn has joined the channel [05:08] Nuck: elliottcable: This is what I said about from.js being too complicated [05:08] elliottcable: lol [05:09] elliottcable: none of that is really going to be presented to a first-time user. [05:09] elliottcable: for a first-time user, it boils down to this: [05:09] dexter_e: perhaps I worded the question wrong [05:09] Nuck: It's sheer genius, sure, but it's also insanely fucking complicated to anyone new :P [05:09] elliottcable: || from('percival') [05:09] elliottcable: || // . . . [05:09] purr: elliottcable: ReferenceError: from is not defined [05:09] elliottcable: || percival.perceive(something) [05:09] elliottcable: lol timeoutfail [05:09] purr: elliottcable: ReferenceError: percival is not defined [05:10] elliottcable: Nuck › that’s basically most easily solved by good documentation. Documentation that caters well to a first-time visitor as well as someone more interested in exploring all of the power available to them. [05:10] Nuck: elliottcable: What is this "something"? [05:10] elliottcable: Nuck › which “something?̦ Hrm? [05:10] Nuck: elliottcable: perceive(something) [05:10] elliottcable: anything *shrug* [05:10] elliottcable: percival is an entirely separate thing of mine [05:10] elliottcable: was just using it as an example. [05:11] galaxywatcher has joined the channel [05:11] Nuck: elliottcable: But what is something for? [05:11] dexter_e: Example: if you want to run a filter between certain action like deleteResource , the model would have to be queried like User.hasRole("can_delete) . So I wonder if the code that looks at session to see which user is logged in is Ok to put in the model. [05:11] elliottcable: the *entire extent* of `from` that a first-timer cares about is this line of code: [05:11] elliottcable: `from('something')` [05:11] elliottcable: which in terms of simplicity, is even simpler than `something = require('something').something;` [05:11] Nuck: elliottcable: Not entirely [05:12] elliottcable: if I finish lazy-loading to my satisfaction, it will be even easier than that [05:12] elliottcable: the entire quantity of code required to use `from` will be this: [05:12] Nuck: elliottcable: It's also less explicity [05:12] dexter_e: I guess this is more of a system design question, but I wonder if anyone can recommend something for the way its done in node. [05:12] Nuck: -y [05:12] elliottcable: || percival.perceive(something) [05:12] purr: elliottcable: ReferenceError: percival is not defined [05:12] elliottcable: Nuck › well, you’re either talking to noobs here, or you’re not. If they’re not noobs, then they’re going to use the more-explicit and more-powerful invocation methods. [05:13] Nuck: elliottcable: Actually, more implied is worse for noobs [05:13] elliottcable: Nuck › you can’t say “`require` is better because it’s simpler,” and then when I show that `from` is simpler, say “well now `require` is better because it’s less simple” [05:13] elliottcable: well, in any case, all of that is a discussion for documentation [05:13] jackbean has joined the channel [05:13] linkgoron: lol [05:13] Nuck: elliottcable: No, simplicity is not fewer characters [05:13] elliottcable: and I am completely open to discussions about which methodology I should expose in the first page of noob-level tutorial, i.e. the getting-started snippet [05:14] Nuck: elliottcable: How do I make it explicit what variable is being set? [05:14] joshkehn has left the channel [05:14] elliottcable: depends on whether you want synchronicity or not. [05:14] elliottcable: `var foo = from('foo')` at its most basic. [05:14] elliottcable: if you’re Proper™, and being asynchronous, [05:15] Nuck: so it's roughly the same as require [05:15] Nuck: syncily speaking [05:15] Nuck: elliottcable: Well, startup doesn't need to be async [05:15] elliottcable: || from('something')(function(something){ [05:15] elliottcable: || /* use `something` */ }) [05:15] elliottcable: Nuck › yes, it does. [05:15] Nuck: And 90% of require calls are on startup [05:15] purr: elliottcable: ReferenceError: from is not defined [05:15] Nuck: elliottcable: Why? [05:15] elliottcable: lazy loading; massively speeds up boot. [05:16] elliottcable: anyway, I just popped in to let you know I’m splitting it up [05:16] Nuck: o_O [05:16] elliottcable: we can argue how much `require()` sucks later [05:16] elliottcable: time for breakfast! [05:16] Nuck: elliottcable: Can I wait for an array of things to load? [05:16] elliottcable: yep [05:16] elliottcable: you don’t have to wait, though. [05:16] Nuck: elliottcable: Now *that* is good [05:16] Nuck: Well, I do wait [05:16] elliottcable: they’ll all be loaded in parallel, as will the entire tree of dependencies below them. [05:17] elliottcable: if you use the `from-lazy` features, then it will “short-circut” that to immediately and synchronously load a subtree of dependencies if you reference something before it’s finished loading. [05:17] Nuck: elliottcable: So it's promise-y? [05:17] gavin_huang has joined the channel [05:18] elliottcable: which leads to a bit of duplication (the originally-dispatched filesystem requests will still occur for the now-redundant asynchronous loading), but there’s no way around that; and the performance loss is minimal [05:18] chjj: node's require is amazing [05:18] elliottcable: chjj › ಠ_ಠ [05:18] elliottcable: ಠ_ಠ chjj [05:18] purr: Let it be known that elliottcable disapproves of chjj. [05:18] elliottcable: Nuck › nah, you mis-understood [05:18] chjj: is that what that means? [05:18] AvianFlu: chjj: elliottcable is a troll, he just really goes through this much trouble to do it [05:18] Nuck: Node's require *is* amazing. Relative to CommonJS. [05:18] elliottcable: Nuck › this isn’t like `foo = from_promis_ey('foo')`, and then `foo` is a “promise” [05:19] elliottcable: AvianFlu › what? I’m not a troll. [05:19] Nuck: promise-based require() would be badass tho haha [05:19] cmeiklejohn has joined the channel [05:19] chjj: elliottcable: you dont like sync require === troll [05:19] elliottcable: uh. [05:19] chjj: numbers dont lie [05:19] elliottcable: yeah, whatever bro. [05:19] Nuck: elliottcable is srs bzns. [05:19] chjj: i didnt know you were a bro [05:19] Nuck: chjj: Better than a brony. [05:20] elliottcable: *shrug* your call what you use. You like `require()`, use `require()`. I, personally, think it’s completely and totally against the spirit of node, and it pisses me off to no end, so I’m replacing it for my own use. [05:20] AvianFlu: is that a young centaur in a polo shirt nuck? [05:20] chjj: i want quadruple equal to be implemented in v8 [05:20] chjj: so i could say elliottcable ==== troll [05:20] Nuck: AvianFlu: Nope, just a hipster who watches MLP [05:20] chjj: because he doesnt like sync require! [05:20] AvianFlu: sounds like patch time to me [05:21] elliottcable: chjj › Pretty sure you’re the troll, not me, bro [05:21] Nuck: typeof elliottcable === 'troll' [05:21] dexter_e: In strict MVC applied to Node.js do Models ever access the Session Object ? Anyone? [05:21] Nuck: Fix'd. [05:21] elliottcable: Nuck › if you’re on http://getflow.com/, gimmie your e-mail, and I’ll invite you to the `from`-lists. [05:21] SubStack: synchronous require is best require [05:21] Nuck: dexter_e: Strict MVC in Node? [05:21] Nuck: LOL [05:21] AvianFlu: SubStack++ [05:21] v8bot_: AvianFlu has given a beer to SubStack. SubStack now has 8 beers. [05:22] elliottcable: // ++ SubStack ≥ SubStack++ [05:22] Nuck: elliottcable: Is that some site for a drug that helps with urination o_O [05:22] dexter_e: Nuck: Strict MVC in Node.js = LOL ? [05:22] elliottcable: so many trolls in here tonight, and I’m not one of them. [05:22] elliottcable: ACTION walks off [05:22] Nuck: dexter_e: Yup [05:22] Nuck: elliottcable: haha [05:22] Nuck: !best sync require [05:22] purr: SYNCREQUIRE IS BESTREQUIRE [05:22] AvianFlu: nuck: he started walking away, don't ruin a good thing [05:23] dexter_e: Nuck: May I ask why ? [05:23] Nuck: AvianFlu: Hey, I happen to think elliottcable is a pretty cool guy. He kills aliens and doesn't afraid of anything. [05:23] chjj: ruby on rails made mvc stupid when they made ruby on rails [05:24] Nuck: dexter_e: Because MVC is painful and Node is unpainful. [05:24] Nuck: Roll your own loose MVC :P [05:24] SubStack: I don't like it when a tool imposes a structure upon my program. [05:24] chjj: mvc should be a general philosophy, not some ridiculous framework [05:24] Nuck: SubStack: Precisely. [05:24] chjj: imo [05:25] SubStack: I want creative control, you know? [05:25] dexter_e: chjj: I agree. So I wonder if you guys recommend having models access the session object. In a "loose" mvc [05:25] EndangeredMassa: SubStack: In general, I agree. However, it can be nice to follow a strict structure so that the platform can infer a lot about how it works, requiring less configuration/wiring code. [05:25] Nuck: dexter_e: No, because sessions are generally in the general vicinity of the model [05:26] Nuck: EndangeredMassa: ... [05:26] Nuck: EndangeredMassa: config through .json [05:26] Nuck: And done. [05:26] Nuck: Just request from an object [05:26] chjj: ill die before i give up my ability to configure! [05:26] Nuck: Include a default config [05:26] dexter_e: Nuck: What do you mean by "sessions are generally in the general vicinity of the model " [05:26] dexter_e: pardon, not grocking [05:26] Nuck: dexter_e: How are sessions implemented? Usually on a database, as in the model [05:26] issackelly_ has joined the channel [05:27] EndangeredMassa: Nuck: Wiring code, then. ASP.NET MVC and Ruby on Rails do this a bit. That's all I meant. [05:27] SubStack: EndangeredMassa: perhaps but I like it better when new modules arise to tackle small problems [05:27] xajler has joined the channel [05:27] Nuck: dexter_e: Honestly, I jsut use Express + Mongoose + connect-mongo for sessions [05:27] LuckySMack__ has joined the channel [05:28] Nuck: SubStack: And by "when new modules arise" you mean "when you code modules" [05:28] SubStack: even if it takes longer, the final product fits in my head all at once a lot more easily [05:28] dexter_e: Nuck: Thanks. Good point about sessions being in the db [05:28] Nuck: SubStack: lots of small modules > one behemoth [05:28] dexter_e: It sounds like everyone does it this way? Session memory store isn't used eh? [05:29] Nuck: You can ignore some bits and add others [05:29] SubStack: Nuck: well I could just as well characterize lots of modules as "aimless wandering" or a "random walk" [05:29] dexter_e: Express has the session object. [05:29] chjj: dexter_e: im an advocate of cookie sessions, thats me though [05:29] SubStack: but I still like that better than trying to up-front the overall design [05:29] Nuck: dexter_e: memory store doesn't scale to large numbers of users or to multi-server setups [05:29] Nuck: dexter_e: What's your database? [05:29] dexter_e: CouchDB [05:30] Nuck: dexter_e: You can put any storage behind the session object I'd bet [05:30] SubStack: dexter_e: when sessions are in the database you don't lose all your sessions when your app crashes or gets restarted [05:30] Nuck: dexter_e: It's fully modular [05:30] dexter_e: SubStack: good point. [05:30] SubStack: also this: http://github.com/substack/node-sesame [05:30] dexter_e: So for even basic middleware like checking user permissions the DB gets a query on every request eh? [05:30] SubStack: if express sessions start getting too annoying [05:31] Nuck: dexter_e: https://github.com/tdebarochez/connect-couchdb [05:31] dexter_e: Substack: Nuck: Thanks! [05:31] Nuck: dexter_e: middleware providing couch-backed session storage [05:31] SubStack: dexter_e: in sesame's case the sessions are all in memory and the database is just there to back them up [05:32] SubStack: not sure how express sessions do it [05:32] Nuck: dexter_e: This one is built upon express sessions [05:32] Nuck: SubStack: I believe it's queried [05:32] Nuck: Might be cached [05:32] Nuck: Well, I *know* it's queried [05:32] Nuck: I highly advise using Redis no matter your database [05:32] dexter_e: But even if sessions are stored in the DB the request must be processed and the SID for that request must be extracted.. Do you keep that code in your model? [05:32] Nuck: It's awesome. [05:32] Nuck: dexter_e: huh? [05:33] Nuck: dexter_e: With connect sessions, it handles it from start to finish [05:33] dexter_e: Right but you still have to grab the SID to query the DB right? [05:33] Nuck: dexter_e: It'll set a cookie with the SID in it, then extract on each request [05:33] Nuck: And then it'll look it up [05:33] dexter_e: Nuck: right, so is your model extracting the SID ? [05:33] Nuck: And set it on req.session [05:33] Nuck: dexter_e: What do you mean? [05:34] Nuck: dexter_e: Connect will do the database management for the sessions db [05:34] Nuck: There is no model, no magic [05:34] Nuck: Just a simple storage system [05:34] dexter_e: I see [05:34] krazyj has joined the channel [05:34] krazyj has left the channel [05:34] yuwang has joined the channel [05:35] Nuck: I still recommend Redis, but that's just because it's teh awesomes. [05:35] dexter_e: Does Redis do MultiVersionConcurency ? [05:35] dexter_e: and conflict management? [05:36] ninjapig has joined the channel [05:36] ninjapig has joined the channel [05:37] Nuck: dexter_e: Dunno, it's just Really Fucking Basic™ [05:37] Nuck: dexter_e: It is a key-balue store in-memory [05:37] dexter_e: sweet [05:38] dexter_e: Nuck: connect-couchdb looks awesome too, thanks for that! [05:38] Nuck: With HDD storage for persistence, but that's set up separate [05:38] Nuck: dexter_e: No problem :) [05:38] Nuck: I'm a Mongo user, but I'm using Redis for sessions [05:40] dexter_e: node-sesame looks sweet too I wonder if it will take couchDB too [05:42] dexter_e: Anything with harmony proxies intimidates me though [05:42] dexter_e: I may be unworthy [05:43] shipit_ has joined the channel [05:47] kab3wm has joined the channel [05:48] elliottcable: Hadn’t somebody written a native extension for the old `promise.wait` functionality? [05:48] elliottcable: basically, something to synch the JS reactor loop and *block* until an asynchronous event ocurred? [05:48] elliottcable: I cao do it myself, but I don’t want to duplicate effort [05:49] yuwang has joined the channel [05:53] Emmanuel_ has joined the channel [05:54] mmalecki has joined the channel [05:55] stagas has joined the channel [05:55] gavin_huang has left the channel [05:58] fangel has joined the channel [05:58] EhevuTov has joined the channel [06:00] elliottcable: SubStack › you’d probably know the answer to that [06:01] SubStack: pretty sure there is something like that on npm [06:01] SubStack: I can't remember what it was called though [06:01] isaacs: Fiber [06:01] isaacs: s [06:02] isaacs: you want marcell's fibers utility [06:02] elliottcable: ah, you’re awake isaacs [06:02] TomY has joined the channel [06:02] elliottcable: was there anything else you needed before you can merge the changes I made into master? [06:03] isaacs: i'd like to get ben or ryan to review it as well [06:03] elliottcable: isaacs › good by me. Who’s ben? [06:03] isaacs: ben == bnoordhuis [06:03] elliottcable: ah [06:03] elliottcable: he already said “DO NOT WANT” regarding looking at it [06:04] isaacs: haha [06:04] elliottcable: I gather he finds `Context`s scary [06:04] elliottcable: ryah might, but he’s busy [06:04] isaacs: herby would be good, too [06:04] elliottcable: herby looked [06:04] isaacs: yeah, ryah's a busy man [06:04] elliottcable: his only worry was “Is this okay by v8?” [06:04] elliottcable: which I settled [06:04] isaacs: kewl [06:04] elliottcable: does he frequent IRC? [06:04] isaacs: yeah, i saw that [06:04] isaacs: ry? or herby? [06:04] elliottcable: herby, lol [06:04] isaacs: i've seen him, but not that often [06:05] elliottcable: I kind of wish ryah would sign Node over to you or bnoord or somebody [06:05] elliottcable: so he could entirely focus on libuv [06:05] SubStack: I wonder if the 0.5.x node api will have a nice way to stop streams [06:05] elliottcable: libuv is … godly-awesome, and I’m going to have serious need of it in about two or three months coming, hereh [06:05] elliottcable: so, selfishly, I want him to have as much time to focus on it and make it as awesome as possible by then ;D [06:05] SubStack: stop .pipe() I mean [06:05] SubStack: without ending [06:05] elliottcable: SubStack › write it? [06:05] SubStack: elliottcable: I did [06:05] elliottcable: I can’t imagine it being that difficult. Hm. [06:05] elliottcable: SubStack › ah? link? [06:06] SubStack: https://github.com/substack/node-pipestop [06:06] elliottcable: hahahaha [06:06] elliottcable: “node-pipestop” [06:06] elliottcable: now there’s a man who backs his words up with code. [06:06] elliottcable: ++ SubStack [06:06] purr: Let it be known that elliottcable loves SubStack. [06:07] elliottcable: SubStack › I love the API. Very slick, three methods, with each returning the previous. [06:08] SubStack: well pretty much the problem is that there's no way to call the cleanup code inside of Stream.prototype.pipe without sending an "end" event [06:08] Aria has joined the channel [06:08] SubStack: and I ran into a case where I want all the backpressure goodness of pipe() but I also needed to stop listening without killing the stream [06:08] smtlaissezfaire has joined the channel [06:09] SubStack: a bit too much of a niche case maybe [06:09] maletor has joined the channel [06:09] SubStack: it's for bouncy so I can take the socket and pipe() it along until the next request comes in for the case of connection: keep-alive [06:11] elliottcable: SubStack › yeah, I get it; [06:11] elliottcable: SubStack › that seems like a common enough use case to belong in core [06:11] elliottcable: or, that’s a lie [06:11] elliottcable: that seems an *intuitive* enough use case, to belong in core. [06:11] SubStack: maybe there could be an .unpipe(stream) [06:12] Mokona has joined the channel [06:12] elliottcable: isaacs › node fibers look very neat; they don’t seem to be full fibers, but I’m pretty sure I can do exactly what I need to do with this without writing extra C++ code. [06:12] SubStack: .pipe() already keeps track of the pipe count so the machinery to implement it is already there [06:12] purr has joined the channel [06:13] isaacs: SubStack: i think we're going to need to do that in core, as well. [06:13] isaacs: if http.IncomingMessage and http.OutgoingMessage are going to .pipe() to their underlying socket [06:13] SubStack: I could make a patch if you want [06:13] isaacs: nah, let's see if it's needed [06:13] isaacs: . [06:13] SubStack: k [06:14] necrodearia has joined the channel [06:14] AvianFlu: SubStack, you can do .pipe(destination, {end: false}), can't you? [06:14] SubStack: you can [06:15] SubStack: but then I would still have to send 'end' events down the wire [06:15] SubStack: or um [06:15] SubStack: yeah that wouldn't even do what I want [06:15] SubStack: which is to unbind all the listeners [06:15] k1ttty has joined the channel [06:16] djbell has joined the channel [06:17] SubStack: exposing this somehow would be boss: https://github.com/joyent/node/blob/master/lib/stream.js#L133-L151 [06:17] SubStack: which is what pipestop does [06:18] justinTNT has joined the channel [06:21] lv has joined the channel [06:22] lv: how to run the sample code available at http://socket.io/#home ? [06:23] elliottcable: Damnit, nah [06:23] elliottcable: isaacs › it looks like node-fibers may be unhelpful to me; it only blocks “inside of the fiber.” I need to block the entire node thread, for the people *calling* me, who themselves will probably not be using fibers. [06:23] isaacs: elliottcable: that is evil. [06:23] elliottcable: isaacs › I can probably write an extension to do this fairly easily, it’s not like it’s a complex task on the surface [06:23] elliottcable: isaacs › yes, I know [06:23] elliottcable: isaacs › well, synchronous require is evil. [06:24] elliottcable: so, fight fire with fire. [06:24] isaacs: elliottcable: sync require is a start-time thing. it's not evile. [06:24] elliottcable: then doing what I’m about to do at start-time isn’t evil either ;D [06:24] isaacs: elliottcable: having multiple threads of js execution, without fair warning and outside of your sandbox, is evil. [06:25] elliottcable: all I’m doing is allowing asynchronous acquisition and initialization to exist “below the stack” wherein some person did a synchronous-acquisition request. [06:25] elliottcable: either A) we block everything for their sake, [06:25] elliottcable: or B) *everything anywhere below him* has to also be synchronous. [06:26] skyl has joined the channel [06:26] isaacs: A seems like a fine choice, no? [06:26] isaacs: just don't do that if it's bad to do that. [06:26] justinTNT: why doesn't connect.static return 404 for missing files? [06:28] Daegalus has joined the channel [06:29] intel_ix has left the channel [06:29] diogogmt has joined the channel [06:31] elliottcable: isaacs › yes, A is exactly the goal :3 [06:31] elliottcable: isaacs › but “just don}t do that if it’s bad to do that” isn’t really an option. [06:31] isaacs: that's what we do in node today [06:31] isaacs: you get one js thread, everything waits for require() [06:31] elliottcable: isaacs › as evidenced by the horde of people jumping on the SYNCREQUIRE IS BESTREQUIRE bandwagon in here a few hours ago, users *don’t really understand* the repurcussions of their synchronous requires [06:31] elliottcable: isaacs › and thus we have to cater to users who are going to request synchronous initialization when that isn’t possible [06:31] isaacs: elliottcable: i understand the repercussions of sync require. [06:32] elliottcable: to do that … we’re just going to have to A), regardless of whether A) is evil or not /= [06:32] isaacs: we used to have require.async. [06:32] elliottcable: yah, I know :3 [06:32] isaacs: and toyed with an async define(), and a few other patterns. [06:32] elliottcable: mmhmm, I remember [06:32] isaacs: they are all shit in serverside code. [06:32] elliottcable: I was watching, idly, the entire time. Been away from Node for a while, but I’ve always kept an eye on what y’all are trying to do to “solve” the asynchronous initialization problem in an inherently synchronous language. [06:32] isaacs: and for client-side code, you need to have it all cached up front anyway [06:33] isaacs: the language isnt' the problem. [06:33] isaacs: the problem is that async require is too complicated. [06:33] elliottcable: oh, it certainly is. [06:33] elliottcable: A truely asynchronous language has no issue with any of this. [06:33] elliottcable: I should know, I designed the first one. ;D [06:33] isaacs: elliottcable: and you are probably also a significant chunk of its userbase. [06:33] elliottcable: absolutely [06:33] isaacs: and you don't see this as a problem...? [06:33] elliottcable: anyway, let’s see what I can do with fibers [06:34] elliottcable: isaacs › that’s only because it’s not complete as of yet. I’m not personally working on it, others have taken up that torch. [06:34] elliottcable: Currently too buried in the necessities of “fixing Node” for my purposes [06:34] isaacs: elliottcable: so. in the meantime. [06:34] isaacs: i don't believe that the language is the problem. [06:34] isaacs: or that js needs to be somehow "more async" [06:34] elliottcable: I absolutely do *not* think it should be. [06:34] elliottcable: It’s a synchronous language, and one I love. That’s just the way it is. [06:35] isaacs: from a language pov, yui3's add/use, or amd, or require.async, are fine. [06:35] elliottcable: In a synchronous language, if you want to do asynchronous stuff … you go to threads/fibers, or a reactor loop, or similar. [06:35] dgathright has joined the channel [06:35] isaacs: in an async language, you don't have to worry about such things, because you're not using it. [06:35] isaacs: it's the haskell problem. [06:36] elliottcable: isaacs › so, regarding my plans; you mentioned something about having multiplepaths of JS execution; can you cover that a bit more? [06:36] SubStack: I like it when asynchronous code stands out. [06:37] isaacs: to paraphrase mark mayo, the history of computer science fuckups has been largely dominated by attempts to make network operations and local operations look the same. [06:37] rendar has joined the channel [06:37] AvianFlu: isaacs++ [06:37] v8bot_: AvianFlu has given a beer to isaacs. isaacs now has 6 beers. [06:38] isaacs: whehter it's fibers, nfs, or whatever, when you make your network operations look like local operations, it's a source of frequent and surprising pain. [06:38] gf3: mmm pain [06:38] isaacs: from the pov of a server under load, the file system may as well be the network. you have to treat it as a "long time", because it is. [06:38] lv: hwo to run the sample code available at http://socket.io/#home ? [06:39] isaacs: from the pov of a server just starting up, however, the file system can be treated as a local data store, because you've only got one request blocking on it. [06:39] isaacs: (the request of the sysadmin to start the server, that is() [06:39] EhevuTov: lv, you need to install Node.js and the npm package manager and then read this: http://socket.io/#how-to-use [06:39] elliottcable: isaacs › yes, yes, yes [06:39] elliottcable: but then you end up with things like rails’ boot-time. [06:39] isaacs: elliottcable: so, when i say that the language isn't the problem, what i really am saying is, if you are covering up the discrepancies with the language, then you're part of the problem. [06:40] isaacs: also! [06:40] elliottcable: asynchronous initialization is *necessary* for some things; and even for those which it isn’t, asynchronous-acquisition allows for massive-parallelization of the acquisitions themselves [06:40] isaacs: making async look sync is not *all that much worse* than making sync look async! [06:40] isaacs: this is what erlang does that makes me go batty [06:40] elliottcable: agreed, 100% [06:40] elliottcable: my issue here isn’t with that [06:40] isaacs: elliottcable: solving the wrong problem, man. [06:40] elliottcable: That’s what I *already do*. [06:40] isaacs: you can block for TEN SECONDS at startup time, and it's *fine* [06:41] isaacs: like, serving no requests, etc. [06:41] SubStack: I agree from experience [06:41] elliottcable: er, not sure what your definition of fine is. [06:41] isaacs: 10, 9, 8, .... [06:41] AvianFlu: as do I [06:41] elliottcable: that’s fine for production, sure. [06:41] isaacs: 10 seconds. [06:41] elliottcable: not for development. [06:41] SubStack: but I'm trying to think of some concrete examples to demonstrate this [06:41] isaacs: elliottcable: in development you can block for 1 second on each request. [06:41] isaacs: but even waiting 10 seconds isn't so bad in dev. [06:41] SubStack: implicit green thread models for instance don't lock up the server [06:42] SubStack: but they can be surprising [06:42] elliottcable: surprising == bad [06:42] isaacs: however, adding latency of even 100ms in production on each request, is completely intolerable [06:42] elliottcable: isaacs › of course, but how does this affect that? [06:42] isaacs: especially if doing so blocks the whole server. [06:42] elliottcable: this is *purely* a discussion of boot-time semantics [06:42] isaacs: elliottcable: what i'm saying is, yes, i get it, you can't block once the server is up. but who gives a crap about boot time? [06:42] SubStack: maybe that's the biggest benefit: that node programs can only ever do exactly 1 thing at once [06:42] lv: My NPM and Socket.io are installed at root folder. After installing them, i tested chat application from https://github.com/ry/node_chat, this one is working. after that i took server and client code from http://socket.io/#home. when i run $ node server.js i got "info - socket.io started". when i lauched it in browser "Welcome to socket.io." is displayed, but not expected out come, any idea? how to test tehse? any other f [06:42] isaacs: you'll be booted *faster* if you do it sync than async! [06:42] elliottcable: Obviously not you :D [06:42] elliottcable: but I do. [06:43] elliottcable: how is that, isaacs? [06:43] isaacs: elliottcable: because you've only got one hard drive. [06:43] elliottcable: er, that’s assuming that the only initialization you do *is* loading more modules, and that’s absolutely not true [06:43] elliottcable: at least, not in the cases I work with [06:43] isaacs: elliottcable: what are you doing on every boot that can't be cached? [06:44] elliottcable: remember, you have to differentiate “synch acquisition versus asynch acquisition” and “synch initialization versus asynch initialization” [06:44] elliottcable: anyway, I have to get back to actually dev’ing [06:44] elliottcable: but you were right about the multiple-threads-of-JS thing [06:44] isaacs: i've written a bunch of node programs, many of them in production, and many platforms before node, and i have never encountered the problem youer' describing. [06:44] EhevuTov: lv, it sounds like your node.js is working. You're probably just having a socket.io issue now. I bet your ip address in your client-side socket.io initialization is wrong [06:44] elliottcable: I can probably do something with v8 contexts, since everything I do is already completely separate contexts, but I’m still not sure how thread-safe v8 is … will need to investigate [06:44] dreamdust has left the channel [06:45] SubStack: browserify could really benefit from better caching [06:45] SubStack: meh [06:45] gf3: elliottcable: I feel like you're in every channel on IRC… ever [06:45] elliottcable: and probably better off in general not to do that at all, and just say “synchronicity is out, unless you want to be a colossal ass to everybody ‘below’ you on the stack” [06:45] isaacs: so far, every time i've thought that i needed parallelization at boot time, what i actually needed was better caching. [06:46] elliottcable: gf3 › /whois elliottcable [06:46] gf3: elliottcable: just as I suspected [06:46] elliottcable: isaacs › basically, this sort of speaks to what we were discussing earlier about MVC: [06:47] elliottcable: isaacs › if you go with caching, you’re basically forcing a particular model upon the programmer. Yes, modular separation, and the identical-ness of a given module to all those using it, is a nice idea, and probably what you damn-well *should* be doing 90% of the time [06:47] elliottcable: just like MVC separation is what you should be doing 90% of the time. [06:47] elliottcable: but I’ve thought about that for, well, since the *original* raging `require()` debates back in 2009 [06:47] isaacs: elliottcable: show me what you can't ship with require() [06:47] elliottcable: and decided that caching is not the solution, at least, not at the framework-level. The module author should be doing that, if it’s appropriate for their module. [06:48] elliottcable: isaacs › ask me later, I’ll try to post some examples. [06:48] isaacs: k [06:48] elliottcable: isaacs › now that I‘ve answered my “can I block Node” question, I’m about to walk off :x [06:48] isaacs: feel free to post them whenever and tell ircretary to tell me about them [06:48] isaacs: i'm genuinely curious [06:49] elliottcable: isaacs › basically, no API I’ve ever created is your bog-standard `module.exports. = `, or even as simple as `Someconstructor; Someconstructor.prototype. = ` [06:49] TomY has joined the channel [06:49] isaacs: elliottcable: perhaps you should try writing simpler apis [06:49] elliottcable: hah [06:49] elliottcable: perhaps I should :D [06:50] elliottcable: anyway, I’m off. isaacs: hit me later if ryah or bnoord wants to talk to me about that pureeq! [06:50] sdwrage has joined the channel [06:50] isaacs: have fun [06:50] SubStack: most of my modules have a single export and it's a function [06:51] loob2 has joined the channel [06:52] versicolor has joined the channel [06:56] kenperkins has joined the channel [06:57] lv: can you suggest me where i t went wrong in my code http://pastebin.com/Y7YXgXBF ? [06:58] Aria: lv: Is there an error there? What doesn't it do that you expect it to do? [07:00] matyr has joined the channel [07:00] DennisRasmussen has joined the channel [07:01] mikolalysenko: what is the best way to do heap profiling in node right now? [07:01] n8ji has joined the channel [07:01] skm has joined the channel [07:01] mikolalysenko: specifically I just want to log all the memory allocations by line/filename [07:01] lv: suggested : check your server-side socket.io IP address to make sure it's what it should be. Then check your client-side code IP address and make sure it's pointing to your server socket.io correctly , But both IPs are same. [07:02] lv: when i run $ node server.js i got "info - socket.io started". when i lauched it in browser "Welcome to socket.io." is displayed, but not expected out come, any idea? how to test tehse? any other files required? [07:02] Aria: What IS the expected outcome? [07:02] EhevuTov: lv you should put your elements that contain or include external JavaScript. [07:28] mikolalysenko: Is there a way to track heap allocations in node.js/v8? [07:28] HT has joined the channel [07:28] mikolalysenko: I've been trying all night and am frankly at a loss... [07:29] mikolalysenko: I tried using v8-profiler, and ended up patching it to get it to work on the latest version [07:29] mikolalysenko: but the output it gives isn't much better than what you get with --log_gc [07:29] n8ji_ has joined the channel [07:30] mikolalysenko: I specifically want to try to find the line of code at which each allocation took place, much like valgrind's track-origins feature [07:30] nroot7 has joined the channel [07:31] nroot7: The module documentation for node.js says that calls to require are cached. It will return the exact same object across multiple calls to require [07:32] nroot7: Then what is the correct way to create multiple connection objects to server using simple-xmpp as it starts with xmpp = require('simple-xmpp') [07:33] EhevuTov: lv, do you have any error messages? [07:35] replore has joined the channel [07:35] replore_ has joined the channel [07:35] Morkel has joined the channel [07:37] Margle has joined the channel [07:37] lv: the same output as before, even after including [07:37] EhevuTov: lv, so you are getting error messages? What are they? [07:37] deoxxa: lv: don't prefix before what you type, it makes it look like a quote [07:38] lv: ok [07:38] ryanrolds: nroot7: Are you wanting to create one connection and use it several times? [07:40] deoxxa: nroot7: that's most likely returning an instance of the function; you can probably do `var x1 = new xmpp(), x2 = new xmpp();' [07:40] lv: its not an error message, in the browser i get only 'Welcome to socket.io.' in the console i get "info - socket.io started" nothing else [07:40] deoxxa: (though i'm not familiar with the package in question) [07:40] ryanrolds: deoxxa, I think you have it. [07:40] deoxxa: lv: can you pastebin some code? [07:40] herbySk has joined the channel [07:40] SamuraiJack has joined the channel [07:41] nroot7: ryanrolds: I want to make multiple client connections [07:41] DeltachaosDeskto has joined the channel [07:42] DeltachaosDeskto: hi @all [07:42] mmalecki has joined the channel [07:42] nroot7: deoxxa: var v = new xmpp(); returns error [07:42] ryanrolds: nroot7: Then deoxxa has it right. var conn1 = new require('SomeInterface')(); should work. [07:42] lv: here it is http://pastebin.com/4bMSRZFj [07:42] EhevuTov: lv, you don't have any HTML or code that would write "Welcome to socket.io" in your browser, right? [07:43] EhevuTov: ?yet you're seeing it [07:43] lv: yes, it is not there, even though i am getting it [07:43] ryanrolds: nroot7: In the module setup a constructor to make the connection. [07:44] EhevuTov: lv, I don't think you've loaded the right , lv [07:47] __doc__ has joined the channel [07:47] EhevuTov: deoxxa, I don't think he's running a web server to host the socket.io. It looks like it's just a socket.io server [07:48] deoxxa: socket.io is a web server [07:48] deoxxa: well, it creates one if it needs one, i mean [07:48] ninjapig has joined the channel [07:48] ninjapig has joined the channel [07:49] EhevuTov: hrm, I'll have to double check. If you're referring to the examples, it uses express to web serve; at least from my experience [07:49] deoxxa: io.listen(port) is roughly the same as io.listen(require("http").createServer().listen(port)) [07:49] EhevuTov: ah, interesting [07:49] ryanrolds: EhevuTov: That is my experience too. I wasn't ware that socket.io hosted it client code without Express. [07:49] deoxxa: you can also pass an express instance into .listen() [07:49] ryanrolds: *hosted it's [07:50] deoxxa: or anything that has the right methods on it, i suppose [07:50] ryanrolds: Right, but when you pass it to express it also binds additional routes to serve the client code is my understanding how how it works. [07:50] andrewreedy has joined the channel [07:50] deoxxa: ryanrolds: it takes over /socket.io, yes [07:50] k1ttty has joined the channel [07:51] ryanrolds: Does socket.io normally serve the client libraries without express? [07:51] deoxxa: yep [07:51] deoxxa: that's how we're using it at work [07:51] deoxxa: no express necessary [07:51] EhevuTov: how would you do that? [07:51] ryanrolds: Oh, learn something new everyday. [07:51] deoxxa: it's not actually binding it on express, but rather intercepting it on the http.Server instance afaik [07:51] CIA-48: node: 03koichik 07 * rcdec7e3 10/ doc/api/tls.markdown : docs: improvement tls example - http://git.io/hy5RFg [07:52] andrewreedy: Has anyone dealt with socket.io and antivirus blocking websockets? [07:52] EhevuTov: deoxxa, actually it looks like there might be an example on their site [07:53] deoxxa: andrewreedy: no, but i've dealt with a stupid corporate firewall - forcing it to polling mode sorted it out pretty quick [07:53] lv: neither this , nor this /usr/local/lib/node_modules/socket.io/lib/socket.io.js changing any out come. [07:54] deoxxa: lv: what do you get when you open http://localhost:8080/socket.io/socket.io.js in your browser? [07:54] andrewreedy: do you force it for all cases or just when it doesnt get fast response [07:54] n8ji has joined the channel [07:54] deoxxa: andrewreedy: for this one customer, all cases, unfortunately [07:54] ryanrolds: deoxxa: I get the feeling he hasn't worked with browser side JS before. [07:54] secoif: Hey guys, is there something like console.log that will also print out all prototype properties ? [07:54] lv: same out put as before: Welcome to socket.io. [07:55] deoxxa: hrm :/ [07:55] ryanrolds: lv: You're using Firefox right? Do you have Firebug installed? [07:56] EhevuTov: deoxxa, yeah, I'd have to see example on how to serve files straight out of socket.io I guess [07:56] EhevuTov: lv, that means that your library isn't loading properly, then [07:56] lv: sorry for previous what do you get when you open http://localhost:8080/socket.io/socket.io.js in your browser? it opens the file. [07:56] deoxxa: what file exactly? [07:56] EhevuTov: you need to find where the socket.io.js file is located and make sure you link to it [07:56] deoxxa: like, what do you see>? [07:57] lv: this file is Socket.io.js; /*! Socket.IO.js build:0.8.5, development. Copyright(c) 2011 LearnBoost MIT Licensed */ /** * socket.io * Copyright(c) 2011 LearnBoost * MIT Licensed */ [07:57] EhevuTov: lv, do a find /usr -name "socket.io.js" on your console and figure out where that file is [07:57] EhevuTov: hrm [07:58] EhevuTov: well, then