For a typed ArrayList list&lt;E&gt; , why isn't remove method is like  public boolean remove(E e) { }   remove() and contains() method takes Object o as parameter. while add() takes E. There is a likelihood someone can call remove() with different object type and get Runtime Error.
Why isn't  generic?    Seems like Collection&lt;E&gt; could have boolean remove(E o);   Then, when you accidentally try to remove (for example) Set&lt;String&gt; instead of each individual String from a Collection&lt;String&gt;, it would be a compile time error instead of a debugging problem later.
Monty hall problem extended. Chromatic Number The smallest number of colors needed to color a graph $G$ is called its chromatic number, and is often denoted $\chi(G)$.  Show that if graph $G$ is simple, then $$ \chi \ge \frac{V^2}{V^2 - 2E}. $$ How can I use function's parameter in it? How can one format a cell to have word wrap in Google Sheets?  I've tried Shift+Enter, but that doesn't seem to work.  One thing I know works is to place  and then if you edit your cell you can have word wrap in it.  But is there a way to do this without switching modes? Can I insert an image into an equation? I would like to use a small image in an equation, where a symbol like \alpha might otherwise be. Is there a nice way to do this? Imagine you're teaching a first course on quantum mechanics in which your students are well-versed in classical mechanics, but have never seen any quantum before.  How would you motivate the subject and convince your students that in fact classical mechanics cannot explain the real world and that quantum mechanics, given your knowledge of classical mechanics, is the most obvious alternative to try?  If you sit down and think about it, the idea that the state of a system, instead of being specified by the finitely many particles' position and momentum, is now described by an element of some abstract (rigged) Hilbert space and that the observables correspond to self-adjoint operators on the space of states is not at all obvious.  Why should this be the case, or at least, why might we expect this to be the case?   Then there is the issue of measurement which is even more difficult to motivate.  In the usual formulation of quantum mechanics, we assume that, given a state $|\psi \rangle$ and an observable $A$, the probability of measuring a value between $a$ and $a+da$ is given by $|\langle a|\psi \rangle |^2da$ (and furthermore, if $a$ is not an eigenvalue of $A$, then the probability of measuring a value in this interval is $0$).  How would you convince your students that this had to be the case?  I have thought about this question of motivation for a couple of years now, and so far, the only answers I've come up with are incomplete, not entirely satisfactory, and seem to be much more non-trivial than I feel they should be.  So, what do you guys think?  Can you motivate the usual formulation of quantum mechanics using only classical mechanics and minimal appeal to experimental results?  Note that, at some point, you will have to make reference to experiment.  After all, this is the reason why we needed to develop quantum mechanics.  In principle, we could just say "The Born Rule is true because its experimentally verified.", but I find this particularly unsatisfying.  I think we can do better.  Thus, I would ask that when you do invoke the results of an experiment, you do so to only justify fundamental truths, by which I mean something that can not itself just be explained in terms of more theory.  You might say that my conjecture is that the Born Rule is not a fundamental truth in this sense, but can instead be explained by more fundamental theory, which itself is justified via experiment.  Edit:  To clarify, I will try to make use of a much simpler example.  In an ideal gas, if you fix the volume, then the temperature is proportional to pressure.  So we may ask "Why?".  You could say "Well, because experiment.", or alternatively you could say "It is a trivial corollary of the ideal gas law.".  If you choose the latter, you can then ask why that is true.  Once again, you can just say "Because experiment." or you could try to prove it using more fundamental physical truths (using the kinetic theory of gases, for example).  The objective, then, is to come up with the most fundamental physical truths, prove everything else we know in terms of those, and then verify the fundamental physical truths via experiment.  And in this particular case, the objective is to do this with quantum mechanics. How do I get current date/time on the Windows command line in a suitable format for usage in a file/folder name? Update: Now that it's 2016 I'd use PowerShell for this unless there's a really compelling backwards-compatible reason for it, particularly because of the regional settings issue with using date. See @npocmaka's     What's a Windows command line statement(s) I can use to get the current datetime in a format that I can put into a filename?  I want to have a .bat file that zips up a directory into an archive with the current date and time as part of the name, for example, Code_2008-10-14_2257.zip. Is there any easy way I can do this, independent of the regional settings of the machine?  I don't really mind about the date format, ideally it'd be yyyy-mm-dd, but anything simple is fine.  So far I've got this, which on my machine gives me Tue_10_14_2008_230050_91:  rem Get the datetime in a format that can go in a filename. set _my_datetime=%date%_%time% set _my_datetime=%_my_datetime: =_% set _my_datetime=%_my_datetime::=% set _my_datetime=%_my_datetime:/=_% set _my_datetime=%_my_datetime:.=_%  rem Now use the timestamp by in a new ZIP file name. "d:\Program Files\7-Zip\7z.exe" a -r Code_%_my_datetime%.zip Code   I can live with this, but it seems a bit clunky. Ideally it'd be briefer and have the format mentioned earlier.  I'm using Windows Server 2003 and Windows&nbsp;XP Professional. I don't want to install additional utilities to achieve this (although I realise there are some that will do nice date formatting). How does Windows 7 licensing work for running the OS as Virtual Machines? I plan on buying Windows 7 Ultimate Edition to run on an old Pentium 4. I also want to run Windows 7 virtual machines inside Windows 7. My question is two fold:   Do I need a license for each Virtual Machine? Does the answer change if I use a third party virtualization platform (e.g. , , , etc) as opposed to ? How can I change the default date format? When I paste a date into Excel 2010 in the format "2012-12-07 00:00:00.000" I'd like it to be displayed by default as "2012-12-07", but it is actually displayed as "00:00.0".   I know I can work around this by prepending a ' or changing the cell format, but I'm interested in changing the default format.  An approach that almost works is going to Control Panel->Region and Language->Long Time format and changing it to something like "h". This results in Excel displaying the dates I paste in as "2012-12-07 00:00:00.000", but screws up times displayed outside of Excel.  The dates I'm pasting in are from SQL Server. Read from location on console C# When can you build up all representations from the fundamental and antifundamental ones? Under what conditions can you determine all representations of a Lie algebra from the fundamental and antifundamental ones using just the tensor product, direct sum and Clebsch-Gordan decomposition? I think this is true for $\mathfrak{su}(2)$ and $\mathfrak{sl}(2,\mathbb{C})$, or at least that's what physics books lead me to believe!   Is it true in general for semisimple Lie algebras? Subdivision Surface on curved mesh I'm trying to delete those ugly lines visible in the cylindrical shape of the lens. What is causing them is the added edge loops I made for the protruding detail with the switch. The problem is that if I delete those edges, it'll look even worse because of the n-gons. Any ideas? How to find the limit of a sequence? Question:  If $0 &lt; x &lt; \frac{\pi}{2}$ and $f_k(x) = \tan(x)+\frac{1}{2}\tan(x/2)+ ...+\frac{1}{2^k}\tan(x/2^k)$.  In Sigma Notation: $$f_k(x) = \sum_{n=0}^k \frac{1}{2^n}\tan\frac{x}{2^n}$$  Find $$\lim_{k\to \infty}f_k(x)$$  I'm not quite sure how to take the limit of a sequence, I've never seen this before, If someone could help me solve this it would be greatly appreciated. How to solve $\frac 1{1.2.3}+\frac 1{2.3.4}+\frac 1{3.4.5}+...$ As my question says,   $$\frac 1{1.2.3}+\frac 1{2.3.4}+\frac 1{3.4.5}+...$$  As far as $\frac 1{1.2}+\frac 1{2.3}+\frac 1{3.4}+...$ is concerned, we can write it as $\frac 1{n-1} - \frac 1{n}$ What can we do here? Worldwide Dissertation Database? or French, German, Italian ones? Is there a global/worldwide database of dissertations? If not, how can I access French, German, Italian, etc. dissertations online? I am trying to classify using randomForest classification in GEE . However, I always get the error User memory limit exceeded, so I assume the number  of the feature are too large. Nevertheless, I saw many developers can classify even bigger dataset, so I am wondering if there is a better option there? The code can be accessed via  var fire= ee.FeatureCollection('users/spatola/recovery_rf_1712').map(function(feature){     var num = ee.Number.parse(feature.get('CLC_311'));     return feature.set('CLC_311', num);   }) var indices= ['EVI_mean','Dnbr','NBR2_mean','NBR2_min','NBR2_max','EVI_min','EVI_max']; var fire1=  fire.filter(ee.Filter.notNull(indices)); var fire2= fire1.select('Class_R','Dnbr','EVI_max','NBR2_max','imageId') var bands= ['NBR2_max', 'EVI_max']; var classProperty= 'Class_R'; var random= fire2.randomColumn('random'); var split_train= 0.8; var split_test= 0.2; var trainPartition= random.filter(ee.Filter.lt('random',split_train)); var testPartition= random.filter(ee.Filter.gte('random',split_test));  var RFtrained_c= ee.Classifier.smileRandomForest({  numberOfTrees: 100,  minLeafPopulation:2,  seed: 123,  }) .setOutputMode('CLASSIFICATION') .train({     features: trainPartition,     inputProperties: bands,     classProperty: classProperty,     }) print(RFtrained_c); var dict =  RFtrained_c.explain(); var test = testPartition.classify(RFtrained_c) print(test.first()) Add time restriction in ArcGIS Network Analyst I am a student who has taken the basic calculus courses but I am working through Calculus (the fourth edition) by Spivak in my spare time in order to both review the material and to gain a more rigorous understanding of the concepts. I am currently in Chapter 8 where he supplies a proof of the basis of the Intermediate Value Theorem, Theorem 7-1 (pp. 135-136 of the fourth edition). It seems mostly straightforward but I think there is some nuance of it that I don't grasp.  I am including in this post the statement Theorem 6-3 since he references it in the proof of Theorem 7-1 as well as part of Theorem 7-1 itself.     Theorem 6-3 Suppose $f$ is continuous at $a$, and $f(a) &gt; 0$. Then $f(x) &gt; 0$ for all $x$ in some interval containing $a$; more precisely, there is a number $\delta &gt; 0$ such that $f(x) &gt; 0$ for all $x$ satisfying $|x-a| &lt; \delta$. Similarly, if $f(a) &lt; 0$, then there is a number $\delta &gt; 0$ such that $f(x) &lt; 0$ for all $x$ satisfying $|x-a| &lt; \delta$.     Problem 6-16 is also referenced. However,it is the same thing as Theorem 6-3 for one-sided limits. The following proof is the Theorem 7-1 up through the paragraph which I don't fully understand.     Theorem 7-1: If $f$ is continuous on $[a,b]$ and $f(a) &lt; 0 &lt; f(b)$, then there is some number $z$ in $[a,b]$ such that $f(x) = 0$.  Proof: Define the set $A$ as follows:  $$A = \{x : a \le x\le b, \mbox{ and } f \mbox{ is negative on the interval } [a,x] \}.$$  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Clearly $A \ne \emptyset$, since $a$ is in $A$; in fact, there is some $\delta &gt; 0$ such that $A$ contains all points $x$ satisfying $a \le x &lt; a + \delta$; this follows from Problem 6-16, since $f$ is continuous on $[a,b]$ and $f(a)&lt;0$. Similarly, $b$ is an upper bound for $A$ and, in fact, there is a $\delta &gt; 0$ such that all points $x$ satisfying $b-\delta &lt; x \le b$ are upper bounds for $A$; this also follows from Problem 6-16, since $f(b) &gt; 0$. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; From these remarks it follows that $A$ has a least upper bound $\alpha$ and that $a &lt; \alpha &lt; b$. We now wish to show that $f(\alpha) = 0$, by eliminating the possibilities $f(\alpha) &lt; 0$ and $f(\alpha) &gt; 0$. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Suppose first that $f(\alpha) &lt; 0$. By Theorem 6-3, there is a $\delta &gt; 0$ such that $f(x) &lt; 0$ for $\alpha - \delta &lt; x &lt; \alpha + \delta$. Now there is some number $x_0$ in $A$ which satisfies $\alpha - \delta &lt; x_0 &lt; \alpha$ (because otherwise $\alpha$ would not be the least upper bound of $A$). This means that $f$ is negative on the whole interval $[a,x_0]$. But if $x_1$ is a number between $\alpha$ and $\alpha+\delta$, then $f$ is also negative on the whole interval $[x_0,x_1]$. Therefore $f$ is negative on the interval $[a,x_1]$, so $x_1$ is in $A$. But this contradicts the fact that $\alpha$ is an upper bound for $A$; our original assumption that $f(\alpha) &lt; 0$ must be false.    The point I don't understand is in the final paragraph of the excerpt. Why does Spivak split the interval $[a,b]$ up into the subintervals $\lbrack a,x_0 \rbrack$ and $[x_0,x_1]$? Isn't it true that, because $\alpha$ is a least upper bound of $A$ and $f$ is continuous on $[a,b]$, it must be true that if $a \le x &lt; \alpha$ then $f(x)&lt;0$? I understand the need to pick out the $x_1$ but not the $x_0$. Especially perplexing is the statement "there is some number $x_0$ in $A$ which satisfies $\alpha - \delta &lt; x_0 &lt; \alpha$ (because otherwise $\alpha$ would not be the least upper bound of $A$." Wouldn't it be true that if there were some $x_0$ such that $a \le x_0 &lt; \alpha$ and $f(x_0) \ge 0$ that $x_0$ would be an upper bound for $A$, contradicting that $\alpha$ is the least upper bound of $A$?  Thanks for any help. Lower Semicontinuity Concepts Prove $\sum\limits_{i=0}^n\binom{i+k-1}{k-1}=\binom{n+k}{k}$ (a.k.a. Hockey-Stick Identity) Let $n$ be a nonnegative integer, and $k$ a positive integer. Could someone explain to me why the identity $$ \sum_{i=0}^n\binom{i+k-1}{k-1}=\binom{n+k}{k} $$ holds?