« first day (922 days earlier)      last day (4025 days later) » 

10:04 PM
@OctavianDamiean umad.herokuapp.com/roster
 
@XCritics Nice. Now the important part. The K/D ratio.
 
// @rlemon Not, Java, Enough
var ElementFactory = new Object();
ElementFactory.getElementOfType = function(type) {
   switch(type){
   case "div": return document.createElement("div");
   case "span": return document.createElement("span");
   case "tr": return document.createElement("tr");
   case "td": return document.createElement("td");
   default : throw new Exception("Invalid Element Type");
   }
};
You had a function without an object explicitly holding it it, that must have been a mistake
 
@OctavianDamiean see that roster page ;)
and nice :P
 
10:19 PM
No manual entry for use
 
Is a metaphor like a simile?
 
Safely checking for two level property flags is done like so right? (a.b || {}).flag
 
!!/inhistory 1920
 
@Zirak March 25 – Irish War of Independence: British recruits to the Royal Irish Constabulary begin to arrive in Ireland. They become known from their improvised uniforms as the "Black and Tans".
 
!!/inhistory 1920-03-25
 
10:28 PM
@Zirak undefined
 
...you lie
 
@ŠimeVidas that looks wrong
for one, the object literal doesn't have a flag property
two, if a is undefined, you'll get an exception
 
Weird...it's listed under 1920, but not under March 25
!!/inhistory 1988-03-25
 
@Zirak 1988 – The Candle demonstration in Bratislava is the first mass demonstration of the 1980s against the communist regime in Czechoslovakia.
 
!!/inhistory 03-25
 
10:30 PM
@Zirak 1990 – The Happy Land fire was an arson fire that kills 87 people trapped inside an illegal nightclub in the New York City borough of The Bronx.
 
@Shmiddty The intent is to check if a.b.flag is true or false, but do so safely so that if a.b isn't defined, the code doesn't throw
 
@rlemon Done
 
@Shmiddty I'd also put a !! in front to coerce to Boolean
@Shmiddty a is always defined. It's usually something ubiquitous like window.
 
@ŠimeVidas but if a isn't defined, it will still throw an exception
 
@ŠimeVidas You can do a.b && a.b.flag
 
10:33 PM
@Zirak ImNotSure.ThatThisIs && ImNotSure.ThatThisIs.TheBestApproach
 
You'd rather throw around object literals?
 
stupid connection issues
 
@MarkDoyle Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
@Zirak If it's safe, why not?
It's a neat little pattern
 
Because you're already doing a.b && a.b.flag, just in more steps
 
10:35 PM
0
A: Disable a "link" tag without access to HTML

rlemonvar test = "http:​/​/​www.formstack.com/​forms/​css/​3/​default.css"; for (var i = 0; i < document.styleSheets.length; i++) { var sheet = document.styleSheets.item(i); if (sheet.href.indexOf(test) !== -1) sheet.disabled = true; } this will work, however it is inefficient (still) as it c...

 
...so you weren't asking for opinion, you were asking for someone to say "you're right"
 
I think my updated answer is elegant
how to disable a stylesheet given only it's href value.
var test = hrefValue;
[].some.call(document.styleSheets, function(sheet) {
    return sheet.disabled = sheet.href.indexOf(test) !== -1;
});
 
@Zirak I'm doing what in more steps?
 
@ŠimeVidas The subject appeared right after: a.b && a.b.flag
(a.b || {}).flag is the same as a.b && a.b.flag
But this is a stupid argument, so I'll just leave it as that
 
!!>!!{}
 
10:37 PM
@Shmiddty true
 
@Zirak In the latter, a.b is evaluated twice, is it not?
 
51 secs ago, by Zirak
But this is a stupid argument, so I'll just leave it as that
 
@ŠimeVidas Likely? no
 
!!>var a = {}; (a.b || {}).flag
 
@Shmiddty "undefined"
 
10:38 PM
zonk
 
@BenjaminGruenbaum No?
 
@ŠimeVidas To the perf!
 
does SO chat use sockets?
 
