Why do we use String docType in java? also tell me their advantages? I'm a beginner in servlet now I found that we would have to use in Java for servlet programming like this:  String docType =                 "&lt;!doctype html public \"-//w3c//dtd html 4.0 " +                         "transitional//en\"&gt;\n";   Now I want to know what's the benefit of that to use into programming? And also tell me that using of their advantages...  here is my program that I'm using this.  import java.io.*; import javax.servlet.*; import javax.servlet.http.*;  public class HelloWorld extends HttpServlet{      public void doGet(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException{         response.setContentType("text/html");          PrintWriter out=response.getWriter();         String title="This is just a title and nothing except that..";         String docType =                 "&lt;!doctype html public \"-//w3c//dtd html 4.0 " +                         "transitional//en\"&gt;\n";          out.println(docType+         "&lt;html&gt;"+         "&lt;head&gt;&lt;title&gt;"+         title+         "&lt;/title&gt;&lt;/head&gt;"+         "&lt;body&gt;"+         "&lt;h1 align='center'&gt;"         +title+         "&lt;/h1&gt;"+         "&lt;ul&gt;"+         "&lt;li&gt;"+         "&lt;b&gt;First name: &lt;/b&gt;"+         request.getParameter("first_name")+"&lt;br&gt;"+         "&lt;b&gt;Last name: &lt;/b&gt;"+         request.getParameter("last_name")+         "&lt;/li&gt;"+         "&lt;/ul&gt;"+         "&lt;/body&gt;"         );     } }
What is DOCTYPE? What is DOCTYPE and why do I want to use it? What are the different DOCTYPEs I can use? What is the difference between standards and quirks mode, and what are some quirks I may run into with differently set DOCTYPEs?   Lastly, what is the proper DOCTYPE that I should be using?
What is the average number of times it would it take to roll a fair 6-sided die and get all numbers on the die?  The order in which the numbers appear does not matter.  I had this questions explained to me by a professor (not math professor), but it was not clear in the explanation.  We were given the answer $(1-(\frac56)^n)^6 = .5$ or $n = 12.152$  Can someone please explain this to me, possibly with a link to a general topic? Use of "to lunch" vs."for lunch" Which is right?      I went to the (mall) to meet my parents for lunch / to lunch   This for a paper I am submitting for a writing assignment. I have heard "to lunch" is right, but is it right in this sentence please? How can I securely format a solid-state drive? Man/Tree Symbiosis It was an old book... I'm pretty sure it was a book, and pre-1990's I think. The basic plot was this man somehow interacted with this tree, and as a result he became a carrier of the tree's 'seed'. They were in a symbiotic relationship: the man got a much longer life, more strength, etc.; but when he did die the tree would grow up from his body. The following code helps me validate an XML file with an XSD schema.  XmlReaderSettings settings = new XmlReaderSettings(); settings.Schemas.Add(null, xsdFilePath); settings.ValidationType = ValidationType.Schema; settings.ValidationEventHandler += new System.Xml.Schema.ValidationEventHandler(settings_ValidationEventHandler); XmlDocument document = new XmlDocument(); document.Load(xmlFilePath); XmlReader rdr = XmlReader.Create(new StringReader(document.InnerXml), settings);  while (rdr.Read()) {  } isValid = true;   The ValidationEventHandler also tells me what the errors are, but doesn't tell me on 'where' or 'on which line' they are located. Is there any way to get the line number where the XML fails to be validated? Closure of a Ball is Contained in Closed Ball (usual metric) Let $\overline{B_d (x, r)}$ be the closure of an open ball, and let $\hat B_d (x, r)$ be a closed ball. Show that in any metric space $(X, d)$, $\overline{B_d (x, r)} \subseteq \hat B_d (x, r)$ for all $x \in X$ and $r &gt; 0$.    I used the definition of closure: $\overline{B}$ = $B \bigcup B'$. If $x \in \overline{B}$, then $x \in B$ or $x \in \overline{B}$, or both. If $x \in B$, then clearly $x \in \hat B$ since $B \subseteq \hat B$. But, if $x \in B'$, then $x$ is an accumulation point. Since $\hat B$ is closed, it contains all accumulation points of $B$. Thus, $x \in \hat B$.  Is this approach correct, or at least in the right direction? Should I be using the closure definition, or try another one? Thank you. How can I safely upgrade an Ubuntu installation from one release to another? What should I do before upgrading to ensure it goes smoothly, and is there any clean-up I need to do afterwards?  In particular, do I need to do anything special if I am using packages from PPAs, if I have a graphics card that needs drivers, or if I'm running a custom Linux kernel?  This is a general question , but as example we take Ubuntu 12.04 and Ubuntu 12.10 In linear regression, when is it appropriate to use the log of an independent variable instead of the actual values? Am I looking for a better behaved distribution for the independent variable in question, or to reduce the effect of outliers, or something else? What is the difference between DX format and FX format lenses, and which to choose for what purpose? What is the difference between DX format and FX format lenses, and which to choose for what purpose?  What are the pros and cons of both? How to hide a(n) (NTFS) partition from ubuntu I need to hide an NTFS partition from listing in the nautilus. How can I achieve that?   Is there any tool to do that?   And how can I hide files in ubuntu (except . operator) How can I know which radio button is selected via jQuery? Is it possible to run some code when an assembly is loaded, without doing anything specific in the loading code? What I am looking for is like a static constructor on a type.  Eg:  Assembly A does not know about Assembly B, but B does know about A. Assembly A needs to know certain things about B if B is loaded. When Assembly B is loaded by the runtime (referenced, or explicit), I want a piece of code (static method or attribute) to be executed that calls a method in Assembly A.  The root cause of this problem is unknown types being encountered when serializing a type in A that contains types from B not known at compile time as interfaces are used. Being an aspiring Apple developer, I want to get the opinions of the community if it is better to learn C first before moving into Objective-C and ultimately the Cocoa Framework?  My gut says learn C, which will give me a good foundation. Particle effect showing only on one side of mirrored object I'm trying to create a fur particle effect on sonic the hedgehog, and I'm using weight paints to keep it in the areas I want.   Problem: I can only get the hair effect to show up on certain random areas on model, and only on one side.  I'm using a mirror effect to keep model symmetrical, but hair only shows on one side of the mirror.  I'm new used Blender, so I don't know what all the settings for the particle effects do.  Whats going on and how do I fix it? Badge progress reports Is there a way to view your own progress towards certain badges? For example:   Tumbleweed - What value constitutes low views for a week? Fanatic  – Is there a way to view how many days in a row you currently have? Beta – Is it even possible to get this badge anymore? lstlisting directly after section start removes margin before next section If I place an lstlisting directly after the start of a (sub)section, the margin before the following (sub)section (title) disappears.  Here is a an example document showing the issue:  \documentclass[twocolumn]{article} \usepackage{listings} \begin{document}  \section{Lorem ipsum} Consectetur adipiscing elit.  \begin{lstlisting} Lorem \end{lstlisting}  Sed quis ante nec mi volutpat congue eu id leo.  \section{Dolor sit amet} Suspendisse at lorem mattis, semper massa id, euismod risus.  \newpage  \section{Lorem ipsum} \begin{lstlisting} Lorem \end{lstlisting}  Sed quis ante nec mi volutpat congue eu id leo.  \section{Dolor sit amet} Suspendisse at lorem mattis, semper massa id, euismod risus.  \end{document}   And you can see the (annotated) result here:    Why is there no margin before the fourth section (title)? Is this a bug in my LaTeX environment (MacTeX-2013), or is this the expected behavior? Google search results showing up a URL on its search which doesn't exist on the website I am using a keyword to display a website page on google search. After entering the keyword, on the first page of google, I am redirected to a page, whose domain is exactly similar to the website whose page I want to display, but it is showing a page which doesn't even exist on the domain. Also, as similar domain with spam characteristics is also getting displayed.   To practically demonstrate this issue, do follow the below steps.   Go to  Type dolce streichquartett and click on search. The 4th/5th URL has this link http://www.dolce-streichquartett.de/?high_ry=/casinos/de/spielautomaten-casino-bregenz.php, which is no where on the website and looks like spam The 7th/8th link you see is http://deonlinecasino.org/doc/kostenlos-roulette-spielen-spielgeld-ausdrucken.php, which is exactly similar to the above with the title as the keyword but a different domain.   What is this issue and why is this happening? What is the idiom for "as anyone can see" or "clearly"? I keep wanting to say "the handwriting on the wall," but that's not correct. The place I'm trying to use it is, "Alice likes Bob, Carol likes Bob, Alice thinks Bob likes her, but Bob dates Carol, and so as anyone can see, Bob did not like Alice."  What is the appropriate idiom here? PHP: Return all dates between two dates in an array How do I calculate the CRC32 (Cyclic Redundancy Checksum) of a string in .NET?