« first day (789 days earlier)      last day (4144 days later) » 

4:02 PM
hey all... any idea why this is jumping?
 
@KirstyHarris cuz I said so
 
lol
i dont want it to lol
 
what do you mean "jumping"?
 
$(document).ready(function() {
    $('div').hover(function() {
        $(this).stop(true).fadeOut('fast');
    }, function() {
        $(this).fadeIn('fast');
    });
});
!!/tell "Kristy Harris" jquery stop
rage.
 
eh lol
oh hahah
@rlemon are you proud.... i free wrote that... im actually bloody chuffed
 
4:07 PM
I would like to pretend I understood that... but I cannot.
 
ok, i basically did that all on my own
 
cool
 
oops
bloody chuffed = Im so fucking darn excited that i can finally understand some of this shit
i know its simple but its a start right?
 
yup
google jQuery hover and jQuery stop
those were the things I changed.
 
i wasnt sure if it were hover or mousein or mouse over...
 
4:11 PM
$(selector).hover(hoverOverFn, hoverOutFn);
function hoverOverFn(event) { /* this would refer to the selector element */ }
function hoverOutFn(event) { /* this would refer to the selector element */ }
mouseover and mouseout
however this is finicky with touch devices remember
 
Does anyone have advice for the dilemma I posted earlier. It is a single example, but the webapp I have been put on at work has a lot of situations like that and I am trying to get the JS organized a bit.
 
Possibly the best cover for "Mary had a little lamb": grooveshark.com/#!/s/Mary+Had+A+Little+Lamb/3AbBuy
 
Agreed
 
@mattblang Break into functions, don't auto-execute.
 
4:13 PM
IoC + Dependency Injection === read up on them
 
Checking the link out now.
 
some people use require js.
 
Yeah, I actually have done a lot of reading about requireJS in the last few days.
 
tbh I haven't looked into it before because I never needed it.
 
4:15 PM
I've been using it recently. It's good.
 
@rlemon btw, I added the /info command handling
 
sweet. I'll put the bot back online. Problem: My 12 port switch is out of ports :(
I need to switch a server back and fourth while updating it
 
Hey guys. Do you want a simple not trivial question ?
3
Q: JSON.stringify deep objects