yeah
 
I think my work's FW is blocking shtuff
 
10:39 PM
@BenjaminGruenbaum It has to be evaluated both times. Those are two separate expressions.
 
For input, and it falls back to xhr if it there's any problem.
 
this is frustrating... have to refresh after every message >.<
 
@ŠimeVidas Won't it be cached the first time (assuming it's not a getter)?
 
All I can say is that my life is pretty plain.
 
@BenjaminGruenbaum The JS engine can cache the references, yes, but it still has to evaluate the identifiers. All code has to be evaluated.
 
10:41 PM
I like watching the puddles gather rain
and It's okay
 
!!>var a = {b:{flag:false}}; (a.b || {}).flag
 
@Shmiddty false
 
@mikedidthis shoot, I forgot to ping you
PING!!
 
@ŠimeVidas Once, the JIT can handle this sort of thing very easily
 
So, anyways, if my code is safe, how about this: (a.b || 0).flag. So, a 0 instead of an object literal.
 
10:42 PM
!!switch partitions now or later
 
@Zirak switch partitions now
 
bunch of stupid kids running around the office today.
 
I'll do a sys update first
 
When a.b.test exists, the two are as fast http://jsperf.com/evaluated-object-cache
When the object doesn't exist (a.b || {}).test is more than 50% slower http://jsperf.com/evaluated-object-cache-no-object
(Chrome 26 stable /windows)
 
Also, @rlemon, it's possible: developers.google.com/youtube/2.0/…
 
10:43 PM
@ŠimeVidas With 0 it's the slowest by far since it has to box and unbox
@ŠimeVidas just added to the test, running
 
Just open an issue on github please
 
@rlemon no worries.
 
@BenjaminGruenbaum But with {}, it has to create a new object...
 
@ŠimeVidas no, it doesn't... (well, not more than with 0)
 
@Zirak will do later when sufficiently drunk.
 
10:44 PM
@ŠimeVidas Yes, (a.b || 0) is the slowest by 96%, a.b && a.b.test is faster than a.b || {} by a factor of two
 
@OctavianDamiean umad.herokuapp.com/roster K/D Ratio bruh
 
It would make sense that short-circuiting will generally be faster.
 
@ŠimeVidas With a.b || 0 it sees a.b is falsy so it falls back to 0 which is a primitive value, then it tries to perform property access on it which boxes it to a Number object, then unboxes it back to 0
 
@XCritics Accuracy % (shots fired / shots hit)
 
So, with 0 both object creation, serialization and deserialization are performed
 
10:46 PM
@Zirak short term command: googleTube. just adds 'youtube + ' prefix to the search and auto oneboxes the first link.
 
@BenjaminGruenbaum Why would it unbox it afterwards?
 
!!/googleTube "Blind Melon - No Rain"
 
@rlemon Command googletube does not exist.
 
and huzzah!
 
@Zirak your ratio is upside down
 
10:47 PM
@BenjaminGruenbaum You're gonna make me look into the spec now, aren't you :P
 
Yes, sorry
 
@ŠimeVidas Because it's still a number, would you expect it to remain an object? Or assume its value didn't change?
!!> var a = 0; var b = (a).toString();typeof a;
 
@BenjaminGruenbaum "SyntaxError: missing name after . operator"
 
@ŠimeVidas It's possible that the jit is clever enough to work this out, but it's a rare use case
 
Why the double dot? a isn't a number literal
 
10:47 PM
@BenjaminGruenbaum "number"
 
@Zirak Right, that's the sort of thing that happens when I start writing code and changing it in the middle -_-
 
!!> 1..toString()
 
@rlemon "1"
 
^works
@rlemon first dot is for floating point :)
 
i know
wtfjs.com is lovely
 
10:48 PM
I recently found out:
!!> 1 .toString()
 
@Zirak "1"
 
Because number literals can't contain spaces
 
@BenjaminGruenbaum In your code above, a is and remains the value 0 at all times. The boxing is done only to do the property access operation.
 
!!> 1/*act as object*/.toString() // Wonder if this works, it should about
 
