« first day (1641 days earlier)      last day (3290 days later) » 

1:06 PM
@ivarni eval is not a prerequisite to xss...
 
@CSᵠ I never said it is
"you can push all kinds of arbitrary js in the 1st place" => with that argument in hand, why add any security at all?
 
i was wondering.. since it's clientside code, the website can give you any JS to execute, in case of a MitM attack, eval or not extra code would still get in
so... eval in js could be evil as it would make code harder to follow as @rlemon said, but that doesn't seem evil enough...
 
eval is evil, == is evil, with is evil, new is just a pain in my ass.
 
The caps lock is evil.
 
no, that is the root of evil
 
1:09 PM
@rlemon don't get what you mean after ==
 
@CSᵠ with(){}
 
never used it, good thing lol
> Using with is not recommended, and is forbidden in ECMAScript 5 strict mode.
 
it is an artifact from a simpler time
 
ES 1st edition even..
 
with(array) {[0]=0}
 
1:21 PM
that's... horrible. Also it doesn't work
 
@rlemon eval == evil == ==
 
1:38 PM
# null is evil
 
THE
0
Q: SVG stretch with parent DIV

THEI am trying to make SVG responsive, so when window is re-sized, my svg will resize as well and fill parent div as it is when viewed first time. Here is the fiddle - http://jsfiddle.net/nhe613kt/321/ HTML <div id="myConta"> <div id="myContaList"></div> </div> JS $(window).resize(OwResize...

anyone....
.
 
Anybody here know how to compare 2 branches in github?
 
@THE Can you not set the width and height of svg to 100%?
 
THE
anyone 300 bounty ?
@Neil tried that, it didn't helped though
0
Q: SVG stretch with parent DIV

THEI am trying to make SVG responsive, so when window is re-sized, my svg will resize as well and fill parent div as it is when viewed first time. Here is the fiddle - http://jsfiddle.net/nhe613kt/321/ HTML <div id="myConta"> <div id="myContaList"></div> </div> JS $(window).resize(OwResize...

 
#myContasvg {
width: 100%;
height: 100%;
}
 
1:48 PM
hey guys
and girls
 
And everyone in between.
 
Hah, sorry that I missed you
 
Wow, really @THE?
Why have you completely changed the scope of your question?
 
THE
@BenFortune project deadline...
 
It went from "How can I call this REST endpoint in C#" to "How can I stretch an SVG"
 
THE
1:52 PM
@BenFortune ok ?
 
Open a new god damn question.
 
THE
:|
lets talk about something else
@BenFortune whats wrong with you ?
why you edited my question
I can't put bounty on a new question so I changed a question I asked before I don't need answer for anymore
 
I rolled it back, as that's not how SO works.
 
THE
seriously, some people, grrrr
 
@ziGi To be honest, I was both genders, as well as a god. So I kind of fit in "Everything in between".
 
1:54 PM
ah I see
 
Oh, you're talking about anime. I thought you were having a transgender identity crisis
 
Can anyone suggest me a good javascript project for beginners?
 
@RahulSah 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.
 
THE
@BenFortune you are so annoying
 
@THE He has a point, though
@SecondRikudo, you being a future mod and all, what is your opinion on "recycling" questions?
 
1:56 PM
@Kippie Define "recycling" questions?
 
Oh, editing and invalidating all of the answers given?
Yeah, that's a big no-no.
 
There were no answers, but it's still wrong.
 
Well, there weren't any actual answers, he just completely changed the subject of the question so he could instantly bounty it
 
Yeah, still a no-no.
 
2:00 PM
Well, you get my vote
 
is there a meta post saying you can't do that, or is it just in the rules?
I was trying to find one the other day when someone did similar.
 
Interesting, I've never seen that before.
Well with the specific no answer and bountied question case anyway.
 
@ssube Maybe you should make a meta post about it. I'm sure it happens regularly, but haven't really seen any "official" stance about it
 
0
Q: Completely changing an old question so the user can put an instant bounty on it

Ben FortuneThe user edited an old question of theirs with no attention or answers in order to instantly place a bounty on it. What's SO's view on this? http://stackoverflow.com/posts/28557935/revisions

 
THE
we all do things we shouldn't be doing when it comes to emergency, well I hope someone do same to you @BenFortune in same situation
laterz
 
