« first day (1871 days earlier)      last day (3071 days later) » 

8:00 AM
Container page that loads in partials.
 
I get the IE issue now :P
 
Where the container page has your routing logic
 
alternatively, FUCK IE 9
 
And loads in the proper partial, depending on the route
 
crl
8:01 AM
@AwalGarg yeah, that's a the beauty of it
 
@Cerbrus I think he wants to load stuff in one go for performance
 
Hello guys
 
@Sheepy 2 blocking in there? { let i; for ( let i = 0 ; i <= 1 ; i++ ) { let i = 0; } }
 
@AwalGarg Yea, that'll be problematic, since stuff behind the hash tag isn't sent to the server
 
New to ES6.
 
8:03 AM
@RahulDesai But we have three "i" :D I want to give an example where let is not bounded to nearest block. Anywhere you can declare variable is a scope, be it block, loop, or even parameter.
 
blocks*
@Sheepy Ok. So you mean the "i" in the loop, going from 0 to 1 has its own scope and the other one has its own scope?
If yes, I would be amazed. 0_0
 
Yes.
 
So, the actual iterator of that loop isn't accessible?
 
There is no "i" in loop.. I mean, unless you misspelled it like "lioop"
 
Good question.
 
8:09 AM
Well, it is accessible in i <= 1 and i++. Otherwise, no, you can't access it :D
 
@Sheepy Yea, that. Well that seems like possible SO question material.
 
Yup, in that example, I believe the iterator is getting replaced by the other "i".
 
Ah. Should I make it my first question? :D
 
So it is not accessible.
First question for what?
 
My first SO question. Well, technically, a second. But I won't delete this one. Promise. Unless if I find a dup :p
 
8:12 AM
Why would you post this question if you already know this answer?
Knowledge sharing, if I am not mistaken.
 
0
Q: How to generate screenshot of a website from a URL?

VineetI am developing a website using Spring MVC. I have a form where I ask user for his website's URL. I need to show him the screenshot of the website after he enters its URL. Should I generate the image at the backend or the frontend?

2 link-only answers
Linking to libraries
 
@Cerbrus One of which got edited
 
Wow, they got beaten up bad.
 
@MadaraUchiha: Yea, removed my dv on that one
 
So that I can get some rep and post an answer three days later, I suppose. I have lots of cats in my bag OvO
I need 10k for delete votes. Quite a long way to go making only occasional answers.
 
8:14 AM
He's smart.
 
@RahulDesai 2 downvotes isn't bad
 
answer three days later?
 
@Sheepy Focus your effort on canonicals
 
After 3 days you would be having a bunch of answers already.
 
I award 500 for each good canonical answer.
 
8:15 AM
50
A: Why does bitwise "not 1" equal -2?

CerbrusThere are 2 integers between 1 and -2: 0 and -1 1   in binary is 00000000000000000000000000000001 0   in binary is 00000000000000000000000000000000 -1 in binary is 11111111111111111111111111111111 -2 in binary is 11111111111111111111111111111110 ("binary" being 2's complement, in the case of a b...

*cough*
Maybe not quite canonical, but still :P
 
Thanks. Let me study what this "canonical answer" thing is about @_@
 
@Cerbrus Settle down, you already have 20k
 
30
xD
 
Let others have a swing at it :P
@Cerbrus That does not contradict what I've said.
If you have 3 apples, you also have 2 apples.
 
!!facedesk
 
Hey! I already voted that one up! XD
 
Does cap still "minimize" gifs?
 
crl
s/desk/keyboard
@Cerbrus wait and see?
 
If you hit the keyboard with your face, you're also hitting the desk.
 
TIL ~ is a bitwise not.
Is that just like !?
 
8:19 AM
!??
 
crl
!!> [!0, ~0, !1, ~1, !2, ~2]
 
@crl "false,-2,false,-3"
 
like !someBoolean
 
@RahulDesai No, not at all.
 
! is a boolean not
~ is a bitwise not
 
8:20 AM
Oh damn.
 
Error 404 occured, I will call the maid (@Zirak)
 
So, ! inverts the boolean value of it's operand
 
yeah, I confused ~ with !
 
crl
~n = -n-1
 
In what cases would we need to use the bitwise not?
I mean, in the real world.
 
crl
8:22 AM
~~n=-(-n-1)-1=n
 
30
Q: What does a tilde do when it precedes an expression?

wwaawawvar attr = ~'input,textarea'.indexOf( target.tagName.toLowerCase() ) ? 'value' : 'innerHTML' Saw it in an answer and I've never seen it before. What does it mean?

 
@RahulDesai I know what you would not use ;)
 
