« first day (31 days earlier)      last day (4900 days later) » 

5:00 PM
cool! I'll go play :)
 
bye
 
bye Nyuszika7H
Cheers for all your help it is much appreciated!
 
Evening
 
wooo I just found a nice tip for those who use fb and ff
 
@Chouchenos F1?
 
5:08 PM
@YiJiang gnuh ?
 
@Chouchenos Mozilla Labs just released it's new social add-on, called F1: mozillalabs.com/messaging/2010/11/10/f1
 
mmm no, not that. (but it's interesting, I'll read that later :p) mine's a hack
 
@IvoWetzel what are your node.js debugging tools. any unit testing set up?
 
@Raynos for debugging node-inspector
 
@NickCraver how do I make a new javascript file in webstorm without it refusing to recognise it as a javascript file. any file ending with .js doesnt have syntax highlighting (im on ubuntu)
 
5:10 PM
Add a bookmark with whatever name you want, this adress : facebook.com/presence/popout.php and check the "sidepanel" checkbox
 
@Raynos unit testing, uh.. yeah game stuff + unit testing... doesn't work that good :/
 
@IvoWetzel it doesnt?
 
Then click the bookmark and you'll have your friend list as sidepanel \o/
 
@Raynos Unit test... gameplay? Well you can unit test functionality but still, you can't really test for all kinds of player input
@Raynos You just can't make a test like "playsGood()"
 
:)
 
5:26 PM
What are good "functional" structure patterns to use? I understand shaping large projects in an OO manner but I can't picture how to structure a large project in a "functional" manner. Since javascript is a solid functional language could anyone give me an insight into higher level functional concepts. (@jAndy I volunteer you for a description)
 
5:50 PM
Is there a good reason to avoid try catch in javascript?
 
@Raynos performance
 
@NickCraver is try block a performance hinderance or is it only the error throwing and handling
 
hindrance overall, the tracing engine is crippled from in-lining your code
 
what do you mean "in-lining" ?
 
function a() { b(); }
function b() { c(); }
function c() { alert("bob"); }
the tracing engine makes this: function a() { alert("bob"); }
 
5:55 PM
I see.
 
among many other optimizations, but the inability to inline and trace correctly is a performance killer
 
Are there any alternative efficient error handling methodologies to try & catch?
 
try not to throw an error...an if() check for some condition is far cheaper than a try/catch
 
ok :)
 
6:13 PM
how would I sort an array of objects, where each object contains a string value which should be my sorting condition :p ? aahhhhr
 
@jAndy what do you mean? sounds like a vicious circle
 
[{foo: 'bar'}, {foo: 'test'}].sort(function(a,b) {a.foo ???})
you can call Array.sort()
 
@jAndy arr.sort(function(a,b){ return a.string.prop > b.string.prop })?
 
which assumes you have only strings in your arry
@YiJian: what would that sort?
 
Array.sort can take a sorting function
 
6:15 PM
[{foo: 'bar'}, {foo: 'test'}].sort(function(a,b) {return a.foo > b.foo; });
 
a.foo - b.foo
 
@jAndy It would compare one the property of a string to the other
 
@NickCraver: that would sort alphabetically?
 
yup
 
@NickCraver you should use subtraction or addiction. booleans dont return negative values
 
6:16 PM
sounds wierd
 
I'd add a equal clause in there though
check for each less, equal, greater, return -1, 0, 1 accordingly
 
@NickCraver What would zero be good for? Stable sort?
 
0 means keep the original order if equal
 
@YiJiang to make sorts deterministic
 
change that behavior too, if you want :)
 
6:18 PM
sort(function(a, b) {
				if( a.value > b.value)
					return 1;
				else if( a.value == b.value)
					return 0;
				else
					return -1;
			}
 
Hmmm... is this a good way to test for jQuery versions?
 
like this I guess
 
    // jQuery >= 1.4.4 has built in op to do this.
    if ( v0 > 1 || (v0 == 1 && v1 > 4) || (v0 == 1 && v1 == 4 && v2 >= 4)) {
        return node.data();
    }
 
is a throw statement in my javascript code going to make it unefficient if it never gets called?
 
it's a string, why not juse if($.fn.jquery > "1.4.4")?
 
6:20 PM
@NickCraver Might want to comment on this,
gist: 701652, 2010-11-16 10:07:22Z
    // return data-* attributes of a node as a dict
    function getDataAttributes(node) {
        
        var vstr = $().jquery.split(".");
        var v0 = parseInt(vstr[0]) || 0, 
            v1 = parseInt(vstr[1]) || 0, 
            v2 = parseInt(vstr[2]) || 0;

        // jQuery >= 1.4.4 has built in op to do this.
        if ( v0 > 1 || (v0 == 1 && v1 > 4) || (v0 == 1 && v1 == 4 && v2 >= 4)) {
            return node.data();
        }

        // for jQuery < 1.4.4, work it out ourselves,
        var d = {}, re_dataAttr = /^data\-(.+)$/;
        $.each(node.get(0).attributes, function(index, attr) {
            if (re_dataAttr.test(attr.nodeName)) {
                var key = attr.nodeName.match(re_dataAttr)[1];
                d[key] = attr.nodeValue;
            }
        });

        // merge in data added/modified via $.fn.data (>1.4 only)
        if (v0 == 1 && v1 == 4)) { $.extend(d, node.data()); }

        return d;
    }
