« first day (479 days earlier)      last day (4470 days later) » 

12:00 AM
Is the name of a function defined within a function in the global namespace?
Is that why elisp function names are long, encapulation through syntactic prefixes?
When I say 'syntactic' I mean 'conventional'.
Clearly it still works well though, hence the email clients, web browsers and spreadsheets that are available from within Emacs.
 
Well, yeah, it works, but so does FORTRAN
Emacs is amazing. How they managed to do it with Elisp? That's beyond me.
 
Well I was just thinking that JS works well, but tools like JSLint help to make it work better. And similarly elisp might work better if it was scheme.
@Zirak discipline?
Dynamic scoping is the stuff of nightmares, but if you're careful ...
 
Perl programs exist, too
 
This is why I almost never use this in my code.
It's handy in dom event handlers. I think that's the only time I use it.
 
People do amazing things with such weird tools...
 
12:11 AM
Otherwise I find it just adds confusion.
 
Really? I'm far from afraid of this. If people are smart, they'll use it right, otherwise weird stuff will happen. Though I never let this naturally resolve to window
 
I just don't use it. I don't have to worry about other people; I don't worry about my own mistakes with it.
 
Maybe it's because I build stuff primarily with plain objects...but then again, what else?
 
When is it useful? Really?
 
Replicate IO or bot functionality from here: github.com/Titani/SO-ChatBot/blob/master/bot.js without using the this keyword once
 
12:14 AM
Okay, I can think of one example where I have used it before: in a module pattern where functions defined within a closure are to be attached to an object. But this doesn't happen very often.
@Zirak So few comments! Is there a readme?
 
It's a "I don't care what you are, as long as you can do this" thing...which I really like. It's a big part of why I'm a fan of dynamic typing, or no-typing to be exact
@adscriven The README is about how to interact with the bot :P
The wiki covers parts of IO, though: github.com/Titani/SO-ChatBot/wiki/IO
 
@Zirak, well, fair enough, if you want to be able to attach method to a random this, then you need this.
I guess I don't write code that way.
 
user1385191
!!/die
 
@MattMcDonald Could not process input. Error: Cannot read property 'stopped' of undefined
hah
 
But then I'm not a big fan of OO.
 
user1385191
12:19 AM
!!/learn greet "I'm dead."
 
@Matt McDonald Command greet learned
 
user1385191
!!/greet
 
@Matt McDonald I'm dead.
 
I know this is not java room but I think someone will be able to answer this quick question: "for(;;)" What does this mean in java?
;; in paranthesis?
 
user1385191
it means while (true)
 
user1385191
12:20 AM
it's an endless loop
 
while what true?
I have this code:

public static Node insert(Node list, String value)
{
Node node=list;
Node previous=null;
for (;;)
{
if (node==null||((String)node.value).compareTo(value)>=0)
{
Node newNode=getNode(value);
newNode.next=node;
if (previous==null)
list=newNode;
else
previous.next=newNode;
break;
}
// Insert in the rest:
previous=node;
node=node.next;
}
return list;
}

what does the ;; mean there?
 
aaaahhh
 
Of course Matt, I'll have to deduct 3k points for answering a Java question.
 
user1385191
!!/learn learn "DIE DIE DIE"
 
@Matt McDonald Command learn already exists
 
12:22 AM
@user1079641 hahahahahahahhaha!
 
user1385191
well done
 
???
 
It's a while ( true ), means an infinite loop
Which is exactly what Matt said.
 
I really need help and no one is in the java room...
 
'while what true?' So precious ...
 
12:23 AM
that doesn't make sense though
I am fairly new to java and don't understand for(;;)
 
user1385191
!!/learn glenn beck "I'M GIVING YOU A LOGICAL ANSWER"
 
@Matt McDonald Command glenn learned
The point is that there is no what to be true
 
if anyone is kind enough, please tell me
 
user1385191
!!/glenn
 
@Matt McDonald beck
 
user1385191
12:23 AM
die
 
user1385191
!!/forget glenn
 
@Matt McDonald Command glenn forgotten.
 
@user1079641 Imagine that everything is true. Then that statement will execute; for eternity.
 
In computer science a for loop is a programming language statement which allows code to be repeatedly executed. A for loop is classified as an iteration statement. Unlike many other kinds of loops, such as the while loop, the for loop is often distinguished by an explicit loop counter or loop variable. This allows the body of the for loop (the code that is being repeatedly executed) to know about the sequencing of each iteration. For loops are also typically used when the number of iterations is known before entering the loop. For loops are shorthand way to make loops when the number of...
You didn't enclose the command name in quotes ;)
 