crl
!!> 8===~~o
 
@crl "false"
 
I see.
 
8:24 AM
@Cerbrus Ooooohhh, never thought about ~arr.indexOf(something)
Clever.
 
!!> 0===~~'o'
 
@Cerbrus "true"
 
@RahulDesai You don't often use it, and most cases when you see it used, it is to reduce several lines into one
 
So, guys, little exercise: Why does ~~'o' equal 0?
 
8:26 AM
One could argue that it is better to simply write out those lines if otherwise you're sacrificing clarity
 
@Neil Gotcha.
 
@Cerbrus Hmm, because ~'o' is -1.. though not sure why ~'o' is -1
 
If ~'o' equals -1, then what is 'o'?
 
Ah, I was about to ask that! ^
 
What could it be so that a bitwise not returns -1?
 
8:29 AM
It's a lower-case zero
 
Or, what does ~ do to 'o', so it eventually returns -1?
 
LOL
 
By the way:
!! > 0 === ~~'This is bizarre'
 
@Cerbrus "true"
 
This is probably the weirdest thing I have ever seen.
 
8:31 AM
It makes sense.
The bitwise not can't operate on strings.
 
any good note taking software for linux? like icloud etc.
 
@RahulDesai You've not seen Dune then.
 
So, it casts it to something it can work with.
 
crl
!!> ñ==~n
 
@crl "false"
 
8:32 AM
!!> ~Number('o')
 
@Cerbrus -1
 
!!> Number('o')
 
@Cerbrus "NaN"
 
!!> ~NaN
 
@Cerbrus -1
 
crl
8:33 AM
!!> ~Infinity
 
@crl -1
 
string to number and number to string?
 
So, 0 === ~~'0' equals 0 === ~~NaN
The string gets cast to number, resulting in NaN, which, as far as bitwise operators are concerned, equals 00000000...
 
@nickB Evernote? Keep? org-mode?
 
Congrats @MadaraUchiha :)
 
8:37 AM
@IanClark Thanks :)
 
@Zirak I want desktop application. And i don't use apps.
 
@nickB org-mode is the best thing since sliced bread. But it's for emacs. So assimilate.
There was a Charles or Charlie or something like that, its icon was a dog, which was supposed to be really good but got bankrupt.
 
so i have to use emacs then
 
@RahulDesai Try []+{} == {} or [] == 0
 
@Sheepy I havent dont this in the console yet but I believe []+{} == {} must be true
let me explain why
both sides resolve to {}
left side, []+{} -> since [] is also an object, {}+{} = {} (I think so)
 
8:44 AM
@RahulDesai No, that's not why.
If that were true, then []+{} were to be === {} as well.
!!> []+{}==={}
 
@MadaraUchiha "false"
 
hmm
 
!!> {} == {}
 
@Cerbrus "SyntaxError: expected expression, got '=='"
 
There's a good SO answer on those
 
8:45 AM
!!> []+{}=={}
 
@RahulDesai "true"
 
It can be quite fun when you are learning it, really, for example: [] == "", [] == 0, 0 != ""
 
wow
 
@Zirak You coming to Benji's talk?
 
He didn't invite me (hint hint @BenjaminGruenbaum nudge nudge)
 
8:46 AM
These are all true. Array equals to empty string. Array equals to zero. But empty string does not equals to zero.
 
@Zirak Who needs an invitation? I'm going to barge in and troll him
 
Link?
 
How is []+{} working then?
 
592
Q: What is the explanation for these bizarre JavaScript behaviours mentioned in the 'Wat' talk for CodeMash 2012?

SLCThe 'Wat' talk for CodeMash 2012 basically points out a few bizarre quirks with Ruby and JavaScript. I have made a JSFiddle of the results at http://jsfiddle.net/fe479/9/. The behaviours specific to JavaScript (as I don't know Ruby) are listed below. I found in the JSFiddle that some of my res...

 
8:47 AM
goodmorning
 
!!> 0 == ""
 
@RahulDesai "false"
 
> People got arrested for building their apps in the nude.
Classy.
 
@RahulDesai "true"
 
@Zirak that statement is correct :D
 
8:48 AM
!!> []+{}
 
@RahulDesai "[object Object]"
 
You can come though, it's a free country.
 
Or is it now?
 
If you're a white hetrosexual male.
Out of which you are none.
As a brown bisexual horsie.
Wait, I'm mixing you up with another friend, nvm.
 
@RahulDesai Know that programming is all about rules. All these happens because of programming rules, which may be very unintuitive. Learning the rules well will serve you well in learning a language.
If you want to learn it, I personally read the spec - starting from the '+' and '=' operator. But they are heavy; others may be able to suggest better materials.
 
