« first day (1300 days earlier)      last day (3654 days later) » 

6:02 PM
Sorry @Retsam I don't know. Though I'm interested in the answer myself.
 
@Retsam Since -compare(b,a) === compare(a,b), if they're not equal, then the order is undefined.
 
Flexbox challenge: Get everything on one line, with the text in referralInfo being reduced if there isn't enough room: jsbin.com/fujiconi/1/edit
 
Nice attitude. -1 — RUJordan 7 secs ago
Wow that guy just got way too pissed for no reason
 
Too many people answer questions to boost their ego/self-esteem
 
aww he deleted it. a 20k rep Xander called me "pedantic" with a lot of snark because I told him that a static index was probably a poor choice and that his lack of explanation was liable to get downvoted
 
6:09 PM
Like that retard @BenjaminGruenbaum
 
@code4coffee 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 is it a bad idea to ping somebody to call them out?
 
 
I really want to ask why he verbally bitch-slapped me for no reason
 
Enjoy for eternity
@RUJordan In this case? No. Don't care
 
6:11 PM
Yaaayyyy I might do it. I don't know if I care enough
That and I need to figure out why our development server isn't responding
 
!!should I play games or fix the linux partition
 
@Zirak fix the linux partition
 
kay :(
 
@rlemon @Loktar I am stuck (see pinned message).
 
I literally want to rip this guys head off. It's like he's never heard of google ever
 
6:14 PM
Stupid nvidia making a stupid GPU which makes nouveau crash...
@RUJordan Yes, you literally want to rip his head off.
 
Literally.
 
@Loktar Red Dead Redemption of Bioshock Infinite: Which should I play first?
 
Bioshock bioshock bioshock!
 
I can't fairly answer that, I've only played RDR
 
Is it as good as they sad?
 
6:16 PM
if you like open world games red dead redemption is awesome
its like GTA in the wild west
 
Wait...there's no PC version
Fuck them
 
Yay I got a nice answer badge!
 
@Akkumulator 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.
 
Second time this happened today...wanted to play Ryse: Sons of Rome too, but it's Xbox 360.
Damn consoles.
 
Damn, I wanted to play that too. I have a PS3
 
6:20 PM
Give me it
 
Does anybody know how to add a directive to the window in AngularJS? I want to call a function when it loses focus (ng-blur i presume).
 
@SomeKittensUx2666 I posted in the HTML room
the user @Wes loves flex
 
@qwerty uhm, window.onblur ? The built-in events aren't good enough for you?
 
@Zirak $200
 
Fine, but use a condom
 
6:22 PM
How do i add it though? You normally add directives on elements through a data attribute. Am i missing something?
 
@qwerty It's not an element. Use it like a regular event, not everything has to be angular.
 
Let me give it a shot, i think i get it.
 
@Zirak no deal. Raw or naw!
 
stackoverflow.com/users/reloaded/617762 prefix your uid with reloaded to see the planned new user page
 
ew
I don't like that
 
6:26 PM
@Zirak I'm a tard. lolz.
uncle zirak, can I have som pie?
 
@Zirak "Projects"? Hmm.
 
@Zirak pretty
 
@BenjaminGruenbaum You know, I wrote "here honey, have some cream pie". As my finger floated over the enter key, I had second thoughts.
 
Hmm, maybe more specific question for my sorting question, will this sort always work as intended:
function evensBeforeOdds(a, b) {
   if(a == b) return 0;
   if(a % 2 == 1) return 1;
   if(b % 2 == 1) return -1;
}
 
define "as intended"
 
6:30 PM
evensBeforeOdds(2, 4) ?
 
After sorting, all the evens will come before all the ods.
Sorry, that's a comparator, so usage is: arrayToSort.sort(evensBeforeOdds)
 
this will return undefined if both numbers are different and even.
 
Whooops, yeah there should be a "return 0" at the end.
function evensBeforeOdds(a, b) {
   if(a == b) return 0;
   if(a % 2 == 1) return 1;
   if(b % 2 == 1) return -1;
   return 0;
}
 
@Retsam then every even will be equal to every other
 
@JanDvorak That's fine, sorry, I don't care about the relative order of evens, just that all the evens come before all the odds.
 
6:34 PM
also, every odd will be above every other number, including other odds
 
@JanDvorak no you're odd
 
this breaks the requirement that compare(a,b) === -compare(b,a)
 
Every odd will be above every other odd!?
 
You could actually implement the sorting yourself in O(n)
 
@JanDvorak Yes, that's my point.
It breaks that requirement, yet it seems to work. (This is actually why I asked about the requirement)
 
6:36 PM
So sorting [3,5] requires changing it to [5,3]. But then 5 appears before the 3, it's not after every other odd! So change to [3,5], but now 3 isn't after every other odd!
HELP
 
Obviously I could write a sorting algorithm that does this without violating the compare(a,b) === -compare(b,a)
 
Just don't use sort. You can easily do it yourself with unshift and push
reduce to the rescue, once again
 
The honest reason I'm asking is 1) because it's interesting, at least to me, and 2) because I see a sort like this in our codebase (not sorting evens and odds, but similar) and I'm not sure if it's worth bothering my coworker about.
 