Also related:
3
A: Get list of data-* attributes using javascript / jQuery

Yi JiangActually, if you're working with jQuery, as of version 1.4.3 1.4.4 (because of the bug as mentioned in the comments below), data-* attributes are supported through .data(): As of jQuery 1.4.3 HTML 5 data- attributes will be automatically pulled in to jQuery's data object. Note that ...

The comments are the interesting part
I'm actually curious why he's trying to create a version independent version
 
no clue
 
Since only one version of jQuery would every be used at any one time, and there is a overhead for including support for older versions
 
this program is really not happy with me screwing with it's 30mb xml config :)
 
@NickCraver Phew, 30mb? What's in there?
 
schema mappings, every single object in a oracle schema - porting to sql...they don't provide a mechanism to change the schema name through the UI so...
plan is a windows xp VM to do the migration on each tier, since we can ship a VM to the datacenter more cheaply than streaming a database back and forth across the metrolink
 
6:38 PM
There are so many things that are wrong about this question and the answer it got
0
Q: check for dupe and submit form jquery - code igniter

rektSo i want a way to check a form with a series of radio buttons (3 sets of 3) for duplicates and submit without the user having to click on a button. I've got the thing working but i want to make it as easy as possible for my users. So basically wanting js to validate and submit my variables as if...

 
@YiJiang Bad questions result in bad answers. Almost universally...
 
@lonesomeday The question isn't too bad, but the asker is making elementary mistakes
 
6:55 PM
@IvoWetzel ws.broadcast returns bytes. What am I supposed to do with bytes apart from boast about how few bytes are send?
Anyone have any experience with cloud9ide?
 
7:33 PM
@Raynos Well it still gives you an idea how much traffic the game generates
As for cloud9ide, I couldn't stand the font....
 
@IvoWetzel do you use the Buffer ?
 
@Raynos Nodes Buffer Object? For what?
 
7:54 PM
@IvoWetzel Binary data buffers
 
8:15 PM
@IvoWetzel for creating images serverside and shooting them down the socket.
 
8:58 PM
@IvoWetzel do you use a node.js logger?
 
9:22 PM
function ObjConstructor() {}
ObjConstructor.prototype = superClass.prototype;

var Obj = new ObjConstructor();
I feel like theres an easier way for this. Someone enlighten me
 
10:11 PM
@NickCraver when you got time, please see my last comment on stackoverflow.com/questions/4189191/…
@Nickcraver that is last help i need to this hope you will take a look
 
I do have a job you know :)
Tell ya what you fix this nullable and I'll do the jQuery part:
var sites = from ps in DB.ProtocolSites.Current()
      where ps.ProtocolId == ProtocolId
            join pi in
              (from ipi in DB.ContactPIs
               join c in DB.Contacts on ipi.Contact equals c
               where ipi.EntityId == 0 && ipi.RecordStatus == 0
               where c.EntityId == 0 && c.RecordStatus == 0
               select new {ipi.Id, c.LastName, c.FirstName}) on ps.ContactPIId equals pi.Id into pis
            from cpi in pis.DefaultIfEmpty()
            join cqdo in DB.ComputerQualDetails.Current() on ps equals cqdo.ProtocolSite into cqdos
 
@NickCraver You mean we don't get £1 per SO rep point? I'm disappointed now...
 
nope, or I'd have a much larger turbo in the car :)
 
@NickCraver wait what LINQ? bah! I would have fixed javascript
 
yup yup
 
10:28 PM
@NickCraver are you based in the USA?
 
yup
 
Ah that explains things.
west coast right?
 
east
 
oh.
then your crazy
 
why's that? :)
 
10:31 PM
Your up too early/late
Im sure your online either very late or very early when its morning over here.
 
10:44 PM
mm usually go to bed around 12-2, it varies, then up around 4:30-5
 
Wait average 3.5h of sleep?
Are you human?
 
mmm doesn't bother me any, 3-4 hours is enough :) dad's the same way
 
You lucky man. Id like to just have 3-4 hours
I need more then 6.5 I go on 6 and im a zombie half the time
 
11:04 PM
I am some days, but that's only after I see the new requirements someone came up with :)
this week it was hey let's have a table of holidays factored into all date calculations....everywhere (in an app that's global mind you)
 
;_;
Thats not too bad if its javascript. just overwrite the Date object
 
@Raynos actually that's a really complicated problem, particularly when there're are adjustments to be made (based on some local/arbitrary rules) for financial transactions
Hey @Nick watch out - my name ended up on a bunch of IBM patents about locale-sensitive holiday-aware date-picker/calendar UI elements :-)
They're all really dumb
 
11:20 PM
ugh
 
@Raynos all SQL calculations, unfortunately - heavy ones that are run often
 
Its late. Good night gents
 
@Pointy hehe that happens, no telling how many my name is on as well
@Raynos nite!
 
11:33 PM
I've been working on writing a multiplayer pong with canvas, websockets & node.js. I'm considering wrapping it up into a tutorial and posting that online. Basically there arent many tutorials out there especially not with node.js. So I just wanted to write up a guide to getting started. Any advice on writing the tutorial?
 

« first day (31 days earlier)      last day (4900 days later) »