In order to use an image as a form's submit button, I have come across two ways and would like to know which one is correct/best-practice.  Version 1:  &lt;button type="submit"&gt;   &lt;img src="mybutton.jpg" alt="Submit" /&gt; &lt;/button&gt;   Version 2:  &lt;input type="image" src="mybutton.jpg" border="0" alt="Submit" /&gt;   I personally feel that the first version is better because it makes semantic sense and has a type of "submit". In the second version its saying the input is of type "image" which doesn't mean much to me as a human.  Which one should I go with?
When looking at most sites (including SO), most of them use:  &lt;input type="button" /&gt;   instead of:  &lt;button&gt;&lt;/button&gt;    What are the main differences between the two, if any? Are there valid reasons to use one instead of the other? Are there valid reasons to use combine them? Does using &lt;button&gt; come with compatibility issues, seeing it is not very widely used?
I had a look at Knuth's The Art of Computer Programming, book 1. In chapter 1, section 1.2.2, exercise 25, he presents the following algorithm for calculating logarithm:  given $x\in[1,2)$, do the following:  L1: [Initialize] Set $y\leftarrow0$, $z\leftarrow x/2$, $k\leftarrow1$.  L2: [Test for end] If $x=1$, stop.  L3: [Compare] If $x-z&lt;1$, go to L5.  L4: [Reduce values] Set $x\leftarrow x-z$, $z\leftarrow x/2^k$, $y\leftarrow y+\log_b(2^k/(2^k-1))$, and go to L2.  L5: [Shift] Set $z\leftarrow z/2$, $k\leftarrow k+1$, and go to L2.  (The algorithm needs an auxiliary table which stores $\log_b2$, $\log_b(4/3)$, and so on, to as many values as the precision of the computer.  Then Knuth concludes: this exercise is to explain why the above algorithm will terminate and why it computes an approximation of $y=\log_b x$.  Well, I see that it works, but I am not able to explain why... Separate and visually indicate reversed events from the day's reputation changes We've been getting a lot of questions  ever since the feature to see event reversals such as deleted posts and serial voting was added into the reputation history; and their confusion is legitimate. Even well-respected users have become confused by that number above the day. It should display the reputation changes for that day. I propose that reversal events such as these be visually separated from the main events for that day and not included in the total reputation change for that day. After all, their reputation isn't actually changing for that day, but reversing changes from previous days. These events already seem to get bumped down to the bottom of the events for the day, why not add a simple separator between them? Events indicating reversals    Events which have been reversed     Perhaps a second, smaller number could be added next to the main one to indicate that other events took place on that day, but I feel most users who really care will have noticed or went looking for the events anyways. However, including them in the actual change only serves to confuse people. What is the formula for Real vs Apparent Depth, when not looking perpendicular to the interface?   I know the formula $$\frac{\text{real depth}}{\text{apparent depth}}=n$$   but I'm not looking for this. Multiple citations: citation order different to bibliography order I wish to cite several sources at once and sort my in-text citations in a different manner to how they appear in my bibliography. I want my citations to be sorted by year and my bibliography to be sorted by author. I am using BibLaTeX with Biber. I used  to achieve this with TeX Live 2015 but since upgrading to 2016 (as well as upgrading all my packages) this does not work.  Below is a minimal working example (with a second bibliography for illustrative purposes). I wish for the citations to be sorted ascending by year (2001, 2002, 2003) and the bibliographies to be sorted alphabetically (a, b, c) and descending by year (2003, 2002, 2001) respectively, but below is an image of the result; the bibliographies stay true to the desired sorting but the citations in-text are sorted descending by year.  If I remove the last \newrefcontext then everything (citations and bibliographies) is sorted alphabetically, and if I remove both \newrefcontexts then everything is sorted ascending by year (which was the option specified when originally calling BibLaTeX). It seems that the citations follow the last sorting referenced; ynt as per BibLaTeX options when both \newrefcontexts are removed or else whatever sorting is specified in the last \newrefcontext.  I am compiling in order pdflatex, biber, pdflatex, pdflatex and am on MacTeX.  It seems this would have worked as desired in TeX Live 2015 so is this a bug or has something changed which requires the citation sorting to be set in some other way?  \documentclass{article}  \usepackage[            backend=biber,            style=authoryear,            sorting=ynt,            sortcites,            ]{biblatex}  \usepackage{filecontents} \begin{filecontents}{lib.bib} @article{test1,   author = {b},   title = {b},   year=2003, } @article{test2,   author = {c},   title = {c},   year=2001, } @article{test3,   author = {a},   title = {a},   year=2002, } \end{filecontents}  \addbibresource{lib.bib}  \begin{document}      Hello World! \parencite{test1,test2,test3}      \newrefcontext[sorting=nyt]     \printbibliography      \newrefcontext[sorting=ydnt]     \printbibliography  \end{document}     Edit  I have a workaround but it's super crap: Typeset the document with global sorting=ynt, copy the pdf to another file, then typeset the document with global sorting=nyt; using a PDF editing tool (Apple's Preview suffices) cut the pages containing the bibliography with the desired sorting from one PDF and paste into the other. As I said super crap. I'm not sure if I'd even do this as I'd feel dirty, but it's a workaround nonetheless.  If a solution does not exist or this is a bug without a patch, then what would be similar but much better would be some kind of package (which probably doesn't exist) which only changes certain pages at a time within the PDF (while still actually 'compiling' the whole document so that all the citations are done). It might look something like:  % document preamble % ...  \usepackage{onlychange} \onlychangerange{10,12}  % Bibliography found on pages 10--12 % On next compilation will typeset all pages except 10--12  % ...   It's a long shot but maybe someone knows of such a package or this rambling has inspired an actual solution. Can anyone help me with this limit problem without L'Hopital rule and Taylor series? $$\lim_{x\rightarrow\ -\infty}\left(-2\frac{\arctan(x)}{\pi}\right)^x$$ I know on client side (javascript) you can use windows.location.hash but could not find anyway to access from the server side. I'm using asp.net. I am installing an overhead automatic garage door opener. My only power source close to where I will be hanging the motor is an overhead light socket that is operated by a switch on the wall next to the house entry door.   I wanted to know if it is possible to rewire the light socket with a standard electrical plug outlet AND to remove the switch &amp; wire it to provide constant power to the new outlet. The overhead light is on my 15A garage GFI circuit &amp; the opener lists 120V/6A as its power requirements.  I live in the US. Why is the company email still "at stackoverflow" Strip whitespace from jsp output How can I strip out extra whitespace from jsp pages' output?  Is there a switch I can flip on my web.xml?  Is there a Tomcat specific setting? We were trying to come up with an easy way to generate a rational number in between two existing rational numbers with a fairly low numerator and denominator (the way we were doing this earlier was to find the average of the two rationals, but that results in a denominator of up to $c * d$. Does this inequality hold for all values of $a, b, c, d$? The PHB states: "A familiar can’t attack, but it can take other actions as normal."  What can a familiar do? Can it use a potion of healing on a character? Can it drop caltrops? How to change XML Attribute How can I change an attribute of an element in an XML file, using C#? I'm trying to prove the following statements.  Let $G$ be a finite abelian group $G = \{a_{1}, a_{2}, ..., a_{n}\}$.   If there is no element $x \neq e$ in $G$ such that $x = x^{-1}$, then $a_{1}a_{2} \cdot \cdot \cdot a_{n} = e$.   Since the only element in $G$ that is an inverse of itself is the identity element $e$, for every other element $k$, it must have an inverse $a_{k}^{-1} = a_{j}$ where $k \neq j$. Thus $a_{1}a_{1}^{-1}a_{2}a_{2}^{-1} \cdot \cdot \cdot a_{n}a_{n}^{-1} = e$.   If there is exactly one $x \neq e$ in $G$ such that $x = x^{-1}$, then $a_{1}a_{2} \cdot \cdot \cdot a_{n} = x$.   This is stating that $x$ is not the identity element but is its own inverse. Then every other element $p$ must also have an inverse $a_{p}^{-1} = a_{w}$ where $p \neq w$. Similarly to the first question, a rearrangement can be done: $a_{1}a_{1}^{-1}a_{2}a_{2}^{-1} \cdot \cdot \cdot xx^{-1} \cdot \cdot \cdot  a_{n}a_{n}^{-1} = xx^{-1} = e$. And this is where I am stuck since I proved another statement.    Any comments would be appreciated for both problems. Using Apex Managed Sharing to share an opportunity Here's the use case. When a lead is converted to an Opportunity, I want to automatically share the opportunity with the previous owner of the lead. This is needed because upon conversion, the opportunity ownership is granted to someone else but the original lead owner needs ongoing access to the opportunity.  So:   A partner submits/creates a lead and is the lead owner Lead is converted to opportunity and internal sales person gains ownership Original partner needs to have view/edit access on this opportunity   I know you can use Apex Managed Sharing to share a custom object, but I'm hitting a wall trying to do this with an opportunity since the fields in OpportunityShare are not writable. The following won't even compile as a result:  List&lt;OpportunityShare&gt; oppShares = new List&lt;OpportunityShare&gt;(); for(Id i : oppIds) {    OpportunityShare os = new OpportunityShare(OpportunityId = i);    os.OpportunityId = i; // *** ERROR - not writable ***    os.OpportunityAccessLevel = 'Read/Write';    os.UserOrGroupId = oppIdToLead.get(i).OwnerId;    os.RowCause = 'Manual Sharing';    oppShares.add(os); }  Database.SaveResult[] result = Database.insert(oppShares, false); It was suggested that I should get myself a polarizer filter to get over my reflection problem. (  )  I found out that a Nikon 52mm Circular Polarizing Filter CPL   while I can get another filter for less than half the price — . (Please note that I know nothing about these filters and googled them just for the example.)  What is the difference between polarizer filters?  I need to remove the glare and nothing else — would either of the two do the magic for me? What filter do you recommend for me? Safari can load internet but none of the other apps cannot! This is by far the weirdest problem I've come across,  My mac can perfectly access internet through safari web browser, but when I tried to do   ping www.google.com   through the terminal, it's requests is being timed out.  None of the other apps are able to reach internet either. Dropbox, Skype, Spotify all showing offline, except the browser itself  I'm guessing something bad with the DNS, but spend 2 hours trying to fix this with no luck I have a class like this:  public class myClass {   public List&lt;myOtherClass&gt; anewlist = new List&lt;myOtherClass&gt;;    public void addToList(myOtherClass tmp)   {     anewList.Add(tmp);   }  }   So I call "addToList" a hundred times, each adding a unique item to the list.  I've tested my items to show that before I run the "addToList" method, they are unique.  I even put a line in to test "tmp" to make sure it was what I was expecting.  However, when I do this (lets say myClass object is called tmpClass):  int i = tmpClass.anewList.Count(); for (int j = 0; j&lt;i; j++) {    //write out each member of the list based on index j... }   I get the same exact item, and it's the last one that was written into my list.  It's as if when I add, I'm overwriting the entire list with the last item I've added.    Help?  This makes no sense. I've also tried List.Insert, where I'm always inserting at the end or at index 0.  Still no dice.  Yes, I'm doubly source my indexing is correct and when I do my test I'm indexing through each of the elements.  :)  UPDATE: Okay, I tried this and still had the same problem:  foreach(myOtherClass tmpC in tmpClass.anewList) {         Console.WriteLine(tmpC.theStringInMyClass.ToString()); }   and still for each of the 100 items, I got the same string output... I'm sure I'm doing something completely stupid, but I don't know what yet. I'm still 100% sure that the right string is getting passed in to begin with.  -Adeena    Okay, I tried this and still had the same problem:  foreach(myOtherClass tmpC in tmpClass.anewList) {     Console.WriteLine(tmpC.theStringInMyClass.ToString()); }   and still for each of the 100 items, I got the same string output...  I'm sure I'm doing something completely stupid, but I don't know what yet. I'm still 100% sure that the right string is getting passed in to begin with.  -Adeena How to merge cells vertically Is it possible to create a table like this one?    The usual structure of tables I use looks like this:  \begin{table}[H]     \begin{adjustbox}{width=\textwidth,center}     % \begin{adjustbox}{center}         \begin{tabular}{lll}             \hline             \multicolumn{1}{l}{\head{XXX}} &amp; \multicolumn{1}{l}{\head{XXX}} &amp; \multicolumn{1}{l}{\head{XXX}} \\             \hline             \ttfamily xxx &amp; \ttfamily xxx &amp; \ttfamily xxx \\             \hline         \end{tabular}     \end{adjustbox}     \vspace{ - 05 mm}     \caption{xxx}     \label{tab:xxx} \end{table} Pointwise convergent and total variation I'm preparing for a test for real analysis and I came across this problem in Royden's book:  Let $\{f_n\}$ be a sequence of real valued functions on $[a,b]$ that converges pointwisely on $[a,b]$ to the real valued function $f$. Show that $TV(f) \leq \liminf  ~TV(f_n)?$  This looks quite similar in form to Fatou's Lemma to me, but can't find any way to establish TV with integration, can anybody please help?  (TV is short for total variation) I was wondering if it is possible to get a link to a rigorous proof that  $$\displaystyle \lim_{n\to\infty} \left(1+\frac {x}{n}\right)^n=\exp x$$