user1385191
!!/learn "glenn beck" "I'M GIVING YOU A LOGICAL ANSWER"
 
12:25 AM
@Matt McDonald Command name must only contain alphanumeric characters.
 
user1385191
!!/learn "glenn_beck" "I'M GIVING YOU A LOGICAL ANSWER"
 
@Matt McDonald Command glenn_beck learned
 
yes but what is the best way to replace that statement? Or should I just take away that for loop?
 
user1385191
my work here is done
 
12:27 AM
That most be the most relaxed rage-quit in the history of time
 
anyone?
 
Do it yourself. See what the loop does, reconstruct it
Currently it enforces what would've been a condition by using break
 
@user1079641 replace it with for(;;). That is the best way.
 
replace for(;;) with for(;;)?
 
You can add a decorative spider as a comment
 
12:29 AM
Possible. Or with for (; ; )
I prefer the former, however.
Decorative cobras work quite well. `for(;/*spssss...!*/;)`
 
for( ;/*/\(oo)/\*/; )
 
@Zirak `for(;/*/\(ooOOoo)/\*/;)` no? :-)
Of course, that also makes an interesting regexp literal.
 
    //  \\
   _\\()//_
  / //  \\ \
   | \__/ |
If you want to get down to specifics :P
 
Pff! Showoff!
 
/*
█░░░░░█░░░░░░░░░░░░░░░░░░░░░█░░█░░░░░░░░░░░░░░█▀▀█
█░█▀█░█░░█░█░░█▀█▀█░█▀▀█░█▀▀█░░█▀▀█░█▀▀░█▀▀▀█░░░░█
█░█░█░█░░█░█░░█░█░█░█▀▀█░█░░█░░█░░█░█░░░█░░░█░░▀▀▀
▀░▀▀▀░▀░░▀▀▀░░▀░░░▀░▀░░▀░▀▀▀▀░░▀▀▀▀░▀░░░▀▀▀▀▀░░█░░
*/
 
12:36 AM
Unicode gangsta!
 
/╲/\ºo;88;oº/\╱\
Stolen from here: exocomics.com/195
 
@Zirak Creepy ascii
@Zirak Hehe, that is soo my daughter!
 
@rlemon Atwood isn't a very good programmer anyway, and why do people keep speaking of Jobs like he was some Messiah sent by technology gods?
Whoops
 
@Zirak i dunno. everyone knows it was the Woz that did all the real work .
 
Sorry about that, Matt
 
12:40 AM
Jobs wasn't a technologist though.
Dunno about Atwood; I like his articles though.
 
I'll never forgive him for what he did to Unix...NEVER
 
Woz did real work in the very beginning and then left.
 
Jobs was a smart man, brilliant at certain business aspects which made him a successful man. This is also true with Bill Gates (albeit he did a lot of the early work).
 
Bill Gates does great work for charity. That's how he'll be remembered in history. Not for computers.
 
Atwood's articles? Most of them are either recycled or pompous. Like "we are typists first, programmers second" yeah...
 
12:43 AM
man, I just read Crockfords entire bug list... all closed, and he's a dick in all of them.
 
@Zirak Most programmers I know are typists first.
 
Just because we type a lot doesn't make us typists
 
som off us dont eeevn tyyp wel
 
@rlemon I've filed two bugs. One upheld, the other outstanding. You just need to provide more evidence than a sentence or two. Provide some basic scientific method and he's pretty accommodating.
 
It's like saying that because I send a lot of flowers I must be a florist
 
12:46 AM
@adscriven ohh legitimate bugs, and his responses were like "Please tell me when this becomes a real world problem" and then like 5 people commenting "this is a real world problem... i'm experiencing it!" and nothing.
 
@adscriven Are you jdalton, or am I mixing people up?
 
@Zirak Hehe¬!
@rlemon No real evidence provided. Shrug. I've read that issue.
 
If you're the maintainer and you're busy, you need all the evidence provided to you on a plate. Otherwise fork it and do it yourself.
 
GGG
@Zirak older versions used 'this'
facebook js sdk still includes one of those older versions
 
12:49 AM
?
oh
 
GGG
yup
someone must have got onto him about that, lol
 
I hate how he indents comments
 
I rather like it, though I don't do it myself.
It doesn't impede my understanding of his src, let me put it that way.
Kind of a semi literate programming style.
 
GGG
12:53 AM
https://github.com/facebook/facebook-js-sdk/blob/master/all.js.php#L18
---> https://github.com/facebook/facebook-js-sdk/blob/master/src/third-party/json2.js#L160
 
IE6 === trollz
 