2:01 PM
Someone's mad
 
@THE: Stack Overflow is not your 24 hour urgent customer service line.
 
@THE the moderators have commented on your meta question, very clearly stating that's not ok.
6
A: Editing older posts for bounty

bluefeetNo, it is not acceptable to edit an older post into a brand new different question to add a bounty to it. Doing that is circumventing the rules of how the bounty system works. You should post a new question, then add a bounty if you don't receive an answer in the requisite amount of time.

 
Hello
@AwalGarg i dont give a dime anymore
 
@FlorianMargaine I don't get it :(
 
2:07 PM
Public, private
 
@darkyen00 :D
 
@BenFortune .reverse()
 
Oh, I thought it was "Ostrich" vs "Emu"
 
I'm in a Haskell class right now, teacher is teaching from LYAH, opened random page - giant "GAYBALLS". MFW.
 
2:10 PM
@BenjaminGruenbaum Is the class worth it if the teacher covers an already known site?
 
@BenjaminGruenbaum That page is very casual for a language like Haskell. Are they trying to appeal to a younger, less hip demographic?
 
@BenjaminGruenbaum Are you inspecting if the teacher is doing a good job or not? :P
 
Is there a market for "Haskell For Under-Privileged Inner-City Youth?"
 
@Kippie no, I wouldn't come if I was trying to actually learn Haskell for the first time. The book is quite good though.
@ssube Did you find any Haskell jobs @BartekBanachewicz ?
 
@BenjaminGruenbaum That Baz Aldrin, he kicks ass
 
2:13 PM
@BenjaminGruenbaum well, obviously. I just don't feel I'm qualified enough for them.
 
guys can i pick your brains for "clientside JS: eval is evil"
1 hour ago, by CSᵠ
i was wondering.. since it's clientside code, the website can give you any JS to execute, in case of a MitM attack, eval or not extra code would still get in
 
How can I print an base64 code of an image using javascript
 
@CSᵠ
264
Q: Why is using the JavaScript eval function a bad idea?

Brian SinghThe eval function is a powerful and easy way to dynamically generate code, so what are the caveats?

 
i have that, i'm looking to debunk it...
is it really evil?
 
2:18 PM
Can't register my new windows phone to dev - center :-/
hmm ...
 
because.. you know.. it's in there for a reason, not for everyday use...
 
@CSᵠ changing your code at runtime is questionable, at best, because it makes debugging much more difficult.
using eval is evil because it jumps into the current scope and runs an arbitrary bit of code.
using it on sanitized input would be ok (ish), but then you may as well just use a <script> tag.
 
is there anybody who can help me out
 
using new Function is somewhat better, as it opens a new scope and gives you slightly more control over the behavior.
 
2:19 PM
^
 
eval is generally a terrible idea, but if you 100% know that the source is trusted, then it's not bad.
I'm more concerned with the security than the scope
 
@ssube awesome idea, tyvm!
@NickDugger indeed that's the case i'm targeting
but security wise... check my permalink ^^^
 
@CSᵠ "everyday use" is a meh statement. But then again, I'm not a typical JS user I suppose.
 
@CSᵠ that reason is often "legacy"
 
I used eval in my templating language for the logic bit. I eval the condition.
 
2:23 PM
85% of MS' API exists because of legacy
 
Good mornin simple folk <3
 
there's no practical reason to use eval now, with modules, CORS, and new Function (in order of preference)
 
most of the "X is evil" are to divert newbies from using that, because X can be done without evil at least in one case...
 
@BenjaminGruenbaum I've never used a DOMParser before, I'm going to have to look a lot of that fiddle up, but it looks nice
 
2:24 PM
isn't DOMParser for XML?
I've not used it either
I've only worked with JSON
 
I used eval for this: jsfiddle.net/Ralt/R3Gmg
 
Wow that's simple
 
You can make it even simpler by removing the first two lines, since the spec says that you're supposed to be able to acces elements by their ID's in JS without getting them
 
That is a pretty elegant calculator. It will break if you try to add exponentation, though.
 
thought I'm not sure who else implimented it besides chrome
 
2:29 PM
which goes to show, eval works in some very limited cases, but isn't good to use in general practice
 
And writing a simple interpreter shouldn't be too hard
 
@CSᵠ just because there is a case for == would you use it?
 