8:49 AM
Yet you don't have any qualms riding my hard brown back.
Shame.
 
@Sheepy True.
That was mind boggling though.
 
Well, it is better than HTML5 spec. I still can't figure out the mess that is document.write.
 
~ and []+{}
 
@BenjaminGruenbaum You promised not to tell anyone *sobs*
 
@Sheepy document.write is not recommended so I stay away from it.
 
8:52 AM
document.write is recommended to stay away from.
 
No, it is not. But please enlighten me, what is your proposed alternative? :)
DOM, sure. Which method(s)?
 
DOM manipulation.
 
@Sheepy I would make a virtual DOM and replace the existing one.
 
!!nudge 10
 
@MadaraUchiha Nudge #2 registered.
 
8:56 AM
@Zirak come though, it'll be fun.
I need css help :D
 
I shall
 
@RahulDesai In general write/writeln has two usages. one for appending content, one for replacing content. First can be replaced by insertAdjacentHTML. Second by replaceNode.
 
document.querySelector('html').innerHTML = "<someTags></someTags>";
I would create "<someTags></someTags>" using `document.createElement`.
 
@BenjaminGruenbaum Me too. How do you scroll a tbody without also scrolling the thead?
 
I see.
 
8:57 AM
Try not to use innerHTML, either. It is almost as heavy as document.write
 
So, I know they are bad. I just want to learn what the spec says, so that I can discern where the different behaviours between the browsers lie. Well, I tried to read it twice, and still not get it :(
If you need to create lots of elements, createElement and appendChild is slow - use createContextualFragment.
 
How about string manipulation?
I was asked this in one of the recent interviews and he was happy after I told this can be solved using string manipulation. :)
Performance-wise, string manipulation is pretty fast I believe.
 
getting innerHTML involves the browser going through the DOM tree and building a string for you. setting the innerHTML is three times worse, with many side effects.
 
Code is ugly, but fast.
oh
 
9:04 AM
@MadaraUchiha nudge
 
reflow is thy enemy
 
@RahulDesai You need to judge for yourself - or experience it first hand. I rarely find setting innerHTML useful. If you want to work with text, go through the text nodes. You won't accidentally change tag or properties. You won't lost event handlers.
(Setting textContent is another matter.)
 
Performance wise, the only thing that really matters is DOM manipulation
Anything done in memory or CPU in JavaScript is often 2-3 orders of magnitude faster than anything that touches the DOM
Especially those which cause layout/reflows
Mapping over arrays, string manipulation, regex, variables, objects, those almost don't matter.
If you have stuff that touch the DOM, they'll be slower, and that's where you should focus your performance efforts.
 
I have some reservation for regex. You can build some pretty inefficient regx :p
 
@Sheepy You can build some pretty inefficient anything.
But the general case is that well formed regex is faster than well formed DOM manipulation
 
9:10 AM
14
Q: Why is "element.innerHTML+=" bad code?

ajax333221I have been told not to append stuff using element.innerHTML += ... like this: var str = "<div>hello world</div>"; var elm = document.getElementById("targetID"); elm.innerHTML += str; //not a good idea? What is wrong with it?, what other alternatives do I have?

 
@MadaraUchiha True.
 
@RahulDesai That's the worst kind of DOM manipulation.
 
-1
A: What's this jQuery syntax with the "$"?

Bhojendra NepalThe bracket operator is an alias for dot operator in javascript but is more useful when you use variable name. So, targets$[operation](sources$) is same as targets$.operation(sources$) To get full knowledge about this, you may visiit this

Nope.
 
@MadaraUchiha yep!
 
Wow. None of the answers mention insertAdjacentHTML!
 
9:10 AM
> targets$[operation](sources$) is same as targets$.operation(sources$)
 
funny title
 
FFS, that crappy question was re-opened
 
morning
 
Can someone re-close it as dupe of stackoverflow.com/questions/1107220/… ?
 
Not expected from someone with 8k reps!
 
9:12 AM
i deserve more reps
 
Ugh, the answers on there...
And now Shadow Wizard closes it as a completely unrelated dupe...
Way to mess up something that simple
 
> Table rows may be grouped into a table head, table foot, and one or more table body sections, using the THEAD, TFOOT and TBODY elements, respectively. This division enables user agents to support scrolling of table bodies independently of the table head and foot.
THEN WHY IS THIS IMPOSSIBLE
 
@Cerbrus Both your duplicates are wrong.
 
Both?
 