ary.filter(x=>x%2).concat(ary.filter(x=>!(x%2)))
 
Besides, I technically haven't seen anything state that compare(a,b) === -compare(b,a) is a requirement.
 
6:40 PM
@JanDvorak Operator precedence
 
@copy fixed, thanks
 
How do you adjust the scrollbar position on a page, so that if you remove stuff from the page that would normally force the page to "scroll up", it instead pushes down? I can't word this properly. The current location of the page becomes the TOP of the page. If you're scrolled 1000px down, and click a button, the new top of the page is at the 1000px mark and the screen doesn't "roll back up"
 
@JanDvorak o/
 
o/
@JacobRaccuia manually scroll by the amount of stuff that was removed?
 
@JanDvorak is it possible to do that without the "scroll effect" ?
they do it here: www.usatoday.com
 
6:48 PM
@JacobRaccuia you should be able to scroll fast enough
 
hmm I'll have to try that. I was hoping I wouldn't have to calculate distance from top or any of that :p
 
0
Q: what is src for script tags when they are in php include files

user2274191If I have a php include file which includes a <script src = > tag, where is the src relative to? Is it relative to the original file or the include file? If anyone could point me to a really good reference as I am moving a site around and all the paths are out and there are php include paths, cs...

 
user1596138
@Zirak :D
 
I'm considering complicating the question with url rewrites...
 
6:58 PM
!!are you alive?
 
@rlemon Certainly not
 
FF crashed :/
no clue how long it was down
opened the window to a crash report
so i've followed this to the best of my ability: stackoverflow.com/a/5015178/829835 and i'm getting nothing but a 500 error
now i'm getting a 400 :P
 
Six hours until quitting time!
 
API calls fail 30-50% of the time.
Connect to VPN, API calls fail nearly 0% of the time.
What. The. Fuck.
 
@JanDvorak I cannot believe the solution was this simple! window.scrollTo(0,0);
thanks!
 
7:19 PM
so I suppose 400 error is better than 500 error
i'm now only 200 away!
 
@Tirithen 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.
 
Chrome is stupid
in HTML / CSS / WebDesign, 21 secs ago, by rlemon
<!DOCTYPE html>
<html>
<head>
	<title></title>
</head>
<body>
<div id="status">Hello World</div>
<script>
var status = document.getElementById('status');
console.log(status.innerHTML); // undefined
</script>
</body>
</html>
works in FF
change variable name from 'status' and it works.
 
@rlemon in chrome that's modifying the window.status property, so it can't be done
6
Q: Reserved Word Behavior

RUJordanWhile creating a small counter based game, I had an array like this: var status = ["day","dusk","night","dawn"]; If I tried to access the first index of the array, I would get: console.log(status[0]); //yields "d" @monners mentioned it might be a reserved word, so I changed the variable nam...

I had the same problem
It'll flatten arrays into strings, etc etc
 
People here have too much free time... ;)
 
7:27 PM
@ThiefMaster I love it xD So artistic
 
