« first day (138 days earlier)      last day (4825 days later) » 

user1385191
3:36 AM
Was it announced on meta that SO finally has a mobile version? I just noticed it yesterday.
 
VB urks me
f = λx.E
 
 
2 hours later…
5:23 AM
Dive Into HTML5 now has a section on the History API http://diveintohtml5.org/history.html window.history, history.pushState, popstate event
 
5:38 AM
Hi
anybody is there?
 
5:49 AM
nope
 
hi
 
6:38 AM
hi, g2g
 
 
2 hours later…
9:00 AM
RT @ted_drake: I created an American Sign Language version of the HTML5 logo http://ht.ly/46NmE #html5 #a11y #closedcaptioning #ASL
 
9:36 AM
hi all
 
hi
 
hello
 
what's everyone up to this morning?
 
1 message moved to PHP
 
user492203
9:56 AM
Are you excited or concerned about our planned API changes? Find out why we're making the changes and leave feedback http://bit.ly/gizFZp
 
user492203
Hi! :)
 
user492203
2 movie tickets for $9 is a good deal: http://j.mp/fK3XgQ looking at the calendar I'll use it to see The Tree of Life in May.
 
user492203
216 likes on "Future of JsFiddle" - happy camper :-) http://forrst.com/posts/Future_of_JsFiddle-gFy
 
user492203
Oh, that's really very nice!
 
user492203
 
10:01 AM
@Nyuszika7H I prefer the current UI
nice and blue
 
user492203
Yep, I like it too, but it could be even nicer :)
 
I like the new one better
 
@Nyuszika7H Is that a dropbox icon?
 
Can someone explain the difference between a function expression and a function statement?
 
user492203
@DontCare4Free No.
 
10:02 AM
@DontCare4Free Looks like it, but it might just be a placeholder icon
 
user492203
@Greg A moment…
 
user492203
Function expression:
 
@Greg Let me see if I can keep that short...
 
user492203
var myFunct = function() {
    // code
};
 
var a; < a declaration / statement
function a(){} the same
 
user492203
10:03 AM
Function declaration:
 
user492203
function myFunct() {
    // code
}
 
var a = 1 + 2; // 1 + 2 is an expression
 
user492203
And here's an example:
 
var a = function(){} // the same
difference:
statements/declarations are parsed before the code is actually executed
expressions only get parsed at runtime
 
user492203
yep
 
10:04 AM
a(); // works
function a(){}
 
ah I see, great
 
user492203
foo(); // 'It works!'
bar(); // ReferenceError: bar is not defined
function foo() { return 'It works!'; }
var bar = function() { return 'It works too!'; }
bar(); // 'It works too!'
 
so var a = function() {} is an expression?
 
b(); // TypeError: Can't call undefined
var b = function(){}
@Nyuszika7H Wrong, there's no reference error being thrown for bar since it's getting hoisted
 
user492203
@IvoWetzel TypeError?!
 
10:05 AM
the declaration gets parsed, and bar / b default to undefined
you're then trying to call bar / b before the actual function was assigned
 
ok so if I had this expression: var func = (function() {}()); would it be parsed before it is executed?
 
user492203
Ah, right.
 
user492203
TypeError: undefined is not a function
 
user492203
I don't understand this.
 
@Greg well what you got there makes things even more complicated
the thing after the = is a self executing function
 
user492203
10:07 AM
alert(hello); // undefined
var hello = 'Hi there';
alert(hello); // 'Hi there'

alert(test); // ReferenceError: test is not defined
 
I'm trying to fully understand how Crockford's examples work in his presentations
 
user492203
So, if I declare a variable at the bottom, I can't get its contents from the top, but I get undefined instead of a ReferenceError? Interesting.
 
user492203
Though if I don't declare it anywhere, I get an error.
 
as I said, they get hoisted
basically, var statments are always moved to the top of the scope
 
"the whole thing is wrapped in the golden parentheses. In this case, the parentheses are syntactically required, and that's because I want this to be a function expression and not a function statement. If it were a function statement, I couldn't immediately execute it, and I want to immediately execute it."
 
user492203
10:09 AM
...
 
ok I'll give it a read
 
( // evaluate the function inside the paranthesis
function() {}
) // and return the function object
() // call the result of the evaluation
there are modifications of how to get the function(){} evaluated into a function object but basically that's how it works
 
@IvoWetzel so if there was any logic in the function, it will be executed?
 
yes
and the whole thing will return whatever the function returns
var func = (function(){return 'foo'})(); // func = 'foo'
 
10:11 AM
which could be more functions ...
 
exactly
it's functions all the way down
 
I see why that's useful to big projects like YUI which is what Crockford is explaining
@IvoWetzel @Nyuszika7H thanks for helping me understand this fully
 