This question actually has absolutely nothing to do with jQuery, nothing to do with name= attributes, and nothing to do with jQuery's $.
 
9:22 AM
A fundamental lack of understanding of JS, first and foremost
 
It's asking about the [] syntax and whether the $ in the target$ variable has any meaning
I don't understand why this got -8 and got so heavily hammered
 
@MadaraUchiha the DOM is really fast, and I didn't check but I bet you 100$ that the browser does .innerHTML = "giantString" faster than React does its diffing.
 
@BenjaminGruenbaum No arguments there.
 
@Zirak what is impossible?
 
So let's keep it open...
Yea
 
9:23 AM
But it isn't the DOM that's the problem
 
@MadaraUchiha because it's a question that can be answered completely by having a quick look at the docs or a basic jQuery tutorial
 
@AwalGarg I want to scroll a tbody without scrolling the thead
 
position: fixed on thead?
 
Regular overflow-y: auto
 
@GNi33: Basix JS tutorial
 
9:24 AM
@GNi33 No, it's a question that stems from misunderstanding the JavaScript syntax and identifier rules.
 
@AwalGarg Breaks layout
 
It's mostly careless DOM manipulation that causes reflows and layouts @BenjaminGruenbaum
Those are the expensive ones
 
@Zirak position: relative on container? if not, then I dunno
 
9:24 AM
@AwalGarg How'd that help anything?
You can't set a height on a tbody
 
position: relative on container fixes the layout breaking thing for me, mostly.
 
And now the OP is trying to correct me...
 
@MadaraUchiha well... yeah
my point still stands
 
It's got nothing to do with jQuery.
 
9:26 AM
Oh, looks like I fudged up a comment.
 
Questions about sizzle selectors can still be answered by the jQuery docs
but yeah, you're right. the //HERE part just shows a lack of knowlegde of basic JS syntax
 
@Zirak I have copy pasted code from stackoverflow.com/a/15307150/3459110 to do exactly this a while ago. (And if you are wondering, yes that is how I write all my CSS)
and it says "position: fixed" so fu :D
 
3 mins ago, by Cerbrus
How about: http://stackoverflow.com/questions/4244896/dynamically-access-object-property-us‌​ing-variable as dupe then?
 
@Cerbrus Doesn't cover the $ in variables question.
 
Hm, can't onebox comments with @name
 
9:28 AM
It's got 2 questions at once here.
 
Because it's 2 questions in 1
And the OP's gotten his answer in comments, regarding $
 
vtc too broad :D
 
// @AwalGarg
table th, table td {
    width: 160px;
}
He basically says to give away on tables being tables and everything's fine
 
oh, he's not even asking about the selectors really... alright, I'll go get some coffee
 
I dunno. It worked for me :/
 
crl
9:30 AM
coffee anan
 
If I start reading and understanding CSS, productivity will blow out.
@argentum47 check hangouts
 
@Abhishrek These are the things you're good for: How do I scroll a tbody without also scrolling the thead, while also not explicitly declaring cell width?
 
crl
you want the thead fixed?
 
Yes
 
crl
there's a position:.. for that
 
9:33 AM
9 mins ago, by Awal Garg
position: fixed on thead?
9 mins ago, by Zirak
@AwalGarg Breaks layout
 
crl
ah
 
6 mins ago, by Awal Garg
@Zirak I have copy pasted code from http://stackoverflow.com/a/15307150/3459110 to do exactly this a while ago. (And if you are wondering, yes that is how I write all my CSS)
 
crl
maybe set it only on scroll
 
4 mins ago, by Zirak
// @AwalGarg
table th, table td {
    width: 160px;
}
4 mins ago, by Zirak
He basically says to give away on tables being tables and everything's fine
 
crl
ok ok :)
 
9:34 AM
zirak sounds frustrated today :D
 
!!> [[],[]] == true;
 
@RahulDesai "false"
 
off to bed
later, guys
 
@RahulDesai I made a new answer to why innerHTML += is bad, with code sample for insertAdjacentHTML that I talked about.
http://stackoverflow.com/a/33995479/893578
Opps. Good night.
 
crl
@Zirak sorry didn't read all, but do you want to just show the thead when it's no longer visible, and make it position:fixed;top; at this moment?
 
9:43 AM
so how shitty is Firefox dev edition?
 
@crl Not precisely. I want to only scroll the tbody.
 
it is my primary browser, I think it is great
 
@AwalGarg is it less shitty than regular FF?
 
Mine too. I don't think it is great, but I fear WebKit unification / assimilation more.
 
yes
 