GGG
=== == trollz
 
His commit messages are also...succint
 
@GGG == === trollz
 
he just seems very arrogant
 
GGG
12:55 AM
no no you've got it backwards
 
@GGG '==' === trollz
 
He probably is arrogant
 
GGG
'===' == trollz
 
This again? :/
 
GGG
quickest way to clear the room out :p
 
12:57 AM
@GGG no
atob("dHJvbGxz") === "trolls"
 
GGG
but does it == "trolls"?
 
Crockford isn't arrogant if you can make your case. I argued mine here github.com/douglascrockford/JSLint/issues/89 and he made a bugfix. I don't see a problem in his attitude. He's a 'show me the money' type person.
 
trolls don't deal in truthy..
 
'===' is easy. Why make it hard?
 
GGG
'==' is easy
maybe i'll start a blog one day just so i can post about this
=== is trolls
hardcore trolls
 
1:00 AM
then we should rename you to GG
or is GGG == trolls, because I know GGG === trolls
 
GGG
my last account had a two letter name
 
I'll just say this: With ==, I don't know if you're stupid or not. If you've intentionally used == for fun and games, or if it's for some hack or something like that. With === I can be sure.
 
GGG
they don't allow two letter names anymore
it got renamed to having a dot at the end
 
@GGG BECAUSE == === trolls!
 
GGG
i guess somehow whenever that happened i lost access to it
 
1:01 AM
And I've got one outstanding issue since early Dec here: github.com/douglascrockford/JSLint/issues/90 No idea why he's not made a change, but at least it's still open.
 
GGG
lol jslint is broken as hell
it routinely says things that make absolutely no sense
 
@GGG It is?????
 
GGG
sure, i can probably make an example just pasting pretty much any code in there
hang on
 
ok, it's official. GGG === trolls && GGG == trolls /*for the trolls*/
 
@GGG === is clear. == is unclear. Wherez da trollz?
@rlemon LOL!
@GGG Gimme one.
 
GGG
1:03 AM
function foo(a, b) {
    return a || void a = b() || a;
}
 
his code is filled with '==', jslint complains about '=='
 
GGG
there that one says stuff that makes no sense
 
void? lolwut?
 
GGG
edited
 
What's the problem?
 
GGG
1:04 AM
void should make sense now
Error:
Problem at line 2 character 24: Expected '0' and instead saw '='.

return a || void a = b || a;
expected zero?
makes no sense
 
The "standard" use of void is passing 0 to it
 
void expr
 
Anyone with experience with Backbone.js here?
 
so void (a=b)
jsLint FTW
 
GGG
the "useful" use of void is using it to void expressions as intended
 
1:05 AM
Sorry, void means what here???
 
GGG
like here
 
void expr
> evaluates expr and returns undefined
 
void doesn't really do anything...it's just function (jsExpression) { eval(jsExpression); return undefined; }
 
GGG
yeah ok this is a bad example...
 
it will throw an error on void a=b
 
GGG
1:06 AM
function foo(a, b) {
return a || void b() || a;
}
 
likely not void (a=b)
 
GGG
where b assigns something to a
you don't want what b returned, you want a
function r(n) {
    var f = m[n];
    return f.e || void f(r, n ? {id: n} : r.main, f.e = {}) || f.e;
}
that's the real example it's just tough to look at
 
That won't be the case... void(anything) === undefined, so you might as well have written a || (b(), undefined) || a
 
@GGG I'd guess that you'd want a linter to complain about bad examples.
 
GGG
look at my real example
i need to void the result of the call to f
as i'm calling f i assign a value to the first thing i checked
 
1:08 AM
Can't you do that with the comma operator ?
 
GGG
yeah i could use comma
 
Using void for that is weird
 
@GGG That's the kind of thing that would be complained about in a code review. JSLint is an automated code review.
 
GGG
this is what void is for!!
this is exactly the point of void
 
Also, ternary in function call? yucky
 
1:09 AM
Void isn't the issue. The whole thing is poor code.
 
GGG
return a || f(a=b) || a;
that would return the result of f
i don't want that
 
return a || b(), a;
 
GGG
return a || void f(a=b) || a;
 
Eh? return a or blah or a???
 
It sounds like a really iffy shortcut. Like ternary on steroids
 
GGG
1:10 AM
yes exactly
it needs to return a either way
 
return a || f(), a;
 
GGG
it needs to return a, or do f and then return a
 
No, that won't do.
 
still doesn't pass
lol
 
And, return a || (f(a=b), undefined) || a;
 
GGG
1:11 AM
yes the comma thing would work
 
