--- Log opened Sun Oct 07 00:00:13 2012 --- Day changed Sun Oct 07 2012 00:00 < etcetera> what was that node package that watched your current directory and recompiled? 00:00 < dandv> etcetera: https://npmjs.org/package/fs-watch-tree ? 00:00 < etcetera> dandv: no that recompiled your app. 00:00 < dandv> or https://npmjs.org/package/directory-tree-watcher 00:01 < dandv> oh, coffee watcher 00:01 < dandv> https://npmjs.org/browse/keyword/watch 00:04 < etcetera> dandv: https://npmjs.org/package/node-dev 00:04 < ljharb> "compiled" and "javascript". gross. 00:18 < LouisT> ljharb: https://bitbucket.org/LouisT/rps there 00:19 < LouisT> ugly code but the first thing i ever wrote with node.js heh 00:19 < Aartsie> Hi all, i'm trying to compile node.js on my Debian server but when i do make i got the message : make: command not found, what do i wrong ? 00:20 < ljharb> LouisT: nice - youre missing at the top of your html files 00:20 < ljharb> also, you should use addEventListener instead of inline event handlers 00:21 < LouisT> ljharb: yea i know all this now, like i said, that's the first thing i've ever written 00:21 < ljharb> also .ogg files don't work in every browser: http://caniuse.com/#search=ogg 00:21 < ljharb> gotcha :-) 00:21 < LouisT> which was MONTHS ago 00:21 < LouisT> sometime in 2011 00:22 < LouisT> i might add the doc type and convert the ogg to mp3 and such i guess 00:22 < LouisT> but other than that, it's not really important heh 00:25 < LouisT> oh, ljharb, ogg works in the browsers i care about.. heh 00:25 < ljharb> if it doesn't work on iphone, it doesn't work 00:26 < LouisT> i don't think audio tags even work on ios? 00:26 < LouisT> hm.. they might 00:26 < LouisT> oh it does 00:26 < ljharb> of course they do 00:27 < Aartsie> ljharb: did you compile your nodejs ? 00:27 < ljharb> i recommend soundmanager2.js for dealing with that stuff 00:27 < LouisT> k, i'll have to remember that if i ever use audio again 00:27 < ljharb> Aartsie: i ran configure/make/make install if thats what you mean, but that's compiling c, not compiling javascript. 00:28 < Aartsie> ljharb: yes that is what i mean, when i will make i get the message make: command not found 00:28 < Aartsie> Whats wrong with it ? 00:29 < ljharb> Aartsie: you need to have "gcc" installed. if youre on a mac with mountain lion (or maybe lion) you'll want to install xcode from the mac app store, and then install the command line tools from it 00:29 < Aartsie> its on a debian server 00:29 < ljharb> ok then yum install gcc or whatever applies 00:30 < Aartsie> ljharb: https://gist.github.com/73cfaa78d7e9598c7d3d 00:30 < Aartsie> ljharb: I already have the gcc packages 00:31 < ljharb> `yum install make`? 00:32 < Aartsie> ljharb: thank you that works ! 00:32 < Aartsie> since when you have to install make ? :P 00:33 < ljharb> looks like debian just doesn't include it by default for some reason 00:34 < Aartsie> yeah i think but, you can see in my gist that there are some false values in my configure... is it ok ? 00:37 < ljharb> yes, you don't want to share v8, or ssl, or zlib, with anything else 00:37 < ljharb> don't know about dtrace or etw but i'm sure it's fine 00:37 < Aartsie> ljharb: ok thank you :) 00:38 < ljharb> np 00:43 < terinjokes> why wouldn't you want to use a shared v8, openssl or zlib? 00:43 < samholmes> How do I run a command in the console from a node script? 00:45 < ljharb> terinjokes: i suppose you could, but then you have to manage those upgrades yourself 00:46 < terinjokes> ljharb: uhm, your package manage would handle that… 00:46 < ljharb> i dunno, i just use the default configure options :-p 00:59 < mscdex> terinjokes: you wouldn't want to necessarily use shared versions of those libraries because node then is not guaranteed to be stable 00:59 < mscdex> and/or not break 01:00 < mscdex> especially when it comes to v8 01:00 < ljharb> there we go, i knew there was a reason 01:04 < qmx> howdy folks! 01:04 < qmx> for auth stuff passport is the way to go? 01:15 < chovy> qmx: every-auth is another popular one. 01:18 < qmx> chovy: thanks, looking now 01:18 < qmx> I'm still getting weird session-related errors with passport 01:21 < chovy> i have not used passport. i rolled my own 01:21 < chovy> whta's the error? 01:24 < qmx> "failed to find request token in session", googling led me to https://groups.google.com/forum/?fromgroups#!topic/passportjs/I-LnOYE4Szo but none of the suggestions worked 01:25 < Sonderblade> qmx: access your site using 127.0.0.1:1234 instead of localhost:1234 01:25 < qmx> I'm using 127 01:25 < qmx> :) 01:25 < Sonderblade> is it twitter auth? 01:25 < qmx> yup 01:26 < Sonderblade> have you set the callback url? 01:27 < qmx> sure 01:27 < qmx> double-checking everything here 01:28 < Aartsie> do i have to install express for a socket.io app ? 01:28 < Sonderblade> and website to: http://127.0.0.1:1234? 01:29 < qmx> Sonderblade: found it, misplaced hosts entry 01:29 < lohkey> Aartsie: no 01:29 < qmx> thanks! 01:29 * qmx feels dumb 01:29 < qmx> :) 01:29 < chovy> qmx: i don't know if this could be the problem, but you could use a fake hostname: edit /etc/hosts and point foo.bar to your ip. 01:30 < qmx> chovy: it was something like this, goof from my part, as expected 01:30 < Aartsie> lohkey: https://gist.github.com/855f21b26fc1821251ed When i connect to it with telnet i can send 1 message ( i dont't see it on the server ) and then it kills the connection ? 01:31 < lohkey> something else is wrong then 01:31 < lohkey> do you have anything in front of node? 01:31 < lohkey> do you have multiple instances running? 01:36 < Aartsie> No this is my first code in node :) 01:39 < Aartsie> lohkey: it is very strange, i can connect but i don't receive data on the server, and when it disconnects it give no message 01:55 < mscdex> Aartsie: what code are you using on the clide side? 01:55 < mscdex> *client 01:56 < Aartsie> i got a GPS tracker that push a message to my server 01:56 < Aartsie> mscdex: my server code is : https://gist.github.com/855f21b26fc1821251ed 01:56 < mscdex> ok, but how is it pushing messages to your server? 01:56 < chrs_> anyone use node for web auth? 01:56 < Aartsie> when i do a telnet connection i can connect to the server but when i send data it won't receive on the server and i will be disconnected 01:56 < chrs_> not user+pass, just pass 01:57 < Aartsie> mscdex: Yes it push messages to my server 01:57 < mscdex> socket.io doesn't handle plain tcp connections 01:57 < mscdex> it works with browser-based and websocket connections 01:57 < Aartsie> ooh.. what can i do to fix that ? 01:58 < mscdex> Aartsie: if you are just using plain tcp, just use node's built-in net module 01:58 < chovy> how should i start my node app in prod? 01:58 < dandv> syskk, ljharb: re. handlebars' impotency: I can live with testing booleans, but what about swtich/case statements, when I want to test a variable against several values? 01:59 < Aartsie> ok but is that difficult ? i used php before and that was very difficult because i have to create a buffer 01:59 < chovy> I've seen upstart, monit, forever, and supervisor used, not sure which one or combination I should use. 01:59 < Aartsie> mscdex: ^^ 01:59 < mscdex> Aartsie: no, it's very easy 02:00 < Aartsie> mscdex: but is it async ? 02:00 < syskk> dandv: handlebars assume you will do that in your controller, not your view i suppose 02:01 < mscdex> Aartsie: yes, very simple example here: https://gist.github.com/24913cc17d24da867978 02:02 < Aartsie> thank you 02:03 < mscdex> Aartsie: then you can write to the socket with c.write() 02:04 < mscdex> chovy: i use upstart for daemonizing most of my node scripts on ubuntu servers 02:05 < Aartsie> thanx ! 02:05 < chovy> mscdex: in a nutshell, what is upstart? 02:05 < Aartsie> mscdex: Why when i will listen to 12345 i will get an error ? 02:06 < mscdex> chovy: it's ubuntu's replacement for sysvinit 02:06 < chovy> will it restart if the app crashes? 02:06 < mscdex> chovy: you can set it up to do that, yes 02:06 < mscdex> Aartsie: what error? 02:08 < Aartsie> mscdex: Thank you it works :) 02:08 < Aartsie> mscdex: And is this async ? 02:13 < mscdex> Aartsie: yes, almost everything in node core is async 02:14 < Aartsie> nice !! 02:17 < jmoyers> anyone used handlebars with tj's consolidate for express 3? 02:24 < syskk> let's say i override a method and i want to access the parent's class method, im currently doing this.__proto__.__proto__.beforeFilter(); 02:25 < syskk> is there a more elegant way to do it? 02:34 < deltab> syskk: you shouldn't rely on __proto__: that's a non-standard feature 02:35 < deltab> Object.getPrototypeOf is I believe the proper way to do that now 02:36 < trypwire_> hey all. can i ask anyone to help me figure out why my float32array values aren't getting set? https://gist.github.com/3846878 02:36 < trypwire_> "prev" and "next" in that function are themselves float32arrays 02:39 < AAA_awright> syskk: I'd assign the prototype to another method. class.prototype.x = super.prototype.y or something 02:39 < AAA_awright> Otherwise use Object.getPrototypeOf 02:40 < jmoyers> or add a __super helper 02:40 < jmoyers> to your inherits 02:40 < jmoyers> whatever you are using 02:44 < syskk> cool 02:47 < niggler> is there a way in node to set process affinities etc? 02:48 < sinclairzx> niggler: i would have thought this should be set with a hint 02:49 < niggler> you can set it by tasksetting the main process 02:50 < niggler> but itd be nice not to have to do that 02:50 < sinclairzx> wrap it up 02:52 < niggler> it might need some v8 hacking 02:52 < niggler> does v8 use pthreads? 02:52 < sinclairzx> niggler: sounds reliable 02:52 < sinclairzx> niggler: no idea 02:53 < niggler> so it looks like it uses pthreads / ntpl 02:53 < niggler> does node pull from v8 often (i.e. should a hole be poked in V8)? 02:54 < sinclairzx> niggler: no idea 02:55 < Benvie> __proto__ is part of es6 02:55 < Benvie> standardized 02:57 < jmoyers> sigh @ template engines plus spotty layout support w/ express 3 02:57 < jmoyers> wasted a stupid amount of time fooling around 03:02 < Raynos> jmoyers: ? 03:02 < Raynos> jmoyers: Just look at consolidate 03:02 < jmoyers> i did 03:02 < jmoyers> consolidate helps, but doesn't add features where they dont exist 03:02 < Raynos> what features would you need :/ 03:03 < Raynos> just use jade 03:03 < jmoyers> i was looking at handlebars, then mustache, then hogan, then through the retarded coffeescript implementations of partials and layout 03:03 < Raynos> :D 03:03 < jmoyers> jade is not my style 03:03 < Raynos> dont use layout or partials >_> 03:03 < jmoyers> i finally found: https://github.com/artspotter/hog/blob/master/lib/hog.js 03:03 < Raynos> hogan has partial support 03:03 < jmoyers> a SANE implementation, im trying it right now 03:03 < Raynos> hog is for express 2.x 03:04 < jmoyers> balblarararrarrgh 03:04 < jmoyers> haha 03:04 < jmoyers> i mean its not like the end of the world not having layout support 03:04 < jmoyers> just somewhat annoying 03:04 < jmoyers> implementations like this make my fucking eyes bleed: https://github.com/quangv/hulk-hogan/blob/master/hulk.coffee 03:04 < Raynos> dont do that 03:05 < Raynos> personally I just include header and footer 03:05 < Raynos> in all my files 03:05 < Raynos> and then im done 03:05 < jmoyers> right, thats how i used to do it 03:05 < Raynos> well actually 03:05 < jmoyers> before i got to express 03:05 < Raynos> personally I dont use a templating library :P 03:05 < Raynos> i build client-side UIs 03:05 < jmoyers> template engines i've cooked up in the past have had some base variable, like "template" that i used to do the bootstrap header and footer stuff 03:06 < jmoyers> if not attached to mustache, i just like something that looks vaguely like html and doesn't have curly braces 03:06 < jmoyers> ejs started getting on my nerves 03:10 < sinclairzx> jmoyers: i think i like mustache 03:10 < jmoyers> mustache is fine 03:10 < sinclairzx> jmoyers: yeah 03:11 < jmoyers> i just want partials and layout. but, fuck it, i'll just use hbs or some damn thing 03:11 < sinclairzx> mustache supports partials 03:11 < qmx> heh, passing the same as jmoyers :) 03:13 < sinclairzx> jmoyers: n00b question here 03:13 < jmoyers> wassah 03:13 < syskk> function A() {}; A.addToPrototype(function(name, fn) {this.name = fn;} 03:13 < syskk> is it possible to do something like this? 03:14 < syskk> i mean 03:14 < syskk> A.addToPrototype = function(name, fn) {this.name = fn;} 03:14 < sinclairzx> jmoyers: i wish to make a web request in nodejs, the 'options' are a little weird tho, i wish to simply pass a url. do you know any utility that will normalize the url? 03:14 < syskk> A.addToPrototype = function(name, fn) {this.prototype.name = fn;} 03:14 < jmoyers> like an http client request? 03:14 < sinclairzx> and give me the domain, path, port etc? 03:14 < jmoyers> oh, url parsing? 03:14 < jmoyers> sure there is a built in module 03:15 < sinclairzx> jmoyers: yup, like http client request 03:15 < sinclairzx> jmoyers: there is http, but i don't really like its interface 03:15 < jmoyers> sinclairzx mikeal's request is nice 03:15 < jmoyers> there is also a url parser 03:15 < jmoyers> https://github.com/joyent/node/blob/master/lib/url.js 03:16 < jmoyers> https://github.com/mikeal/request 03:16 < sinclairzx> jmoyers: just the url.js lib looks good :) 03:17 < sinclairzx> jmoyers: i miss the Uri class out of .NET :( 03:17 < jmoyers> sinclairzx http://nodejs.org/api/url.html 03:17 < jmoyers> this has all the same functionality 03:17 < sinclairzx> jmoyers: thanks mate, its perfect 03:19 < sinclairzx> jmoyers: also, one more quick question, what libraries exist for dealing with byte data in node? 03:19 < jmoyers> yes. 03:19 < jmoyers> what kind? 03:19 < jmoyers> https://github.com/substack/node-binary is decent for parsing streams of binary 03:20 < jmoyers> i've also used https://github.com/rmustacc/node-ctype in the past 03:20 < sinclairzx> what's node buffer? 03:20 < sinclairzx> is that useful? 03:20 < jmoyers> node has a buffer implementation 03:20 < jmoyers> yes, its nice on its own 03:20 < jmoyers> node-binary of buffertools or node-ctype have more specific conveniences for parsing things like protocol streams 03:21 < Benvie> notably node's buffer implementation significantly outperforms TypedArrays 03:21 < sinclairzx> jmoyers: i think ill check out NodeBuffer 03:21 * sinclairzx writes his own web stack 03:21 < jmoyers> err, i have no idea what NodeBuffer is 03:21 < jmoyers> the Buffer class is native to node 03:21 < jmoyers> and yes it outperforms, but specifically because it does slab allocation, right? 03:21 < Raynos> sinclairzx: use buffers 03:22 < sinclairzx> Raynos: will do 03:22 < Benvie> slab allocation helps it absolutely destroy typed arrays when measuring constructing new ones 03:22 < jmoyers> there is also a TypedArray implementation that USES node buffers, right? 03:22 < Raynos> sinclairzx: https://github.com/Raynos/routil#small-libraries don't write your own web stack 03:22 < Raynos> look at existing small libraries 03:22 < sinclairzx> Raynos: also, streaming something like a 1gig file through http should be trivial in node right? 03:22 < Raynos> and build on their shoulders 03:22 < Benvie> but it also outperforms in all operations too which is unrelated to that I believe 03:22 < Raynos> sinclairzx: depends\ 03:23 < sinclairzx> Raynos: i don't want to use express 03:23 < sinclairzx> Raynos: i typically learn tech by building things on it from scratch anyway 03:23 < Raynos> sinclairzx: I never said use express 03:23 < Raynos> I siad use small libraries 03:23 < Raynos> express is an elephant 03:23 < sinclairzx> Raynos: i only want to use things build directly into node 03:24 < jmoyers> express is fine 03:24 < jmoyers> :P 03:24 < niggler> who is actually working on the node core 03:24 < jmoyers> you minimalist hipster type 03:24 < Benvie> I would guess the performance of Buffer is attributable to it being THE core fundamental concern for Node and has received a corresponding amount of attention 03:24 < Raynos> sinclairzx: enjoy reinventing every wheel 03:24 < sinclairzx> Raynos: i don't want to use 100's of micro frameworks 03:24 < Raynos> niggler: substack is. 03:24 < Raynos> jmoyers: express is massive. 03:24 < sinclairzx> Raynos: yeah, should be fun 03:25 < jmoyers> sorry, i dont subscribe to the 20 line module craze 03:25 < jmoyers> i think its a fine thing, but im not afraid of express 03:25 < sinclairzx> Raynos: im also building everything in TypeScript 03:25 < Raynos> sinclairzx: LOL @ TypeScript 03:26 < sinclairzx> Raynos: there's nothing wrong with TS 03:26 < niggler> fuck typescript 03:26 < Raynos> sinclairzx: I wrote my own web stack on node from scratch twice. The first time was a disaster. The second time it was build on many small modules and that's basically what the routil list is 03:26 < Raynos> jmoyers: its not that large modules are bad. 03:27 < Raynos> jmoyers: It's that large module are far more likely to make trade offs that are not suitable to your needs 03:27 < sinclairzx> Raynos: but ive build web stack/frameworks before in many languages and platforms 03:27 < jmoyers> shrug 03:27 < Raynos> express makes trade offs that are not suitable to node. 03:27 < sinclairzx> Raynos: its not hard 03:27 < Raynos> It murders streams 03:27 < jmoyers> express has a clean api and does the standard things well 03:27 < jmoyers> yes, i am aware of the streaming tradeoff 03:27 < Raynos> sinclairzx: have you done it in C or C++ ? 03:27 < Raynos> if your not doing streams then your not doing node 03:27 < sinclairzx> years ago 03:28 < jmoyers> and when memory management becomes an issue for my internal app, and re-write then 10 web service handlers in a streaming way :P 03:28 < sinclairzx> Raynos: i don't subscribe to everything being streamed 03:28 < jmoyers> dogma is retarded without reason 03:28 < Raynos> streams are composable. 03:28 < jmoyers> i love streams btw, the event bus architecture i have for the apps core functionality is all streaming 03:29 < sinclairzx> Raynos: least, i don't subscribe to it from a API perspective, and yes, they are composable 03:29 < Benvie> raynos have you done anything with CPS or TCO/trampolines 03:29 < Raynos> im not saying you need to do control flow with streams. 03:29 < Raynos> but all your IO should be streaming 03:29 < Raynos> Benvie: ? 03:29 < jmoyers> so you don't buffer ever eh ;-)? 03:29 < jmoyers> must be a hard life. 03:29 < Raynos> oh I buffer 03:29 < Raynos> a lot. 03:30 < Raynos> but I still use streams 03:30 < Benvie> was just curious, I'm thinking of changing an implementation of something to use a trampoline 03:30 < sinclairzx> Raynos: you stream between disparate node applications? 03:30 < Raynos> sinclairzx: https://github.com/Raynos/chain-stream#example 03:30 < niggler> buffering is annoying 03:30 < jmoyers> buffering is convenient. 03:30 < Raynos> streams are flow control. Everything is a stream ( https://github.com/Raynos/http-stream#example , https://github.com/Raynos/events-stream#example ) 03:30 < jmoyers> and dude, thats to much fluent interface for me 03:30 < jmoyers> the 100th chain return of this is too much 03:31 < sinclairzx> Raynos: me also, i don't understand what it's actually doing 03:31 < Raynos> jmoyers: thats because its a stupid example that shows everything in one go. 03:31 < Raynos> but I write crazy code >_> 03:31 < Raynos> I'm just as bad as Benvie & gozala 03:31 < jmoyers> crazy code is hard to read 03:31 < gabrieluk> if i want to add real time date in my express app, what should i use? 03:31 < sinclairzx> Raynos: you would probably enjoy programming modern graphics cards 03:32 < Benvie> over the last few days I wrote a js interpreter that uses CPS, so code written normally can be executed asynchronously, or paused and rewound, or all state serialized and saved 03:32 < Raynos> Benvie: whats the diference between CPS & trampolines 03:32 < jmoyers> i've had to inherit too much fucked up shit in my career to write mind melting functional transforms 03:32 < Benvie> CPS needs trampolines, or cheats using setTimeout 03:32 < Benvie> to drop the stack 03:32 < Raynos> Benvie: that's a nice toy but bad for maintainability. 03:32 < Benvie> right now I just dump the stack every 100 or so frames deep 03:33 < Raynos> callbacks are nice because they are incredibly explicit 03:33 < Raynos> Benvie: Do you have any tools for crazy live editing environments? 03:33 * jmoyers wants to start a flame war 03:33 < jmoyers> i love await, screw callbacks! 03:33 < Benvie> I developed this primarily with the intention of using it as a sandbox to deeply introspect code as you develop it in your dev environment 03:33 < Benvie> not so much for use in live code 03:33 < Raynos> Benvie: do you use esprima and if not why not? 03:33 * jmoyers kids, he kids 03:33 < Benvie> yeah 03:34 < Benvie> it executes the parser API AST 03:34 < Raynos> Benvie: you dont need deep introspection. The hardest problem is visualizing streams 03:34 < Raynos> I need to visualize how data comes in, gets transformed and leaves my process 03:34 < Benvie> which of course doesn't help if you're not using streams 03:34 < Raynos> I also need to visualize the current global state of the application 03:34 < Benvie> like say you're writing a gui 03:34 < Raynos> Benvie: A gui is a stream 03:34 < Benvie> yeah but that's what this does 03:35 < Raynos> streaming input DOM events, streaming DOM manipulation as output 03:35 < Benvie> instead of variables being hidden in an invisible variable record in callbacks 03:35 < Raynos> the rest is manipulation of streams 03:35 < Benvie> you can see the variable record like any other object' 03:35 < Benvie> you can see where the declarations are 03:35 < Raynos> Benvie: You mean the local scope object? 03:35 < Benvie> yes 03:35 < sinclairzx> Raynos: im really enjoying TS btw, have you had a chance to play around with it yet? 03:35 < Benvie> more fine grained 03:35 < jmoyers> you are in the like the 3rd ring of hell 03:35 < Benvie> block level scoping to support let 03:35 < Raynos> sinclairzx: TypeScript is a nice idea. I wont use it until I have a tool that supports it and runs on linux 03:35 < Raynos> I also hate compile to X languages 03:36 < sinclairzx> VIM works i think 03:36 < jmoyers> when you see the world in your favorite abstraction, every problem boils down to that abstraction ;-) 03:36 < sinclairzx> to what degree, im not sure 03:36 < Raynos> I wouldnt mind bullying the TypeScript team into solving the hard problem of making TypeScript work with pure JS and external type annotation files 03:36 < Benvie> I implemented a full js runtime, on top of js. Kind of like narcissus 03:36 < Benvie> but not as...arcane 03:36 < Raynos> jmoyers: It does. It's the best 03:36 < sinclairzx> jmoyers: that is very true 03:36 < Raynos> Benvie: is it your career or hobby to build tooling? 03:37 < Benvie> no one pays me to sadly 03:37 < Raynos> Benvie: when your in SF we should have lunch. 03:37 < Raynos> im sure you'll come down here at some point next year 03:37 < Benvie> I do client work the minimum amount I need to in order to not work for months at a time 03:37 < Benvie> so I can do this stuff 03:38 < Benvie> https://github.com/Benvie/js-astify/blob/master/lib/interpretor.js 03:38 < Benvie> you can do 03:38 < Raynos> Benvie: What do you think about light table and using it to build tools on top of it? 03:38 < Benvie> var x = new Interpretor; x.execute('var x = n => n * 3; [1,2,4,5].map(x)') 03:39 < Benvie> and you can see all the scope objects, and the global scope, and the completion value, etc. 03:39 < Benvie> that is exactly what I want to build 03:39 < Benvie> that's what the carrot I've been chasing with all these related things 03:39 < Benvie> to give full depth and breadht to the code your write as you write it 03:40 < Raynos> Benvie: You want to build light table? 03:40 < Benvie> to see options side by side based on the code, to see the visual representation of it in a way that's useful for comprehension 03:40 < Raynos> well theres two things 03:40 < Benvie> something like it 03:40 < Raynos> there is visualization 03:40 < Raynos> and then there is static analysis 03:40 < Benvie> yeah 03:41 < Raynos> visualization for debugging 03:41 < Raynos> and static analysis for code understanding 03:41 < Raynos> I still havn't found a solid way to get docs in my editor for shit 03:41 < Raynos> nor a solid way to discover npm modules 03:41 < Benvie> http://worrydream.com/LearnableProgramming/ says that visualization is as much part of the process of creating as it is for analysis 03:42 < Benvie> or it should be, but it's hard to do 03:42 < Benvie> it is for me 03:42 < Benvie> this is why UltraREPL exists and a dozen things I've made related 03:43 < Benvie> I did in a repl half the time just pouring over stuff like a giant box of legos 03:43 < Raynos> Benvie: UltraREPL isn't as useful as I wanted :( 03:43 < Raynos> I did a little REPL hack 03:43 < Benvie> the console is limited 03:43 < Raynos> to spawn up a REPL and load a file into it 03:43 < Benvie> I started building the next generation of it 03:43 < Raynos> so I can play with local tokens 03:44 < Benvie> ultra repl has a lot of features that do a lot of thigns that one one knows how to use 03:44 < Benvie> .load ./filename.js 03:44 < Raynos> that doesnt handle file local requires 03:44 < Raynos> if its anything like node's REPL's .load 03:45 < Benvie> it's not but I don't think it does what you're saying either 03:46 < Benvie> if (!params) params = this.context.current.locals.__filename; 03:46 < Benvie> so if you were to do 03:46 < Benvie> __filename = '/dev/whatever.js' 03:47 < Benvie> it defaults to a folder in the ultra-repl location, and each context saves to a corresponding file 03:47 < Benvie> so you'd end up with alpha.js, beta.js in ./ultra-repl/library 03:47 < Benvie> var code = this.context.current.getExecutedCode(); file.write(code); 03:49 < Benvie> but I started building a version using appjs that has configurable pannels, with draggable splitters, maximizable panels, etc. 03:50 < Benvie> this I want to build out into a full editor with integration of live code interpretation and analysis and introspection 03:51 < Benvie> think like a code editor where each bit of code can be moused over and clicked on to expand information, replace with similar code, or executed in place 03:52 < Raynos> Benvie: I should use appjs at some point 03:52 < Benvie> it's quite useful to have the APIs from node and chrome together 03:53 < Benvie> like I use node's require system but extended out to run in chrome for requiring stuff, without having to build or use browserfy or whatever 03:54 < viktor_> hi! 03:54 < Benvie> http://bbenvie.com/img/devenv2.png you can see the echos of ultra-repl in it 03:54 < Benvie> but hey the mouse does stuff too 03:55 < dandv> how does appjs compare with meteor? 03:55 < Benvie> not similar 03:55 < mhr> dandv, they're unrelated 03:56 < Benvie> appjs is a node module that exposes chromeless chrome browser contexts 03:56 < Benvie> on the desktop 03:56 < dandv> "Open Source , event driven framework for building rich applications within an ECMAScript compliant environment including Web Browsers and V8 on the server." ? -- https://twitter.com/AppsJS 03:56 < dandv> oh, that's appSjs 03:56 < aMoniker> Is there a good library for doing basic server-side pubsub? 03:57 < jmoyers> more apt comparison 03:57 < jmoyers> is appjs and node-webkit 03:58 < Raynos> Benvie: how do you plan to do it without build or browserify? 03:58 < Raynos> aMoniker: mediator 03:59 < Raynos> Benvie: I find massive objects hard to read 03:59 < Raynos> Benvie: I can't visualize how watching the state of a large object with many nested properties helps me understand a program 04:04 < Benvie> yeah I agree 04:04 < Benvie> that's just an initial stab but not the desired goal 04:04 < Benvie> appjs provides direct access between objects in node and the DOM 04:05 < Benvie> and even includes a require-in-browser built in functionality 04:06 < Benvie> which integrates with the existing node module system but adds the ability to compile in the browser context when desired (while still being a "normal" node module capable of having parent modules that were run in node) 04:06 < Raynos> Benvie: I should play with appJS 04:07 < Benvie> so I simply have my index.js which loads appjs, then I do window.require('./browser-main') or whatever 04:07 < Benvie> which is organized like a node module but interacts with DOM apis 04:07 < Benvie> and has the window as its global object 04:07 < jmoyers> you have to use path.join these days to maintain windows support re: delimeters, correct? 04:08 < Benvie> https://github.com/Benvie/metaspect/blob/master/data/index.js is an example of this 04:08 < zezikaro> hi does anyone know how to install phatomjs or zombie js or anything like that on windows? 04:08 < zezikaro> I keep getting exceptions of 04:08 < zezikaro> npm ERR! `cmd "/c" " 04:08 < zezikaro> etc 04:08 < Benvie> this file is the main browser module 04:08 < zezikaro> could anyone help me please 04:09 < Benvie> for that project I mean 04:10 * sinclairzx wonders if microsoft will release a nodejs web stack 04:11 < sinclairzx> that would be awesome 04:11 < Raynos> Benvie: https://github.com/Raynos/browserify-server/tree/master/example 04:11 < sinclairzx> ASP.NODE 04:11 < Raynos> I've been using browserify-server as a static file server with browserify recompilation on file watch instead 04:11 < jmoyers> heh 04:11 < jmoyers> kind of counter node community if you ask me 04:11 < sinclairzx> community is overrated 04:11 < Benvie> yeah the end result looks like similar code 04:12 < Benvie> node require semantics next to document.body 04:12 < Benvie> browserify works on the web, but has to go the extra mile to fake it 04:13 < Benvie> appjs brings the web to node but of course you won't be building things in it that live on the web generally 04:13 < gabrieluk> i'm trying to figure it out how to use this https://github.com/JerrySievert/node-date-utils . it says: $ npm install date-utils than require('date-utils');. ok, that is fine, i know where require('date-utils'); goes, but where am i supossed to insrt those methods such as Date.today();? 04:14 < Raynos> chjj: ping 04:14 < Raynos> sinclairzx: you kidding me? 04:15 < Raynos> You want to do it manually raw to the metal 04:15 < Raynos> and then your asking for a bloated fully microsoft integrated framework? 04:15 < sinclairzx> Raynos: that would be ace 04:15 < Raynos> sinclairzx: http://ayende.com/blog/72705/node-cs 04:16 * sinclairzx adds it to the TS feature request 04:16 < sinclairzx> Raynos: yup, the TPL is ace 04:21 < syskk> can anyone help me with this: https://gist.github.com/3847096 ? 04:21 < syskk> i think there's something i dont get with prototypes 04:21 < syskk> see expected output at bottom 04:24 < jmoyers> syskk are you writing node specific code 04:24 < syskk> not in this case 04:25 < jmoyers> well 04:26 < jmoyers> you can look at two things 04:26 < jmoyers> https://github.com/joyent/node/blob/master/lib/util.js#L525-548 04:26 < jmoyers> perhaps coffeescripts __extend implementation 04:26 < jmoyers> since its designed to go back as far as ie6 i think 04:27 < Raynos> syskk: you need to overwrite the the arrays 04:27 < Raynos> ApplicationController.prototype.actions_ = {} 04:28 < syskk> i don't get why AccountController and HomeController share the same hash 04:28 < syskk> yea, should be https://gist.github.com/3847096 04:28 < Raynos> because its a bug 04:28 < syskk> i mean ApplicationController.prototype.actions_ = {} 04:28 < Raynos> yeah do that 04:29 < Raynos> also dont use an array 04:29 < Raynos> use an object 04:29 < syskk> yea, i fixed that 04:29 < Raynos> also dont use controllers 04:29 < syskk> but I still don't get the desired behavior 04:29 < Raynos> this is not rails 04:29 < syskk> i am not. just a dummy example 04:30 < syskk> mm is it because objects are passed by reference maybe? 04:34 < syskk> ok. it works if i reset the actions_ property 04:39 < niftylettuce> any node dev's here have a nexus7? 04:50 < syskk> how to clone an object in Node.js? 04:51 < syskk> Object.create(obj) right? 04:51 < SomeoneWeird> definec lone 04:51 < SomeoneWeird> define clone* 04:54 < syskk> copy 04:54 < SomeoneWeird> new Object(obj) should work too 04:55 < SomeoneWeird> >> new Object({a:"b"}); 04:55 < purr> SomeoneWeird: (object) {a: 'b'} 05:10 < chovy> mscdex: thnaks 05:32 < Raynos> Here's an interesting require problem 05:32 < Raynos> You give me an uri to a file. I require that file. That file requires an npm module. I want to mutate the state of that npm module without knowing where it is or how to get it 05:32 < Raynos> Any way to do that without global backdoors? 05:38 < deltab> Raynos: redefine 'require'? 05:38 < Raynos> deltab: can't do that. it's a local variable 05:38 < deltab> ah 05:38 < Raynos> ive found another backdoor 05:38 < Raynos> which is abuse browserify 05:47 < jmoyers> raaaar 05:52 < Raynos> abusing browserify is so easy and fun :D 05:57 < Raynos> AST munging is fun 06:01 < niggler> blah im debating whether it makes more sense to rework jison or to start fresh 06:37 < Sven_vB> jison looks fine 06:40 < ranyu> i have a problem with async.queue ; in this example code i push 2 tasks to the queue but only the first one gets executed 06:40 < ranyu> http://pastebin.com/qZU4cXsn 06:41 < ranyu> can anyone tell me what im doing wrong? 06:54 < deltab> ranyu: nothing obvious to me 07:11 < etcetera> is there anything similar to node-dev? 07:11 < etcetera> https://github.com/fgnass/node-dev 07:12 < etcetera> hmm, nodemon is much more popular. 07:12 < jmoyers> supervisor 07:12 < jmoyers> is another. 07:14 < Raynos> supervisor++ 07:14 < Raynos> forever should be used if you want a more background solution 08:00 < chjj> Raynos: whats up 08:00 < Raynos> chjj: was going to ask about marked 08:00 < Raynos> but forgot what 08:00 < chjj> Raynos: hehe, alright 08:00 < chjj> Raynos: sorry i took so long to respond 08:01 < Raynos> its cool 08:01 < Raynos> lets see if i can jog my memory 08:02 < Raynos> chjj: maybe you should default the highlight function to highlight.js 08:03 < chjj> Raynos: maybe 08:09 < Raynos> chjj: is there any way to share links between multiple markdown snippets? 08:09 < Raynos> I have a [1]: link declaration and want to share among multiple snippets 08:11 < chjj> Raynos: like a global variable? or some kind of included file? marked doesn't do any kind of IO so the latter isnt possible, and neither is the first. however, you could hook into the parser and always add something to the `.links` object if you really wanted. 08:12 < Raynos> well i have a weird program 08:12 < Raynos> that parser markdown out of javascript comments 08:12 < Raynos> and each is considered a seperate snippet 08:12 < Raynos> I guess I can invoke the lexer manually 08:12 < Raynos> and then mess around with thelinks object 08:13 < chjj> Raynos: hook `marked.parse` and just ensure that `tokens.links[1]` exists. 08:13 < chjj> Raynos: that would be the easiest way 08:14 < Raynos> :) 08:14 < Raynos> sweet 08:52 < dandv> Hmm WAY more people here than in #meteor 08:53 < SomeoneWeird> i wonder why... 08:53 < yawnt> lol 08:54 < Raynos> ... 08:54 < Raynos> why on earth would there be more peopel in meteor 08:56 < Sven_vB> what is meteor? 08:56 * SomeoneWeird unsure whether Raynos mean't that as a pun or not 08:56 < Raynos> conincidence 08:57 < Raynos> meteor is a silly framework 08:58 < chovy> i have a few lines like this: 08:58 < chovy> exports.foo = function(){ }; 08:58 < chovy> exports.bar = function(){} 08:58 < chovy> how can i call foo from bar? 08:58 < kuja> exports.foo() 08:58 < chovy> do i just do exports.foo() ? 08:58 < chovy> k 08:58 < Raynos> ... 08:58 < kuja> alternatively 08:59 < Raynos> make them local variables 08:59 < kuja> exports.foo = function foo() {} 08:59 < Raynos> kuja: that wont work 08:59 < Raynos> exports.foo = foo; ... later ... function foo() { } 08:59 < kuja> oh, well then exports.foo = foo 08:59 < Raynos> but exports is bad 08:59 < Raynos> dont do that. 08:59 < Raynos> use module.exports = singleFunction 09:00 < kuja> You mean to promote small modules? 09:01 < kuja> (why is it bad to export multiple functions) 09:02 < deoxxa> Raynos: wat 09:02 < deoxxa> Raynos: that would so work 09:02 < deoxxa> you're correct in that it's not the best way to do it, but it's not specifically wrong either 09:03 < deoxxa> kuja: smaller module means smaller api surface and less room for dubiously related functionality to creep in 09:03 < chovy> i have a lot of exports.whatevers 09:03 < chovy> in same file 09:04 < Raynos> its bad to export multiple things 09:04 < kuja> deoxxa: Yeah I understand, I was just wondering if that was actually the reason or not for saying one should export a single function 09:04 < Raynos> if you need multiple tokens 09:04 < Raynos> do module.exports = { ... } 09:04 < deoxxa> Raynos: you are a man of contradictions 09:04 < Raynos> not contradictions. 09:04 < chovy> what's the diff between module.exports = {} and exports = {} 09:04 < Raynos> its about 09:04 < deoxxa> > it's bad to export multiple things 09:04 < Raynos> defining your exports in one place 09:04 < deoxxa> > do module.exports = { ... } 09:04 < Raynos> exports.x = ... 09:04 < Raynos> is scattered all over the file 09:05 < Raynos> module.exports = { .. } is one statement 09:05 < Raynos> it helps readability 09:05 < chovy> so i have to do: 09:05 < deoxxa> that pretty strongly falls into the territory of opinion and taste, Raynos 09:05 < chovy> exportable = { foo: fn1, bar: fn2 }; module.exports = exportable; 09:05 < chovy> how is that better? 09:06 < kuja> chovy: IMO it is up to you to decide that 09:06 < kuja> I think we are discussing preference here 09:06 < chovy> k 09:06 < Raynos> not realy 09:06 < kuja> That's what it's reading like. 09:06 < pyrotechnick1> http://bikeshed.com/ 09:06 < chovy> but do i need the modules.exports vs. just exports? 09:06 < Raynos> exports is fine 09:06 < Raynos> just make sure you do it all in one place 09:06 < pyrotechnick1> http://violet.bikeshed.com/ 09:06 < Raynos> and dont mix logic & exporting 09:07 < chovy> what do you mean all in one place? 09:07 < deoxxa> Raynos: please. if you don't know the answer, don't just guess. 09:07 < Raynos> ~_~ 09:07 < chovy> i export each function i want to expose. 09:07 < icebox> chovy: usually, when a style matter arises, I give a look at other projects 09:07 < chovy> seems pretty similar to just doing public foo() in php 09:07 < deoxxa> chovy: yes, there's a difference between module.exports and exports when you're assigning something to it wholesale. `module.exports = "x"` will not do the same thing as `exports = "x"`. 09:08 < chovy> i typically do this: 09:08 < deoxxa> chovy: `exports = "x"` will only modify a local variable, whereas `module.exports = "x"` will do what you'd expect it to do. 09:08 < chovy> exports.foo = {} 09:08 < chovy> exports.foo.bar = fn; 09:08 < chovy> exports.foo.biz = fn2; 09:08 < chovy> i find it easier to organize this way, so if there's a compelling reason not to do this...i'd like to know why 09:09 < chovy> i suppose i could do: 09:09 < chovy> var foo = {}; 09:09 < chovy> foo.biz = fn1; 09:10 < chovy> foo.baz = fn2; 09:10 < chovy> exports = foo; 09:11 < kuja> I think you'd want module.exports = foo in that case 09:12 < jaseemabid> I have a small node module with few c++ functions on it. I named it foo and building it produces foo.node. Where do i add the js code if i want to add a JavaScript function onto my module? 09:12 < kuja> But sure, you could do that if you'd like. I like icebox's suggestion, look at other peoples' code and go with what works best for you (for me, I like to look to isaacs' stuff for guidelines) 09:13 < chovy> kuja: what's the diff bewteen module.exports and just exports? 09:13 < kuja> To quote deoxxa from a moment ago: "< deoxxa> chovy: `exports = "x"` will only modify a local variable, whereas `module.exports = "x"` will do what you'd expect it to do." 09:13 < deoxxa> my basic thing is like `var Derp = module.exports = function Derp() {}; Derp.prototype.herp = function herp(lol, wut) { return lol + wut; };' 09:14 < kuja> chovy: They are the same object, however when you do "exports = something" you are assigning a local exports variable. 09:14 < kuja> And thus module.exports and exports become different objects 09:17 < chovy> ok 09:19 < Raynos> exports is a local variables 09:19 < Raynos> module is a local variable 09:19 < Raynos> module.exports === exports 09:19 < Raynos> when you require a module you get whatever the value of module.exports is 09:20 < Raynos> so when you overwrite the local exports variable with a new value you dont change module.exports at all 09:20 < chovy> k, now i'm confused 09:20 < kuja> Raynos laid it out pretty clearly ;) 09:20 < chovy> is it safe just to always use module.exports = foo; 09:20 < kuja> Yeah it is 09:21 < nathan7> var exports=module.exports={}; 09:21 < Raynos> module.exports is always safe 09:21 < nathan7> that's basically the default 09:21 < nathan7> You can overwrite module.exports all you want after that 09:24 < mauritslamers> chovy: what can help is to see what require does exactly when loading a file 09:25 < mauritslamers> it wraps your code in a function, like function(global,module,exports){ // your code } 09:25 < chovy> ok 09:26 < mauritslamers> so, that explains how module and exports exist in a code file 09:26 < chovy> i think to keep it simple i will declare an object, and then only assign once at the bottom. 09:26 < mauritslamers> and exports is also a property of module 09:26 < chovy> to exports.module = myobj 09:26 < mauritslamers> chovy: that won't work 09:26 < kuja> Why not at the top for readability sake? :D 09:26 < kuja> module.exports = myobj 09:26 < chovy> myobj is't defined yet 09:26 < chovy> i should probably read about modules 09:27 < kuja> var myobj = module.exports = {} 09:27 < chovy> and i can add to it after that? 09:27 < mauritslamers> chovy: the reason why I said the thing about require, is exactly that 09:27 < mauritslamers> y 09:27 < mauritslamers> ou 09:27 < mauritslamers> are writing code as in a function 09:27 < mauritslamers> so variables have function score, and are hoisted 09:27 < kuja> chovy: Sure, why not? Both variables are referencing the same object. 09:27 < chovy> ok 09:27 < chovy> makes sense 09:28 < mauritslamers> so wherever you define a variable, it will be hoisted to the top in order to be function scoped 09:29 < Raynos> just do an object literal 09:29 < Raynos> module.exports = { method1: method1, method2: method2 } 09:30 < chovy> Raynos: i think that will become unmanagable 09:30 < chovy> trying to track down where ending }'s are 09:31 < dandv> Sven_vB: don't listen to Raynos. Meteor is a really awesome framework based on node.js, check http://meteor.com/screencast 09:31 < chovy> i like foo.bar = function(){ 09:31 < chovy> }; 09:31 < gildean> chovy: get a decent editor that will hilight your brackets etc. 09:31 < kuja> chovy: I think he means that you can do: module.exports = {foo: foo}; function foo() {} 09:32 < kuja> But that seems like a matter of preference. 09:32 < chovy> i see 09:34 < rendar> hey meteor seems great 09:34 < yawnt> lolno 09:35 < jaseemabid> Need help adding both javascript functions and c++ functions on a module. Can anybody point me to some good examples/tuts? I can to do the basic job in c++ and make it *cleaner* in javascript. Now i compile and end up with a module.node file which i can require. I dont know where i can add js code in this 09:35 < jaseemabid> Sorry, i meant "I *want* to do the basic job in c++ and make it *cleaner* in javascript" 09:36 < icebox> jaseemabid: https://github.com/rbranson/node-ffi maybe it is a viable approach in your context 09:37 < jaseemabid> icebox, Thanks 09:38 * sinclairzx grumbles 09:40 < rendar> yawnt: why not? 09:41 < yawnt> cause 09:41 < yawnt> it's like nodejs without everything nodejs has 09:41 < rendar> hmm 09:41 < yawnt> so you lose all the wonderful community and userland stuff that nodejs has 09:41 < rendar> i see 09:42 < rendar> yawnt: but all node.js packages can't be used with that? 09:43 < jaseemabid> icebox, I cant figure out how its all linked together. binding.gyp links to a cpp file. Dont know were you call the js files. 09:43 < rendar> yawnt: well they have different apis, so i guess not.. 09:43 < yawnt> long story short is 09:43 < yawnt> if you use meteor 09:43 < yawnt> you are not using node 09:44 < yawnt> but yeah.. packages can be ported to meteor 09:44 < rendar> yawnt: i see 09:44 < icebox> jaseemabid: it is an addon for loading and calling dynamic libraries using js, not viceversa 09:45 < rendar> yawnt: how node.js packages are written? using node.js apis? i mean, if i have another js framework like node, i couldn't run node's packages because they use different apis.. 09:45 < icebox> jaseemabid: js -> c/c++ dynamic libraries 09:45 < jaseemabid> icebox, I want to define module.foo with c++ and module.bar with js. Thats all 09:46 < icebox> jaseemabid: and then? what is your use case? 09:46 < icebox> jaseemabid: bar calling foo? 09:46 < jaseemabid> icebox, might happen. Is that important? 09:47 < hemanth_> i'm working with cluster, i have 4 workers listening on the same port, it being an HTTPServer, why does only 2 workers respond for each web request? and curl call from CLI is just one worker responding 09:47 < icebox> jaseemabid: well... that choice defines your tools :) 09:47 < jaseemabid> icebox, module.foo with c++ is done. I just dont know where put module.bar source. Now I compile and get a module.node. 09:48 < SomeoneWeird> jaseemabid, create index.js which requires module.node and export foo and bar from that 09:48 < icebox> jaseemabid: ok... I have been saying another thing 09:49 < SomeoneWeird> ? 09:49 < jaseemabid> SomeoneWeird, make module_cpp, require it in js and add js stuff onto that? 09:49 < SomeoneWeird> mhm 09:50 < jaseemabid> SomeoneWeird, So in my package.json, i say entry point is this index.js? 09:50 < SomeoneWeird> yerp 09:50 < jaseemabid> Ah, lot of refactoring now i guess. 09:51 < SomeoneWeird> shouldn't need to? 09:51 < SomeoneWeird> in index.js just do exports.bar = require('./module.node'); exports.foo = function() { console.log('whatever foo is'); }); 09:51 * jaseemabid main in package.json saves the day 09:52 * jaseemabid is happy with the solution. Thanks SomeoneWeird icebox :) 09:53 < icebox> jaseemabid: you are welcome 10:03 < Gekz> is it enough to use socket.io over HTTPS, or do I need to think harder to make sure it doesn't leak data out of an insecure websocket? 10:07 < tuhoojabotti> hey icebox 10:08 < icebox> tuhoojabotti: hey 10:08 < icebox> tuhoojabotti: thanks for the latest commits 10:08 < icebox> tuhoojabotti: the latest changes for my user completing would be nick, join and part of the other users :) 10:09 < tuhoojabotti> yeah 10:09 < icebox> *completion 10:12 < tuhoojabotti> icebox: only my computer just broke. :P 10:13 < Raynos> chovy: dont inline those methods. literallyt { foo: foo, bar: bar } ... function foo() {} function bar() {} 10:13 < Raynos> chovy: function declarations hoist up 10:14 < icebox> tuhoojabotti: sigh! :( 10:18 < hemanth_> are cluster deffered ? 10:23 < dandv> anyone using Handlebars? what do triple {{{ mean ? (posted at https://github.com/wycats/handlebars-site/issues/28 an example) 10:25 < sinclairzx> dandv: im using mustache 10:26 < icebox> dandv: I think it is about a safe string or not 10:27 < dandv> I found the Handlebars docs annoying and lacking... triple { vs double { isn't explained 10:33 < sinclairzx> hmm 10:38 < sinclairzx> hey all, is it fairly common to find the "on" and "data" and "end" events on stream things? 10:47 <@mbalho> sinclairzx: https://github.com/substack/stream-handbook http://nodejs.org/api/stream.html 10:49 < sinclairzx> mbalho: cheers 10:55 < sinclairzx> mbalho: take a bit of effect to think asynchronously aye 10:58 < mafiahunt> Would node.js be a good choice for a web mafia game? 10:58 < mafiahunt> Mafia is basically text based chat. 11:00 < yawnt> mafiahunt: sure 11:01 < dandv> mafiahunt: meteor would be bette 11:02 < mafiahunt> dandv: I've looked into meteor but.. it seems like a security nightmare 11:02 < dandv> mafiahunt: it's not. they just haven't updated the docs. essentially, you put your server code in the server/ directory. see also http://britto.co/blog/security_with_meteor 11:02 < dandv> and the auth branch lets you prevent modifications to the DB 11:03 < dandv> I REALLY wish the meteor guys covered security in the screencast, because this turns off many new devs 11:04 < mafiahunt> I think I'll build the game / chat part with meteor 11:05 < mafiahunt> and the others like community, forums, accounts with PHP 11:05 < mafiahunt> Would this be possible? 11:06 < deoxxa> dandv: i really wish they covered how to use npm with it as well 11:06 < deoxxa> dandv: and if they maybe covered how the architecture is well thought-out and at all a good idea 11:06 < yawnt> why would you use meteor when there's derby 11:06 < deoxxa> dandv: and maybe if they also described how they manage to keep a straight face while saying some of the things they say 11:06 < yawnt> at least derby is nodejs 11:08 < dandv> deoxxa: meteor's smart packages are more complex than npm. But to use node modules, see https://github.com/tmeasday/unofficial-meteor-faq#what-about-node-modules 11:09 < deoxxa> dandv: apologies, that was all sarcasm. meteor is a steaming pile of feces. 11:09 < dandv> yawnt: meteor is much more actively developed, better funded, and better marketed 11:09 < yawnt> and sucks more too 11:09 < yawnt> :D 11:10 < deoxxa> lol @ smart packages 11:10 < yawnt> ^ 11:10 < deoxxa> dandv: you're not going to find a lot of love for meteor here. they basically took node and removed the two coolest parts - asynchronous program flow and npm. 11:10 < yawnt> i'll tell you what dandv .. i've known geoff and n1mmy since way before meteor became meteor.. it was called skybreak 11:11 < yawnt> and i liked what they were building 11:11 < yawnt> but as time passed it become more and more a platform itself 11:11 < yawnt> so yeah.. it raised a tons of millions.. but why would you throw away everything npm has to offer? why would you use fibers when callbacks is the de-facto standard? 11:11 < dandv> hm... I just read all of nodebeginner.org today but I'm new to meteor. 11:11 < yawnt> it's not nodejs.. it's a whole other platform 11:12 < deoxxa> mmm 11:12 < yawnt> you like it? fine.. but don't talk about meteor as if it was nodejs 11:12 < mafiahunt> What about node.js + express + socket.io? 11:12 < yawnt> i like that better 11:13 < dandv> yawnt: why use fibers? because http://bjouhier.wordpress.com/2012/03/11/fibers-and-threads-in-node-js-what-for/ 11:13 < yawnt> wops 11:13 < yawnt> sorry deoxxa 11:13 < yawnt> didn't read you already spoke bout async and npm 11:13 < yawnt> ;_; 11:13 < yawnt> I BEG YOUR PARDON, SIR 11:13 < mafiahunt> http://www.nodebeginner.org/ is great, ty for sharing 11:14 < yawnt> dandv: i never found myself to have pyramids of doom 11:14 < dandv> you can use Aync with meteor, http://gist.io/3443021 11:14 < yawnt> i think the reason why meteor choose fibers was only a matter of target 11:14 < yawnt> people aren't used to callbacks 11:14 < yawnt> so you get more users if you have everything in a sync fashioned 11:15 < yawnt> *fashion 11:15 < dandv> mafiahunt: I'm no expert in either node.js or meteor, but it seems to me that yawnt and deoxxa are just a bit bitter... your choice 11:16 < dandv> yawnt: yes, meteor's target is to make web development easy, for complex business logic as well, where you do end up with callback pyramids 11:16 < yawnt> i've seen a lot of complex code 11:16 < yawnt> working perfectly with no pyramids at all 11:17 < dandv> did it use streamline.js? 11:17 < yawnt> no 11:18 < mafiahunt> which one is easy to learn / use? It's going to be my first 'real' node.js project 11:18 < dandv> mafiahunt: check out https://vimeo.com/49433252 11:25 < mafiahunt> Wait 11:26 < mafiahunt> Meteor isn't asynchronous? 11:26 < yawnt> yeah 11:26 < yawnt> but it looks like it's not 11:28 < mafiahunt> I see, ok 11:50 < jaseemabid> [npm install ./] is not moving local package to ~/node_modules so im unable to require it somewhere else. How do i fix this? 11:59 < milani> jaseemabid, go tou your somewhere-else, then npm install /path/to/your/module 12:06 < fotoflo> Hey all. What is the best library for doing Facebook 0auth? 12:07 < fotoflo> is it DracoBlue? (8 months old) 12:07 < milani> fotoflo, what abt everyauth? 12:07 < milani> fotoflo, https://github.com/bnoguchi/everyauth 12:08 < fotoflo> looks good 12:09 < yawnt> fotoflo: passport 12:09 < yawnt> don't use everyauth 12:09 < yawnt> it's an API nightmare 12:15 < fotoflo> ughh, internet snow day here 12:17 < fotoflo> yawnt: if I've already built a local way to authenticate users, will i have to throw it out and switch to passport for local authentication? 12:17 < yawnt> fotoflo: passport supports multiple auth 12:18 < fotoflo> yawnt: i see that 12:18 < yawnt> so you can have local and facebook 12:18 < yawnt> side by side 12:18 < fotoflo> right, but i should throw out my existing local and switch to passport 12:18 < Mandragor> Hi all 12:18 < yawnt> fotoflo: i'd do that 12:20 < Mandragor> First time for me on this irc chanel 12:20 < yawnt> welcoem 12:20 < Mandragor> hoped I'd could find some help for trying to make a socket.io app work 12:22 < Mandragor> I can manage to make a Handshake between my server and my other client server but ... have problems to make the respound go to the client .... 12:22 < Mandragor> can't figure why 12:22 < Mandragor> and getting desperate 12:26 < Mandragor> anyone could help for a socket.io problem ? 12:26 < Mandragor> for a crossdomain server 12:26 < Mandragor> ? 12:30 < Mandragor> Does anyone tryed a sockeT.io cross server application ? 12:34 < max``> . 12:35 < Mandragor> anyone active here ? 13:24 < syskk> is it possible to know at runtime how many arguments are in a function definition? arg_count(function(a,b,c) {}) should return 3 13:25 < TehShrike> syskk: https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Functions_and_function_scope/arguments 13:26 < stagas> syskk: fn.length 13:26 < TehShrike> Oh, right, what stagas said. https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Function/length 13:28 < syskk> nice 13:28 < syskk> thanks :) 13:28 < Mandragor> does anyone knows where the socket.io.js should be for a cross domain application (client side or server side ?) 13:31 < fotoflo> if I set an object in two different collections: a["test"] = mySameSameObject; b["test"] = mySameSameObject; Do we store mySameSameObject twice, or simply once pointer? 13:36 < syskk> is there a Array.popFirst in js? 13:38 < syskk> Array.shift 13:48 < gavri> grunt's lint does not pick up options from ~/.jshintc. where do the options have to be specified? 15:19 < Brandon_R> who wants to play powderkeg? 15:48 < SomeoneWeird> anyone done twitter oauth authentication? 15:48 < yawnt> i did 15:49 < nathan7> SomeoneWeird: I'd probably use everyauth for it if I did 15:50 < SomeoneWeird> yeah, I looked at it but it doesn't seem to implement everything 15:50 < SomeoneWeird> unless i'm just looking wron 15:50 < SomeoneWeird> g 15:50 < yawnt> ;_; 15:50 < yawnt> nathan7: everyauth is terrible :( 15:50 < nathan7> yawnt: bring us something better 15:51 < nathan7> yawnt: I don't like it either but I'm lazy 15:51 < nathan7> yawnt: I hate fiddling with oauth 15:51 < SomeoneWeird> yeah oauth is yuck 15:51 < nathan7> It's a necessary evil. 15:51 < nathan7> That kind of stuff is never gonna be sexy. 15:51 < SomeoneWeird> some would beg to disagree 15:52 < nathan7> oauth needs to work over HTTP, cross-domain, and be secure 16:03 < Acionyx> Hello! I need help: i have an error "Cannot POST /" while trying to post file to site; i'm using express and there is config(file ./routes/indexpost.js exists): 16:03 < Acionyx> ... 16:03 < Acionyx> routes = require('./routes') 16:03 < Acionyx> ... 16:03 < Acionyx> app.post('/', routes.indexpost); 16:03 < Acionyx> ... 16:06 < RLa> Acionyx, where you get that error, in browser? 16:07 < Acionyx> Yes, after sending post request with xml file attached(in form) 16:07 < RLa> do you get some error in node console too 16:07 < Acionyx> there are 404 in the node console 16:07 < Acionyx> POST / 404 9ms 16:09 < RLa> weird 16:10 < RLa> can you paste app.js code somewhere 16:11 < jbrokc> hey - i just did `brew upgrade node` which symlinked npm and all. then did `npm install -g `. how come going into a node shell and doing `require('')` gives me a module cannot be found error (if it was installed globally)? 16:11 < Acionyx> where i can paste it? in chat? 16:12 < RLa> Acionyx, pastebin.com for example 16:12 < jbrokc> (by going into a node shell I mean just dropping `node` and typing in `require('')`) 16:12 < RLa> do not paste more than 2 lines in chat 16:12 < Acionyx> thanks a lot, i'm newbie for this things. http://pastebin.com/ghDCH69m 16:12 < nathan7> jbrokc: because npm install -g is not for require()ing 16:13 < nathan7> jbrokc: It's purely for stuff with binaries and things 16:13 < jbrokc> aw, what's the global install then? or is that gone now? 16:13 < nathan7> jbrokc: npm link them into your node_modules if you want to require() them 16:13 < nathan7> jbrokc: That *is* global install 16:13 < RLa> Acionyx, code looks ok 16:13 < nathan7> jbrokc: I personally have a ~/node_modules with a bunch of stuff I use a lot 16:13 < jbrokc> so i *have* to use a local node_modules file in order to use packages? 16:13 < RLa> Acionyx, tho you should put router middleware after static middleware 16:14 < RLa> not sure if that would matter in current case 16:16 < jbrokc> nathan7: i'm still not getting how to link it (or what linking does) 16:17 < Acionyx> RLa, what did you mean? code is almost created by express , i've changed only one line - so order must be right? 16:17 < jbrokc> nathan7: oh, nevermind 16:18 < jbrokc> thanks 16:18 < yawnt> nathan7: i read now 16:18 < yawnt> passport 16:18 < yawnt> or authom 16:18 < RLa> Acionyx, did you restart the server after adding your own code? 16:19 < yawnt> (i like passport better) 16:19 < Acionyx> RLA, of course i did 16:20 < RLa> hm, what else could be it 16:20 < RLa> you could paste the handler's code too but i can't see why it should matter 16:21 < RLa> oh wait 16:21 < RLa> i think i got it 16:21 < RLa> you define routes outside app.configure() 16:22 < RLa> move them into the function and it should start working 16:23 < Acionyx> like this? http://pastebin.com/Wuse14qk 16:24 < Acionyx> it doesn't =( 16:25 < Acionyx> that is indexpost.js http://pastebin.com/uuWfzZeB 16:25 < Acionyx> maybe it will help 16:25 < nathan7> jaequery: C= 16:25 < nathan7> yawnt: ? 16:26 < yawnt> nathan7: passport 16:26 < yawnt> alternative to everyauth 16:26 < nathan7> ! 16:26 < nathan7> Passport.js was what I was looking for 16:26 < nathan7> I keep finding awesome libs but forgetting their names 16:27 < yawnt> i'm developing something that should fix that 16:27 < yawnt> stay tuned 16:27 < yawnt> ;) 16:27 < Mandragor> Hi everyone 16:29 < RLa> Acionyx, you moved app.post into configure function and it's still not working? 16:30 < RLa> oh i see you did 16:30 < nathan7> yawnt: tell me the name 16:30 < nathan7> yawnt: so I can forget it q= 16:30 < Acionyx> Yes, yes 16:30 < RLa> Acionyx, is the GET part working? 16:30 < Acionyx> RLa, it's working okey and there are form, where i'm sending my file 16:32 < RLa> is indexpost pseudocode? 16:33 < RLa> or is that really code as-is? 16:35 < Acionyx> http://pastebin.com/uuWfzZeB code as-is. I'm don't understand, what is "pseudocode"?(in example, please, my english is bad ) 16:36 < RLa> you are then missing var keyword on line 2 16:37 < Acionyx> I've added "var", restarted, there is same error 16:49 < cainus> Acionyx: get rid of the second "indexpost" on line 1 16:50 < Acionyx> cainus, did. still same result 16:50 < cainus> gimme current code, plus error message 16:52 < cainus> also, what editor do you use? 16:55 < Acionyx> cainus, "Cannot POST /" in case of POST request. GET request is ok to the "/" 16:55 < Acionyx> current code for ther app.js http://pastebin.com/aLJbv2TX 16:55 < Acionyx> current code for ther indexpost.js http://pastebin.com/UezAutam 16:55 < Acionyx> eclipse juno(jee) 16:55 < Acionyx> in the console(2 requestget&post) there is 16:55 < Acionyx> Express server listening on port 3000 16:55 < Acionyx> GET / 200 48ms - 307 16:55 < Acionyx> GET /stylesheets/style.css 304 16ms 16:55 < Acionyx> POST / 404 1ms 16:57 < cainus> you should get this: http://github.eclipsesource.com/jshint-eclipse/ 16:57 < Guest14007> do any of you use delicious? the bookmarking thing 16:58 < cainus> Acionyx: I'd put a console.log() in the top of your post ahndler to see if it even gets there 16:59 < harrisonm> Guest14007: used to, but I'm probably going to get a Pinboard account soon 16:59 < Guest14007> harrisonm: why pinboard over delicious? 17:00 < harrisonm> No ads/sponsored links/whatever, simple interface, hasn't been run through a sale/acquisition blender 17:00 < cainus> Acionyx: 404 seems to suggest it doesn't even know about your handler... probably something like a bad import... bad filename or something like that 17:01 < RLa> Acionyx, can you make single-file test case 17:01 < Guest14007> harrisonm: why not just use your browser's bookmark feature if those features are priorities? 17:01 < thl0> when implementing a stream interface, what is the best way to handle non-fatal errors 17:02 < Acionyx> cainus, i'm thinking so -> console is empty, .log() isn't executed. will try in single file 17:02 < thl0> ie. I don't want to emit('error') since that disconnects piped streams and thus kills it 17:03 < cainus> don't emit anything if there's nothing that needs to be done about it 17:03 < thl0> is there a standard way how this should be done for streams or should I just emit a custom event e.g, emit('warning') 17:04 < thl0> well I want to warn the user that (in my case a file couldn't be processed) 17:04 < cainus> if it's a probably that needs to be handled specifically, then it should break the pipe 17:04 < Acionyx> cainus, if put function in app.configure it will work, so why it doesn't see a file? 17:04 < plato> hey has anyone used amazon ec2 here? 17:04 < plato> i'm wondering if there are any disadvantages to developing on it as opposed to deploying a finished product 17:05 < thl0> cainus: in that case emitting a warning that user may choose to listen on is probably the best way to go? 17:05 < cainus> Acionyx: I don't see you importing it 17:05 < Acionyx> but "routes.index" for GET works! why doesn't work "routes.indexpost"? 17:05 < cainus> thl0: does streaming continue afterward? 17:06 < RLa> Acionyx, routes = require('./routes') <- this assumes index.js in routes directory is clever 17:06 < Guest14007> harrisonm: did you see my other question? it might've gotten lost in the sea of lines 17:06 < cainus> ah heheh 17:06 < RLa> Acionyx, can you paste routes/index.js somewhere? or is that same as indexpost.js? 17:07 < thl0> cainus: yes, since it is a non-fatal error - it keeps processing other files 17:07 < cainus> one stream with *many* files? 17:07 < RLa> btw, i think index.js is stupid idea anyway 17:07 < RLa> maybe it solves some problems but most of time i have only seen hacks in it 17:08 < Acionyx> RLa, imports only "index", but not the "indexpost"? damn... 17:08 < cainus> I think putting each route in a separate file is silly too 17:08 < niggler> thats true of most frameworks RLa 17:08 < thl0> cainus: it's a recursive file reader: https://github.com/thlorenz/readdirp 17:08 < RLa> and it breaks ides depend how clever those hacks are 17:08 < thl0> cainus: here is the stream api I have so far: https://github.com/thlorenz/readdirp/blob/master/stream-api.js 17:09 < cainus> thl0, how do you tell the beginning and end of each file if they're all in the same stream? 17:09 < thl0> cainus: it just resolves the file entries, not the contents 17:10 < cainus> what does that mean? 17:10 < Acionyx> So, if i understand you right, i need to add functions to var exports.{routename} in one file - index.js ? 17:10 < thl0> cainus: like fs.readdir but recursive 17:10 < RLa> Acionyx, you can require() separate files, like indexpost = require('routes/indexpost') 17:10 < cainus> if you put 2 files in one stream you need some way to delimit between them 17:10 < RLa> Acionyx, no var with exports 17:10 < cainus> or do you use n streams for n files? 17:10 < RLa> "exports" is already declared/defined variable in nodejs 17:10 < thl0> cainus: the stream emits file entries one by one 17:11 < cainus> file "entries"? 17:11 < RLa> Acionyx, you should read this: http://nodejs.org/docs/latest/api/modules.html 17:11 < cainus> pointers to files? 17:12 < thl0> cainus: objects as described here: https://github.com/thlorenz/readdirp#entry-info 17:12 < cainus> alright... so what error can occur? 17:13 < Acionyx> RLa, thank, will read it. So, i maked it work! Solution was to put exports.{functionname} in one file called index.js 17:14 < cainus> Acionyx: probably better to learn to do it without index.js . Otherwise all your source files will be named index.js. :) 17:14 < thl0> cainus: ie. could run out of file descriptors (since fs.stat accesses the file) or a file could be removed right after it was found, but before fs.stat executes 17:15 < cainus> and you don't want to break pipe in either case 17:15 < thl0> nope, since the other files can still process 17:15 < cainus> yeah you could emit warning... or you could have an error message in the "entry" 17:16 < thl0> but I think I got the point now, I'll just emit a warning if the pipe should continues 17:16 < thl0> :) 17:16 < thl0> thnx 17:16 < cainus> alright cool ;) 17:16 < Acionyx> maybe you can give some links to "howto" make correct routes in app?) 17:16 < Acionyx> If you knew how hard to learn nodejs without full documentation in own language... 17:17 < cainus> you're making the routes just fine. you're just importing modules incorrectly 17:17 < cainus> you could just have a routes.js instead of a routes/index.js 17:18 < Mandragor> anyone knows a cross domaine socket.io tutorial ? 17:19 < Mandragor> or exemple ? to explain how not to have the "XMLHttpRequest cannot load" problem 17:19 < Mandragor> I have a Handshake but nothing goes out 17:20 < cainus> Mandragor, maybe http://stackoverflow.com/questions/10235905/socket-io-doesnt-set-cors-headers 17:20 < Acionyx> best library for parsing xml content? 17:21 < cainus> Acionyx: rackspace has an elementree lib 17:22 < cainus> https://github.com/racker/node-elementtree 17:22 < Acionyx> thanks! 17:53 < Acionyx> how can i pass my vars from app.js to all functions in routes.js ? i've tried something like require('./routes.js')({xml:xml}), but there are many functions, so it doesn't work 17:55 < mscdex> Acionyx: you could pass your app object to your route modules 17:55 < mscdex> oh wait nvm i misread that 17:56 < cainus> no I think that's what he means 17:56 < Acionyx> mm, i've also tried this: in app.js line app.set('xml',xml), and how can i access it in function in route, where are only req&res? 17:56 < Acionyx> access "app" i mean 17:58 < cainus> doesn't req have an app var on it? 17:58 < cainus> I assume you're using express 17:59 < cainus> req.app.get('xml') 17:59 < rendar> would it be easy for js to be connected to C++ code, and to represent a C++ instance? even if js uses the prototype design 17:59 < cainus> oh no... req.params.xml 18:00 < cainus> there's a way, but I don't use express, so I should stfu and stop guessing :) check the docs :) 18:01 < Bux> Gentlemen, I greet you 18:02 < Acionyx> console.log(req.params); puts "[ ]" 18:02 < Acionyx> any ideas? 18:02 < harrisonm> Guest14007: Stepped out for a while. Because you also get sharing, sync with a lot of services, excellent API 18:02 < cainus> console.log(req.app); ? 18:03 < harrisonm> Guest14007: Not saying Delicious may not work fine for your needs, but it seems cleaner/more useful to me 18:03 < Guest14007> harrisonm: ah i see 18:04 < Acionyx> req.app.settings.xml works fine, thanks for idea) 18:05 < cainus> cool...knew it was something like that 18:05 < Acionyx> you are using pure node without framework? 18:06 < cainus> I wrote my own framework like everyone else. heh 18:06 < cainus> you're better off not knowing about it. ;) 18:06 < cainus> express is pretty good, especially starting out 18:08 < Acionyx> first i did was making own template manager, but then i confessed, that my knowledges are tiny and it is too early to do things like framework) 18:08 < cainus> templates have pretty much been done to death too 18:08 < mscdex> kinda like flow control 18:09 < mscdex> ;-) 18:10 < cainus> yeah I probably went through a million flow control libs before I realized I didn't need any of it 18:10 < cainus> everything short of icedcoffeescript 18:10 < Qbix1> hi people and sup 18:11 < Acionyx> flow control... my brain breaks after years of silly php =\ 19:15 < Slade-> hey whats the appropriate way to 'error' if somethings wrong.. like calling a function with a missing param 19:19 < AAA_awright> Slade-: What in particular? 19:19 < AAA_awright> usually throw new Error or callback(new Error) 19:20 < Slade-> AAA_awright: writing a function that expects a table with specific items. i wanna error if those items arent there 19:21 < Slade-> in this case, its ip address, port, etc) 19:21 < AAA_awright> Slade-: You can silently fail (no input no output) or `throw new Error` if you decide it's outside the domain of your function 19:22 < Slade-> is Error javascript standard? or something specific to nodejs 19:30 < cainus> Slade-: standard: https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Error 20:20 < TehShrike> Excellent: https://github.com/felixge/faster-than-c 20:20 < jtomasrl> is there an open source API code made in node? 20:21 < TehShrike> blurg? 20:21 < TehShrike> ...yes? 20:31 < Fodi69> hi, how can I run some event in a previously defined time without a request? I use express 20:32 < Fodi69> so for example I want to run something on 13:45 tomorrow, a function 20:34 < matbee> run a datetime check every minute 20:34 < matbee> lol 20:35 < Fodi69> matbee: o_O ? 20:36 < shanse> https://github.com/ncb000gt/node-cron 20:37 < shanse> Fodi69: ^ 20:37 < Fodi69> shanse: i'm checking it 20:37 < shanse> if you're using redis you can also use its timers 20:38 < Fodi69> I want to run multiple node processes 20:39 < ttoz> hello from California 20:40 < Fodi69> and what can this "node-cron" do when I restart the server, or create a new node instance 20:40 < Fodi69> ? 20:54 < cainus> anyone know the magic to make travis use 0.8.x? 20:55 < chilts> cainus: http://paste.dollyfish.net.nz/884044.txt <- as many versions as you want 20:55 < cainus> I don't want to specify exact version though 20:56 < chilts> 0.8 will use the latest 0.8 they have available 20:56 < cainus> ahh okay cool 20:56 < cainus> thanks 20:56 < chilts> or just try it with 0.8.whatever and see if that works 20:59 < cainus> 58 tests complete (3241ms) 20:59 < cainus> I'd like to see rails do that 21:08 < jmoyers> npm install --dev installs devDependencies and is the correct way to do that, right? 21:08 < jmoyers> shit feels like its going in a loop... 21:09 < kuja> jmoyers: I did not notice that option ever, but I use 'npm install' and it seems to install my dev dependencies. 21:11 < jmoyers> yeah npm install --dev does something awful 21:11 < jmoyers> as far as i can tell 21:16 < harrydog> anyone know, in express, do i have to add socket.io to the package.json dependencies? 21:17 < harrydog> i try calling io.sockets.on, but io.sockets says "undefined" in the console 21:41 < Hupo> okay 21:42 < jbergstroem> bnoordhuis: ping. got some segfaults on the buildbot again 21:42 < Hupo> actually wait, nevermind, I just figured it out 21:42 < bnoordhuis> jbergstroem: where/what? 21:44 < Hupo> or actually 21:45 < jbergstroem> bnoordhuis: sent to you in priv. prefer public chat? 21:46 < bnoordhuis> jbergstroem: oh, it's okay - but i tend to miss pms 21:50 < Hupo> today I learned that you can access chars in a string with "string"[index] 21:51 < insin> ...in some JS implementations 21:53 < jmoyers> yes. 21:54 < Hupo> I also learned that ! can be used in rather esoteric manner like !+0 & !+false (comes out as true), !+1 & !+true (comes out as false) and !+string/array/object (comes out as true) 21:56 < Hupo> now I just need to figure out why ++[0][0] / ++[[]][0] works and gives 1 but for example ++0, ++[], ++[][] and many other combinations don't 21:58 < Hupo> or actually rather why ++[[]][0] works but ++[] doesn't 21:58 < Hupo> or actually I guess it kinda makes sense 21:58 < Hupo> damn 21:58 < Hupo> how mind-bending 22:03 < jmoyers> you.. dont actually *need* to know that 22:03 < jmoyers> at all 22:03 < Hupo> no, of course I don't 22:04 < jmoyers> :-) 22:04 < Hupo> but I want to understand how this comes out 22:04 < Hupo> so ++ only works on "pointers", which is why ++0 fails but ++[0][0] works, because you're "pointing" to the first element of the array (that you just defined) 22:06 < jmoyers> well it works on a variable 22:07 < Hupo> yeah, and in context of my previous sentence, variable would be a "pointer" 22:07 < Hupo> because you can't really call [0][0] a "variable", can you now? 22:07 < Hupo> or I guess you can since array elements are "variables" 22:07 < Hupo> w/e IT JUST WERKS 22:08 < jmoyers> right well 22:08 < jmoyers> its not super common to say 'pointer' in javascript 22:08 < Hupo> it sure isn't 22:08 < jmoyers> because that means something very specific 22:08 < Hupo> I know 22:08 < Hupo> that's why I used quotes 22:08 < Hupo> "pointers" 22:08 < gkatsev> references, not pointers 22:08 * jmoyers does the 'air quotes' motion 22:10 < jmoyers> before i write this 22:11 < jmoyers> does anyone know if there is an express plugin (or anything) that precompiles templates from linkedin's fork of dust and serves it based on a directory path? 22:12 < jmoyers> im thinking views/* would serve a consolidated js file with all views, named and registered as available partials, then views/specificView would give just the views for that part of the directory structure. 22:12 < jmoyers> that way, if you wanted to incrementally load templates, you could. but you could also grab a fully concatted/minified version all at once, also 22:18 < Industrial> Anyone use node-seq? https://gist.github.com/f74cc8fd86faafe62a52 Howcome the last function (with p 'LOL') doesn't get run? in the debugger, it ends returning null from line 49 and then the .seq handler just never called 22:20 < jmoyers> eyes burn 22:21 < bingomanatee> hi there 22:21 < jmoyers> wassah 22:22 < bingomanatee> i know its OT but … anyone have good recommendations for a slide show powers by JS/(d)html? 22:22 < jmoyers> googles template is my favorite 22:22 < jmoyers> from this years io 22:22 < gkatsev> impress.js 22:22 < jmoyers> bingomanatee http://code.google.com/p/io-2012-slides/ 22:22 < jmoyers> i've done a few presos with it 22:23 < jmoyers> the annoying part is when my company is like "hey bro, can i get those in powerpoint?" 22:23 * jmoyers screams NO! 22:23 < gkatsev> bingomanatee: http://bartaz.github.com/impress.js/#/bored 22:24 < Hupo> speaking of templates, I find templatizer to be pretty awesome if you need to do client-side rendering 22:24 < bingomanatee> thx 22:24 < jmoyers> templatizer is jade only 22:24 < jmoyers> which makes me sadface 22:25 < Hupo> true, but jade is fabulous! 22:25 < jmoyers> not my style 22:25 < Hupo> well, I can understand that 22:25 < Hupo> I thought it wasn't my style either but now that I've actually used it for a while I have to say it's quite nice 22:25 < jmoyers> i've been thinking about using consolidate.js to build a general purpose compiler 22:26 < jmoyers> the problem is that not all (in fact most) template engines don't have a 'base' vs a 'compiled template instance' architecture 22:26 < Hupo> true that 22:26 < Hupo> it's one of the big reasons why I like jade, tbh 22:27 < Hupo> it's awesome that you can compile the templates into pure JS functions 22:27 < jmoyers> jade does it well, dust does it well 22:28 < jmoyers> handlebars too: http://handlebarsjs.com/precompilation.html 22:30 < jmoyers> handlebars has a specific `precompile` funciton which looks exactly like what one might need -- https://github.com/wycats/handlebars.js/blob/master/bin/handlebars#L127 22:57 < Hupo> +[[+!+[[]]]+[![]][+[[]+[]]]++] === 10 22:57 < Hupo> javascript sure is fun 22:58 < Aria> Gotta love type coercion 22:58 < Hupo> indeed 23:07 < mscdex> >> 010 == 10 23:07 < purr> mscdex: (boolean) false 23:08 < aho> >> 010 23:08 < purr> aho: (number) 8 23:08 < aho> :> 23:09 < mscdex> ;-) 23:10 < mscdex> >> 0 === -0 23:10 < purr> mscdex: (boolean) true 23:10 < mscdex> >> 0.0 === -0.0 23:10 < purr> mscdex: (boolean) true 23:10 < mscdex> :O! 23:11 < aho> >> 1/0 23:11 < purr> aho: (number) Infinity 23:11 < aho> >> 1/-0 23:11 < purr> aho: (number) -Infinity 23:11 < aho> useless! :D 23:12 < aho> but yea... there is a way to differentiate between those two values 23:13 < aho> >> 1/0 === 1/-0 23:13 < purr> aho: (boolean) false 23:14 < Hupo> >> Infinity 23:14 < purr> Hupo: (number) Infinity 23:14 < Hupo> >>Infinity = 9 23:14 < purr> Hupo: (number) 9 23:14 < Hupo> >>Infinity 23:14 < purr> Hupo: (number) Infinity 23:14 < Hupo> >>Infinity = 9; 1/0 23:14 < purr> Hupo: (number) Infinity 23:15 < Hupo> also, just checked out the google io html5 slide deck linked earlier 23:16 < Hupo> looks neat 23:18 < hillct> Good evening all. I'm running into an issue with bodyParser/Formidable where after writing my uploaded image file, Formidable gives up http://pastebin.com/fvkJfSKv due to an improperly formatted body, but I need to be able to see what's been uploaded. What event do I need to hook onto so I can at least log the body content? 23:18 < aho> Infinity is a read only constant, which holds the IEEE 754 value for infinity, which is a magical value which is larger than any other value (itself included) 23:19 < aho> in older engines this value could be overwritten 23:19 < aho> just like undefined could be overwritten 23:53 <@Nexxy> anyone here in Berlin? 23:55 < Daegalus> Nexxy: i can safely say that i am not in berlin 23:55 <@Nexxy> well damn 23:55 <@Nexxy> it's 2am here and I want to go out 23:56 < Slade-> and you're asking in a javascript channel? 23:56 < Daegalus> Nexxy: but if you ever need someone in the southern bay area, give me a shout 23:56 <@Nexxy> uh yes. JSConfEU just happened 23:56 <@Nexxy> here in Berlin --- Log closed Mon Oct 08 00:00:32 2012