« first day (1495 days earlier)      last day (3459 days later) » 

3:03 PM
seems like .classList does not exist on IE, right?
 
!!caniuse classlist
 
>= IE10 it works
 
ye, any "real" cross-browser solution? "className" maybe?
 
!!google classList polyfill
 
^
 
className works, but it's a terrible API
 
className is supported everywhere, but classList is easier to work with
 
Writing a trivial polyfill seems pretty easy though
 
yea, it's pretty simple to spin up yourself.
I've done it, but with that said the polyfill from remy looks good
 
3:09 PM
@rlemon I don't see anything to protect you against changes to className though
 
who need protection
 
user2620028
Me :/
 
user2620028
And your mother about 30 years ago
 
I can't believe it took me two minutes to debug my 4 months old code for which I had banged my head for almost a week! I must have been terrible that time!
 
And now you're a master programmer?
 
3:15 PM
I am now a not-noob programmer.
 
@AwalGarg Loss of context, less assumptions about how it should work.
 
user2620028
In other words, you are not any better presumeably. You just forgot more about it lol
 
I... didn't understand?
 
user2620028
I am thinking about upgrading my phone to the Nokia Lumia 1520 ... What do you guys think ( I know some of you guys are mobile gadget people )
 
Yay for Lumias.
 
3:21 PM
htc <3
if you want to be a super-hipster, check out the oneplus one
 
plus one for oneplus one
 
user2620028
I cant stand the ios or android OS
 
@rlemon copy/paste the code in my page script does not seem to have any effect on the classList problem...
 
then you're including it wrong, or using it wrong.
got code to go along with the problem?\
 
@HatterisMad Why's that? I haven't used it much, but windows mobile doesn't seem incredibly different.
 
3:26 PM
Hi guys, is there a function that will round an integer to be inside a range?
 
@Billy Google.
 
Have tried..
 
really?
 
@Billy Math.min(high, Math.max(low, x))
 
!!tell Billy google javascript round to nearest n
 
@SecondRikudo None of that is what I asked
@ssube Thanks that's perfect
 
@Billy So please elaborate.
 
var initial = 421.18834;
var range = 0.04;

var factor = Math.round(initial / range); // 10530 - will round to correct value

var result = factor * range; // 421.20
 
Sorry Maybe I didn't explain it very well but you will know what I meant when you see @ssube's message
 
@Billy By "round" do you mean limit to within the range?
Or actually round to arbitrary precision?
 
3:28 PM
yea, round is a horribly misleading term here :P
 
Yeah my bad that's probably why my googling wasn't helping
 
You probably want to wrap the min/max in a function, like function MathUtils() { }; MathUtils.range = function MathUtils_range(a, b, x) { return Math.min(b, Math.max(a, x)); }
 
just add it to Math :P who cares
 
The function name might not be necessary, depending on what browser you debug in (chrome will figure it out as of a few months ago, others may say "anonymous function")
 
3:31 PM
^
 
if( !( 'range' in Math ) ) {Math.range = function MathRange(a,b,x) {...} }
 
@rlemon Math is pretty safe, but I feel weird adding things to system objects.
@Billy Note the reversed params, too. Your lower limit goes to max, upper to min.
 
user2620028
@ssube I used to have an android when they were young, and the os glitched out and died on me so often that i will never forgive it until i forget that i ever owned a couple of them lol.

Iphone i have a disdain against from having to fix their broken screens daily for a few years.

Windows phone then is the well performing although sometimes feature lacked alternative.
 
Yeah thanks I understand the logic. Not sure why I didn't think of that myself :P
 
@ssube I wouldn't call them a and b though
 
3:33 PM
^ min and max probably?
 
low,high
 
top, bottom
up, down
floor, ceil
 
To avoid confusion with Math.min and Math.max
@ssube No
 
well in a range you have a low and a high limit.
so semantically it also makes sense
(i hope) @BenjaminGruenbaum ^^ school us with your maths.
 
3:34 PM
What?
What's the question?
 
2 mins ago, by rlemon
if( !( 'range' in Math ) ) {Math.range = function MathRange(a,b,x) {...} }
what would you label arguments a and b
 