Aw shit, GTA5
 
"1" == 1
or
Number("1") === 1
 
@NickDugger Please don't do that
 
2:31 PM
@Jonathan I never said it was a good idea, lol
just that you can do it
 
brb breakfast of champions
 
== has some actual uses, like when you want coercion.
 
@rlemon definitelly! when that's better then ===, it's a tool in the toolbox...
 
No. Never ever use == in JS. Convert your types instead
 
@ssube yes, but it is clearer if you convert your own types
 
2:32 PM
I'm pretty ok asking for equivalence when I want equivalence.
 
so there is very little case for ==
 
i found myself using === too much, at some point i was wondering why i keep doing that shit 100% of the time
 
because your intent is clear
 
== is short for String.IsNullOrEmpty
 
@rlemon I'm sure you could make a performance argument against manual conversion.
 
2:32 PM
I keep using === in C before remembering
 
@ssube I'm sure you couldn't
 
it depends largely on the type
 
The only downside to using === is that I've sometimes caught myself doing it in C#, because of the habit
 
i mean, i have a method that definitely returns a boolean, and i'm using === true instead of just if()
 
10 million ops vs 5 million ops. idgaf
micro benchmarks are pointless
 
2:33 PM
so... why have a loose language if that's the case...
 
I mostly use == against null.
 
ew
 
@CSᵠ that's not the case we're making. Using no equal operator is perfectly fine.
@poke also not the case we're discussing, because you can always safely use === null (if you're actually talking about nulls).
 
exactly and in C++ and other langs, there is no spoon ( === )
 
When it comes to booleans, I almost always test for turthyness or falsiness.
 
2:34 PM
@Retsam I prefer testing for turtleness
 
@ssube I do want to allow for undefined though
 
if( obj ) <- instantly understand I'm checking falsey
if( a == 1 ) <- is a a string? a number? a boolean?
 
turtleness is when you flip the variable over and if it can right itself, it's good enough
 
turtlenecks ?
@rlemon maybe it doesn't matter?
 
@poke then use a helper: return typeof foo !== 'undefined' && foo !== null
 
2:35 PM
out of context, sure, but in an actual project, of course it matters
 
@CSᵠ to the person reading and trying to understand your code, it matters that you are making them question your intent.
 
when you understand that 0 is false and -12 or 19872 are true :))
@rlemon why the funk u reading my code? gtfo! :PP
 
@poke == null gives no indication that you know or care about undefined, where as isNullOrUndefined(foo) does (to some extent)
 
@ssube Why not check for undefined directly? foo !== undefined?
 
@CSᵠ Cos he gon' give it to you
 
2:36 PM
@poke undefined is a string
 
Everybody say Hallelujah (whooo!)
 
posted on April 14, 2015 by Nicholas C. Zakas

If you grew up in a democratic country, chances are you were taught at a young age about the importance of democracy and people’s right to vote. Children growing up in the United States, in particular, are inundated with the message that democracy is the best form of government and voting is the best way […]

 
but we all know that undefined is definitely not a function
 
!!> 'undefined' in window;
 
@jAndy "ReferenceError: window is not defined"
 
2:36 PM
because typeof foo !== 'undefined' works if undefined has been assigned to something, works if no argument was passed, and is generally more reliable
 
With bluebird, what is the proper way to do this?
 
gnah fucker
undefined is a variable in the global context aswell
 
crazy; but good to know, thanks
 
!!> function hasValue(foo) { return foo !== undefined; }; undefined = 1; var bar; hasValue(bar);
 
@ssube "TypeError: \"undefined\" is read-only"
 
2:37 PM
damn you, cap
 
haha
 
strict mode ;)
 
Gnah fucker ?
whats that ???
 
@NickDugger there've been years of brainwashing about that...
 
@NickDugger undefined = function() {return 'where is your god now?'}
 
2:38 PM
So, in strict mode, I can check against undefined directly? ;P
 
pls no
 
@poke no, in strict mode you cannot change undefined
it is read only
 
@poke no. Just use typeof, it's more predictable across the board.
 
imagine undefined is this
undefined="undefined"
 
!!> typeof undefined
 
2:38 PM
@NickDugger "undefined"
 
when you check if something is undefined, you are checking it against the string undefined
 
Eh, I think checking === undefined is reasonable.
 
rlemon not true
 
