[00:01] Nuck: I love how Mongo's docs list "Problems requiring SQL." as a case it's less suited for. [00:03] jhbot has joined the channel [00:10] MikhX has joined the channel [00:10] jhurliman: can anyone give me pointers on how to capture and handle "socket hang up" errors in my app? i'm fetching some webpages with a node app and i sometimes get these uncaught exceptions: https://gist.github.com/1102022 [00:11] jhurliman: but looking at that stack trace, i have no idea where in my code i should be inserting a try/catch [00:11] TheJH: !git context joyent/node src/http.js 1545 [00:11] jhbot: error, showBlob() failed [00:12] TheJH: !git context joyent/node lib/http.js 1545 [00:12] jhbot: 1544 [00:12] MikhX has left the channel [00:12] jhbot: 1545 self._state = 'connected'; [00:12] jhbot: 1546 [00:12] TheJH: jhurliman, could you gist your code? [00:12] jhurliman: TheJH, unfortunately it's a large codebase that i haven't been able to boil down to a small repro yet. i'm using the request library [00:13] TheJH: jhurliman, which node version are you using? [00:13] jhurliman: right now i'm mostly curious on how to interpret that stack trace. all of the files/methods in the stack trace are internal to node, suggesting that there is no way to catch that error? [00:13] jhurliman: 0.4.9 [00:14] Sorella_ has joined the channel [00:14] TheJH: jhurliman, you can catch the error by adding an error handler to a request or so [00:14] jhurliman: ahh, right [00:15] jhurliman: thank you. i must be making an http request somewhere without attaching an error handler, so it falls back to throwing an exception [00:15] TheJH: jhurliman, yes. but I think that mikeals request does that for you [00:15] clockwize: should I connect to mongodb, then start a web server and use it in requests or open a connection per request? [00:16] TheJH: jhurliman, at least if you always give it a callback [00:16] jhurliman: i wish that branch of node that could show stack traces across async callbacks was functional [00:16] TheJH: jhurliman, yes, that would be cool [00:17] jhurliman: right now all of the errors i get from node have a stack trace of two or three lines showing internal node code. "something went wrong somewhere in your 20,000 lines of code. go find it!" [00:17] tomtomaso has joined the channel [00:17] plainas: is tehre any way to run a simple json datastore on node in the same fashion as couchdb (for example) [00:22] meso_ has joined the channel [00:22] tantek has joined the channel [00:23] TheJH: plainas, a simple in-memory key-value store? [00:24] caiges has joined the channel [00:24] jhurliman: looks like there have been a lot of improvements to the request library very recently though, i should upgrade [00:25] plainas: well... I would need to save the data externaly in some way [00:25] zackattack has joined the channel [00:25] TheJH: plainas, why don't you take a couchdb then? [00:27] plainas: I might, just asking if node has similar capabilities, I guess the answer to your question is: for neatness/tidyness reasons [00:28] TheJH: plainas, I don't think that there's a JS-only persistent storage for node [00:28] [[zz]] has joined the channel [00:29] mscdex: there is [00:29] mscdex: at least a few [00:30] mscdex: kv stores [00:30] rhdoenges has joined the channel [00:31] TheJH: mscdex, persistent ones? [00:31] mscdex: sure [00:31] mnaser: redis with node? [00:33] mscdex: nstore is one of them that i can think of off the top of my head [00:33] mscdex: you might find others on the wiki modules page or on npm [00:34] TheJH: !npm search persistant [00:34] jhbot: no results [00:34] xerox: red is does persistence on disk indeed [00:34] mscdex: !npm search nstore [00:34] jhbot: no results [00:34] mscdex: ha [00:34] TheJH: hmm... [00:34] mscdex: nstore is on npm though [00:35] escii: http://mrdoob.com/projects/multiuserpad/ does anyone know if the server code of this project is open, or someone already did clone it? [00:36] jhbot has joined the channel [00:36] TheJH: !npm search nstore [00:36] jhbot: package keys: Unified api for node key/value stores [00:36] jhbot: package nstore-query: Query Addon for nStore [00:36] jhbot: package nstore-cache: Cache addon for nStore [00:36] jhbot: package nstore: nStore is a simple, in-process key/value database for node.js. [00:36] TheJH: weird... [00:36] mscdex: :) [00:36] Xeon06_ has joined the channel [00:39] rhdoenges: !npm search persistent [00:39] jhbot: no results [00:39] mnaser: !npm search redis [00:39] jhbot: packages (short format, truncated): redis-client, connect-session-redis-store, express-session-redis, keys, rapid, redisql, node-redis-mapper, redis-session-store, redis-queue, redis-node, resque, n-pubsub, ron, node-redis-monitor, mmmodel, backbone-redis, redis_objects, redisify, nedis, cluster-log [00:40] skm has joined the channel [00:40] TheJH: aaaah, now I know why it didn't find anything earlier. after 5 minutes, it won't work anymore [00:40] cpetzold has joined the channel [00:40] TheJH: fixing... [00:40] towski has joined the channel [00:41] mnaser: funny bug [00:41] mnaser: :p [00:41] clockwize: omg.. daughters baby monitor just started beeping...normally wouldn't worry and go and check but she's sick and coughing/breathing raspy so I legged it up the stairs faster than I've ever moved [00:41] clockwize: but she'd just squished herself in to the corner of the bed where the motion pad thing doesn't pick up [00:42] jhbot has joined the channel [00:42] TheJH_ has joined the channel [00:42] TheJH_ has joined the channel [00:43] plainas: nstore looks beautifully simple :) I like it [00:44] TheJH: mnaser, I have a cache of all npm data. cache freshness time is 5 minutes after fetching it. when it isn't fresh anymore, I fetch the updates of the npm database. guess what I saved as the whole db :/ [00:44] plainas: clockwize, I have am looking for a monitor for my baby daugther too :) Sorry the OT all [00:44] clockwize: yeah. sorry for OT :) my heart rate still hasn't slowed though :p [00:45] clockwize: plainas: http://www.amazon.co.uk/dp/B0013FW5G8/ref=asc_df_B0013FW5G83728270?smid=A3P5ROKL5A1OLE&tag=googlecouk06-21&linkCode=asn&creative=22206&creativeASIN=B0013FW5G8 < this is what I have [00:45] amerine has joined the channel [00:45] mnaser: the updates only aka 1-2 packages, TheJH? :p [00:45] jhbot has joined the channel [00:45] chrisdico has joined the channel [00:46] TheJH: mnaser, that's probably the upper limit, usually 0 [00:46] mrtrosen_ has joined the channel [00:47] ysynopsi1 has joined the channel [00:47] metellus_ has joined the channel [00:47] tmzt_ has joined the channel [00:47] topaxi_ has joined the channel [00:47] rhdoenges has joined the channel [00:47] rook2pawn has joined the channel [00:47] [tm]_ has joined the channel [00:48] bradleymeck has joined the channel [00:48] mrkurt_ has joined the channel [00:48] tjholowaychuk has joined the channel [00:49] plainas: clockwize,interesting... I thought video was the most high-tech out there and I was thinking of building my own with asorted electronics. [00:50] xerox_ has joined the channel [00:50] mscdex_ has joined the channel [00:51] orospakr` has joined the channel [00:52] mnaser has joined the channel [00:52] mnaser: http://pastie.org/2261562 -- I find this code bad.. I know it could be cleaner, I have a lot of the "error != null" checks .. how would I refactor, i'm getting frustrated writing this code because I know it's not good [00:52] jhbot has joined the channel [00:53] kaww: !npm search redis [00:53] jhbot: packages (short format, truncated): redis-client, connect-session-redis-store, express-session-redis, jobs, keys, rapid, redisql, node-redis-mapper, redis-session-store, redis-queue, redis-node, resque, n-pubsub, ron, node-redis-monitor, mmmodel, shorten, backbone-redis, redis_objects, redisify [00:54] TheJH: mnaser, https://gist.github.com/7e2e8a8e6b4650653ac2 [00:55] TheJH: mnaser, better that way? [00:55] rachelderp has joined the channel [00:55] mscdex_: mnaser: just use if error [00:55] mscdex_: it's a little shorter :p [00:55] mnaser: yeah, that looks a lot cleaner and nicer, more tolerable [00:56] TheJH: mscdex_, one char less [00:56] mscdex: one char? [00:56] TheJH: mscdex, "error?" vs "error" [00:56] mnaser: I like the error? because I do tons of RoR dev [00:57] mscdex: is that how you do that in coffeescript or something, with the question mark if you have no comparison operator? [00:57] sylvinus has joined the channel [00:57] TheJH: !@mscdex coffee compile error? [00:57] jhbot: mscdex, typeof error !== "undefined" && error !== null; [00:58] mscdex: eh? [00:58] TheJH: mscdex, it also checks whether "error" even exists [00:58] mscdex: i don't use coffeescript, so i have no clue [00:58] rachelderp: Are there any examples of node servers/clients using diffie hellman crypto? [00:59] mnaser: mscdex what jhbot outputted is the JS equivilant or writing "error?" [00:59] hippich has joined the channel [00:59] hippich has joined the channel [00:59] mnaser: !npm search diffie [00:59] jhbot: no results [00:59] mscdex: ah [00:59] jamescarr has joined the channel [01:00] rachelderp: mnaser: diffie hellman functions are included in node's crypto api [01:00] rachelderp: http://nodejs.org/docs/v0.5.1/api/crypto.html [01:00] rachelderp: but I'd like to find an example to work with [01:00] mnaser: ahhh i see [01:01] Wizek has joined the channel [01:01] mscdex: rachelderp: well, you could always send a message to the committer of that functionality [01:02] mscdex: rachelderp: https://github.com/havard [01:02] mscdex: rachelderp: i think he uses it in node-openid [01:02] vipaca has joined the channel [01:02] vipaca has joined the channel [01:02] rachelderp: Thanks for the tip [01:02] stracK has joined the channel [01:03] L_star has joined the channel [01:03] Somepersson has joined the channel [01:04] silenex has joined the channel [01:04] xerox_: what's a reliable way to send emails from a node program [01:04] xerox_: that doesn't require one to install sendmail x_x [01:04] guydoingstuff1 has joined the channel [01:04] TheJH: !npm search smtp [01:04] jhbot: packages (short format): simplesmtp, node_hash, mailer-fixed, smtpclient, smtpc, mail, smtp, mailer, emailjs, kyatchi, Haraka [01:06] xerox: so you suggest raw to an smtp [01:06] rhdoenges: smtp's what sendmail uses [01:06] mscdex: those aren't all smtp clients though [01:07] TheJH: xerox, maybe this one: emailjs: send text/html emails and attachments from node.js to any smtp server [01:07] TheJH: if you want high-level [01:07] rhdoenges: ooh [01:07] rhdoenges: that is probably what you want [01:07] mscdex: xerox: i'd suggest node-mail or emailjs [01:08] mscdex: er i guess it's just "mail" for node-mail in npm [01:08] xerox: ACTION looks ! [01:09] jerrysv has joined the channel [01:10] AndyDawson has joined the channel [01:10] b_erb has left the channel [01:11] kaww: !npm search mysql [01:11] jhbot: packages (short format): noblerecord, mysql, mysql-libmysqlclient, mysql-client, orm, mysql-pool, mysql-oil, node-dbi, mysql-helper, mysql-native-prerelease, sequelize, autodafe, mysql-native, moose, oursql, db-mysql, mysql-simple, connect-mysql-session [01:11] TheJH: kaww, tip: if you do it in query, it will display up to 20 in long format (with description) [01:12] hybsch has joined the channel [01:12] chapel: !npm search gist [01:12] jhbot: packages (short format): ngist, massagist, gist, redis-completer, hanging_gardens_registry, node-gist, gista [01:13] tmzt_: !npm search handler [01:13] jhbot: packages (short format): mongrel2, xmpp-muc, connect-assetmanager-handlers, node-handlersocket, vhost, jus-config, json-line-protocol, stream-handler, node-proxy, m2node, combohandler, groundcrew, contracts, addTimeout [01:13] tmzt_: !npm info node-handlersocket [01:13] jacobolus has joined the channel [01:13] rachelderp: mscdex: Looked at the source for node-openid, but it doesn't seem to use the crypto diffie hellman functions [01:14] rachelderp: https://github.com/havard/node-openid/blob/master/openid.js [01:14] TheJH: tmzt_, no npm info, only npm owner [01:14] kaww: TheJH: cool [01:14] bradwright has joined the channel [01:14] bradwright has joined the channel [01:15] chapel: !npm search geo [01:15] jhbot: packages (short format): geohash, geoutils, node-geocode, simplegeo, geo, simplegeo-thrift, geonode, simplegeo-client, modestmaps, connect-geoip, ngeohash, geo-distance, pigeons, maptail, geocoder, geoip [01:16] ajsie has joined the channel [01:16] mnaser: i know this is sily and kinda JS related, but how can I call a function within the same module? calling it with no prefix or with this. -- both fail [01:16] mscdex: rachelderp: ah ok, i guess he hasn't gotten around to converting his code to use it then, i was just going based on a blog post he wrote: http://ox.no/posts/diffie-hellman-support-in-node-js [01:17] mnaser: http://pastie.org/2261638 [01:17] tmzt_: chapel: can I get a github url for a package [01:17] chapel: ? [01:17] tmzt_: with jhbot [01:17] mscdex: lol [01:18] mscdex: tmzt_: jhbot is TheJH's creation iirc [01:18] TheJH: tmzt_, no :) [01:18] TheJH: !remember git-search https://github.com/search?q=$&type=Everything&repo=&langOverride=&start_value=1 [01:18] jhbot: saved definition of 'git-search' [01:19] TheJH: !@tmzt_ mem git-search npm [01:19] jhbot: tmzt_, https://github.com/search?q=npm&type=Everything&repo=&langOverride=&start_value=1 [01:19] jhurliman: TheJH, following up from earlier, i updated to the latest version of request (2.0.1) and those crashes went away [01:19] FireFly|n900: !mem git-search foo bar [01:19] jhbot: https://github.com/search?q=foo&type=Everything&repo=&langOverride=&start_value=1 [01:19] mscdex: mnaser: as long as it has a name it should be fine, i dunno if cs does any magic or not though [01:19] TheJH: tmzt_, not exactly a module search, but... [01:20] TheJH: jhurliman, good [01:20] chapel: heh tmzt_ [01:20] chapel: :P [01:20] mnaser: mscdex: coffee-scrript translates it to this http://pastie.org/2261652 [01:21] mscdex: oh, it's part of an object [01:21] mnaser: yeah [01:21] TheJH: mnaser, nameOfTheObject.create_target or so [01:22] mnaser: yes but my problem is that, create_target needs iqn_name [01:22] mnaser: and i cant figure how to properly call another method [01:22] TheJH: mnaser, call nameOfTheObject.iqn_name in create_target [01:23] stracK has joined the channel [01:23] mnaser: but then that would mean i'd have to call the object with the intiial arguments in order to have that done [01:24] mnaser: i feel like i'm really off in this. what i want is an object that i create with initial values, then i can manipulate it, where it has internal/external functions [01:24] TheJH: mnaser, I don't quite understand you, but do you realize that the functions will only be called after the obejct is complete in your example? [01:24] luke` has joined the channel [01:24] TheJH: *object [01:25] mscdex: mnaser: like a class or what? [01:25] mnaser: i want to make my object a "model" [01:25] TheJH: mnaser, coffeescript also has classes [01:25] mnaser: i create it once using initial variables, and then it has methods and attributes [01:25] Nuck: mnaser: prototype. [01:26] Nuck: USe dem. [01:26] mscdex: yeah [01:26] luke`_ has joined the channel [01:26] mnaser: actually i just saw the coffeescript classes [01:26] TheJH: mnaser, dou you want multiple instances of a class, class methods and instance properties? [01:27] mnaser: exactly what I want, TheJH. [01:27] TheJH: mnaser, ah, ok [01:27] mnaser: classes are perfect [01:27] tayy has joined the channel [01:28] mscdex: function Foo() { this.instanceFn = function(){}; } Foo.prototype.classFn1 = function() { this.classFn2(); }; Foo.prototype.classFn2 = function() {}; [01:28] mscdex: something like that [01:28] FireFly|n900: coffeescript classes are just a thin wrapper over the prototype OOP model in JS though. If you'd like to know how it actually works I suggest learning about JS OOP as well [01:28] mnaser: i've done tons of ruby/python oop but javascript seems pretty differnet.. [01:29] mscdex: you can pass in instance specific values into the constructor and save them as instance variables [01:29] Nuck: Yeah, prototypes aren't classes lol [01:29] mscdex: Nuck: we know, but it gives a similar effect [01:30] mscdex: i stopped quoting the term long ago ;-) [01:30] FireFly|n900: mnaser, yeah, most languages utilise classical OOP [01:31] FireFly|n900: JavaScript is one of a few prototypical languages [01:31] FireFly|n900: I suggest reading eloquentjavascript.com btw, I think there's a chapter on how OOP works in JS [01:32] mnaser: will do so [01:32] jtsnow has joined the channel [01:34] polotek has joined the channel [01:36] guest_097 has joined the channel [01:37] TheFuzzball has joined the channel [01:37] mscdex: there's also: https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide [01:37] polotek: Is there any documentation for require.extensions? [01:37] Nuck: FireFly|n900: The domain is dead, by the looks of it [01:38] polotek: I expected it in the Module docs, but no good [01:38] TheJH: good night, guys [01:38] markbao_ has joined the channel [01:38] TheJH: or whatever it is in your timezone [01:38] booo has joined the channel [01:40] Remoun has joined the channel [01:40] markbao_: mongodb native driver: how should I store an ObjectId that I got back from a row? [01:40] mscdex: polotek: not that i can see, except the examples here: https://github.com/joyent/node/blob/master/lib/module.js#L456 [01:40] markbao_: currently, I'm getting: http://winning.markbao.com/8h0Z [01:40] vikstrous has joined the channel [01:41] Nuck: markbao_: store it? [01:41] Xeon06_ has joined the channel [01:41] markbao_: Nuck: well, to be most efficient, I should be storing it as an ObjectId, right? [01:42] markbao_: I'm not sure if that's what it is doing here [01:42] Nuck: markbao_: It should be stored for you :confused: [01:42] Nuck: ACTION uses deviantART emotes, just ignore them :P [01:42] markbao_: sorry - I'm not being clear [01:42] markbao_: so I'm pulling down an ObjectId from a previous query [01:42] markbao_: and storing it inside another document as a reference [01:42] hippich has joined the channel [01:43] Nuck: markbao_: OOOOOOOOH! [01:44] Nuck: That's actually a good question, perhaps you can require the ObjectId function from the mongo driver and then use it? [01:45] Nuck: markbao_: Try `require('mongodb').ObjectID, I'm sure it's there somewhere [01:45] Destos has joined the channel [01:48] markbao_: hmm, not in there [01:51] gqlewis has joined the channel [01:51] tmzt_: it's under BSON [01:52] markbao_: thanks tmzt_ [01:52] markbao_: I was able to get it working using require('mongodb').BSONPure.ObjectID('4e2b7488e7912b0000000001') [01:54] markbao_: however [01:54] markbao_: it seems like it's just spitting out the same thing [01:54] Hurreman: ACTION just tried to comment out his comments instead of removing them. Lack of sleep or lack of (or too much?) caffeine? [01:56] pHcF has joined the channel [01:56] pHcF: i've created a telnet server using net.createServer.. the server works fine on mac classic telnet client but on windows default client every char typed it sends to the server… how to avoid that? [01:56] hassox has joined the channel [01:56] pHcF: to send all the characters together to the server [01:57] drefined has joined the channel [01:58] sivy has joined the channel [01:59] Nuck: pHcF: Queue them up, append to string, then when the server gets a newline, treat it as a recieved message? [01:59] pHcF: will it work on mac? [02:00] Nuck: Dunno [02:00] Nuck: Test? [02:00] pHcF: yep [02:00] pHcF: :P [02:01] hybsch has left the channel [02:02] markbao_: /facepalm [02:02] markbao_: it stores it as ObjectID natively [02:03] markbao_: FFFFFFFUUUUUU [02:03] markbao_: there goes 1 hour down the drain [02:04] Nuck: markbao_: lol there's so many times I wish there were a #mongodb chat. [02:04] Nuck: It'd make my life so much easier [02:04] markbao_: Nuck: I think there is... [02:04] markbao_: just not node specific/ [02:04] Nuck: markbao_: I'm /list mongo-ing right now [02:04] markbao_: /join #mongodb [02:04] Nuck: Nope [02:04] markbao_: :P [02:05] Nuck: Damnit they hid the room [02:05] markbao_: stealth mode [02:05] Nuck: bitches [02:05] Nuck: ACTION gets grumpy [02:05] Nuck: markbao_: Never thought to /join before lol [02:05] markbao_: Nuck: lol you always gotta try and /join [02:06] Xeon06_ has joined the channel [02:07] Wizek has joined the channel [02:08] Nuck: markbao_: I forgot stealth mode existed, and I didn't think anyone used it on a major chatroom. [02:09] ceej has joined the channel [02:10] zackattack has joined the channel [02:11] vikstrous has joined the channel [02:11] mnaser: It looks like Dnode doesn't send the object type and prototype? [02:11] slifty_corsair has joined the channel [02:11] mnaser: so the object that's sent is a "testclass" and what i get back is a "object" and it's prototypes are gone [02:11] rachelderp: Are there any drawbacks to using HTTPS requests in node to send encrypted information, versus writing my own encryption using crypto.diffieHellman functions? [02:12] Aria: Yeah, dnode just serializes the object itself. [02:12] mnaser: So if I want to send "classes" across, what would I have to do? [02:12] agnat has joined the channel [02:12] mnaser: or if I wanted to manipulate them rather [02:12] jesusabdullah: I'm not sure that's something dnode does [02:12] jesusabdullah: I'd hate to say "rethink the problem" [02:13] jesusabdullah: I really do [02:13] mnaser: >_< [02:13] Nuck: jesusabdullah: But you're saying it anyways? [02:13] jesusabdullah: but I think you can find a way to do this with an instantiated object [02:13] jesusabdullah: Nuck: Yeah >_< [02:13] jesusabdullah: mnaser: Can you expose a getter/setter or something? [02:13] jesusabdullah: SubStack might have some advice if he's not too busy [02:13] tuhoojabotti: ffuuu [02:14] Nuck: jesusabdullah: Does he ever NOT have advice? [02:14] mnaser: what I was doing was: "volume = new Volume zpool, item" and "callback null, volume" [02:14] Nuck: ewww CS [02:14] jesusabdullah: Nuck: sometimes! [02:14] mnaser: well you highlighted him so if he ever has an answer I think he'll drop by I guess [02:14] jesusabdullah: volume = new Volume(zpool, item) ? [02:14] jesusabdullah: and cb(null, volume) ? [02:15] mnaser: yes [02:15] tuhoojabotti: Hueg thunderstorm! [02:15] jesusabdullah: and you want to access volume's prototype remotely? [02:15] Nuck: jesusabdullah: If he doesn't have advice, then there's something wrong with the topic. [02:15] polotek: mnaser: why can't you load your prototype definitions on the other side? [02:15] polotek: do you not control that environment as well? [02:15] tuhoojabotti: It's 5 am ffs [02:15] jesusabdullah: Nuck: He just looks busy is all [02:15] jesusabdullah: hacking the shit out of that Gibson! [02:16] jesusabdullah: Meanwhile, I'm drawing the Wonder Twins [02:16] Nuck: jesusabdullah: Doesn't mean he doesn't have advice, just means he's too busy to give it ;) [02:16] mnaser: I do, I could set it up on the other side, but then i'd have logic over two applications [02:16] Nuck: jesusabdullah: Wonder Twins? [02:16] mnaser: and yes jesusabdullah [02:16] unomi has joined the channel [02:17] mnaser: basically i want to get an "object" and then once I have that object, I can do things with it, like object.update / object.resize / etc [02:17] polotek: mnaser: if you could send your classes with all their functionality then you'd have that anyway [02:17] mnaser: I could just make a bunch of functions like resizevolume(...) -- but i think it'd be so much cleaner [02:18] mnaser: polotek: part of the other reason is that ill be using dnode-ruby to work with the results [02:18] polotek: whether you load the code on both sides or send it across the wire, you're going to have to instantiate the functions twice [02:18] mnaser: so its hard to have the prototypes there [02:18] Nuck: mnaser: ... Ruby? [02:18] Nuck: ACTION vomits [02:19] jesusabdullah: Pffsht, ruby's not THAT bad [02:19] mnaser: Nuck: seriously, every comment you do is "ewww ruby" "ewww coffeescript" -- it'd be a lot more useful if there was constructive-ness in what you say [02:19] polotek: you could serialize all your known prototypes and send those over [02:19] jesusabdullah: it's just got a boring ecosystem is all! [02:19] Nuck: jesusabdullah: It is for me. [02:19] polotek: you could toString your functions and send those as well [02:19] polotek: but you'd lose closures [02:19] jesusabdullah: Nuck: How do you feel about python? [02:19] polotek: and probably open security holes :) [02:19] jesusabdullah: :v [02:19] mnaser: ruby is a really good language. rails is really solid framework. [02:19] Nuck: mnaser: There's two things I hate more than anything else in the programming world: Ruby and CoffeeScript. [02:19] jesusabdullah: rails lives up to its name [02:19] jesusabdullah: fbofw [02:19] Nuck: jesusabdullah: It's powerful, but I'm not a fan of the syntax. [02:20] mnaser: polotek: what would you do if it was your call? [02:20] Nuck: jesusabdullah: As for RAILS... Rails is just a piece of shit. [02:20] Nuck: It really does not scale well. [02:20] mnaser: Nuck: im sorry [02:20] dshaw_ has joined the channel [02:20] jesusabdullah: I call it RAYLEZZ cause that's more gangster [02:20] mnaser: lol [02:20] Nuck: IT used to be all "RAILS SCALES" then everybody realized it really DOESN'T scale. [02:20] mnaser: oh god [02:20] jesusabdullah: RAILS SCALES KINDA [02:20] Aria: Heh. It's a classic frontend language. It scales as well as any of 'em. [02:20] jshaw has joined the channel [02:20] Nuck: jesusabdullah: Until a certain point [02:21] rachelderp: RAILS SCALES (down) [02:21] Prometheus: wait [02:21] Nuck: Then it jsut fucks itself [02:21] Aria: "Keep your requests from talking to each other and add more web front ends." [02:21] Prometheus: did someone call rails a solid framework? [02:21] Nuck: scales to like 50 users [02:21] mnaser: what else would you use to create an online app with an ORM/etc [02:21] jesusabdullah: Your MOM scales to 50 users >:o [02:21] mnaser: seriously, it's the best choice. imho. [02:21] jesusabdullah: mnaser: node.js? [02:21] Nuck: mnaser: Uh, Node.js [02:21] Prometheus: lol. [02:21] jesusabdullah: haha [02:21] Prometheus: :/ [02:21] Nuck: Seriously [02:21] Nuck: NODE scales. [02:21] AAA_awright: LOL [02:21] mnaser: and how the hell are you going to write an entire application [02:21] Nuck: And it does so damn well. [02:22] Nuck: mnaser: Easily? [02:22] mnaser: alright then [02:22] Nuck: mnaser: /me points to LearnBoost. [02:22] Prometheus: mnaser: you can't be serious [02:22] Nuck: 'nuff said. [02:22] Prometheus: did you come from PHP to ruby? [02:22] mnaser: to each his own guys, i just find node.js might drive you nuts on lareg projects [02:22] Prometheus: or just picked up ruby as your first language? [02:22] Prometheus: just out of curiosity [02:22] jesusabdullah: The one thing I'll point out is that apparently sqlite and node don't play well together [02:22] Prometheus: because you seem to be giving rails a lot of credit there [02:22] Nuck: mnaser: I'm using Node.js to build a whole fucking art community. [02:22] AvianFlu: fuck SQL, seriously [02:22] AAA_awright: Yeah you want to abvoid that combo [02:22] jesusabdullah: also, that node doesn't have a "heavyweight" framework a la RAYLEZ or the jangoes [02:22] Nuck: Can't get much bigger than that. [02:22] mnaser: jeez [02:23] mnaser: so drop sql [02:23] mnaser: drop rails [02:23] kriszyp has joined the channel [02:23] AAA_awright: Well what's wrong with SQL? [02:23] mnaser: write javascript [02:23] mnaser: ??? [02:23] mnaser: profit [02:23] Nuck: mnaser: Node.js + MongoDB. [02:23] AAA_awright: It's great for running statistics and such [02:23] Nuck: THEN profit. [02:23] AvianFlu: you're in #Node.js! we did! lol [02:23] gazumps has joined the channel [02:23] jesusabdullah: Well, sql isn't that bad, it just fits a particular problem set [02:23] Nuck: jesusabdullah: We have Express lol [02:23] jesusabdullah: and mongo/redis/whatever-the-fuck might fit your needs better [02:23] Nuck: jesusabdullah: A VERY particular set of problems. [02:23] polotek: express isn't nearly as feature rich as rails [02:23] polotek: which is a good thing [02:23] Nuck: Which Mongo tends to fit just fine too. [02:23] jesusabdullah: Nuck: express is more comparable to sinatra [02:23] Nuck: jesusabdullah: Ah true [02:24] dgathright has joined the channel [02:24] mnaser: anyways [02:24] Nuck: jesusabdullah: We have underscore, is that more like django? [02:24] Aria: HEh, I kinda love node too. Express is awesome that way. [02:24] jesusabdullah: Naw, that's more like the "standard library" [02:24] mnaser: rules 1 and 2 of node.js is don't mention rails i gues [02:24] jesusabdullah: haha [02:24] pjacobs has joined the channel [02:24] Nuck: Just don't bring up Ruby [02:24] Nuck: Realize how many former Ruby coders are in here [02:24] jesusabdullah: mnaser: You can bring up ruby/rails, no really [02:24] kaww has joined the channel [02:24] mnaser: seriously i havent seen this channel as active as it was for the past 1 minute [02:24] mnaser: shit exploded [02:24] jesusabdullah: mnaser: It's just that rails is a pretty divisive topic [02:24] Prometheus: =P [02:24] Prometheus: rails happens. [02:25] Nuck: We'll just laugh at your choices. [02:25] jesusabdullah: You mean raylezz [02:25] Nuck: Prometheus: It happens? LMAO [02:25] jesusabdullah: Okay, drew Zan [02:25] ^robertj: is there a way to make a blocking generator and then feed it values to yield? [02:25] jesusabdullah: Now, Janya [02:25] jesusabdullah: the hot one! [02:25] Nuck: ^robertj: Elaborate? [02:25] Nuck: jesusabdullah: Who the fuck? [02:25] mnaser: to be honest, i think that for huge applications, it's really hard to design them in node [02:25] ^robertj: Nuck, I'v got a StringReader I am trying to turn into a blocking socket reader [02:25] mnaser: again, im not a node.js expert [02:26] mscdex: rails isn't as divisive as matlab is [02:26] polotek: mnaser: that's because node is a platform, not a framework [02:26] Nuck: mnaser: You get used to it :P [02:26] polotek: express is a framework [02:26] mscdex: and labview [02:26] egeste has left the channel [02:26] polotek: just seems it's not as extensive as you would like [02:26] mnaser: and rails is blocking, i know. but yeah, i even saw express, it looks very sinatra like [02:26] mnaser: that's what i personally think ,rails is a really good groundbase for an app, it has tons of things that's there to help speed up progrmaming [02:26] mscdex: a platform on a platform! [02:26] polotek: mnaser: write your own framework. it'll take a long time before it's as extensive as rails [02:27] mnaser: now if it's the best to do it, might not be, but rails does a great job for it's purpose [02:27] polotek: but somebody's gotta do it [02:27] Nuck: mnaser: Once you learn how scope and whatnot work in JS, it's very simple to deal with callbacks. [02:27] ^robertj: Nuck, so I need a way to wait when there is a peek() [02:27] Nuck: mnaser: I hate Ruby. It's my worst enemy. [02:27] Nuck: ^robertj: I'm afraid that's a bit above my level. [02:27] mnaser: ruby is a lot better than many of the languages out there [02:27] polotek: ^robertj: can you use an event emitter? [02:27] Prometheus: ... [02:27] Prometheus: please make it stop :/ [02:27] AAA_awright: I wonder if I could write a log parser that analyzes for contervercial topics [02:27] Nuck: mnaser: You MUST be a convert from PHP. [02:28] ^robertj: polotek, dunno, can the listeners be blocking? [02:28] Nuck: I can't think of any other reason you'd consider it a great lenaguage. [02:28] AAA_awright: Nuck: I still work in PHP because there's no better content management system. [02:28] polotek: ^robertj: there is no blocking i/o in node [02:28] mscdex: PHP is now a recursive acronym for People Hating PHP [02:28] mscdex: ;-) [02:28] Nuck: AAA_awright: Fair enough [02:28] polotek: listeners are functions [02:28] ^robertj: polotek, not in node btw [02:28] Nuck: mscdex: lol [02:28] AAA_awright: And it's a pretty good template language, if someone would write a PHP template engine for Node.js [02:28] polotek: ^robertj: then I'm confused [02:28] Prometheus: AAA_awright: PHP is a CMS? [02:28] Nuck: ^robertj: Then why are you asking us? [02:28] AAA_awright: Prometheus: Drupal [02:29] Prometheus: oh [02:29] Nuck: AAA_awright: EJS. [02:29] ^robertj: doh wrong channel, thought i was in #javascript [02:29] ^robertj: wasn't paying attention :P [02:29] mscdex: huh? [02:29] AAA_awright: Nuck: Eh maybe [02:29] Nuck: AAA_awright: I picked EJS as my template engine simply because it has the nice PHP-esque syntax. [02:29] Prometheus: AAA_awright: I'm sure there are, you just haven't come across them yet =) [02:29] Stythys: http://refinerycms.com/ [02:29] mscdex: ^robertj: what blocking javascript out there is it that you're using? [02:29] Nuck: AAA_awright: I too love the stuff, it's very nice. [02:30] mnaser: how good is the video that's on nodejs homepage? i feel like with how strong-minded everyone is about this, i might be missing something [02:30] ^robertj: mscdex, jssajaxparser's Reader [02:30] DrPizza_ has joined the channel [02:30] mnaser: because im finding it really, really tough to write anything with node, i cant imagine building our entire rails application that we have in node, ever [02:30] DrPizza_: ok neato. [02:30] Prometheus: mnaser: I don't think it'd be there if it was complete crap =) [02:30] DrPizza_: building in VC++. [02:30] ^robertj: mscdex, it's a javascript sgml parser [02:30] DrPizza_: excellent. [02:30] mnaser: well, not crap, but let's just say, convincing [02:30] Nuck: markbao_: You posted a screencap earlier of your Mongo thing... What is that interface, it looks awesome? [02:30] DrPizza_: now to make it tidy. [02:31] mnaser: does it cover a good variety of node? [02:31] markbao_: Nuck: it's a hosted Mongo thingamajig - MongoHQ.com [02:31] Nuck: markbao_: AH! [02:31] jacobolu_ has joined the channel [02:31] mnaser: because an hour of "this is how to hello world" is meh [02:31] Nuck: markbao_: I knew it looked slightly familiar. [02:31] markbao_: :) [02:31] Nuck: markbao_" Thanks :D [02:31] Prometheus: mnaser: it's a bit more than just hello world =) [02:32] mnaser: good. i'm getting tired and frustrated as shit, i'll probably scratch all i did for today because it's gone no where [02:32] markbao_: no worries Nuck :D [02:32] Prometheus: about 30 minutes of hello world =P [02:32] mnaser: i'll give it a watch before hitting the sack [02:32] mnaser: but just a heads up, im not trolling anyone with ruby or anything, i wasn't trying to push anyone's buttons [02:32] mnaser: just fyi [02:32] Prometheus: mnaser: understandable, you are not the only person to come to node.js from ruby =) [02:32] polotek: mnaser: your frustration is understandable. if you want to focus on application logic, you're going to have a tough time with node [02:32] mscdex: mnaser: also i'd bet more people use pure js rather than cs [02:33] polotek: it's still very new and doesn't have all the tools of a ruby or python [02:33] mscdex: at least in here [02:33] Nuck: polotek: That's intentional [02:33] mnaser: yeah.. my application logic is _really_ not that hard... [02:33] polotek: not to mention that those tools are more difficult to port because of the async nature of node [02:33] polotek: vs. those other platforms [02:33] mnaser: literally, all this node.js application is a frontend API service that recieves a request, then executes a command locally depending on the request [02:33] Nuck: polotek: Meh, I've gotten used to the async nature of Node. [02:33] mscdex: mnaser: that's pretty easy to do [02:34] Nuck: mnaser: REST api? [02:34] mnaser: get new volume command, run 'zfs create ...." with parameters, tada. [02:34] Prometheus: try doing that in rails [02:34] Prometheus: =) [02:34] mnaser: rails would be overkill for that obviously [02:34] mnaser: not even the right tool [02:34] Prometheus: but you said... =P [02:34] mnaser: i thought of REST API but didnt find good modules, i was suggested dnode (initially i was using the xmlrpc module) [02:34] dgathright has joined the channel [02:35] mscdex: you could use express too instead of a specialized module [02:35] Nuck: mnaser: If you want to make a simple REST API, look at Express. You jsut toss back JSON as the response and it'll handle it. [02:35] mscdex: depending on your needs [02:35] Nuck: I'm building a REST API using it [02:35] mnaser: but if there's any good restful routers having /pools/mypool/volumes/myvolume [02:35] mscdex: yeah [02:35] mnaser: exprss is good to build rest apis? it seems to me like it had too much [02:35] mscdex: express is really flexible [02:35] mnaser: guess i need to give it more of a shot [02:35] Nuck: mnaser: I thought the same thing, but it really feels lightweight when you're using it. [02:36] mnaser: it really sucks because i know node is a good option but the time i've lost just figuring out "the right way" to do it [02:36] Aria: Express is really not that big. [02:36] Aria: And it's very modular. [02:36] Nuck: For a rather powerful library, Express feels really lightweight, because as Aria says, it's modular. [02:36] Nuck: You only use what you need. [02:36] Aria: And even all of it just isn't that much. [02:36] Nuck: yep [02:37] Nuck: because tj is awesome like that :P [02:37] polotek: mnaser: what is it you're having trouble with exactly? [02:37] Aria: He really is. I have a lot of respect for him. [02:37] polotek: you need to understand how node thinks about http [02:37] Nuck: Aria: Who doesn't? It's like NPM levels of awesome. [02:37] polotek: seems to me a simple rest endpoint shouldn't require something like dnode [02:37] polotek: how did you end up there? [02:38] mnaser: basically i have a small api endpoint that runs there, not necesarily rest, i thought of rest, express "looked" big so i looked for some rest modules, didnt have luck [02:38] mnaser: then I just found a good xmlrpc plugin, started using it, was told about dnode and how it might be better, checked out dnode ruby bindings, and so on [02:38] mnaser: I need to be able to interact with the API using ruby, we still have a huge app that needs to continue to run till we slowly port and move things over [02:38] Nuck: if you want to have arguments in the path, you can do "/pools/:pool/volumes/:volume/" as the path in app.get(); [02:39] Nuck: mnaser: Just call the API through Ruby [02:39] mscdex: or you can use custom regex if you need something really fancy [02:39] chrislorenz has joined the channel [02:39] mnaser: it's only used by our manager so not too much to worry about [02:39] Nuck: Probably not the most efficient means of communication, but I'd imagine it ought to be sufficient. [02:39] mnaser: we control the input [02:40] mnaser: well, what would be the 100% efficent way, that's what i'm looking for, honestly. [02:40] rchavik has joined the channel [02:40] Aria: Hm. diode seems overkill. [02:40] Nuck: mnaser: No such thing, to be honest. [02:40] Aria: er. dnode. Lion, your autocorrect sucks. [02:40] mnaser: haha, had to deal with that for a while [02:40] mnaser: (autocorrect) [02:40] Nuck: The thing is, you'd hafta do inter-process communcation, which is generally a bitch. [02:41] Nuck: Aria: Oh fuck, Lion added autocorrect? [02:41] mnaser: by inter-process communication .. ? [02:41] Aria: Yeah, but it's able to be turned off. [02:41] Nuck: mnaser: Wait, are these on two separate machines? [02:41] mnaser: yes, that's why i want a small frontend on the other machine [02:41] Nuck: mnaser: Will the Ruby app be communicating via a network connection with the Node app? [02:41] mnaser: so the main can send commands to it [02:41] Nuck: Okay, then the API calls will be most efficient. [02:42] mnaser: rails app <-- internal network --> node.js api frontend [02:42] Nuck: Only real overhead is HTTP itself, but that's EXTREMELY Minimal. [02:42] MikhX has joined the channel [02:42] mnaser: low latency infiniband network (its the same as our local storage one) [02:42] Nuck: infiniband sounds like a shitty 80's group. [02:42] bartt has joined the channel [02:43] Me1000 has joined the channel [02:44] mnaser: its fast. [02:44] tjholowaychuk has joined the channel [02:44] Aria: Yeah, it's fast if you keep your protocol stack thin. [02:44] Aria: It's fast enough that you notice the latency of everything. [02:45] skm has joined the channel [02:45] mattcodes has joined the channel [02:45] Nuck: Doesn't make it sounds like less of an 80's band. [02:45] SubStack: rest is ok until you want to start a job and want to be notified when it's done [02:45] SubStack: polling super sucks [02:45] mnaser: it's one-time jobs [02:45] mnaser: create/snapshot/delete volume, and i just get a response back [02:46] pastak has joined the channel [02:46] vikstrous has joined the channel [02:47] Aria: Yeah, REST is awesome for that. [02:47] Aria: "DO this" "READ that" (post and get, respectively) [02:47] mnaser: i do a bunch of rest work.. in rails [02:47] mnaser: :D [02:48] mnaser: haaha [02:48] systemfault: Still waiting for browsers that get the fact that there is more than 2 http verbs [02:48] systemfault: s/that/to [02:48] zackattack has joined the channel [02:49] Nuck: Aria: "Shove this down your filesystem" (PUT) [02:49] Nuck: "Rip this out of your gut" (DELETE) [02:50] Nuck: systemfault: I want PUT on forms still. [02:50] CIA-94 has joined the channel [02:50] Nuck: That's the BIGGEST thing I want. [02:50] systemfault: Yeah :) [02:50] Nuck: I don't care about other verbs. [02:50] Nuck: I just want PUT. [02:50] Aria: I still want a "CREATE" verb. [02:50] systemfault: PUT is definitely the one I want the most. [02:51] brownies has joined the channel [02:51] Nuck: I also want better ways to upload files. [02:51] systemfault: Aria: What would it do more than POST/PUT [02:51] Aria: It'd let the server assign the URI [02:51] systemfault: POST is for that. [02:51] Aria: And it'd be JUST that, unlike post. [02:51] Nuck: I should ask so take the multipart-encoded from data and t would take the multipart-encoded from data and pass me a temporary file reference. [02:51] Aria: No, POST Is "have some data, not idempotent" [02:51] Aria: Which people use for create. [02:52] Nuck: What purpose is a CREATE? [02:52] Nuck: I really don't see the use-case. [02:53] Nuck: Where's the place to lodge feature requests for Node? [02:53] Nuck: I want an mktmp. [02:53] brainproxy: Nuck: perhaps propose your idea/s in the google group [02:53] Nuck: brainproxy: Blargh. [02:53] brainproxy: and see what folks think [02:53] SubStack: Nuck: oh I know a place... it's called npm :p [02:53] Nuck: SubStack: Surprisingly, no mktemp modules. [02:54] SubStack: write one! [02:54] Nuck: SubStack: I don't do C. [02:54] Nuck: And I dunno if there's an async mktemp equivalent. [02:54] brianseeders has joined the channel [02:54] Aria: Create? How about MKCOL foo/, then CREATE foo/ \n Suggested-Filename: bar.txt [02:54] Aria: An you get back a 201 Created; Location foo/bar2.txt [02:54] SubStack: Nuck: can't you just fs.writeFileSync('/tmp/' + Math.random(), body) ? [02:55] jerrysv has joined the channel [02:55] Nuck: SubStack: As I understand, mktemp generates a temporary file which will be deleted when unlinked. [02:55] Nuck: Not sure if /tmp/ works the same way [02:56] systemfault: Nuck: The name.. [02:56] polotek: It won't on windows [02:56] SubStack: process.on('exit', fn)? [02:56] polotek: which means it won't on node pretty soon [02:56] Nuck: SubStack: I don't ever exit [02:56] Nuck: This is for an uploading API [02:57] Nuck: I just want a simple way to create files which I won't bother with the name, I just get passed a file descriptor from the middleware [02:58] Nuck: Basically, the file gets uploaded, a file is created, a fiel descriptor is kept, but the file is unlinked, so once that descriptor is garbage collected, the file will fade from existence. [02:58] brownies has joined the channel [02:59] Aria: Why do it that way? [02:59] brainproxy: Nuck: maybe node-formidable could be adapted to that purpose? [02:59] tj has joined the channel [02:59] Aria: with node, you have access to the data as it comes in in the first place. [02:59] Nuck: lolnetsplit [03:00] Guest92009: mnaser: look at the size of the code before assuming such things :p as far as frameworks go express is tiny [03:00] Nuck: Aria: Because it's hard to use it as a file in that form [03:00] Aria: Ah. What do you want to do with it? [03:00] mscdex: netsplat [03:00] Aria: (It's a lot like node's interface to a file… it's a stream.) [03:01] mnaser: Guest92009: i am doing a bit more reading now.. let's just say i have a lot to learn and not a lot of time [03:01] mnaser: which is frustrating [03:01] polotek: Nuck, you're basically describing how PHP does uploads right? [03:01] Nuck: Guest92009: What's up with the lack of nick? [03:01] Guest92009: irc is being a douche [03:01] polotek: mnaser: if you're pressed for time, why would you decide to try and learn node before getting your project done? [03:01] Nuck: Guest92009 [03:02] Nuck: I see [03:02] Nuck: " Quits: tjholowaychuk (~tj@96.50.119.149) (*.net *.split)" [03:02] Nuck: Yowch [03:02] Nuck: polotek: Basically, yes. [03:02] gqlewis_ has joined the channel [03:02] mnaser: polotek: i learn quickly, it's javascript at heart, and it's not that big of a project to be something that i would never think of using node for [03:02] Nuck: polotek: I want my uploads to be transparent, and then I just deal with my file descriptor. [03:02] mnaser: at least i think it's a good simple thing to start with [03:02] polotek: mnaser: apparently not, or you wouldn't be having so much trouble :) [03:02] tjholowaychuk has joined the channel [03:02] polotek: node runs javascript [03:03] Nuck: brainproxy: I am looking at formidable though, but I'm not sure how I'd go about it :/ [03:03] polotek: but it introduces some seriously new constructs [03:03] mnaser: haha, i'm just 3-4 days in. i promise i'll get it all down! [03:03] mnaser: heh [03:03] polotek: those of us who are fans of node find those constructs pretty intuitive and nice to use [03:03] polotek: but it shouldn't be taken lightly I guess [03:03] Nuck: polotek: I sure do. [03:03] chrislorenz has joined the channel [03:03] zeade has joined the channel [03:03] onar has joined the channel [03:05] mnaser: i just need exposure.. im doing my fair share of reading [03:05] Nuck: mnaser: Don't worry, Node is a flasher, it will expose itself to you quite quickly. [03:06] e6nian has joined the channel [03:06] mnaser: is there online podcasts for node? [03:06] ceej has joined the channel [03:06] peol has joined the channel [03:06] peol has joined the channel [03:06] peol has joined the channel [03:06] brainproxy: mnaser: did you take a look at the Node Beginner Book? [03:07] mnaser: googling that now [03:07] polotek: Nuck: you could approximate your upload thing in pure js [03:07] brainproxy: http://www.nodebeginner.org/ [03:07] polotek: your middleware would create a tmp filename and stream the file there [03:07] brainproxy: you can read it free online, or buy a pdf [03:07] polotek: set a listener on response "end" and delete the file [03:08] mnaser: ill check it out today [03:08] Nexxy has joined the channel [03:08] Nuck: polotek: Will it still exist if I keep a file descriptor but delete it? [03:08] Aria: In unix, yes. Windows doesn't allow this. [03:08] Nuck: Good thing my servers are Linux ;) [03:09] polotek: if you have an fd you have to have the data around, either on the fs or in memory right? [03:09] polotek: (reaching the limits of my experience at this level) [03:09] Nuck: I'm pretty sure as long as it keeps an fd, it remains in existence, just unnamed. [03:09] polotek: the way it works in PHP is you get the tmp filename, verify the upload however you do that [03:09] Nuck: Or wait [03:10] Nuck: Do I just unlink? [03:10] polotek: and then move_upload_file or whatever the function name is [03:10] polotek: which copies the file to a location of your choosing [03:10] jameson has joined the channel [03:10] polotek: Nuck, try that [03:10] Aria: Just unlink. [03:10] polotek: gotta go. later gents [03:11] Aria: Though I'd just open the place I want it and write it as it comes in. [03:11] Aria: No temp file at all. [03:11] Nuck: Aria: I'm no good with Linux, can somebody explain the concept of linking and unlinking to me? [03:11] polotek: Aria: verifying uploads is sometimes important [03:11] tjholowaychuk: Nuck unlinking is like a reference [03:11] polotek: hard to do when streaming [03:11] Nuck: Aria: Well, it's uploaded first via AJAX, then I set it into place later. [03:11] tjholowaychuk: you just say [03:11] tjholowaychuk: im done with that shit [03:11] tjholowaychuk: if all procs are done with it, then it's removed [03:11] Nuck: tjholowaychuk: If I unlink but keep an fd, it stays, though? [03:11] Nuck: This is ideal for a temp file. [03:12] Nuck: Do I jsut call unlink on the file I write to? [03:12] tjholowaychuk: yeah pass it a path [03:12] Nexxy: omg teej language [03:12] Nuck: As it is, I have an uploader that basically just dumps the raw file data into an HTTP body [03:12] Aria: Nuck: any reason for this? [03:12] shanebo: is it normal for node to make your head hurt? [03:12] Nuck: And I just pipe into file [03:12] Nuck: Aria: For what? [03:13] Nuck: shanebo: That is a side effect of starting with Node, it goes away with continued use. [03:13] Aria: Nuck: For using a temp file. [03:13] shanebo: Nuck, man I sure hope so because I'm almost ready to bail :D [03:13] Aria: shanebo: Yeah, async will break your head for a while. [03:13] shanebo: what I don't get is how it's been compared to front-end js? [03:13] Nuck: shanebo: It's actually quite pleasant once it digs its way into your psyche. [03:14] Nuck: shanebo: Honestly, I don't see the semblance either, other than how it's the same language. [03:14] shanebo: yeah, maybe that's why I've been confused [03:14] Aria: shanebo: It's evented, that's the only similarity, other than the javascript. [03:14] Nuck: shanebo: It's highly efficient and great for making powerful servers, though. [03:15] brainproxy: event-driven, callbacks [03:15] luke` has joined the channel [03:15] Aria: Just as you have addEventListener('click'), you have on('data') in node. [03:15] Nuck: Aria: I pipe to a temp file, display it on the page so they know what they just uploaded, then ask them for a title and whatnot. If they never give a title and finish uploading, it needs to disappear. [03:15] shanebo: no where in front-end js will you ever see a console.log, which is after a method with a console.log, fire before hand. [03:15] Aria: ACTION nods. How long's the timeout? [03:15] brainproxy: shanebo: I use console.log all the time in the front-end [03:15] Nuck: shanebo: That happens. [03:15] brainproxy: lol [03:16] _jhs has joined the channel [03:16] jakehow has joined the channel [03:16] Nuck: shanebo: Think of this: $(function(){ console.log('1'); }); console.log('2'); [03:16] Nuck: It will log 2, then 1. [03:16] _jhs has left the channel [03:16] shanebo: haha, that's exactly what I did locally here [03:16] Nuck: It's all events. [03:16] shanebo: and was dumbfounded [03:17] shanebo: hahahah [03:17] shanebo: i'm not alone [03:17] Nuck: shanebo: Yeah, it's a bit odd, but you learn to read teh indentation as ordering isntead of the lines. [03:17] shanebo: not sure I can get used to that [03:17] Nuck: It just takes a bit of a mental change. [03:18] brownies has joined the channel [03:18] Nuck: Aria: I'm thinking I don't wanna do a timeout. [03:18] jasonh has joined the channel [03:18] Aria: Hm. Then when will this 'disappearance' take place? [03:18] Aria: I mean, you really don't want to tie GC timing to user experience. [03:18] Nuck: Aria: Hmmm... Valid point... [03:18] Nuck: The big question for me is "how do I keep this shit around between pageloads" [03:18] shanebo: Nuck, and the strange thing is that it only seems to do that with methods with callbacks [03:19] Nuck: Can't shove an fd into a database, but I'm sure I can use an object. [03:19] Aria: What I'd do is write it to a temp file mysef, "incoming/id", then when the title comes in, move it. And when it comes in the first place, setTimeout(removethefile, 3600) [03:19] Aria: Nuck: That's easy. Node's persistent. All the page loads can share variables. [03:19] tar_ has joined the channel [03:20] Aria: If you use a global (or common between your two pages, anyway) variable, the data will be there. [03:20] brownies has joined the channel [03:20] Aria: IT's not like PHP where there's a free(everything) at the end of each request. [03:20] Aria: Local variables die with their function or closure, but more global things last. [03:20] Nuck: shanebo: Yeah, here's how it works: callbacks are executed when the command that is trying to be run is done. It returns instantly, but the callback will be run when the event happens. [03:21] Nuck: Code continues, but that callback will run when the event hits. [03:21] Nuck: Until then, shit goes on. [03:21] Nuck: Aria: I'd love to use a session store, but mine is on my db layer :/ [03:21] shanebo: does it help to trip on acid because I still don't get it ;) [03:22] Aria: Nuck: Why? If it's in node, it's all there... [03:22] Nuck: shanebo: lol did you ever deal with setTimeout in the browser, or perhaps events? [03:22] fairwinds has joined the channel [03:22] shanebo: very familiar with events [03:22] shanebo: and delegation [03:22] Nuck: Aria: I don't have globals per-user or per-session, only global for my server. So I need to tie the uploads to a given session. [03:22] Nuck: SeE? [03:22] shanebo: but again, code still waits for something else to process before it fires the next line :D [03:23] Aria: Right . . . So you have to do the ID yourself. But you can do that. [03:23] Nuck: shanebo: Think of each callback function as an event listener. It will wait until the event fires before actually running, but anything after that callback will still continue as usual. [03:23] Nuck: It's no different from the events on the client-side [03:23] webben has joined the channel [03:24] shanebo: okay that helps [03:24] shanebo: can i show you some concept code and you can tell me how stupid this is? [03:25] Nuck: Using fs.readFile(function(){}) is just binding that "readFile" event and calling function when it's done. [03:25] Nuck: shanebo: Sure :) [03:25] shanebo: fs.readFile is what I'm getting hung up on [03:25] Nuck: Aria: I'll just use an object with session IDs and whatnot :P [03:26] Nuck: shanebo: If you want something to run after that, you don't shove it after it, you shove it in it. [03:26] shanebo: boo! [03:26] shanebo: :D [03:26] Nuck: That's the thing that confuses a lot of people. Stepping is done through callbacks. [03:26] shanebo: it feels dirty [03:26] Nuck: shanebo: It feels natural once you learn it better. [03:27] shanebo: that means I've gotta litter and pass req and res in almost every method i run though right? [03:27] brainproxy: yes, but you don't have to use anonymous functions [03:27] Nuck: shanebo: Not quite [03:27] shanebo: brainproxy, I rarely do [03:28] Nuck: shanebo: Once you define a variable (whether as an argument or via `var req`), it is in that scope and all scopes within that. [03:28] Nuck: So once you have a callback within a callback, the arguments of the outer one will be accessible from the inner one [03:28] shanebo: even if it's not an anon func? [03:28] Nuck: Node.js is a lot like inception. [03:28] Nuck: shanebo: As long as it is defined within there [03:28] shanebo: hahahaha [03:28] Nuck: That's lexical scope [03:28] brainproxy: just be careful w/ the closures :) [03:29] Nuck: brainproxy: Pssssssssh! Fuck that noise, I use closures all willy-nilly. [03:29] shanebo: brainproxy, care to elaborate? [03:29] Hurreman: I've felt that all those hours writing jQuery-plugins (where nested callbacks are quite common) helped me get into node a bit faster. But just a week in so far, so still learning, but the initial headaches are gone :) [03:29] TechCel has joined the channel [03:29] Nuck: Hurreman: lol [03:29] Nuck: You shoulda seen me when I first started with Node. [03:29] Nuck: My code was horribad. [03:29] Nuck: Because I didn't understand what the fuck scope meant. [03:30] Hurreman: hehe [03:30] Nuck: I just used this.foo and then shoved .bind(this) [03:30] Nuck: I cheated ;) [03:30] Hurreman: :p [03:30] Nuck: But sometime in February I had a revelation and suddenly it all made sense. [03:31] Nuck: And now I <3 Lexical Scope. [03:32] brainproxy: shanebo: there are some good tips here http://bonsaiden.github.com/JavaScript-Garden/#function.closures [03:33] Hurreman: I've been doing webdevelopment for over 13 years and node + websockets is probably one of the biggest "aaaaaaaaaaah"-moment I've had since first discovering sql :P [03:34] Nuck: Hurreman: Have you discovered NoSQL yet? [03:34] tjholowaychuk: aaaaaaaaaaah [03:34] tbranyen: lol [03:34] Hurreman: lol ;) [03:34] shanebo: brainproxy thanks! [03:34] Nuck: "all that is left is in the language is function scope." [03:34] Nuck: I guess that makes sense. [03:34] tbranyen: wonder what the websocket support is for web frames in native mobile apps [03:34] Hurreman: Nuck: Discovered yeah, implemented, no [03:34] tbranyen: probably really poor [03:34] shurane has joined the channel [03:35] Nuck: Hurreman: Implement with Mongo + Node.js, it's better than the Node + WebSockets duo [03:35] tbranyen: Nuck: or implement the trio [03:35] Nuck: tbranyen: And you have an orgasmic setup ;) [03:35] tbranyen: its not like they are mutually exclusive [03:35] eastender has joined the channel [03:35] Nuck: Or better yet, socket.io [03:35] tbranyen: Nuck: i'm working with backbone in node connected to mongo and its been awesome [03:35] Nuck: WebSockets without the cross-browser pain in the ass [03:36] tbranyen: can't wait to hook up the client side [03:36] Hurreman: tbranyen: you think? From my experience mobile support for html5 is actually pretty sweet [03:36] tbranyen: Hurreman: websockets in iOS only exist in 4.2 [03:36] tbranyen: i dunno about android [03:36] tbranyen: or blackberry [03:36] Nuck: Safari Mobile works great for WebSockets [03:36] Nuck: Who gives a fuck about BlackBerry [03:36] tbranyen: Nuck: ... only in the absolute latest [03:36] tbranyen: Nuck: people who aren't closed minded [03:36] Hurreman: ah [03:36] broofa has joined the channel [03:37] tjholowaychuk: aaaaaaaaaaah [03:37] tbranyen: Hurreman: although... polyfilling that... [03:37] tbranyen: omg [03:37] tbranyen: that'd be tits [03:37] tbranyen: to NSSocket(iOS) and Socket(Android) [03:38] tbranyen: i'm sure there are websocket implementations in obj-c and android [03:38] tbranyen: er java* [03:39] tjholowaychuk: ah i just got a wicked idea [03:39] Nuck: Android: The only reason anyone still learns Java. [03:40] _jgr has joined the channel [03:40] Nuck: Minecraft: The only reason anyone still has the JVM. [03:40] srid has joined the channel [03:40] srid has joined the channel [03:40] tjholowaychuk: what would you guys say the most available scripting lang is? [03:40] tjholowaychuk: py? [03:40] tjholowaychuk: (general purpose) [03:41] Nuck: "most available"? [03:41] Nuck: Like, most often installed? [03:41] tjholowaychuk: already on systems [03:41] scoates_ has joined the channel [03:41] Nuck: Probably Python, with a close second being PHP [03:41] systemfault: python -> Perl [03:42] Nuck: Though JavaScript is the most common scripting language, probably, if you don't want "general purpose". [03:42] tjholowaychuk: oh yeah perl [03:42] Nuck: oh /vomit perl. [03:42] tjholowaychuk: nah i just need something that is not much of a PITA [03:42] Nuck: I tried to learn that when I was 11 [03:42] Nuck: It was hideous. [03:42] blkcat: mmm, perl. <3 [03:42] Nuck: tjholowaychuk: PHP or Python, I'd say. [03:42] dexter_e has joined the channel [03:42] Nexxy: PHP is a pain in the ass [03:42] Nuck: It's not that bad IMO [03:42] Nuck: I prefer it over Perl or Python. [03:43] Hurreman: PHP is what you make of it [03:43] Prometheus: python++ [03:43] Nuck: Python has awkward syntax, and Perl is just... Fucking hideous. [03:43] blkcat: php is just perl with all the good bits taken out, which is why you probably liked it better when you were 11. :) [03:43] tjholowaychuk: the greatest thing about php is how great it makes every other language feel [03:43] Nuck: catb0t: Y U NO WORK [03:43] Nuck: node++ [03:43] Nuck: ACTION rages at catb0t [03:43] Nuck: Who wants a vanilla v8bot again? [03:43] Nuck: Grab me a nick and I'll host it reliably. [03:43] halfhalo: ACTION throws lisp out into the ring [03:44] tjholowaychuk: actually nvm it doesnt matter [03:44] Nuck: (I have a home server that already hosts 3 bots for deviantART chat) [03:44] Hurreman: tjholowaychuk: that's how I feel about vb.net [03:44] tjholowaychuk: i can precompile so i'll just use node [03:44] tjholowaychuk: silly me [03:44] Nuck: tjholowaychuk: good choice. [03:45] tbranyen: tjholowaychuk: perl [03:45] Nuck: tbranyen: Bit up on the slowtake there [03:45] tbranyen: actually i scrolled up and nobody said it, just some guy bitching about syntax [03:45] tjholowaychuk: what a lame error unused value on *str++; [03:46] wookiehangover has joined the channel [03:47] isaiah_ has joined the channel [03:47] dexter_e: Are there any obvious reasons why Weld.js isn't the default choice for all templating? [03:47] dexter_e: It seems like such a revolutionary solution [03:47] tjholowaychuk: slow [03:47] dexter_e: Oh really , wow [03:48] tbranyen: dexter_e: because not all template engines should rely on the dom? [03:48] tjholowaychuk: it's cool, but on the SS you'd need jsdom etc [03:48] tjholowaychuk: on the CS i think templates are kinda useless [03:48] Nuck: Because EJS and Jade cover most efficient solutions? [03:48] akshatj has joined the channel [03:48] mykul has joined the channel [03:48] tbranyen: tjholowaychuk: i'm trying to change that :) [03:48] tbranyen: at least with this current project [03:48] markdaws has joined the channel [03:48] tjholowaychuk: did you see caustic? [03:48] tjholowaychuk: CS stuff is far too dynamic [03:49] tjholowaychuk: im not nearly done yet but it's a start [03:49] tbranyen: tjholowaychuk: dude its a pain in the dilz, but it can yield a shit ton in performance [03:49] tbranyen: lincoln me [03:49] tbranyen: is it on your github? [03:49] dexter_e: do you guys know if weld.js can be used to inject data into html attributes as well ( href="" src="" [03:49] dexter_e: ? [03:49] tjholowaychuk: tbranyen yup [03:49] tbranyen: kk [03:49] tjholowaychuk: it's not really a template engine [03:49] tjholowaychuk: just a view system thing [03:49] dexter_e: weld.js isn't a template engine ? [03:49] tjholowaychuk: behaviour is basically embedded in html [03:49] tjholowaychuk: so [03:50] tbranyen: I've been thinking about client side from standpoint of startup, running, teardown events for all dynamic components [03:50] tjholowaychuk: for example if you have in your "template" caustic will give you .pets.add(pet) etc [03:50] davidcoallier has joined the channel [03:50] tjholowaychuk: tonnnnns of shit can be deduced from the markup itself [03:50] tbranyen: each partial/component needs to be responsible for all events/dom elements/fetching/rendering etc [03:50] tbranyen: hmmm [03:50] tbranyen: looking it up, cause that sounds kind of sketch [03:51] tjholowaychuk: it's definitely weird [03:51] tjholowaychuk: http://www.screenr.com/s72s [03:51] tjholowaychuk: here's the screencast [03:51] fizx has joined the channel [03:52] dexter_e: Anyone know how weld.js can be used to inject the attributes of html nodes? [03:52] dexter_e: for example How does weld.js target the src ? [03:53] hij1nx has joined the channel [03:53] dexter_e: Wow perfect timing [03:54] dexter_e: Mr. hij1nx: Can weld.js be used to inject html attributes like src and href? [03:54] tbranyen: tjholowaychuk: ah yeah i see what you're doing there. my goal is to have every page backed by the server to eliminate render flicker on load and then from there everything is done client side [03:54] SirRonKcuhc has joined the channel [03:54] tbranyen: i hate going to sites that load dynamic content client side on initial load [03:54] tbranyen: you get that ridiculously annoying flicker [03:55] SirRonKcuhc has joined the channel [03:55] Nuck: `v8 commands [03:55] Nuck: `v commands [03:55] SirRonKcuhc: Nuck: Commands: Type `v . Optionally, type `v @ to send to a specific user. `v Commands are: about, beers, commands, git, google, help, macro. Other commands: v8, `re, `pcre, `ref. Type `v help for more information. Join #v8bot for more support. [03:55] Nuck: ACTION yells "hooray!" [03:55] tjholowaychuk: tbranyen yeah i think the initial layout should be SS [03:55] tjholowaychuk: pretty much always [03:56] tjholowaychuk: but as far as smaller templates go, if you truly have an "app" [03:56] tjholowaychuk: i think templates are kinda useless [03:56] Nuck: SirRonKcuhc++ [03:56] SirRonKcuhc: Nuck has given a beer to SirRonKcuhc. SirRonKcuhc now has 1 beers. [03:56] catb0t: SirRonKcuhc now has 1 beer [03:56] tbranyen: well you gotta use something [03:56] Nuck: lel [03:56] amerine has joined the channel [03:56] tjholowaychuk: you do, but you want something dynamic [03:56] Nuck: catb0t: Picky little shit. [03:56] tjholowaychuk: you dont want to re-render a template to change a title [03:56] tbranyen: tjholowaychuk: something like uki? [03:56] tjholowaychuk: when you can just do .title(str) [03:57] linyows has joined the channel [03:57] tjholowaychuk: people just need to stop thinking of views as somrthing you pass an object to [03:57] tjholowaychuk: but something that is integrated [03:57] tjholowaychuk: dynamic and "alive" [03:57] shurane: Does everybody use anonymous functions in Javascript? Everything I see with jsdom seems to liberally use it. [03:57] tjholowaychuk: shurane all the time [03:58] tbranyen: tjholowaychuk: hmmm that kind of shakes the foundation of data binding, no? [03:58] tbranyen: well maybe not [03:58] tbranyen: so long as data and presentation are 1:1 [03:58] shurane: Is it *that* common? [03:59] tbranyen: shurane: about as common as naming your javascript files with the extension .js [03:59] dexter_e: Can weld.js inject html attributes? :) [04:00] ekryski has joined the channel [04:00] Nuck: I have an idea for an extension to v8bot. [04:02] Nuck: The idea would be to hook it into NPM, so you can `install mongodb-native or something, then provide filtered access to require() [04:02] Nuck: You'd be able to `install environment extension, then v8@environment: code [04:02] arlolra has joined the channel [04:02] riven has joined the channel [04:02] Nuck: And it would allow you to call on shit :P [04:06] dexter_e: Anyone know how to use weld.js ? [04:07] tjholowaychuk: doesn't sound like it [04:07] dexter_e: Yeah, pardon the redundance [04:07] dexter_e: I've just been trying to get this one question and google can't seem to caugh it up [04:08] skm has joined the channel [04:08] dexter_e: tjholowaychuck: Do you know which templating engine will render even if data is missing? [04:08] tbranyen: mine will :D [04:08] tjholowaychuk: weld and caustic need to combine [04:08] tbranyen: but mine is also currently buggy as shit [04:08] tjholowaychuk: i like that you can shove an object at weld [04:08] tjholowaychuk: but you would still have to wrap an api around it [04:08] dexter_e: Yeah I think thats where its at [04:09] dexter_e: Basically like rubys merge or reverse_merge method [04:09] dexter_e: but for views [04:09] Nuck: tjholowaychuk: I think you should put MiddleWare into caustic. [04:09] dexter_e: MyTemplate.reverse_merge( myObject ) [04:09] tjholowaychuk: Nuck yeah some plugins would be nice [04:09] Nuck: Because I'd like to be able to add my own methods to modify data which would then be changed before DOM-ifying. [04:09] tjholowaychuk: instead of the visitor [04:09] Nuck: Like, with birthdays, etc. [04:10] tayy has joined the channel [04:10] dexter_e: Which template engine won't crash upon missing data ? [04:10] Nuck: dexter_e: None of the ones in Express? [04:10] tjholowaychuk: mustache [04:10] Nuck: They just fire off to express.error I'd imagine [04:10] tjholowaychuk: he means undefined vars i guess [04:10] Nuck: Hey Anonymous, grab my 'stache! [04:10] tbranyen: tjholowaychuk: do i need to do anything special for partials support in express for my template engine? [04:11] tjholowaychuk: tbranyen shouldn't have to [04:11] dexter_e: can mustache be used for on the fly defaulting too ? Like var a = s || "default" ? [04:11] tbranyen: excellent [04:11] tjholowaychuk: as long as it supports local vars [04:11] tjholowaychuk: and native js function execution [04:11] tbranyen: yup [04:11] tbranyen: but it doesn't support conditionals in loops [04:11] tbranyen: learned that yesterday [04:12] dexter_e: I see. Yeah I was surprised that EJS didn't support that either. [04:12] tbranyen: well in my case its a bug [04:12] dexter_e: That made me wonder why its even called Embedded Javascript [04:12] tbranyen: :-p [04:12] tjholowaychuk: ejs does [04:12] tjholowaychuk: .. [04:12] tjholowaychuk: lol [04:12] tjholowaychuk: it IS just js [04:12] tjholowaychuk: so yeah you can nest whatever you want [04:12] tbranyen: tjholowaychuk: shame there are two ejs's [04:12] tjholowaychuk: ah [04:12] tjholowaychuk: true [04:12] tbranyen: i always get confused and think of javascriptmvc's [04:12] tjholowaychuk: im writing mustache for c [04:13] tbranyen: o rly [04:13] dexter_e: actually though if you reference anything undefined in an EJS template it will halt [04:13] tbranyen: too bad mustache sucks donkey dicks [04:13] tjholowaychuk: sorry it's not mustache [04:13] tjholowaychuk: mustache-like [04:13] tbranyen: oh [04:13] tjholowaychuk: dexter_e yeah [04:13] tbranyen: yeah i derive a lot from mustache [04:13] tjholowaychuk: js will do that to you [04:13] tjholowaychuk: but that's js, not ejs [04:13] dexter_e: well JS will keep going [04:13] tjholowaychuk: no [04:14] _jgr has joined the channel [04:14] tjholowaychuk: it wont [04:14] tjholowaychuk: v8: you there [04:14] SirRonKcuhc: tjholowaychuk: SyntaxError: Unexpected identifier [04:14] dexter_e: in js if you do var s=a || b it will evaluate both. [04:14] tjholowaychuk: v8: foo || bar [04:14] SirRonKcuhc: tjholowaychuk: ReferenceError: foo is not defined [04:14] tjholowaychuk: see [04:14] jacobolus has joined the channel [04:14] Nuck: tjholowaychuk: I set up a new v8bot for us :P [04:14] stagas_ has joined the channel [04:14] Nuck: Since he's been gone forever :P [04:14] tjholowaychuk: haha [04:14] Nuck: And catb0t is a hooker. [04:14] Nuck: And a furry. [04:14] Nuck: And nobody likes furries. [04:16] tbranyen: my cat is a furry and i lurve her [04:16] tjholowaychuk: my cat is trying to drink [04:16] tjholowaychuk: my beer [04:16] Nuck: I prefer dogs [04:16] tjholowaychuk: i want a sugar glider [04:16] Nuck: They're so lovable. [04:16] AAA_awright: Hey my dog is furry you insensitive clod [04:16] Nuck: sugar glider? [04:16] tbranyen: my cat don't like my ... smoke [04:17] Nuck: AAA_awright: Mine is fuzzy :P [04:17] dexter_e: JS: var a = nonExistantValue || "default-string"; =>a:'default-string' EJS: var a = nonExistantValue || "default-string" => 'nonExistantValue is undefined' wont run. [04:17] AAA_awright: That's a subset of furry? [04:17] Nuck: AAA_awright: No, fuzzy doesn't yiff. [04:17] tbranyen: dexter_e: nonExistentValue needs to be defined [04:17] tbranyen: like scoped [04:17] AAA_awright: ahem. [04:18] tbranyen: v8> var a = nonExistentValue || "default-string"; [04:18] SirRonKcuhc: tbranyen: ReferenceError: nonExistentValue is not defined [04:18] tbranyen: v8> var a = nonExistentValue || "default-string"; var nonExistentValue; [04:18] SirRonKcuhc: tbranyen: undefined [04:18] tbranyen: v8> var a = nonExistentValue || "default-string"; var nonExistentValue; a [04:18] SirRonKcuhc: tbranyen: "default-string" [04:18] tbranyen: boom shakalaka boom [04:18] Nuck: Thank Science for open-source bots. [04:19] glen1 has joined the channel [04:19] Determinist has joined the channel [04:19] glen1: hey [04:19] dexter_e: var obj={} var a = obj.nonExistantValue || "default-string"; [04:19] dexter_e: JS works , EJS halts [04:19] tjholowaychuk: nope [04:20] hippich has joined the channel [04:20] dexter_e: JS halts too? [04:20] tbranyen: in that case it wouldn't [04:20] tjholowaychuk: if it's defined that will work [04:20] tjholowaychuk: ejs IS js [04:20] tjholowaychuk: same with jade [04:21] Nuck: Jade is just ugly. [04:21] tbranyen: pfft yeah right, i bet you wrote a parser for something almost identical to JS, but you halt on undefineds just to fuck with us [04:21] Nuck: It's powerful [04:21] Nuck: But ugly. [04:21] Nuck: Like Russia. [04:21] Corren has joined the channel [04:21] tjholowaychuk: haha yeah it takes a while to get used to [04:21] tjholowaychuk: i cant stand stuff like ejs [04:21] tjholowaychuk: personally [04:21] jerrysv has joined the channel [04:21] tjholowaychuk: i wrote a markdown to docbook compiler [04:21] tjholowaychuk: for my book [04:21] dexter_e: Is it possible to use EJS in a way that templates will render regardless of garbage going in? [04:21] glen1 has left the channel [04:21] tjholowaychuk: because i fucking hate xml [04:21] tbranyen: markdown++ [04:21] SirRonKcuhc: tbranyen has given a beer to markdown. markdown now has 1 beers. [04:22] Nuck: dexter_e: EJS is LITERALLY just JS. [04:22] Nuck: catb0t is picky with the ++'s as always. [04:22] slajax has joined the channel [04:23] dexter_e: var data={ garbage:"non-related"}; var html = new EJS({url: 'cleaning.ejs'}).render(data); Is there a way to make templates still render in this situation? [04:24] tjholowaychuk: oh you're using the lame CS ejs [04:24] tjholowaychuk: no clue [04:25] tjholowaychuk: I imagine it's similar [04:25] dexter_e: whats cs ejs ? [04:25] Nuck: client-side EJS? [04:25] dexter_e: oh [04:25] dexter_e: yeah [04:25] dexter_e: I didn't know it was lame I thought there was only one ejs wow [04:25] Nuck: Nope [04:25] tjholowaychuk: it's just a really gross implementation [04:25] Nuck: You can render on the server too [04:25] cjm has joined the channel [04:25] tjholowaychuk: like the mustache js implementation haha it's huge for something so basic [04:25] Nuck: I use it via tjholowaychuk's awesome Express. [04:26] dexter_e: I'm using ejs in node too [04:26] Nuck: dexter_e: Got NPM? [04:26] tbranyen: tjholowaychuk: i was surprised at how slow it is [04:26] dherman has joined the channel [04:26] tbranyen: not that it matters much for the size of my templates [04:26] tjholowaychuk: which? [04:26] tbranyen: mustache.js [04:26] tjholowaychuk: ejs? [04:26] dexter_e: Nuck: Yes got npm [04:26] tjholowaychuk: oh [04:26] tjholowaychuk: yeah mustache should be really optimized [04:26] Nuck: npm install ejs [04:26] tjholowaychuk: more so than ejs etc [04:26] Nuck: amirite? [04:26] tjholowaychuk: yup [04:27] dexter_e: yeah I installed ejs [04:27] dexter_e: with npm install ejs [04:27] Nuck: npm is very straightforward. [04:28] dexter_e: but I am also using EJS to render in-browser map reduce functions with underscore [04:28] hij1nx has joined the channel [04:29] dexter_e: so all UI-events just request data from the local model and the model does update-merging between clicks behind the scenes. [04:31] jakehow has joined the channel [04:31] Nexxy has joined the channel [04:31] caolanm has joined the channel [04:33] dexter_e: I think once solutions like Weld.js and Caustic are on the horizon its hard to still use {{}}<%%>type stuff. [04:33] _jgr has joined the channel [04:33] tbranyen: dexter_e: i dunno i think {{ }} will always be my first choice [04:33] tbranyen: since its so obvious whats going on [04:34] tjholowaychuk: the only inflexibility due to something like weld or caustic is the granular stuff [04:34] tjholowaychuk: other than that they are wildly more helpful [04:34] dexter_e: granular stuff like what? [04:34] dexter_e: like conditionals and stuff ? [04:34] tbranyen: tjholowaychuk: unless you are a client side developer who hates the DOM with a passion of the christ [04:34] tjholowaychuk: like if you want to set a title, and have the title represent say "User {name}" but you get an auto-generated .title(str) [04:35] dexter_e: right right [04:35] tjholowaychuk: you have to tell it some how that you want a {pre,post}fix [04:35] hij1nx_ has joined the channel [04:35] tjholowaychuk: though wth caustic you could easily hint at that [04:35] tjholowaychuk:

User {val}

etc could still be used [04:35] tjholowaychuk: tbranyen haha well we kinda have to use it [04:36] tjholowaychuk: i just dont want to write my view abstraction layer [04:36] tjholowaychuk: by hand all the time [04:36] tjholowaychuk: i dont do client-stuff often [04:36] tjholowaychuk: but that seemed obvious to me [04:37] tbranyen: i dunno just seems like your data and your view should be completely separate, that much seemed obvious to me [04:37] kawaz_home has joined the channel [04:37] tbranyen: why should i be coding all this presentation layer stuff [04:37] tjholowaychuk: they aren't separate [04:37] tjholowaychuk: decoupling css/html/js [04:37] tjholowaychuk: is BS [04:37] tjholowaychuk: IMO [04:37] tbranyen: no wai [04:37] tjholowaychuk: they are extremely coupled [04:37] Nexxy: that's what she said [04:37] dexter_e: its true [04:37] jerrysv: css/html = presentation [04:38] tbranyen: yes [04:38] tbranyen: i agree with that [04:38] Nuck: CSS and HTML are one and the same, IMO. [04:38] jerrysv: javascript = more dynamic [04:38] Nuck: JS is a bit more separate [04:38] jerrysv: though css3 transitions have approached javascript [04:38] tbranyen: jerrysv: yeah and not many people are happy about that [04:38] tbranyen: well i'm speaking for myself [04:38] Nuck: jerrysv: I disagree. transitions are something for presentation, not for action. [04:38] tjholowaychuk: plus with something like caustic, it's still separate, but WHEN/WHERE you update portions of a view [04:39] tjholowaychuk: are stil the same as rendering some template really [04:39] tjholowaychuk: Nuck: yeah I agree too [04:39] brainproxy: there's this interesting CS field called bi-directional programming, which is closely tied to the "view update" problem and involves neat concepts like "lenses" and "get put" laws [04:39] tjholowaychuk: css should have more [04:39] Nuck: JS = action, CSS/HTML = presentation [04:39] tbranyen: seems thats the same as jQuery("header").text("some header"); [04:39] tbranyen: which is ugly [04:39] jerrysv: nuck: but that line can blur some, depending on the transition [04:39] tbranyen: and shitty to work with someone else who codes like that [04:39] Nuck: CSS3 transitions are just presentation in their core [04:39] brainproxy: I think it would interesting to try to bring some of that research into templating and shared-state stuff [04:39] Nuck: jerrysv: Not that much. [04:39] AAA_awright: JS=logic, CSS=presentation, XML/RDF=data [04:39] Nuck: Some people try to use it as such [04:39] tjholowaychuk: tbranyen vs view.render({ header: 'val'}) ? [04:40] tjholowaychuk: same thing really [04:40] tjholowaychuk: one is more flexible [04:40] Nuck: But it is still not JS [04:40] tjholowaychuk: one is less flexible [04:40] dexter_e: I think things will move in the direction which Flash has actually been going. [04:40] Nuck: AAA_awright: I agree, but substitute HTML5 for XML [04:40] jerrysv: regardless, break the logic out from the presentation [04:40] dexter_e: Blackboxes of functionality [04:40] AAA_awright: Which is a subset of XML [04:40] AAA_awright: Really, I mean DOM [04:40] cha0s has joined the channel [04:40] cha0s has joined the channel [04:40] AAA_awright: Formatting doesn't really matter [04:40] tbranyen: tjholowaychuk: except that in the first example header is a DOM element that could theoretically change to