it is upper and lower limit
 
@rlemon You shouldn't ask a mathematician to name things.
 
lol
 
ask PHP developers
 
3:36 PM
start, stop, step
 
@rlemon what does Math.range do?
 
@AwalGarg no because then I'll get the same thing with 9 names
 
;p
 
return Math.min(b, Math.max(a, x));
 
He'll respond with α and ω
 
3:36 PM
Why'd I want a special function for that?
 
that isn't the question :P
 
That just looks confusing.
 
@BenjaminGruenbaum Because.
 
lol
 
I wouldn't call that range though
Maybe clamp
 
3:37 PM
I'd call it interval maybe
Although, I don't think this function is justified.
soz.
 
.range(1,5) I'd expect [1,2,3,4,5]
 
@BenjaminGruenbaum It's a super common op in graphics.
 
but that is just me?
 
Yeah, which is not what this function does.
 
I didn't name the fn :P I'm just poking my nose in someone elses code/question
 
3:38 PM
@ssube in graphics it's usually not both at once.
 
@BenjaminGruenbaum Only because they don't have a combined instruction.
High-pass and low-pass are useful, but sometimes you need a mid-pass with variable ranges.
 
 Math.constrain(min, max, value)
Still don't like it.
 
@BenjaminGruenbaum Math.min(max, Math.max(min, x)) XD
 
Normally you'd normalize and not deal with this rather than trim, when you trim it's usually from one side. Then again I didn't code a lot of graphics.
 
Would limit be better? Trim?
 
3:40 PM
I used this in my own code (without the util fn)
let me dig out the demo
 
@BenjaminGruenbaum You do some interesting stuff in shaders, where your function runs 10 million times/second and you can't branch. :p
 
I didn't say branch
 
Math.limit() ?
Who cares anyways :p
 
Math.minmax and not offend anyone?
 
Math.myNewFunction
 
3:43 PM
 
I'll call it Math.Fucks() and it will always return 0
 
can't find the fiddle now. too many fiddles.
Math.min(Math.max(n,359),0)
to clamp degrees
 
function rand() {
    return Math.random() !== 0.0 : Math.random() : "Spanish inquisition";
}
 
Shouldn't the first colon be a question mark? Or am I unfamiliar with this syntax?
 
3:48 PM
yes, ternary is condition ? truthy : falsey
 
Yep, typo
 
@rlemon his "readme" is not clear... how to use his "polyfill" classList pls?
 
ah cool just checking it wasn't something I didn't know about :p
 
No, no.. I'm just an idiot
 
@ssube there is an algorithm named that
@rlemon why'd you clamp degrees?
 
3:50 PM
@Julo0sS include the required file and run it
@BenjaminGruenbaum can't remember exactly why now, but I did need it clamped. it was used in another calculation that required 0-360
 
@rlemon that seems to be the problem^^ tried include to php, tried include from <script tried copy/paste... no way^^
 
Sounds like you should use modulo
But I guess you know better
 
@Julo0sS included to php?
 
i tried all i could (even php) ^^ :D
 
@copy I probably could have
didn't think about it
@Julo0sS show me code or sorry I cannot help
including a polyfill is pretty straight forward generally.
 
3:52 PM
A bit long, but true.
 
@rlemon <script src="./classList.js"></script>
for example
^^
 
user2620028
Fire alarms are being tested in my building right now.... Every 2 minutes
 
@HatterisMad Does it drive you mad?
 
user2620028
I think if they do it one more time i am going to be forced to make them not a liar and burn the place down
 
@BenjaminGruenbaum A different algo, or is that a reasonable name?
 
user2620028
3:53 PM
@SecondRikudo I see what you did there
 
@ssube minimax
 
oi
 
351
Q: What is "chat with an expert"?

AntonyA box just comes out of nowhere which says "chat with an expert". It happened once on Stack Overflow and once on Meta. Is this an ad? Isn't Meta supposed to have no ads? Here's the HTML for that weird box: <div id="adviza-box" style="width: 380px; "> <div id="adviza-status"> <...

wut wut wut?
 
doesn't raise any red flags?
 