I wish JS didn't have undefined. Makes no sense. just throw an exception like everyone else.
 
@jAndy for this thought experiment, yes
 
2:39 PM
you're checking against the variable undefined in global scope
 
typeof foo === 'undefined' will always work, foo === undefined will not. They're otherwise equivalent. Use the one that always works.
 
which is undefined
 
@jAndy but we're always checking against the value
are we not?
!!> (function(a) { console.log( a === 'undefined' ) }())
 
with typeof we're checking against a string
 
@rlemon "undefined" Logged: false
 
2:40 PM
@ssube How do you assign undefined to a value? Do you use foo = void 0?
 
bullshit
my life is a lie
 
'undefined' == 'undefined'
 
@jAndy ahhhhhhh okay
yea, that is what I'm thinking of.
dammit.
 
why must you complicate
 
So I can just ignore what you said above? xD
 
2:41 PM
yes
 
:-P
 
!!> 'undefined' == undefined
 
@NickDugger false
 
Good, that was really confusing me :D
 
2:41 PM
but don't use ==
 
Honestly, I find foo === undefined just more readable, and any case where it doesn't work is a bug that must be fixed.
 
!foo
 
More readable, less reliable.
 
I have a love/loathe relationship with truthy/falsey
 
@ssube How so?
 
2:42 PM
It would be appropriate if you were writing ruby/coffeescript.
 
!!> (function( undefined ) { console.log(undefined === undefined, typeof undefined); }());
 
It's literally never been a problem for me. When it someday becomes a problem for me, maybe I'll take your advice.
 
It's actually more reliable, because it throws if you make a typo in foo
 
@jAndy "undefined" Logged: true,"undefined"
 
user1596138
@Retsam do you explcititly define a variable as undefined?
 
2:42 PM
@copy lint/strict mode should catch that
 
If you can’t reassign undefined in strict mode, and since we’re all using strict mode, why is checking against undefined using === unreliable?
 
user1596138
!!> var foo; typeof foo === 'undefined'
 
@Jhawins true
 
@Jhawins I do!
 
@Jhawins Very rarely, but sometimes for specific apis.
 
user1596138
2:43 PM
Either way same thing
 
yea, but sometimes I just like to see it :P
 
user1596138
@poke you can't do it anywhere
 
@rlemon makes it clear that you know and expect it to be undefined there, instead of just forgetting to define it
 
@ssube Strict mode doesn't. Lint might, although it could be intentional
 
@copy using an undefined variable intentionally?
if you're doing that, you're pretty screwed already
 
2:44 PM
For instance typeof require
 
!!> void 0 === undefined;
 
@jAndy true
 
THE V0ID
 
Your linter might not know require, but it doesn't complain because you're inspecting the environment
 
@copy they typically do: you put it in a comment at the head or enable a flag saying you're in a (browser|require|node|common|etc) environment
 
2:45 PM
In fact, if you do use fo0 === undefined, the linter will complain for sure
 
@copy my linter doesn't even know document, so I ignore it completely.
 
More points for === undefined
 
@NickDugger They usually have options for that
 
Our current sprint is named, "Afterglow"
 
@RahulDesai lol omg you did get burned
best troll comment in a long time
 
2:49 PM
@NickDugger our current sprint is called do or die
 
@darkyen00 that's one of those multi-year sprints, no?
 
nah
it will only last till this weekend
started today
 
a four-day sprint? what?
the sheer meeting overhead there makes me want to put down my keyboard and walk away
 
^ wtf
 
posted on April 14, 2015 by admin

Hovertext: I caught you creating on me! New comic! Today's News:  Last chance for class, kids!

 
user1596138
2:56 PM
At least it's not the Google analytics code
 
i wonder if feeds can subscribe to explosm too
 
explosm would be way funnier than smbc
 
!!s/explosm/anything/
 
@NickDugger anything would be way funnier than smbc (source)
 
SMBC hasn't been funny for a while
 
2:58 PM
Hi, i have a problem with cloned elements total price calculation in Jquery.Could any one help me to get out of this
 
user1596138
@SterlingArcher You're an owner, you can go add it if there's a supported feed (idk if you're supposed to announce it or whatever)
 
smbc is just really desperate, sad, vaguely sexual jokes
 

« first day (1641 days earlier)      last day (3290 days later) »