user492203
@IvoWetzel That's nice, I didn't know about it!
 
@YiJiang I start wondering if people actually read the garden or just look at the design :P
 
10:15 AM
@IvoWetzel Come on now, it's not that good
 
@YiJiang Well I certainly do like it and I hate a ton of the stuff that's out there on the web
 
user492203
I wonder why isn't box-shadow / -webkit-box-shadow working in Chrome 11.0.686.1 dev?
 
@Nyuszika7H Hmm, where?
 
user492203
 
10:24 AM
@Nyuszika7H You didn't define a blur color?
 
user492203
@YiJiang ah
 
user492203
Like this?
 
user492203
box-shadow: 0 0 0 80 #000;
 
@Nyuszika7H That should work
 
user492203
@YiJiang It still doesn't work.
 
10:26 AM
80px - it might not accept unitless values here
 
user492203
@YiJiang ah right, it works now :)
 
user492203
And it's 0 0 80px #000
 
Kev
11:51 AM
hey folks...i have a question about the feasibility of using NodeJS as a VNC proxy
We run Citrix XenServer. Each guest VM has a console VNC session which is exposed on the host server(s) on the hosts private 192.168.x.x interface. There's a couple of API calls you do to ask for the VNC session which is returned as a url which you then do a HTTP 1.0 CONNECT to
when you complete the connect you are then connected to a VNC session
I'm wondering if NodeJS would be a suitable tool to write a proxy/forwarder so that clients (such as our customers) could use to connect to console sessions over the VPN clients we provide them with (unfortunately the VPN doesn't route into the Citrix private network, nor do we want it to). we have a bridge server that sits on both the VPN and citrix private network so the proxy/forwarder would live there
thoughts...from a NodeJS perspective?
 
@Kev not really from a NodeJS perspective, but won't the clients have access to the Citrix private network over the VNC?
in that case, I see no reason for not giving them VPN there directly instead of messing with proxies
 
Kev
@DontCare4Free - no, the private network is not visible to the VPN, never will be
 
@Kev That's not what I'm saying
I'm just saying that it would be visible to the VNC
 
Kev
@DontCare4Free - the VNC client?
 
@Kev yes
 
12:04 PM
@IvoWetzel ^
 
Kev
@DontCare4Free - no because the VNC server runs inside DOM0 on the host server, is only connectable via 192.168.x.x. Outside clients have no direct access to that network
 
@Kev so, what exactly do you want to expose then?
 
Kev
why are my posts scrolling to the top of the page?
@DontCare4Free - I want to expose the VNC session running on the host. To do that I need a proxy/forwarder that would reside on a server that bridges the 192.168 and the public facing. clients connect to the proxy, proxy gets session on XenServer host and fowards packets between client and server
 
@Kev so you want to expose the vm console or the host console?
 
Kev
@DontCare4Free - the VM console. XenServer hosts automatically create VNC servers for each guest (so you don't have to run VNC on the actual guest)
 
12:12 PM
@Kev but wouldn't the clients/customers then be able to access the private network through the vnc session?
 
Kev
@DontCare4Free - how? they have no direct access to 192.168.x.x
@DontCare4Free - the VNC server isn't running on the guest, it's a Host feature.
 
@Kev can't the vm access 192.168.x.x?
 
Kev
@DontCare4Free - no because it's a guest. it has no need to see the private management network....do you know anything about citrix xenserver?
 
@Kev yes, I use it
 
Kev
hang on logging out, chat is putting my comments at the top of the page
@DontCare4Free I am back
 
12:20 PM
RT @stshank: I love this! Microsoft fish-tank browser speed test rewritten in WebGL. 16fps on oldish MacBook Pro with 10,000 fish. http: ...
 
Kev
@DontCare4Free - ok. On XenServer each host has a private management lan
 
user492203
Hi! :)
 
@Kev that depends on your configuration, not in the default
 
Kev
@DontCare4Free or rather is connected to a private lan, at least that's what we do
 
@Kev so, each vm has a host-only virtual network?
 
Kev
12:21 PM
@DontCare4Free - so, you know in XenCentre how you have the console tab?
 
Kev
@DontCare4Free - 1) VM's are connected to VLAN's which are public facing (mostly), they have no visibility of the host server's management interfaces.
 
user492203
incoming feeds
 
Kev
@DontCare4Free - ok, in xencentre, when you connect to a console that's basically connecting to the VNC server that runs in DOM0 on the host
@DontCare4Free - you can only see that on our setup if you are running xencentre on a machine that is on 192.168.x.x
@DontCare4Free - our customers or their VM's have no access to that network. it's on a separate physical interface and set of switches.
 
@Kev So, let me see if I got this correct
 