But I wouldn't ever do that
 
GGG
i thought void was better because this is the whole point of void afaik
 
return a || (f(a=b), a);
 
GGG
if this isn't what void is for, i don't know what is
@copy yeah that works too
 
Awful, awful code. You're sacked, the lot of you.
 
1:12 AM
@GGG writing poor href attributes
 
if (a) {
    return a;
}
f(a = b);
return a;
 
You should rather use multiple returns
@Zirak this
 
Youl should write what you mean.
 
That's about 400 times clearer
 
GGG
no, this code is a bootstrap that gets appended to "compiled" commonjs assemblies
i want it as terse as possible
 
1:13 AM
f(a=b)? WTF?
 
GGG
it lives in a string in a bash script anyway
 
Then sure, write all the monstrosities you want.
Don't expect anyone to call them pretty, though
 
GGG
//
//  CoM4 bootstrap
//
(function (m) {
    function r(n) {
        var f = m[n];
        return f.e || void f(r, n ? {id: n} : r.main, f.e = {}) || f.e;
    }
    r.main = {id: 0};
    return r(0);
}([...]));
that's the entire added thing
 
Holy shit.
 
GGG
list of modules goes where ... is
 
1:14 AM
Long live JSLint.
 
And tbh, I never understood the purpose of void. Some have told me it's to be sure you get the "real" undefined, but shrug
And if that's not the minified source but actual dev code...
 
GGG
yeah it's hand minified
 
Is it very far away from dev code?
 
GGG
it's like that in the dev code
it makes sense to me because i wrote it like 10 different ways before i settled on this
 
sigh
The whole point of good code is that it'll make sense to you in 10 months, and to the guy after you, and after him, and so on
 
GGG
1:18 AM
but it needs to be small all the time
and it needs to be unreadable in the source
so you know it's not really part of the program
 
Then write the unminified version in comments
 
GGG
just some black box crap you can ignore
 
Or something like that
 
Sometimes terse code makes sense if you're implementing a specific algorithm. But then you should include a link to e.g. the wikipedia entry prior to your code.
 
:( this site is so freaking depressing...
0
Q: Given the choice, is it better to construct DOM elements using JQuery or PHP

CamAs the title suggests, I'm looking for an answer to a best practice question, Is it better to construct DOM elements using JQuery or PHP. backend or frontend. To give some context, My PHP loop builds page elements like so; <div id='content'> <div id='el1'></div> &...

 
1:19 AM
!!give Incognito a lick
@Zirak Mmmm! Incognito tastes just like raisin
 
Two scoops or one?
 
GGG
it is just doing exactly what the commonjs modules 1.1.1 spec says
 
i need to animate a width, is this the correct way?
 
GGG
i guess i could link to it
 
var newWidth = $("#container").width();
$("#head").animate("width", newWidth);
 
1:20 AM
I...I don't even know how to approach you, @robm. What possibly makes you ask that?
 
@GGG If it's a copy of a particular algorithm then the code is probably fine -- but you have to include a link to the algorithm.
 
02:20, 13 hours of code, probably that could give a break and a simple answer, wold be much appreciated
 
All I can think of is...why not?
 
@Zirak :) give us a quick tip man, pls
 
I could question your definition of "correct", but unless I'm not aware of something, yeah...it should work.
 
GGG
1:23 AM
@adscriven spec imp not algo
it's just so simple and there's no more code to write
i figure why overcomplicate it
that is all the js code this thing needs
 
@Zirak need to add that variable value with animation
it doesn't work tho
 
@GGG Well an algorithm would be most helpful, but knowing the intended behaviour is useful.
 
Whadya mean "add that variable value with animation"?
 
@Zirak well this var newWidth = $("#container").width(); is a number now righ?
 
@GGG It's simple if you know the context. Otherwise it's wtf?
 
1:27 AM
It should be, yes
 
so the width must become that number and wider animating
which i guess is this $("#head").animate("width", newWidth);
 
...?
 
if i do $("#head").css({"width": newWidth});
it's fine
but if i do
$("#head").animate("width", newWidth);
doesn't work
 
Explain "doesn't work"
oh, wait...if that the right syntax?
!!/jquery animate
 
this works basically, $("#head").css({"width": newWidth + 'px !important;'});
#head has now "newWidth"
 
1:32 AM
Apparently animate requires an object like css does
 
only thng i'm trying to do is to apply the same width but with an animation rather than a set css
 
See the examples in the docs
 
GGG
@adscriven yeah i'm not sure what to do about it.... it's actually easier to read like this than with proper variable names because the lines get really long
and as i mentioned i want to keep it as small as possible
 