@ThiefMaster I expected the building to look.. idk... more high tech.
@SomeKittensUx2666 ran in browser and phone
 
@RUJordan that's destructuring, probably a bug
 
protip: don't run with console open
 
> You've earned the "Enlightened" badge for How to grab element you are hovering over?.
nice
@BenjaminGruenbaum destructuring?
I like destruction
 
!!> var [x,y] = [3,5]; [x,y] = [y,x]; x+" "+y;
 
7:30 PM
@BenjaminGruenbaum "5 3"
 
Wait what the hell
 
Huh. Including console.log gives the if statement an edge, but changing it to a noop allows the concat to advance
 
var [x,y] what is this magic?!
 
!!tell RUJordan google tuple
 
7:31 PM
ES6 destructuring.
 
@rlemon fwiw I think that's an awesome name.
My name is boring.
 
lol
Ben Jamin' man
 
you be jamin'
 
7:33 PM
Is that high-tech-y enough?
 
how is your name bad?!
@ThiefMaster CUT YER HAIR YA HIPPIE!
 
That's so cool.
 
It's long so I always get called Benji or Benny
 
@BenjaminGruenbaum @rlemon thanks! I got some reading to do
 
@ThiefMaster does that pipe say "Canada" ???
 
7:33 PM
@BenjaminGruenbaum at least your name isn't unisex
 
Also, it's just not that interesting. He who runs with wood sounds cool.
 
DO YOU KNOW HOW WEIRD IT IS TO HAVE SEX WITH A WOMAN WITH THE SAME NAME AS YOU?
 
@ThiefMaster NEEERRRRRD
 
DO YOU?
 
@RUJordan lol, yeah, there's that.
 
7:34 PM
Who's running with wood?
 
@BenjaminGruenbaum fwiw my parents were going to call me Benjamin but changed to Robert last second
 
@RUJordan she told me we was 21.
 
my BC said Benjamin for like a week
 
lololol
 
@RUJordan If only... damn... she was hot
 
7:35 PM
She was hot. But she was a little... fuh-reaky
 
@RUJordan how is that bad. at least you won't fuck up her name in bed
 
@RUJordan ikr
 
> "OHH ME! OHH ME!!!! YES ME!!!!"
 
me xD
stop
 
HAMMERTIME!
 
7:35 PM
im going to cry at work
NOT NOW CAPRICA
 
lol
 
well, at least after you are done you can turn over and say "I guess I really do put the D in Jordan."
 
ROFL
 
@rlemon Not sure, that underground visit was a few weeks ago
 
Pun of the month right there
 
7:37 PM
@ThiefMaster looks like it isn't
or after the 'a' would be a 'd'
I was hopeful.
 
!!s/hopeful/hopeful for that D/
 
@RUJordan I was hopeful for that D. (source)
 