Why did I miss this :( :/
 
4:00 PM
asked Mar 31 '13 at 17:48
Microsoft puts Docker on Windows clients
 
@BenjaminGruenbaum lol
> Yeah just stick it in a jquery object usually fixes everything!
 
@SecondRikudo nice
 
@Loktar That's what she said-ish
 
4:03 PM
I should just steal @BenjaminGruenbaum's answer and get sweet rep
 
bleh they want to use angular here in our next app
I really don't want to
trying to push them to ember at least
 
@AwalGarg 's is better.
@Loktar have you ever used Angular before?
 
yea
I dont like how I'm not writing JS, I'm writing angular :P
 
aha yay \o/
 
Plus I also worry with the whole 2.0 transition blah blah
 
4:04 PM
Oh, my point was - if you haven't it'd look good on your resume @Loktar :P If you have I totally get it though.
Framework transition should be cheap if you code correctly in a framework agnostic way.
 
btw @BenjaminGruenbaum that dom tree thing is as much cross browser as xhr2
 
yeah it just sounds like 2.0 will be so different
and Rob Eisenberg leaving is weird too to me
 
@AwalGarg write an answer.
 
idk the pro is there is alot of third party documentation for the devs here
 
@Loktar Great, I was just getting used to angular
 
4:06 PM
@Loktar I had a long discussion about that: IMO I think he's awesome for going with his truth and his own vision.
 
no
 
@BenjaminGruenbaum yeah definitely
 
If you structure your code in a good way - Angular won't get in your way.
Write normal JS, then wrap it in Angular, don't write Angular. if you're responsible enough to do that you'll win.
 
heh I wont :P I'll fall into the trap of the angular way because itll be the easiest
 
And no one said isn't using it — albanx 2 mins ago
-_-
 
4:09 PM
nice thank you
hah and you wrote the answer even better :P
 
:P Who would have known
 
bleh I dont say this often.. but I wish I had your knowledge
you explain things very clearly
 
!!nudge 20 charge at Benji
 
@SecondRikudo Nudge #1 registered.
 
which shows you have an awesome understanding
 
4:10 PM
@Loktar Same.
I think we just understand different domains better.
 
@Loktar Isn't that why we're all here?
Aside from the fantastic religious and political debates we have here regularly
 
haha yea
 
For example, I'm clueless in graphics and canvas stuff.
 
I'm hanging in SO chats mostly to pick up new concepts and knowledge.
 
yeah these convos are what makes it awesome here
@BenjaminGruenbaum thanks for the compliment :P
 
4:12 PM
same :P
 
@BenjaminGruenbaum can confirm.
@Loktar is way better than you at raising kids.
:P
 
haha
eh I wouldn't say better just more experienced
 
probably better :P
 
I am the best at pooping on slides. no one can take that from me. lemon 4 the win!
 
4:15 PM
@rlemon look, you pooped once on a slide...
 
I bet you're the best here at walking with wood.
 
Roflmao
 
@BenjaminGruenbaum running*
 
@rlemon Does this happen every day or is today a slide pooping kinda day?
 
I keep getting that wrong
 
4:15 PM
@Sippy there are still three parks in my city I haven't been banned from. so depends on if I wanna go for a drive or not
 
Im the best at writing ugly code.
 
@FlorianMargaine true story: when I was 10 I was at the park with some friends and was telling jokes and made my friend laugh so hard he actually peed himself. 10 years old, peed himself from laughing. I was stunned.
 
I think @Mosho can assure you I write some of the ugliest code when I have a task I don't think will require significant maintenance.
@rlemon poor kid, not the sort of thing of things the other kids forget
 
user1596138
@Loktar funny we had that conversation about police the other day... I guess they killed an inmate at the local jail :?
 
@BenjaminGruenbaum yea he didn't seem to upset by it at the time. maybe he was just playing it off.
 
4:18 PM
posted on November 19, 2014

var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); try { var pageTracker = _gat._getTracker("UA-3727700-1"); pageTracker._trackPageview(); } catch(err) {} If you want a Science book in a hurry, they're on amazon!

3
 
Not as bad as pooping on a slide, but yeah.
 
Ola
@BenjaminGruenbaum o/
 