The first argument should be a cssPropName => value object
And the second argument is the animation length
 
s this $("#head").animate({"width": newWidth + 'px'},"fast");
 
1:35 AM
what is the equiv. to arguments in php
 
The + 'px' part isn't needed, but that's the idea
 
ahhh, damn i knew it was something like that
 
ninja'd
 
thanks zirak
 
1:36 AM
thanks guys.
 
$("#head").animate({"width": newWidth},"fast");
however, it doesn't animate
but yea
no idea why
this does $("#head").css({"width": newWidth + 'px !important;'});
 
(* 2 "no problemo")
Then you're meddling with css specificity issues
Frankly, I've completely lost track of how jQuery does stuff like animate, so can't help with that
 
that's fine, thnks man
 
Enjoy
 
1:50 AM
I think I'm going to go become a haskell programmer.
And forget about javascript.
 
Do you get your own cape with that?
 
I hope so.
 
And why would you do that?
 
I'm sick of the culture of javascript code authors (not programmers). The religious zealotry of jQuery, the attitude of people who insist they know so much yet are convinced SQL queries crash the browser environment, people hard-coding enumerated IDs into elements and insisting it's fine
 
user1385191
looks like it's time to brush up on Python
 
1:53 AM
My working theory is I'm an idiot with haskell and there's only 30 people in the world that actually program it (everyone else just talks big)
 
user1385191
should probably get a portfolio up as well
 
I open stack overflow, read questions, and I'm just depressed as hell.
@MattMcDonald Are you consulting now?
 
user1385191
fired
 
Epic.
What happen?
 
user1385191
projects took too long
 
user1385191
1:55 AM
boss expected me to copy-paste lots of code
 
user1385191
I tried to maximize flexibility
 
=/ Sounds like you had a lousy project management setup.
 
user1385191
one programmer amongst 2 designers = company = do the math
 
Was everything basically ad-hoc fly by the seat of your pants?
 
user1385191
yep
 
1:56 AM
Yeah, that's why I'm looking for a new job right now, I'm tired of that setup, something is going to give eventually, and it'll be me one way or another.
 
user1385191
my boss' response after he accidentally deleted a few days' worth of work? "nah, I don't need git. I'll just save to disk"
 
Oh, sweet.
 
user1385191
mozilla's got a front-end dev job opening
 
user1385191
telecommute + an office in vancouver
 
user1385191
I'm shooting for it
 
1:57 AM
@MattMcDonald Check out storybird, it's a virtual company but they do a lot of flash and html5 canvas stuff.
 
user1385191
just need to know python
 
They're on SO careers I believe.
I applied to them so you're competing with me :P.
 
user1385191
they have an office in toronto too :)
 
They're actually virtual, I had a skype with them already, really cool company by the sounds of it.
They want a front-end dev who really knows how to make maintainable sites, write some quality JS, make their HTML5 version of their product and mobile version, and perhaps maintain some of the flash stuff (but they generally don't need heaps of flash work done by the sounds of it)
So basically you work remote.
It sounds like they're right up your alley. Also the backend guy does mostly python so it's a natural setup for you to be learning some django.
 
user1385191
2:01 AM
I'm looking for the front-end job since I have 0 xp with django
 
GGG
django is pretty easy peasy
 
I don't think they want you to do intensive stuff with it, just work with templates or maybe basic stuff.
It sounds like they want a dedicated front-end guy with serious in-depth knowledge of the front end who's got a basic understanding of the backend.
 
user1385191
:)
 
GGG
2:20 AM
wow i think i just found a bug with so
am i supposed to be able to edit other people's questions on stackapps.com with 101 rep?
 
Anyone can edit anything (well, almost), it just goes into the suggested edit queue if you don't have enough rep to have edit privs.
 
GGG
no i got it to go right in and also skip the diff thing
like a boss
 
Looks like a pending suggested edit to me ;)
 
GGG
oh :(
i thought it went in
"This edit will be visible only to you until it is peer reviewed"
hurr
 
2:53 AM
RT @stevefaulkner: Browser's Got A Brand New ASS (accessibility support score) http://www.html5accessibility.com/ #HTML5 #Accessibility
 
 
3 hours later…
5:30 AM
RT @fsasaki: "translate" attribute made it into HTML5! https://www.w3.org/Bugs/Public/show_bug.cgi?id=12417#c79 a good day for the multilingual web
 
 
2 hours later…
GGG
7:10 AM
anybody know anything about opera?
esp. getComputedStyle weirdness?
crap where's @MattMcDonald
 

« first day (479 days earlier)      last day (4470 days later) »