9:44 AM
Right now there's a height on some ancestor container, so scrolling hides the thead along with some controls and whatnot. I just want to scroll the tbody. Not anything else.
 
regular FF is the worst mainstream browser right now
 
New, SO "Yesterminute" moderation! meta.stackoverflow.com/questions/311427/… Thread deletion quests are handled before you finish writing your question! ( @MadaraUchiha )
 
I would really rather use Safari or Edge
 
I don't think regular FF is shitty either, and that's my opinion ofc.
 
@BartekBanachewicz Hard to say. Globally it has roughly equal share with IE.
 
9:45 AM
hm okay the dev edition at least looks better
 
Meta question was asked 9:41, and the question it's about is deleted 9:40 xD
 
crl
101
Q: HTML table with 100% width, with vertical scroll inside tbody

Marko SHow can I set for <table> 100% width and put only inside <tbody> vertical scroll for some height? HTML: <table> <thead> <tr> <th>Head 1</th> <th>Head 2</th> <th>Head 3</th> <th>Head 4</th> <th>Head 5</th> </tr> </thead> <tbody> <tr> <td>Content 1</td> <td>Content 2<...

 
@BartekBanachewicz You need persona! Hmm I think they call it "theme" now. addons.mozilla.org/en-US/firefox/themes
 
@Sheepy this won't fix those butt-ugly round edges of tabs
 
Hello I have some issue can anyone solve issue code is "ECONNREFUSED"
 
9:47 AM
No. But you can have our cute and lovely Firefox-tan with you always
https://addons.mozilla.org/en-US/firefox/addon/firefox-tan-on-tan-background/
 
@BartekBanachewicz ^ this is how my FF looks
 
@crl The js answer of going display: block and setting th widths by looping over tds is pretty much one of the first things I had in mind.
It's also one of the last things I'll try.
 
@0MV1 Too board. Be more specific.
 
I am calling the webservice from phonegap using ajax and javascript but always get the same error code error ECONNREFUSED
 
@AwalGarg beh ugly ubuntu fonts
 
9:48 AM
1 message moved to Trash can
@0MV1 Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
the dev version looks okay though
dunno I might test it for a while
 
!!tell 0MV1 google phonegap ECONNREFUSED how to solve
 
{
  "code": "ECONNREFUSED",
  "errno": "ECONNREFUSED",
  "syscall": "connect"
}
 
except lmao it's 2015 and they still have a separate search box
 
9:50 AM
Speaking of search box, I love Edge's index page dearly :D
Specifically, how it hides the address bar and put it in the center.
 
default UI of FF and the "enable smooth scrolling" setting is annoying. But the ease of customization balances it out. Also @BartekBanachewicz the url bar works as the search bar as well, just like chrome.
As for the fonts, I like ubuntu's fonts so I have those set. you can change them to whatever you want.
(this is Fedora, btw :P)
 
@AwalGarg except the proprietary ones ofc
 
whatever you have installed
 
@MadaraUchiha: Can mods revert failed audits if the audit was incorrect?
 
@AwalGarg right, I forgot that with linux you don't just get an usable system :P
 
9:53 AM
??
 
@CapricaSix The solution you have given do not solve my problem I have two web service methods and second is exactly the same as first one but first is calling proper but second not and getting error "ECONNREFUSED" please provide other solutions.
 
I'd rather get a good default than a million of config options
 
your "good" default would be annoying for someone else, so if $service wants to cater to everyone, a million config options is often a good choice
 
@BartekBanachewicz That is what Firefox is trying to move towards, from the chromification to the recent great-or-die.
Which includes killing off "heavy theme" which can solve your "butty tab" problem, because "most users don't use it".
 
@AwalGarg this isn't true in practice
 
9:56 AM
explain
 
@AwalGarg look at OSX
 
@crl What's more, this doesn't handle dynamic content
 
@BartekBanachewicz I think it is quite true. I am still annoyed by Firefox removing the option for "always enable context menu".
 
OSX is used by millions of people and yet its customization options are marginal
 
you are underestimating the number of people who passionately hate OSX
 
9:57 AM
fuck them
 
Or the number of sheep.
 
it still has millions of users that don't hate it
 
and millions of them who do
 
@BartekBanachewicz Exactly. Apparently most people love curvy tabs.
 
@AwalGarg well then I guess it only caters its millions of users, not everyone vOv
 
9:58 AM
This discussion is turning really productive :p
 
fine by me
 
@CapricaSix The solution you have given do not solve my problem I have two web service methods and second is exactly the same as first one but first is calling proper but second not and getting error "ECONNREFUSED" please provide other solutions.
 

« first day (1871 days earlier)      last day (3071 days later) »