12:26 PM
RT @slace: Blogged! Making the Internet Explorer #JavaScript tools better http://goo.gl/fb/19bhu #ie9
 
user492203
Feeds are coming! (I knew!)
 
Kev
@Nyuszika7H flagged as spam :)
 
There are two NICs on the host
 
user492203
@Kev It isn't spam, it's a feed!!
 
Kev
@DontCare4Free there are actually more, but yes
@Nyuszika7H - spam feed :)...only kidding
 
12:27 PM
one of them leads to the management network, which only you/your company/whatever has access to
 
Kev
@DontCare4Free - yes
@DontCare4Free - that is the only network that the XenAPI/XenCentre can connect to manage hosts etc on
 
another one leads to a network which is connected to the internet and has a vpn server for the customers
 
Kev
@DontCare4Free - yes correct. VPN has no access at all to our back end management networks
 
the host only exposes itself on the management network
 
Kev
@DontCare4Free - yes
 
12:30 PM
now you want to make a bridge between the management network and the customer/vm network for vnc connections?
 
Kev
@DontCare4Free - however we have an admin box that sits astride the 192.168.x.x management network and public
@DontCare4Free yes
@DontCare4Free - but not any old proxy server will do
@DontCare4Free - there is a dance you have to do via the XenAPI to find the console session on the host for a VM
 
@Kev I see
 
Kev
@DontCare4Free - you have to use the API to login and establish a session, then you have to locate the VM and find it's console object. that console object has a property which is called location. location looks like:
https://192.168.x.x/console?ref=OpaqueRef:8b2fde60-dbcc-3a88-59c2-655c1cba7f6a
you then do a http CONNECT something like:
 
inheritance or composition?
 
Kev
CONNECT /console?ref=OpaqueRef:8b2fde60-dbcc-3a88-59c2-655c1cba7f6a&session_id=(your sessions id as an opaque ref) HTTP/1.0 which gets you your actual VNC console on the host for the VM
@DontCare4Free - see foss-boss.blogspot.com/2010/01/… if you're interested
 
12:39 PM
so that creates a http tunnel to the vm console vnc session?
 
Kev
@DontCare4Free - well it gives me the vnc session, but you have to connect from the private lan to get at it
 
so simply a http proxy which does all the xenapi dancing?
 
Kev
@DontCare4Free - yes, but I also need to add some of my own code to do various pre-auth checks against our DB to make sure the customer is permitted blah blah blah
@DontCare4Free - so...I wondered if NodeJS was up to that task
 
I suppose it would be doable, although I start to worry a bit about performance
 
Kev
@DontCare4Free - oh, someone has a C implementation of this: xvpsource.org/?topic=about&page=xvp
 
user492203
1:11 PM
http://i.imgur.com/aEFc0.jpg IS USELESS. Not because it's unusable/inaccessible but because BOTS DON'T HAVE JS.
 
user492203
:413394 Yep.
 
@Nyuszika7H some might have js
 
user492203
@DontCare4Free Anyway, there's no need to make new captchas every day… reCAPTCHA is fine and used by many sites.
 
@Nyuszika7H true, although that captcha seems much quicker than reCAPTCHA
also, what happens if reCAPTCHA goes down?
quicker, in the sense that it is easier to "solve", although it might pose problems for mobile users
 
@DontCare4Free I believe someone actually brought this up on MSO
Was shot down pretty quickly, hehe. It's just not a very good solution, seriously
 
1:18 PM
@YiJiang reCAPTCHA or that other one?
 
@DontCare4Free The other one, of course. SO uses reCAPTCHA
Here we go:
-2
Q: Consider using Ajax Fancy Captcha instead of Recaptcha

RodH257I saw this in use on someones blog today: http://www.webdesignbeach.com/beachbar/ajax-fancy-captcha-jquery-plugin I've had a long standing hatred of Captcha's, even though they are a necessary evil. It frustrates me when I have to squint to try and read the text, or when I stuff it up 2 or 3 ti...

 
maybe they could have both
 
@DontCare4Free Eh... no.
 
so desktop users could use the "fast" one while touchscreen users who are unable to DnD could use reCAPTCHA
 
user492203
 
user492203
1:21 PM
Kitten captcha!
 
@Nyuszika7H rather, 404 error
 
user492203
LOL it doesn't even work.
 
user492203
> please try again
 
it works for me
 
user492203
1:23 PM
Now it works for me, too…
 
I'd like to learn how to document my JavaScript properly, but JsDocs seem to be fairly undocumented itself, any ideas?
 
heh, undocumented documentation
 
user492203
@YiJiang That fancy captcha is actually pretty easy to solve for bots with JS. They just need to check which one is draggable and simulate dragging.
 