Can u shower some wisdom over analytics ? (I started reading the web--- i only found apis and tools i can use -not how to build one- )
 
@KendallFrey right in the kisser
 
4:21 PM
@Feeds lol
Awesome
 
since @ tipranks you guys do a LOT of it (or it seems) would u like to guide me towards some right place ?
/i dont mind buying books/
 
that's some good breakfast cereal
 
@rlemon oh that felt good
Moon landing skepticism just isn't cool anymore
 
don't say it too loud, there are conspiracy theorists in the chats who love to debate it
3
 
@rlemon The moon is where a giant god was sealed thousands of years ago. Of course no man set foot on it.
 
4:25 PM
@SecondRikudo iirc vegeta blew it off. -- fuck that god--
 
@SecondRikudo no, that is just the dark side. and we've known about it for a long time. something something pillars something something hot chick he doesn't deserve
 
Space exploration is pretty depressing sometimes
 
I wish we find someone like an interspace civilization
who rules over us
 
45 years ago we had guys walking on the moon, really fucking far away
 
and are like millions of years ahead of us
 
4:26 PM
@darkyen00 That was Piccolo, and no, he didn't destroy the moon. It was an illusion placed by me.
 
what is depressing is to know that in my lifetime we couldn't (currently) travel to another star system.
 
Now we don't even have anyone more than 500 miles away
 
@SecondRikudo IIRC bebi vegeta did aswell.
 
I will (likely) never meet life not from earth in my lifetime
 
@rlemon Actually, to seal the Ten Tails, they made it the core of the moon, taking approximately a seventh of the earth's mass with it and hurled it to the heavens
 
4:27 PM
@SecondRikudo I was referencing Transformers movie
 
This is why real life needs time warp
 
@KendallFrey or we need to discover subspace and figure out how to travel in it
 
6
Q: How could Piccolo blow up the moon, while Goku barely managed to leave a small crater?

Madara UchihaIn Dragonball Z, when Gohan changed into an Ozoro, Piccolo found an appropriate solution, destroy the moon. Easy-peasy. The real question is, when Goku used his Genki Dama (on two occations, by the way), it never resulted in anything more than a relatively small crater. With all the power stored...

@SecondRikudo OHAHAHA
 
@rlemon Not even Star Trek could travel in subspace
 
@darkyen00 One of the theories in the answers is that it's was a fake moon.
 
4:28 PM
I enjoyed interstellar, but as realistic as they tried to make it, it is still very much science fiction
 
@SecondRikudo I enjoyed the fact that you asked it.
 
@darkyen00 :P
Piccolo had, what, power level of 300?
 
user1596138
@Shmiddty just no money hahaha
 
The sad truth is likely that in order to be able to visit any worlds, we ourselves wouldn't be able to, but embryos hatched and grown on the spaceship would
 
I started watching Gravity, but stopped because I couldn't handle the wildly inaccurate debris mechanics
 
user1596138
4:29 PM
@Neil ........................no
 
Goku's Genkidama had the power level of over 6 billion (assuming every human gave only 1 power unit), and it barely scratched the planet XD
 
user1596138
Over 9000
 
@Jhawins Didn't say it was likely even that
 
@KendallFrey everyone but the Tau'ri could. so if we merge star gate universe with star trek universe we meet somewhere in the middle ??? subspace + holodeck?
 
user1596138
@KendallFrey omfg I can't stand that. Like GI Joe's sinking ice
 
4:30 PM
@SecondRikudo nudge charge at Benji
 
@SecondRikudo iirc piccolo was stronger then that
maybe 6000ish
 
@BenjaminGruenbaum in today websites jquery is (should) almost a standard for dom exploring. we should not re-invent the wheel. — albanx 5 mins ago
HOW THE F did that get an upvote?
 
but we are talking about fight before nappa.
so meh
 
@darkyen00 That was slightly after Raditz
 
user1596138
They are freaking out trying to get away fast enough before the ice from the surface crushed them at the sea floor? lmfao
 
4:31 PM
Raditz "lost to opponents whose power level is less than 1000"
I doubt he multiplied his power level by six at that short period
Anyway, thanks @CapricaSix
 
