« first day (947 days earlier)      last day (4005 days later) » 

4:02 PM
Anyone know how I can get the mouse pointerLock API working on Chrome Frame (if even possible)? stackoverflow.com/questions/16485707/…
 
First world problems, I already rep-capped in the morning so now I'm just answering a bunch of questions :P
 
green ticks still give rep
 
How do you find the stamina
oh, you just got 1 very popular answer
 
Yeah
I answered what I thought was a basic C# question in the morning, apparently C# people aren't very used to answers that cite the specification like we do in JS so it got a bunch of upvotes.
 
> When there is no type hierarchy you don’t have to manage the type hierarchy. — Rob Pike
 
4:12 PM
@BenjaminGruenbaum I didn't read it all (its a whole bunch), but what I read... I'm uncertain about it. It confused me because first the author stated and granted nazi-germany a superior organizsation and economy, for being on eye-height and even higher with four other major states back then (UK, USA, USSR, France) and in the following section he describes that it actually wasn't any superior achievement at all
beyond that, the article has some major wrong information from what I know about strength of military forces
 
@jAndy I'm also uncertain about it, I think that if he had a solid point he could had made it more coherently. Also, yeah, the strength of armies information is also different from what I've read.
 
Why is Sauron's Eye Prototype here?
 
one of the biggest myth about military strength from 1933-1939 is, how much nazi germany armed up. Compared to its neighbors (france, ussr, uk, poland), germany had a disadvanted of about 97:1 1933 and still about 25:1 1933
that was, by all means, actually never a big enough army to attack
 
4
Q: Javascript if short notation

user2381011I was surfing on the web in search of a shorthand Javascript notation for an if-statement. ONLY the if, not the else. My question: does it exist? eg: (i === 0) ? onlyMyTrueValue; The only snippet I seem to find is this one: (i === 0) ? myTrueValue : myFalseValue; Thanks in advance

THE FOOLS.
 
4:18 PM
While I begin working, just wanted to drop this in in case anyone has yet to see: github.com/Zirak/SO-ChatBot/issues/59
 
2nd all nighter at uni in 2 days. not good.
 
@phenomnomnominal What rude things to say
 
CoffeeScript support in bot. good.
 
Hey guys
 
herro
 
4:21 PM
Hi help vampire
 
@SimonSarris LOL
 
@Zirak, wheeeeerrrreee?
Oh i see!
I didn't notice at first, because it looked like something I would say
 
fabian ~% python test.py|netcat golf.shinh.org 80
HTTP/1.1 200 OK
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Date: Mon, 20 May 2013 16:22:55 GMT
Server: lighttpd/1.4.29

12b
<p>bad content body:</p><pre>./handler.rb:439:in `read_multipart'
./handler.rb:402:in `loop'
./handler.rb:402:in `read_multipart'
(eval):108:in `handle_'
./handler.rb:77:in `handle'
/home/i/ags/fe/fcgi/index.fcgi:38
/home/i/ags/fe/fcgi/index.fcgi:21:in `each'
/home/i/ags/fe/fcgi/index.fcgi:21</pre>
0
Did I break the server?
 
somewhere in my style sheet I have something that effects the mobile styles and adds a tiny little horizontal scroll. I have inspected the heck out of my site and still can't find the little hidden fucker that sticks out creating the unwanted scroll.
 
or you just sent a bad request
 
4:25 PM
@copy The server just told you that your request syntax sucks.
 
like not specifying the correct content type for a post request
 
It sends me 2 http responses back
 
Is there some sort of script or tool besides the inspector that I can use to find this thing that sticks out and creates the unwanted scroll
 
nope
this kind of stuff is a pita to find
it's likely a left: 5px somewhere that screws up everything
@copy that's... not possible
 
4:27 PM
@copy You must be sending two requests then.
 
Nah, it's ruby
It seems to send the 200 OK headers first, then realizes that there's an error and then sends a 400 Bad Request
 
wat
 
@copy No, it sends two different responses
It switches the protocol in the middle which is a mistake
However, what it does is send a 200 response on a keep-alive connection, realize something is wrong, then senc another response, this time 400
 
Or that, makes sense too
 