I guess jsdoc.sourceforge.net is all that's needed, a list of stuff you can type in your comments
 
@Nyuszika7H they should just make all the buttons draggable
 
user492203
1:25 PM
@DontCare4Free yep
 
user492203
 
user492203
 
@Nyuszika7H not even that, just call the event that fires when it's dropped...
 
user492203
@Greg what event fires?
 
"drop"
 
user492203
1:28 PM
ah right
 
drop(e, ui)
 
so, essentially it's not much more safe than simply a captcha that rejects everyone who doesn't have js enabled
 
2:09 PM
@Nyuszika7H I... I want your brrrrrrrainzzz... braaaaaaaaaaainz... braiiiiinnnn....
 
user492203
 
user492203
2:27 PM
@YiJiang Are you there?
 
@Nyuszika7H Absolutely not
 
user492203
@YiJiang lololololololol
 
user492203
I like putting squirells on the same line :)
 
@Nyuszika7H squirrels?
 
user492203
function foo() /*->*/ { /*<- this is a squirell*/
    // code
}
 
2:30 PM
@Nyuszika7H oh
the bracket?
 
user492203
@DontCare4Free yep
 
2:57 PM
Could people please stop flagging random messages?
 
Anyone fancy a quick +50 rep?
0
Q: Prototypes and nested return functions, help!

Myles GrayIntro: I know that "How does this code work?" type questions are frowned upon and I'll look about as clever as a brick reading "The Sun" for asking such a question but... here goes. I am trying to understand prototyping in JavaScript, now this isn't the problem, I understand the basics of the...

 
hm is the +3 one insufficient?
 
@IvoWetzel Well it explains MOST of it but there are still 1/2 niggly things annyoing me:
request: function(url, callback) {
        // build a request here and send it
        request.on('finished', function() {
            callback();
        });
    }
That being one of them
 
lord
 
how does the .on work?
@Nyuszika7H what @ircmaxell said
 
3:00 PM
sigh
 
obviously, request needs to be some fancy dancy thingy
which fires events
 
in Star Room, 1 min ago, by Greg
Someone needs to find something more constructive to do with their time
 
the on method would then register callbacks for these events
 
2 messages moved to bin
 
@IvoWetzel I'm not exactly sure what you mean by register the callbacks...
 
3:03 PM
let me give you a code example
 
request.on('finished', function() { I don't understand the context, how does the 'finished' work
okay
 
    function Request(url) {
        this.events = {};

        // do ajax stuff here...
        var that = this;
        req.onreadystatechange = function(data) {
            that.emit('finished', data);
        };
    }

    Request.prototype = {
        on: function(type, callback) {
            // transform into an array when there are multiple callbacks
            this.events[type] = callback;
        },

        emit: function(type, data) {
            this.events[type](data);
        }
    };
 
Okay hang on I'll have to copy and paste it to try and understand it
@IvoWetzel does square brackets mean return?
 
uh no
they are accessors
foo[1]
foo['test']
 
3:17 PM
events.foo
events['foo']
type = 'foo'
events[type](data); === events.foo(data)
 
then why do we write events[type](data) rather than events.foo(data)
 
uh....
 
are there any advantages?
god this is confusing
 
because you want to choose the callback function programatically?
foo.emit('finished', ...)
should result in events.finished(...)
not events.foo()
I mean, come on they got to teach you something
 
@IvoWetzel everything I know in JS (limited as it may be) is all self taught
they haven't taught me ANYTHING but bad practises in uni, I'm self taught in everything except Java (no exaggeration)
 
yc
3:31 PM
Anyone feel like donating a close vote here?
1
Q: I need a correction for my following codings.,it's not working for me.,pls help.

john2103<input type="image" onclick="validate();pageTracker._linkByPost(this);" class="book" value="Search" src="/wp-content/themes/Bloom/img/search.png"> The above lines were used for google Analytics.,But it's not working for me.,so pls guide me..how to rectify it...

 
@IvoWetzel So what this does is define the .on prototype extension of request and what .on does is to accept the type and callback arguments, It then stores these elements in an array called events, Then the .emit function accepts/returns the elements from the events array?
 
4:36 PM
@IvoWetzel is this the square bracket notation we were talking about?
 
yes
 
hi all
some body here me
 
@user547706 pardon?
 
hello
@Greg hello ?
 
4:51 PM
@Saeedouv hi?
 
Any reason Chrome would not show a page in the Scripts pane even though it appears in the Resources pane?
 
@MylesGray in node.js the on words means bind. Basically you expect anything which has an on method to basically be a bind to an event with a callback
 
@Raynos RIGHTT!!! It makes sense now
'.on' doesn't really describe the function
 

« first day (138 days earlier)      last day (4825 days later) »