@BenjaminGruenbaum "1"
 
10:49 PM
!!> console.log(parseInt('fuck'), parseInt('fuck', 16))
 
@rlemon "undefined" Logged: "NaN",15
 
radix FTW
 
@BenjaminGruenbaum So the engine reads the value from a, boxes it, and then discards that object after the property access op.
That objects isn't unboxed.
 
@ŠimeVidas Can't property access change the valueOf of the object? How would the runtime know in advance I'm doing property access and not asking for a getter?
 
@BenjaminGruenbaum A getter is still property access.
 
10:51 PM
!!> console.log( [1,2,3] < [1,2,4], [1,2,3] <= [1,2,4] )
;)
 
@rlemon "undefined" Logged: true,true
 
!!> [1,2,3] == [1,2,3]
o_O
 
I've noticed a funny analogy. Women can talk about random shit endlessly. I can talk about random JavaScript shit endlessly.
 
@rlemon false
 
js you silly goose
 
10:52 PM
!!is it working now or not
 
@Shmiddty not
 
rage
 
Hm, why would two distinct array objects be the same?
 
women.all === js // true
 
This is so cool:
!!> var a = {}; Object.defineProperty(a, 'foo', { get : function f () { console.log('f'); return f; } }); a.foo();
 
10:53 PM
@Zirak "function f() { console.log('f'); return f; }" Logged: "f","f"
 
@ŠimeVidas the point is, I can use lexicographical ordering but not trichotomy comparison
 
Object.defineProperty(Number,"messWith",{get: function(){ this.valueOf = function(){ return 42;};return 10;}})
 
You can use what but not what? Never mind :)
 
yea, proper names are stupid
 
10:55 PM
Ah yes, I didn't see the first code above
 
!!> Number.MIN_VALUE > 0
 
@rlemon true
 
wait what? it is greater than 0? the MIN_VALUE?
 
@ŠimeVidas Hmm, apparently I can't override Number.valueOf
 
I'm going home now.
 
10:56 PM
;)
 
adios ladyfaces
 
!!/inhistory 1986-09-05
 
@rlemon 1986 – Pan Am Flight 73 with 358 people on board is hijacked at Karachi International Airport.
 
fuck... my bithday. just a test
 
@BenjaminGruenbaum JavaScript works in mysterious ways *looks into the sky*
 
10:58 PM
Did you spot a dead bird?
 
@ŠimeVidas Still, it's 98% slower with 0, much slower than with {}, why is that internally?
 
nope :? but I did see a good shot exiting my mothers vagina
 
Uh, wait, I'm indoors and it's 1AM
 
hrm, I thought :9066221 was to me :/
ignore previous comments
 
@BenjaminGruenbaum If I had more free time, I'd probably try to figure that one out.
 
11:00 PM
@ŠimeVidas boxing is probably just really slow
 
I'm off to the web platform room for some alone time adios
 
!!/inhistory 1945-08-06
 
@rlemon 1845 – The Russian Geographical Society is founded in Saint Petersburg, Russia.
 
that is what you report back??
not Hiroshima
 
Wrong century
 
11:01 PM
shit
typo
 
@rlemon undefined
 
hah
 
yyyy-mm-dd ??
 
@ŠimeVidas Yep, that's it, creating an object literal is much faster than boxing a number, chances are the JIT extracts a much smaller class from it jsperf.com/boxing-vs-just-property-access
 
yeah, it had nothing
 
11:02 PM
wow
 
That's all there is to it
 
wikipedifail
!!/inhistory 1960-10-22
 
@rlemon undefined
 
REALLY?
 
@BenjaminGruenbaum Makes sense
 
11:04 PM
@Zirak what gives? en.wikipedia.org/wiki/…
 
!!/inhistory 1948-05-15
 
It doesn't go through every possible page; it goes to October 22, and looks for 1960
 
@BenjaminGruenbaum 1948 – Following the demise of the British Mandate of Palestine, Egypt, Transjordan, Lebanon, Syria, Iraq and Saudi Arabia invade Israel thus starting the 1948 Arab-Israeli War.
 
