Hashset and List :Which one is efficient way to store list of objects Which one of the folowing is efficient way to store list of objects?   Hashset&lt;object&gt; listOfObjects = new HashSet&lt;object&gt;();   or  List&lt;object&gt;listOfObjects = new List&lt;object&gt;();
HashSet vs. List performance It's clear that a search performance of the generic HashSet&lt;T&gt; class is higher than of the generic List&lt;T&gt; class. Just compare the hash-based key with the linear approach in the List&lt;T&gt; class.  However calculating a hash key may itself take some CPU cycles, so for a small amount of items the linear search can be a real alternative to the HashSet&lt;T&gt;.  My question: where is the break-even?  To simplify the scenario (and to be fair) let's assume that the List&lt;T&gt; class uses the element's Equals() method to identify an item.
unable to reset root password of mysql Why 32bits OSs can't address more than 3.2/3.2 gb of memory? Don't know if this is the right place to ask this question.  I've been reading that 32bit OSs (like the Ubuntu i'm running right now) can't adress more than 3.2gb or 3.3gb of RAM memory.  I remember for my old Computer Architecture course that the memory limitation was 2^32 "pointers" (don't remember the right word). I mean, the memory was represented like an array where the CPU can acces it directly, but up to its limit. If the CPU is 32 bit, then it can address 2^32 words, if it's 64 bits 2^64, etc.  So, if what i said before is right, then, my OS should be able to address 2^32 = 4294967296 = 4Gb.  I'm thinking maybe some sort of space is reserved to the particular use of the Kernel, cache, buffering or swapping. But don't have the correct answer.  Can you give me a hint? $SU(2)$ is the covering group of $SO(3)$. What does it mean and does it have a physical consequence?  I heard that this fact is related to the description of bosons and fermions. But how does it follow from the fact that $SU(2)$ is the double cover of $SO(3)$? How can you sync Blender configs between multiple machines? I am looking for an example such that in a pre-Hilbert space $H$ we have for a subspace $U$ that  (i) $\bar{U} \oplus U^\perp \neq H$  (ii) $ \bar{U} \neq U^{\perp \perp}$  Since finite and closed subspaces will probably not do it, I am not good at inventing nice examples. Does anybody here have a few at hand? How to move Applications from phone to SD Card? Signed to unsigned conversion in C - is it always safe? Checking my understanding: $1 - 1 + 1 - 1 + 1 - ... = \frac{1}{2}$ I've recently run into a proof that claims that $1 - 1 + 1 - 1 + 1 - 1 ... = \frac{1}{2}$ that proceeds as follows:     Let $S = 1 - 1 + 1 - 1 + 1 - 1 + ...$. Then $$S = 1 - (1 - 1 + 1 - 1 + 1 - 1 ...) = 1 - S$$ Therefore, $2S = 1$, so $S = \frac{1}{2}$. QED   I was under the impression that this sum doesn't converge, and therefore this step of the proof is invalid:     Let $S = 1 - 1 + 1 - 1 + 1 - 1 + ...$   That is, it's not even valid to suppose that the sum is equal to some (implicitly real or complex) number $S$, and therefore the reasoning that follows is meaningless because $S$ doesn't exist and therefore has any properties we want it to have.  Is the reasoning I've given above correct? That is, is it correct for me to claim that the proof fails because $S$ doesn't exist?  (I've heard that there are techniques for evaluating divergent integrals by using complex analysis and Taylor series, so perhaps there's another way to prove that the summation is $\frac{1}{2}$; I just wanted to see whether my reasoning is sufficient to explain why this particular proof is incorrect. If the proof actually is correct, then I stand corrected!)  Thanks! Iterating over Java collections in Scala I'm writing some Scala code which uses the  API. I would like to iterate over the rows contained in the java.util.Iterator that I get from the Sheet class. I would like to use the iterator in a for each style loop, so I have been trying to convert it to a native Scala collection but will no luck.  I have looked at the Scala wrapper classes/traits, but I can not see how to use them correctly. How do I iterate over a Java collection in Scala without using the verbose while(hasNext()) getNext() style of loop?  Here's the code I wrote based on the correct answer:  class IteratorWrapper[A](iter:java.util.Iterator[A]) {     def foreach(f: A =&gt; Unit): Unit = {         while(iter.hasNext){           f(iter.next)         }     } }  object SpreadsheetParser extends Application {     implicit def iteratorToWrapper[T](iter:java.util.Iterator[T]):IteratorWrapper[T] = new IteratorWrapper[T](iter)      override def main(args:Array[String]):Unit =     {         val ios = new FileInputStream("assets/data.xls")         val workbook = new HSSFWorkbook(ios)         var sheet = workbook.getSheetAt(0)         var rows = sheet.rowIterator()          for (val row &lt;- rows){             println(row)         }     } } How do I copy a file in Python?  I couldn't find anything under . How does Java Garbage Collection work with Circular References? Book featuring a child learning from a crowdsourced AI book Can Windows Virtual PC run a 64-bit OS? I am looking for a way to concatenate the strings of a field within a group by query. So for example, I have a table:  ID   COMPANY_ID   EMPLOYEE 1    1            Anna 2    1            Bill 3    2            Carol 4    2            Dave   and I wanted to group by company_id to get something like:  COMPANY_ID   EMPLOYEE 1            Anna, Bill 2            Carol, Dave   There is a built-in function in mySQL to do this How can I add a bookmark in my nautilus folder explorer In Ubuntu 11 I just dragged the folder there.  This seems to be not possible on my new Samsung ultrabook with Ubuntu 12.04   I've tried Ctrl+D and using the top menu but nothing happens and no error messages, just nothing.  How can I add a bookmark? I have browsed several ASIC manufacturer's webs, but I haven't found an actual number. I assume there would be a fixed cost associated with creating masks and such and then there will be a cost per unit.     Note: that I don't actually want to have an ASIC made, I'm just curious. Here is a question as phrased in Advanced Linear Algebra (Steven Roman):     Show that a linear operator $\tau$ on a finite-dimensional complex inner product space $V$ is normal if and only if whenever $S$ is an invariant subspace under $\tau$, so is $S^\perp$.   I'm only interested in the $\Rightarrow$ direction. Wikipedia (and ProofWiki)  that uses some kind of computation with the trace. Linear Algebra Done Right chooses an orthonormal basis and then uses the fact that $\Vert \tau v \Vert = \Vert \tau^* v \Vert$.  However, the above  proofs seem a bit too computational to me. Can the following argument work?  (Use $\odot$ for orthogonal direct sum.) Suppose that $\tau$ is normal and write $$V=E_{\lambda_1} \odot \cdots \odot E_{\lambda_k}$$ where the $E_{\lambda_i}$ are the eigenspaces of $\tau$. If $S$ is a $\tau$-invariant subspace then $\tau|_S$ is diagonalizable, so $$S=\widetilde{E}_{\lambda_1} \odot\cdots\odot \widetilde{E}_{\lambda_k}$$ where the $\widetilde{E}_{\lambda_i} \le E_{\lambda_i}$ are the eigenspaces of $\tau|_S$ (which could be trivial). Then choose orthogonal complements $D_i$ such that $E_{\lambda_i} = \widetilde{E}_{\lambda_i} \odot D_i$, and then $$S^\perp = D_1 \odot\cdots\odot D_k.$$ Since each $D_i$ is a subspace of an eigenspace, they are all $\tau$-invariant. How can I change an element's class with JavaScript? From everything I've read about quantum mechanics and quantum entanglement phenomena, it's not obvious to me why quantum entanglement is considered to be an active link. That is, it's stated every time that measurement of one particle affects the other.  In my head, there is a less magic explanation: the entangling measurement affects both particles in a way which makes their states identical, though unknown. In this case measuring one particle will reveal information about state of the other, but without a magical instant modification of remote entangled particle.  Obviously, I'm not the only one who had this idea. What are the problems associated with this view, and why is the magic view preferred? Going through a text file line by line in C