I know :(
 
s/hopeful for/<just put anything here>/
 
@RUJordan it is still early. I will try to out do myself.
 
7:39 PM
@KendallFrey is there a regex so that I could just append text after a word? Like mine above I did s/hopeful/hopeful for that D/ but I just wanted to append text?
@rlemon I would say the same but I guess I've already outdone myself.
 
!!s/(.*)/$1 sucks/
 
@rlemon sucks (source)
 
I would have used /\./ or something
 
@rlemon @rlemon I would say the same but I guess I've already outdone myself. sucks (source)
 
bam!
 
7:40 PM
or /l/
 
s/(.*)/$1 sucks/
 
@RUJordan have you fixed all of your life's problems yet?
 
I don't think JS supports lookbehind
 
nope
 
@SimonSarris nope, I got really drunk and found a date for tonight. Hopefully she's smart!
:D
 
7:41 PM
@RUJordan DUDE STOP PICKING UP CHICKS AT THE BARS!
10/10 that is your biggest issue
 
I said I was drunk I didn't say I got drunk at the bar <.<
 
bar flies are all retards.
except @RyanKinal ofc.
 
lol
Thanks
 
:P I actually met this one on the train
 
I realized you often stop at your local bar when I said it
 
7:42 PM
I don't like all this smart talk
 
had to retract
 
besides you weren't smart when you got the date
 
haha
 
^
 
7:42 PM
you stupided your own self
 
does the term "drunk goggles" mean nothing?
!!urban drunk goggles
 
I mean I'm sure I wasn't that bad
 
@rlemon drunk goggles The eyesight you have when one is drunk. Which leads your inhibitions to be lower and one you wouldn't normally be attracted to looks real good.
@GabrielOshiro 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.
 
Nobody likes a stupid drunk. I must have been pretty suave
 
@RUJordan can you describe smart for me
 
7:43 PM
never heard it said drunk goggles before
 
@KendallFrey ohh yea?
 
@SimonSarris it depends on the type of definition you want
 
how have you heard it
 
!!urban beer goggles
 
@KendallFrey beer goggles phenomenon in which one's consumption of alcohol makes physically unattractive persons appear beautiful; summed up by the phrase, "there are no ugly women at closing time"
 
7:43 PM
what if I describe smart as "people who don't get bored"?
 
@KendallFrey same shit if you ask me
 
I didn't ask you
 
idk. some of the smartest people I know get bored really easily
which is why they constantly are trying to do new things and excel at them
 
@SimonSarris interesting way to put it. But that puts the implication that intelligence leads to fun
 
oh you're one of "those"
the funseekers
the walking dead!
 
7:45 PM
when I get bored I code. but I get bored a lot. so I code a lot.
 
It's a flaw of mine. I'm constantly fidgeting, moving around, out of the house.
 
@SimonSarris My problem is I have lots of exciting things but I'm at work
 
the walking living really
 
I can't help it, unless I'm coding or watching a good movie I need to move around or I feel like I want to rip my hair out
 
I'm still trying to decide whether I had a drunk-goggles experience last weekend. I met a girl while kinda tipsy, and she was totally cute, and a bit hippie-looking. And she told me she was in the band that was playing later.
 
7:45 PM
@RyanKinal wait aren't you married?!
 
@RyanKinal do you know the band name?
90% chance they have a FB page and she is on it
 
So, I went to see the band (because duh). And I didn't even recognize her after she got all "prettied up" in her club clothes, heels, and striaghtened hair.
 
I have a feeling she looked better as a hippie
 
Worst of all, though, she couldn't sing
It made me sad
@RUJordan Nope. Not married.
 
that is not a flattering top
 
7:48 PM
Seriously
 
@RUJordan You're thinking of me
 
@rlemon I think it would take a lot...
 
That's right
My bad
 
man you guys are judgemental
 
No worries. It's easy to confuse us because of our similar levels of super-fucking-awesome.
 
7:49 PM
@KendallFrey shhhhhh Ryan thinks she is cute
 
@RyanKinal can you sing?
 
@SomeKittensUx2666 We're always thinking of you.
 
@SimonSarris She's cute, but she was far cuter before she tried to be cute.
 
@SimonSarris we're judging her. how else should we be?
 
7:49 PM
That's ok, I know cute girls with no boobs
 
@Zirak wink
 
ass > boobs
women are always walking away from me, so I picked the more visible attribute to enjoy.
2
 
Anyway, like I said, I don't know if it was the beer or the look. So, who knows.
 
oh god why did I start this discussion
 
@SimonSarris because secretly you want me to tell you that i'm attracted to smart men named Simon?
 
7:51 PM
@SimonSarris When's your next book coming out?
 
@rlemon well you did ask me to visit that one time, so I just assumed we were dating
@SomeKittensUx2666 it will be a novel
 
when you Assume, you just make an ass out of u and me
 
and three years
 
@SimonSarris *The Adventures of Space Captain <canvas> and his trusty sidekick requestAnimationFrame"
2
 
@rlemon that's ok, more asses === better
 
7:53 PM
@SomeKittensUx2666 LOL
 
Make it happen.
It'll be _why's poignant guide for <canvas>
 
@SomeKittensUx2666 for that we have learncanvas.com
(no content up yet, editing a laaarge guide)
 
@Adam 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.
 
@SimonSarris ++
 
I'll need guest contributors soon
 

« first day (1300 days earlier)      last day (3654 days later) »