!!/inhistory 1948-03-1949
 
but that is on the October_1960 page ;)
 
11:05 PM
@BenjaminGruenbaum November 28 – Winston Churchill makes a landmark speech in support of the idea of a European Union at Kingsway Hall, London.
@BenjaminGruenbaum October 7 – The Democratic Republic of Germany DDR is established officially
@BenjaminGruenbaum January 16 – Şemsettin Günaltay forms the new government of Turkey. (18th government, last single party government of CHP)
 
yeah, I was afraid I was too lenient...
 
seriously though Zirak, have I said how awesome it is that you spent the time and effort making this bot?
 
My pleasure
 
well much gratitude
and respect
 
11:06 PM
!!/inhistory 1945-10-06
 
@BenjaminGruenbaum 1945 – Baseball: Billy Sianis and his pet billy goat are ejected from Wrigley Field during Game 4 of the 1945 World Series (see Curse of the Billy Goat).
 
THAT? America dropped a friggin nuke and THAT is the history piece? LOL
 
The plot thickens!
 
!!/inhistory 1945-09-10
 
@BenjaminGruenbaum 1945 – Parade in NYC for Fleet Admiral Nimitz and 13 USN/USMC Medal of Honor recipients
@BenjaminGruenbaum undefined
 
11:08 PM
Your thoughts on the answers?
7
Q: CSS positioning to fill container: width vs. left/right?

BaumrConsidering: For elements that are absolutely positioned inside a relatively positioned container. If you want the element to fill the width of the container. The element is also bottom-aligned. Is it best for maximum browser compatibility to set a width in pixels for the element, or simply...

Thanks :)
 
@BenjaminGruenbaum wrong month
august, not september
 
Oh right
My history needs brushing -_-
 
The 10th month is October
 
!!/inhistory 1945-08-06
 
@BenjaminGruenbaum undefined
 
11:10 PM
@Zirak I read his two messages as one :/
 
@Baumr Wait a little bit longer before accepting
 
I'm working on that drunkeness so I can raise the github issue
 
@Baumr Everyone answered just saying 'yeah, you're ok' , nobody really discussed the pros and cons of each approach
 
@rlemon yeah, that's apparent
 
seriously. can I get some feedback on : stackoverflow.com/questions/16224424/… my answer here?
 
11:12 PM
@BenjaminGruenbaum Yeah you're right, but it's been since April 12th
 
I don't often answer main site, but when I do: I like to make sure i'm not off my rocker.
 
@Baumr If it's interesting to you, you can put a bounty on it, if not, there is nothing wrong with leaving a question open if you don't really like the answers you got.
 
is Array.prototype.some more expensive than looping over useless sheets?
 
11:14 PM
I have to imagine most sites only have <10 sheets (WP :?)
 
:-)
 
@rlemon a little suggestion for your game, when the blue stuff exploded, its direction should be the same as the direction of the bullet who hit it with a small arc, that's raughly how physics laws of momentum work
velocity of bullet*mass of bullet + velocity of ball * mass of ball = velocity of fragments * mass of fragments
 
@BenjaminGruenbaum yea, I need to work on the forces, most of it is just thrown in there :/ but thankyou for the suggestion. you will see (in the code) the mass / amount of fragments is random / hard-coded which is also needing change.
 
Note that velocity is a vector, in your case that just applies to both the x axis and the y axis or if you got it represented polarically it's easier
 
0
Q: Documenting Function That Takes Random Parameters?