@FlorianMargaine I have been able to lessen the horizontal scroll on my homepage and then it completely goes away on all my sub pages
 
4:30 PM
Well, no it doesn't make sense. I mean it's doing that but that doesn't make sense. :D
 
@FlorianMargaine on my nav ul for 320-480 styles if I make it max-width:300px; instead of max-width:320px; it lessens the scroll
 
So I inherited some code from a team member. (It was written within the past 2 months)
 
@Shmiddty That feel.
 
within this code, I have seen Date.parse(new Date()), $(...)[0].innerHTML = ...
$get(...).firstChild.firstChild.innerHTML = ... (get is just a shorthand element by id)
used right next to jQuery code
$get('...').firstChild.firstChild.innerHTML = '&nbsp;&nbsp;&nbsp;OK&nbsp;&nbsp;&nbsp;'; >.<
 
@FlorianMargaine any ideas
 
4:35 PM
i risk to be boring, but, can anyone give me link to site he think it's really well designed and exaplain in 2 words why he think so? :P
 
google.com
 
if (typeof (Namespace.Property) === 'undefined') (not horrible, but why the parens?)
 
@FlorianMargaine (please avoid bignames :D )
i forgot it :))
 
Why do people do typeof context.property === 'undefined'? It's longer and weirder than just context.property === undefined
 
for example i love cloud9ide.com awesome UX IMO
 
@FlorianMargaine ahhhh :D i love it only cause it's you :D
 
@Zirak browser compat
 
Example?
 
@Zirak Paranoid about undefined be redefined I guess.
 
wait... doesn't Backbone.js have templating?
 
4:38 PM
=== void(0) then
 
@Zirak iirc, the shorter version doesn't work on older browsers
 
@Shmiddty I feel you :/
@Shmiddty Yes it does, also backbonejs sucks
 
@FlorianMargaine so I just have to keep searching for element that sticks out just a little to much
 
@BenjaminGruenbaum with the dev sitting next to me, I was like "couldn't we just use Date.now()?"
@BenjaminGruenbaum That's what we're using, apparently. And handlebars.js, and underscore.js, and jquery.js
 
@Shmiddty Backbonejs has a dependency for underscore.js which includes underscore microtemplate (which suck, but backbone sucks so much as it is)
It's not a very bad set up, it's just the opposite of my taste.
 
4:39 PM
@FlorianMargaine which the best UX you got on the web?
 
