[00:02] twoism has joined the channel
[00:04] Epeli has joined the channel
[00:04] tjholowaychuk: segfaultin
[00:04] tjholowaychuk: go self
[00:05] c4milo: :s
[00:06] evlapix has joined the channel
[00:06] evlapix: Trying to store new Date().getTime() in a buffer. Any help?
[00:06] tjholowaychuk: dont worry, got this under control haha
[00:09] vejs has joined the channel
[00:10] agilandfast has joined the channel
[00:10] [[zz]] has joined the channel
[00:14] ph^ has joined the channel
[00:14] Evet has joined the channel
[00:15] xraid has left the channel
[00:17] vnguyen has joined the channel
[00:20] bootlaces has joined the channel
[00:21] agilandfast has joined the channel
[00:22] mikeal: mjr_: when are you heading over?
[00:22] isaacs has joined the channel
[00:22] isaacs: jashkenas, Aria: ping
[00:22] isaacs: hm... Aria seems to be not around lately...
[00:23] ginader has joined the channel
[00:23] mjr_: mikeal: I'm still in SF. I can leave here in about 20 mins, and I was planning on stopping by my house first.
[00:23] ben_alman has joined the channel
[00:24] isaacs: pquerna: that article was really good.
[00:24] TheEmpath: does node have any oauth support?
[00:25] jashkenas: isaacs: what's up?
[00:25] isaacs: jashkenas: wanna play with the new npm sudo stuff?
[00:25] jashkenas: ha, sure.
[00:25] isaacs: jashkenas: you had a lot of strongly held opinions about that, so feedback would be useful.
[00:25] mikeal: yeah pquerna, i'm still finishing it but it's great so far
[00:25] jashkenas: will do. what should I install?
[00:25] isaacs: jashkenas: npm install http://github.com/isaacs/npm/tarball/fix-root
[00:26] tjholowaychuk: is EventEmitter decent in c++ land?
[00:26] isaacs: jashkenas: to then set it into multiuser mode, `sudo npm multiuser`
[00:27] jashkenas: ok., first thing ... "PWN ME PLZ" is obnoxious.
[00:27] isaacs: hah
[00:27] tekky has joined the channel
[00:27] isaacs: it actually doesn't warn that if it's installing npm
[00:27] jashkenas: you trust yourself, I take it.
[00:27] isaacs: but because it's some random tarball from a random wank on the internet, it assumes that it's unsafe.
[00:28] TheEmpath: i refer to my first dates as tarballs, imo
[00:28] isaacs: jashkenas: if you have an idea for a message to type there that is nicer, but still suitably "stop and think, for real", then that'd be good.
[00:28] jashkenas: would be nice if "C for current" was a lowercase C.
[00:29] isaacs: jashkenas: i think it accepts that too
[00:29] isaacs: jashkenas: yeah, if (r.toLowerCase() === "c") return
[00:29] jashkenas: isaacs: instead of "PWN ME PLZ", just make them type "yes", or "no" -- but don't accept "y" ... only "yes"
[00:29] isaacs: k
[00:29] wink_ has joined the channel
[00:30] jashkenas: isaacs: npm multiuser breaks for me ... gist coming.
[00:30] isaacs: jashkenas: i dunno,though, i type "yes" with even less thought than typing my password.
[00:30] jashkenas: http://gist.github.com/616165
[00:30] jashkenas: let me know if you get that fixed, and I can install again and try again.
[00:31] isaacs: oh, that's weird..
[00:31] isaacs: jashkenas: oh, i see, it didn't actually have anything to write...
[00:31] isaacs: jashkenas: since you didn't set anything
[00:32] isaacs: so, you're not actually putting npm into multiuser mode, you're just running "npm multiuser" and then telling it not to do anything.
[00:32] jashkenas: eh, well, that's what I want.
[00:32] jashkenas: install to /usr/local
[00:32] isaacs: jashkenas: right, and sudo everything, and just pray nothing bad ever happens.
[00:32] jashkenas: bingo.
[00:33] isaacs: then npm multiuser will not solve that problem. what you need is a proper code-reviewed limited-write registry.
[00:33] isaacs: and we don't have one of those.
[00:33] ginader has joined the channel
[00:33] jashkenas: dude -- we already talked about this.
[00:33] isaacs: right, you think i'm silly for caring so much
[00:34] jashkenas: someone can rm -r your home directory with the current npm *without* sudo.
[00:34] jashkenas: that's game over.
[00:34] isaacs: that's not game over. that's a bricked machine.
[00:34] isaacs: bfd, restore from a backup
[00:34] mAritz: would someone here be interested in writing a lacuna expanse bot? :D
[00:34] isaacs: if you really think that's the worst thing i can do to your computer, you're not creative enough.
[00:35] stephenjudkins has joined the channel
[00:35] jashkenas: isaacs: then why has this never happened in the decade that people have been installing Ruby gems and Python eggs with sudo?
[00:35] isaacs: jashkenas: from what i've heard, it has
[00:35] jashkenas: oh? link?
[00:35] isaacs: plenty here: http://www.google.com/search?sourceid=chrome&ie=UTF-8&q=malicious+gem
[00:36] SubStack: installing modules in a userdir is perhaps too risky even
[00:36] SubStack: best to login through a nobody account
[00:36] jashkenas: um, none of those are real incidents ...
[00:36] SubStack: then pull from that
[00:36] SubStack: and sandbox it at runtime also
[00:37] jashkenas: isaacs: your solution is to ask folks to chown /usr/local to their own account ... how is that better than a sudo install?
[00:37] isaacs: jashkenas: /etc/hosts doesn't live in /usr/local
[00:37] SubStack: >_<
[00:37] isaacs: jashkenas: neither does /System/Library
[00:37] SubStack: yeah that's quite a bit better actually
[00:37] jashkenas: now *everything* has effective root access, not just the program I'm consciously sudo-ing.
[00:38] isaacs: jashkenas: no, not everything. because /usr/local *only* has stuff that you've installed.
[00:38] jashkenas: isaacs: so? /etc/hosts isn't the be-all-end-all of security.
[00:38] SubStack: anyways, just put it in your homedir
[00:38] TheEmpath: is there a way to suppress socket.io log messages?
[00:38] isaacs: jashkenas: no, but it's one vector by which you can do a lot of real life "taking all your money" type harm to someone.
[00:38] lianj: isaacs: btw, chromium doesnt use /etc/hosts iirc
[00:38] TheEmpath: i have my own logging solution that exports to file, email, and have developer level support and i'd like to use that instead
[00:39] [[zz]] has joined the channel
[00:39] isaacs: lianj: really? on OS X it sure seems to.
[00:39] jashkenas: isaacs: so is /usr/local/firefox, or /usr/local/bin/ssh, or /usr/local/bin/sftp ...
[00:39] pengwynn has joined the channel
[00:39] jashkenas: by which I mean user-installed web-accessing programs.
[00:39] isaacs: ok, so just chown the folders that you want npm to access, and point it at those.
[00:39] jashkenas: in any case, I'd be glad to continue testing the branch, just let me know when you're ready.
[00:39] lianj: isaacs: hm ok. doesnt work here on linux. maybe its my build..
[00:40] isaacs: lianj: ah, i'm in osx land. everything goes through the local dscacheutil
[00:40] isaacs: er, whatever it is actually called.
[00:40] jashkenas: isaacs: or how about a line in ".npmrc" that says: i_really_dont_mind_using_root = true
[00:41] isaacs: jashkenas: i am not comfortable with that.
[00:41] lianj: isaacs: yeah except when browsers start to bringing their own resolver. anw..
[00:42] isaacs: jashkenas: why not just install npm as root, and then point its configs at the directories suggested by `npm multiuser`?
[00:42] isaacs: jashkenas: then you never use root (except to update npm itself), and the ring of trust is much much smaler.
[00:43] jashkenas: I'd prefer to keep node packages in /usr/local ... like everything else.
[00:43] bbarrows has joined the channel
[00:43] jashkenas: I really don't have this opinion very strongly -- I'm not trying to make a principled stand or anything -- It's just that your package manager has no business being anal about this issue -- no other piece of software does anything like it.
[00:44] jashkenas: And I want to see NPM succeed.
[00:44] isaacs: then why not just own /usr/local/lib/node and /usr/local/bin?
[00:44] isaacs: just because most other pieces of software are hideously insecure doesn't mean it's ok.
[00:44] isaacs: someone has to be first.
[00:44] jashkenas: because I don't own anything in /usr/local .. and changing that policy will cause problems down the line
[00:44] jashkenas: for other users, etc.
[00:45] jashkenas: isaacs *NPM* is one of the most hideously insecure pieces of software in existence, and I mean that with no disrespect -- like I said, I want to see NPM succeed.
[00:45] nerdEd has joined the channel
[00:45] isaacs: no, but it's pretty insecure.
[00:46] isaacs: you have to trust not only the person who wrote the module you're installing, but everyone that person trusts (via their dependencies)
[00:46] jashkenas: Fundamentally, you're running arbitrary scripts as your current user, that anyone can push to the repo -- there's no way to make that secure.
[00:46] isaacs: you're right about that.
[00:46] isaacs: but you can limit the damage to the damage that can be done as a non-root user.
[00:46] jashkenas: Pretending like no-sudo makes it secure is a lie, and not only that, but is mega-annoying.
[00:46] isaacs: i mean, you can't pretend that it's not *more* insecure when run as root
[00:47] Tim_Smart: Make it user no-body. Problem largely solved.
[00:47] isaacs: i'm not pretending that npm is ever secure. just because there's a seatbelt doesn't mean you'll live, but it does mean you probably ought to wear it
[00:47] jashkenas: That's like saying that enough nukes to destroy the world 10 times over, is less dangerous than enough nukes to destroy the world 20 times over.
[00:47] isaacs: Tim_Smart: if it's user nobody, then it can't actually do anything
[00:47] jashkenas: It's technically correct, but it's a fundamental fallacy.
[00:47] isaacs: jashkenas: you know, you can still rm -r ~ as root.
[00:47] Tim_Smart: isaacs: Anything on install phase anyway.
[00:48] isaacs: Tim_Smart: but then you can't do "node-waf configure build", because the current dir is owned by root
[00:48] isaacs: Tim_Smart: i could chown the dir first, run everything as nobody, etc.
[00:48] stephenjudkins: same could be said about maven, rubygems, easy_install, etc...on a project of any reasonable size you have to hope that the couple dozen people who have pushed libraries don't have their private keys / github logins / web hosts compromised
[00:48] Tim_Smart: Well you would have to chown something, yeah.
[00:50] isaacs: also, you'd have to do a setuid, which would only work if you're already root
[00:50] stephenjudkins: frankly, i think the whole situation won't change that much until we're all using a hypothetical future object-capabilities managed code language for everything
[00:50] herbySk: steadicat: hi, any success?
[00:50] jashkenas: stephenjudkins: don't even get me started about object-capabilities ... ;)
[00:50] isaacs: Tim_Smart: and a script could still just call "sudo whatever"
[00:51] Tim_Smart: Yeah.
[00:51] steadicat: herbySk: I'm sorry, I can't try right now
[00:51] stephenjudkins: jashkenas: heh, what are your thoughts on it? big joke? next big thing in programming?
[00:51] jagautier has joined the channel
[00:51] isaacs: the thing is, once you train the user to be accustomed to entering their password, and not see it as a huge warning flag, there's really nothing you can do to even mitigate the damage, let alone make it anything close to "safe"
[00:51] franksvalli has joined the channel
[00:52] jashkenas: big joke. academic wankery. similar to this, really -- if a malicious script makes it on to a page, even an object-capabilities restricted one, it's still game over.
[00:52] jagautier: hey im trying to send a message straight to a single client in socket.IO it says that the clients are indexed by their ids but if i do socket.clients[clientId] im getting an error
[00:52] tmpvar has joined the channel
[00:52] jagautier: ideas?
[00:52] sh1mmer has joined the channel
[00:52] stephenjudkins: anyone use an android phone? random programs that really shouldn't need it ask for permissions for all contacts, GPS location, phone logs, email, etc... as far as I can tell 90% of people just don't even read it and press "ok"
[00:52] jashkenas: object-capabilities apis are only useful to the extent that they expose interesting functionality. And to that same extent, they can be exploited and gamed...
[00:52] isaacs: but yeah, jashkenas, Tim_Smart, the solution would be to check if you're root, and if so, rather than complain about it, chown the folders that I need to "nobody", and then fire up npm as a non-root uid.
[00:53] Tim_Smart: I like not typing sudo because it saves me 5 characters.
[00:53] Tim_Smart: I don't care about security so much... I do care though.
[00:54] Tim_Smart: Oh 5 characters + my password.
[00:54] jagautier: are there any places with more socket.IO besides their website?
[00:55] jagautier: examples that is
[00:55] isaacs: jashkenas: i agree with you about caja, btw.
[00:55] jesusabdullah: caja? What is that?
[00:55] jashkenas: isaacs: cheers for a point of agreement then!
[00:55] stephenjudkins: jesusabdullah: google caja, sandboxed java
[00:55] isaacs: jashkenas: dealt with that noise first-hand on YAP. caja is google's object-capability javascript-in-a-box thing
[00:55] isaacs: jesusabdullah: ^
[00:55] jashkenas: isaacs: by the way, have you seen the JavaScript it generates?
[00:55] isaacs: jashkenas: HOLY HELL yes.
[00:55] isaacs: OMG
[00:56] jashkenas: Caja makes CoffeeScript look like .... I don't even know what.
[00:56] yrashk has joined the channel
[00:56] Tim_Smart: Orgasmic? :p
[00:56] Tim_Smart: Rather the output ecma from Coffeescript.
[00:56] isaacs: imports___.canAccess__("obj").canCall___("method") etc
[00:56] isaacs: jashkenas: caja doesn't even try to be readable, though. cajita is for the cajita interpreter.
[00:56] isaacs: cajita is not for humans.
[00:57] isaacs: jashkenas: also, it's slow.
[00:57] isaacs: but i'm told they have donea lot of work on that.
[00:57] Tim_Smart: So is their naming convection's, so it seems.
[00:57] stephenjudkins: how much first-hand experience do folks here have with caja?
[00:57] jesusabdullah: sandboxed javascript?
[00:57] jesusabdullah: Kinda neat, I guess
[00:57] stephenjudkins: we were talking about using it for a near-future project (i'm personally a bit skeptical)
[00:58] Tim_Smart: :/
[00:58] jashkenas: isaacs: just tried it on underscore, and it fails with a parse error...
[00:58] isaacs: jashkenas: yeah, it fails on most of yui, too, which was pretty painful.
[00:58] isaacs: jashkenas: by the time we'd gotten yui2 into yap, yui3 was up to like the second major public release.
[00:58] Tim_Smart: Well for NPM, I say complain once - really loudly - and never again.
[00:59] jashkenas: amen.
[00:59] isaacs: hm... you know, i'm really kind of liking this "are you really really sure?" and then chowning it myself approahc.
[00:59] isaacs: and from then on, if you sudo, it'll just re-spawn as non-root
[00:59] Tim_Smart: Like somehow play weird noises and stuff.
[00:59] jashkenas: hilariously enough, Caja can't parse it's own source code...
[00:59] isaacs: er, not respawn, just process.setuid("something other than root")
[01:00] jashkenas: isaacs: if you chown my directories, you're part of the problem -- then *you* are the malware.
[01:00] isaacs: haha
[01:00] bencc has joined the channel
[01:00] isaacs: jashkenas: i would'nt be doing a chown -R thing.
[01:00] grantmichaels has joined the channel
[01:00] isaacs: jashkenas: just the .npm folder, the specific the places where i need to write and run things.
[01:00] jashkenas: how would another user access those?
[01:00] Tim_Smart: chown /usr/local/lib/node/coffee-script sorta thing I take it?
[01:00] isaacs: jashkenas: they'd still be world-readable
[01:01] isaacs: and world-executable
[01:01] jashkenas: world-executable?
[01:01] jashkenas: alright.
[01:01] isaacs: yeah
[01:01] isaacs: just not world-writable
[01:01] jashkenas: perhaps an NPM user then?
[01:01] isaacs: yeah.
[01:01] jashkenas: that sounds fine by me.
[01:01] isaacs: jashkenas: so, here's the rub of this all...
[01:01] Tim_Smart: User no-body would be fine.
[01:01] isaacs: there actually IS a very valid use case for "sudo for global stuff, and non-sudo for non-global stuff"
[01:01] isaacs: Tim_Smart: yeah, it'd be a config, easy to do
[01:01] jashkenas: but?
[01:02] sudoer has joined the channel
[01:02] isaacs: jashkenas: i mean, there are people who have specifically said, i want to use sudo to keep npm itself up to date, but i want all my users to run it in their local home dirs.
[01:02] Yuffster has joined the channel
[01:02] isaacs: i mean, i'm not saying all the use cases can't be dealt with, it's just a somewhat tricky UI problem, that's all.
[01:03] Tim_Smart: But yeah, it still doesn't prevent the problem of libraries themselves being the douche.
[01:03] Tim_Smart: Just the install process.
[01:04] Tim_Smart: Which the install process doesn't concern me as much.
[01:04] isaacs: jashkenas: so, i gotta run, but i appreciate your feedback. i hope we can have conversations like this again in the future, it's very helpful to have insight into things from a lot of different people.
[01:05] Tim_Smart: So really, the whole sudo thing is only a really small part of the problem.
[01:05] jashkenas: sure. talk to you later. thanks for being receptive.
[01:05] isaacs: we threw around a lot of pretty emphatic shit, i hope it doesn't leave you less willing to engage in round two :)
[01:05] jashkenas: not at all.
[01:05] isaacs: :D
[01:05] isaacs: Tim_Smart: you too :)
[01:06] Tim_Smart: :p
[01:06] isaacs: Tim_Smart: of course. jashkenas: part of my issue is that I spent too much time seeing people pull nasty crap on our users when i was at yahoo.
[01:06] isaacs: jashkenas: using the flash engine to hijack your dns resolution, that's like, evil haxx0r 101
[01:06] jashkenas: nice.
[01:06] isaacs: not even terrifically difficult, either
[01:07] isaacs: there are even cases where you can do it if the page owner has filtered out and tags from your markup, if you have a js vector
[01:07] twoism has joined the channel
[01:08] scoates: can someone tell me what I'm doing wrong with Step()? http://gist.github.com/616188 (I'd expect the output to be "one\ntwo")
[01:08] isaacs: ok, to be continued.
[01:08] JimBastard has joined the channel
[01:08] cloudhead has joined the channel
[01:08] JimBastard: i ordered a double cheeseburger medium and i got one patty rare and the other well done. im not sure how mad i can be
[01:09] Tim_Smart: JimBastard: Must be a pretty fancy take-out. Usually you can't declare how you want your meat cooked.
[01:10] JimBastard: lol Tim_Smart
[01:10] Tim_Smart: scoates: Don't you need to call the callback?
[01:10] Tim_Smart: this.next() or w/e
[01:12] scoates: Tim_Smart: ah. knew I just wasn't getting it (-:
[01:12] scoates: what's w/e ?
[01:12] scoates: whatever/
[01:12] scoates: ?
[01:12] Tim_Smart: yeah.
[01:12] scoates: ah. (-:
[01:13] scoates: doesn't seem to be this.next()
[01:14] scoates: ah.. it is this.next(); I was using an archaic version of Step
[01:14] scoates: thanks Tim_Smart
[01:15] scoates: ah.. but that parallizes them. I guess I just don't get it.
[01:15] Tim_Smart: I personally think control flow libraries aren't a good idea.
[01:16] jashkenas: Tim_Smart: ++
[01:16] Tim_Smart: There are certain cases where they are useful - for those cases I use my library parallel.
[01:16] scoates: yeah, this isn't for a server app. blocking is ok/intentional.
[01:16] Tim_Smart: scoates: No, just use native functions / prototypes.
[01:17] AAA_awright: And usually you want to throughly cook ground meat, you have no clue what was ground up in there >_>
[01:18] mopemope has joined the channel
[01:19] scoates: I guess I just don't get what you mean. I have code that I want to run before other code (I don't want their outputs to be intermingled when they console.log). I realize that for performance, blocking is bad, but the performance of this doesn't matter that way.
[01:19] Tim_Smart: scoates: Also, if you are writing control flow in a path that sees a lot of traffic, try not to use closures if you care for memory usage.
[01:19] scoates: I don't care about memory, and there is exactly 1 user at any given time (-:
[01:20] Tim_Smart: OK, I have a example of control flow somewhere in a gist...
[01:20] matt_c has joined the channel
[01:20] scoates: cool (-:
[01:22] grantmichaels has left the channel
[01:22] Tim_Smart: scoates: http://gist.github.com/560231
[01:23] scoates: right. that makes sense.
[01:23] Blackguard has joined the channel
[01:23] Tim_Smart: Also, always try to avoid creating functions inside functions where you can.
[01:24] Tim_Smart: Make everything as flat as possible. There are cases where you might have to though.
[01:25] MikhX_ has joined the channel
[01:25] scoates: I think I'm just going to re-work the way my code runs. It could just output less and run in parallel.
[01:25] scoates: thanks.
[01:25] Tim_Smart: I use http://github.com/Tim-Smart/node-parallel for running async stuff in parallel, if interested.
[01:27] scoates: hmm.. that does look useful. thanks.
[01:32] ryah: we need a heap compact lock for v8
[01:32] ryah: it shouldn't be too hard ? :/
[01:33] jashkenas: ryah ... why do you need a heap compact lock?
[01:33] jashkenas: for Node object / v8 gc interactions?
[01:34] ryah: because i want to start poking in the heap
[01:34] ryah: and i can't have stuff moving around
[01:38] jakehow has joined the channel
[01:39] themiddleman has joined the channel
[01:41] jacobolu_ has joined the channel
[01:43] hzin has joined the channel
[01:52] dohtem has joined the channel
[01:53] franksvalli has joined the channel
[02:11] vejs has joined the channel
[02:16] reid has joined the channel
[02:18] antares_ has joined the channel
[02:18] huyhong has joined the channel
[02:20] vejs has left the channel
[02:20] sh1mmer has joined the channel
[02:20] q_no has joined the channel
[02:21] robotarmy has joined the channel
[02:24] rex_fernando has joined the channel
[02:26] heavysixer has joined the channel
[02:26] rauchg_ has joined the channel
[02:31] davidascher has joined the channel
[02:31] boaz_ has joined the channel
[02:33] jakehow has joined the channel
[02:36] matt_c has joined the channel
[02:38] saikat has joined the channel
[02:40] saikat_ has joined the channel
[02:42] mr_daniel has joined the channel
[02:43] dguttman_ has joined the channel
[02:45] marshall_law_ has joined the channel
[02:47] ginader has joined the channel
[02:49] bencc has left the channel
[02:50] creationix has joined the channel
[02:51] rex_fernando has joined the channel
[02:54] bradleymeck has joined the channel
[02:54] bradleymeck: ACTION throws rocks at w3c for not knowing about fallbacks and progressive enhancement and the penetration % of the jabascripts
[02:55] ezmobius has joined the channel
[02:56] rex_fernando: So what's a good way to manage dependencies in the browser?
[02:57] bradleymeck: rex_fernando what kind of dependencies and are you using a JS library already? if soo look for an Assets bit
[02:57] jashkenas: rex_fernando: package your assets.
[03:00] rex_fernando: I just meant it as a general question; I'm not working on a project right now.
[03:01] reid has joined the channel
[03:01] charlenopires has joined the channel
[03:02] rex_fernando: I actually haven't done much client-side javascript at all, but node.js has modules, and I'm pretty sure browsers don't, right?
[03:03] bradleymeck: nope
[03:03] bradleymeck: no modules
[03:04] rex_fernando: yeah, so how do people deal with that? I'm assuming they don't just put everything in a single file, under the global namespace
[03:07] bradleymeck: globals
[03:08] bradleymeck: lots of files, make a variable to namespace your stuff on window, and pray
[03:08] rex_fernando: lol really?
[03:09] rex_fernando: that sounds not so fun
[03:09] yhahn has joined the channel
[03:09] bradleymeck: that sounds like w3c quality
[03:10] rex_fernando: are they working on something to fix this?
[03:10] bradleymeck: nope
[03:10] bradleymeck: use a library though
[03:10] bradleymeck: there are tons of ways to fix it through libraries if done right
[03:11] rex_fernando: how do they get around the problem?
[03:11] eisd has joined the channel
[03:12] bradleymeck: they manage the loading for you or they set up arbitrary rules
[03:12] rex_fernando: could you point me to some?
[03:13] bradleymeck: jquery, dojo, sencha/extjs, requirejs (for loading only), labjs (never used), mootools (pls no)
[03:15] rex_fernando: jquery does dependency management?
[03:15] dilvie has joined the channel
[03:15] bradleymeck: it has things in there for it, i know it does through plugins, but the plugin system by itself is a sort of module system
[03:16] noahcampbell has joined the channel
[03:19] twoism has joined the channel
[03:20] ngw has joined the channel
[03:21] rex_fernando: ok
[03:21] rex_fernando: do you like any of them in particular?
[03:22] bradleymeck: i like jquery for dom manipulation, dojo for ui creation, sencha is the only real mobile one right now, and i mostly use custom stuff for data/etc
[03:22] bradleymeck: and i know that doesnt help :)
[03:22] rex_fernando: lol
[03:23] mjr_ has joined the channel
[03:23] JimBastard_ has joined the channel
[03:23] bradleymeck: if you are targetting ie6 use jquery though
[03:24] rex_fernando: I'm definitely not targeting ie6 :)
[03:24] huyhong has left the channel
[03:25] rex_fernando: well, thanks
[03:25] rex_fernando: I guess I'll look at those libraries
[03:26] JimBastard_: ieeeeeeeeee
[03:27] cataska has joined the channel
[03:28] bradleymeck: ie6 the creepy uncle that gets all the kiddie programmers
[03:28] bradleymeck: i love job apps, 8 years web2.0 experience
[03:28] guybrush: rex_fernando: http://github.com/mape/connect-assetmanager is kinda nice (didnt use it myself yet)
[03:28] bbarrows: Hey, so I have a question about javascript closures and node if anyone is interested.. So I am looping through a list of site objects. These site objects have the url of the site I want to GET and a string that I want to search for in the response. So I am using http.createClient. I then create a request with request = httpClient.request. So i setup my first listener on the request for 'response' which will call my callback an
[03:28] bbarrows: d provide me with a response object. I then setup a another listener on this response object to catch the data as it comes in.
[03:29] bradleymeck: bbarrows tldr; gist
[03:29] bbarrows: oops
[03:29] bbarrows: sorry
[03:29] bradleymeck: pastes help us know since words are pretty bad at explaining code
[03:29] rex_fernando: bradleymeck: lol nice analogy
[03:32] Arro has joined the channel
[03:36] bbarrows: git://gist.github.com/616320.git
[03:38] adinardi has joined the channel
[03:38] mqt has joined the channel
[03:38] jjcm has joined the channel
[03:39] BHSPitCSP has joined the channel
[03:39] bbarrows: Basically I have this loop where I create callbacks for a http response but in these callbacks I want to parse the data they receive using variables I have access to in the loop
[03:40] bbarrows: So I need to do something with closures to make these available for the callback right?
[03:42] badaxx has joined the channel
[03:42] pufuwozu has joined the channel
[03:48] jagautier: anyone used socket.io with the android webkit on the HTC inredible?
[03:48] tav has joined the channel
[03:48] dmcquay has joined the channel
[03:48] AAA_awright: Anyone know of an auto-restart program that actually works well?
[03:48] jagautier: a connection isnt made and i get this in the node log
[03:49] jagautier: Couldnt find client with session id "vendor"
[03:50] dmcquay: AAA_awright - what have you tried?
[03:51] bradleymeck: bbarrows give us a pste of what you have
[03:51] AAA_awright: dmcquay: A few various hacks of scripts, idk
[03:51] jagautier: nbody has used socket io with android?
[03:51] themiddleman has joined the channel
[03:51] bradleymeck: apparently not
[03:51] AAA_awright: Is there something that worked for you?
[03:52] bradleymeck: monit if you actually spend time to set up the beast
[03:52] dmcquay: AAA_awright spark
[03:52] dmcquay: and upstart
[03:52] dmcquay: well, upstart is really doing the magic
[03:53] bbarrows: bradleymeck: not a gist? sorry, what site do u prefer?
[03:53] dmcquay: and monit in addition if you want
[03:53] dmcquay: AAA_awright - there is a good article on howtonode.org
[03:53] dmcquay: i'll look it up for you
[03:53] admc__ has joined the channel
[03:53] admc_ has joined the channel
[03:53] admc has joined the channel
[03:53] bradleymeck: bbarrows sorry seems the gist scrolled out of view
[03:54] dmcquay: AAA_awright - http://howtonode.org/deploying-node-with-spark
[03:54] bradleymeck: sec
[03:54] bbarrows: ok, thank you
[03:55] davidascher: hmm, i think the node event loop is confusing me. in http://gist.github.com/616330 why is i = 2 in both calls to zadd?
[03:55] JimBastard_: AAA_awright: that fugue thing
[03:55] JimBastard_: AAA_awright: use that
[03:55] JimBastard_: http://github.com/pgte/fugue
[03:56] cloudhead has joined the channel
[03:57] BHSPitMonkey has joined the channel
[03:57] BHSPitMonkey: rauchg_: any news with the firefox socket.io issues people have reported?
[03:57] bbarrows: bradleymeck: what I would like to do is one line 54 do something like "data.substr(data.indexOf(results[i].start), data.indexOf(results[i].end)))"
[03:57] rauchg_: BHSPitMonkey: im gonna look into it asap
[03:58] rauchg_: haven't had a chance yet
[03:58] rauchg_: but it shoudl be something simple
[03:58] dmcquay: davidascher - looking
[03:58] jpld has joined the channel
[03:58] jpld has joined the channel
[03:59] bradleymeck: bbarrows why cant you do that?
[03:59] bradleymeck: i mean results is visible from nested functions
[03:59] bradleymeck: unless you override it
[03:59] bpot has joined the channel
[03:59] bradleymeck: davidascher closures
[04:00] bbarrows: ya
[04:00] bbarrows: so I realize that but I was wondering the ebst way to create
[04:00] dmcquay: davidascher - the for loop executes all times
[04:00] bradleymeck: davidascher > http://nodejsbot.blogspot.com/2010/09/javascript-primer.html (look into the closures section)
[04:00] dmcquay: before the callbacks are executed
[04:00] bbarrows: ok
[04:00] davidascher: k, thx
[04:01] bbarrows: so i guess whats confusing me is that I have two nested callbacks
[04:01] bradleymeck: which is fine
[04:02] bbarrows: so if i create a closure around a function which has a callback inside
[04:02] bbarrows: the inner callback will be able to access the closures variables?
[04:02] bbarrows: I guess I should jsut keep messing with it
[04:02] bradleymeck: yes you can access external variables from inside of functions for all parent scopes until it is resolved
[04:03] bbarrows: ok, thank so much!
[04:03] twoism has joined the channel
[04:04] bbarrows: that page looks really helpful too...
[04:04] AAA_awright: dmcquay JimBastard_: Something that restarts the program when a file is modified?
[04:04] JimBastard_: something seems very wrong with this line
[04:04] JimBastard_: ['img', { "src": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV4AAABCCAMAAAAolk58AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAGBQTFRFxcXFubm5hISEIFtlOjs8lpaWp6endnZ2ZWVlVVVV6urqDg4ORUZGAdz/4+Pj0dHR+vr68vLy2traEo+kICAgDa3KAeP/C8bnGHODMCwrCzxEANj/////MzMzAAAA/v7+9uCH4AAAACB0Uk5T/////////////////////////////////////////wBcXBvtAAALdUlEQVR42txc6XqzKhAGyqpE0di0tjG5/7s8GpM44IAkX5fzdH6ayQAvs6OQ83PUUqG
[04:04] JimBastard_: loool
[04:04] JimBastard_: JUP + base64 encoded images
[04:04] JimBastard_: amazing
[04:04] dmcquay: AAA_awright - sorry, i thought you were talking about restarting in the case that a fatal error occurs
[04:04] AAA_awright: Well that too
[04:05] AAA_awright: Or rather, waiting until the problem is fixed or something
[04:05] Tim_Smart: AAA_awright: fs.watchFile ;)
[04:05] fizx has joined the channel
[04:05] Tim_Smart: Then just manually rebuild the module.
[04:05] AAA_awright: Is there some implementation of that? I can't seem to get this quite right
[04:07] overra has joined the channel
[04:07] JimBastard_: AAA_awright: whats so bad about having to restart the app?
[04:08] AAA_awright: It takes five whole seconds
[04:08] JimBastard_: to do what?
[04:08] AAA_awright: Press Ctrl+C and start it again from the bash history... :p
[04:08] JimBastard_: yeah, i dunno. sometimes people try to optimize the wrong things
[04:09] AAA_awright: Well, uh, the repetition! Keeping the same thought process is important!
[04:09] JimBastard_: how many lines of code do you need to write?
[04:09] bradleymeck: i need to optimize my client side code so that my server has less load is always a good one
[04:10] JimBastard_: i can type about 100 words per minute. so if you need a 1000 line app you can write it in 10 minutes and only have to start node once
[04:10] JimBastard_: problem solved
[04:10] AAA_awright: Of course, that just solved all my problems, that's fantastic
[04:10] AAA_awright: :p
[04:11] Tim_Smart: It won't work as expected is one of the terms.
[04:11] benreesman_ has joined the channel
[04:12] JimBastard_: AAA_awright: if you are doing test driven then you wont have to do that
[04:12] JimBastard_: you just run the tests
[04:12] digitaltoad has joined the channel
[04:12] JimBastard_: then when all your tests pass, the shit actually works
[04:12] JimBastard_: i swear, i tried it
[04:12] JimBastard_: it was crazy
[04:12] AAA_awright: I'm developing new features
[04:12] AAA_awright: And I do I have a number of Vows tests
[04:13] JimBastard_: got ya
[04:13] Tim_Smart: I write tests usually before I write the feature.
[04:14] bradleymeck: i can type a mighty 30 words a minute
[04:14] bradleymeck: so obv jim is 3.3 times the coder i am
[04:15] chapel: tmpvar << you there?
[04:15] JimBastard_: bradleymeck: the brown fox jumps over the red dog
[04:15] Tim_Smart: tmpvar inherits from you there?
[04:15] chapel: lol
[04:15] chapel: sorry I use << for auto complete
[04:16] lianj: bradleymeck: maybe you do faster brackets ;)
[04:16] JimBastard_: i can push like 130, but accuracy starts to fail hard
[04:16] Tim_Smart: chapel: Yeah I was just playin, yo.
[04:16] JimBastard_: even 100 is strained
[04:16] chapel: well if he isn't here, wonder if anyone can help me
[04:16] chapel: I am using jsdom and jquery
[04:16] chapel: now I have a valid selector, that isn't firing
[04:16] JimBastard_: chapel: you sure?
[04:16] chapel: Ive tested it outside of the script, and it works as expected
[04:16] Tim_Smart: JimBastard_: Does vim hackery count?
[04:17] JimBastard_: Tim_Smart: always
[04:17] chapel: yes I am sure JimBastard
[04:17] JimBastard_: whats the code look like
[04:17] Tim_Smart: JimBastard_: I are copy-pasting my way to victory then.
[04:17] JimBastard_: maybe increase the font size a few and change bg color to black
[04:17] chapel: .current_selected_player_row td[id$=arenaRating]
[04:17] chapel: thats the selector
[04:17] JimBastard_: ohh hrmm
[04:17] chapel: when I slap that in stylebot, it works as expected
[04:17] JimBastard_: whats id$ do again
[04:18] chapel: id ends with
[04:18] JimBastard_: what happens if you drill up a level?
[04:18] JimBastard_: can you make the selector less specific until it finds a node?
[04:18] chapel: the class is a tr above the td
[04:18] JimBastard_: so we can see where it breaks
[04:18] chapel: well the td[id and so on works by itself
[04:19] JimBastard_: is it the $ ?
[04:19] chapel: could it be the .each command?
[04:19] chapel: uhhh, let me rephrase
[04:19] aurynn has joined the channel
[04:19] chapel: exports.jqwindow(agent, 'td[id$=arenaRating]', '.current_selected_player_row td[id$=arenaRating]', ratingValue);
[04:19] chapel: that is the line of code I am using, the first selector, works fine in node.js
[04:19] chapel: the second isn't firing
[04:20] JimBastard_: im sorry man, im pretty ripped and you are kinda all over the place. can you put this all together into a gist or something. i gotta get a snack
[04:20] chapel: I do wonder if its a jquery issue though
[04:20] JimBastard_: lol
[04:21] tmpvar: chapel, yo
[04:21] JimBastard_: ACTION tags in tmpvar
[04:21] chapel: hey tmm1
[04:21] chapel: bah
[04:21] chapel: tmpvar
[04:21] JimBastard_: autodefeat
[04:21] chapel: so with that above line
[04:22] chapel: the first selector is working
[04:22] chapel: but the second is not
[04:22] chapel: mind you I am using jquery's .each
[04:22] chapel: fast paste for you http://gist.github.com/616353
[04:22] tmpvar: chapel, you read my mind ;)
[04:23] chapel: figured context was important
[04:23] tmpvar: still ne a bit more, how are you using these two methods?
[04:23] chapel: I tried making the second window.JQuery with (userSel) at line 9 just assign to a variable using .text()
[04:23] tmpvar: s/ne/need
[04:24] chapel: what you see is exactly how I am using them atm
[04:24] tmpvar: oh, hah. i see exports i assume there is another file involved.. sec
[04:24] chapel: no, dont really need exports
[04:25] chapel: I followed someone elses code at first
[04:25] chapel: before I knew what exports was
[04:25] chapel: anyways
[04:25] tmpvar: fair enough
[04:26] bbarrows: bradleymeck: is the only way to create a context for my closure that contains the values I want to pass them into a function as an argument that returns an anonymous function?
[04:27] chapel: so the issue I am having tmpvar is that the second selector isn't firing
[04:27] bbarrows: bradleymeck: for example: function makeClos(setI) { return function() { console.log(setI); } }
[04:27] EyePulp has joined the channel
[04:27] tmpvar: chapel, so userRatings is empty?
[04:27] chapel: I cant place if its .each from jquery
[04:27] chapel: yes, it returns undefined
[04:27] tmpvar: easy test for that is on line 9
[04:27] jamescarr has joined the channel
[04:27] bbarrows: bradleymeck: this just seems like such a hassle, sorry to bug u about javascript basics in the node room btw
[04:28] tmpvar: console.log(window.jQuery(userSel).length)
[04:28] tmpvar: if 0 then there is a good chance that selector doesnt match anything
[04:28] jamescarr: does this look silly: http://gist.github.com/616357
[04:28] chapel: 0
[04:28] jamescarr: the idea is that normally people will have loaded the first two objects from antother web service call
[04:28] chapel: but, thats the thing
[04:29] bradleymeck: bbarrows it is only odd when looping and making functions per loop iteration, and even then it makes sense, the variables arent read only and the functions arent executed synchronously so you have to save them some how
[04:29] tmpvar: chapel,
[04:29] chapel: the same selector works elsewhere
[04:29] chapel: and in code, it should work
[04:29] tmpvar: oh, it does?
[04:29] bradleymeck: but yes, wrap em in a function if you have to, Array.prototype.forEach will help for those cases
[04:29] tmpvar: elsewhere being the browser, right?
[04:29] bbarrows: bradleymeck: cool, thank u! that was the last question I promise
[04:29] chapel: yes browser, I use stylebot (chrome plugin) to test
[04:30] chapel: since I can add css on the fly
[04:30] tmpvar: chapel, i think this is because we are missing a compareDocumentPosition call
[04:30] tmpvar: :/
[04:30] tmpvar: yeah, thats probably it.. meh
[04:30] chapel: the class is in a tr, which is above the td
[04:30] chapel: so I know my selector code is right
[04:30] tmpvar: right, compareDocumentPosition isnt implemented yet
[04:30] tmpvar: its a stub :(
[04:31] chapel: hmm, not sure what that is tbh
[04:31] tmpvar: heh
[04:31] tmpvar: well the method exists, but it doesnt do anything, yet.
[04:31] tmpvar: its a fun method. ill tell you that much
[04:31] tmpvar: so there is a workaround
[04:31] chapel: well why do we need compareDocumentPosition?
[04:31] bradleymeck: i have an impl lying about, but the thing is slow as hell
[04:32] tmpvar: for compare?
[04:32] bradleymeck: yea
[04:32] tmpvar: where? :P
[04:32] bradleymeck: give me a min, havent dug around my DOM stuff in a bit
[04:32] tmpvar: (hook it up!)
[04:32] tmpvar: k
[04:32] tmpvar: slow is better than misleading at this point, heh
[04:32] chapel: mind explaining a bit more why it isn't working
[04:32] chapel: I am new
[04:33] tmpvar: jQuery uses compareDocumentPosition internally
[04:33] tmpvar: it makes things like
[04:33] chapel: oh, and since you are replicating a browser
[04:33] tmpvar: ".selector #selector"
[04:33] tmpvar: right
[04:33] chapel: ah
[04:33] chapel: okay
[04:33] chapel: if I could do a simpler selector I would
[04:33] tmpvar: right, or pass a context in
[04:33] tmpvar: that's the workaround
[04:33] chapel: hmm
[04:34] tmpvar: (context is the second arg
[04:34] bradleymeck: tmpvar its in Witch's DOM give me a min to port
[04:34] tmpvar: bradleymeck, much appreciated
[04:35] jagautier has left the channel
[04:35] huyhong has joined the channel
[04:35] jagautier has joined the channel
[04:35] chapel: the other way I was handling it, was to get all the players names, and then join the two arrays, then search the array for the position of the players name
[04:35] chapel: but bah, I was getting into some major efficiency and overcoding problems
[04:35] chapel: when the simple thing was, to get the selected players rating
[04:35] chapel: which hangs on that one bit of code
[04:36] tmpvar: yeah
[04:36] jagautier: hey i just forked socket.io and cloned the repository but it didnt pull in the socket.IO-client files
[04:36] jagautier: any ideas?
[04:36] chapel: so all the time, I thought two jquery calls weren't working, it was just not liking my selector :)
[04:36] xak466 has joined the channel
[04:36] xak466 has left the channel
[04:36] chapel: appreciate the help tmpvar
[04:37] tmpvar: chapel, yeah, sorry I couldn't help you earlier :/
[04:37] huyhong has left the channel
[04:37] chapel: I had a friend go over my code, and he rewrote a ton of it to who me scope, once I figured out what I was missing, I added like 4 lines of code to mine and it worked as expected :P
[04:37] tmpvar: wasn't sure what you were trying to do heh
[04:37] chapel: np
[04:37] chapel: at the time, I was dealing with a few issues
[04:37] tmpvar: yeah
[04:37] chapel: I didn't understand callbacks
[04:37] chapel: no where near an expert atm, but I think I get them
[04:37] Yuffster_work has joined the channel
[04:38] tmpvar: so i have a partial fix for the compareDocumentPosition issue somewhere
[04:38] chapel: lol hola Yuffster
[04:38] chapel: Yuffster_work
[04:38] tmpvar: but there are tons of cases and I never got it quite done enough to push
[04:38] chapel: Im just glad Im one step closer
[04:39] tmpvar: yeah, with a bit of refactoring you could work around that issue.. but in all reality it shouldn't be an issue in the first place
[04:39] chapel: one thing Im curious, why can't I take the window.jquery and select something, then whatever I assign the value to, why cant I then run another jquery on that?
[04:40] Tim_Smart: jquery returns itself, so you can: var result = jQuery('a'); result.css(...);
[04:40] chapel: I think I get that because you are running a simulated browser, window = browser window and if you pull out some value from it, it just becomes regular data
[04:40] chapel: hmm
[04:41] tmpvar: chapel, it should work.. let me make sure im speaking the truth
[04:41] bradleymeck: tmpvar, i think http://gist.github.com/616369 is all i needed for porting
[04:41] chapel: well since you are running jquery as an embedded script, and not exactly apart of node or the module, without the window browser simulation, jquery doesn't exist
[04:42] quirkey has joined the channel
[04:44] AAA_awright: I should probably know this, is there any way to use a Goto?
[04:45] bradleymeck: only to top or bottom of a switch or loop
[04:45] AAA_awright: I'm trying to break out of a for loop a statement or two after the close
[04:45] BHSPitMonkey: you should probably know that we stopped using those after QBASIC :P
[04:45] bradleymeck: i never did
[04:45] AAA_awright: Except that GOTO is a legitimately useful statement
[04:45] bradleymeck: i enjoyed the insanity
[04:45] BHSPitMonkey: I refuse to believe.
[04:45] bradleymeck: goto is useful as long as it doesnt jump out of a function
[04:46] bradleymeck: basically, as long as the stack is safe
[04:46] BHSPitMonkey: I've never encountered a situation where it would be necessary
[04:46] AAA_awright: For breaking out of things, yes. And possibly also breaking into things, so something is only evaluated every time but the first time
[04:46] bradleymeck: goto put a label before your loop and you can break/continue on that label
[04:46] AAA_awright: s/breaking/skipping/
[04:46] tmpvar: chapel, i think the confusion here is that the second query does work, but your query is relying on compareDocumentPosition
[04:47] chapel: yeah, now that I know its not my selector
[04:47] bradleymeck: tmpvar i tested that thing pretty hard so it should pass, idk jsdom's internals though if i need to do something else
[04:47] chapel: its just not able to process it
[04:47] tmpvar: looks right
[04:48] AAA_awright: How much more efficent would it be to have for(var i=0 && goto start; i < 5; i++) { out(", "); label start; out(i);} out(";");
[04:49] tmpvar: goto's are generally bad
[04:49] AAA_awright: That's what people said about Javascript
[04:49] dilvie: Do you guys just do includes for common headers / footers in your Node apps?
[04:50] Tim_Smart: headers and footers?
[04:50] bradleymeck: AAA_awright it would be slightly more performant but goto isnt an expression so wouldnt work
[04:51] AAA_awright: bradleymeck: For a programming language in general, though
[04:51] dilvie: I'm currently stalled -- teetering between three possibilities: includes, developing a full blown content manager with a node module plugin system, or doing strictly web service API's for my dynamic content, and relying on AJAX (the least likely alternative)
[04:51] AAA_awright: Alright then, is it possible to define an arbritary block, and break out of just that block? From what I remember in the spec, no
[04:51] tmpvar: bah, its late.
[04:51] AAA_awright: tmpvar: Nonsense the fun is just getting started
[04:51] bradleymeck: yes its a hack but i forget how something fed up like while(false) {} ?
[04:51] dilvie: AAA_awright: is brave enough to do content management.. maybe I should bite the bullet and do that, too.
[04:51] AAA_awright: bradleymeck: Haha you know that works
[04:52] tmpvar: thanks for the impl bradleymeck, ill probably apply it to browser/index.js unless you want to push a patch my way ;)
[04:52] bradleymeck: nope
[04:52] AAA_awright: I'll try that
[04:52] tmpvar: i need to pass out
[04:52] tmpvar: haha, love it
[04:53] AAA_awright: Actually for this case, nvm, I realized I'm inside a function I can just return from
[04:53] dilvie: AAA_awright: Any tips for developing a CMS on node? =)
[04:53] AAA_awright: >_<
[04:53] tmpvar: chapel, I'll try and get that in tomorrow and push a new version to npm
[04:53] AAA_awright: dilvie: It has better be kick-ass
[04:53] tmpvar: until then, g'night
[04:53] chapel: okay, thanks
[04:53] bradleymeck: dilvie i would suggest a web service api
[04:53] AAA_awright: uh
[04:53] chapel: :( sad though I wanted to make progress tonight
[04:53] bradleymeck: dilvie first get a db chosen
[04:53] chapel: guess I can use a dummy var until then
[04:54] JimBastard_: what turned out to be the issue
[04:54] bradleymeck: compareDocumentPosition isnt implemented, i there up a gist with Witch's impl
[04:54] bradleymeck: tmpvar is going to merge it in tomorrow
[04:54] JimBastard_: i figured it might be that
[04:54] AAA_awright: dilvie: So what I'm trying to do is keep highly modularized, use lots of events and make everything, the router, HTTP server, template mechanism, everything a plug-in to other modules, I have about a dozen 100 line files right now
[04:54] JimBastard_: yeah, he has a large merge queue
[04:54] JimBastard_: we found another bug too
[04:54] dilvie: bradleymeck: Well yeah. I'm definitely doing that either way, but I'm not likely to use a CMS like WordPress and rely on JavaScript.. if I do a Node based SSI-style or full blown CMS, I can do that AND have total no-JS server-side fallback
[04:54] JimBastard_: i should remind him
[04:55] dilvie: graceful degradation of the UX
[04:55] JimBastard_: chapel: ill make sure we get that patched over the weekend
[04:55] dilvie: bradleymeck: Going with CouchDB
[04:55] AAA_awright: Mozilla Bespin Embedded (more recently renamed to Skywriter) makes a nice code editor
[04:55] chapel: :)
[04:55] chapel: I am just glad I am further than I was
[04:56] dilvie: AAA_awright: Are you going open-source?
[04:56] chapel: question, lets say I have an irc bot, I want to be able to edit its command list on the fly, is there a way to do that without restarting it?
[04:56] dilvie: AAA_awright: like, can I build on modules?
[04:56] AAA_awright: dilvie: I'm trying to keep public domain
[04:56] AAA_awright: actually, dual licensed public domain + AGPL
[04:56] AAA_awright: Just to make RMS scream
[04:56] bradleymeck: chapel sure, just hold the commands in an object as properties
[04:57] dilvie: What's AGPL?
[04:57] dilvie: AAA_awright: I've been releasing under MIT. Is that compatible?
[04:57] AAA_awright: Should be...
[04:57] bradleymeck: dilvie then my suggestions come in 3 lessons. 1. Fonts are a killer thing to include in a CMS. 2. Rich Text Editors should not be enforces 3. Provide some sort of http API
[04:58] AAA_awright: dilvie: A version of the GPL that requires any changes you make be published, even if you aren't redistributing the source. While I like the idea, I contend that isn't lawful, hence the option to go public domain too :)
[04:58] dilvie: AAA_awright: I've got an HTML5 validator module.. will validate AJAX / Get / Post form submission against an HTML5 file with validation rules using the new HTML5 required / pattern / input types.
[04:58] chapel: hmm, hmm
[04:58] chapel: well I am basing the bot on protobot JimBastard
[04:58] deoxxa: AAA_awright: public domain isn't really public domain, you should consider something explicit such as the WTFPL or some such thing
[04:59] chapel: it has some simple commands in an object
[04:59] deoxxa: different countries have different laws governing public domain
[04:59] chapel: but there are more complex ones
[04:59] JimBastard_: chapel: you can do anything with eval and toString
[04:59] AAA_awright: deoxxa: "Or a legal equivelant"
[04:59] JimBastard_: or a database
[04:59] chapel: I could, I am just wondering whats the easiest way to abstract it
[04:59] JimBastard_: couchdb
[05:00] chapel: you mean for the bot?
[05:00] dilvie: My client is expecting a semi-functional app in a couple weeks, so I'm almost certainly starting out with includes, but I want to progressively add a lot better functionality.
[05:00] JimBastard_: for the triggers
[05:00] JimBastard_: the command list
[05:00] deoxxa: AAA_awright: hmm you can't count on all countries having laws that suit what you want
[05:00] deoxxa: or more specifically, what your users want
[05:00] chapel: hmm, couldn't I just make it a module or something
[05:00] deoxxa: germany is a good example
[05:00] nroot7 has joined the channel
[05:00] dilvie: AAA_awright: Unless your system is sufficient right now to be used.... is it ready to roll out a beta website on?
[05:00] chapel: if I required it as a module, if I changed anything in the module, would it update automatically?
[05:00] bradleymeck: chapel sure but then if the bot goes down and the stuff is stored in memory only...
[05:00] JimBastard_: you can do anything, you are asking a super open-ended question
[05:00] dilvie: AAA_awright: got a github?
[05:00] bradleymeck: chapel no
[05:01] bradleymeck: no hot reloads in node
[05:01] AAA_awright: I have something that serves content right now, you can't edit and some pages can crash it
[05:01] hassox has joined the channel
[05:01] dilvie: git repo I can check out?
[05:01] AAA_awright: dilvie: http://git.bzfx.net/~aaa/metawiki.git/
[05:01] davidascher has joined the channel
[05:01] chapel: hmm
[05:01] AAA_awright: It's ugly and security-hole ridden too, though I have everything I know of marked with FIXME
[05:01] dilvie: Will check it out right now..
[05:02] chapel: so the only way to handle modifying commands is to store them as an object or in an object
[05:02] bradleymeck: does github do http proxied git?
[05:02] Me1000 has joined the channel
[05:02] chapel: or just not worry about it
[05:02] AAA_awright: It might want a library or two I don't have checked in...
[05:02] chapel: and reload the code as needed
[05:02] chapel: is there a way to reload the script after ending it?
[05:02] bradleymeck: chapel you would have to use a module that allows reloading modules or restart node
[05:03] AAA_awright: bradleymeck: An HTTP clone URL? click "HTTP" by clone URL... actually I think that's the default now
[05:03] dilvie: AAA_awright: this.version = '0.0.0dev-very-alpha';
[05:03] dilvie: hahaha
[05:03] bradleymeck: nah, im talking pushes
[05:03] dilvie: AAA_awright: Are you using semantic versioning?
[05:03] AAA_awright: dilvie: That's the only proper way :D
[05:04] AAA_awright: hmm yeah so dev-very-alpha would be a higher version than 0.0.0-alpha but I don't anticipate such a revision
[05:04] AAA_awright: 0.0.1 would be -alpha
[05:05] chapel: what about this bradleymeck http://blog.romeda.org/2010/01/hot-code-loading-in-nodejs.html ?
[05:05] Duncan has joined the channel
[05:06] dilvie: AAA_awright: I always start at 0.1.0 and update the middle bit every time I add new features, and the minor version every time there's a bug fix. =)
[05:07] bradleymeck: chapel thats from january look into nodules or something idk, i dont do hot reloads
[05:07] dilvie: well, not every single bug and every single feature.... but I commit often. =)
[05:07] chapel: well its for a simple irc bot
[05:07] jagautier: so i got socket.IO working on android webkit but its using flashsocket? android webkit doesnt have websockets?
[05:07] chapel: nothing special
[05:07] chapel: id just like to be able to work on it without having to shut it down
[05:07] chapel: since it takes upwards of 40 seconds to get on irc
[05:07] JimBastard_: repl?
[05:07] holydevil has joined the channel
[05:08] AAA_awright: For 0.x I would just worry about API breakage (increment to 0.(x+1) since you don't need to increment 0 when it's 0)
[05:09] bradleymeck: chapel 40 seconds!?
[05:09] chapel: yeah, maybe less, but at least 20 seconds
[05:10] gerred has joined the channel
[05:10] chapel: not a big deal
[05:10] bradleymeck: http://github.com/kriszyp/nodules
[05:10] dilvie: AAA_awright: hmm.. I thought 1.0.0 is supposed to indicate API stability, not the minor version number. Minor version number is supposed to increment when you add new features to the API, right?
[05:11] chapel: yeah reading about them now
[05:11] chapel: err it
[05:11] chapel: not sure how to refer to it
[05:11] dilvie: and the last number is for bug fixes.
[05:11] Tim_Smart: I'm thinking the best way to hot-reload, is to spawn a new worker child, share the socket fd for a moment, then mark the old one for deletion (so it can handle previous requests)
[05:11] AAA_awright: Let's check http://semver.org/
[05:11] chapel: hmm, sounds good Tim_Smart
[05:12] chapel: though I am sure its out of my knowledge atm
[05:12] AAA_awright: Yeah, major is for reverse-compatability breakage, minor is for features, release is for bugfixes (and not incrementing major if you break reverse compatability is a bug)
[05:12] dilvie: Consider a version format of X.Y.Z (Major.Minor.Patch). Bug fixes not affecting the API increment the patch version, backwards compatible API additions/changes increment the minor version, and backwards incompatible API changes increment the major version.
[05:12] Tim_Smart: Hmm, actually I'm not entirely sure there is a way to stop listening for connections and serve previous ones at the same time.
[05:12] chapel: yeah
[05:13] chapel: welp thanks again for everything guys
[05:13] chapel: gotta goto work, bbiab
[05:13] dilvie: AAA_awright: You increment to 1.0.0 when your API stabalizes, and you're not expecting to make a lot of backward-breaking changes.
[05:13] AAA_awright: Right
[05:13] BHSPitMonkey has joined the channel
[05:13] JimBastard_: is there a lic field specified in the package.json format?
[05:13] JimBastard_: uhh, on second thought where is the spec for that
[05:14] JimBastard_: http://github.com/isaacs/npm/blob/master/doc/json.md
[05:14] AAA_awright: dilvie: Among the other features I'm looking at, using bloom filters to determine which databases to hit, using sendfile() to send pre-rendered templates, and an internal DOM to pre-render Javascript widgets for the client or clients without JS
[05:15] dilvie: AAA_awright: Any 0.x.x version means that you're expecting to break backwards compatability
[05:15] _sri has joined the channel
[05:15] dilvie: AAA_awright: LOVE the pre-rendered templates bit.
[05:15] AAA_awright: Node is as fast as an aggressively cached Drupal install and 5ms response vs 40ms
[05:15] dilvie: AAA_awright: I'd love to be serving static HTML when it's available.
[05:16] Tim_Smart: AAA_awright: sendfile <3 I use it here and there with node.
[05:16] AAA_awright: Oh, and Less CSS
[05:16] dilvie: what are bloom filters?
[05:17] dilvie: AAA_awright: Also thrilled about the internal DOM. You using jsDOM?
[05:17] AAA_awright: I plan to, not yet
[05:17] Tim_Smart: I wouldn't use it for high traffic area... DOM isn't known for being fast.
[05:17] Tim_Smart: areas*
[05:17] AAA_awright: dilvie: It's a probabalistic algroithm which can tell you with a very good certainty if an object is a member of a set, with very little memory. For instance, "Is '/this/url' handled by the database?"
[05:17] dilvie: AAA_awright: is the template engine bit modular? Can I selectively use Mustache or EJS?
[05:18] AAA_awright: dilvie: Yes, right now I have Jade and I'm writing another one now that formats a database row somewhat intelligently
[05:18] AAA_awright: Jade should convert nicely to a DOM structure too
[05:18] dilvie: Tim_Smart: I don't think he means to use DOM methods to build every page.. =)
[05:19] AAA_awright: Yeah, I can only imagine the DOM building parts of the page
[05:19] AAA_awright: Like a sortable data table
[05:20] bradleymeck: templates will be faster than dom by a landslide generally
[05:20] AAA_awright: I've done some really basic benchmarking, this is true
[05:20] dilvie: AAA_awright: yeah, I was thinking of doing something similar to access web services AJAX style on the server side, i.e., for fallback from no JS clients...
[05:20] bradleymeck: no js clients are pretty rare outside of gov
[05:20] xdamman has joined the channel
[05:20] AAA_awright: dilvie: Oh, shared code editor. Edit the website template in the CMS, and see any changes other people make while they edit if you like. Skywriter was built for doing just that
[05:20] Me1000 has joined the channel
[05:21] dilvie: bradleymeck: Up to 10% in some verticals. That's common enough to be concerned about it for things like ecommerce. =)
[05:22] dilvie: AAA_awright: with versioning?
[05:22] AAA_awright: Also, email server. No reason you can't have an email listener in addition to the HTTP listener and have a webmail frontend and an IMAP frontend to a mailing list with the same CMS.
[05:22] AAA_awright: dilvie: Of course
[05:22] bradleymeck: dilvie i just quit a company targetting 40+ year olds (lots of ie6) and very few had js off, however, in europe its a different story
[05:22] AAA_awright: Git, of course... how it is stored exactly I have to think out
[05:22] TheEmpath has joined the channel
[05:23] dilvie: bradleymeck: In high-security environments, no JS is very common, and script blockers like NoScript are also employed.
[05:24] bradleymeck: true, but then again on most of those sites i wouldn't be using highly interactive things that would require dom
[05:24] dilvie: AAA_awright: I was wondering how you could do versioning with GIT in a content management system.
[05:25] stride: heh, yeah, high security.. but they'd never miss their adobe plugin for those nice little PDF charts
[05:25] AAA_awright: dilvie: For a while I was building a CMS out of cgit, which would take content from a Git repository and format it with XSLT. cgit already has a caching mechanism so peformance isn't a big problem...
[05:25] AAA_awright: cgit is the Git web frontend written in C... a Git CGI written in C (a threefold pun, har har har)
[05:27] jagautier: do flash sockets usually perform a lot worse then websockets?
[05:29] dilvie: stride: Actually, I did web consulting for a company that did endpoint security. They got really low-level implementing security policies at OS-service blocking levels... so while you might be able to open a PDF chart, it might do it only in a sandbox.
[05:29] dilvie: I've never checkout out cgit
[05:30] bradleymeck: jagautier a little, they dont do near as well without a policy file
[05:30] bradleymeck: 3s startup time without one :(
[05:32] jagautier: using socket.IO
[05:32] jagautier: im building a multiplayer pong
[05:32] jagautier: runs fine with two chrome windows
[05:33] jagautier: sucks real bad on the android phone though
[05:33] dilvie: woo, this is quite a short circuit
[05:33] dilvie: return JSON.parse(fs.readFileSync(file || configFile || process.env['METAWIKI_CONFIG'] || 'config.json'))
[05:33] dilvie: what's the difference between configFile and config.json?
[05:34] ajpiano has joined the channel
[05:35] dilvie: yes, I read source code for entertainment. I'm laughing at your coding style. (I'm kidding. It's fine. ;)
[05:38] dilvie: AAA_awright: I like that you're emitting a lot of events.
[05:39] AAA_awright: dilvie: The last one is the static file in the current working directory
[05:39] AAA_awright: Dunno if it's a good idea to have there but whatever
[05:41] dilvie: AAA_awright: I don't see why it wouldn't be.
[05:41] dilvie: AAA_awright: As long as the server security is set up properly.
[05:41] dilvie: =)
[05:42] AAA_awright: Yeah you're right, if you want to go without a config file explicitly specify a blank one
[05:42] AAA_awright: It shouldn't cause /problems/
[05:42] unomi has joined the channel
[05:42] AAA_awright: Not that you would want to go without a config file
[05:43] dilvie: I haven't actually looked at the config file yet
[05:43] AAA_awright: It's rather boring the one I have currently is more exciting
[05:43] dilvie: how friendly! console.log("All loaded!\n");
[05:43] quirkey has joined the channel
[05:44] dilvie: AAA_awright: Is it in a state you could do a push so I can see what you've got going currently?
[05:44] AAA_awright: I have lots of console.log, luckily if I need high peformance I can just specify console.log = function(){} and then only errors come through
[05:44] dilvie: AAA_awright: Or is your branch broken?
[05:44] AAA_awright: That's fairly recent
[05:44] AAA_awright: And my branch is a bit broken right now
[05:44] AAA_awright: Or, my commit-to-be
[05:44] dilvie: cool
[05:45] AAA_awright: But I did have it going to the database and fetching information and formatting it, and displaying it, using the node module
[05:45] dilvie: Like I said, I have a habbit of committing on every new feature add or major bug fix. =)
[05:47] dilvie: AAA_awright: I haven't seen any db code yet, but just out of curiosity, would it be a major re-write do use a NoSQL db like couch, or are you using an ORM abstraction that would make it easy?
[05:47] AAA_awright: I'm not in the habbit of micro-committing but I go for one commit per feature
[05:48] AAA_awright: Small features, and branch for major features that take more than a few commits
[05:48] AAA_awright: dilvie: Yeah, very... It just asks each database for a certain piece of content and the database driver returns whatever it knows about it
[05:51] dilvie: AAA_awright: you were mentioning some kind of db filter thing? Can you explain that?
[05:51] AAA_awright: I would like it to return the relevant data in an RDF model, even represent all data that way. That should be highly cachable too, if you know how
[05:53] AAA_awright: dilvie: Later you might want to determine if you should even hit up the database or not... with a Bloom filter you can determine with only a small chance of a false positive, if what you are looking for is in the given set, so you don't even have to hit the HDD 99% of the time when it doesn't exist
[05:53] dilvie: ugh. I'm not a fan of that Jade markup. CDATA blocks for a script in HTML5? That doesn't make any sense.
[05:53] dilvie: I would much prefer something like mustache
[05:53] AAA_awright: dilvie: http://en.wikipedia.org/wiki/Bloom_filter
[05:55] jetienne has joined the channel
[05:56] AAA_awright: You could cache the presence of a few million different URLs in a megabyte of memory, if the given URL doesn't exist then you know for sure you can send a 404, for instance. Now, the probability that the URL being requested actually exists is high, but to determine what type of content a URL is, that can speed things up, instead of going into a database
[05:56] dilvie: AAA_awright: once upon a time I jumped on the XML bandwagon and wanted to create a content manager that used XML and XSLT.
[05:56] dilvie: I get a little way into the project and quickly changed my mind.
[05:57] AAA_awright: dilvie: yeah... XSLT is good for lots... it isn't much good for website data... How much do you know about RDF?
[05:57] dilvie: AAA_awright: Just that it's used to encode metadata in tripples
[05:58] dilvie: AAA_awright: and there are a bunch of symantic vocabularies specified in RDF
[05:58] AAA_awright: Right, it describes objects. But even more important...
[05:58] AAA_awright: Like how the Web globally identifies webpages, RDF globally identifies points of data
[05:58] AAA_awright: That's just cool once you realize what that can do, linked data
[05:59] dilvie: AAA_awright: tell me more.
[06:00] benburkert has joined the channel
[06:00] bradleymeck: AA
[06:00] bradleymeck: woops
[06:00] AAA_awright: dilvie: So for instance, I could ask from one person "What were the prices of Oil in dollars" and another entirely different person "What were the prices of Gold in dollars" and divide the two time series to get the price of oil in mass of gold
[06:01] dilvie: AAA_awright: So, it looks like some of the back-end stuff is working right now on your CMS, right -- but I don't see any front-end whatsoever. Am I missing something, or have you not built any sort of admin interface?
[06:02] AAA_awright: Or use RDF semantics to take "Gerald is a Ford" and "Ford is a brand of car" and infer that "Gerald is a car"
[06:02] AAA_awright: dilvie: It's missing templates, I have some that work...
[06:03] AAA_awright: Once I can figure out why this isn't working
[06:03] alexb_ has joined the channel
[06:04] bradleymeck has left the channel
[06:04] dilvie: wow, this threw me: if(self.event.emit("request", request, response)) return true; then 4 lines of comments, and another return true; in handleRequest
[06:05] daniellindsley has joined the channel
[06:06] dilvie: AAA_awright: did you mean to create an else block there?
[06:06] AAA_awright: huh
[06:07] digitaltoad has joined the channel
[06:07] dilvie: http://git.bzfx.net/~aaa/metawiki.git/tree/modules/metawiki.http.js
[06:07] AAA_awright: dilvie: events don't have return values, so none of that should be there... I was trying to put the 404 handler there, in case there is nothing to handle the HTTP event I think
[06:08] AAA_awright: Yeah
[06:08] dilvie: ah
[06:08] AAA_awright: No it does, if it called any event handlers or not
[06:10] zomgbie has joined the channel
[06:10] AAA_awright: I should write a test for that
[06:10] AAA_awright: ACTION adds to todo list
[06:10] dilvie: AAA_awright: that function doesn't seem to do anything, yet.. unless you have something else listening for that event somewhere...
[06:11] AAA_awright: Yeah, modules/metawiki.route.http.js hooks into that
[06:11] AAA_awright: modules/metawiki.route.http.page.js hooks into that ^
[06:12] AAA_awright: modules/metawiki.node.js hooks into that ^
[06:12] AAA_awright: And from there it calls the database to get content, then the template to format it, and then metawiki.route.http.page.js formats the page body around that
[06:12] dilvie: I see.
[06:12] AAA_awright: It works better then it sounds
[06:13] dilvie: You should comment your source a bit to make the flow more obvious.
[06:13] AAA_awright: I'm in need of an API documentor mechanism, there aren't any good ones
[06:14] AAA_awright: To generate call graphs
[06:14] dilvie: I guess I could cat all these files together and search for event names. =)
[06:14] AAA_awright: http://69.72.216.27/metawiki/function.png has the event hooks more or less
[06:15] dilvie: oh cool
[06:17] dilvie: AAA_awright: How does the metawiki.node branch work?
[06:19] AAA_awright: dilvie: In the config file (for now) I have a list of content types, and what databases/tables/columns contain the data for each type... node asks db for all information about that node ID, and the database determines its type, and then returns the relevant fields... It passes that data pretty much raw to a template, which searches for a list of files, for instance, /tpl/subtpl/node-(type) which formats that data into the page body
[06:21] AAA_awright: A lot of that is inspired by Drupal though I'm not so sure right now it's the best role model
[06:22] dilvie: what was your rationalle for using a bloom filter?
[06:22] dilvie: sorry I'm jumping all over.. just trying to figure out how this all fits together. =)
[06:24] SamuraiJack has joined the channel
[06:24] AAA_awright: Not every database is going to have every node, if you can figure out which ones to skip you can save some HDD activity which I am thinking will be the bottleneck
[06:24] AAA_awright: But that's for later anyways
[06:25] dilvie: AAA_awright: that might be a good rationalle for a site like Facebook, but what about smaller sites that don't have heavy storage requirements?
[06:25] dgathright has joined the channel
[06:25] AAA_awright: You could just not enable that module
[06:26] dilvie: AAA_awright: I guess what I'm trying to ask is, do you think the CMS should be solving that problem, or is it better solved on the DB end, for example, with auto-sharding features?
[06:26] AAA_awright: It would be implemented as a module, ideally, like everything else. But even then, it would improve on access times and would take hardly any memory if there are less then a few thousand pages of content
[06:26] AAA_awright: dilvie: If the database is already doing enough caching sure
[06:27] AAA_awright: I don't know the specifics yet, it might make peformance worse for all I know because it involves hashing
[06:27] herbySk has joined the channel
[06:28] ivanfi has joined the channel
[06:28] dilvie: is it optional in the current version?
[06:28] dilvie: in other words, can I turn the feature off?
[06:29] dilvie: for my hosting, storage is cheap, and memory is expensive, and I'm guessing a bloom filter would increase memory demand in exchange for improving lookup times?
[06:30] mjr_ has joined the channel
[06:31] d0k has joined the channel
[06:37] cnu has joined the channel
[06:37] AAA_awright: dilvie: It's not even implemented yet
[06:38] AAA_awright: dilvie: But in any event it's very cheap on memory, maybe cheaper than accessing the database
[06:38] badaxx has joined the channel
[06:40] dilvie: oh
[06:41] dilvie: AAA_awright: Looks like you have a lot of good ideas here, but I'm not sure you have enough for me to start using this system tomorrow.
[06:41] AAA_awright: 1800 bytes of memory to cache the existance of 1000 elements with 99.9% certainty, 1200 for 99% certainty, 500 for 90% certainty
[06:41] AAA_awright: dilvie: Not quite
[06:42] dilvie: AAA_awright: I'm thinking I'll just start with simple includes and mustache views, and track your progress. I'm in this chat pretty regularly. =)
[06:43] dilvie: It'll probably be 2-3 months before I'm ready to either adopt your (hopefully much more mature) system, or roll my own.
[06:43] AAA_awright: (I have a pretty basic implementation that can optimize a Bloom filter, the calculus to do so is insane)
[06:43] muhqu has joined the channel
[06:44] dilvie: AAA_awright: If yours was more mature, I'd start using it tomorrow.
[06:44] dilvie: I do like a lot of your ideas.
[06:44] dilvie: I like the event-oriented module nature. I like the simplicity of the architecture..
[06:44] AAA_awright: It can start serving content fairly soon now, but that's not what most people look for in a CMS
[06:44] AAA_awright: Authentication and editing data is a must
[06:44] amerine has joined the channel
[06:45] dilvie: yeah. I don't really see the point of a CMS that doesn't do editing of some kind.
[06:45] V1 has joined the channel
[06:47] dilvie: Eventually, I'll want full theme and content editing, page creation, article creation, drag and drop menu creation, plugin management, software auto-updates, etc..
[06:47] dilvie: I've basically been spoiled silly by WordPress. I hate the technology it's built on, but they got that management UX down.
[06:48] AAA_awright: It does themes, uh... auto-updates via npm
[06:48] dilvie: AAA_awright: rock on.
[06:49] dilvie: I also need some pretty rich security policy / user role management
[06:50] dilvie: AAA_awright: Have you started documenting the bits of the API that you consider somewhat stable?
[06:50] AAA_awright: Wow that was a stupid bug, alright
[06:51] dilvie: which bug?
[06:51] AAA_awright: I was assigning a value to an object by an object... creating someObject["[object Object]"]
[06:52] dilvie: I've done that.
[06:52] AAA_awright: That should error.
[06:52] AAA_awright: ACTION ugh
[06:52] dilvie: it didn't error when I did it. =)
[06:52] Mobbit has joined the channel
[06:53] AAA_awright: Should consider overriding .toString or whatever
[06:53] AAA_awright: I probably never want to use it anyways
[06:54] dilvie: I use .toString all the time for debugging.
[06:54] hoodoos has joined the channel
[06:55] dilvie: oh no, I used to do that. Lately I've been using JSON.strigify() so I can get a better sense of what's inside what I'm looking at. =)
[06:55] dilvie: (which causes the scripts to totally fail on the client-side in IE, BTW)
[06:55] hoodoos: morning/evening/noon guys
[06:55] dilvie: hi hoodoos
[06:56] dilvie: we're geeking out all over the place here.
[06:56] hoodoos: heh, glad to hear you're still geeking
[06:57] dilvie: I just learned how AAA_awright is using bloom filters to speed up data lookups for his CMS. Enlightening.
[06:57] hoodoos: i'm looking for logger atm, anyone can suggest one?
[06:58] dilvie: console.log()
[06:58] hoodoos: noo, it doesn't give time when someth happen
[06:58] hoodoos: it says that it happened, but not when..
[06:59] dilvie: console.log(new Date() + ' ' + eventMessage);
[06:59] hoodoos: :)
[06:59] hoodoos: and what if i'd like to change place I write to?
[06:59] hoodoos: * i log to, sorry
[06:59] AAA_awright: dilvie: I'm using sys.inspect but that seems to work too
[07:00] zum: node's pretty much "write your own" territory right now, although there are things like http://github.com/quirkey/node-logger
[07:00] dilvie: or what zum said.
[07:00] hoodoos: :D
[07:00] AAA_awright: How would you wrap around console.log
[07:00] AAA_awright: console.log = function(s){console.log(new Date() + ' ' + s);}
[07:00] AAA_awright: Not like that
[07:01] xla has joined the channel
[07:01] AAA_awright: var c = console.log; console.log = function(s){c(new Date() + ' ' + s);}
[07:01] AAA_awright: ^ that works
[07:01] AAA_awright: hoodoos: ^
[07:01] hoodoos: console log is kinda big for my taste, i like it that way: log.e(msg) and log.i(msg) and inside I can place console.log, yes
[07:02] Anti-X has joined the channel
[07:02] hoodoos: can also add some tagging for better greping and.. well, that's sufficient
[07:02] dilvie: hoodoos: yes.
[07:02] AAA_awright: dilvie: Did you get my PM link?
[07:04] pufuwozu has joined the channel
[07:05] aubergine has joined the channel
[07:12] prettyrobots has joined the channel
[07:14] yellowbean has joined the channel
[07:14] pufuwozu has joined the channel
[07:17] liesen has joined the channel
[07:17] comster has joined the channel
[07:18] stephank has joined the channel
[07:19] hannesw has joined the channel
[07:19] pufuwozu has joined the channel
[07:19] yellowbean has joined the channel
[07:20] yellowbean has joined the channel
[07:21] comster: newbQ: I'm having trouble with mongo gridfs files, that is over the size of the chunks. I've only found the most basic mongo.GridStore.read examples. Any suggestion?
[07:22] frode has joined the channel
[07:22] V1: comster: #mongodb
[07:22] yellowbean has joined the channel
[07:22] brainfck` has joined the channel
[07:23] comster: thx :)
[07:23] adambeynon has joined the channel
[07:30] pufuwozu has joined the channel
[07:35] comster: might be somewhat unique to the js api though
[07:35] pufuwozu has joined the channel
[07:41] q_no has joined the channel
[07:41] Athox has joined the channel
[07:42] arikon has joined the channel
[07:43] arikon: hi
[07:43] arikon: how to set connection timeout on httpClient in node?
[07:45] ph^ has joined the channel
[07:46] SubStack: aww Buffer is Arrayish but doesn't have forEach and friends
[07:46] V1: arikon: .setTImeout() on the client?
[07:47] digitaltoad has joined the channel
[07:47] SubStack: hah you can do the [].slice.call trick with buffers too ^_^
[07:48] arikon: client.setTimeout(1000) doesn't work
[07:51] Athox: having forEach as a callback makes it useless almost all the time
[07:51] Athox: at least to me
[07:53] SubStack: useless? I like putting them at the end of pipeline-style transformations
[07:53] a_meteorite has joined the channel
[07:54] micheil: SubStack: I wouldn't recommend forEaching a buffer.
[07:54] a_meteorite has joined the channel
[07:55] hzin has joined the channel
[07:55] SubStack: micheil: but why?
[07:55] micheil: because I would guess it would be rather slow.
[07:55] SubStack: but without evidence that is just a guess
[07:55] SubStack: ACTION gathers some evidence
[07:56] teemow has joined the channel
[07:57] micheil: SubStack: I've heard a lot of ops on buffers are fairly slow, but yeah
[07:58] zomgbie has joined the channel
[07:58] evl has joined the channel
[07:58] evl has joined the channel
[08:01] SubStack: it's only about 2x slower
[08:01] SubStack: gisting
[08:01] SubStack: perhaps 3x
[08:01] alexb_: No good gzip lib for node?
[08:01] Tim_Smart: 2x slower for small buffers...
[08:01] Tim_Smart: Or?
[08:01] SubStack: this buffer has 1e6 items
[08:01] micheil: Tim_Smart: is there such thing as a growing buffer?
[08:02] Tim_Smart: micheil: No.
[08:02] micheil: :(
[08:02] micheil: Tim_Smart: still getting that error with the new parser.
[08:02] Tim_Smart: micheil: Right. I take a look in a minute.
[08:02] SubStack: doing a test for small buffers now
[08:03] bootlaces has left the channel
[08:03] Tim_Smart: The conversion won't be cheap either ;)
[08:04] Tim_Smart: (Buffer to array)
[08:04] virtuo has joined the channel
[08:04] Tim_Smart: And it won't point to the actual data.
[08:04] ph^_ has joined the channel
[08:04] aubergine_ has joined the channel
[08:04] SubStack: http://gist.github.com/616485
[08:06] jesusabdullah: Looks significant
[08:06] Tim_Smart: That is quite a bit.
[08:06] SubStack: quite a bit?
[08:06] SubStack: 3x is hardly a lot
[08:06] jesusabdullah: It's 300%
[08:06] Tim_Smart: I have already tried this before, and it failed.
[08:07] Tim_Smart: 3x times is a lot.
[08:07] jesusabdullah: Not a lot in CS terms maybe, but it's certainly statistically significant, non-trivial, non-negligible for non-negligible use of buffer looping
[08:08] romanb has joined the channel
[08:08] SubStack: but for loops are ugly
[08:08] jesusabdullah: Sure
[08:08] Tim_Smart: for loops <3
[08:08] SubStack: that is the kind of stuff that v8 should be optimizing behind the scenes
[08:08] Tim_Smart: Embrace them.
[08:08] jesusabdullah: So, if you're doing it like every once in a while, the prettier syntax could easily be worth it, but if it turns out to be something you do ALL THE TIME then a for loop may be worth it
[08:08] SubStack: not the programmer
[08:08] ph^ has joined the channel
[08:08] jesusabdullah: For loops :C
[08:08] bentomas has joined the channel
[08:08] jesusabdullah: They're good to have around, but I prefer maps and foreach's and such
[08:08] SubStack: computation is hardly ever the bottleneck anyways
[08:08] Tim_Smart: SubStack: Lol, buffers weren't meant to be cast to array s like that.
[08:09] Tim_Smart: jesusabdullah: Yeah, but the function invocation adds overhead.
[08:09] Tim_Smart: Speed man speed.
[08:09] SubStack: I don't care what stuff was meant for
[08:09] q_no has joined the channel
[08:09] jesusabdullah: Tim_Smart: If you care THAT much about speed you should be using a compiled language *anyway*
[08:10] Tim_Smart: jesusabdullah: Yeah but I also care about how I spend my time, that is why my vim has snipMate installed.
[08:10] jesusabdullah: I think there's a certain point where you have to accept that the whole reason you're using language x is because the trade-off between speed and abstractions is worthwhile
[08:12] jesusabdullah: ACTION tries bed again
[08:13] jesusabdullah: Hopefully doesn't dream about *shudder* matlab *shudder*
[08:16] Tim_Smart: jesusabdullah: Too easy http://screenr.com/SBl
[08:17] okuryu has joined the channel
[08:19] Evet has left the channel
[08:21] ph^ has joined the channel
[08:25] aubergine has joined the channel
[08:25] TomY has joined the channel
[08:26] jetienne has joined the channel
[08:27] peritus- has joined the channel
[08:28] arikon has left the channel
[08:34] hellp has joined the channel
[08:35] zomgbie has joined the channel
[08:37] codemanki has joined the channel
[08:38] TomY has joined the channel
[08:44] mytrile has joined the channel
[08:46] mbrochh has joined the channel
[08:46] mbrochh has joined the channel
[08:50] bentomas has left the channel
[08:58] TomsB has joined the channel
[09:01] xla has joined the channel
[09:04] tpryme has joined the channel
[09:07] rra_ has joined the channel
[09:09] zk has left the channel
[09:10] aubergine has joined the channel
[09:10] zk has joined the channel
[09:11] romanb_ has joined the channel
[09:14] prettyrobots has joined the channel
[09:24] rnewson has joined the channel
[09:24] ooooPsss has joined the channel
[09:27] cnu has joined the channel
[09:27] mbrochh]2 has joined the channel
[09:29] caolanm has joined the channel
[09:29] sechrist: man the npm site is so crazy to load
[09:29] sechrist: pagination plz
[09:30] sechrist: or pagination + lazy loading infinite scroll
[09:30] aubergine has joined the channel
[09:31] rasputnik has joined the channel
[09:40] ph^ has joined the channel
[09:40] V1: Didn't know npm had a site
[09:40] V1: its just a landing page
[09:46] emmanueloga has joined the channel
[09:50] victorcoder has joined the channel
[09:52] aubergine has joined the channel
[09:55] MikhX has joined the channel
[09:58] mif86 has joined the channel
[10:08] unomi: Is there a critique of CoffeeScript out there somewhere? or is it just perfect?
[10:12] Ori_P has joined the channel
[10:18] agnat has joined the channel
[10:25] Tim_Smart: unomi: Not perfect, but cool none-the-less.
[10:37] ph^ has joined the channel
[10:39] caolanm: if anyone here uses couchapps, I've been playing around with this command-line tool written in node.js: http://github.com/caolan/cpm - feedback welcome
[10:43] zomgbie has joined the channel
[10:45] ivanfi has left the channel
[10:47] unomi: Tim_Smart: I agree that its looks pretty nifty, just a bit surprised that I couldn't find any posts that were critical of it.
[10:47] Tim_Smart: unomi: It definitely has some haters around...
[10:47] unomi: I would imagine that for browserside scripting, the extra layer would be a bit annoying when debugging for example.
[10:48] Tim_Smart: unomi: Yes - debugging and the fact the it designed to support the browser.
[10:48] aliem has joined the channel
[10:48] Tim_Smart: So it can't use es5 methods for some things.
[10:48] Tim_Smart: But the idea is that you use those anyway...
[10:49] Tim_Smart: So: array.forEach (element) -> soSomethingAwesome element
[10:49] Tim_Smart: Etc.
[10:49] unomi: ah, I thought that it pulled underscore in as a dependency
[10:50] fermion has joined the channel
[10:50] unomi: which would grant it use of those constructs across environments
[10:50] Tim_Smart: Nope/
[10:51] Tim_Smart: You can use it anywhere where you use ecmascript, so you can pull in the underscore library yourself if you like.
[10:51] Tim_Smart: The compilation step is kinda annoying as well - I usually run coffee files directly otherwise.
[10:51] unomi: dunno, we have a team member who is proposing moving everything to it, but tbh, I'd rather work in pure ecmascript.
[10:52] unomi: I am probably just old fashioned :p
[10:52] Tim_Smart: unomi: It is nice to work with, maybe not quite production ready though?
[10:53] unomi: nod
[10:54] Tim_Smart: unomi: Have you played with it yet?
[10:54] dipser has joined the channel
[10:55] unomi: I have looked at the CS source and output .js from a module he is working on. I haven't used it myself as yet. I generally find plain-old-javascript quite nice.
[10:56] Tim_Smart: unomi: http://jashkenas.github.com/coffee-script ACTION throws a hand to cover his face in shame!
[15:49] bradleymeck: austin texas, with a lease until may soo cant move unless they wanted to pay me stupid dollars
[15:50] TheEmpath: there's a coder rush in california these days
[15:50] TheEmpath: i dunno if its ending soon or not
[15:50] tj has joined the channel
[15:50] TheEmpath: but during this entire recession, i've been unemployed once and that was on purpose
[15:50] TheEmpath: i've juggled jobs
[15:51] TheEmpath: but i was never without for long
[15:51] TheEmpath: and im not even all that modern
[15:51] TheEmpath: nothing more formal training in High School AP C++ and 10 years of PHP :X
[15:51] stride: "High School AP"?
[15:51] TheEmpath: ya
[15:52] stride: what does AP stand for?
[15:52] TheEmpath: they taught advanced placement C++ in my high school
[15:52] TheEmpath: you get college credits for it
[15:52] TheEmpath: I loved computers, but hated school
[15:52] TheEmpath: graduated with a 2.2gpa, but i knew three languages!
[15:52] stride: ah, *facepalms* that's what google says as well
[15:53] bradleymeck: rawr 2.8gpa overall 3.45gpa in major CS, mostly down due to me hacking side projects XD
[15:53] bradleymeck: and thats when i learned the power of standardized measurements
[15:53] jacobolus has joined the channel
[15:54] programble has joined the channel
[15:54] programble has joined the channel
[15:56] TheEmpath: never did college
[15:56] TheEmpath: never saw the point
[15:56] TheEmpath: University of Google, baby
[15:57] bruse: university is about sex, drugs while learning about interesting stuff
[15:58] stride: + the occasional all-nighter to get that paper in on time
[15:58] Astro has joined the channel
[15:58] bradleymeck: university is about going to school, learning how terrible the learning system is, going off on your own to learn, and then getting bad grades because you dont know random terms you wont see again
[16:00] dylang: Anybody using Soda - I'm not sure how to shut down firefox after I'm done. I end up with a dozen firefoxes while developing.
[16:01] tjholowaychuk: dylang: testComplete()
[16:01] tjholowaychuk: should do it
[16:01] tjholowaychuk: buy if your tests fail it will stay open so you can view the log
[16:01] bruse: sounds like you guys have terrible universities
[16:01] xdamman has joined the channel
[16:01] dylang: tjholowaychuk: awesome, thanks, will try it.
[16:02] benburkert has joined the channel
[16:02] Ori_P_ has joined the channel
[16:02] jgautier has joined the channel
[16:02] jstemmer has joined the channel
[16:02] bradleymeck: bruse, i went to a very nice university well 2 of them after transfer and learned the collegiate system is a poor preparation for CS
[16:02] jgautier: hey when socket.IO uses a websocket transport does it still use the same port as the server instance?
[16:02] steadicat has joined the channel
[16:02] jgautier: to do the websocket communcation
[16:02] aconbere has joined the channel
[16:02] bruse: i think that very much depends on your definition of CS
[16:03] c4milo: bradleymeck: agree with your definition of university :)
[16:03] bradleymeck: jgautier it should run off the web browser's current port
[16:03] bruse: at least my CS program prepares me very well for a doctorate in CS, the study field
[16:03] bradleymeck: bruse, both theoretical and practical application
[16:03] bruse: software engineering is not really that related
[16:04] mjr_ has joined the channel
[16:04] jgautier: so check this out my app works fine at home when i use the servers local ip address but i have just fowarded the ports on my router and i am now trying to access via the external ip. the files are served up and i see the connection come through but then it immeidately disconnects
[16:04] jgautier: ideas?
[16:05] dylang: tjholowaychuk: testComplete() worked, thanks!
[16:05] bradleymeck: if the connection actually goes through, no idea
[16:05] tjholowaychuk: dylang: awesome, np
[16:06] jgautier: 8 Oct 08:53:04 - Initializing client with transport "websocket" 8 Oct 08:53:04 - Client 15775396022945642 connected 8 Oct 08:53:04 - Client 15775396022945642 disconnected
[16:06] brainfck` has joined the channel
[16:06] jgautier: connects then immediately disconnects
[16:07] bradleymeck: nothing in the issues about this?
[16:08] jgautier: hmm maybe something to do with the server listenting on port 80?
[16:09] bradleymeck: is it behind another server?
[16:10] bradleymeck: if so then the front server is probably eating the upgrade event
[16:10] jgautier: nope im running node on a virtualbox vm in ubuntu and im fowarding the port of that server on the router
[16:10] jgautier: im gonna try a different port
[16:10] bradleymeck: virtualbox vm of ubu has problems with node serving crud for me
[16:11] bradleymeck: real ubu works fine
[16:11] rra_ has joined the channel
[16:11] jgautier: hmmm
[16:11] jgautier: thats weird
[16:11] bradleymeck: i spent days trying to figure out what was wrong
[16:11] jgautier: but if it works locally should work over through the router
[16:11] bradleymeck: yea
[16:12] jgautier: tried 8080 no luck
[16:13] jgautier: anyways
[16:13] jgautier: back to REAL work
[16:13] jgautier: ugh
[16:13] jgautier: thanks for your help
[16:13] jesusabdullah: Ugh, real work
[16:14] jgautier: hahaha
[16:14] Anti-X has joined the channel
[16:14] jesusabdullah: I've been having to do real work over the last week almost exclusively
[16:14] jgautier: why cant they just pay me to play around with new technologies?
[16:14] jesusabdullah: kicking my ass
[16:14] jesusabdullah: hah
[16:14] jesusabdullah: I'm a grad student, so that puts a different light on things
[16:14] jesusabdullah: I usually play with new stuff in the evenings and stuff
[16:15] jgautier: me too but its hard to work all day then come home to more computer stuff
[16:15] seanouimet has joined the channel
[16:15] jgautier: i just need to have a job thats more interesting ;)
[16:18] halogenandtoast has joined the channel
[16:21] yviktorov has joined the channel
[16:22] ezmobius has joined the channel
[16:22] mif86 has joined the channel
[16:26] ossareh has joined the channel
[16:26] dgathright has joined the channel
[16:26] yviktorov has joined the channel
[16:29] yviktorov has joined the channel
[16:29] JshWright has joined the channel
[16:31] ginader has joined the channel
[16:32] jpld has joined the channel
[16:34] JshWright: so if a package version is incorrect in the npm registry, is there a way to get npm to install an "older" version?
[16:34] bradleymeck: npm install x@y.z.a
[16:35] JshWright: perfect, thank you
[16:35] c4milo has left the channel
[16:36] JshWright: the 'redis' package 404's when trying to download version 0.3.4, but the current version is only 0.3.3
[16:36] mjr_: uh oh
[16:36] mjr_: I can bump the version and push a new one if it's messed up in the repo
[16:36] JshWright: well, install redis@0.3.3 worked just fine for me
[16:37] mjr_: I unpublished 0.3.4 and published again
[16:38] dahankzter has joined the channel
[16:38] mjr_: Can you try 0.3.4 again please?
[16:38] JshWright: npm info build Success: redis@0.3.4
[16:38] mjr_: hooray
[16:38] Gruni has joined the channel
[16:38] TomY has joined the channel
[16:39] mjr_: If your redis server is running, you can also do "npm test redis" and it'll make sure everything is happy.
[16:40] dnolen has joined the channel
[16:40] twoism has joined the channel
[16:41] davidascher has joined the channel
[16:41] JshWright: tests look good
[16:42] mjr_: Great. Happy redis-ing.
[16:42] agnat has joined the channel
[16:42] davidascher has joined the channel
[16:42] rnewson has joined the channel
[16:42] victorcoder has joined the channel
[16:43] holydevil has joined the channel
[16:44] yviktorov has joined the channel
[16:45] WALoeIII has joined the channel
[16:46] noahcampbell has joined the channel
[16:46] prettyrobots_ has joined the channel
[16:47] vandenoever has joined the channel
[16:47] langworthy has joined the channel
[16:47] oever has joined the channel
[16:47] dysinger has joined the channel
[16:48] yviktorov has joined the channel
[16:52] mif86 has joined the channel
[16:53] dgathright has joined the channel
[16:55] eazyigz has joined the channel
[16:56] eazyigz: anybody using ec2 to host nodejs? I am curious what kind of AMI you are running.
[16:57] TomsB has joined the channel
[16:57] sh1mmer has joined the channel
[16:57] jameshome_ has joined the channel
[16:59] brainfck` has joined the channel
[17:01] technoweenie has joined the channel
[17:04] sonnym: eazigz: I'm planning on using freeBSD on ec2 for hosting my first node application, but haven't set anything up yet, so I cannot comment beyond that :)
[17:05] sonnym: *eazyigz
[17:05] jakehow has joined the channel
[17:06] rra_ has joined the channel
[17:06] eazyigz: ok, I heard rightscale has good ami's
[17:06] deepthawtz has joined the channel
[17:06] saimon_ has joined the channel
[17:06] davidascher has joined the channel
[17:06] eazyigz: but I'm contemplating building my own, for replication purposes
[17:07] sprout has joined the channel
[17:08] sh1mmer has joined the channel
[17:10] xdamman has joined the channel
[17:12] TheEmpath: sonnym i figured out the socket.io issue
[17:12] sonnym: nice, what was it?
[17:12] TheEmpath: i was using apache as my webserver, not node.js :X
[17:13] sonnym: I've made ~3 fixes that have all been transient.
[17:13] sonnym: hmm, I wonder if it's only failing when I have apache up. . .
[17:13] slashxr has joined the channel
[17:13] TheEmpath: once i turned node.js into a webserver, i made it serve the client.js
[17:13] TheEmpath: which contains this:
[17:13] rauchg__ has joined the channel
[17:13] dmcquay has joined the channel
[17:14] TheEmpath: and that made everythign work
[17:14] sonnym: I already have everything served through node, and it still fails
[17:14] herbySk: sonnym: alas, on freebsd there are couple of problems with node (random EADDRINUSE, http-upgrade-server not working, some more net-related things)
[17:14] TheEmpath: how are yo invoking the socket.io.js?
[17:14] ezmobius has joined the channel
[17:14] sonnym: herbySk: that's definitely good to know. . . looks like I'm going to stick with linux :) thanks for the head's up
[17:14] benburkert has joined the channel
[17:15] herbySk: sonnym: well, I prefer freebsd over linux, but node is not extensively tested on it, only solaris and linux is "tier1", if I remember right... and OSX, maybe
[17:15] thejefflarson has joined the channel
[17:15] sonnym: TheEmpath: it's a bit strange because I lazy load socket.io.js
[17:16] TheEmpath: hrmm
[17:16] Ori_P has joined the channel
[17:16] stephenjudkins has joined the channel
[17:17] TheEmpath: i use
[17:18] isaacs has joined the channel
[17:19] chapel: hmm
[17:22] MikhX has joined the channel
[17:22] franksvalli has joined the channel
[17:22] sonnym: TheEmpath: something like this: http://paste.org/pastebin/view/23318
[17:23] ezmobius has joined the channel
[17:23] TheEmpath: o
[17:23] sonnym: works fine in chrome
[17:23] sonnym: it's just the xhr-multipart that fails
[17:23] sonnym: the wonky debug code in load_js is because the jQuery method doesn't let me step through code in firebug
[17:24] sonnym: I'll have to try with a normal script tag again to see if it works
[17:26] sh1mmer has joined the channel
[17:29] vnguyen has joined the channel
[17:30] robotarmy has joined the channel
[17:31] sonnym: TheEmpath: weird, now I'm getting an "io is not defined" error. . . makes no sense
[17:31] TheEmpath: D:
[17:32] sonnym: and it's definitely getting pulled down, at least according to firebug
[17:32] franksvalli has joined the channel
[17:33] sonnym: at least I've gotten used to developing in chromium. that can't be a bad thing haha
[17:37] twoism has joined the channel
[17:38] ajsie has joined the channel
[17:41] rnewson has joined the channel
[17:41] rnewson has joined the channel
[17:42] vandenoever has joined the channel
[17:42] vandenoever has joined the channel
[17:46] davidascher: tjholowaychuk: have you thought about an html->jade converter?
[17:47] tjholowaychuk: davidascher: nope
[17:47] davidascher: (could be called 'deja' =)
[17:47] Druid_ has joined the channel
[17:47] tjholowaychuk: :p
[17:48] Anti-X: or simply html2jade? you know, to not confuse people needlessly
[17:48] davidascher: I'm playing w/ a system where i'd like content to be authored in jade and where that's the "source", but also editable through direct dom wisywig-type operations. figuring out how to map changes from the DOM back to jade diffs isn't trivial.
[17:48] davidascher: Anti-X: boooring.
[17:48] dahankzter has joined the channel
[17:48] Anti-X: it's a converter
[17:49] Anti-X: it's supposed to be boring
[17:49] Anti-X: if it did something unexpected then you would be angry
[17:49] Anti-X: i know it's not web 2.0 enough
[17:49] Anti-X: but deal with your issues, man!
[17:50] bradleymeck has left the channel
[17:50] javajunky has joined the channel
[17:50] gJ|Alex has joined the channel
[17:50] Anti-X: i was thinking of making a node port of JsTestDriver.. unless that already exists
[17:51] Anti-X: and i can't believe the amount of source files for that shit
[17:51] gerred has joined the channel
[17:53] franksvalli1 has joined the channel
[17:55] bradleymeck has joined the channel
[17:56] bradleymeck: i return~
[17:56] franck34 has joined the channel
[17:56] franck34: HAAAAAAAaaaaaaaaaaaa
[17:56] franck34: hi
[17:56] bradleymeck: yo
[17:56] franck34: i'm trying to refactor this code http://github.com/ry/node_chat/blob/master/client.js using mootools
[17:57] bradleymeck: ACTION shudders
[17:57] franck34: just to know if somebody already did it
[17:57] bradleymeck: dont think so
[17:58] franck34: ok let me continu so ..
[17:58] franck34: was using ape-project before
[17:58] franck34: but node.js seem's to be more easy !
[17:59] xdamman has joined the channel
[17:59] jbenesch has joined the channel
[17:59] Ari-Ugwu has joined the channel
[18:00] nefD: i got a happy meal for my son last night, and the toy was a *a freaking chewbacca bobble head on top of an at-st that winds up and walks*
[18:01] nefD: so, i kept it
[18:01] nefD: now its on my desk
[18:01] aubergine has joined the channel
[18:04] javajunky has joined the channel
[18:06] ryah: pquerna: http://brad.livejournal.com/2228488.html
[18:06] delapouite has joined the channel
[18:09] Ari__ has joined the channel
[18:12] sudoer has joined the channel
[18:13] Ari-Ugwu has joined the channel
[18:14] JshWright: I hate it when I get stuck on something, finally give up and start collecting information to pose a coherent questions in IRC, and in the process of that collection, solve my own issue...
[18:14] franck34: bradleymeck: done
[18:14] franck34: http://node.tradingactive.com/ just for test
[18:15] franck34: cool
[18:18] cloudhead has joined the channel
[18:18] bradleymeck: is there a way to make a generic in memory WritableStream
[18:27] aurynn has joined the channel
[18:28] femtoo has joined the channel
[18:31] mr_daniel: I have found websites explaining how to install npm, but they only explain how to install npm in /user/local or in ~/local. It there a way to install npm in an arbitrary folder for example ~/mystuff/node/npm ?
[18:32] mr_daniel: I tried to figure out how 'make install' works, which internally executes 'node cli.js install npm'
[18:32] isaacs: mr_daniel: yes.
[18:32] mr_daniel: but I am stuck in cli.js on lin 80, because I don't how 'npm.commands[command](arglist, errorHandler)' works
[18:33] isaacs: mr_daniel: set the stuff in the .npmrc file prior to doing the install.
[18:33] isaacs: mr_daniel: editing the npm code itself is much much more involved than necessary
[18:33] AAA_awright: I haven't been able to set the paths from the command arguments, is the config file really necessary?
[18:34] isaacs: mr_daniel: http://gist.github.com/579814#file_yet_another_option.sh
[18:34] isaacs: AAA_awright: ?
[18:34] mr_daniel: ok, so 'node cli.js install npm' reads the command given in '.nmprc' and places the files there
[18:34] isaacs: mr_daniel: "node cli.js" is just what the "npm" command maps to, effectivly
[18:34] isaacs: mr_daniel: so it works like npm works
[18:34] V1 has joined the channel
[18:34] isaacs: mr_daniel: it just uses itself to install itself
[18:35] AAA_awright: isaacs: Shouldn't I be able to run "node npm.js --root=~/npmroot install npm" or something like that?
[18:35] isaacs: AAA_awright: no =
[18:35] mr_daniel: ok, get that, I'll try the '.nmrc' way in a minute, thanks for explanation isaacs
[18:35] franck34: what's the way to fetch the Host header (domain name) sent by an http request ? i'd like to implement multiple channel based on the domain name. channel1.chat.test.com, channel2.chat.test.com etc
[18:35] Druid_ has joined the channel
[18:35] isaacs: AAA_awright: node path/to/npm/cli.js install npm --root ~/npmroot --binroot ~/bin --manroot ~/share/man
[18:35] isaacs: etc
[18:36] isaacs: AAA_awright: or, if you prefer, you may also use environs. npm_config_root=~/npmroot npm condfig ls
[18:36] AAA_awright: k
[18:36] isaacs: AAA_awright: npm_config_root=~/npmroot npm config ls
[18:36] isaacs: AAA_awright: `npm help config` for more info
[18:37] isaacs: AAA_awright: cli > env > ~/.npmrc > etc/npmrc > defaults
[18:37] isaacs: priority of config inheritance ^
[18:37] isaacs: it's a prototype chain
[18:38] CrabDude has joined the channel
[18:38] sechrist: Anybody know how to detect the hostname to do a www redirect in express/connect?
[18:38] isaacs: sechrist: check req.headers.host?
[18:38] sechrist: yeah but I'd like to do all requests
[18:38] sechrist: instead of a redirect in a specific route
[18:39] rcy has joined the channel
[18:39] sechrist: www.example.com/randomstuffhere -> example.com/randomstuffhere
[18:41] jackish has joined the channel
[18:41] sechrist: humm
[18:43] brainfck` has joined the channel
[18:44] rschildmeijer has joined the channel
[18:46] brianmario has joined the channel
[18:46] itissid has joined the channel
[18:46] franck34: thx sechrist
[18:46] aubergine has joined the channel
[18:46] sechrist: ?
[18:47] franck34: lol i asked a question regarding hostname, you answer another question but was the same ;) req.headers.host
[18:49] rschildmeijer has left the channel
[18:58] LowValueTarget has joined the channel
[18:58] 17SAABTVQ has joined the channel
[18:58] 45PAA9RW6 has joined the channel
[18:58] admc_ has joined the channel
[19:02] franck34: is there something equivalent to vardump, print_r to dump object ?
[19:03] franck34: or jsonify or .. ?
[19:03] franck34: (just started node.js today)
[19:03] DrunkDwarf has joined the channel
[19:03] dguttman has joined the channel
[19:03] matt_c: franck34: sys.inspect(obj) (sometimes wrapped in a console.log()
[19:04] matt_c: console.log(sys.inspect(obj))
[19:04] franck34: thx a lot
[19:04] nerdEd has joined the channel
[19:05] rschildmeijer has joined the channel
[19:07] ginader has joined the channel
[19:08] Me1000 has joined the channel
[19:09] gwoo has joined the channel
[19:09] gwoo has joined the channel
[19:10] technoweenie has joined the channel
[19:13] rschildmeijer: Doing some simple benchmarking with ab (apache benchmark) against 0.2.3 and experiencing some keep-alive issues (using 'ab -k' to enable persistent connection). Im trying to do 1000 requests (ab -n1000) with a concurrency level of 5 (ab -c5). After 2..11 request/response i get the initial response line (http version, status code, http version, reason phrase), then I got a "connection reset by peer (54)"...looks like node.js is
[19:13] rschildmeijer: closing my "persistent" connections (timeout?). Any idea?
[19:14] bartt has joined the channel
[19:15] javajunky has joined the channel
[19:16] emmanueloga has joined the channel
[19:18] jakehow has joined the channel
[19:18] kjeldahl has joined the channel
[19:19] eisd has joined the channel
[19:19] c4milo has joined the channel
[19:20] jacobolus has joined the channel
[19:21] rschildmeijer_ has joined the channel
[19:21] rex_fernando has joined the channel
[19:23] nefD: anyone running windows? if so, in IE, does the follow snippet produce a green hexagon in the bottom right corner, or a bloody mess? : http://jsfiddle.net/NrpUH/
[19:24] DrunkDwarf: I get a hexagon
[19:24] nefD: badass.. thanks!
[19:24] DrunkDwarf: but not in IE7 compatibility mode
[19:24] nefD: hrmph.. well, I can live with that
[19:24] nefD: just ie8 im guessing?
[19:24] sh1mmer has joined the channel
[19:24] xdamman has joined the channel
[19:24] DrunkDwarf: IE8 works fine
[19:25] nefD: awesome,. thanks muchly
[19:25] mr_daniel: I just made a new 'git pull; make; make install' to update my local node.js installation, but despite that npm complains that it wants Node.js version >= 2.0
[19:25] mr_daniel: and it is right because my local include/node/node_versions.h file has an entry
[19:25] mr_daniel: # define NODE_VERSION "v0.1.94-5-g3ac6dee"
[19:25] isaacs: mr_daniel: what does node -v say?
[19:26] isaacs: mr_daniel: where did you "git pull" from? ryan's repo or your own fork?
[19:26] MikhX has joined the channel
[19:26] mr_daniel: the same value 'v0.1.94-5-g3ac6dee', it seems like 'node -v' just pulls the value from node_versions.h
[19:26] rschildmeijer has left the channel
[19:26] isaacs: mr_daniel: your node code is way way out of date
[19:27] c4milo has joined the channel
[19:27] mr_daniel: I think it is ryans' repo, but I am not sure, mom...
[19:28] isaacs: mr_daniel: git remote add ry git://github.com/ry/node.git ; git pull --rebase ry master ; make distclean ; make clean ; ./configure ; make ; make install
[19:28] isaacs: actually, for safety, replace the ";" with "&&" so that it'll die on errors
[19:29] mr_daniel: ok, 'git describe' reports >= v0.2, I think I should 'make clean' first...
[19:30] mr_daniel: I think 'make clean' will solve the problem, 'make' is still running...
[19:31] isaacs: kewl
[19:31] isaacs: mr_daniel: that ^ is just a shotgun "scorch the earth, scrub it clean, get the new stuff, install it" path
[19:31] isaacs: mr_daniel: not really necessary often
[19:35] jacobolus has joined the channel
[19:35] mr_daniel: ok, 'node -v' reports v0.3.0-pre and npm reports 0.2.3-6, thanks you for your help isaacs
[19:35] isaacs: mr_daniel: np :)
[19:36] awenkhh has joined the channel
[19:39] DozyPieman has joined the channel
[19:39] comster has joined the channel
[19:39] jameshome_ has joined the channel
[19:46] hornbeck has joined the channel
[19:46] MikhX has joined the channel
[19:47] scnd has joined the channel
[19:47] sh1mmer has joined the channel
[19:47] reid has joined the channel
[19:50] muk_mb has joined the channel
[19:59] jackish has joined the channel
[20:00] c4milo has left the channel
[20:03] tilgovi has joined the channel
[20:03] pengwynn has joined the channel
[20:05] spetrea has joined the channel
[20:05] spetrea: can someone try this out ? http://github.com/wsdookadr/github-spider/tree/master/Jit/Examples/Icicle/
[20:05] spetrea: just example1.html and example1.js
[20:05] spetrea: I've been working on visualization of followers for profiles on github
[20:05] spetrea: and I've been using thejit project(for visualization in Javascript) and node.js for writing a crawler
[20:05] SubStack: npmify it
[20:06] spetrea: SubStack: it's not mature yet, still has bugs, and I'm not yet sure exactly what I want to do with it
[20:06] SubStack: doesn't matter
[20:06] spetrea: SubStack: bottom line, I need to find a way to display the stuff there so it's useful
[20:06] spetrea: SubStack: you are in that visualization as well as pkrumins :)
[20:06] spetrea: SubStack: but you will see that Peteris has so many friends that thejit is not able to display them
[20:07] creationix has joined the channel
[20:07] spetrea: it's a depth 3 crawl
[20:07] spetrea: so not so many people are included ...
[20:07] creationix: TheEmpath: hey
[20:07] bradleymeck: spetrea i cant get those to do anything it seems
[20:07] jacobolu_ has joined the channel
[20:07] spetrea: bradleymeck: http://github.com/wsdookadr/github-spider/tree/master/Jit/
[20:08] spetrea: bradleymeck: get everything there
[20:08] spetrea: bradleymeck: it needs some files from thejit, that's why it wasn't working with the first link
[20:08] spetrea: bradleymeck: lemme know if i tworks
[20:09] bradleymeck: seems to work
[20:09] spetrea: bradleymeck: do you see stuff ?
[20:09] spetrea: bradleymeck: can you click on stuff ?
[20:09] spetrea: and see some more of it ?
[20:09] bradleymeck: yes, after 3 levels it hits 0 children for all
[20:09] bradleymeck: but it should
[20:11] spetrea: that's a bit weird, cuz I set the depth to 1 ..
[20:11] spetrea: nvm that
[20:16] Neura has joined the channel
[20:17] creationix: wow, the state of javascript docs is bad
[20:17] creationix: I can't find a single good example of the factory pattern on the web
[20:17] rauchg_ has joined the channel
[20:18] SubStack: pshaw, patterns
[20:18] eazyigz: I am getting EADDRINUSE address already in use error
[20:19] eazyigz: but when I run sockstat I don't see that port being used
[20:19] eazyigz: anybody seen this before?
[20:19] ginader has joined the channel
[20:22] benoitc has joined the channel
[20:28] AAA_awright: eazyigz: That's strictly possible iirc, coding sockets in pure C at least
[20:29] eazyigz: actually I figured out
[20:29] eazyigz: bitnami was running on port 80
[20:29] eazyigz: I removed the damn thing from startup scripts, and now node works
[20:30] eazyigz: this is the potential problem we face when using other people's ec2 AMI's
[20:34] aconbere has joined the channel
[20:34] mr_daniel: I just made a strace and it seems like Node.js searches for libraries in two places: ~/.node_libraries and GIT_DIR/lib
[20:34] mr_daniel: how can I tell Node.js also to look at ~/mystuff/node/npm/libs/ ?
[20:35] agnat: mr_daniel: try node --help
[20:35] mr_daniel: NODE_PATH, thanks agnat
[20:37] jchris has joined the channel
[20:40] jakehow has joined the channel
[20:40] jherdman has joined the channel
[20:42] dilvie has joined the channel
[20:43] sudoer has joined the channel
[20:48] dilvie: Is there a good user roles module for Node?
[20:54] Ori_P has joined the channel
[20:54] benoitc has joined the channel
[20:55] zomgbie has joined the channel
[20:56] bradleymeck: jimbastard had something a while back, idk if he published it
[20:57] eazyigz has joined the channel
[20:57] vandenoever has joined the channel
[20:57] JimBastard: i started to spec it out
[20:58] JimBastard: gonna be implementing it soon i hope
[20:58] JimBastard: needed relationships working in resourcer
[20:58] v8bot has joined the channel
[21:00] JimBastard_ has joined the channel
[21:02] bruse: v8: parseInt('128', 4)
[21:02] v8bot: bruse: 6
[21:02] bruse: v8: parseInt('128', 8)
[21:02] v8bot: bruse: 10
[21:02] Ori_P has joined the channel
[21:02] bruse: v8: parseInt('128', 16)
[21:02] v8bot: bruse: 296
[21:02] bruse: oh.
[21:03] herbySk: bruse: :-) what?
[21:05] bruse: never mind, i thought it would convert from base 10 to whatever base you entered, but it did the opposite
[21:06] Anti-X: yeah you specify which base the string is
[21:06] Anti-X: that's the point
[21:06] Anti-X: sort of
[21:06] eazyigz: when I type the command 'node' I get an error: bash: node command not found
[21:06] eazyigz: what gives??
[21:06] Anti-X: you need to make a symlink for node in your /bin folder
[21:07] eazyigz: I ran ./configure, make, and make install
[21:07] Anti-X: ur /usr/bin whatever
[21:07] herbySk: v8: (128).toString(16) //bruse
[21:07] v8bot: herbySk: "80"
[21:08] eazyigz: I cannot find node in the bin or sbin directory
[21:08] eazyigz: I just ran the make file and installed
[21:08] eazyigz: what the heck??
[21:09] Anti-X: yeah it doesn't make a command shortcut i tell you
[21:09] Anti-X: afaik
[21:09] gregerolsson has joined the channel
[21:09] eazyigz: but where is the command??
[21:09] eazyigz: it worked on my other linux distros
[21:10] eazyigz: its this amazon ami on ec2 that has this problem
[21:11] Anti-X: i found my node in ~/node
[21:11] herbySk: easyigz: /usr/local/bin or something like that
[21:11] herbySk: run make install again and look at the output
[21:12] Anti-X: oh yeah i have an exe in usr/local/bin (cygwin)
[21:12] Anti-X: that may be it
[21:12] bradleymeck: ACTION wishes there ways a way to reverse Object.keys
[21:12] SubStack: reverse?
[21:12] SubStack: don't rely on the order of that
[21:12] herbySk: ACTION does not understand
[21:13] SubStack: also Array has .reverse()
[21:14] SubStack: but the js spec says key order in objects is undefined
[21:14] bradleymeck: Object.keys generates an array, i wish i could take that array and use it as an iterator setting them onto an object, but i can write that
[21:14] themiddleman_ has joined the channel
[21:14] SubStack: an iterator?
[21:15] SubStack: sounds like too much java/c++ on the brain
[21:16] SubStack: just Object.keys(obj).forEach(/*...*/)
[21:16] Anti-X: yeah you sound sick
[21:16] bradleymeck: Object.fromKeys(Object.keys({x:1,y:1}),function(key){return 1}) would return {x:1,y:1}
[21:16] bradleymeck: bleh
[21:16] SubStack: the hell is fromKeys
[21:17] gregerolsson has left the channel
[21:17] SubStack: anyways, require('traverse/hash')
[21:17] Tim_Smart has joined the channel
[21:18] bradleymeck: fromKeys is what i was wishing for
[21:18] bradleymeck: that seems a bit overkill
[21:19] SubStack: then you can just Hash.map({ x : 1, y : 2 }, function (x) { return x + 100 })
[21:19] SubStack: which will return { x: 101, y: 102 }
[21:20] herbySk: creationix: http://www.herby.sk/js-classical.zip
[21:20] SubStack: also there's a zip in tere
[21:20] SubStack: *there
[21:20] bradleymeck: but i cant give it an array?
[21:20] SubStack: sure you can
[21:20] SubStack: node> Hash.zip(['a','b','c'], [1,2,3])
[21:20] SubStack: { a: 1, b: 2, c: 3 }
[21:20] creationix: herbySk: nice
[21:20] herbySk: creationix: this is what I meant by positioning hierarchy one under another ('types' (instances, prototypes, ...) are also one under another
[21:21] herbySk: but I don't know if it is better, too much text. But I feel striaght, mainly horizotal or vertical lines more readable
[21:21] SubStack: bradleymeck: or you could write a reduce without any libs like this:
[21:21] creationix: looks more umlish
[21:22] SubStack: node> ['a','b','c'].reduce(function (acc,x) { acc[x] = x.charCodeAt(0); return acc }, {})
[21:22] SubStack: { a: 97, b: 98, c: 99 }
[21:22] SubStack: but that is kinda verbose
[21:23] herbySk: creationix: :-/ well, ... at least you know what I meant - to show who is ancestor of who by visually stack them on top of one another
[21:23] creationix: herbySk: btw, I ended up inlining my primitives http://creationix.com:3000/object-graphs-2/classical.dot
[21:23] creationix: herbySk: yep
[21:25] creationix: herbySk: it would look a lot better if you could make your property lines come out of the property row in the record and then you wouldn't have to label the arrow
[21:25] creationix: perhaps
[21:25] herbySk: creationix: hm... well, they basically do, so I may remove lot of the role labels
[21:26] creationix: herbySk: though I guess it's just preference, I think the curved lines are easier to follow
[21:27] herbySk: creationix: what I would do in your example is 1. maybe override toString instead of getPerimeter, it makes more sense (rect 2(a+b) works well for the square); 2. for sqr and rect (dunno if possible) align 'width' and 'height' to the left, omit the = and align 4, 5 and 6 to the right.
[21:28] creationix: yeah, I can't align
[21:29] herbySk: creationix: maybe... maybe only thing I really lack is the more logical positioning (these are instance, there are traits (or, prototypes in js), this inherits from that thing above)
[21:29] peritus- has joined the channel
[21:29] 30BAAAOB8 has joined the channel
[21:29] creationix: herbySk: I'm still having a terrible time showing nested closures
[21:29] herbySk: (the hollow top is nice, btw; pity it can be there in the other arrows)
[21:30] bradleymeck: so what does a good roles module need?
[21:30] herbySk: creationix: :-) hmm. yes, it's hard...
[21:30] creationix: it's not defining a function that creates the closure in a sense, it's calling it
[21:30] creationix: because each call is a new closure
[21:30] herbySk: (maybe handdrawn and scanned is best solution ?)
[21:30] creationix: perhaps
[21:30] creationix: but graphviz is fun ;P
[21:31] herbySk: s/hollow top/hollow tip/
[21:31] creationix: I'm just not sure what I want it to look like
[21:31] creationix: oh I wish I had my whiteboard from texas
[21:32] creationix: herbySk: so here's the real challenge, draw this one http://creationix.com:3000/object-graphs-2/factory.js
[21:32] creationix: two factories and a constructor+prototype object
[21:32] herbySk: seems like interesting idea to learn svg and make nice online diagram tool based on node XD
[21:33] creationix: layout algorithms are hard
[21:33] creationix: unless you just mean manual positioning
[21:33] peritus-: Connect people around ?
[21:33] bradleymeck: layout algorithms with primm's algo and weights of box sizes!
[21:33] creationix: it's been my dream for years to make an online vector tool
[21:34] creationix: peritus-: perhaps
[21:34] tjholowaychuk: creationix: do you not work for sencha anymore? or just taking a break or something?
[21:34] peritus-: I have a basic question, why middleware stacking is linear and not like a tree
[21:34] peritus-: http://dpaste.de/G0sq/
[21:34] herbySk: creationix: what I learned from yuml and your pictures is, even if the layout is automatic, it must let you _somehow_ change the positioning
[21:34] peritus-: I want my require_user only to be evaluated if i'm in the private_stuff branch (i.e. not for every static file delivery)
[21:35] creationix: peritus-: you can specify sub-folders for things to be added
[21:35] creationix: check the use function
[21:35] creationix: oh, nevermind, you already did
[21:35] tjholowaychuk: peritus-: it is a bit of a fundemental flaw, you can kinda hack it with the "mounting" that we have
[21:35] tjholowaychuk: but its not ideal
[21:35] creationix: peritus-: just skip auth if the path starts with static
[21:35] herbySk: creationix: you can't dra such things (factory.js). There's the 7 +/- 2 rule. Only by splitting and putting into more diagrams.
[21:35] tjholowaychuk: peritus-: alternatively you can "mount" entire other connect stacks, which kinda works
[21:36] creationix: peritus-: serve your static stuff on a subdomain and then even cookies will be seperate
[21:36] admc__ has joined the channel
[21:36] admc_ has joined the channel
[21:36] admc has joined the channel
[21:36] creationix: look for the vhost middleware
[21:36] peritus-: yah, that's my production deployment solution, sure
[21:37] creationix: peritus-: it's not hard to do for development too
[21:37] brainfck` has joined the channel
[21:37] creationix: just modify your /etc/hosts file
[21:37] creationix: and have some environment variable to set the base domain
[21:38] creationix: herbySk: 7 +/- 2 hmmm
[21:38] creationix: I think it's small enough
[21:39] peritus-: .. and if i change the middleware order ? i want a real dispatch/route that executes a different stack of middleware depending on path ..
[21:40] deepthawt has joined the channel
[21:40] c4milo has joined the channel
[21:40] herbySk: creationix: yes, maybe it can stick in 9 pieces...
[21:40] herbySk: creationix: btw, isn't it MVP reather than MVC?
[21:40] herbySk: s/reath/rath/
[21:41] hannesw_ has joined the channel
[21:41] tjholowaychuk: peritus-: you can create a whole new connect.Server, but some middleware fuck up
[21:41] tjholowaychuk: that idea didnt go well
[21:41] c4milo: tjholowaychuk: !!!
[21:41] creationix: the connect middleware interface it great
[21:41] creationix: the connect dispacther is soso
[21:41] deepthawtz has joined the channel
[21:41] creationix: good thing they can be used seperately
[21:41] tjholowaychuk: could be better still
[21:41] creationix: herbySk: https://gist.github.com/c9af2b63a24ba11f85fd
[21:42] peritus-: creationix: so i want to use expressjs' route middleware ?
[21:42] creationix: herbySk: how about that one
[21:42] tjholowaychuk: app mounting is a fail
[21:42] peritus-: *sigh* .. i'll do some more research. thanks.
[21:42] tjholowaychuk: peritus-: connect's "router" is the one powering Express
[21:42] tjholowaychuk: peritus-: and express is built on connect.. so if you want any of that you misewell use Express it has little to no overhead
[21:42] peritus-: tjholowaychuk: looks about the same
[21:43] creationix: herbySk: the return value is the baz() function, and it has a and b in it's closure
[21:43] creationix: not sure how to draw that though
[21:44] creationix: peritus-: just put an if statement ignoring the /static urls
[21:44] creationix: I don't think there is an ideal solution for every use case
[21:44] creationix: real software is ugly
[21:44] creationix: by definition, it's all different
[21:44] creationix: otherwise you wouldn't be writing it
[21:45] herbySk: creationix: that should be easy, - - <> - -> arrow
[21:46] peritus-: creationix: sure. i think i'll try to model it after the example in http://expressjs.com/guide.html#Route-Middleware ..
[21:46] creationix: peritus-: cool
[21:47] creationix: herbySk: hmm, not sure I follow
[21:47] tjholowaychuk: peritus-: the route middleware thing is Express specific
[21:47] herbySk: creationix: I understand, you have problems how to visualize closure and it's bindings
[21:47] tjholowaychuk: hense just use express lol its not slower, and its not big
[21:47] creationix: herbySk: yeah, it's easy to see, when you're looking at the code
[21:48] creationix: it's based on the physical location within the code
[21:48] creationix: but there are layers
[21:48] creationix: each function call creates a new scope
[21:48] tjholowaychuk: creationix: just take a sample closure, and highlight the scopes
[21:48] tjholowaychuk: and raw the lookup
[21:48] herbySk: creationix: hm, let me think
[21:48] tjholowaychuk: i think that would explain it best
[21:48] tjholowaychuk: IMO
[21:48] creationix: tjholowaychuk: so how would you draw https://gist.github.com/c9af2b63a24ba11f85fd
[21:48] tjholowaychuk: maybe do the same with C to show the difference between function / block scope
[21:49] tjholowaychuk: just take it into photoshop and highlight the scopes
[21:49] creationix: tjholowaychuk: oh, use the code as the diagram?
[21:49] tjholowaychuk: yeah
[21:49] creationix: I'm wanting to diagram the data structures that result from the code
[21:49] creationix: not the code itself
[21:49] tjholowaychuk: why, the code explains it best
[21:49] tjholowaychuk: if annotated
[21:49] creationix: it doesn't explain some things well
[21:50] creationix: besides, that defeats the purpose of the exercise
[21:50] creationix: I'm trying to not use code to explain code
[21:50] creationix: but diagrams instead
[21:50] tjholowaychuk: lol
[21:50] tjholowaychuk: ok
[21:50] creationix: but yeah, closures are a lot easier when you can see the code
[21:51] unomi: ajpiano: http://everything2.com/user/Professor%20Pi/writeups/Why%20time%20appears%20to%20speed%20up%20with%20age nice read, thanks :)
[21:53] creationix: ok, so a function has 5 parts (nested scopes, name, parameters, executable code, properties)
[21:53] rnewson has joined the channel
[21:53] rnewson has joined the channel
[21:53] creationix: and two functions can share the exact same nested scopes
[21:53] creationix: since they haven't been run yet, their own unique scope doesn't exists yet
[21:53] creationix: hmm
[21:54] creationix: objects are simple in comparison, they only have one thing,properties
[21:54] Blackguard has joined the channel
[21:56] creationix: I wish I had the time and resources to animate the transitions in state as a program ran
[21:56] creationix: that would awesome
[21:57] bradleymeck: js in js, gogogo
[21:58] creationix: I don't think this is something that can be automated
[21:59] inimino: creationix ⋱ Hm, I've been thinking about doing some debugging stuff, this might be somewhat related I guess.
[21:59] bradleymeck: anything can be automated with enough time and money
[21:59] eazyigz has joined the channel
[21:59] Anti-X: speaking of debugging... sleep time
[22:00] bradleymeck: wait a tic
[22:00] bradleymeck: could we do it using the v8 debugger api?
[22:03] altamic has joined the channel
[22:03] jchris has joined the channel
[22:03] bradleymeck: creationix, what did you need it to do, basically just a closure dump per function and the global space? on a line by line basis?
[22:04] dilvie: JimBastard: You around? I want to check out your user roles module. I need to adopt a solution for a funded app in active development. Will be happy to contribute to your project.
[22:04] creationix: bradleymeck: possibly
[22:13] jherdman has joined the channel
[22:14] mikeal: ok
[22:14] mikeal: i've got a crazy string encoding/escaping issue
[22:14] bradleymeck: aaah
[22:14] mikeal: Ordoñez
[22:14] dal9k has joined the channel
[22:14] mikeal: when you run this through the url encoder in Python you get
[22:15] mikeal: Ordo%5Cu00F1ez
[22:15] mikeal: but in node.js you get Ordo%C3%B1ez
[22:15] mikeal: the crazy thing is that in the browser
[22:15] mikeal: escape() gives you the first one that you get in Python
[22:15] dal9k has joined the channel
[22:15] mikeal: but encodeURIComponent gives you the one that node does
[22:15] mikeal: wtf!
[22:17] bradleymeck: i get "Ordo%F1ez" in browser
[22:19] bradleymeck: to the unicode chart!
[22:19] mikeal: in Chrome i get that for escape but not for encodeURIComponent
[22:20] eazyigz has joined the channel
[22:21] digitalspaghetti: what are the main differences between palm's nodejs fork, and the main repo version then?
[22:21] Tim_Smart: v8: encodeURI('Ordoñez')
[22:21] v8bot: Tim_Smart: "Ordo%C3%B1ez"
[22:22] kschzt has joined the channel
[22:22] Tim_Smart: v8: encodeURIComponent('Ordoñez')
[22:22] v8bot: Tim_Smart: "Ordo%C3%B1ez"
[22:22] c4milo has left the channel
[22:24] bradleymeck: oh i see whats going on
[22:24] bradleymeck: escape/python is using extended ascii, node/encode is using utf8
[22:25] bradleymeck: mikeal does that make sense to you?
[22:25] mikeal: yeah, the issue is that when Twisted gets this string is explodes
[22:25] bradleymeck: is there a way to decode it as a Unicode object?
[22:26] benburkert has joined the channel
[22:26] bradleymeck: ACTION doesnt know twisted
[22:26] gerred has joined the channel
[22:26] mAritz has joined the channel
[22:26] mAritz1 has joined the channel
[22:32] boaz has joined the channel
[22:32] radiofreejohn has joined the channel
[22:33] mikeal: python has this, yes
[22:33] mikeal: but Twitsted is all retarded
[22:35] benburke_ has joined the channel
[22:35] bradleymeck: i work a lot in python, i just dont know how much control twisted gives you
[22:36] overra has joined the channel
[22:38] pengwynn has joined the channel
[22:40] reid has joined the channel
[22:40] benburkert has joined the channel
[22:41] jherdman has joined the channel
[22:41] benburk__ has joined the channel
[22:44] rwaldron_ has joined the channel
[22:45] kschzt: twisted is retarded compared to node, very true :)
[22:46] bartt1 has joined the channel
[22:46] pufuwozu has joined the channel
[22:46] digitalspaghetti: i'm starting to hate python a little since i've started using node
[22:46] digitalspaghetti: and PHP is dead to me
[22:47] Tim_Smart: python is still a nice language...
[22:48] reuss has joined the channel
[22:48] digitalspaghetti: oh yea, python has it's uses - it's great for deamons
[22:49] digitalspaghetti: and Django has it's uses for content-driven websites like large news sites, but not so great for complex apps
[22:49] digitalspaghetti: where you need to fight against django
[22:50] Nohryb has joined the channel
[22:50] kjy112 has joined the channel
[22:50] Tim_Smart: Heh, gotta give this a go http://github.com/ncb000gt/node-gtk
[22:50] digitalspaghetti: AHH HA!
[22:50] SubStack: python sucks for my haskell-addled sense of functional control flow
[22:51] digitalspaghetti: i was looking at doing something desktop based with node
[22:51] digitalspaghetti: Since my app is written with ExtJS as the frontend, and uses couchdb as the backend, node is actually a perfect fit
[22:52] digitalspaghetti: because i just pass JSON to node, and save it as a doc
[22:52] digitalspaghetti: then fetch the doc and it's in the correct format for my app
[22:52] mr_daniel has joined the channel
[22:53] AAA_awright: No. python is never useful. I call it the python usefulness theory.
[22:54] digitalspaghetti: AAA_awright: yea, the stuff i have written in python i could probably re-write in less code and faster with node :D
[22:54] AAA_awright: If you are using python it's not because it's the best choice of language to get the job done, it's because some other idiot wrote their library or application (here's looking at you, Blender) python-only.
[22:58] herbySk has joined the channel
[22:58] herbySk: creationix: http://www.herby.sk/closures.zip
[22:58] DrunkDwarf has joined the channel
[22:59] creationix: herbySk: interesting
[22:59] creationix: I hadn't thought of showing the scopes as objects
[23:00] creationix: that just might work!
[23:00] mr_daniel: Did anyone try socket.io? I just installed it with npm and copy+pasted the example code to create an server: http://nopaste.info/04761d70f9.html
[23:00] banjiewen has joined the channel
[23:00] mr_daniel: but instead of listening on incoming client request, the script immediately exists
[23:01] herbySk: creatonix: good ol' smalltalk school. there everything is an object (stack frame, too)
[23:01] mr_daniel: Also weird: in the snippet code no listening port is set. Is the code snippet on the main site of socket.io wrong?
[23:02] rex_fernando has joined the channel
[23:03] creationix: herbySk: so what is the proper word for the nested closures?
[23:03] creationix: are they contexts or scopes?
[23:04] Tim_Smart: digitalspaghetti: Seems those bindings are really buggy.
[23:04] randy_ has joined the channel
[23:04] Tim_Smart: Had to change a few things to get it to compile as well.
[23:04] herbySk: creationix: well, my feeling says context is nearer than scope. Context is more a dynamic thing and scope is more a static one to my ears.
[23:05] creationix: so node has this feature to load each module in it's own "context"
[23:05] herbySk: but, closure is proably the word to be used :-)
[23:05] creationix: that mean they have their own copy of all the globals
[23:05] creationix: *means
[23:05] javajunky has joined the channel
[23:05] creationix: well, closure is when you have access to the variables in your outer scopes/contexts, no matter where you're called from
[23:05] creationix: you "close over" the free variables
[23:06] shaver: in JS you have some dynamic scope
[23:06] shaver: it's a bit of a confusing mess
[23:06] creationix: I often think of "this" as the scope
[23:06] creationix: not sure
[23:06] creationix: I should read what I said in my what-is-this article
[23:06] shaver: no, in JS |this| is never on the scope chain
[23:06] shaver: scope is how you look up free variables
[23:07] herbySk: creationix: :-)
[23:07] creationix: hmm, then I calles the free variables from the closure as coming from scopes
[23:07] creationix: and "this" as a context
[23:07] creationix: this is all terribly confusing
[23:08] herbySk: creationix: well, I'd see a stack frame as a context, and it contains loca variables, this and pointer to outer context if it exists
[23:08] Tim_Smart: digitalspaghetti: brainfucker's version is a lot better.
[23:08] Tim_Smart: Coding a GUI in node is pretty awesome.
[23:08] herbySk: (strange, I never use the scope word)
[23:09] digitalspaghetti: oh, even though this version is an up to date fork? has ncb000gt fooked it up?
[23:09] Tim_Smart: Yeah, he hasn't added too much though.
[23:09] Tim_Smart: If I have time, I might slowly build out the bindings.
[23:09] creationix: so there are three ways to access data in JavaScript, the freevariables you can see from the closure, the properties on an objects (and it's inheritance chain) and whatever is in "this" from your latest functions
[23:10] creationix: Tim_Smart: what was it a binding for? gtk?
[23:10] Tim_Smart: Yeah
[23:10] creationix: how does that run on osx?
[23:10] herbySk: creationix: You forgot parameters and local vars. And 'this' is just pre-defined arg (or local var). You can see it as that.
[23:10] creationix: right, parameters
[23:10] Tim_Smart: creationix: It doesn't. Unless you have gtk installed.
[23:10] Tim_Smart: + devel headers.
[23:11] creationix: well, local vars are the same at other free variables from the closure
[23:11] creationix: and I used to call "this" a special local variable, but got a lot of complaints about that
[23:11] herbySk: creationix: Parameters are sorta local vars, too, and 'this' as well.
[23:11] creationix: Tim_Smart: hmm, so I'm guessing nobody has tried yet (with node that is)
[23:11] herbySk: creationix: except 'this' is defined in each call to each function
[23:12] herbySk: (so you cannot see outer 'this', because it is shadowed by your actual one)
[23:13] Tim_Smart: creationix: http://dl.dropbox.com/u/396394/screenshots/node%2Bgtk.png
[23:13] creationix: Tim_Smart: nice
[23:14] creationix: I'd love something like that, but for cocoa
[23:14] creationix: using a hotcocoa style api
[23:14] digitalspaghetti: Tim_Smart: you should write a blog on doing this :D
[23:14] creationix: that would make for some nice native osx apps
[23:14] davidascher has joined the channel
[23:14] creationix: it's easy to embed the node runtime in an osx app
[23:14] Tim_Smart: creationix: Does Cocoa have a C++ api?
[23:14] ysynopsis has joined the channel
[23:14] creationix: sortof
[23:15] creationix: carbon is c++
[23:15] creationix: and I think there are ways to bridge cocoa to c++
[23:16] Tim_Smart: Hmm I think there is a memory leak...
[23:16] Tim_Smart: Could be gtk though.
[23:16] lgl has joined the channel
[23:19] MikhX has joined the channel
[23:19] aurynn: ObjC++ exists. Mixing C++ and ObjC in the same source.
[23:19] herbySk: creationix: showing contexts as object may also help you to explain memory issues of closures, the fact that they carry the context with them and so the contexts must be alive and can only be collected when no one needs them any more.
[23:20] creationix: herbySk: good point
[23:20] creationix: I think they're thought of as objects in V8 world anyway
[23:21] creationix: aurynn: do you have enough skills/time to work on that?
[23:21] creationix: I wish I did
[23:21] aurynn: creationix, I only know you *can*. I don't know C++ and I only have a little bit of C and ObjC
[23:22] tjholowaychuk: creationix: checked out the souce. "arguments" and others are special cases, unless some languages (IO) that push a scope
[23:22] creationix: tjholowaychuk: yeah, I don't think you can do "var this = foo"
[23:22] tjholowaychuk: no
[23:22] creationix: and I know the actual arguments are special
[23:23] creationix: they are immune to var housting
[23:23] creationix: *hoisting
[23:23] tjholowaychuk: interestingly most of the lookup logic is in the parser
[23:23] eazyigz has joined the channel
[23:24] tjholowaychuk: well not most but a lot
[23:25] creationix: makes sense
[23:27] creationix: interesting "…This means that you can write pure C code that interacts with Objective-C objects. It also allows you to bypass some of the dynamic behavior at times when it's not needed."
[23:27] creationix: skipping C++ sounds like fun
[23:27] creationix: just enough to bind to V8
[23:27] hellp has joined the channel
[23:31] TheEmpath: event listeners queues in node.js... any examples?
[23:31] creationix: TheEmpath: EventEmitter ?
[23:31] TheEmpath: i shall review!
[23:31] creationix: it's builtin
[23:31] creationix: see the API docs
[23:32] dilvie: creationix: I've been thinking of closures as objects recently, to the extent that I've almost entirely purged "new" from my javascript vocab.
[23:32] creationix: aurynn: I've got it, macjavascript!
[23:32] creationix: dilvie: nice
[23:33] creationix: JavaScript and Ruby Semantics are strangely close once you get to the low level stuff
[23:33] creationix: and if they can implement ruby on the objective-c runtime, why can't a subset of javascript be implemented there too
[23:33] creationix: and then you can have the objective-c powered javascript for your front-end and a node server as your backend
[23:33] creationix: and they talk over http or some other ipc
[23:34] creationix: native mac apps with no ugly hacks
[23:35] creationix: really that's the only thing that will leverage the strengths of both node and cocoa
[23:35] deepthawt has joined the channel
[23:36] aurynn: Javascript crossed with Cocoa..
[23:36] steadicat has joined the channel
[23:36] aurynn: Call it Lattescript.
[23:36] sprout has joined the channel
[23:36] aurynn: :)
[23:37] creationix: aurynn: have you seen macruby?
[23:37] creationix: it's amazing
[23:37] aurynn: I've heard it's really good
[23:37] Eber has joined the channel
[23:37] aurynn: And the python bindings
[23:37] creationix: a completely new ruby runtime nativly on macruby's runtime
[23:37] dilvie: Aren't CommonJS modules basically the same as wrapping your code in an anonymous self executing function and creating a closure for it?
[23:37] creationix: dilvie: pretty much
[23:37] creationix: with a few extras like module and require
[23:39] creationix: wow, where has my day gone? see you all later, I've got some serious slides to finish before tomorrow.
[23:39] dilvie: bye. =)
[23:41] aurynn: Having a new laptop makes hacking SO MUCH NICER.
[23:41] saikat_ has joined the channel
[23:42] timmywil has joined the channel
[23:43] radiofreejohn has left the channel
[23:44] ph^ has joined the channel
[23:48] dnolen has joined the channel
[23:49] charly1 has joined the channel
[23:49] salieri has joined the channel
[23:51] TheEmpath: instead of object delegation and linked reference between the class, i can just plop event listeners all over the place between modules in different files to communicate between them, cant i?
[23:52] benbro has joined the channel
[23:53] Me1000 has joined the channel
[23:54] aurynn: Yes
[23:54] aurynn: Thoubh that can be spaghetti really quickly.
[23:55] jacobolus has joined the channel
[23:58] TheEmpath: im parsing up the listeners to be in organized files
[23:58] TheEmpath: with a map routing requests