DanielWhat's the best approach to creating documentation (displaying the function prototype if you will) for functions that take a variety of different forms in terms of parameters. Let's say there are 10 different choices: param(name); param(name, type); param(name, options); param(name, type, optio...

 
11:17 PM
@BenjaminGruenbaum Thanks, yeah, they're not great are they?
 
instead of the 'ring' around the turret I'm going to put rotating 'balls' - when hit they pop and once you run out you are dead.
the NPCs will still pass through you, so they can loop around
but instead of under I think they will pass over you
 
@Baumr nope
 
@BenjaminGruenbaum I may investigate sometime and answer it myself ;P
 
394
A: <kbd> elements are way intrusive

Hilarious Comedy Pesto                                                                                                                                                                                                                                                                                                            

 
11:26 PM
Updating texlive takes more time than updating linux...
 
2
A: Documenting Function That Takes Random Parameters?

Benjamin GruenbaumThe reason projects use the overloading syntax is because it is easy and clear to read. There might be criticism about the jQuery library but it is one of the best documented libraries I know of in JavaScript, it's very easy to read. Functions in that syntax have two purposes, either arguments a...

If you wouldn't mind looking at my edit and telling me if the original phrasing about jQuery was too harsh in your opinions that would be swell
 
(restarting, be back in ~2 minutes)
 
(in my universe, 8 minutes = 2 minutes)
 
!!/listcommands
@rlemon Nice!
 
11:36 PM
@Zirak help, listen, eval, live, die, refresh, forget, ban, unban, info, jquery, choose, user, listcommands, purgecommands, norris, urban, parse, tell, mdn, awsm, beautify, convert, define, get, google, hang, inhistory, karma, learn, 420, 5318008, bewbs, i_am_a_robot, aliens, ym, format, happynewyear, tell2, 3point14, camel, ihatelanadelrey, fa, vk1, vk2, rlhd, popcap, knock, say, heybuddy (page 0/2)
 
!!/slidepoop
 
Yay bot works
!!/gayclubs
 
!!/camel
 
11:38 PM
 
!!/tobacconist
 
@BenjaminGruenbaum Drop your panties, Sir William; I cannot wait until lunchtime!
 
!!/moose
 
@rlemon If @Mooseman was here....
 
@Zirak bug report:
!!/listcommands 1
 
11:39 PM
Server error (status 500) occured (message probably too long)
 
!!/listcommands 1
 
I tried in the sandbox
it's repeatable
 
@Zirak hard line breaks split the max-limit
 
!!/listcommands 2
 
11:40 PM
@BenjaminGruenbaum tester, cmdname, dance, stab, fools, hal9000, oregon, botnet, fuckable, hrmmm, hrmmmm, cake, rtd, truth, cool, right, moose, code, dude, nudebeachconstant, vengeance, iso8601, onthisday, thebestfox, echo, mustache, nudge, spec, stat, timer, todo, undo, weather (page 2/2)
 
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam eros elit, iaculis eu ultrices vel, pellentesque sit amet velit. Cras vitae mauris lorem, ut tristique felis. Sed auctor felis eu turpis laoreet id blandit tortor euismod. Fusce aliquet, tellus in commodo pharetra, ante justo dignissim dolor, id gravida sapien lectus quis leo. Sed sit amet interdum tortor. In hac habitasse platea dictumst. Pellentesque vestibulum risus erat, quis sagittis felis. Aliquam quis enim at nisl malesuada scelerisque quis non felis. Nam ornare felis eu massa imperdiet accumsan. Curabitur sed nulla sapi
see!
post as much as you want as long as you hard break > 500
 
hmm I wonder what this does:
!!/nudebeachconstant
 
@BenjaminGruenbaum 0.4887634182931323
 
!!> Math.tan(0.4887634182931323)
 
11:42 PM
@rlemon 0.5318008
 
boobie
 
user1125394
someone has a good link for left padding intgers with arbitrary number of 0 (either2,5 or 10)
 
user1125394
google.com I know
 
user1125394
stackoverflow.com/a/1267338/1125394 this guy has really nothing to do, probably smart though
 
11:47 PM
@c'c ?
 
The only good reason to use ctrl-C ctrl-V while programing is that your keyboard misses some greek letters
 
no way.
moving LoC is also very valid
wait, no that is CTRL-X
tbh, I cp names in forms all the time
<label for="someIDValueHere">label</label>
<input id="<pasted>" ... />
i realize it probably takes as much time to select, copy, and paste it, but I still do it
 
@Andrew Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 

« first day (922 days earlier)      last day (4025 days later) »