I actually started a KSP save dedicated to orbital debris collisions
 
@BenjaminGruenbaum I'm coming for you!
 
I spent a couple hours on it, but never got anywhere close to dangerous debris clouds
 
No no no. It is trivial to do AJAX without jQuery: var xhr = new XMLHttpRequest; xhr.open("GET", yourURL); xhr.onload = yourCallback; xhr.send(); - how hard is that? Seriously? Lots of people don't use jQuery today like people who write code for modern browsers or people who use frameworks like Ember, React or Angular. It is certainly not something everyone "should" include, there is nothing "standard" about it. It's just a DOM manipulation library. — Benjamin Gruenbaum 35 secs ago
 
4:33 PM
@SecondRikudo they trained for arrival of vegeta
and goku was OVER 9000 !
and then when they fought the ginyu force
he was the only one other then vegeta who could take blows.
 
Hi all, when I navigate inside an embedded iframe with external domain, the entries are not getting added to history object in IE 8 and 9. But this works in IE 10 and 11. any idea?
 
!!caniuse history api
 
oops
@Yoda that is because History API isn't supported in IE8 and 9
 
!!tell Yoda google History.js
 
caniuse.com ... a site that has convinced me that Opera Mini does not support anything.
 
@Schoening Opera Mini
basically takes photos of your pages
running on opera servers
what do you expect it to do ?
 
@rlemon I just want to have a back button inside iframe that behaves like history.back(). is this possible?
 
run porn at 1080 p at 120fps for 3d watching ?
 
@darkyen00 Really? Wow. Well I did not know that. I thought it was just another browser.
 
4:37 PM
!!google how opera mini works
 
!!educate jquery people or leave them dumb?
 
@AwalGarg educate jquery people
 
Hah.. how quaint.
Do any of you use Sublime Text? If so. Can you recommend a good plugin that can performance check functions for V8 ?
 
How did that get two upvotes?
 
4:42 PM
@BenjaminGruenbaum ember has jquery as a dependency btw :P
 
@BenjaminGruenbaum dude won't back down
 
@PatsyIssa not the point
 
Hi! Is it possible to set the property contenteditable : <div class="blah" contenteditable="true"> directly inside the CSS class blah? (instead of inline HTML) ?
 
Also - not for long :D
Also, it ships with its own ajax
 
@BenjaminGruenbaum so you aren't "
 
4:43 PM
I know i know :P
 
@Basj no
you can set it with JS or HTML attribute
 
@rlemon .blah { contenteditable: true } doesn't work in CSS. so this is normal ?
 
contenteditable isn't a css style rule
it's a Element Attribute
you cannot set that in CSS
 
@rlemon ok. so if I have 1000 elements in DOM that should have this attribute, I have to repeat it 1000 times inline in HTML ?
 
javascript
 
4:46 PM
@Basj yes, or apply it with JS
 
or... you know... put the attribute in your html template, server-side...
 
@rlemon you mean setAttribute('...', '...')
 
you can use a JS property there
!!afk lunch
 
Ok.
 
@BenjaminGruenbaum didn't know you had powers to delete answers
neat.
 
4:48 PM
@FlorianMargaine how would that work? Looking for a similar thing for quite a while... can I read somewhere about this thing?
Tried skimming through a few templating tuts, didn't really get it :(
 
Something else : This : window.onclick = function(e) { ... } works but document.getElementById('myid').onclick = function(e) { ... } does not seem to work. Can't I set onclick like this ? Do I absolutely have to use AddEventListener ?
 
console.log the element
 
@rlemon 20k
 
wait @BenjaminGruenbaum you deleted that post?
 
Me and 2 others
 
4:51 PM
@all even I corrected my answer with javascript version it was downvoted and proposed for deleting. Why Awal Garg do not give a better suggestion instead for downvoting my answer. What is the problem of using regexp sorry? — albanx 3 mins ago
!!fullfill this guy's wish or let it go?
 
@AwalGarg let it go
 
that's like a good bot!
 
!!afk off to a beer with Mosho and SecondRikudo
2
 

« first day (1495 days earlier)      last day (3459 days later) »