I actually like handlebars (well, I like Mustache, I think handlebars doesn't add much to it really)
 
I probably would have fought for Angular if I were part of this from the start
 
@FlorianMargaine I've never heard of any problems, but given the benefit of the doubt... property in context, or if you're worried about prototype chain, context.hasOwnProperty(property)? Still shorter and less obfuscated
Well, not obfuscated
bah. end of pointless rant/
 
I'm not saying they should do it this way
just a reason for one or the other
I use in personally
 
@Shmiddty Anything but backbone, I really like Knockout and Ember too.
 
4:41 PM
    $.fn.serializeObject = function () {
		var o = {};
		var a = this.serializeArray();
		$.each(a, function () {
			if (o[this.name] !== undefined) {
				if (!o[this.name].push) {
					o[this.name] = [o[this.name]];
				}
				o[this.name].push(this.value || 'NULL');
			} else {
				o[this.name] = this.value || 'NULL';
			}
		});
		return o;
	};
 
Do you at least use Marionette?
 
because why?!
 
@Shmiddty wtf is that?
 
@Shmiddty ...wow
 
more codes I found
 
4:42 PM
@Shmiddty I know it's codes you found but, wtf is that?
 
I think it's supposed to be JSON.stringify
 
@Shmiddty I smell a developer who was doing his first single page app, coming from a "let's create dynamic pages with jQuery" background.
 
or... is it serializing a form? I think it's serializing a form
 
Yeah, it looks like it's serializing an object in a wicked form like way
 
4:43 PM
Fixing other people's code is a thankless, depressing task.
 
Well, I feel for you, inheriting code form inexperienced developers is a pain, that's why code review is so important
 
Should I fear asking what does serializeArray look like?
 
@Zirak trying to find that now
 
oh, it's part of jquery
 
4:45 PM
serializeArray is actually well written
 
what?
could be more readable honestly...
 
For jquery, it's decent+
Love me some return ternary though
!!/jquery serializeArray
 
not ternary
 
but ternary ternary
jquery loves nested ternaries...
 
4:46 PM
I think it's well written, the map -> filter -> map structure is nice, the pipe of execution is very understandable
I'd re-write that last return though ,yeah
 
There's a trend in libraries to splat complex return statements into one expression
 return this.name && !jQuery(this).is(":disabled") && rsubmittable.test(this.nodeName) && !rsubmitterTypes.test(type) && (this.checked || !manipulation_rcheckableType.test(type));
oh yeah. very well written
 
return true; // fix'd
 
What's the && and || precedence, again?
 
!!/mdn operator precedence
 
4:48 PM
(function(window, $, true, undefined) {
}(this, jQuery, false))
I don't think it works :(
 
^^^^ rhetorical question
 
but it'd be fun.
 
@FlorianMargaine you can shadow undefined but not true
 
@Zirak I'd write this as multi-line (with lines ending in &&), but I don't see the big issue. Compared to the rest of the jQuery source code it's very nice.
@JanDvorak not in strict mode iirc
 
4 mins ago, by Zirak
For jquery, it's decent+
I'd split it into different variables
 
4:50 PM
Yeah, probably that too
 
@BenjaminGruenbaum [citation needed] because that's what's jQuery is doing everyday
 
To me it looks like somebody trying to show off and failing.
 
describes most of jquery's source code ^
 
The bot needs Kernighan's quotation about debugging.
 
this one?
> Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
 
4:52 PM
 $.fn.serializeArray = function () {
    var result = [], el
    $( Array.prototype.slice.call(this.get(0).elements) ).each(function () {
      el = $(this)
      var type = el.attr('type')
      if (this.nodeName.toLowerCase() != 'fieldset' &&
        !this.disabled && type != 'submit' && type != 'reset' && type != 'button' &&
        ((type != 'radio' && type != 'checkbox') || this.checked))
        result.push({
          name: el.attr('name'),
          value: el.val()
        })
    })
    return result
^ Zepto
IMHO, Zepto's is worse
 
Oh my
 
seems clearer at first glance though
 
That's horrible code :/
 
but yeah ugly too
 
@FizzyTea Pull request
 
4:53 PM
Aw, just copy and paste! :-)
'Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it?'
 
ugh I hate this
 
but it is more clear than jquery's code, really
 
Whenever I see a forEach loop that has a results array and a push statement. I read it "This guy never heard of map" .
 
can't find it
 
Zepto also only supports modern browserz, jeez
 
4:54 PM
@BenjaminGruenbaum this method is faster than map + filter
 
and it sucks
 
I think they were optimizing there
 
@FlorianMargaine I don't think that doing a .each and pushing to a results array is faster than .map
Perfing though
 
it's map + filter
so you'll loop twice
 
@FlorianMargaine That optimization is dumb.
 
4:55 PM
^
 
And even if you have over 90 million elements, you could still reduce
 
it's not like you'd be saving cache hits by iterating once
 
true
reduce is always the best solution anyway
 
I thought it was recursion ?
 
no
recursion is always the only solution.
 
4:57 PM
I thought it was jQuery?
 
anyone used this before? sipml5.org/index.html?svn=179
 
How'd you write map+filter with reduce?
 
Seriously, do you guys often use reduce ?
 
JS is missing select many :)
@dystroy I do often, yes
 
@dystroy never :P
 
4:58 PM
@dystroy I try as much as possible
 
flat_map
 
@JanDvorak is that a part of the spec :O?
 
jQuery's map is flat
 
// Just lost faith in this API

// create an Array to set multiple initialization values
var initvalues = new Array();
initvalues.customform= 17;
initvalues.recordmode = 'dynamic';
initvalues.entity = 355;
 
where's this from?
 
4:59 PM
Netsuite CRM API documentation
 
Yeah, not using a second filter is twice as fast, I still think it's a dumb optimization
 
but I can't use it at work
 
since I'm doing php + old browsers support with jquery, and seniors don't want es5-shim ~~
 

« first day (947 days earlier)      last day (4005 days later) »