« first day (600 days earlier)      last day (4351 days later) » 

10:00 AM
okay... light reading over.. Didn't understand anything..
:D
help pls.. how is it used... else a good site where I can read up on it myself
 
var iframe = $( '#gmaps' ),
    new_iframe = iframe.clone();
new_iframe.prop( 'src', new_coordinates );
iframe.replaceWith( new_iframe );
 
(YAWN)
clone(true,true); // wasnt one of tehse required to
 
no :)
for cloneNode( true ), this also clones the children, we don't need them for an iframe
in jquery, clone( true ) also clones the events etc, which I don't think he needs.
 
events?.. what events?.. I need only what I said.. nothing more.. :D nothing less
 
Note to self: stop giving relationship advice.
 
10:07 AM
@ShyamK which is why I said you don't need true.
@Raynos note to yourself: stop giving advice.
:p
 
@Raynos its fine
i consider yall as friends so i dont mind if u advice
oh btw she came back LOL
 
lol...
@FlorianMargaine no u
 
and now she wants to learn javascript >_>
so that she can be with me more time ^_^ (kinda handy)
 
you'll waste even more time though
and "javascript" becomes "sex" after a while.
 
@FlorianMargaine didn't work the error is still there.
 
10:11 AM
code?
 
mapBtn.on('click', function() {
$(this).fadeOut(200);
contactBtn.fadeOut(200);
//geoplugin_latitude() + ", " + geoplugin_longitude()
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function (position) {

// Did we get the position correctly?
// alert (position.coords.latitude);

// To see everything available in the position.coords array:
// for (key in position.coords) {alert(key)}

//console.log("Some value: "+position.coords.longitude);
new_iframe = mapIframe.clone();
new_iframe.prop( 'src', 'https://maps.google.com/?ie=UTF8&ll='+position.coords.latitude+','+pos
gawd.. thats a lot for a chat room.. :D
 
yes what about it.. the site I mean
 
you can paste your code and try out your js, and also show us what you've done
 
What do you think about the idea of "The ncore module IS your app"
 
10:16 AM
that's one philosophy
I'd rather have "the ncore module wraps your app"
"but you don't see it that much."
 
well ncore does wrap your app
or better explained
require("ncore")() is a macro for require("ncore/modules/core")(DEFAULT_OPTIONS, noOpCallback)
 
yeah, I mean, I don't want to write something like var ncore = require('ncore');
this should be boilerplate, and I concentrate only on my app
 
require("ncore") is a shortcut that you do once
 
yeah, but you know what I mean, right?
 
I'm not quite sure what you mean
 
10:19 AM
I mean, if I use something like ncore-boilerplate, I shouldn't ever think about writing this line
 
Yes
correct
 
I don't really care about the rest, as long as it allows me to nicely organize my app and do the DI correctly
 
I've reduced src/core.js in your boilerplate to the single line require("ncore")()
 
yep, saw that, that's nice, although I don't know if useful, since as I just said, ncore-boilerplate takes care of that :p
 
Well
the useful bit is in the tests
 
10:21 AM
I'll have to update ncore-boilerplate btw
 
you can require("ncore") in the tests and call app(done) which will fire a callback when ncore is done setting up your application
 
oh, that's really nice then
 
the client-side build thing is completely broken / untested in 2.0
 
yeah I'm waiting till it's beta at least :p
 
getting client-side support back isn't on my todo list
server-side support is pretty stable
my todo list currently exists of "finish the blog -.-" and "finish routil -.-"
 
10:23 AM
haha
routil isn't finished?
 
Ok, having looked at it. ncore client-side support from version 1.x cant be trivially ported
routil needs documentation and testing. It has no tests
routil also needs session support
Do you think un packing routil into a bunch of local variables is a good or bad idea?
 
hm
if that is the case, it means you need more modules
 
well
I plan to split routil into modules
it's just convenient to bundle them through routil
since routil uses a single error page handling mechanism with error page setup in a single location
 
if you want to bundle them, have them under the same namespace
 
10:32 AM
oh
 
@FlorianMargaine too many images in what I'm trying to do.. the css and jquery are crashing
 
@FlorianMargaine github.com/Raynos/routil/tree/master/lib everything in lib will go into NPM at some point
 
yeah a single variable if you prefer
then you can use different local variables
something like var body = routil().body;
 
I was asking earlier whether redirect = routil.redirect ... redirect(...) or routil = require("routil") ... routil.redirect(...) was better
 
@FlorianMargaine shes reading MDN and not w3Schools
i wont waste time :D :D
 
10:34 AM
Thanks anyhow
 
@Raynos matter of preference
var routil = require('routil'),
    redirect = routil.redirect();
so it's up to the programmer to choose whatever he wants
 
that's exaclty what I have :P
 
not exactly
but yeah, you got that right I think :p
 
:)
 
or not... depends if you like to have instanciations
so that you can have something like:

module.exports = routil.redirect = function() {
    return new Redirect();
};
 
10:37 AM
nope
 
so you can use var redirect = routil.redirect() and have an object you can play with
 
all of routils methods are functions that don't rely on instances or this
routil is designed for performance
so passing req and res as parameters in static functions is the most performant
 
k
it's just that having objects allows your object to do more things than a static function
 
Finally i can benchmark :D
 
or not, it's js -_-
@Abhishek wut?
so?
 
10:41 AM
and i did :-(

My JS based de-coder : 1 file in 4200ms // boy i am still proud
C++ Based de-coder : 1 file in 130ms //ouch i got pawned badway
[the file size was about 5mb encoded at 128kbps stereo]
dear god C++ is really fast lol
 
// no offense to JS though (x
 
@FlorianMargaine In this case I don't need objects.
 
yep, I said something stupid btw.
 
11:38 AM
@Raynos did you ever worked with node.js native modules ?
 
can jquery be used to change the alert messages?
visually
maybe using css or something?
or maybe make the alert message appear inside a div ?
 
11:54 AM
idk about jQuery but javascript can't
you can write custom alert messages
but then they won't do what you want
 
RT @w3c: An appreciation for URLs and doing right by users: @danwrong interviewed at Fluent 2012 http://www.youtube.com/watch?v=EzpHeMUBX70
 
I don't understand.. "you can write custom alert messages
but then they won't do what you want" ... What do you mean?
give an example if possible
 
Are you trying to change the looks of the window that pops up
when you do alert("OMG I KNOW jQUERY");
 
if possible, yes
 
Sam
Afternoon
 
12:02 PM
yes
 
that is not possible atleast with javascript
and hence with jQuery aswell
but you can rather write your own custom alert message :-) using some trickary
 
hmm.. yes.. if its not possible with js then jquery is out of the question.. thanks..
 
Sam
Or use a nice modal window instead ;)
 
@Sam modal window?
 
Sam
I think jquery ui may have something you need -> jqueryui.com/demos/dialog
 
12:04 PM
but there are sites that have customised pop-up boxes.. how is that done?
I shall check that out.. thanks
@sam
 
o/
 
@Abhishek see node-gyp
 
why ?
And by the way i need help with the emitters in native modules :/
my native code is ready i am stuck at a point :-(
 
I recommend you look at recent native code projects from reputable node authors
to understand how to build them
I've never done native code myself
 
@Abhishek it is
 
12:08 PM
(o_o)
you cant change the looks of a window with javascript x_x
 
no, but you can override alert and show a custom dialog box instead :p
oh, that makes me want to try something
!!> alert('hi');
 
@FlorianMargaine ReferenceError: alert is not defined
 
Sam
@FlorianMargaine But why not use a plugin like colorbox?
 
@Sam you can, I was just saying it's possible to override alert to launch the colorbox :)
 
12:10 PM
@FlorianMargaine ReferenceError: alert is not defined
 
Sam
I didnt know you could do that
Beyond my skill level lol
 
try the following in your console: window.alert = function( v ) { console.log( v ); }; alert( 'hi' );
or window.alert = function( v ) { console.log( v + ' custom alert' ); }; alert( 'hi' );
 
@FlorianMargaine openAtrium installed after i replaced jQuery 1.2.6 with 1.3.2
 
will print "hi custom alert" to the console instead of opening an alert box
 
anything above 1.3.2 and it busts still... :/
 
12:14 PM
@rlemon really? -_-
yeah, jQuery Update (the module) doesn't go above 1.3.2 on d6
 
@Raynos seems like
 
you would think that module would be something standard or integrated into the core
 
nobody is intrested in teaching native module programming
the documentation lacks a lot
 
Man :\
 
and as they removed the eventemitter from C++
 
12:15 PM
mongoose-auth :\
 
@rlemon ^^
 
wtf
 
its becomes insane to understand
 
or at the very least distros would include it or document that you need it.... i found this information randomly searching google
 
@rlemon well the install should be flawless with jQ 1.2
 
12:16 PM
should be
^ key words
and in most of the installs it is.
but to be a wise guy i installed core with 1.3.2 and then i installed openPublic with 1.3.2 and they worked with it.
 
so why not make it standard is all i'm saying
but alas my issue is fixed, i can just see some other newbies falling into the same problem.
 
groups.google.com/group/nodejs/browse_thread/thread/… wow they removed so much semantic part and made shit real lol
 
@rlemon so, do you like openatrium so far?
 
just starting with it this morning
got called out on a service call last night before I could set anything up past installation
 
12:24 PM
haha ok
"this morning" always bothers me when it's 2:30pm here
 
service call === 45 minute drive to open some ports on a router ಠ_ಠ
forgot to mention that ^
@FlorianMargaine heheheheheh openatrium ships with jquery update module.
but the install fails if you don't manually update it first.
too funny'
 
no
not enough ;
</troll>
 
@rlemon rofl
@Raynos commented functions = death
 
lol
 
12:36 PM
otherwise I just don't like function inside function
 
@FlorianMargaine It's just a reminder to myself that that's how I intend to get the session data in other functions
 
function renderSessionPage(req, res) {
    getSession(req, res, renderCorrectTemplate)

    function renderCorrectTemplate(err, user)  {
        if (user === null) {
            template(req, res, "session/new.ejs", {})
        } else {
            template(req, res, "session/delete.ejs", {})
        }
    }
}
 
@FlorianMargaine how would you refactor that?
 
you could just as well use an anonymous function there :/
 
I seriously dont get it why node.js developer team
 
12:36 PM
anonymous functions are silly
 
made native harder >_<
arggh
 
@Raynos don't you have a lib like after.js?
 
function declarations are always better then anonymous functions
I only use anonymous functions as methods
 
either use a flow management "lib" or get the function out
 
no :\
you cant get the function out
and flow control adds nothing of value
 
12:38 PM
???
you can't get the function out?
 
Please stop trolling until you show me an alternative piece of code that is better
 
function renderSessionPage( req, res ) {
    getSession( req, res, renderCorrectTemplate );
}

function renderCorrectTemplate( err, user ) {
}
or you lose req and res there?
 
@FlorianMargaine of course you lose req and res
it's an inner function because it needs closure scope access
 
I guess you could manipulate it with bind, but I guess your way is cleaner
and flow control adds the "clean" part, that's pretty much it
 
flow control does not add the clean part
named functions are the most elegant control flow primitive that can be used in that code that I know of
 
12:49 PM
1
A: How do you keep code with continuations/callbacks readable?

Florian MargaineDisclaimer: this answer doesn't answer specifically your problem, it's a generic answer to the question: "Are there some well-established best-practice patterns that I can follow to keep my code readable in spite of using asynchronous code and callbacks?" From what I know, there is no "well-esta...

 
Yeah
using Step is more ugly
 
that's like the semicolon debate :/
 
Anonymous functions are not parsed at runtime
 
what's correct then?
 
horse staple battery
 
12:53 PM
I wasn't sure about this and expected someone to correct me, but no comment :/
 
There is probably no performance difference at all
 
there is
there was a jsperf about this
 
wat
of course there is performance difference between creating an object and not creating
 
@FlorianMargaine jsfiddle.net/X9pTk
@FlorianMargaine using Step does not magically make the inner function declarations go away
 
Well, yeah. But it's not parsing
 
12:58 PM
well of course not but it does create a new function object and activationscope and all that shit
 
Got bored last night and implemented metaballs from an XNA example
 
Quora? You've been cheating on us?
 
@Loktar you're insane
 

« first day (600 days earlier)      last day (4351 days later) »