[00:03] Aria has joined the channel [00:03] davidsklar has joined the channel [00:04] _ry: isaacs: jonn, yes [00:05] isaacs: yeah, when i snuck a brief peek at hpricot, it was C, but using a lot of random little things in the ruby c api [00:05] isaacs: and built as a ruby add-on [00:05] isaacs: a jpricot project would be nice. [00:05] isaacs: ACTION wants to steal the letter J from Java [00:06] bmizerany has joined the channel [00:06] isaacs: so when people say "jython" or "jruby", then the person they're talking to will be like, "it runs on javascript?" [00:08] isaacs: nvm, this is indeed mostly ruby [00:08] mikeal has joined the channel [00:09] _ry: if why was a better hacker there'd be a bit more encapsulation [00:10] _ry: all those ragel machines could still be used [00:10] _ry: it's just you'll need to do a quite a bit of hacking [00:10] Aria: Yeaaah. [00:10] Aria: _Why's amazing, but not for code quality. [00:10] isaacs: Aria: yo [00:10] isaacs: Aria: your [00:10] mape: why? [00:10] Aria: Yo. [00:10] isaacs: Aria: you're going to give us the hpricot for javascript, yes? [00:10] Aria: _why the lucky stiff. Ruby's now-vanished zany developer. [00:11] mape: yeah but why [00:11] Aria: isaacs: Yes. Though not actually hpricot, more like Dom+HTML5 parser+whatever missing bits. [00:11] isaacs: right [00:11] isaacs: Aria: i'll have a patch for you with a package.json [00:11] Aria: Turns out it was really easy to get non-events DOM to work as a commonjs module. [00:11] Aria: Oh boy. [00:11] davidsklar has joined the channel [00:12] Aria: .oO(I hate language-specific packaging.) [00:12] isaacs: how would you feel about putting the dom.js in the repo rather than requiring that env-js be downloaded and built separately? [00:12] _ry: Aria: what's your poison? [00:13] Aria: RPM for RPMey linux, deb for Ubuntu and Debian, etc. [00:13] Aria: And making things so bloody simple to install that a tarball doesn't feel like pain. [00:13] mape: Rpm and dependencies hell [00:13] isaacs: Aria: the nice thing about package.json is that json is almost a universal data format. [00:13] Aria: Dependency hell exists when versions are pinned. It's a problem with any version-sensitive system. [00:14] Aria: isaacs: Yeah! One that no package manager out there uses! [00:14] Aria: And the C-style specify-suffix, path-search prefixes works really well. [00:14] isaacs: Aria: npm solves that problem. you get the versions you want, other programs can get other versions of the same package. [00:14] isaacs: Aria: i know of two package managers that do. [00:14] Aria: Yes. But where do you keep data files? [00:14] Aria: And systemwide and per-user config files? [00:15] isaacs: you install in a root. [00:15] Aria: Most of these systems try to ignore the platform, and I think that's a mistake. [00:15] isaacs: if you want to install in a different root, then that's fien. [00:15] isaacs: npm --root /path/to/whatever/ install npm [00:15] Aria: Because a lot of people choose the platform carefully, and things that distance themselves from it never work quite right, always having to write addon scripts to start and stop daemons, etc. [00:16] Aria: I'm a fan of going the extra mile and integrating with platforms, not abstracting away. [00:16] isaacs: Aria: i would like you to use npm and complain to me about it. [00:16] Aria: Alright. I'll have to do that. [00:16] isaacs: :) [00:16] Aria: You'll get a earful from a well-managed RPM linux, and OpenSolaris. [00:17] Aria: Both of which have strong ideas about how package management should work. [00:17] isaacs: Aria: this isn't really "package management" as much as "node program management" [00:17] Aria: (Basically, I want to say "myrpmtool install hook.io" ... and get V8, node, and hook.io installed as dependencies) [00:17] mikeal: i'm still using an npm from like a 2 months ago [00:17] isaacs: it's specifically tailored towards working with node programs (and, really, commonjs programs) [00:17] mikeal: and not having any problems [00:17] Aria: Hm. Interesting. I just hope it doesn't become another Rubygems. [00:17] isaacs: mikeal: there are a few things you can do with the new one. [00:17] isaacs: mikeal: like, actually install stuff that you published and tagged. [00:18] mape: npm vs kiwi? [00:18] isaacs: mikeal: circular dependencies, etc. [00:18] mikeal: i haven't had to install in a while [00:18] mikeal: i have all my local packages in dev mode [00:18] isaacs: mikeal: nice, me too. [00:18] Aria: (Ruby's C-style searching for libraries is super easy to understand. You can implement it in a line of code. Gems are ... thousands of lines. And changes to core stuff. It's just nuts.) [00:18] isaacs: that actually bit me, though, because the 0.1.0 npm drop didn't work unless you'd already had it installed previously *^_^* [00:18] isaacs: Aria: npm just puts packages where node expects to find them. [00:19] Aria: Gooood, good. [00:19] Aria: ~/.node_libraries? [00:19] Aria: Nothing to add to the path? [00:19] isaacs: Aria: by default, yes. [00:19] isaacs: Aria: if you add a different root, then it'll obey. [00:19] Aria: Excellent. [00:19] isaacs: npm config set root /usr/local/lib/node_libraries or whatever [00:19] Aria: Where's the config stored? [00:19] isaacs: it's up to you to make sure that node knows where to find shit [00:19] Aria: ++ [00:20] isaacs: Aria: right now, it's in ~/.npmrc only. [00:20] Aria: That's sane. [00:20] Aria: Okey, so it's user-level. [00:20] isaacs: Aria: but i'd like to make that configurable, and have system and local confs [00:20] Aria: ACTION nods. [00:20] isaacs: later [00:20] mikeal: i really like the "activate" system [00:20] Aria: /etc/ on unixes, /opt/npm-version/etc on Solaris, the registry in Windows. [00:20] mikeal: so it can sufficiently resolve multiple versions of the same package [00:20] isaacs: Aria: i would look at whatever process.installPrefix is [00:21] isaacs: Aria: i assume that node is sitting in what you'd like to use as your root [00:21] Aria: mikeal: I think the C way is better. Just put !@#!@# version numbers in your paths. And use semver-style numbering. [00:21] mikeal: Aria: if packages are installed in ~/.node-libraries then it's a per user application so ~/ makes more sense than /etc [00:21] isaacs: Aria: actually, that's what it does. [00:21] Aria: Good! [00:21] mikeal: activate just sets the "default" package [00:21] isaacs: Aria: when you install npm, you'll notice that you have npm, but you also have npm-0.1.2 [00:21] mikeal: so if you don't have a version dep declared and do an import that's the one you'll get [00:21] Aria: mikeal: Sure, if you're installing a user-local copy. But if you're installing a daemon into the system, you don't want it in a user's homedir. [00:21] mape: isn't the issue more that there isn't a standard of how to require stuff? [00:22] isaacs: 0.1.2 is the active version, so the symlink points from there to the unversioned copy [00:22] mikeal: it's not require's job to resolve versions [00:22] Aria: mape: A bit. But I'm content working with just node and then telling the commonjs folks that there's better ways. [00:22] mape: instead of doing require('module') people start prefixing and unshifting and whatnot [00:22] Aria: Yeah. They should stop that. [00:22] Aria: (I wish node has a -I.) [00:22] mape: well seems the same in node [00:22] Aria: Yeah, they should be using NODE_PATH [00:22] isaacs: Aria: well, it's not quite fair to compare npm to rpm or yum or dpkg [00:22] mape: especially modules that use a lot of other modules [00:22] mikeal: isaacs: did you finally land all those require rewrite patches in node? [00:23] isaacs: mikeal: _ry nudge ^ [00:23] Aria: Aria: Nah. You're more likely to get comparisons to gems and rpa [00:23] mikeal: isaacs: so npm is still using all the same workarounds for require path stuff? [00:23] isaacs: Aria: yeah, that's a fairer comparison. or, maybe pear or cpan [00:23] Aria: Yeah. [00:23] onar has joined the channel [00:23] mikeal: or easy_install [00:23] isaacs: mikeal: well, it's just assuming that it'll work. if you actually do require("foo") multiple times against multiple different versions in the same session, it'll break. [00:23] mikeal: ACTION giggles [00:24] mikeal: right [00:24] isaacs: mikeal: the increasingly inappropriately named easy_install? [00:24] Aria: (I've just fought Gems for years. They make it REALLY REALLY hard to not use. Program code depends on the packaging, it uses introspection far too much. Simple stuff gets complex. [00:24] Aria: ) [00:24] mikeal: it was *never* easy [00:24] isaacs: Aria: my goal wiht npm has been to make run-time use of npm strongly discouraged. [00:24] Aria: isaacs: The beauty of require and such is that you /can/ isolate stuff -- a = require('foo-1.0'); b = require('foo-2.0') [00:24] isaacs: Aria: it's a package manager, not a server. [00:24] Aria: GOOD. [00:25] Aria: And installing into the node_libraries is win that way. [00:25] isaacs: Aria: right, and i do, but there are some tricky things you can do to make loading dependencies more simple. [00:25] Aria: That's where gem activation went wrong. [00:25] Aria: Yeah? Like? [00:25] mikeal: Aria: actually, you can just require('foo') and in your package.json file specify the version you require and npm will handle the version resolution [00:25] isaacs: Aria: ie, if your package has { "dependencies": { "foo" : "1.0.0 - 2.0.0" } } let's say [00:25] Aria: (if you depend on foo-1.0, require('foo-1.0')! that's the beauty of doing it that way.) [00:25] isaacs: Aria: you can then do require("foo"), and yo'ull get whichever version satisfied. [00:25] Aria: Oh, ew -- see, that's npm getting used at runtime, like Gems. [00:26] Aria: And that's dangerous water. [00:26] isaacs: Aria: if another package requires foo 2.0.0 - 3.0.0, then it can *ALSO* do require("foo") and get the version that it required. [00:26] mikeal: i don't want to go through all my code and change the version in my require statements, i just want to change the version in the package metadata [00:26] isaacs: Aria: however, unlike gems, this is what people are already doing in their code. [00:26] mikeal: this is really ugly in Ruby and Python because of… well…. Ruby and Python [00:26] Aria: Yeah. It just means you're dependent on npm to keep it working. [00:26] isaacs: Aria: but they're just doing require.paths.unshift("./deps/") or whatever. [00:26] mikeal: node is a lot cleaner [00:27] isaacs: Aria: so, actually, you *can* do this now, and people are doing it, but you can also do it with npm, and it'll work better, and be more maintainable. [00:27] Aria: I'd rather keep require as-is, and if you put version numbers in the code, you're declaring right there what API you expect. [00:27] isaacs: Aria: and npm supports your use case :) [00:27] mikeal: that gets hard to maintain [00:27] mikeal: but yeah, you can do that [00:27] mikeal: but also, remember that it's a version *lock* on that version [00:27] isaacs: Aria: actually, that's the easier use case to handle. [00:28] mikeal: it's not a semver definition of the version you're importing [00:28] Aria: Yeah. Which is a bit sad, I think [00:28] mikeal: unless you want to override require completely, you can't do it [00:28] mikeal: and overriding require is messy [00:28] Aria: Yeah, don't do that [00:28] isaacs: Aria: that was a result of a lot of heated discussion [00:29] isaacs: Aria: my decision was, in the end, you just can't trust people to use semver wisely, and the rules are highly non-obvious [00:29] mikeal: overriding require means that package mangers are going to step all over each other [00:29] mape: hmm is there any way of making the require path additional? [00:29] isaacs: Aria: everyone thinks that they know how semver is supposed to work, and no one agrees on it, and everyone thinks that everyone else is wrong. [00:29] mikeal: it's the worst possible way to do this [00:29] isaacs: mikeal: ++ [00:30] mikeal: isaacs: yeah, that commonjs thread is hilarious [00:30] isaacs: though, doesn't kiwi have its own require statement that isn't global? [00:30] mape: like require('myModule', './node-mymodule/lib/'); and the second path is only used if the first one failed (ie it isn't in node_libraries) [00:30] isaacs: the only thing anyone agrees on with semver is what is greater or less than what. [00:30] isaacs: so that's all that npm uses [00:30] mikeal: probably, i just remember it making me angry, that might have been why :) [00:30] steadicat has joined the channel [00:30] mape: or an array of paths even [00:31] isaacs: mape: require.paths.push("./node-mymodule/lib"); require("myModule"); require.paths.pop() [00:31] mikeal: the semver argument is pretty nuts [00:31] mape: isaacs: Hmm yeah [00:31] rektide: christ so much backlog to read [00:32] mikeal: i try to comply with the definitions, but strictly semver means that you're depending pretty strongly on people not fucking that up [00:32] mape: Guess the unshift is the best way of doing it [00:32] Aria: Works for GNOME [00:32] Aria: They use semver-style versioning [00:32] mikeal: mape: node's import system is sane enough to do unshift cleanly [00:32] _ry: package management is such a hard problem - just thinking about it depresses me [00:32] mikeal: Aria: between gnome projects [00:32] mape: yeah [00:32] mape: hehe [00:32] isaacs: mape: if you want to use your path as the lowest-priority, you want push. if you want to ensure it gets your version, you should use shift [00:33] mape: yeah [00:33] mikeal: they don't depend on a third party to not fuck up their version definition [00:33] isaacs: _ry: it's not as hard as it looks. [00:33] mape: faster to use unshift then since that makes sure there is only one lookup [00:33] Aria: mikeal: Yeah, which is its scope! It could just as well work in the scope of node projects or commonjs projects [00:34] Aria: Someone just has to write it up clearly and early. [00:34] rektide: isaacs: right! it only took debian 7 years to get vaguely correct, and archive.org to provide snapshots.debian.org to make it all not suck [00:34] mikeal: i can't just start a gnome project on github :) [00:34] isaacs: rektide: right, and i cheated a lot, so it just took me 7 months [00:34] mikeal: and expect the integration to work [00:34] isaacs: rektide: cheat #1: only do nodejs packages :) [00:36] isaacs: Aria: it turns out, just requiring semver-compliant versions, and using the semver semantics to compare package versions (to know this is > or < that, etc.) then that's all a pm needs. [00:36] Aria: Yeah. It really helps. [00:36] Aria: semver is win [00:36] isaacs: the whole "it's ok to update from 0.1.2 to 0.1.3, but not from 0.1.2 to 0.2.3" that shit is WONKY [00:36] mikeal: the whole 1.1 definition can resolve to 1.1.9 thing is what doesn't work [00:36] isaacs: that's what no one agrees on [00:37] mikeal: because someone will, eventually, fuck that up [00:37] _ry: you just can't trust people to use semver though [00:37] mikeal: and you won't have a mechanism to lock to a version earlier than 1.1.9 [00:37] isaacs: _ry: right. node doesn't even use it ;P [00:37] robrighter has joined the channel [00:37] mikeal: well.... [00:37] _ry: try as i might - and having full control of node - i can't even get node ot do it [00:37] _ry: versions tend to have meaning beyond the API [00:37] isaacs: semver is overrated [00:37] mikeal: semver says that anything pre-1.0 is is fair game [00:37] _ry: you know - like what gets put on a box [00:38] isaacs: _ry: ++ [00:38] rektide: arguing that we cant trust package maintainers to maintain packages seems like a null argument [00:38] rektide: its absolutely true, but there's no sense safeguarding against it [00:38] isaacs: _ry: there's a social element to the version that is chosen. it's a signal. [00:38] isaacs: rektide: we can trust pms to maintain packages, but we can't trust package authors to agree on very much. [00:38] isaacs: rektide: npm trusts package owners to own their packages. [00:38] isaacs: and that's about it. [00:38] mikeal: rektide: we *do* need to give people the tools depend on a version definition range when maintainers screw that up [00:39] _ry: its very difficult to use code that you yourself have not installed and witnessed working [00:40] _ry: be this a different version of the same package or something completely new [00:40] mikeal: totally [00:40] Aria: Yeah. I'd love to see a node distro, that edits software and makes it work together [00:40] _ry: i like all my bits where i want them [00:40] Aria: That's something that really helps quality. [00:40] _ry: s/like/want/ [00:40] mikeal: this whole dream world where we can just assume that people won't break their code when they push a new version that is +0.0.1 is insane [00:40] _ry: like - i want to test my software in a certain configuration and give it to my users [00:41] _ry: in that same configuration [00:41] isaacs: I forget who said that the tragedy of AI was that we tried to get the software to write our software, but it turns out that software doesn't mind bugs, so the software it writes is shit. [00:41] _ry: split up packages too much always leads to breakage [00:41] _ry: cpan has a pretty good model [00:42] _ry: with the testing stuff [00:42] mikeal: cpan looks really nice from the outside, i always admired it compared to what Python was doing [00:42] _ry: package management and build systems.. fuck [00:42] mikeal: but then when you talk to perl people, all they do is complain about how it's shit [00:42] _ry: the hardest problems known to man [00:42] rektide: writing code to load or compile code... :( [00:42] mape: that and naming variables [00:42] rektide: seriously i must have spent 1/8th my programming doing that [00:43] rektide: bah, variable naming is easy. a, b, c, d.... ;) [00:43] mikeal: naming variables is easy, naming projects is a pain in the ass [00:44] rektide: i'm down with that [00:45] mikeal: github needs a random project name generator [00:45] _ry: maybe project names are part of the problem [00:45] Aria: Oh, yeah, you need to separately test and make _sure_ versions work as advertise. [00:45] _ry: maybe we need a semname [00:45] Aria: I'd take a semver version as a claim, not a fact. [00:46] Aria: (but then you know who to blame if it changes) [00:47] _ry: of course if you have a very nice static language you can just anaylize your software [00:47] _ry: and find out what interfacs it provides [00:47] Aria: Build systems suck. Mostly double so if you invent your own. [00:47] mikeal: yeah, that always works out as advertised :) [00:47] _ry: http://www.haskell.org/hoogle/?hoogle=(a+-%3E+b)+-%3E+[a]+-%3E+[b] [00:48] _ry: ^-- this is how it should be [00:48] mikeal: we need a search engine for node stuff [00:48] mikeal: because it's un-fucking googleable [00:48] thotypous has joined the channel [00:48] mjr_: the project name generator needs to only pick words that will show up properly on searches [00:48] rektide: whomever came up with ".net" should literally be shot [00:49] rektide: maybe like, in the hand or something [00:49] _ry: what if we just had like a project registery [00:49] _ry: where you go and say - hey i released this tarball [00:49] jwm: heh I like .net [00:49] _ry: (upload) [00:49] mikeal: _ry: i wrote that :) [00:49] _ry: it has these tags [00:49] mikeal: jsregistry [00:50] mikeal: it's a registry for commonjs packages [00:50] rektide: jwm: as a name, .net is criminally un-findable. [00:50] mape: kinda writing one [00:50] isaacs: _ry: that's what npm uses [00:50] mikeal: npm has a command line utitliy to upload to it [00:50] isaacs: mape: you should use the one that npm is using, then we can share :) [00:50] _ry: isaacs: but it has to have a website [00:50] mikeal: it will [00:50] isaacs: _ry: so, it doesn't have a website yet. unless you really like json [00:50] isaacs: but it'll be at npmjs.org [00:50] _ry: mikeal:link? [00:50] jwm: why not nodejs portage hehe [00:50] jwm: :) [00:50] mikeal: to the code or to one running? [00:50] isaacs: _ry: http://registry.npmjs.org [00:50] isaacs: g [00:50] mikeal: it's a couchapp [00:50] jwm: nodeage [00:50] jwm: heh [00:50] isaacs: _ry: http://registry.npmjs.org/npm [00:51] isaacs: _ry: http://registry.npmjs.org/npm/stable [00:51] mape: isaacs: nefD fixed one that fetches from github with all the modules [00:51] isaacs: _ry: http://registry.npmjs.org/npm/0.1.2 [00:51] _ry: isaacs: cool [00:51] Aria: HEhe. Ruby has this registry. raa. I'm sad nobody uses it anymore. [00:51] mikeal: this looks really pretty if you have JSONView installed [00:51] mikeal: :) [00:51] _ry: isaacs: so i just want an html form to fill out whenever i update postgres-node and test it [00:51] mape: isaacs: any way of just listing all modules? [00:51] mikeal: the nice thing about this is that you can use CouchDB replication to keep one inside your firewall or create a mirror [00:52] isaacs: _ry: you can use npm publish [00:52] mikeal: http://registry.npmjs.org/ [00:52] mape: There are only 4? [00:52] isaacs: mape: atm. and it's one namespace. go claim some stuff!! [00:52] mikeal: only isaacs is pushing to that one at the moment [00:52] isaacs: mape: it wasn't working until last night (this morning, really) [00:52] mape: Ah k [00:52] Azeroth______ has joined the channel [00:53] _ry: also - i really want a "node -e" flag [00:53] isaacs: mape: but please, do use it. don't be intimidated by the empty dance floor. [00:53] _ry: node -m sys -e "puts('blah')" [00:53] Aria: YES please. [00:54] mape: isaacs: http://nodecode.info/ Kinda the same idea (dummy prototype fake info etc etc) but it fetches from github so the list is bigger from the start [00:54] _ry: we should probably have node execute the repl if it's started without a script or -e flag [00:54] mikeal: http://github.com/mikeal/js-registry [00:54] _ry: instead of the separate binary [00:54] softdrink has joined the channel [00:54] mikeal: that's sane [00:54] _ry: (and we really need readline!) [00:55] isaacs: mape: wanna put something like this in top of the jsregistry? [00:56] mape: isaacs: Just a frontend? [00:56] isaacs: mape: sure. [00:56] mikeal: isaacs: we need a web pages, like…. with HTML :) [00:56] isaacs: basically, i'd like an html front end in front of everything that you can do with the jsregistry [00:56] mikeal: couchdb does that ;) [00:56] mikeal: _show and _list :) [00:56] isaacs: they're all just PUT and GET requests, after all. we could make it respect POST as well as PUT [00:56] mape: Guess it shouldn't be a problem, gotta get nodecode done first, and some other thingys [00:56] mape: And the docs if they need more work [00:57] isaacs: no reason why you couldn't create a user account, or push a package, or modify tags, all from the web site. [00:57] mikeal: the auth/user stuff is all just couchdb [00:57] mikeal: there is already a jquery lib to do it :) [01:02] mape: isaacs: so the jsregistry is just the web end of npm? [01:02] isaacs: mape: the jsregistry doesn't actually know anything about npm [01:02] isaacs: mape: npm is just a client [01:02] mape: Oh k, so just node modules? [01:02] isaacs: mape: npm is the *only* client.... [01:02] mape: Or commonjs? [01:02] mikeal: yeah, you could stick narwhal commonjs packages in it [01:02] isaacs: mape: if you want to start dropping stuff into there, sure. [01:02] isaacs: go nuts [01:03] mikeal: you can see the web api in the readme on http://github.com/mikeal/js-registry [01:03] isaacs: mape: just put the "engines" designation in your package.json if it's only for narwhal or only for node or whatever. [01:03] mikeal: the only hard part is doing auth, which you should just look at the npm source to figure out [01:03] mikeal: wait, will npm push non-node packages to the registry? [01:04] mape: Hmm k, I'll take a look at it tommorow, 3AM here so my head isn't in the mood for tango [01:04] isaacs: mikeal: sure. it won't push packages it can't understand. [01:05] isaacs: and it won't *install* non-node packages [01:05] isaacs: oh, he's gone... [01:06] Aria: Alright. Time to try npm then. [01:07] derbumi has joined the channel [01:11] tmpvar has joined the channel [01:11] tmpvar: Aria, yo [01:12] mscdex has joined the channel [01:16] mikeal has joined the channel [01:17] isaacs: Aria: that's great news. [01:19] Aria: Heh. Well. npm is hanging installing. [01:19] Aria: At npm fetch http://waitdownload.github.com/isaacs-npm-v0.1.2-0-g59e69c9.tar.gz [01:22] tmpvar: Aria, you are writing a html5 parser, right? [01:24] Aria: Yes I am. [01:24] tmpvar: where can I find it? :P [01:24] Aria: Pretty significantly along, though the parsing spec is a fiddly beast, and I'm going through test cases like mad. [01:25] Aria: http://github.com/aredridel/html5 [01:25] Aria: http://github.com/aredridel/env-js is a fork of env-js that provides a DOM to parse into [01:25] tmpvar: oh yeah? you actually got env-js working on node? [01:25] Aria: The DOM part anyway. [01:26] Aria: No events module or anything like that. [01:26] Aria: I'll get there, but parser first. [01:26] tmpvar: got ya [01:26] tmpvar: you're making me feel silly now, hah [01:26] Aria: (I also intend to do a Jaxer style runat='server' to run Javascript.) [01:26] isaacs: Aria: putting published tarballs in couch directly is high up on the todo list [01:27] isaacs: Aria: github's tarballer is a jerk. [01:27] Aria: Ah, now, it gives EACCESS at npm writeShim to: /usr/local/bin/npm-0.1.2 [01:27] Aria: Weird to have a user-level installer not run as the user. [01:27] isaacs: Aria: you don't own /usr/local/bin, i take it? [01:28] pjb3 has joined the channel [01:28] Aria: 'course not. It's a multiuser system. [01:29] isaacs: Aria: then, if that's where node lives, you must use sudo [01:29] tmpvar: Aria, if you are interested -- http://github.com/tmpvar/jsdom [01:29] isaacs: Aria: you could, of course, compile node with ./configure --prefix=$HOME/node or something [01:29] Aria: ACTION nods. [01:29] tmpvar: i'd like to hear what you think of the project when you get a chance [01:29] Aria: Spiffy, tmpvar [01:32] Aria: Organization of the code seems odd. Got any simple examples of how to use it? [01:32] Aria: Code looks clean. [01:32] tmpvar: 1 sec [01:33] tmpvar: http://github.com/tmpvar/jsdom/blob/master/example/pure/run.js [01:33] tmpvar: in order to use browser libs I was having to stub out the window a bit. also its parserless (part of the minimal/useful aspect) [01:34] tmpvar: there have been some window augmentation methods moved into lib/browser/ so that example could be a bit smaller [01:34] Aria: Good good. [01:35] BryanWB has joined the channel [01:36] Aria: The setup there is a bit funky, but for efficiency in minimal cases, I can see why you do it that way. [01:36] Aria: I'd wrap that up and make a very simple setup method that does it all. [01:36] saikat has joined the channel [01:36] tmpvar: Aria, you mean the innerHTML setup and all that noise? [01:37] BryanWB: how can I free a Buffer that I have allocated? is "delete mybuf" the best way? [01:39] Aria: No, I mean the assembling the DOM + BOM and all that, getting it ready to use in the main namespace. [01:40] tmpvar: that makes sense. I think Dav's work has made this much much cleaner. I'll peek around for a newer example [01:40] Aria: (So one could with(dom) { code-that-runs-in-a-browser } ) [01:40] bpot has joined the channel [01:41] tmpvar: this is a better:: http://github.com/tmpvar/jsdom/blob/master/lib/browser/browser.js [01:41] tmpvar: a better example* [01:41] isaacs: tmpvar: mjsunit.runner says it has "mjsunit" as a dependency. where do i get mjsunit? [01:41] tmpvar: it comes with node [01:42] tmpvar: oh wait. hah [01:42] tmpvar: its inside :/ [01:42] isaacs: is it this? http://v8.googlecode.com/svn/trunk/test/mjsunit/mjsunit.js [01:42] tmpvar: yeah, but I'm actually shipping a modified version (to avoid modifying 1300 tests) [01:42] Aria: Nice, tmpvar. That's more straightforward (though having the function windowAugmentation read as a noun and not a verb is distinctly weird.) [01:42] isaacs: tmpvar: i see [01:43] Aria: Man, I'll have to test the html5 parser against this. Should Just Work [01:43] isaacs: tmpvar: it'd be nice if either mjsunit.runner didn't list it as a dep, or if it was clear where to get it from. [01:43] tmpvar: isaacs, ill fix now [01:43] isaacs: tmpvar: thanks!! [01:44] binary42 has joined the channel [01:44] tmpvar: im just going to remove it heh, i had to add a msg param to the front of all of the asserts. Ideally it wouldn't need any of this crap. [01:45] isaacs: tmpvar: that works [01:46] tmpvar: k, pushed [01:46] tmpvar: Aria, yeah that would be interesting :) [01:46] BryanWB: isaacs: w/ your latest version of npm, compiles fine for me on fedora 12 [01:46] isaacs: BryanWB: which does? [01:47] tmpvar: and I agree with the name of window/browser-Augmentation [01:47] BryanWB: isaacs: npm [01:47] isaacs: BryanWB: AH, ok, great :) [01:47] isaacs: i thought you were talking about mjsunit.runner ;P [01:50] isaacs: tmpvar: http://github.com/isaacs/jsdom/commit/f69588ee4318aa74e7db8ccccb495ba15347379e [01:52] tmpvar: fail mode ;) [01:52] isaacs: fail mode? [01:52] tmpvar: on my part heh [01:52] isaacs: ah, no worries [01:53] isaacs: that's why i like comma-first, though. makes that error more impossible. [01:58] phazm: anybody know how to /send/ an email with email.js? The only example given is receiving [01:58] sprsquish has left the channel [01:58] sprsquish has joined the channel [02:14] jedschmidt has joined the channel [02:21] mnutt has joined the channel [02:25] Azeroth______: has anyone started work on a 3d math lib for node.js yet? [02:29] Azeroth______: if not am going to look at porting OpenTK.Math [02:31] foucist has joined the channel [02:31] saikat has joined the channel [02:31] foucist: hello, has anyone thought about nodejs as a browser plugin? [02:33] JimBastard has joined the channel [02:35] foucist: looking at getting browser 2 browser connectivity, possibly using the websockets stuff.. nodejs as a browser plugin might be the way to go [02:35] foucist: a real platform [02:36] isaacs has joined the channel [02:37] jwm: a real platform hehe [02:37] BryanWB: isaacs: it would be great if you could put a todo list in the npm wiki, i might try to take a stab at it [02:47] mnutt: has anyone here done much with node-mongodb-native driver? it's not handling cursors as I'd expect (it looks like it's trying to load the whole dataset into memory before iterating) [02:47] JimBastard: is that orlandov_ 's thing [02:48] mnutt: JimBastard: you mean node-mongodb-native? I think it was done by christkv. Is there a preferred node driver? [02:48] JimBastard: ahh wrong person [02:48] JimBastard: sorry [02:53] mjr_ has joined the channel [02:54] tmpvar: JimBastard, you scared him away [02:54] tmpvar: way2go [02:54] JimBastard: :-( [02:54] JimBastard: i think ive halped more people then ive scared away [02:55] JimBastard: soo sleepy [02:55] tmpvar: long day eh? [02:55] JimBastard: yeah [02:55] JimBastard: ive got 9 named events in brood mother spawning process now [02:56] JimBastard: those nested if else statements were started to make me cry [02:56] tmpvar: lol [02:56] tmpvar: horrah for events [02:56] JimBastard: i gotta get the basic admin interface and the rest api working asap [02:56] JimBastard: once this is done [02:58] tmpvar: nice [02:59] BryanWB: for a locally running node process, is there any way I can pipe data to its stdin? [02:59] JimBastard: i think so ya BryanWB [02:59] BryanWB: much like I can send it a signal w/ kill? kill -s SIGFoo PID [02:59] JimBastard: it should be in the docs [02:59] BryanWB: JimBastard: tks [02:59] mjr_: yes, all of that works. [02:59] JimBastard: theres a lot of powerful stuff in the built in modules [02:59] JimBastard: you'd be surprised [03:00] BryanWB: JimBastard: though i didn't see anything in process module, but i am only 1/3 way through api ;) [03:00] JimBastard: yeah mang [03:00] JimBastard: ACTION hits BryanWB with the noob stick. [03:00] BryanWB: ACTION parries the blow [03:00] mnutt has joined the channel [03:00] JimBastard: :-( [03:00] JimBastard: go read [03:01] BryanWB: am reading ;) [03:01] tmpvar: haha JimBastard is getting cranky [03:01] JimBastard: too...many...javascripts... [03:02] tmpvar: JimBastard can you write me a mouse trails script? [03:02] tmpvar: i want unicorns and rainbows [03:02] tmpvar: to emit from the cursor [03:02] mjr_: boom [03:03] tmpvar: haha [03:03] mjr_: So, speaking of node.js, I'm looking forward to noding it up at Yahoo on Wednesday. [03:03] mjr_: node-ing? [03:03] tmpvar: nice [03:03] Azeroth______: o? [03:03] tmpvar: are you going to be sitting the audience? [03:03] robrighter has joined the channel [03:03] mjr_: My underscores! [03:04] mjr_: I'll be in the audience. [03:04] tmpvar: cool, I'm presenting after the _ry [03:04] mjr_: cool [03:04] mjr_: I actually knew that, which is why I mentioned it in the first place once I saw you were here. :) [03:05] tmpvar: huzzah! [03:05] mjijackson has joined the channel [03:05] mjr_: I'm going to ask like, really hard questions. [03:09] mjr__ has joined the channel [03:09] Azeroth: what? like 'which is better vi or emacs' ? [03:09] Azeroth: kekeke [03:10] tmpvar: eclipse [03:10] tmpvar: heh heh [03:10] Azeroth: notepad++ here [03:10] Azeroth: :D [03:10] Azeroth: it has more plus then the others [03:10] tmpvar: windoze [03:10] mjr__: Which is better, emacs on Linux with JSLint or vim on OSX with comma-first? [03:12] BryanWB: i would love to know how to use jslint w/ emacs [03:13] BryanWB: ACTION googles [03:13] tk: tmpvar: welll have a single use case working with libxml... now to see if it will work when I add in the others [03:13] tmpvar: heh [03:14] PyroPete1 has joined the channel [03:15] polotek has joined the channel [03:16] polotek: Did anybody else get contacted by Manning publishing about a node.js book? [03:17] creationix: polotek: I did [03:17] creationix: well, they wanted me to review a proposal [03:18] polotek: yeah [03:18] polotek: so is it legit? [03:18] tk: polotek: everybody knows Manning publishing doesnt deal with books... :P [03:18] polotek: except me [03:19] Azeroth: and me [03:19] creationix: I think they're crazy for trying to print a book on node, it will be obsolete before it's even in print [03:19] creationix: half the time that's true of my blog posts [03:20] phazm: I haven't found a working script to allow me to send an email from node.js -- anyone know of one? [03:20] Aria: phazm: Send using a child process like sendmail, or speak to an SMTP server? [03:21] phazm: don't really care, just want to send an email on error :) [03:21] tk: creationix: ya, problem with JS books in general (except pure JS books anyways) [03:21] softdrink has joined the channel [03:21] mjr__: phazm: spawning /usr/sbin/sendmail as a child_process should be pretty easy [03:21] creationix: I think a good book about node would be great as soon as the core api is stable, something like the pickaxe for ruby [03:22] creationix: but till then, it's a waste of paper [03:22] mjr__: Yeah, writing about node ON PAPER seems strange. [03:22] Aria: Mmm, pickaxe. [03:22] inimino: who's writing it? [03:22] mjr__: Remember those "Internet Yellow Pages" books that used to be found in bookstores before people realized that search engines were a thing? [03:23] tk: creationix: but if Manning does something like Oreilly with the small PDF books pre-publishing... it could hold over until it is stable maybe before publishing [03:23] creationix: actually, I think that's the goal [03:23] creationix: I'll review the proposal tomorrow and give them some feedback [03:23] colin___ has joined the channel [03:24] phazm: I'm about 20% through printing wikipedia for resale. [03:24] mjr__: phazm: http://github.com/aheckmann/node-email/tree/v0.0.1 [03:24] phazm: thank you mjr__ [03:24] mjr__: It's funny that you asked for that, and about 10 seconds later it came across my twitter. [03:25] creationix: mde: how much do you have written so far? [03:25] mde: Just the TOC, and that's a rough roadmap. [03:26] mde: I'm interested in what people want to see. [03:26] creationix: good luck, I'll review it tomorrow with some suggestions [03:26] mde: And of course in what will keep it from being basically a doorstop on the print date. :) [03:27] tlrobinson: anyone know what "Resource temporarily unavailable" typically means? [03:27] mde: That would be much appreciated. [03:27] mde: Books on stuff this new are always potentially dicey, but it also conveys some legitimacy, which is pretty worthwhile I think. [03:28] creationix: agreed [03:28] _ry: tlrobinson: node error? [03:28] _ry: tlrobinson: EAGAIN? [03:28] tlrobinson: _ry: yeah... but it's on kriskowal's narwhal/node stuff [03:29] tlrobinson: i don't know [03:29] _ry: i believe "Resource temporarily unavailable" is strerror(EAGAIN) [03:29] _ry: *shrug* [03:30] tlrobinson: i'll bug kriskowal [03:33] micheil has joined the channel [03:33] rednul has joined the channel [03:34] mnutt_ has joined the channel [03:35] polotek has left the channel [03:36] micheil: anyone know a matthew eernisse? [03:37] inimino: mde? [03:38] mde: Yes, that's me. :) [03:38] inimino: lucky guess :) [03:38] micheil: mde: ah, okay [03:38] mde: It's a hell of a lot easier than trying to coach people on the last name spelling. [03:39] micheil: mde: no, I was looking up some node.js stuff, and your name came up, wasn't sure who you were in here [03:39] mde: Yeah, just lurking. [03:41] _ry: micheil: how's the 'upgrade' stuff? [03:41] micheil: it's awesome. [03:41] _ry: cool [03:41] micheil: _ry: my websocket server now works and accepts connections from chrome, in much less code then before. [03:42] _ry: good [03:42] tk: mmmm strawberries [03:42] micheil: _ry: when are you expecting the node api to stabilise? would you call it fairly stable now? [03:43] _ry: i would call it fairly stable right now [03:43] micheil: okay, good good [03:43] _ry: i should probably call a halt on new features at some point [03:43] _ry: but it seems like there isn't anything big really [03:43] _ry: there's just many bugs [03:45] mde: I'm headed home, back on later, y'all. :) [03:48] isaacs has joined the channel [03:49] micheil: _ry: crypto stream out of net.Stream, that could surely mean streaming crypto into a db or file? [03:49] polotek has joined the channel [03:55] mjr_ has joined the channel [03:56] isaacs: hey, what's the cool trick to find out the memory size of node's process? [03:56] mjr_: process.memoryUsage() [03:57] mjr_: ? [03:57] Aria: Oh, hey, isaacs. [03:57] ayo has joined the channel [03:57] isaacs: mjr_: ahh, that's it. thanks! [03:57] WALoeIII has joined the channel [03:57] Aria: isaacs. . . Took four tries to install npm. [03:57] isaacs: Aria: yikes. [03:58] isaacs: Aria: i think it might be something wonky with the "binary" encoding. fs and http both speak buffer now, right? [03:58] Aria: Not sure. I was gonna investigate that soon. [03:58] isaacs: Aria: you can also do "./cli.js link ." [03:58] mjr_: Sometimes node's edge is particularly bloody. [03:59] isaacs: Aria: and, of course, it could just be the fact that sometimes github gives you an error code rather than a tarball [03:59] Aria: Could be. [03:59] isaacs: Aria: it'd be nice to have it try again if it gets an invalid content-type.. [03:59] Aria: Yeah. [03:59] Aria: Or an error code. [03:59] isaacs: ACTION goes back to the todo list... [04:00] Aria: Heh, now I get EACCESS trying to use it, since I installed with sudo. [04:01] isaacs: Aria: make sure to chmod 0755 the bin [04:02] kriskowal_ has joined the channel [04:02] Aria: Which bin? [04:02] isaacs: Aria: it should chmod 0755 the bins automatically.. [04:02] isaacs: Aria: $(which npm-0.1.2) [04:02] isaacs: that one [04:02] Aria: It is. [04:02] Aria: It's ~/.node_libraries/.npm that's wrong, I think [04:03] Aria: (Also, the error doesn't say) [04:03] jsilver: LEMME SEE A SCREENCAST ABOUT NODE!!! [04:03] isaacs: yeah, still some better debugging to be done. [04:04] isaacs: there are some cases where i'm lazy, and just throw an fs.doSomething() directly in the code, and throw whatever comes out if its an error [04:04] charlesjolley has joined the channel [04:06] isaacs: Aria: all the dirs it creates should be 0755 [04:06] isaacs: Aria: but i wonder if somehow when it copied over the tarball, it's not exe-able [04:06] Aria: It runs, just gets EACCCESS running npm ls [04:06] Aria: Not sure where. [04:07] jsilver: hey [04:07] jsilver: any thoughts on express? [04:07] jsilver: haml-js? [04:08] jsilver: datastore APIs? [04:08] dgathright has joined the channel [04:11] towski has joined the channel [04:16] kriszyp_ has joined the channel [04:17] Yuffster_ has joined the channel [04:18] cainus__ has joined the channel [04:19] mediacod1r has joined the channel [04:19] digitals1aghetti has joined the channel [04:22] Aria: Also, isaacs, I get a CALL_NON_FUNCTION with npm help [04:23] mikeal has joined the channel [04:24] isaacs_ has joined the channel [04:24] mjr_: jsilver: I don't have any opinions on those things you mentioned, because I don't use them. I suspect that they are all fine. [04:24] jsilver: what's everybody's favorite node backend data store [04:25] jsilver: i'm sold on node and want to write an app [04:25] isaacs_: jsilver: i'm partial to couchdb [04:25] mjr_: I use CouchDB because they buy me free beer. [04:25] jsilver: k [04:25] isaacs: mjr_: that's largely my reason, as well. [04:25] jsilver: how many connections and requests can a node server hold? [04:25] mjr_: If MongoDB would start buying me beer, I might reconsider. [04:25] jsilver: does it make sense to use node to serve static files? [04:26] isaacs: jsilver: no, nginx is better for that [04:26] isaacs: jsilver: node makes it really easy to do more complex things, though. [04:26] jsilver: like run the actual app [04:26] jsilver: i get that [04:26] jsilver: i come from ruby [04:26] isaacs: yolp [04:26] jsilver: i understand blocking calls [04:26] cloudhead has joined the channel [04:26] isaacs: oh, then you know how it's done. [04:26] mjr_: jsilver: using node to serve static files is a fine way to learn about node though. [04:27] jsilver: interesting [04:27] isaacs: mjr_: true, you do end up using most of the relevant apis if you do that. [04:27] mjr_: That was the first thing I wrote, even though there were clearly plenty of other examples. [04:27] jsilver: if I use vanilla node, I will need to code my own routes if I want them, correct? [04:27] sveisvei has joined the channel [04:27] screen-x has joined the channel [04:28] jsilver: i have been looking at various node projects and i'm impressed [04:28] jsilver: but have been doing ruby for months so i'm slightly retarded [04:28] isaacs: jsilver: unless you use something like sherpa, or (fab), or express, or node-router, or faye, or a million other things. [04:28] jsilver: yeah [04:28] isaacs: jsilver: there are more routing libraries in node than hairs on a dog. [04:29] jsilver: is the general attitude "write it yourself" or "use one of these fine plugins" [04:29] jsilver: i come from rails and the attitude, i'm sorry to say... is usually the latter [04:29] saikat has joined the channel [04:29] mjr_: Node is very young. A lot of people are writing a lot of things. The API is only just now stabilizing. [04:30] jsilver: i don't want to get too comfortable in some syntactic sugar land, although i doubt that will happen in JS (lol) [04:30] foucist: anyone think a browser plugin running node is possible? [04:30] mjr_: You'll have to make your own decision about the tradeoffs. [04:30] Aria: Yeah, not nearly as likely. And with how the modules work, jsilver, things tend to not leak onto each other so much [04:30] Aria: foucist: Yeah, of course it is. Why would you want such a thing? [04:30] colin___: Hello, I'm working on modifying node-dirty to work with my application, anyone able to shed some light on benefit / differences between fs.readFile and fs.createReadStream [04:31] foucist: Aria: browser to browser connectivity, bypass server/client model.. distributed internet [04:31] foucist: true cloud ;) [04:31] Azeroth: hrmm can anyone help me .. im trying to fig out how to implement a operator for a class so i can do like Vector3 + v [04:31] jsilver: back to my original question, what is the upper load limit of a *complicated* node app? [04:31] colin___: I can give some example code if it helps [04:31] Azeroth: *verctor3 [04:31] Azeroth: bah [04:31] Aria: foucist: Sure, but the security implications scare people. Also, NAT sucks. [04:31] isaacs: jsilver: it really does depend a lot on what you'er doing. [04:31] jsilver: i wanna see some speed tests [04:31] jsilver: or i can just write my own app lol [04:31] cloudhead: kriszyp_: you around? [04:32] Aria: colin___: readFile reads the whole file, createReadStream lets you read chunks. [04:32] kriszyp_: for a bit [04:32] isaacs: jsilver: for high concurrency, "hello world" is closer to nginx than apache [04:32] foucist: Aria: shouldn't be too hard to add a nat buster to the plugin.. [04:32] Aria: colin___.: Imagine reading a 10GB file -- it becomes clear at that point. [04:32] Aria: foucist: 'nat buster'. Hah. Hahah. [04:32] jsilver: isaacs, interesting [04:32] cloudhead: kriszyp_: is your jsonschema implementation complete? [04:32] brianmario has joined the channel [04:32] kriszyp_: yes [04:32] kriszyp_: it should be [04:32] cloudhead: kriszyp_: so it implements the rfc? [04:32] foucist: Aria: well i mean a nat busting handshake with external servers etc [04:32] cloudhead: looks kind of short at first glance [04:33] kriszyp_: it doesn't implement the hyper schema part (since that goes beyond validation) [04:33] colin___: Aria: I understand, i'm reading in a data-store, basically i need the entire contents in memory [04:33] colin___: would you recommend using readFile [04:33] colin___: ? [04:33] Azeroth: Node.js nMath is 3d Math lib 0.01a: git@github.com:azeroth48/nmath.git [04:33] Aria: Use readFile if that's all the control you need. [04:33] kriszyp_: it should implement the validation part though, although it is possible there might be some slight discrepancy, let me know if you find any [04:33] cloudhead: kriszyp_: this is the one right: http://code.google.com/p/jsonschema/downloads/list [04:33] Azeroth: http://github.com/azeroth48/nmath [04:33] colin___: with 150k records read file is about twice as fast as createReadStream [04:34] kriszyp_: yeah, but since you are on the server, you should use the commonjs one: http://github.com/kriszyp/commonjs-utils/blob/master/lib/json-schema.js [04:34] cloudhead: ah interesting, ok [04:35] cloudhead: 2nd question: does json schema support validation against an arbitrary function? [04:35] kriszyp_: implementing hyper-schema is much more involved, since it gets into the full REST architecture, that is more in the domain of pintura/perstore [04:35] cloudhead: yea [04:35] kriszyp_: json schema doesn't define any function-based validation, because it wouldn't be cross-platform, but you can certainly add a validator function [04:35] colin___: Aria: Is there a way to "reload" a readStream to pull in data as the file changes [04:35] Azeroth: anyone help? http://github.com/azeroth48/nmath/blob/master/nmath/vector3.js i want to implement a operator like var v = Vector3 + Vector3.. is it possible? [04:36] kriszyp_: for example in perstore, if there is a "set" function on the a property def that is called on changes. [04:36] Aria: Reload? What would that do? You're wanting to watch for byte-regions of files changing? [04:36] kriszyp_: but that is beyond the scope of json schema (since it is lang dependent) [04:36] cloudhead: I see I see [04:36] mscdex has joined the channel [04:38] colin___: Yes, If something gets written to that file, id like to update the stream to pick it up and add it to memory for quick sorting and filtering [04:39] colin___: So, i guess the quick question is ... is the only reason to use createReadStream if you want to access some of the data before the entire file is read [04:40] foucist has left the channel [04:41] Aria: Yeah. [04:41] Aria: And what you want is ... hard. Unix APIs don't let you notice regions changing so you're really reloading the whole file. You want a filewatcher that runs a readstream. [04:41] Aria: I imagine that will get added some time [04:42] colin___: I guess since i'm writing to the file, I can also add it to a local array at the same time - that'll work [04:42] Aria: Yep. [04:42] Aria: That's a much smarter way. [04:42] stevendavie has joined the channel [04:43] colin___: Aria: thanks for the tips [04:43] Aria: Sure thing. [04:47] tilgovi has joined the channel [04:50] gbot2 has joined the channel [04:52] derferman has joined the channel [05:00] tlrobinson: how might i get node-waf to statically link a lib, like iconv for example [05:00] tlrobinson: 3 [05:04] mjr_: jsilver: I made a node.js screencast for you. It has everything you need to get started with node: http://www.youtube.com/watch?v=4OLN2BviFDI [05:06] jsilver: *click* [05:08] Azeroth: hrmm what would be the best way to store a static variable in a prototype? [05:08] Azeroth: as a function? [05:09] arnaudsj has joined the channel [05:09] arnaudsj has left the channel [05:09] Azeroth: am feeling the nubness [05:09] jsilver: mjr_ not bad [05:09] Aria: In a closure? [05:09] jsilver: :) [05:10] Aria: just var foo = bar, outside the function, Azeroth? [05:10] Azeroth: http://github.com/azeroth48/nmath/blob/master/nmath/vector3.js [05:11] Azeroth: so like i wanna beable to call nMath.Vector3.UnitX [05:11] Aria: So nMath.Vector3.UnitX = foo [05:11] bolson_ has joined the channel [05:12] Aria: Or if you really want it in the prototype, UnitX: foo [05:13] Azeroth: nMath.Vector3.UnitX = new Vector3(1, 0, 0); [05:13] Azeroth: TypeError: object is not a function at Object.CALL_NON_FUNCTION_AS_CONSTRUCTOR (native) [05:14] Aria: So do it afterward. [05:14] Azeroth: http://pastebin.com/xsWPze8c [05:15] Aria: Also, is the return value of require what you want there? [05:15] Aria: It shouldn't be a function [05:15] Aria: You might want var Vector3 = require('./vector3').Vector3; [05:15] MattJ has joined the channel [05:15] gf3 has joined the channel [05:15] hassox has joined the channel [05:15] jazzychad has joined the channel [05:15] admc has joined the channel [05:15] javarants has joined the channel [05:15] plhw_ has joined the channel [05:15] adamholt has joined the channel [05:15] gsf has joined the channel [05:15] martyn___ has joined the channel [05:16] Aria: (You're using the name 'Vector3' there a half dozen ways -- as the internal name of two function expressions, and as a variable, and as something you're exporting.) [05:17] Azeroth: lol am learning [05:17] Azeroth: coming from c# [05:22] Azeroth: yey [05:22] Aria: That workin' now? [05:23] Azeroth: http://pastebin.com/gkvf3tkb <-- this works [05:23] Azeroth: but i can't use overloaded constructors? [05:24] Azeroth: http://pastebin.com/uG6HX4TS [05:24] Aria: You're still thinking in classes. [05:25] Aria: You just changed the Vector3 variable from one function to another. [05:25] Azeroth: bah [05:25] Azeroth: is another way? [05:26] Aria: nMath.Vector3 = function(x, y, x) { this.X = x ? x : 0; this.Y = y ? y : 0; this.Z = z? z : 0 }; [05:26] Aria: Or, use different function names. [05:26] Aria: And give them the same prototype. [05:27] Azeroth: hrmm was afraid of dat [05:27] Azeroth: dam [05:27] Aria: nMath.EmptyVector3 = function() { ....}; nMath.EmptyVector3.prototype = nMath.Vector3.prototype = ... [05:28] Aria: You really are stuck thinking in classes here. You don't have to. The name of it doesn't matter, really. [05:28] Azeroth: well am thinking more about easy use [05:28] Azeroth: but o well [05:28] Azeroth: but kewl thanks for the help [05:29] Aria: Sure thing. (you can still do it in one function -- args not passed are undefined) [05:31] boaz has joined the channel [05:32] joshbuddy has joined the channel [05:38] isaacs: Aria: i can reproduce some of the snags you were running into before. [05:38] isaacs: Aria: it seems, if you're going to be installing node in a multi-user place, then you should install npm in such a way also (ie, setting npm's "root" config to something global), and use sudo for it, like you do with apt-get or whatever. [05:39] isaacs: Aria: or, you should own the location of node, and of npm's root [05:41] Aria: ACTION nods. [05:41] Aria: Ouch. [05:41] sudoer has joined the channel [05:41] Aria: Seems kinda brittle. [05:48] SamuraiJack has joined the channel [05:52] tilgovi has joined the channel [05:55] SvenDowideit has joined the channel [05:59] _ry: tlrobinson: here is an example http://github.com/ry/node/blob/c77964760047f734c58dab49143ff6487f938c6e/wscript#L177 [06:00] _ry: you'll have to detangle it - but that should give you a lead [06:00] tlrobinson: _ry: thanks [06:10] keeto has joined the channel [06:10] piranha has joined the channel [06:15] SvenDowideit_ has joined the channel [06:20] BryanWB has joined the channel [06:22] phazm: heh, I can't find any resources on sanitizing input for database insertion via JavaScript because you would have to be insane to rely on JS to sanitize inputs [06:22] phazm: anyone have something prepared? [06:22] mikeal has joined the channel [06:26] phazm: I think I'll just use node-ugly to run PHP sanitization [06:27] phazm: hrm, performance penalty isn't worth it [06:27] mscdex: actually, i just added this to my module [06:28] isaacs: Aria: i could have it just always put executables in ~/bin or something. [06:28] phazm: mscdex: poormansmysql? [06:28] isaacs: Aria: but i just figure that wherever you've installed node is generally in the path. maybe it should be a conf optin. [06:29] mscdex: yeah [06:29] mscdex: http://gist.github.com/389035 [06:29] phazm: taking a look, thanks [06:30] mscdex: it's not completely foolproof though [06:30] tmpvar: phazm, have you looked into the php.js lib? [06:30] dgathright: Is there a flag I can throw to ./configure to specify 32 bit as opposed to 64 on my macbook? ld: warning: in /opt/local/lib/libz.dylib, file was built for i386 which is not the architecture being linked (x86_64) [06:31] phazm: tmpvar: no -- should I? [06:31] mscdex: that was the first place i looked, and they don't have any mysql* functions there [06:31] mscdex: just addslashes [06:31] phazm: I'm using redis, not MySQL [06:31] tmpvar: phazm, you were going to clean the input with php? php.js should be helpful heh [06:31] tmpvar: oh [06:31] phazm: tmpvar: Right, but is there a considerably performance penalty, such as with ugly-php module? [06:32] tmpvar: nah, its a port of php to js.. but as mscdex says there are no mysql methods [06:32] tmpvar: phasm, you shouldn't need to worry about sql injection with redis ;) [06:33] tmpvar: you probably should be more concerned with XSS, which you can solve by stripping html entities [06:33] mscdex: well, unless you're storing sql queries or something [06:33] tmpvar: that seems pointless [06:33] mscdex: heh possibly [06:33] phazm: tmpvar: are you being sarcastic regarding sql injections on redis? [06:34] tmpvar: negatory, http://phpjs.org/functions/strip_tags:535 [06:34] tmpvar: redis is simply a k/v store from what i understand [06:34] tmpvar: unless im mistaken [06:34] mscdex: yeah [06:35] tmpvar: depends on how you are using it i guess [06:35] tmpvar: i need to pass out, its late [06:35] tmpvar: peace :) [06:35] phazm: yea -- but if I don't sanitize, my call, which was: SET key value could become: SET key val;FLUSHALL [06:35] SvenDowideit has joined the channel [06:35] phazm: which would erase my database ;) [06:35] tmpvar: thats a different problem heh [06:36] tmpvar: i mean.. its similar to sql injection [06:36] tmpvar: but more like nosql injection lol [06:36] mscdex: heh [06:36] phazm: heh :) [06:37] phazm: there's about a one is a million chance of there being any bad data like that, as I'm pulling it from websites meant for javascript processors, not user input [06:37] mscdex: yeah escaping/sanitization is most likely going to be vary for the different nosql stores, depending on the syntax they use [06:37] tmpvar: tricky. you'd have to build that yourself im guessing [06:37] tmpvar: yep [06:38] tmpvar: _ry, we should probably link up for 5 or so tomorrow [06:38] tmpvar: must sleep, good luck! [06:38] phazm: thanks :) [06:41] _ry: uh? link up for 5? [06:41] _ry: :/ [06:42] javajunky has joined the channel [06:42] Azeroth: 5 men all at once. [06:42] SvenDowideit_ has joined the channel [06:42] Azeroth: be scared [06:42] Azeroth: be very scared [06:43] jansc has joined the channel [06:43] javajunky: wtf [06:44] mscdex: haha [06:46] freshtonic: anyone in here familiar with the process of creating 'seeds' for kiwi? [06:55] Nohryb has joined the channel [06:58] freshtonic: no worries, I have seed-building working fine now [06:59] markwubben has joined the channel [07:03] Sembiance has joined the channel [07:03] vhost- has joined the channel [07:05] tlrobinson: well, i got iconv statically linked in my extension only to discover heroku is running an older version of node. oh well [07:08] micheil has joined the channel [07:11] mrd` has joined the channel [07:14] felixge has joined the channel [07:14] felixge has joined the channel [07:24] Nohryb has joined the channel [07:25] teemow has joined the channel [07:26] phazm: anyone know if tmpvar's jsdom can be used to parse returned html from http.client, or is it just for creating markup? [07:29] joshbuddy has joined the channel [07:32] felixge: _ry: you still up? [07:39] dgathright has joined the channel [07:53] cruxst has joined the channel [08:02] romainhuet has joined the channel [08:09] Azeroth has joined the channel [08:15] felixge has joined the channel [08:15] felixge has joined the channel [08:20] N` has joined the channel [08:21] hellp has joined the channel [08:28] javajunky1 has joined the channel [08:29] zomgbie has joined the channel [08:36] BryanWB: hey folks, pls take a look at my experiment in grouping callbacks http://gist.github.com/389141 [08:37] BryanWB: I am using creationix's great Step but there is still a large amount of boilerplate. Is there a better way to use Step or a different pattern I can use? [08:39] mape: BryanWB: did you look at his new group feature in step? [08:39] mape: Not sure it can be used but yeah [08:39] BryanWB: mape: i have not, only looked at the tutorial [08:39] BryanWB: mape: are there other callback grouping libs that I should be looking at? [08:40] mape: Not that I know of [08:40] SamuraiJack: BryanWB: hey, take a look at: http://openjsan.org/go/?l=JooseX.CPS [08:40] digitalspaghetti has joined the channel [08:40] BryanWB: mape: btw, buf = null, dereferences a buffer so it will be garbage collected [08:40] BryanWB: SamuraiJack: that sounds dirty ;) i will check it out [08:41] SamuraiJack: its written in Joose, though you can port it to "raw" JS if needed [08:41] SamuraiJack: its quite clean actually ) [08:43] derbumi has joined the channel [08:43] BryanWB: SamuraiJack: sorry to be ignorant , what is joose? [08:43] SamuraiJack: Joose is the OOP system for JS [08:43] SamuraiJack: http://joose.it [08:43] xla has joined the channel [08:43] BryanWB: SamuraiJack: cool, tks [08:43] xla_ has joined the channel [08:44] SamuraiJack: it works with node also, (will in 3.008) [08:48] TomY_ has joined the channel [08:51] felixge has joined the channel [08:51] felixge has joined the channel [08:56] tbassetto has joined the channel [08:59] Azeroth has joined the channel [09:01] xla_ has joined the channel [09:03] inimino has joined the channel [09:04] tlrobinson: _ry: minor typo in docs "rlwarp" [09:04] tlrobinson: sounds like it would be a fun program [09:06] micheil: tlrobinson: that was fixed the other day [09:06] micheil: or the commit showed it [09:06] Nohryb has joined the channel [09:06] tlrobinson: oh, guess the website wasn't updated [09:06] micheil: http://github.com/ry/node/commit/a1f23c1aa103a2c42c1855703d51b82ba5777f98 [09:06] mscdex has joined the channel [09:07] BryanWB: creationix: am trying to use Step but the challenge is that I have to put the step hooks, like this, parallel(), in an "asynchronous function" [09:08] BryanWB: creationix: which can be a pain if there are a lot of deeply nested functions. So far it requires me to put a fair amount of boilerplate in the Step( .... ) block of code [09:08] mape: since you are using the this.parallell() as a callback that isn't an issue? [09:08] mape: or this.group() if you use that [09:09] jfd has joined the channel [09:09] BryanWB: mape: it works but that makes it important to put all the code leading up to and including the async function inside the Step block [09:10] javajunky has joined the channel [09:10] mape: Why would it have to be inside it? [09:11] mape: As long as you pass the callback around it can be all over the place (not that would be the best solution) [09:11] jfd: Have an issue with latest version of node and child process. stdin.addListener("data") always returning a string instead of a buffer, even if I explicitly set encoding to binary. Ideas anyone? [09:11] BryanWB: mape: it doesn't have to, but it makes for pretty ugly code, and each functions has to pass parallel along to the one function that finally needs it [09:12] BryanWB: mape: btw not having much success w/ group() but still trying. Does it work similarly to parallel? [09:13] mape: Never used parallel but I assume so, isn't there an example in the step github repo? [09:14] BryanWB: mape: nope, group() is very new [09:15] BryanWB: jfd: i think u have to set the encoding to binary [09:16] jfd: BryanWB: I already have. Im setting instream.setEncoding in my child process. The code was working before latest version, so I guess that something has changed in node [09:16] BryanWB: jfd: but the docs say it should be a buffer so it could be a bug http://nodejs.org/api.html#readable-stream-20 [09:18] jfd: BryanWB: yea, must be a bug.. My original process is returning a buffer by default. [09:23] mape: BryanWB: http://github.com/creationix/step/blob/master/test.js [09:23] mape: that has a group example? [09:25] BryanWB: mape: tks, but shows same problem, if I have a lot of deeply nested functions I have to pass along the group function through the entire chain [09:25] BryanWB: wish there was a cleaner way . . . but I guess the u have to put the hook in the async function [09:26] mape: Well you have to pass the callback since they are async [09:26] BryanWB: which makes your functions quite tightly coupled [09:27] mape: well not really, should just make them return into the value of the callback in the first function? [09:28] BryanWB: maybe currying is the answer here [09:29] maushu has joined the channel [09:42] hellp has joined the channel [09:43] unomi has joined the channel [10:06] botanicus has joined the channel [10:10] mythz has joined the channel [10:18] hassox has joined the channel [10:21] sveimac has joined the channel [10:27] charlesjolley has joined the channel [10:28] BryanWB has joined the channel [10:29] BryanWB has joined the channel [10:35] Tim_Smart has joined the channel [10:37] BryanWB: can anyone tell me why this child process in this example http://gist.github.com/389247 doesn't terminate before event listener for "exit" has been added? [10:55] sveimac has joined the channel [11:10] jasondavies has joined the channel [11:10] derferman has joined the channel [11:12] jfd has joined the channel [11:13] BryanWB: once I have compiled and installed node, the standard lib files like fs.js, sys.js appear to be inside the node binary executable [11:13] BryanWB: Can I tweak the js inside that file w/out causing insane damage/ [11:13] BryanWB: ? [11:14] ashb: you can probably change things so long as the length stays the same, but i *really* woudln't recomend it [11:14] Tim_Smart: Gah Mac OS X is starting to get annoying now, time to start using Ubuntu again [11:15] Tim_Smart: /spam [11:16] BryanWB: ashb: do most binaries have length checksums? [11:16] ashb: no, but likely have ponters/lengths to the stuff afterwards which will be in a different place if you add stuff [11:17] BryanWB: ashb: so pointers to file offsets which will no longer be accurate [11:17] ashb: yeah [11:17] ashb: i.e. Dont Do It. [11:18] sveimac has joined the channel [11:19] BryanWB: is it just me or does fs.stat('filename') not work on latest master? [11:19] mape: BryanWB: why not change the source and recompile rather them mucking in the binary? [11:20] BryanWB: mape: sure, but was curious ;p [11:24] sztanphet has joined the channel [11:27] unomi has joined the channel [11:30] BryanWB has left the channel [11:30] BryanWB has joined the channel [11:31] sveisvei has joined the channel [11:43] ncb000gt has joined the channel [11:50] spoob has joined the channel [12:10] jansc has left the channel [12:18] charlesjolley has joined the channel [12:26] kriszyp has joined the channel [12:29] derferman has joined the channel [12:33] voodootikigod_ has joined the channel [12:34] felixge has joined the channel [12:34] felixge has joined the channel [12:39] micheil has joined the channel [12:42] creationix: BryanWB: you had questions about step? [12:50] creationix: ahh, I see the emails, I'll reply there [12:51] jfd has joined the channel [12:53] micheil: _ry: ping me when you're about, the tweet I sent you kinda borked. [12:58] tekky has joined the channel [12:59] Tim_Smart has left the channel [13:01] felixge_ has joined the channel [13:01] felixge_ has joined the channel [13:10] sveimac has joined the channel [13:15] BryanWB: creationix: yeah, it seems I can only put the "hooks" for Step in a truly async function and not an arbitrary function. Is this correct? [13:15] creationix: what do you mean [13:16] creationix: Step itself is async so you can never wrap it in a sync function [13:16] creationix: but all async functions do that [13:17] creationix: but it can have sync steps within it [13:17] jasondavies has joined the channel [13:17] jasondavies has joined the channel [13:17] creationix: just return the value instead of calling the "this()" callback [13:17] BryanWB: creationix: fair enough, but then how to nest Steps? [13:17] BryanWB: creationix: am trying to do that here http://gist.github.com/389396, line 38 [13:19] creationix: well, you're not using newGroup for your callback [13:20] BryanWB: creationix: that is cruft, i am using "this" as the hook into Step [13:20] BryanWB: creationix: should it be "this()" instead of "this" ? [13:21] jfd has joined the channel [13:21] BryanWB: creationix: however, the Step on line 38 runs w/ in a Step that starts on line 56 [13:23] Nohryb has joined the channel [13:23] pgriess has joined the channel [13:25] creationix: hmm, no "this" is right there [13:26] jherdman has joined the channel [13:26] creationix: I just sent my reply to the mailing list, I've never nested Steps, I always use the composition pattern [13:26] BryanWB: creationix: since I have nested steps, the group() call back actually has to be an argument to Step [13:27] BryanWB: creationix: tks a lot i will go read it [13:27] creationix: ok, I'll look at your use case [13:28] micheil: creationix: reckon it'd be hard to modify event emitter to not bubble? [13:28] creationix: no clue [13:28] micheil: or rather, ristrict emits to the actual object? [13:28] creationix: I don't use events much, just callbacks [13:29] creationix: they are always restricted [13:29] micheil: eg, http.Server emits "connection" from the net.Stream it's built around [13:29] micheil: so consequentially, you can't inherit from net.Server or http.Server and emit your own connection event [13:30] creationix: sounds like you need a hook in the code that emitting the connection in the first place [13:30] BryanWB: creationix: here is a cleaned up gist, http://gist.github.com/389396, using group() as an async callback w/ in step line 48 [13:30] BryanWB: ACTION goes back to reading creationix's e-mail [13:32] micheil: well, atleast namespace events [13:32] creationix: BryanWB: since you have the renameGroup logic seperate you don't need a reference to group after line 55 [13:32] creationix: renameGroup(group1, this.group()); is fine [13:32] BryanWB: creationix: really, that didn't seem to work for me earlier, let me try again [13:32] micheil: creationix: do you think it'd be also useful to be able to get an event when a stream's readyState changes? [13:34] creationix: micheil: like ajax does? maybe, not sure [13:35] micheil: creationix: yeah, like ajax (*cough* XHR) does [13:35] blowery has joined the channel [13:37] BryanWB: creationix: no joy [13:38] spoob: The lack of method_missing in Javascript is like a brick wall in the middle of a highway [13:38] davidsklar has joined the channel [13:38] mape: spoob: you have it in firefox :) [13:41] creationix: BryanWB: sorry, I've got to go for now, have a look at the wheat code if you want, I'll be back on later [13:41] BryanWB: creationix: will do, tks [13:41] sudoer has joined the channel [13:44] thoolihan has joined the channel [13:46] sztanpet has joined the channel [13:46] gf3 has joined the channel [13:57] jasondavies has joined the channel [13:57] jasondavies has joined the channel [13:58] mjijackson has joined the channel [14:06] mnutt has joined the channel [14:06] sztanphet has joined the channel [14:09] felixge has joined the channel [14:09] felixge has joined the channel [14:20] sztanphet has joined the channel [14:23] sztanpet has joined the channel [14:23] jfd has joined the channel [14:26] robinduckett has joined the channel [14:26] robinduckett: yo [14:27] MattJ: oy [14:28] nefD: allo [14:31] bweaver has joined the channel [14:31] sztanpet has joined the channel [14:33] robinduckett: what's a good way to do benchmark timers with node? [14:35] hsuh has joined the channel [14:36] nefD: oof. the raphael JS vector library is sexy. [14:36] robinduckett: slow in anything without a native SVG renderer though [14:38] nefD: :( [14:38] nefD: i guess im just a sucker for the fact that it eases the cross browser-ness of svg for me [14:39] robinduckett: oh yeah no, it's good shit, but unfortunately not so good for companies using IE6 on a 5-10 year old PC [14:39] nefD: which browsers done have native svg at this point, out of curiosity? I haven't really kept up with svg in general [14:39] robinduckett: Safari, Chrome, Opera, Firefox and I believe IE8 [14:40] robinduckett: I could be lying/having wishful thoughts about IE8 [14:40] rektide: no svg in ie8 [14:40] nefD: oops, done = dont [14:40] nefD: so it looks like mainly the ie* browsers [14:40] robinduckett: oh [14:40] mjijackson: robinduckett: wishful thinking ;) [14:40] robinduckett: :'( [14:41] robinduckett: what about IE9? [14:41] rektide: i believe its been confirmed [14:41] rektide: for ie9 [14:41] rektide: the lack of svg makes a serious case in my mind for striking the 6 from ie6 must die [14:41] mjijackson: but it probably won't be done right... [14:41] robinduckett: someone should just make a WMF->SVG transliteration system For IE<9 [14:41] rektide: pillow biters [14:42] rektide: there's some VML stuff that gets abused in IE8 world [14:42] rektide: i think there are some svg -> vml translation projects &c [14:42] Yuffster has joined the channel [14:42] robinduckett: hey now, IE has always been the high point of innovation in web tech until the evil W3C told them to stop innovating ;) [14:42] nefD: at this point, ive come to realize that if I want to be into bleeding (or even cutting) edge web dev., it simply wont be an attractive avenue for my employers anyway.. and that being the case, most things i'd be developing to use those technologies would be on my own, which means I can afford to say "screw it" if something I make runs slowly in a particularly redmond bourne series of browsers :) [14:43] colin____ has joined the channel [14:43] nefD: "Don't like the performance? Consider an upgrade! Its free, and only takes a couple minutes!" [14:44] rektide: just making ie7 or ie8 supported adds 8-22% effort to a project [14:44] rektide: "run fast" be damned, just running [14:44] robinduckett: 10% of our visitors use IE6 [14:44] robinduckett: and as my boss no longer uses it [14:44] robinduckett: it's hell to test for [14:45] nefD: rektide: Actually, for the current site ive been heading up for my company, ie8 hasn't been *that* bad, simply because we aren't doing anything too fancy (at least, beyond what JQuery and JQ UI provide).. It's IE7 thats been the real pain in the ass [14:46] robinduckett: I don't think the testing with 960.gs and IE6/7 was very thorough. I'll have a site made using 960.gs looking and working great in IE8/FF/Chrome/Safari/Opera but looking cack in IE<8 [14:48] nefD: the crazy thing is that in a series of social network based games we had developed about two/1.5 years ago, ie6 usage was still high enough that we had to support it.. it was only within the past 6-8 months that it dropped low enough for us to ignore the traffic [14:48] felixge: You need to understand IE psychology [14:49] felixge: 90% of all IE problems are float stuff that can be fixed with: float: left; display: inline; [14:49] felixge: the rest can be more difficult to trace down, but there are lots of great sites documenting them [14:49] spoob: Chrome Frame seemed like it would help, but it doesn't seem to be under development [14:50] felixge: anyway, I've settled with "usable" for IE6/IE7. If some design elements look a little off - so what ;) [14:50] nefD: one css bit that has fixed many ie issues for me: table-layout [14:51] nefD: (because developing a site with tableless layout while also supporting IE is possible, but try justifying the time to a ceo) [14:52] rektide: chrome frame is under development. its just not very "NEW VERSION!!! CHECK IT OUT!!" hurf burf about it, because, well, it mostly just works and its goal is to be an innocuous as possible [14:53] alex-desktop has joined the channel [14:55] TomY_ has joined the channel [14:58] spoob: Google also has the ANGLE project for WebGL on Windows [15:02] hsuh has joined the channel [15:04] jfd has joined the channel [15:07] binary42 has joined the channel [15:08] mrjjwright has joined the channel [15:09] joshbuddy has joined the channel [15:10] boaz has joined the channel [15:10] jfd has joined the channel [15:18] mikeal has joined the channel [15:19] fed1 has joined the channel [15:20] fed1 has left the channel [15:21] fernmicro has joined the channel [15:36] jedschmidt has joined the channel [15:36] jedschmidt: maybe it's just me, but this page seems a unnecessary: http://wiki.github.com/ry/node/hosting [15:37] jedschmidt: and wrong. heroku support isn't public, and elusive hippo is vaporware: http://elusivehippo.com/not-implemented [15:40] robinduckett: http://gist.github.com/389557 [15:40] robinduckett: :D [15:45] phazm has joined the channel [15:45] creationix has joined the channel [15:49] romainhuet has joined the channel [15:52] rektide: ANGLE actually annoys me [15:53] rektide: propping up IE with chrome frame i see as marginally acceptable [15:53] rektide: given this madcap world we live in [15:53] rektide: ANGLE strikes me as a colossal amount of very good work that could be spent doing something useful, like advancing Xorg, that instead is being used to prop up intel's lame brained excuse for hardware [15:54] bpot has joined the channel [15:54] rektide: i dont understand how such a huge company with so many talented people can continually justify making such great cpus and such absolute shit platforms to run them on [15:54] rektide: its frustrating beyond measure [16:01] spoob: it's needed though. IE people would run Chrome Frame and have no WebGL [16:01] robinduckett: Xorg is in a lot better place than it was in say, 2005 or so. [16:01] spoob: so they have Chrome Frame + ANGLE, and get the whole HTML 5 stack [16:01] spoob: or they have IE9 + ANGLE [16:06] JimBastard has joined the channel [16:06] JimBastard: has anyone here seen JSLinq yet? [16:07] JimBastard: This project is licensed under the Microsoft Reciprocal License (Ms-RL) [16:07] JimBastard: hrmm wtf does that mean [16:08] JimBastard: does anyone know the deal with http://jslinq.codeplex.com/license is [16:11] MattJ: ACTION rolls on the floor laughing [16:11] MattJ: It appears to be a Microsoft GPL [16:12] JimBastard: so does this mean i can steal it and put it on github [16:12] JimBastard: i guess i have to keep the lic in tact [16:13] javajunky: I believe i is less infectious than the GPL, I think closer to LGPL maybe. [16:15] javajunky: too many licences in the world :( [16:15] MattJ: Wow - how did I miss these licenses? [16:15] MattJ: It seems there's a "Microsoft Limited Reciprocal License", which allows you to develop the software only for Windows [16:16] MattJ: Too much evil in the world :( [16:16] devinus has joined the channel [16:16] fizx has joined the channel [16:16] spoob: Microsoft Reciprocal sounds like "we'll fuck you, and give you a reach around" [16:17] fizx has joined the channel [16:17] JimBastard: we'll see [16:17] JimBastard: http://github.com/Marak/linq [16:17] JimBastard: im gonna clean that shit up and make it actually easy to grok with examples [16:17] JimBastard: and some live demos [16:17] JimBastard: fucking MS [16:17] JimBastard: hiding some awesome code behind codeplex [16:17] JimBastard: (verdict is still out as extensive testing has not happened) [16:18] JimBastard: but this would be sweet to get working on node [16:18] spoob: Jim; better make sure it's not a Community Pinky Promise [16:18] JimBastard: i already got the JS code [16:18] brianmario has joined the channel [16:18] JimBastard: so as long as it works.... [16:18] JimBastard: aight back to real work [16:21] fictorial has joined the channel [16:26] colin__ has joined the channel [16:27] qFox has joined the channel [16:28] mjijackson: random question for math gurus: what does it mean to be "closed under composition"? [16:30] colin__ has joined the channel [16:32] romainhuet has joined the channel [16:32] robinduckett: Hey guys.. how do I build node-mysql-libmysqlclient? D: *feels like a noob* [16:33] hober: mjijackson: if you compose two elements in the set, the result is also in the set [16:34] hober: mjijackson: a group, mathematically speaking, is just a set that's closed under some operation [16:34] mjijackson: hober: what does it mean to compose two elements? [16:35] mjijackson: the composition is just some operation? [16:36] saikat_ has joined the channel [16:36] mattly has joined the channel [16:36] stevendavie has joined the channel [16:38] hober: say f(x) and g(x) are functions. f(g(x)) is the composition of f and g [16:39] mjijackson: hober: excellent. thx [16:39] dgathright has joined the channel [16:46] admc has joined the channel [16:46] jan__ has joined the channel [16:47] jan__: _ry: hey, this is felix [16:47] jan__: _ry: this is the build error on Solaris 10 (not opensolaris): http://gist.github.com/389639 [16:47] jan__: _ry: any idea? [16:47] softdrink has joined the channel [16:50] botanicu_ has joined the channel [16:54] _ry: jan__: hmm [16:55] jan__: _ry: seems like this comes out of math.h [16:55] _ry: jan__: looks like it needs to tweaking [16:55] jan__: _ry: I can get an ssh account on this box [16:55] micheil: _ry: morning' [16:55] _ry: jan__: okay [16:55] _ry: jan__: i don't have an enromous amount of time today - but i can take a peak [16:55] jan__: _ry: alright, I can actually try to work on this as well if you can give me some hand holding [16:55] _ry: micheil: hey [16:55] mape: _ry: Hey, have a working POC on the doc patch thingy http://doc.mape.me/api.html [16:56] technoweenie has joined the channel [16:56] technoweenie has joined the channel [16:56] jan__: _ry: but it sounds like we'll need to hack v8, right? [16:56] mape: Broke some other things while fiddling around (quick throw together) but the general idea should come across [16:56] _ry: jan__: yeah - but maybe its not so bad [16:56] _ry: jan__: get me an ssh account [16:56] _ry: it might be a small fix [16:56] micheil: mape: hate to mention it, but those docs are becoming kinda messy [16:57] mape: micheil: In what sence? Nothing is changed except the hover? [16:57] mrjjwright has joined the channel [16:57] jan__: _ry: ok, they are still on 0.1.33 but I'll either get some to upgrade or would backport this to 0.1.33 myself [16:57] micheil: mape: well, there's no typographic heirachy, everything's the same size. [16:57] mape: _ry: Oh yeah, to open the edit of a section you hover the h2 heading and click the text [16:58] jan__: *them [16:58] mape: micheil: Ok, that isn't what I'm showing though ;) [16:58] micheil: mape: just commenting. [16:58] jan__: (the error is the same on 0.1.9x so) [16:59] indiefan has joined the channel [16:59] mape: micheil: No worrys [17:00] _ry: jan__: looks like a v8 issue - so it should be a matter copying deps/v8 into 0.1.33 [17:00] _ry: assuming that's the only issue [17:00] jan__: _ry: no v8 api diffs between 0.1.3x and 0.1.9x? [17:00] _ry: no [17:00] jan__: k, good : ) [17:01] _ry: mape: hmm not working in chrome ? [17:01] n8o has joined the channel [17:01] mape: _ry: Works here, what part does? [17:01] micheil: _ry: out of curiosity, would it be a good idea to add to http.Server (through net.Stream), an event emission for when the ReadyState changes? [17:02] mape: *doesn't [17:02] _ry: micheil: i'd rather not [17:02] indiefan has left the channel [17:02] _ry: micheil: what's the issue? [17:02] mape: _ry: Make sure you refreshed so there isn't old js cached, that will break it [17:03] micheil: okay, basically, with my websocket server, I'm keeping a list of clients connected, however, I have no way of knowing when a client disconnects (other then trying to call a Connection.write() which checks the sockets writable and readable statuses) [17:03] mape: Then you should be able to click the text in headings, and update the section live, when clicking submit patch it adds that to a link and does mailto with the diff [17:03] _ry: micheil: listen for 'close' [17:04] micheil: on the client connection? [17:04] _ry: yeah [17:04] micheil: okay, testing that. [17:05] spoob: An architectural question here.. I am thinking that node does some things very well, but I should still use narwhal/jack for client handling? So I would have jack do stuff and pass streaming operations (like file transfers) to Node? [17:05] _ry: mape: very cool [17:06] mape: Yup turned out nifty [17:06] _ry: mape: can you just do something where it displays the patch instead of doing mailto? [17:06] mape: And it is more or less ok code, it takes the markdown at generation and puts that in the html for reference [17:06] _ry: using a textarea? [17:06] mape: Sure, I can just swap the contents [17:06] airportyh has joined the channel [17:07] _ry: spoob: why? [17:07] towski has joined the channel [17:07] _ry: spoob: sounds needlessly painful [17:07] micheil: _ry: close event never fires. [17:07] _ry: micheil: hmm [17:07] mape: _ry: if you refersh you should see the diff in the previous edit area [17:07] spoob: If I programmed server side in Node, I would need to maintain state, instead of just forking? [17:07] mape: *refresh [17:08] _ry: micheil: that's not good... [17:08] micheil: unless I'm adding the listener to the wrong thing [17:08] spoob: that is, there's a difference in programming for something that can block and wait, and something that needs to be quick with events? [17:09] rektide: spoob: what kind of blocking operations do you anticipate having to deal with? [17:09] _ry: mape: cool [17:09] micheil: _ry: "end" perhaps? [17:09] _ry: micheil: perhaps... [17:09] rektide: spoob: the event loop means you're handling with incoming events as they happen, and you're only sending data when you need to send data. nothing should block. the only blocking problems are if you have really long running computations you need to be reactive during. [17:09] micheil: got it. [17:10] _ry: micheil: addListener('end', function () { connection.end() } [17:10] micheil: this._req.socket.addListener("end", function(){ [17:10] spoob: as an example, I might have a server side database that the client wants to query. The server would then perform the query and be possibly a bit slow. With jack, it would be that one thread, whereas Node would block for other clients [17:10] _ry: spoob: node doesn't block... [17:11] mjr_ has joined the channel [17:11] saikat has joined the channel [17:11] spoob: well it wouldn't service the other clients? or is every event concurrent? [17:11] saikat has joined the channel [17:12] _ry: spoob: you'll start a call to the backend db - then start servicing other clients [17:12] _ry: when the db returns you'll return the request [17:12] spoob: or it enforces the programming style of initiating the query then eventing again on the results returning? [17:12] _ry: yes [17:13] _ry: which is undoubtably the most efficent way to program servers [17:13] spoob: how much will WebWorkers help? as I can imagine multiple small operatinos that would add up, like for loops with thousands of entries [17:14] _ry: this scales and order of magnatude better than thread-per-connection [17:14] spoob: yes, I remember how much faster the Archimedes was, with co-operative multitasking :) [17:15] _ry: right - so this is cooperative threading - but even better [17:15] _ry: it only uses one execution stack [17:15] _ry: it's very simple [17:15] N` has joined the channel [17:16] _ry: ('better' in my mind - simpler, faster, less memory. others complain that callbacks are too difficult to program with) [17:16] rektide: v8 is imlementing multi-threaded webworkers, confirm or deny? [17:16] arlolra has joined the channel [17:16] rektide: as in, workers can have their own thread [17:16] RayMorgan has joined the channel [17:17] _ry: rektide: i believe you can run separate contexts in different threads [17:17] _ry: they don't implement 'workers' [17:17] rektide: *sigh* [17:17] stepheneb has joined the channel [17:17] qFox: finally have a working web interface for mysql [17:17] _ry: but i might be wrong [17:18] _ry: afaik chrome implements workers with processes [17:18] _ry: which is how god intended [17:18] arlolra: ha [17:18] rektide: indeed [17:18] rektide: otherwise sharedworkers would be a bit of a tangle [17:19] spoob: doesn't chrome use v8? [17:20] ncb000gt: yes [17:21] keyvan has joined the channel [17:24] phazm: how would I 'tolower' in node? [17:25] qFox: String.prototype.toLowerCase ? [17:26] ncb000gt: who wants to cry a good cry? [17:26] ncb000gt: http://code.google.com/p/regexml/ [17:26] phazm: qFox: Do I need to include a module for that? I'm getting: TypeError: Cannot call method 'toLowerCase' of undefined [17:28] V1 has joined the channel [17:29] qFox: no [17:29] qFox: (uhm, at least, i hope not) [17:29] qFox: you can call it on any string [17:29] qFox: "Hello World".toLowerCase() === "hello world" [17:30] dgathright has joined the channel [17:30] spoob: regexml looks like something used in Satanic rituals [17:30] ceej has joined the channel [17:30] ncb000gt: yes, it does [17:31] lifo has joined the channel [17:31] alex-desktop has joined the channel [17:31] mjijackson: ACTION is going to port regexml to node, just to see ncb000gt cry! [17:31] qFox: :p [17:32] ncb000gt: that would kill me [17:32] qFox: bring tissues. [17:32] _ry: micheil: is your issue fixed? [17:32] mjijackson: after all, who needs just regular expressions when you can have regular expressions *and* XML! [17:33] ncb000gt: mjijackson: you cut me reeeeaaaaalllll deep just then. [17:33] micheil: _ry: yeah, cheers [17:33] mjijackson: ncb000gt: ;P [17:33] mjijackson: ;) [17:34] spoob: regular expressions with jQuery selectors on JSON sounds interesting though [17:35] stepheneb has joined the channel [17:35] atmos has joined the channel [17:36] inimino: wow, regexml [17:36] spoob: I see regexml is implemented by drcalloway... that has to be an academic project [17:36] inimino: no, this spells enterprise all the way [17:37] ncb000gt: regex's in jquery are unnecessary. the selection engine is already structured enough for you to do nearly anything you want. [17:37] inimino: you know what this project really needs... [17:37] ncb000gt: inimino: lol, agreed. [17:37] inimino: XSLT uses regexes [17:37] ncb000gt: more cowbell? [17:37] inimino: someone needs to define an embedding of regexml in XSLT, so you can have sweet XML goodness all the way down [17:38] inimino: using namespaces, of course [17:38] pdelgallego has joined the channel [17:38] spoob: i get a horrible feeling in my stomach that extends to include my cringing nether regions as I stare at regexml [17:39] ncb000gt: o.0 [17:41] inimino: ACTION can never remember the emoticon for "cringing nether regions" [17:42] felixge has joined the channel [17:42] felixge has joined the channel [17:42] qFox: ox ? [17:43] _ry: micheil: good, i'm glad [17:43] _ry: felixge: in case you're hacking yourself deps/v8/src/platform-solaris.cc [17:43] micheil: _ry: I still have other issues, but those can wait until tomorrow. [17:43] felixge: _ry: cool [17:44] felixge: _ry: I think I won't have an ssh account until tomorrow, so I'll try to see what I can do during the day and then ping you when you get on [17:44] _ry: that's fine - i need to prepre for cinco de node [17:45] felixge: _ry: I saw that, looks like fun :) [17:45] micheil: cinco de node? [17:45] _ry: http://www.meetup.com/BayJax/calendar/13308905/?from=list&offset=0 [17:46] CIA-75: node: 03Peter Griess 07master * rd988239 10/ src/node_net2.cc : [17:46] CIA-75: node: Fix SEGV by setting msg_controllen earlier. [17:46] CIA-75: node: - Some implementations of CMSG_FIRSTHDR() rely on msg_controllen being [17:46] CIA-75: node: set correctly, else it returns NULL: see . - http://bit.ly/dmWrW0 [17:46] CIA-75: node: 03Ryan Dahl 07master * rb6c5cf6 10/ src/node.cc : [17:46] CIA-75: node: Ignore SIGPIPE [17:46] CIA-75: node: Was inadvertently removed with evcom, [17:46] CIA-75: node: http://github.com/ry/node/commit/c72967d3351c4a28c3f2434748598017aa0126d5#L10L1900 - http://bit.ly/aR0Kam [17:47] rektide: oh hell, totally neglected that there was an opportunity/excuse for drinking and revelries on the horizon [17:47] rektide: day after star wars day, hurrah [17:47] binary42: rektide: drinking can happen any time in an asynchronous world. Even when you don't expect it. [17:48] qFox: wished i lived even remotely close to it :/ [17:48] _ry: ACTION is away [17:48] stephenlb has joined the channel [17:52] fizx has joined the channel [17:53] jan____ has joined the channel [17:55] jan____ has joined the channel [17:55] dgathright has joined the channel [18:00] BinaryPie has joined the channel [18:00] felixge: I'm very excited to see how my buffer-based multipart parser will perform [18:01] felixge: 100 mb /sec? 200? 500? :) [18:03] V1: When constructing a module, is it best to focus on performance or maintainability? [18:03] mape: depends on what it does? [18:03] N` has joined the channel [18:03] V1: Useragent parsing. [18:04] mape: what would make it that much faster that would make it a pain to maintain? [18:04] V1: I got an array with Useragent familitys which i combine as Regexp [18:05] V1: Writing one idiotic long regexp, instead of compiling it out arrays [18:05] steadicat has joined the channel [18:05] mape: well then it would only run once? (when required) [18:06] rektide: felixge: i'm excited too! [18:06] V1: because its compiled out of arrays, i need to use new RegExp() and array joins. instead of doing /regexp/, and yes only when its required [18:06] spoob: write it for maintainability, benchmark it for hot spots, then fix performance if it matters [18:06] spoob: the hot spots won't be where you think while you're writing the code [18:06] felixge: V1: you are talking about insanely small strings, go for a regex [18:07] felixge: rektide: well, I just got it to work :) [18:07] V1: Some context would always be better, so heres the file in question: http://github.com/3rd-Eden/node-useragent/blob/master/useragent.js The regexp combining is at the bottom. [18:08] felixge: V1: the question is, do you really want to go for maximum performance? (check this if you're unsure *g*: https://gist.github.com/b9beafc6d6e2047ddf04 ) [18:09] V1: As requires are blocking, I do not want to provide allot of overhead [18:09] mape: question is, is doing a regex at all really the fastest way? [18:09] felixge: V1: you wouldn't require() during runtime anyway? [18:09] joshbuddy has joined the channel [18:10] V1: True to that.. [18:10] felixge: V1: this selector will never match: http://github.com/3rd-Eden/node-useragent/blob/master/useragent.js#L15 [18:10] felixge: V1: because you're lowercasing the string you perform it on [18:11] mape: hehe [18:11] V1: Iknow, that was still on todo list, but thanks for the heads up :p [18:11] qFox: hm. is indexOf faster than regex? [18:12] qFox: for simple searches... [18:12] mape: yes [18:12] qFox: i doubt it'll invoke the regex engine [18:12] polo has joined the channel [18:12] creationix: I would hope it's faster, unless the regex engine precompiles certain regexes into simple loops [18:12] qFox: so if performance is an issue, maybe go for a long stretch of indexOf's? (although that might negate the gain..) [18:13] qFox: right [18:13] creationix: node-bench is your friend [18:13] qFox: if you can cache the regex object, i guess that would save time as well [18:13] V1: That would only be usefull for matching, not for parsing. [18:13] qFox: clearly [18:13] creationix: doesn't js cache the regex object all the time anyway [18:13] qFox: no [18:13] mape: Well if you can match the most common in a indexOf the regex can be less complex [18:13] qFox: every literal is interpreted as a new regex object [18:13] qFox: whenever its encountered... [18:14] qFox: although maybe they are internally... [18:14] qFox: (but the spec clearly states they must be recreated) [18:14] qFox: es5 anyways. not sure about 3 [18:14] jedschmidt has joined the channel [18:15] qFox: anyways, V1, maybe change the first function to use indexOf's :) is all i meant to say [18:15] V1: Will test it :) [18:15] qFox: and, if possible, cache the large regex object somewhere. you're not going to do complex things with it so that should be fine. [18:16] fizx has joined the channel [18:16] V1: well it should be cached as its not constructed inside a function but a global inside the module [18:16] V1: so it would only be generated when you require the module [18:16] qFox: you can probably create a large string with implode and pass it on to new RegExp() btw [18:17] qFox: that should allow you to use regex and still be maintainable. [18:17] qFox: to some degree :) [18:18] V1: I could also construct browser_v123 as precompiled string "browser|broswser|browser|browser" to so i can ditch the .joins [18:18] qFox: possibly, but i'd save that for the last step, and possibly just the "minified" version [18:19] qFox: seeing how it's a single step, the overhead is not worth the maintainability impact [18:20] mikeal has joined the channel [18:20] mythz has left the channel [18:20] tk: if I am testing a script in node-repl is there a way to expose the vars that are global inside the JS file w/o using exports and setting the require to a var? [18:21] creationix: tk: you can eval the script [18:21] V1: the overal performance isn't that bad, it parses 6040 useragents in 165ms avarage [18:22] mjijackson has joined the channel [18:22] V1: (total ) [18:22] creationix: V1: nice [18:23] creationix: so I'm giving a presentation on node.js tomorrow night and haven't had a chance to prepare, any ideas on what I should present [18:23] tk: creationix: ahhh so eval will handle it a bit different than require does? [18:23] creationix: tk, yes, require basically does an eval, but wraps it in a wrapper function [18:23] tk: creationix: ahhh explains the vars being out of scope then [18:24] creationix: require does more than that, but that's the general idea for variable scope [18:24] isaacs has joined the channel [18:26] joshbuddy has joined the channel [18:27] sztanphet has joined the channel [18:28] teemow has joined the channel [18:29] airportyh has joined the channel [18:29] sztanpet has joined the channel [18:32] maushu has joined the channel [18:33] sztanphet has joined the channel [18:41] qFox: hm. pretty happy with my simple query interface. do i proceed to create some kind of phpmyadmin script, agnostic of its server layer. or do something fun. [18:44] WALoeIII has joined the channel [18:44] admc has joined the channel [18:44] maushu: agnostic of its server layer [18:45] qFox: well yeah, just fire queries at some page and wait for a response. [18:45] qFox: after that it's all client side [18:46] mjr_: tk: note that repl also does an eval, which is the "e" in "repl". Your evaled code has access to the global scope, and it also returns the result of eval. [18:47] tk: mjr_: the fact that code typed into repl was accessable was what was puzzling me about the require from there [18:47] rictic has joined the channel [18:48] mjr_: I think doing require inside of repl can cause some surprises. [18:49] sudoer has joined the channel [18:49] rictic: I'm having trouble writing reliable node programs because if there are any errors in any event handlers (naturally, most of my code is here), things just fail silently [18:49] rictic: I've had some luck scattering try/except around to catch a few bugs, but there seems like there's gotta be a better way [18:49] mjr_: rictic: listen for uncaughtException [18:50] rictic: oh, awesome [18:50] saikat_ has joined the channel [18:51] mjr_: http://nodejs.org/api.html#event-uncaughtexception-49 [18:51] botanicus has joined the channel [18:52] mjr_: mape: it is kind of tedious to extract the hash links in the doc viewer. Is there any way you could make that easier? [18:52] creationix: mape, maybe put a link be each header? [18:52] creationix: s/be/by/ [18:53] rictic: Making a link by each header that's only visible on mousover seems to work well [18:54] felixge: rictic: nothing should ever fail silently [18:54] mjr_: creationix: did you figure out what to do for your talk? [18:54] felixge: rictic: if you see node dying without a (somewhat) useful error message, it's a bug [18:54] creationix: mjr_: I'm thinking a whiteboard type thing where you draw on a shared canvas [18:54] creationix: nothing fancy because I have to implement it all today and write up slides for it [18:55] felixge: creationix: google beat you to it :) [18:55] tilgovi has joined the channel [18:55] rictic: felixge: yeah, that's what the docs seem to be saying, but that's been my experience, maybe Socket.io has a big catchall somewhere [18:55] creationix: felixge: which one? [18:55] felixge: creationix: http://docs.google.com/support/bin/topic.py?hl=en&topic=28131 [18:55] felixge: google docs now has a realtime drawing app [18:56] felixge: it's pretty awesome / vector based [18:56] felixge: I won't link to a document there, last time I did that the people in here were busy drawing penises for 30 minutes [18:56] felixge: :D [18:56] mjr_: There are sadly still sometimes bugs where node silently fails. If you can isolate them, these are good things to report. [18:58] felixge: mjr_: I had a particular evil case of that in 0.1.3x :( [18:59] tmpvar has joined the channel [18:59] mjr_: Yeah, me too. It turned out that went away (because it jumped out) with the "errors throw" change. [18:59] thotypous has joined the channel [19:00] V1: qFox, its indeed faster using .indexOf .. The regexp based parsers 6000 ua's in 75ms and the indexOf in 65 ms ;) [19:00] qFox: :) [19:00] qFox: on huge regexp? [19:00] qFox: *one [19:00] V1: no, the small matching [19:00] _ry: mjr_: yep :/ [19:00] qFox: ah. i would expect the huge regexp to win over multiple passes [19:00] _ry: mjr_: realized i wasn't catching sigpipe today [19:01] _ry: so that should fix one of them [19:01] mjr_: _ry: Yeah, I saw that. Whoops. [19:01] V1: Well the downside of the huge is that it actually needs the matches , it doesn't just search. So indexOf would be of little use there. [19:01] felixge: V1: I think indexOf will pay of more when the strings become larger [19:01] qFox: hm yeah [19:02] _ry: this is the big issue at the moment: http://github.com/ry/node/issues#issue/126 [19:02] _ry: it really needs to be fixed soon [19:02] _ry: we got to get V8 to fix the damn ReThrow too [19:02] qFox: such a simple test case deserves a simple fix :p [19:02] felixge: _ry: any idea what causes this bug> [19:02] felixge: ? [19:03] creationix: _ry: I think it was sigpipe that was killing howtonode every few hours [19:04] creationix: I solved it temporally with an infinite loop in bash restarting the process [19:04] mjr_: creationix: upstart is not a bad way to handle that, even after _ry fixes this bug. [19:04] fizx has joined the channel [19:04] creationix: I never could get upstart to work [19:05] creationix: it worked for some of my processes, but not all of them [19:05] mjr_: That's annoying. [19:05] inimino: monit is nice [19:05] creationix: yeah, and back in 0.1.91, I had a bug where howtonode would just stop responding, but not crash [19:05] mjr_: I've got probably 10 different things going with upstart right now. [19:05] creationix: monit would catch that, but not upstart of a bash script [19:06] mjr_: oh, hmm. Maybe that is better. [19:06] mjr_: monit I mean. [19:06] creationix: upstart is really nice when it works though [19:06] V1: felixge, i don't think the strings will become any larger unless some browser vendor goes nuts when compiling the user-agent string. The largest that I have found was 256 chars. [19:07] stepheneb has joined the channel [19:07] creationix: _ry: nice to know that's a bug and not just me being dumb (re: issue 126) [19:08] creationix: I get that all the time when developing [19:08] unomi: http://www.punteney.com/static/examples/yui3-slideshow-animated/ [19:08] unomi: wrong # [19:12] joshbuddy has joined the channel [19:17] malte has joined the channel [19:19] TheEnd2012 has joined the channel [19:24] keyvan has joined the channel [19:26] Dracoblue|afk has joined the channel [19:30] nefD: i ditched monit & upstart in favor of writing daemons (via node-deamon) to handle the relaunching of and logging for script crashes.. a lot more flexibility [19:30] nefD: ((late response)) [19:32] ncb000gt has left the channel [19:34] bweaver has joined the channel [19:34] charlesjolley has joined the channel [19:34] sveimac has joined the channel [19:38] derferman has joined the channel [19:40] sveisvei has joined the channel [19:42] mscdex: node-daemon? got a link? [19:43] phazm has joined the channel [19:43] sztanpet has joined the channel [19:44] javajunky has joined the channel [19:45] mscdex: ah nevermind, I think found it [19:47] drostie has joined the channel [19:47] gbot2 has joined the channel [19:48] malte_ has joined the channel [19:53] arlolra has joined the channel [20:01] kriszyp has joined the channel [20:02] creationix has left the channel [20:02] creationix has joined the channel [20:02] creationix has left the channel [20:02] creationix has joined the channel [20:06] _ry: creationix: hey [20:06] creationix: hey [20:06] _ry: wheat - it loads stuff from git repo? [20:06] creationix: yep [20:06] creationix: uses "git show" in a subprocess [20:07] _ry: i wonder if we could somehow bench it against something similar in ruby or python? [20:07] creationix: so local remo, not repote [20:07] creationix: probably [20:07] creationix: using their popen [20:07] _ry: is there a similar setup? [20:07] dgathright has joined the channel [20:07] _ry: er is there similar software? [20:07] creationix: I cache the responses in ram though, so it would have to be long running like twisted or event machine to be comparable [20:07] _ry: what i really want is a web benchmark that does some i/o [20:08] _ry: instead of respond iwht 'hello world' [20:08] creationix: well, if I disable caching, it's pretty slow [20:08] mjijackson has joined the channel [20:08] creationix: it would have to spawn a several new child processes per request [20:08] RayMorgan: _ry: I pretty much have a dev branch of Mu working with Buffers [20:09] creationix: _ry do we have buffer based streams in fs yet? [20:09] RayMorgan: have yet to test Mu string vs buffer over the wire though. Tonight I will [20:09] creationix: serving static files with buffer pumping would be a good test I think [20:10] _ry: RayMorgan: cool - i don't have much time though - i was just trying to see if there was a blog or something i could test out of the box [20:10] _ry: like a little sqlite3 blog :/ [20:10] _ry: or wheat .. [20:10] _ry: the problem with wheat is that it doesn't exist in ruby yet :) [20:11] RayMorgan: yeah, that is my plan.. a primitive blog [20:11] creationix: _ry: are you looking to find places to improve node or looking for a benchmark where node wins [20:11] _ry: i have this presentation tomorrow and i would love to show the monster benchmark - which so far i've been shying away from [20:11] creationix: because anything with subprocesses seems really slow to me [20:11] _ry: the, "yes, it's 1000x faster than your current software, literally" [20:11] creationix: _ry: I've got a presentation tomorrow too, want to work together [20:12] _ry: benchmark [20:12] zomgbie has joined the channel [20:12] creationix: ACTION thinking... [20:12] creationix: well, I consider the in-memory caching of wheat a feature of node [20:13] creationix: it's so easy to just put stuff in a closure variable [20:13] _ry: creationix: i don't want to do any programming - i need to work on my slides - but if you setup a bench i could help with doing graphs and stuff [20:13] _ry: yeah the caching isn't very fair [20:13] creationix: :) [20:13] RayMorgan: _ry: did you ever look into using writev? [20:13] _ry: i want to bench real i/o requests [20:13] keyvan has joined the channel [20:14] _ry: RayMorgan: for what? [20:14] _ry: RayMorgan: i forget - did we talk about that? [20:14] ewdafa has joined the channel [20:14] phazm has joined the channel [20:14] RayMorgan: I was there.. but I didn't know what it was fully about. But if I remember, it was to allow not actually writing the bufer until the end of the tick [20:15] RayMorgan: so I can call httpResponse.write() a bunch of times and it won't continually be flushing small bits [20:15] RayMorgan: something like that [20:16] _ry: RayMorgan: oh well it's not really a writev() issue - it's just letting the writes buffer up very momentarally to push them out in one syscal [20:16] _ry: the problem is that it doesn't work very well with the current API [20:16] RayMorgan: gotcha [20:16] _ry: because write() is supposed to return true if it's flushed to the buffer [20:16] RayMorgan: ah [20:16] _ry: but you can't say that unless you've actually done it [20:16] zomgbie has joined the channel [20:17] _ry: i'm toying with it [20:17] _ry: it's a difficult problem [20:17] RayMorgan: yeah [20:17] _ry: especially with writing buffers - because if you delay the write [20:17] _ry: then people would think they can reuse the buffer [20:17] _ry: but they can't cause it's sitting internally in some queue [20:17] _ry: strings are immutable so that's not really a problem [20:18] RayMorgan: that makes sense [20:18] _ry: software is hard [20:18] _ry: :) [20:18] steadicat has joined the channel [20:18] creationix: and hardware is easy, I guess they were misnamed [20:18] _ry: what i might be able to do is delay the writing of strings [20:18] _ry: and do them all in one syscall [20:18] _ry: but when a buffer comes flush the whole thing [20:19] _ry: there isn't really a difference between flushing to kernel and flushing to node [20:19] _ry: maybe node could just have its own interanl buffer [20:19] _ry: and return false when it's above a certain threshold [20:20] qFox: and have an extra param to force the flush anyways? [20:20] qFox: (or vice versa) [20:20] _ry: it'd flush in any case at the end of the tick [20:20] _ry: just to optmize the case wher epeople do [20:20] _ry: socket.write("hello world") [20:20] _ry: socket.write("\n") [20:20] _ry: so you don't do two syscalls [20:20] qFox: ah okay [20:21] _ry: which seems like a really special problem - but even in http.js where i basically control everything [20:21] tmpvar has joined the channel [20:21] _ry: i've been wedged into a situation where i'm making 2 byte write() syscalls [20:21] _ry: (in proxying chunked http requests) [20:21] _ry: and - it really hurts [20:22] _ry: you just can't do that in highperformance servers [20:22] RayMorgan: it would definitely help Mu [20:22] fizx has joined the channel [20:23] _ry: maybe i need to change the API [20:24] _ry: having the return value of write() show the size of the write buffer might be too tight a coupling [20:24] _ry: maybe write streams should just have a "queueSize" member [20:24] phazm: tmpvar: Hey, any reason why your jsdom is requiring ryan's fork of node-htmlparser instead of the head by tautologistics? [20:24] rictic: So good news: I've got a reduction for the bug I was seeing earlier, where errors were silently dropped [20:24] _ry: if i did that then i could flush at the end of the tick both buffers and strings in a single syscall [20:25] rictic: The bad news is that it seems to depend on hitting an internal server: http://pastie.org/945800 [20:25] _ry: (btw - this is why commonjs defining streams is laughable) [20:25] DracoBlue has left the channel [20:25] tmpvar: phazm, davglass made some changes that made it work properly? im not completely certain [20:25] tmpvar: i can dig up the conversation if you need [20:25] DracoBlue has joined the channel [20:25] _ry: (they can't possibly imagine these situations) [20:25] RayMorgan: _ry: would you have to copy the buffer though? [20:26] _ry: RayMorgan: yeah - i guess having the buffer ref is still a problem [20:26] phazm: tmpvar: Sure -- I just think that the head is considerably more developed than the fork you are using -- I haven't tried implementing it yet, just curious [20:26] tlrobinson: (_ry: async streams, you mean. sync streams are pretty well understood) [20:27] _ry: but sync streams make no sense for servers [20:27] tmpvar: phazm, I havent had a chance to peek it, I'll put it on the todo [20:27] _ry: since js doesn't have threads [20:27] phazm: thanks tmpvar [20:27] romainhuet has joined the channel [20:27] n8o_ has joined the channel [20:27] phazm: right now I'm using regex matches to extract html from a 'data' listener... :'( [20:27] _ry: RayMorgan: maybe we could have the buffer emit a 'flushed' event? [20:28] tlrobinson: _ry: lets not get into this argument :) [20:28] _ry: RayMorgan: sigh - but that seems so complicated [20:28] _ry: tlrobinson: :) [20:28] RayMorgan: _ry: yeah, that seems a bit much [20:28] _ry: i hate buffers [20:28] RayMorgan: lol [20:28] _ry: i mean i like them for use internally [20:28] _ry: but i don't want users to use them actually [20:28] qFox: phazm> does the "end" event fire? eg. does it show up in console? [20:28] _ry: they're too lowlevel [20:29] _ry: on the other hand - i can't really tell people not to use them - since they're so fast [20:29] RayMorgan: yeah [20:29] _ry: it's a real conundrum [20:30] RayMorgan: I would say the average user shouldn't use them.. but I would like to see libraries that do I/O use them so at least they are fast [20:30] _ry: one possibility is having a copy-on-write way to slice a buffer [20:30] aaronwinborn has joined the channel [20:30] _ry: effectively making them immutable [20:30] _ry: well - not really [20:30] _ry: but making it so the slices don't reference the same data [20:30] qFox: if a buffer acts like a string, wouldnt that solve the whole problem? [20:30] phazm: qFox: for? [20:30] mjr_: Can't you work around this multiple write thing for now by just turning on Nagle? [20:31] qFox: phazm> anything, but especially when you're expecting the error to be thrown :) [20:31] mjr_: If you don't mind the ~200ms packet coalescing delay because you want to lazily do multiple writes of a few characters here and there, the kernel can sort that all out for you. [20:31] RayMorgan: qFox: strings in V8 are not efficient to get out of V8, so writing them to a socket for instance is slow [20:31] phazm: I expect no errors, currently. What could POSSIBLY go wrong? [20:31] phazm: :) [20:31] _ry: mjr_: the issue is making the actual syscall [20:32] mjr_: Or is it literally the overhead of the syscall [20:32] mjr_: oh, well that sucks [20:32] _ry: i mean - i'm not sure - but i think so [20:32] phazm: qFox: Do you mean when using the jsdom module, or my regex hack? [20:32] qFox: RayMorgan> i didn't mean actually using strings. i meant the immutable property they have. if buffers acted the same way as strings do... [20:32] RayMorgan: ah [20:32] qFox: phazm> i'm only referring to the pastebin you just pasted [20:32] _ry: mjr_: if i tcptrace the proxy for example [20:32] _ry: it sends the correct packets [20:33] mjr_: Then I suggest you do it the way Nagle does it. If you care about super low latency, then you have to be careful with your writes, because each of them will do a syscall. If you want to be lazy, then node can do a similar Nagle-style buffering. [20:33] _ry: e.g. "\r\n" isn't its own packet [20:33] phazm: perhaps you are referring to rictic, qFox? [20:33] _ry: the issue is really with the reference to the buffer [20:33] qFox: am i...? oops, sorry. [20:33] _ry: users want to socket.write(buffer) and then buffer[7]= 123 [20:33] _ry: because they'll feel like it's gone [20:34] qFox: rictic> is the "end" event firing? do you see the line in the console? [20:34] _ry: but it will still be waiting at least until the end of the tick to be flushed out [20:34] rictic: qFox: I do [20:34] qFox: ok [20:34] rictic: and if I hit a different server (or even a different page on the same server), the error is not swallowed [20:34] qFox: _ry> ah ic. then the immutable property will not help :/ [20:34] rictic: I created an issue for this: http://github.com/ry/node/issues/issue/135 [20:35] mjr_: _ry: it seems like there's a way to work this out so that's still the API. At some point you end up building up a location in memory for the syscall to handle, and you do this by copying bytes. [20:36] mjr_: This would be easier to work out with a whiteboard. [20:36] mjr_: and like, no typing. [20:36] qFox: is there no way of flushing to the buffer on access? [20:37] tmpvar: REQUEST: whiteboard using canvas + collaborative via nodejs [20:37] qFox: tmpvar> that's mostly a clientside thing, isnt it? [20:37] tmpvar: it'd be like a chatroom, but instead of text it would communicate lines/colors/etc [20:38] tlrobinson: tmpvar: did you see saikat's thing [20:38] tmpvar: i did not [20:38] tmpvar: link? [20:38] deanlandolt: tmpvar: RESPONSE: http://ajaxian.com/archives/drawing-with-cappuccino-nodejs [20:38] deanlandolt: err, yeah, what tlrobinson said [20:38] mjr_: it is hard to beat hashing things out in person on a real whiteboard, assuming the travel times are low. [20:38] tlrobinson: yeah what deanlandolt linked to :) [20:39] saikat: tmpvar: http://techblog.gomockingbird.com/socket-to-em is the original post with link to the source code [20:39] tmpvar: thanks! [20:40] qFox: _ry> is that the only case? accessing numeric properties of the buffer before it's flushed? [20:41] mjr_: qFox: the issue is that users might want to re-used the buffer after they have called write() on it. [20:41] mjr_: fill it up with new data for their next write, etc. [20:42] qFox: i'm afraid this is asked and answered, but why is that a problem? [20:42] qFox: i mean, that's what a buffer does? :) [20:43] mjr_: Because node would like to hold on to those buffers until they can be stuffed into the kernel's buffer. [20:43] mjr_: too many uses of the word "buffer" [20:43] qFox: ah wait. overwrite. [20:44] qFox: maybe the problem is that write seems a lot like push? [20:44] _ry: mjr_: you coming to the talk tomorrow? [20:44] _ry: mjr_: maybe we can find a whiteboard :) [20:44] qFox: (i think i see the problems now) [20:45] _ry: but the point of buffers is that to avoid copying [20:45] _ry: we write() directly from them [20:45] mjr_: _ry: yeah, I'll be there tomorrow. I could also get there earlier if you want to chat. [20:45] _ry: if it needs to copy then it defeats the point [20:45] qFox: yeah and since it cant be extended... [20:46] aaronwinborn: i would like to implement a file upload for large files (to php/drupal), and am concerned if multiple users upload simultaneously. i've been told to look at node.js, but don't know where to begin. are there similar examples to work from out there? [20:46] _ry: mjr_: before the talk probably isn't a good time to discuss - i'll be too preoccupied ( i hate giving talks) [20:46] _ry: mjr_: but if not afterwards, then maybe at mikeal's house? [20:46] mjr_: Yeah, I understand. Well afterwards we can maybe chat a bit, but I bet you'll be overwhelmed by fans. [20:47] mjr_: you know, signging autographs, etc. [20:47] teemow has joined the channel [20:48] mjr_: Otherwise, I'll probably be at mikeal's place. If that doesn't work, I could just come over. I work at 2nd and Bryant nearly every day. [20:48] _ry: heh - well maybe convincing yahoo people to take up node :) [20:48] piranha has joined the channel [20:48] _ry: mjr_: that too :) [20:48] jedschmidt has joined the channel [20:49] _ry: ACTION goes make to making diagrams  [20:52] nefD: hrm. i think ive grown to dislike jquery ui in general.. [20:53] TobiasFar has joined the channel [20:54] isaacs: you know, if yahoo had been this into node 5 months ago, i might not have quit. [20:55] V1 has left the channel [20:55] qFox: are they actually going to do something with it? [20:55] isaacs: _ry: i think it's starting to catch on at yahoo. i know dav is all kinds of into it, and yui is an early adopter team at yahoo when it comes to funky js stuff. [20:56] qFox: (or is that why ryan is going there? :p) [20:56] isaacs: qFox: yui is using it in a few places today [20:56] qFox: cool [20:56] isaacs: qFox: if you've seen davglass on the mailing list, he's the same davglass from yui [21:07] bmizerany has joined the channel [21:07] jedschmidt: isaacs: i'd always figured you were doing node stuff at yahoo, heh. [21:08] isaacs: jedschmidt: not officially. and not since january [21:08] aaronwinborn: how can i post a large file to node.js and have it return the file to php? [21:08] aaronwinborn: or alternatively save its filepath to mysql? [21:09] saikat: btw _ry in the README "ronn" should be "run" [21:09] sztanpet has joined the channel [21:13] technoweenie: saikat: i think he's referring to http://rtomayko.github.com/ronn/ [21:13] saikat: oh haha ok [21:13] saikat: wait but [21:13] saikat: technoweenie: why do you need ronn to do "make doc install" [21:14] technoweenie: because node uses ronn to generate the docs [21:14] saikat: oh i see [21:14] saikat: thanks [21:17] mrjjwright has joined the channel [21:17] airportyh has joined the channel [21:17] technoweenie: np [21:17] technoweenie: those node docs are really nice [21:18] saikat: agreed [21:20] airportyh has joined the channel [21:22] CIA-75: node: 03Rhys Jones 07master * rafce4c3 10/ (5 files in 3 dirs): Added default CAs, updated openssl verify behaviour, added crypto and https documentation - http://bit.ly/ctQWua [21:22] CIA-75: node: 03Ryan Dahl 07master * rd044e2d 10/ lib/net.js : [21:22] CIA-75: node: Lazy load crypto [21:22] CIA-75: node: The whole program is being slowed down by the large CA string in crypto. [21:22] CIA-75: node: Why? - http://bit.ly/aaukmW [21:24] aaronwinborn: http://rfw.posterous.com/how-nodejs-saved-my-web-application looks like a promising solution for large uploads. or am i barking up the wrong tree? [21:26] fizx has joined the channel [21:31] qFox: hmk. the speed of information? about 4 seconds across a square: http://nos.nl/l/tcm:5-712583/ [21:32] darkf has joined the channel [21:32] qFox: (dutch, apparantly some guy started screaming during the 2 minute silence in memorial of ww2, which caused the panic you're witnessing) [21:34] qFox: all said and done, the first seconds are actually the most interesting. how people respond to something like that these days. even here... [21:40] nefD: hrm, maybe I should give yui a shot [21:41] mjr_: I keep meaning to do the same thing with YUI. [21:41] voltie has joined the channel [21:42] nefD: ive got no beef with jquery (my go to), but i just dont like dealing with jquery ui anymore, and I don't necessarily like the prospect of dealing with mixed-quality plugins [21:43] isaacs: yui is nice [21:43] mikeal: isaacs is biased [21:43] isaacs: hehe [21:43] isaacs: i like jquery, too [21:43] isaacs: actually, in a lot of cases, i think jquery is actually quite a bit better than yui [21:43] isaacs: less over-engineered, more javascripty. [21:43] nefD: hrm, thats kinda what i'm worried about [21:44] mikeal: have you used jquery-ui ? [21:44] isaacs: jquery tends to have a smaller API, but even jquery is really heavy for some things. [21:44] isaacs: mikeal: i have. it's mostly shit. [21:44] mikeal: it's interesting [21:44] nefD: ive used jquery-ui for years, but i've grown to dislike it, honestly [21:44] airportyh has joined the channel [21:44] isaacs: mikeal: divs everywhere with a jillion stupid ui-top-left classes [21:44] mikeal: they worked really hard not to leave the standard jquery model [21:44] nefD: i feel like every time i use it, i'm having to come up with workaround hack code to get the widgets to perform fairly trivial tasks [21:44] mikeal: but it also means that they created and emit hundreds of new events [21:45] mikeal: there are all these new widget specific events that fire in really specific orders [21:45] mikeal: it's crazy [21:46] nefD: heres a fun one: getting a reference to the currently selected tab using the tabs widget [21:47] nefD: now, if I were designing a tabs widget, I would *probably* say to myself, "You know, I bet someone will eventually need to find out which tab is currently selected.. I'll add a method for that!" [21:48] rnewson has joined the channel [21:48] nefD: now, youll find that its actually not too tough to do this, but its certainly less intuitive than it could be [21:48] mikeal: i don't do enough ui programming to have a really strong opinion [21:48] rnewson: mjr_: I thought you were going to ask me about couchdb-lucene problems? [21:48] mikeal: all i know is that flot is the best shit ever for making graphs :) [21:49] mjr_: rnewson: yeah, I keep getting distracted though. Got a second right now? [21:49] rnewson: yep [21:49] mjr_: maybe we should go over to #couchdb [21:49] derbumi has joined the channel [21:49] rnewson: bet I get there first. [21:50] kriskowal has joined the channel [21:53] romainhuet has joined the channel [21:57] RayMorgan_ has joined the channel [21:57] nefD: hmm mochaui seems like a nice ui library [21:58] nefD: i wonder if it'd play nice qith jquery, or if i'd need to lear mootools [21:58] nefD: geez.. s/qith/with, s/lear/learn [22:00] mikeal: did someone write a good options parser yet? [22:00] mjijackson: mikeal: do you know about optparse-js [22:00] mjijackson: ? [22:01] creationix has joined the channel [22:01] mjijackson: mikeal: http://github.com/jfd/optparse-js [22:01] thotypous has joined the channel [22:02] isaacs: mikeal: have you seen what i did to options in npm? [22:02] isaacs: optparse-js and argparsejs are both overkill. [22:03] mikeal: yeah, i didn't like var optparse-js last time i looked [22:03] creationix has joined the channel [22:03] mikeal: isaacs: when was the last time you changed the options parser in npm [22:03] mikeal: cause i looked at it a few months back [22:03] isaacs: mikeal: less than that [22:03] isaacs: mikeal: like, weeks. [22:03] mikeal: i'm using this right now [22:03] mikeal: http://github.com/mikeal/relaximation/blob/master/common/optionparser.js [22:03] mikeal: it's a total hack [22:04] mikeal: but it gives me a free help menu and parses arguments compliant with other unix programs [22:04] mikeal: god that code is ugly [22:04] mikeal: i think i wrote that my first week i was using node [22:04] isaacs: i found i really ended up wanting something more like ronn for man pages, and the "automatic help menu" DSL-style approaches always ended up sucking. [22:05] mjijackson: isaacs: what do you mean by overkill? [22:05] isaacs: but i guess it'd be nice to have it generate the VERY terse sort of thing you get when you send an unknown option to ls. [22:05] mikeal: all mine requires is a help string for each command [22:05] mikeal: i don't do the sub-command stuff at all [22:05] isaacs: mjijackson: i mean, too much code, not obvious, not intuitive. [22:06] mikeal: man, this has a recursive prototype function [22:06] mattly has joined the channel [22:06] mikeal: something about that seems really wrong [22:06] isaacs: mikeal: here's the arg parser logic i'm using for npm: http://github.com/isaacs/npm/blob/master/cli.js#L24-42 [22:06] isaacs: it turns --foo bar into { "foo" : "bar" } [22:06] isaacs: but that's about it [22:06] mikeal: yeah, i need more than this [22:07] mikeal: i need support for -a and —arg [22:07] mikeal: and —arg=something and —arg something [22:07] mikeal: standard argument parsing semantics for more programs [22:07] isaacs: mikeal: i started writing something like that at http://github.com/isaacs/arg-parse-js [22:07] isaacs: that's when i decided it's overkill [22:08] mikeal: this is a lot of code [22:08] mde: mikeal: I did a very basic version of something like that: http://github.com/mde/jake/blob/master/lib/jake.js [22:08] mikeal: this makes my code seam lean :) [22:09] mde: Kinda hacky, but it works reliably. [22:09] mikeal: mde: i might steal this while loop [22:09] mde: Excellent. [22:09] mikeal: cause my recusive function is kinda messy [22:09] mde: Define everything in optsReg [22:10] mikeal: mde: does this handle -a, —arg, —arg=something, and —arg something [22:10] mikeal: this doesn't handle boolean arguments, but i can just add that [22:10] mde: It handles at least two of those, but yeah. [22:11] mde: Ah, it doesn't do --arg something [22:11] mikeal: i was a simpler way to do that definition [22:11] mikeal: er want [22:11] mikeal: maybe [22:12] isaacs: mikeal: most of the complexity in arg-parse-js is around using the same code to generate a snazzy help doc and also parse the args into an object, and support nested groups and whatnot. [22:12] isaacs: mikeal: yeah, it's way more than it should be. [22:12] mikeal: {"args":['-a','—arg'], "help":"help me!", default:true, type:"boolean"} [22:12] mikeal: default is optional [22:12] rnewson has left the channel [22:13] mikeal: maybe i'll work on this tonight [22:13] fizx has joined the channel [22:13] mde: Yeah, I'm just passing everything through, it's not really general purpose. Would be nice to have something simple like that to use though. [22:14] isaacs: mikeal: what about something that just interprets the things on teh command line into an object, and then another thing that takes a list of requirements and shows help if they're not set right? [22:14] mikeal: and then i'll push it to the registry with npm :) [22:14] mikeal: because some args are optional and some aren't [22:14] isaacs: mikeal: also, some args are optional sometimes. [22:14] isaacs: ie, if you have -f, then you must have either -p or -q, that kinda shit [22:15] mikeal: right, but if you're going to be adding that kind of arg specific logic, you can just do it after you get an options hash out of the parser [22:15] isaacs: then why not just always have the logic happen after the parse? [22:15] mikeal: i just want it to be dead simple to create a new command line script [22:15] isaacs: mikeal: yep [22:15] mikeal: sure [22:15] mikeal: maybe just add a validation function [22:15] isaacs: yep, that's what i'm thinkin [22:15] mikeal: so, something like this [22:16] isaacs: and the validation fn gets the obj as an arg, and can barf. [22:16] isaacs: mikeal: also, you need to be able to take positional args. [22:16] mikeal: var opts = cmdopts.createParser( {name:{args:['-a','—arg'], "help":"help me!", default:true, type:"boolean"}) [22:16] isaacs: cp file1 file2 [22:16] isaacs: that kinda deal [22:16] mikeal: opts.validation = function (options) { } [22:17] isaacs: mikeal: can you do it without creating an object, maybe? [22:17] isaacs: var opts = parse(process.argv) [22:17] mikeal: var options = opts.parse() [22:18] isaacs: OH! heh, here's where it becomes important to know up front [22:18] mikeal: the reason i like it being an object that you call parse on, instead of the other way around [22:18] isaacs: cp -R file1 file2 [22:18] mikeal: is that you can define the options at the top of the file and then at the bottom do if (require.main == module) { opts.parse() } [22:18] isaacs: is -R a boolean flag, or an arg that takes data? [22:19] pkrumins: another day off from node.js, what's new and cool? [22:19] isaacs: mikeal: why not just put this at the bottom of the file: mikealsFunkyCliGoodness() [22:19] pkrumins: any cool new libs? [22:19] mikeal: ahaha [22:19] isaacs: and then that thing will do if (module.parent === require.main) .. [22:19] mikeal: i like the definition at the top because for most bin scripts the context of the script can be undestood from the external cli interface [22:20] mikeal: wrapping it in another function is annoying [22:20] isaacs: mikeal: oh, hey, also... your bins won't be require.main if you've installed it with npm [22:20] isaacs: since i use a shim to get around the require("./foo") issues [22:20] mikeal: i have scripts that aren't part of a module tho [22:20] mikeal: a ton actually [22:20] isaacs: node scripts? [22:20] isaacs: they're always "part of a module"... [22:21] mikeal: it's not a module you would ever install [22:21] mikeal: like, i would never to [22:21] mikeal: npm install mikeals-build-scripts [22:21] isaacs: ah, i see [22:22] isaacs: still, it'd be brittle to rely on being require.main [22:22] mikeal: if it's part of an installable module definitely [22:22] mikeal: all the cli stuff is in a different file [22:22] mikeal: and you never do anything with it but run it as a bin [22:22] mikeal: i don't bother using the require.main thing [22:23] isaacs: yeah, better to put your cli stuff in a cli script, and then assume it's the cli [22:24] mikeal: agreed [22:28] voltie_ has joined the channel [22:28] creationix has joined the channel [22:32] creationix has joined the channel [22:42] isaacs: mikeal: seems like all that the parser would need to know is "these things are definitely flags" [22:42] mikeal: yup [22:42] isaacs: mikeal: what about stuff like: tar -xzvf filename.tgz [22:43] isaacs: mikeal: are you going to support single-char flags being lumped together? [22:43] mikeal: -xzv are booleans that are set to the opposite of their default, the last one is the important one [22:43] isaacs: right [22:43] mikeal: yeah, it should do that, i don't think my current code handles it tho [22:44] isaacs: you need to know that -f === --filename [22:44] mikeal: and if you did -xzfv it whould throw an error [22:44] mikeal: because f isn't a boolean argument [22:44] isaacs: and know that - introduces one or more single-char switches [22:44] isaacs: though, with tar, you don't even need the - [22:44] isaacs: but that'd be asking for a lot ;) [22:46] mikeal: i'm gonna handle the basics first [22:58] aho has joined the channel [22:59] eck has joined the channel [22:59] eck has joined the channel [23:02] stepheneb has joined the channel [23:03] keyvan has joined the channel [23:04] bmizerany has joined the channel [23:07] rednul has joined the channel [23:08] freshtonic has joined the channel [23:09] kriskowal has joined the channel [23:15] RayMorgan has joined the channel [23:17] phazm: how can I create a nested http client? I've tried adding another http.createClient(80, 'www.site.com'), I've tried reusing the existing site -- but I think there's a conflict opening another http client on port 80 again [23:18] airportyh has joined the channel [23:19] mjr_: You can make many, many HTTP clients to the same server. [23:23] phazm: do you have an example of the syntax? [23:24] phazm: for example, if I have addListener('response'...addListener('data'...addListener('response'....addListener('data')...)...)...); [23:24] mjr_: not handy. Do you have an example you can share that's broken? [23:24] phazm: mind if I PM it to you? [23:25] mjr_: sure. [23:26] stepheneb has joined the channel [23:29] Azeroth has joined the channel [23:36] keyvan has joined the channel [23:37] hassox has joined the channel [23:45] derferman has joined the channel [23:48] mattly has joined the channel [23:49] gf3 has joined the channel