dystroyI need a function building a JSON valid string from any argument but : avoiding recursivity problem by not adding objects twice avoiding call stack size problem by truncating past a given depth Avoiding recursivity problem is simple enough : var seen = []; return JSON.stringify(o, function(_...

 
I am integrating requireJS into my home project, but this project at work already had a large code base, full of random function and jQuery selectors all over the place, so I am having trouble figuring out how to get a handle on it. That example I posted earlier was just one example.
 
4:16 PM
@FlorianMargaine Using jquery just for $.each? eh?
@rlemon I can run it on an extra laptop I have you know
 
done and done
@Zirak once the server is updated it's going back in the server room. I just needed to put a head on it so it's connected to the KVM that the bot machine is on
so I stole the bots network cable as well :P
but the update is done
 
!!/help info
 
@Zirak info: Grabs some stats on my current instance or a command. /info [cmdName]
 
eventually I would like to get a machine at home that is dedicated for the bot (node and all)
 
@Zirak I have to rewrite it -- but it was for a bigger app
 
4:18 PM
In a week tops I should have my new comp set up, so don't worry about that
Intending to turn this scrap metal into a server anyhows
 
my issue is not that I don't have the hardware - once I get home alcohol is available to me and any personal projects / hobbies are lost
 
@rlemon :(
 
@dystroy Can't you add a third parameter, depth?
 
@Zirak I'd like but I'm not the author of JSON.stringify
 
Use currying, then
 
4:20 PM
What's currying ?
 
when you make the function smell weird
 
!!/tell dystroy google currying javascript
 
@FlorianMargaine Y U NO MAEK SENSE!? Could not understand tell dystroy google currying javascript
 
19
Q: In functional programming what is "currying"?

Eric MWriting as an unreconstructed imperative & OO programmer... Have messed about with Erlang and also Haskell lately. I like Erlang, not sure yet about Haskell. Functional seems more like math than programming, hope that makes sense. Functional programming seems very powerful. Reading docs on ...

 
4:22 PM
Not exactly currying in this case, more like partial-application
 
!!/google Curry in a Hurry
 
You can easily do it with Function.prototype.bind. You wrap your reviver function in another function, which does the depth calculation itself
 
Hum... practically how would you do the stringification ?
(I already know how to mix curry and javascript : dystroy.org/re7210/index.html?file=curry-aux-epinards.html)
 
@Zirak I'm surprised this Q wasn't closed by mods
 
4:24 PM
Actually it's easier than that. Just wrap it up in another function
var wrapper = function () {
    var depth = 0;
    return function ( key, value ) {
        if ( depth > something ) {
            return;
        }
        if ( objectCheck(value) ) {
            depth += 1;
        }
        //other stuff
    };
};

JSON.stringify( obj, wrapper() );
That sorta thing
hrm, but stringifying goes depth-first though
 
Hum... that would increment even if not going deeper but laterally, wouldn't it ?
 
Yeah, without altering the base algorithm, it's gonna be ugly
Rewrite JSON.stringify? It's not too hard, stuff already have toJSON
 
yes, that's the alternative I mention in my question
But I'd really like to have a very short library.
And I was wondering if there was a simple solution
 
Nope, none that I can think of
 
@Zirak Hey Zirak, I was curious what exactly you meant by this.
Wups, that didn't work like I thought it would. About breaking into functions.
 
4:33 PM
If you break your code into its re-usable components, and those components are only called when necessary...
You can have a core js file, and load others via different methods (requirejs, yepnope, the lot) depending on your criteria
 
How to specify that criteria though? I think that is what I am having trouble envisioning.
 
maybe the current page?
 
Having absolutely no knowledge of what you're building and how, I can't answer that question
 
Right, sorry. So for example, right now the input masks I mentioned are just a bunch of selectors in an on ready function. So essential it is being called for every page, which works, but lots of selectors have nothing to do with the current form for the current page, since they all differ from page to page. I guess what I am having trouble with is imaging how, if I was to break up the code, I would have only certain bits called when necessary.
 
@mattblang something like this maybe? gist.github.com/4132456
 
4:42 PM
I also wanted to add that I thought about hey, have a function with if statements that check for the form id, and only run the mask code if that form id is found. But that seems bad as well. Checking the link out now.
 
I never checked this
!!> (function (a, a) { console.log(a); })(0, 1);
 
@Zirak "SyntaxError: Strict mode function may not have duplicate parameter names"
 
:(
Non-strict mode gives the later definition
 
@Zirak pretty but I'll have some difficulty finding a real world use...
 
god, jqzoom is so badly written -_-
 
4:53 PM
@dystroy "real world"? What's that?
 
0
Q: HTML5/JS - Choppy Game Loop

RikonatorI have been experimenting with HTML5/JS, trying to create a simple game when I hit a wall. My choice of game loop is too choppy to be actually of any use in a game. I'm trying for a fixed time step loop, rendering only when required. I simply use a requestAnimationFrame to run Game.update which...

 
Any thoughts on the statement "Heavily commented code is difficult to read."?
 
comments saying "what" are useless and just clobber the screen
 
Very general
Missing a period at the end
 
I mean seriously
this code is hard to read just because of the comments: github.com/douglascrockford/JSON-js/blob/master/json2.js#L269
 
4:58 PM
The formatting of the comments there is really the annoying part; they break indentation
 
omfg that's stupid
 
@FlorianMargaine I agree. The good thing (I had to read it a few hours ago) is that github makes the comments almost invisible. I didn't read a word of them.
 
If there's more comments than code, I think there's a problem
 
But as Uncle Bob repeatedly says, comments should be used sparingly. If you have to describe what's going on, then you might need better code.
 
4:59 PM
I use comments as bad joke placeholders
 
@RyanKinal I mean the comments are light grey over white. You can unsee them if you want.
 
@RyanKinal "function comments" are different
 
Oh fuck the javadoc style shit...they're a bane to everything
 
I'm not against comments but this is silly :
// If the type is 'object', we might be dealing with an object or an array or
// null.

case 'object':
 
@dystroy These ones are pink
 
5:00 PM
I like the javadoc comments
 
Bright fucking pink
 
@FlorianMargaine I hate them with a passionate fury. But I was forced to work with java for a long time, so my opinions are a bit biased.
 
@FlorianMargaine I really prefer Go comments : not full of decoration like /*******************************
 
@FlorianMargaine and why the hell are the comments not indented
 
Now I even use Go comment style in java code : This prevents over-use of my mouse wheel
 
5:01 PM
@FlorianMargaine I like the purpose of javadoc comments... but I don't like the fact that, in soooo many cases, there's more comment than code
 
that's crockford for you
what the hell is the scale property for on image elements?
can't find any doc about it on mdn
 
@FlorianMargaine gist.github.com/3373067 :D
 
@dystroy Can you explain "Go" comment style?
Or link to it, or something?
 
wtf, why is it all messed up
github...what did you do to tabs?
 
to which standard does the Image object belong?
 
5:03 PM
@RyanKinal first, the inital elements of philosophy : lysator.liu.se/c/pikestyle.html
 
DOM standard
 
can't find it :/
no Image in there dom.spec.whatwg.org
 
@RyanKinal now some code : golang.org/src/pkg/bytes/bytes.go
 
(thought that too)
 
oh, Image is a shortcut to createElement('image')
 
5:05 PM
ah
 
@RyanKinal and the automatically generated doc :golang.org/pkg/bytes
 
there's nothing about the scale property on them
 
ah, because it doesn't exist!
FUCKING JQZOOM
 
> (document.createElement('img')).scale
undefined
:P
 
5:07 PM
@FlorianMargaine You, sir, have been trolled by horrible software
 
@dystroy Hmmm. I like it.
 
oh god
it's really extending a DOM object
FFS...
 
About to complete prince of persia 2 , phew after this i can* code!
 
@copy yeah...
@Zirak you meant createElement('img'), right? :>
 
@Abhishek Nice!
 
5:13 PM
Indeed I do
 
I remember the end of dead space
i think the part that scared me the most was that ending
the rest I didn't have much difficulty
 
can somebody tell me which of the following syntax is wrong for an object declaration ?
 obj['name'] = 'Suresh'
 obj = {'name': 'Guru'}
 obj{'name'} = 'Ahmed'
 obj.name = 'Mark'
 
Third
 
They don't all do the same thing, and the 3rd line is just wrong
 
holy good god. it's easier to pirate software than it is to buy it.
 
5:16 PM
thank you
 
As the interpreter can tell you by yelling
 
And the 2nd isn't the equivalent of the rest either
 
@rlemon It sure is
 
@rlemon With movies it's even worse.. if you pirate it you have a single file, without crap. If you buy it you need to 1) insert the disc, 2) watch anti-piracy crap/insult, 3) possibly watch also unskippable trailers.
 
hm, nearly 20k rep... haven't done ANYTHING for the last 10k though
they really should make it so that the older the question / answer, the less rep one gets for an upvote
 
5:22 PM
@DineshVenkata looks like you're following some test
and it's the second, by the way
 
It has finished :D
 
@IvoWetzel congratulations, you have 20k rep!
jqzoom is a fucking horrible piece of shit
 
@FlorianMargaine Chat Mafia at it's best!
 
oh god
he's manipulating integers starting with 0 everywhere
and using parseInt without the radix parameter
I'm pretty sure there are floating numbers problems everywhere
oh god I hate this code
 
5:28 PM
I may have missed the start of the conversation : why are you reading this code ?
 
@FlorianMargaine I really enjoyed the link you sent me. It made me think about maybe using Backbone along with Require to route requests to the functions that I need to run for certain pages.
 
It really should not be this difficult to use maven...
 
because there is some slight offset (like, 20-50 pixels) in the large image compared with the "lens" on the picture
@mattblang you're welcome :)
and, well, the client reported this. I didn't think it'd be so painful ~~
the plugin extends all the dom elements
uses parseInt like a noob
uses floating numbers like mad man
with no rounding whatsoever
doesn't cache anything
it's just...
well.
 
You're looking for a 5 letters word that made Cambronne celebre ?
 
@ThiefMaster Trying to purchase windows 7 pro 64bit. Walk into the store I purchase all of my hardware at (personal and for work... so they get a descent amount of business from me. ~$500-$1000/mo) and the idiot behind the counter tells me she only carries OEM now and I cannot purchase it without purchase of a motherboard and cpu.
 
5:32 PM
WTH
 
so I tell her thats retarded, go down the street to another store, they charge $65 more than the other store!
 
Never had to purchase win7... msdnaa ftw ;)
 
I'm thinking of just buying a subscription for work and using that ffs.
 
Why not order cheap system builder versions from german amazon?
 
I had the same sorta run around trying to buy VS2012
 
5:32 PM
@dystroy well, fuck the guards.
 
@ThiefMaster last week I purchased hardware for another PC for one of the engineers.
I don't need anymore hardware - just windows.
 
I know. In germany microsoft has to sell those versions without hardware
They probably hate it but well, sometimes our courts make nice decisions
 
yea, I can order it pretty cheap from other sites. I just wanted to get this pc running today
 
Just get the iso and enter the product key later?
 
@ThiefMaster I would really like this in France : I must build my PC myself to avoid buying an OS...
 
@dystroy: Buy it in germany and get the iso from some university server
@rlemon: isn't that loaded with dell crapware?
 
Raw version of my userscript is ready!
 
Good Guy Dell provides all ISO files for download.
@ThiefMaster nope.
 
The ISO isn't needed : I only use linux
 
5:35 PM
none of it actually.
 
I'm just pushing it to GitHub so you guys can check it out. :)
 
ah, misread your message
Firefox should really be smarter when IPv6 is broken (as in configured but timing out)...
 
@dystroy unfortunately my clients are not as 1337 uber haXX0r like that.
 
It tries every single request to a domain with IPv6 first... it should disable it for a certain time when it fails.
 
@ThiefMaster I hate that the MS store just says "get access to all the Microsoft operating systems you need to effectively develop and test your applications".. but they fail to mention which operating systems this is
it could be win8 and winXP or something stupid
or all 32 bit software
for a thousand bucks I kinda wanna know what i'm getting.
 
5:45 PM
@FlorianMargaine the third line is wrong I waned an invalid line
 
@DineshVenkata you were trolled... a little bit...
 
I mean which one is right? @dystroy
 
Depends on what you want.
 
obj['name'] = 'Suresh'
obj = {'name': 'Guru'}
obj{'name'} = 'Ahmed'
obj.name = 'Mark'
in these four statements
 
@DineshVenkata I'd suggest you to read that : developer.mozilla.org/en-US/docs/JavaScript/Guide/…
 
5:47 PM
the third one is wrong
@dystroy sure
 
@DineshVenkata If you must work with Javascript, then you must perfectly master what's in this doc
 
@dystroy I was registering for an event this was a question I haven't worked on javascript
 
So, if you're interested check it out. github.com/mainerror/SO-GitHub-Onebox/raw/master/…
It is a raw first version. Nothing is optimized yet.
Once installed just grab a GitHub project URL and post it in chat. :)
o_O
 
@OctavianDamiean the third line is wrong syntactically right?
5 mins ago, by Dinesh Venkata
obj['name'] = 'Suresh'
obj = {'name': 'Guru'}
obj{'name'} = 'Ahmed'
obj.name = 'Mark'
 
@DineshVenkata You kidding?
Mhmm, what the hell.
Something is wrong. O_o
 
5:54 PM
I'm a javascript newb
 
It oneboxes but then the oneboxed message gets replaced again. :O
moar testing
 
I didn't get you
 
@DineshVenkata 3rd line
hing hint
 
@Abhishek I know it is wrong but people here were confusing me
so conforming
 
(x-x)
dear god
 
5:56 PM
don't understand who's kidding
 
@Abhishek no, it's the second
 
@FlorianMargaine why is it the second one?
 
since when are you such a noob?
@DineshVenkata because it is
 
Oh, I think I know what's wrong ... the chat is messing with URLs after I've oneboxed them. Sigh ...
 
here it is var obj = { property_1: value_1
so I think second one is correct
 
5:59 PM
Crap ... also switching between channels gets rid of the onebox obviously.
 
stupid question... this code would insert a <p> after the div with id of one wouldnt it...
$(document).ready(function(){
$('#one').after('<tag><p>What the Fuck!</p></tag>');
});
i think this tutorials being an idiot with me
 
<tag> ?
But yes, it should
 
oh...ignore me... i think i know what ive done
its me reading it wrong lol
 
So, the tutorial's not an idiot?
 
no its me being a plank
im trying to learn and i read it literally
 
6:06 PM
I don't suppose it was, say, "div:first" rather than "#one", right?
 
no, it were the fact i left the <tag> in when that was actually referencing the tag i wanted to use...
 
lol
 
i just slapped my head on that one... i am blonde at times
 
!kb Kristy
 
it is official: it is easier to rip off Windows 7 than it is to walk into a store and purchase it. MS Store no longer sells it. For $1000 I can get MSDN OS 2012 which contains it, but it's a grand... the stores in my area sell it for $150 - $210 and REQUIRE that you also purchase at minimum a mobo and cpu.
downloading the ISO took 35 minutes... getting a key took another 10 minutes. one link and one phone call. I have activated win7.
MS makes their software WAY to hard to purchase IMO (unless you are big corp)
 
6:15 PM
@rlemon How do you get a key (not that I plan to do it, of course) ?
 
@rlemon ebay.com/sch/… - although piracy is still the quicker option
 
I bought windows7 through Microsoft's website
downloaded
 
@rlemon Good - I like this honest option
 
and installed
 
didnt have you down as being a pirate @rlemon
 
6:19 PM
@canon they no longer offer win7 only win8
I got the key by calling up my bro and getting him to read me off his key - I happened to know which OEM version he has on his PC so downloaded and installed that ISO from the dell website (OEM discs allow 5 computers to be installed upon)
so it's pirated but legit.
 
Another win for the M$ licensing department
 
because key marries to disc you have to do the phone activation. but that was ok by me
 
I can't remember the last time I installed a genuine copy of Windows that wasn't just a reinstall of the manufacturers OEM key
 
I'm seriously considering the MSDN OS 2012 for $1000
every version of windows to date 32 and 64 bit. but only 5 installs. so does that mean 5 per OS version? or 5 total? the latter seems a tad ridiculous but it is MS so I don't put it past them.
Really?
^ free download
the disc contains no licensing information in itself. so they are charging ten bucks for a OEM ISO with no key.
 
It's shit like this, IE :) caniuse.com/datauri
 
6:25 PM
You know it's a sad day when blackberry browser supports features you do not.
 
hello everyone
 
yes?
 
was just being friendly
 
Fixed my bug. :)
@GNi33 and @AmaanCheval you can check it out now.
 
0
Q: QapTcha error issue. Works locally, not on live server

BlassFemurI am adding QapTcha (http://demos.myjqueryplugins.com/qaptcha/) to a website that I am working on and I'm getting the error "Uncaught TypeError: Cannot read property 'error' of null". What's weird to me is everything is working perfectly locally. No errors or anything. Once I uploaded via ftp to ...

 
6:35 PM
Just installed it
@OctavianDamiean Isn't that link supposed to be oneboxed?
(Yes, I refreshed)
Oh, probably only on new events
 
@AmaanCheval It does not onebox old messages or anything after refreshing.
 
Since it is just a userscript.
 
Oooooh, this looks good!
 
@OctavianDamiean What's oneboxing?
 
6:36 PM
Meh because, I've just stolen the Twitter onebox design. :D
@mainerror, Graz - Austria
web developer and Ubuntu evangelist
259 tweets, 150 followers, following 282 users
This is oneboxing.
Of course it is limited since it isn't directly backed in into the chat system but I hope to convince Benjamin to add native support for it with some code. :D
 
@simevidas, Zagreb, Croatia
45 tweets, 12 followers, following 41 users
But this works automatically.
Ah, you add support for GitHub links, I see.
 
hello all, any ideas why this isnt over riding the css to change the border
$(document).ready(function(){
$('div').height('200px');
$('div').width('200px');
$('div').css('border-radius, 10px');
});
 
@KirstyHarris $('div').css('border-radius', '10px');
 
ah... sorry.. my bad lol!.. :) thankyou :)
bloody tutorials lol
 
@OctavianDamiean The onebox's link where twitter has @username is the API link, not the user's profile link
Next to "language: JavaScript"
That probably sounded confusing. "mainerror language: JavaScript" is in the onebox. The mainerror part is a link to the API instead of your profile
 
6:54 PM
@AmaanCheval Oh god, right! :D
Didn't pay attention, will fix.
I'm currently trying to convince Ben that it's a necessity to have it built into the chat system. :)
 
It is!
Also, who's Ben?
 
Don't let Steve Jobs see this question.... He invented rounded edges! — Neal 8 secs ago
 
lol @ neal
 

« first day (789 days earlier)      last day (4144 days later) »