« first day (956 days earlier)      last day (4217 days later) » 

18:00
how can I make sure the current token is valid if it's stored in a cookie besides make it expire sooner?
If I can get metaballs to work for a liquid demo, I want to make a 'hose' that whips around shooting out 'water' over a balance scale. Which ever side tips first is the result.
!!> var arr=[true,false,true,false,false,true,true]; eval(arr.join('-.5+'))>0
@dystroy true
I'm torn though, is that WTF worthy?
@rlemon implement the Lorentz waterwheel
18:03
Tip: They want a realistically bad solution.
@rlemon hah glad I could help :)
You like my balls and it makes me happy
@BenjaminGruenbaum Fixed.
@SomeKittens I mainly want the guy who downvoted it to explain himself, but thanks.
@BenjaminGruenbaum I had the similar your situation
past 5 minuts
or 5 minut past?
or 5 minut last?
:P
18:10
@BenjaminGruenbaum I would reword the "checks if ..." paragraph slightly
var coin = (function (seed) {
    var pRand = function (nseed) {
        var seed, constant = Math.pow(2, 13) + 1,
            prime = 37,
            maximum = Math.pow(2, 50);
        if (nseed) {
            seed = nseed
        }
        if (seed == null) {
            seed = (new Date).getTime()
        }
        return {
            next: function () {
                seed *= constant;
                seed += prime;
                seed %= maximum;
                return parseFloat("." + seed)
Arg. Coworker is arguing for his change that adds an unnecessary abstraction. "Abstractions aren't trade-offs! They don't make the code any more complex!"
is this WTF worthy?
@SomeKittens what kind of abstraction?
Not enough bitwise operators
18:11
:(
i'll go back to work
@JanDvorak encapsulating a native knockout binding to save ~10 chars of code
m59
m59
@rlemon it makes no sense in the world to me...
yay for undownvote
@SomeKittens ten chars, or ten chars per line?
@m59 basically i'm generating pseudo random numbers and checking them against the previous generated value.
18:12
10 chars total
that's not really worth it
m59
m59
var mind = 'blown'; @rlemon
@SomeKittens I need to ask them if Prolog/Haskell are okay. I have a great idea for a cross-over Prolog/Haskell/Python solution.
Yeah, especially when the native method is what we use elsewhere in the codebase.
does it make the code look more consistent? @SomeKittens
18:13
It will have puppies.
is there danger in giving access to a site with a cookie that has the user's unique ID from the API?
@KevinMurphy lol
@JanDvorak No, it's worse, because it extends Knockout, so one has to context-switch to figure out what the binding does.
can't users edit cookies in their browser?
18:14
I might implement the random burning of kittens though
@KevinMurphy yes
For people where I wrong on the my answer stackoverflow.com/a/16820465/1461682
@SomeKittens wait what? What are we talking about now?
how about generating a random guid and storing it in a database and matching it to the users unique ID?
@BenjaminGruenbaum basically: active: currentPage()=='new' (his) versus css: { active: currentPage() === 'new'} (proper, uses native css binding)
18:15
 $(document).keydown(function(e) {
        if (e.keyCode == 13) { $('#login_form').submit(); }
    });
@MirkoCianfarani this
@MirkoCianfarani
Adding a keyboard listener to the document that always submits the form on ENTER, no matter where you are, is a very bad idea. It has some serious accessibility implications. Those 3 lines could render the entire page inaccessible. — circusbred 32 mins ago
m59
m59
@rlemon if you will do me a great kindness....can you check this out (in Chrome) and tell me if it can be done in a way that doesn't suck? jsbin.com/obunol/45/edit
Also, ton of whitespace and commented code makes the code look messy
@BenjaminGruenbaum I think some people enjoy downvoting high-rep users.
@SomeKittens Not sure, people don't like downvoting for no reason
18:17
Maybe some high-minded revenge scheme against the SO 'mafia'?
m59
m59
@rlemon It works perfectly the way I want in Chrome, but FF is screwed. It's ridiculously un-semantic to me, also..
@m59 use templates or just include the html directly. I hate seeing html generated from strings via js. it's just so nasty to look at
@SomeKittens I'm not sure what the context is, I don't like having code in my bindings, I'd have a custom active binding if he uses it often, and put the function that checks agianst new in the VM. If it's just one or two places I'd just the native binding though
m59
m59
@rlemon LOL please ignore that part. You know me better than that.
@BenjaminGruenbaum I don't how to change because miss the <div id=login_form> and I suggest of use the other methods
and @JanDvorak I can have more details
18:18
imo there is nothing wrong with putting the HTML on the page then var elm = $('#foo').detach()
@Loktar what about generating a random number and inserting into a database when the cookie is created and matching that ID to the unique ID?
@MirkoCianfarani not a reason to downvote, but you're using $ everywhere, but then you write jQuery.validator
m59
m59
@rlemon That is totally irrelevant dude..that's just to show the scaling and divider, nothing more
it's all relevant when we're doing code reviews ;)
m59
m59
@rlemon I mean that insane amount of calculations and jquery hack-like junk to get it to look and scale the way it does.
@rlemon yeah, it's just to show that the divider works and that the icons will scale down if the ul gets too big.
18:19
@MirkoCianfarani what is $fm.attr('${ajax/check_login.php}') supposed to do? Do you have an attribute with that name?
yea, I would look into doing it with pure css if you can
@BenjaminGruenbaum It just checks to see if the selected button is the one most recently clicked.
you may have to re-factor the html, but if you can get it to work pure css with media-queries that would be optimal imo
There's ~5 of 'em
@SomeKittens Then I'd use CSS
m59
m59
18:21
@rlemon the question is "if I can". That's what's killing me.
@MirkoCianfarani also, your answer basically says "it's a dupe. Here's a dump of [[this]] answer:"
@SomeKittens like here tipranks.com/resources/finance.yahoo.com/MSFT.html (this is a PoC, no harsh code judgements!) when you click the sort by part and change from date to rank
Yeah, no need for an additional binding for something so simple.
m59
m59
I've probably worked on this stupid thing for like 100 hours or more. I've done it every way I can think of and can't get it any cleaner :(
But I'm determined.
I take my code and function. Change for the question and $fm.attr('${ajax/check_login.php}') this add the action
$fm.attr('${ajax/check_login.php}')  is the action of the form @JanDvorak
18:22
@MirkoCianfarani "Because missing the code with div how login_form or form" does not make any sense to me.
@SomeKittens these are the bindings, not good, but again PoC tipranks.com/resources/scripts/kobindings.js
@MirkoCianfarani attrexpects an attribute key, not value
Hey guys
@powerc9000 hello
@SomeKittens code review also appreciated if you feel like wasting your time :)
18:23
Which would you rather have? A library with lots of not-very-good documentation, or a library with only a little good documentation (i.e. it doesn't cover everything)?
Lots of not very good.
@RyanKinal a library with readable code I can check for myself
@MirkoCianfarani "... because I do not know how to ..." never sounds good
@BenjaminGruenbaum gotta get back to work...
is there a 100% safe way of dealing with cookies to log someone in lolz
18:24
@BenjaminGruenbaum Unrecognized input. Please check your syntax.
@SomeKittens cool, thanks :)
@RyanKinal little, but good
im going hysterical over here
m59
m59
@Kevin yes, give me a moment
@RyanKinal :)
18:25
@BenjaminGruenbaum ;-)
@RyanKinal :-D
m59
m59
@Kevin give me your email if you could...
@m59 you ruined it :(
m59
m59
oh oops
@MirkoCianfarani if you're going to copy-paste the question code, at least fix it entirely (and describe in text what you've changed)
m59
m59
sent
wow thanks
m59
m59
If you have any specific questions, let me know.
uff i don't know how to recover the points to open questions and now I delete the my answer @JanDvorak
Finally thx for suggest
m59
m59
and that is language agnostic, so will work with whatever server side you use.
18:27
:(
tweaking my random number generator and crashed my browser :(
API horror story of the day: The code examples in the documentation give you possible values of a callback argument as strings (type == 'create'). However, it turns out that they are, in fact, objects, and thus type === 'create' is false, but type == 'create' is true.
@rlemon lol
I should work on my random number generator...
up until it crashed it was a good tweak...
now it's gone :(
ohh well
m59
m59
@rlemon doh, making a pure css trapezoid would have been a good first step :) I did it in 3 pieces
lol man.. cheevos.com
I love that site so much
I just reread the bottom 3 columns made me laugh again
@Loktar Hah! I had forgotten about that.
18:29
I hope BBoy is doing alright
@RyanKinal lol yeah same here someone mentioned a cheevo the other day, it jarred my memory
omfg, I love the logo on top
... for some values of "love"
haha yeah
> It shows dedication, and that you don't just give up on things. It would actually look good on a job resume.
haha
> (Guest then asks 20+ questions in awe)
:( what makes me sad is knowing he is not trolling
18:32
@Loktar I kind find any wikipedia article on the topic. What's cheevos ? A kind of kharma/rep for gamers ?
he believes this
@dystroy achievements, basically like you said karma or rep for gamers
if I do something in game X, I may unlock an achievement for it
Microsoft gamers ?
most services have them
but this dude is talking about MS and xbox 360 specifically
> If they are telling the truth and have more Cheevos than you, leave. Nothing else you can do. Buy the person a drink and leave, unless you're willing to look 2nd best. If you brought a date, odds are she's going to be impressed with the higher gamer score and ditch you. Get out as soon as you can and go to some other party.
HAHAHAHA
18:33
please can someone help me out with this fiddle? jsfiddle.net/SYAGm/1 if you look at it, what i want is to only have 2 digits after the dot like a normal price
If you brought a date, odds are she's going to be impressed with the higher gamer score and ditch you
golden
haha yeah
how does someone lose base on life so badly?
Damn... I have more than 28 years experience in gaming and still about 0 cheevos...
> Points = (Cheevos * 2) + youtube views + social media fans(myspace, facebook) + (breakdance skill leve(1-10) * 50,000)
@dystroy it's ok
you can still date up if your other scores add up
18:35
lol
0
Q: Why does PHP use the characters "<?php"?

Paul TarjanOf all the possible delimiters for server-side includes, why did PHP pick "less than question mark php"?

@rlemon Don't points from golf.shinh.org count?
no actually I don't know.
Then why would anybody care?
@copy Only if your date happens to be @BadgerGirl.
18:36
he says he only cares about cheevos but then contradicts himself with his equation
!!> 0*2 + 0 + 0 + 0*50000
@dystroy 0
@dystroy the lowest breakdance skill level according to his given options is 1
@rlemon I'm still below
Woo! You have 50000 points!
18:37
!!> 0*2 + 0 + 0 + 1 * 50000
@rlemon "SyntaxError: missing ; before statement"
@RyanKinal it's more fun to do the math.
@rlemon 50000
does anyone have 2 mins spare to look at my fiddle? jsfiddle.net/SYAGm/1
18:39
@Loktar Thanks, ill have to look into those methods
that was the best thing ever
LOL wtf
bahaha.
@rlemon do you think he is for real?
18:41
thats the best one
@powerc9000 I know he is
This is the greatest thing ever!
I think hes trolling
I think hes a developer
THERE IS NO WAY THIS IS REAL
18:43
ohh he is
a developer that is
not a very good one
look at his windows phone apps
lol I love that video so much
@Loktar Rated 9.5 on hot or not!? Blasphemy. He's a perfect 10
haha
I love the stutter in the voiceover
haha yeah
18:46
Trivia: what does this Ruby code return? ->(x){x} === "x"
Nobody cares
5
ding ding ding
LOL
man, now I remember why I had to stop following this guy the first time.
I could spend all day reading his BS
18:48
lol whys that?
ooh hah yeah
bboy krustdog lol wtf
dude, cheevos and youtube views get you chicks and land you jobs. didn't you know
no, I need to up my cheevo game!
I'm surprised you even have a wife with as little youtube views as you have.
thats the only reason I have a wife
my youtube views are decent
she settled.
ahh
18:49
@Loktar you won her over with the smoke effect, didn't you?
bboy360 didn't wanna date down, I see. She had no other option.
loktar00's channel
578
subscribers
811,086
^ views
but 0 cheevos
"guy who mastered games and social media" vs "guy who owns games and uses social media"
hard decision.
haha
The videos I have of you showering and changing clothes have more views.
18:50
@Zirak people have some weird fetishes :?
woa?! 800K views?!
> Ohh yeah put those pants on OMG OMG UGGHhhhhh
dude, why are you not blogging this and putting it on t-shirts.
@rlemon lol yeah from my stupid prank vids
...yeah, people. hehe. It's not me watching over and over. Totally.
18:51
@dystroy you available?
@Loktar do you mind if I drop your name at clubs to impress women?
I mean thats fine, but if they call me Im going to jump on it
@FlorianMargaine What do you mean ? I'm married and my wife calls me because there's some movie or documentary with dance...
I cant make any promises I wont try and pick them up
> Yea, I know loktar00, dudes a close friend of mine. You should come back to my place and we can IRC with him and have a few Drinks ;) ;)
18:52
@dystroy no, I mean, available for some Go basic help :P
I've been increasing my steam count too, if they see that you'll prob be screwed man
I've been going through the Go Tour but I can't apply on my code
hah, I just checked my spam folder. This is great.
compensating
lol
hey is that Mars game fun?
I ended up grabbing it last night, saw you playing it
18:53
I was just looking for the link!
hahah
yea it's fun.
for the price :P can't beat it.
the graphics are shitty indie graphics but I kinda like em that way
note to other people: the room is in french, don't bother.
@Zirak keep trolling, tell him you've very interested
18:56
@Zirak reply in Akan
see if he understands you
user1596138
Does anyone know a way for me to call a function only as soon as a specific element has loaded?
Some elements have a load event
user1596138
Oh yeah, of course. I didn't think of just using onLoad.
Can some one with CSS knowledge jump in to the HTML room for a second?
@mikedidthis is it you that has the question?
19:04
@rlemon nope. I am trying to explain to someone about classes and I think I may just jump off a building
in HTML / CSS / DOM & web design, 54 secs ago, by Jhawinsss
@alisamii if you're styling individual elements you should be using IDs. That's really all that needs to be said.
@RyanKinal
:resists the rage:
in HTML / CSS / DOM & web design, 1 min ago, by Jhawinsss
@rlemon If he's styling one specific thing I don't see why not.
he's now asking for two reasons it's a bad idea
@FlorianMargaine I'm back, sorry
@RyanKinal you cannot resist this
you must be heard!
19:06
Thanks guys. Sorry that guy just got to me :(
@dystroy np
user1596138
@rlemon I am.
user1596138
@rlemon Give me them.
@Jhawinsss 1) specificity becomes harder to work with
2) they are no longer re-usable because ID's are singular
3) they are ugly.
4) because Ryan will break legs if you do.
I gave you two legit, and two sensible reasons
user1596138
19:09
@rlemon To number 1, that is the entire point. Styling one individual element.
@rlemon it's "Je t'aime" btw.
user1596138
@rlemon Reasons 1 and 2 are the same.
@Jhawinsss maintainability is also ensuring forward compatibility
don't ever assume your code will not be changing
@Jhawinsss Incorrect
NEVER assume this
19:09
Specificity refers to overriding your styles
and specificity is a bitch when dealing with IDs
user1596138
I'm not trying to be a dick here, or prove anything. I'm legitimately curious. So please keep this in mind.
using ID's for styling -> you may as well be doing it all inline. and we can all agree inline styles are bad. so why don't you see the same for IDs
user1596138
While I hardly ever do the front-end, I've usually used multiple class selectors myself. Using the first class (the common one) for the general styles and then the secondary class which is more specific to a few elements, or even one for individual/more specific styles. I'm guessing this IS correct?
19:11
yes
I group classes or nest them
user1596138
@RyanKinal If you know anything about HTML, you probably know that IDs are supposed to be unique. This means that there can only be one of any particular ID per page. As the argument goes, if you absolutely know that you’re only going to have one of a particular design element on a page, then go ahead and use an ID.
or put element specific rules.
user1596138
@RyanKinal Direct quote from that link ;)
user1596138
Not defending IDs, just saying that that was ironic.
@Jhawinsss I'm aware. I wrote it.
19:12
ul.foo { }
ol.foo { }
.foo li { // for both }
3 mins ago, by rlemon
don't ever assume your code will not be changing
@Jhawinsss then he goes on to say why you can't actaully assume that
The point being, of course, that you rarely know anything absolutely
^ this is so true
even if you wrote it, control it, maintain it, and it is 100% bug free... chances are it will still be changed at one point or another.
And overriding styles defined with an ID selector is a gigantic PITA
user1596138
@rlemon This is true. It's definitely impractical in the long-run.
19:15
Picture this: You write a style with an ID selector (for instance #content h2), and you want to override that for some reason. You try, in a different stylesheet, to use h2 as your selector, but it fails miserably. You either have to resort to using the same ID (tying your two styles together) or a different ID (adding more complexity).
I always got told, class for styles, ids for hooks?
Or, Eric Meyer forbid, the evil of all evils: !important
so don't be complacent with mediocre code. Always use the best practice even if you assume the style will be only applied once. It's no more work to put class="" and . instead of #
user1596138
I don't need to picture it. I've done it myself. But in certain cases I think it can be appropriate. Maybe not all, but certain.
@Jhawinsss I think it (in all cases) can be avoided.
user1596138
19:16
@RyanKinal Hahaha I almost said !important for irony but wasn't sure if you guys would believe it was a joke afterwards.
Sure. There are exceptions to every rule. But be very very careful. Especially if there's any remote possibility that I'll have to work with your code.
if you are serving millions of hits a second like google every char counts and not putting class="" vs id="" might be a win there
user1596138
@rlemon Definitely can, probably should. But it's not invalid.
but it is not desired.
@Jhawinsss working !== correct.
I would argue just working, albeit bad code, is not valid.
@rlemon did you like my little room? Its the only place I can go and feel clever! :)
19:17
but that is an argument for another day
> Always code as if the guy who ends up maintaining your code is a violent psychopath who knows where you live.
@mikedidthis nahh, you are clever :P you're making money off webdesign. I never was able to figure out how
What @FlorianMargaine said
@FlorianMargaine I disagree with that
@mikedidthis Do you want the bot to be in that room?
19:18
@RyanKinal I'm sad. codepen.io/chriscoyier/pen/lzjqh 256 styles no longer overrides one id in chrome
user1596138
@Zirak I think the bot needs to be in most rooms.
@BenjaminGruenbaum care to elaborate?
@FlorianMargaine Double that in the likely case that you're the maintainer. He knows everything about you.
@rlemon lol
@rlemon nah, I was lucky, I never did / do them for the money :)
19:19
@FlorianMargaine Always code beautiful code, like you're making a piece of art. Clear and simple code is beautiful. Don't assume your colleagues are idiots and use the language and its tools to the fullest extent.
@Zirak yes please! If that is ok?
!!/summon 29074
user1596138
!!/info summon
@Jhawinsss Command summon, created by God, invoked 1 times
user1596138
!!/help summon
19:20
@Jhawinsss summon: Say boopidi bee and in the room I shall appear. /summon roomid
@BenjaminGruenbaum I agree, however I also think that ugly code is ugly code. I would still not use an ID for styling because I believe it to be bad practice. I don't think this has anything to do with the intelligence of my co-workers or anyone looking at my code in the future. use bitwise operators, use == vs === when applicable, use eval if you REALLY must. but never break 'best practices' unless there is a pressing reason (like google trying to save a few bytes)
user1596138
Ah!
I should add that listener...
@rlemon Bitwise operators are a horrible practice if you're not code golfing. Unless in specific contexts when performing actual bit operations, I would never use them.
user1596138
@rlemon I would argue that working but bad > not working and bad.
19:22
ahh, but when you need to, you can use them.
@rlemon sure, when you're performing bit operations use them
a lot of people shy away from them all together and find workarounds to not use them
Well, if you need to do operations on bits...
Avoiding them is worse than using them in that case
alert("hello world!");
:)
What a cheesy line! I bet you regulars have seen that over and over.
> window.alert = console.log.bind(console); // This is a godsend.
19:25
@JonH nope, never
I've just been cured of blindness
@JonH We discourage the use of alert
meh
@rlemon I usually do even worse, I bind it to an AJAX/WS call with all the data like time etc and then have logs I can sort by severity etc on the server
yea i'm just talking as a userscript
websites with alerts annoy me
Y U TAKING MY TAB FOCUS YOU SOB?!?!?!
19:27
@rlemon I haven't seen a website with alerts in a long while tbh
@BenjaminGruenbaum don't test @XCritics code
lol ok
@JonH did you invent this line of code?
nahh, I do see them every so often.
@LightweightHeavyHanded 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.
finally I can use the chatroom - does anyone know what these are called?: .getsession(), .setvalues(), .getOrder()
is it called reference property?
user652649
19:33
8 messages moved from HTML / CSS / DOM & web design
would something like this work where the sub properties have different values: nlapiGetWebContainer().getShoppingSession().getOrder().setFieldValues({'items':['‌​options']})
0
Q: Math calculation refactoring in JavaScript

