I have this class:  public class TestSubject {     public TestSubject(List&lt;Integer&gt; list) {     } }   I'm instantiating it like this and somehow it's working, even though I'm inserting an ArrayList&lt;String&gt; into a constructor that accepts List&lt;Integer&gt;:  List&lt;String&gt; strings = new ArrayList&lt;&gt;(); strings.add("foo"); Constructor&lt;TestSubject&gt; constructor = TestSubject.class.getConstructor(List.class); TestSubject test = constructor.newInstance(strings);   This is what I see after instantiation:    How can this be possible?  Also, how can I make sure from the instantiation code that the correct type of list is being used?
I read about Java's type erasure .  When does type erasure occur? At compile time or runtime? When the class is loaded? When the class is instantiated?  A lot of sites (including the official tutorial mentioned above) say type erasure occurs at compile time. If the type information is completely removed at compile time, how does the JDK check type compatibility when a method using generics is invoked with no type information or wrong type information?  Consider the following example: Say class A has a method, empty(Box&lt;?&nbsp;extends&nbsp;Number&gt;&nbsp;b). We compile A.java and get the class file A.class.  public class A {     public static void empty(Box&lt;? extends Number&gt; b) {} }     public class Box&lt;T&gt; {}   Now we create another class B which invokes the method empty with a non-parameterized argument (raw type): empty(new Box()). If we compile B.java with A.class in the classpath, javac is smart enough to raise a warning. So A.class has some type information stored in it.  public class B {     public static void invoke() {         // java: unchecked method invocation:         //  method empty in class A is applied to given types         //  required: Box&lt;? extends java.lang.Number&gt;         //  found:    Box         // java: unchecked conversion         //  required: Box&lt;? extends java.lang.Number&gt;         //  found:    Box         A.empty(new Box());     } }   My guess would be that type erasure occurs when the class is loaded, but it is just a guess. So when does it happen?
Prove that $a^{2^n}=1 \mod 2^{n+2}$ I would like to prove that  $$a^{2^n}\equiv 1 \pmod {2^{n+2}}$$  I tried induction but could not get it.  Thank you very much! How can I change GNOME Shell theme? I've installed the GNOME Shell in Ubuntu 12.04 and I want to change the "Shell Theme", But it doesn't allow me to do that.  The alert says something like: "The GNOME-Shell extension is not activated", and I want to install it with the console, But it returns me an error.  How can I solve this problem? How to avoid messages from applications which I ran with a &? I ran dolphin like this:  dolphin . &amp;   I see messages in the console like these:  QPixmap::scaled: Pixmap is a null pixmap   How can I keep the console clean or silent? Some text lines are italicized with no spaces between words How to use SQLDeveloper to connect to embedded Derby database Enqueue Stylesheets After Theme's "rtl.css" I am currently developing a theme with internationalization support, and would like to load stylesheets after my theme's rtl.css (an alternative style.css loaded for languages with a right-to-left reading order).  I am familiar with enqueueing my stylesheets and controlling their load order with dependencies using the wp_register_style() and wp_enqueue_style() functions, however rtl.css is loaded automatically by WordPress whenever the locale's language direction is rtl, and there doesn't seem to be a way to specify the stylesheet as a dependency.  I know I can conditionally enqueue stylesheets using the is_rtl() function, however  these stylesheets' &lt;link&gt; elements are still printed out before WordPress automatically prints rtl.css's. I could also simply manually insert &lt;link&gt;s to the stylesheets that I wish to depend on rtl.css right after the call to wp_head() in my theme's header.php file, but I believe it's bad practice to do so, and I would like my theme to be commercial quality.  How can I load stylesheets after WordPress loads rtl.css? It is possible to find an efficient algorithm for constructing a provably hard to factor number $N$, together with a witness that shows that it is indeed hard to factor. EDIT, since it was not clear: I also want to be sure that even the person that constructed the number cannot factor it.  Of course, a random large enough integer is going to be hard to factor with high probability, but we might be unlucky.  There are also multi-party protocols for shared generation of RSA moduli (such as ), but I would like a non interactive technique.  Motivation: This was suggested by Poncho's answer to in QGis 1.8 were lots of predefined coordinate systems (national projections). Where have they all gone in qgis 2.0? I specifically need the Gauß-Krüger-Projections Zone 1 to 5.  Is there any plugin to load those coordinate systems? I received a table template, which I'm intended to generate dynamically with data using Java. But when the table becomes to large, the compilation with LaTeX fails. The specific about this template is, that it stretches the table width into the maximal page width and has same column widths for all data columns (except the first column).  Here is a minimal version of the full template, that still works fine:  \documentclass[final,authoryear,3p,twocolumn]{elsarticle}  \usepackage{amssymb,amsmath} \usepackage{calc} \usepackage{array} \newcolumntype{L}[1]{&gt;{\raggedright\arraybackslash}p{#1}} \newcolumntype{R}[1]{&gt;{\raggedleft\arraybackslash}p{#1}} \usepackage{eurosym} \usepackage{microtype} \usepackage{needspace} \usepackage{fp}  \usepackage{graphicx} \DeclareGraphicsExtensions{.pdf} \input{pgfexternal}  \newcommand\tabt{\rule{0pt}{2.6ex}} \newcommand\tabb{\rule[-1.2ex]{0pt}{0pt}}  \begin{document}  \begin{table*}[t]     \footnotesize     \begin{tabular*}{\linewidth}{@{}L{2em}@{}*9{R{(\linewidth-2em)/9}@{}}}\hline\tabt $i$ &amp; $1$ &amp; $2$ &amp; $3$ &amp; $4$ &amp; $5$ &amp; $6$ &amp; $7$ &amp; $8$ &amp; $9$\tabb\tabularnewline\hline\tabt $1$ &amp;  &amp; $48.87$ &amp; $0.01$ &amp; $0.05$ &amp; $1.23$ &amp; $0.00$ &amp; $0.20$ &amp; $5.67$ &amp; $2.35$\tabularnewline     \end{tabular*} \end{table*}  \end{document}   But when extending this example by another column, so that the table would look like the following example, it fails:  \begin{table*}[t]     \footnotesize     \begin{tabular*}{\linewidth}{@{}L{2em}@{}*10{R{(\linewidth-2em)/10}@{}}}\hline\tabt $i$ &amp; $1$ &amp; $2$ &amp; $3$ &amp; $4$ &amp; $5$ &amp; $6$ &amp; $7$ &amp; $8$ &amp; $9$ &amp; a\tabb\tabularnewline\hline\tabt $1$ &amp;  &amp; $48.87$ &amp; $0.01$ &amp; $0.05$ &amp; $1.23$ &amp; $0.00$ &amp; $0.20$ &amp; $5.67$ &amp; $2.35$ &amp; b\tabularnewline     \end{tabular*} \end{table*}   This fails, no matter how many columns I add. So far, it seems for me to be a problem with the division by 10. May it be, that LaTeX isn't able to handle that properly by default? How can I solve this problem and make even larger tables work using this template. Or is that to any other problem I don't see yet? Thanks for any help! How can I monitor my Samba traffic? Do we know anything about Aragorn's first time in Moria? When the Company is forced to abandon their attempt to cross the Misty Mountains via the Redhorn Gate (the pass of Caradhras), Gandalf proposes they go "neither over the mountains, nor round them, but under them," via Moria. During the debate Aragorn remarks:     "I too once passed the Dirmrill Gate but though I also came out again, the memory is very evil. I do not wish to enter Moria a second time."    I haven't read much beyond the LOTR trilogy other than The Silmarillion. Does Tolkien ever describe Aragorn's first visit to Moria anywhere? Can I programmatically open the devtools from a Google Chrome extension? What is the derivative of this? I have a function of the following form:  $J = \|W^TW-I\|_F^2$   Where, $W$ is a matrix and $F$ is the Frobenius Norm.  How can I find the derivative of $\frac{\partial J}{\partial W}$ ? Writing string at the same position using Console.Write in C# 2.0 I have a console application project in C# 2.0 that needs to write something to the screen in a while loop. I do not want the screen to scroll because using Console.Write or Console.Writeline method will keep displaying text on console screen incremently and thus it starts scrolling.  I want to have the string written at the same position. How can i do this?  Thanks Suppose that $f:[0,\infty)\rightarrow\mathbb{R}$ is continuous. Is it true that   $$\int_{0}^\infty|f(t)|dt&lt;\infty\Rightarrow \lim_{t\rightarrow\infty}f(t)=0?$$  If so can you provide a proof, otherwise a counter example. Thank you. It's my understanding that the phrase "Winter is Coming" is the motto of the Stark house, when the story first reaches the wall it's implied that the winter is not a periodic season like it is in our world.  Does the winter refer to a particularly severe season or does a winter only occur every few years? Is there any Stack Exchange site where I can ask others to recommend me good web sites for solving specific problems?  For example I would like to know if there is any URL shortening website that can allow me to define the url.  For example instead of http://bit.ly/1gX2dD0 I would like it to be http://bit.ly/superflow - if "superflow" is not available then I will invent another word.  I can imagine that such services are paid but I don't need the link to last more than one day, and maybe there is such a website. proving the inequality $\triangle\leq \frac{1}{4}\sqrt{(a+b+c)\cdot abc}$ Duplicate explanation should encourage improvement of original The new closed-as-duplicate banner says:     This question has been asked before and already has an answer. If those answers do not fully address your question, please .   I think it should instead say     This question has been asked before and already has an answer. If answers there do not fully address your question, please  or  to the pre-existing one.   &mdash; to discourage re-re-asking the same question. (I also changed "those answers", which has no plural , to "answers there", which doesn't need one.)    As of September 19, 2013, the original text quoted above has returned here. My friend and I have been wracking our heads with this one for the past 3 hours... We have 2 point masses, $m$ and $M$ in a perfect world separated by radius r.  Starting from rest, they both begin to accelerate towards each other. So we have the gravitational force between them as:  $$F_g ~=~ G\frac{Mm}{r^2}$$  How do we find out at what time they will collide?  What we're having trouble with is this function being a function of $r$, but I have suspected it as actually a function of $t$ due to the units of $G$ being $N(m/kg)^2$.  I've tried taking a number of integrals, which haven't really yielded anything useful.  Any guidance?  No, this is not an actual homework problem, we're just 2 math/physics/computer people who are very bored at work :)