NicoHere's the full source to a plugin I'm developing, the relevant code I want to refactor is: function measure($element, $bubble){ var scrollTop = $window.scrollTop(), viewportHeight = $window.height(), readableTop = $element.position().top, readableHeight = $element.he...

user1596138
Lmao room war.
user1596138
in HTML / CSS / DOM & web design, 50 secs ago, by Wes
@mikedidthis don't say sorry. this room is as yours as mine. js room is too chaotic and i don't want this room turning like that
19:42
lol
@Jhawinsss :) its true though, its very slow placed over there :)
1.) Create room titled "General Code Help" with an enticing subsection
2.) Create two bot accounts to have a continual, markov-chain inspired conversation in there so the room's always at the top.
3.) Whenever someone joins the room, have the bots engage in a standard conversation. (Think of "could you explain that" "Do you have any more code samples" etc, etc).
4.) No more noobs bothering the JS room.
5.) ???
6.) Profit!
Also Javascript Room, thank you, I think he understood the issue with his selectors :)
@danieltjewett 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.
@SomeKittens I like it, but instead of 'General Code Help' we'll title the room 'FREE CODEZ FOR YOU!'
19:47
in HTML / CSS / DOM & web design, 20 secs ago, by Benjamin Gruenbaum
@Wes Would you mind adding jQuery to the title of your room? We'd really appreciate it back at the JS room, you can have all the erm, constructive discussion about it here instead of at our room
lol
@AmaanCheval We once talked about something related, and I can't remember if I mentioned this...but I once read a nice viewpoint (can't explain it in another way) that there are 2 kinds of truths: Trivial truths and profound truths.
Trivial truths are ones whose negation is obviously false, for instance `2 + 2 = 4`.
Profound truths (which philosophy deals in) are ones whose negation are also profound truths, for instance "ignorance is bliss".
@SomeKittens infiltrate the C++ room, add "jQuery to the title"
@Zirak Cool, thanks! You hadn't mentioned that earlier
!!/summon 7
!!/unsummon 6
huh...that's quite bad
!!/undo
19:55
!!/summon Kraken
okay...
!!/unsummon 7

« first day (956 days earlier)      last day (4217 days later) »