I have a collection of unique ints which is always unsorted, something like   [1, 56, 78, 89, 887, 98, 100, 0, 23, 114, 900]   I would like to quickly remove an element from the container, say 887 and the result should be   [1, 56, 78, 89, 98, 100, 0, 23, 114, 900]   I am currently using a vector and using this code to erase the element.  container.erase(std::remove(container.begin(), container.end(), elem), container.end());   where elem holds the value to be removed. This works but I have do this operation a million times or more and hence I would like to see if I can use any other algorithm or container to remove elements faster.
I've been reading up on STL containers in my book on C++, specifically the section on the STL and its containers. Now I do understand each and every one of them have their own specific properties, and I'm close to memorizing all of them... But what I do not yet grasp is in which scenario each of them is used.  What is the explanation? Example code is much prefered.
$A$ is a $n\times n$ matrix such that $ A^m = 0 $ for some positive integer $m$.   Show that $A^n = 0$.   My attempt: For $n &gt; m$, it's obvious since matrix multiplication is associative.  For $n &lt; m$, $A^n\times A^{m-n} = 0$; not sure what to do next. Also I know that $\det A = 0$. Latex create a second keywordstyle using listing doesn't work Use variable with TOP in select statement in SQL Server without making it dynamic Why use pointers? $f(x)$ is a strictly increasing, and continuous, function on $[0,+\infty)$. Consider the integral,  $$\int_0^a f^{-1}(x) dx.$$  Reasoning  The interval $[0,a]$ is "reflected" across the line $y=x$ onto the interval $0 \leq y \leq a.$  $f(x)$ and $f^{-1}(x)$ are symmetric across the line $y=x$. So, the integral is equivalent to the area bounded by $y = 0$, $y=a$, and $f(x)$.  So, "integrating $f$ along an interval on the $y$-axis" is the same as integrating $f^{-1}$ along the same interval on the $x$-axis?  Question  Is my reasoning correct? GUI for watching logs (tail and grep) Could you recommend a GUI application with powerful log watching capabilities?  Generally it would work as tail -f in GUI, but on top of that following features would be very useful:   filtering out some lines based on (regular) expressions  coloring some lines based on (regular) expressions interactive search saveable configuration easily applicable to different files notifications based on (regular) expressions   A similar tool on Windows is  and its paid version - I have a specific requirement (probably silly!) for testing a browser of Chrome. I realize this requirement isn't the most logical, but politics being what they may I'd like to know the technical workaround.  I need to test a site in version, let's say, 28 of Google Chrome. Obviously Google runs a silent updater which can be disabled, but at this point they don't (to my knowledge) release old archives of the MSI installers (which I can easily use to reinstall and force a no-update option for testing). If we can get this working on a single instance then there's a possibility that a virtual machine or some other workaround will give us an easy restore point to meet this test.  If anyone has a good idea of where to start here that would be amazing.  I've already floated the "why are we doing this question?" and the answer is that it is part of the requirements so we need to make a best effort.  UPDATE:   FileHippo appears to only archive the online installer (automatic update)  OldApps doesn't archive Chrome anymore  OldVersion doesn't appear to have any Chrome Archives   UPDATE 2:  - The accepted answer's server is the correct solution here at this point in time. Basically speaking you're looking for the full install (30 or so MB). If you have an 800K file it is the online installer which automatically updates. Problem 4.3.32 in Linear Algebra, Lay:  Let $V$ and $W$ be vector spaces, let $T:V\to W$ be a linear transformation, and let $\{\mathbf{v}_1, \dots , \mathbf{v}_p \}$ be a subset of $V$. Suppose that $T$ is a one-to-one transformation [...]. Show that if the set of images $\{T(\mathbf{v}_1), \dots ,T(\mathbf{v}_p)\}$ is linearly dependent, then $\{\mathbf{v}_1, \dots , \mathbf{v}_p \}$ is linearly dependent. This fact shows that a one-to-one linear transformation maps a linearly independent set onto a linearly independent set.  All I can think of doing: If $\{T(\mathbf{v}_1), \dots ,T(\mathbf{v}_p)\}$ is linearly dependent, then there exist weights $c_1, \dots, c_p$, not all zero, so that $$c_1 T(\mathbf{v}_1) + \cdots + c_p T(\mathbf{v}_p) = \mathbf{0}$$ Since $T$ is linear: $$c_1 T(\mathbf{v}_1) + \cdots + c_p T(\mathbf{v}_p) = T(c_1\mathbf{v}_1) + \cdots + T(c_p \mathbf{v}_p)=T(c_1 \mathbf{v}_1 +\cdots + c_p \mathbf{v}_p)=\mathbf{0}$$ So the set $\{\mathbf{v}_1, \dots , \mathbf{v}_p \}$ must be linearly dependent. Am I missing something? And why must $T$ be on-to-one for this to be true? An example showing that it is not true if $T$ is not one-to-one would be great! I am going to start a phd at the US with an F1 visa. University told me that I could enter the US only 30 days before the date on I-20. Since English is not my first language (and this would be a big change in my life) I would like to go there by June.  The thing is that I have an European passport with a valid ESTA. My plan would be to arrive with this passport, stay 4-6 weeks , go to Canada for a short vacation (maybe flight maybe by land) and come back to the USA with F1 visa.  I have two questions about this:  1) is this possible?   2) If yes, how could I justify knowing I will lose my come-back flight during my first entry? (I would purchase round trip because one-way are too expensive, probably with less than 90 days difference) Creating shapefile from Excel file in QGIS? I am using QGIS 2.6.1 and have worked in an Excel file database (which was actually converted from a Shapefile). I have managed to convert it as CSV file and load it into QGIS (displays data fine) but I have trouble to convert it to a shapefile.  I can view it but I can´t add or alter data in this file. I think I have to save it as a database.   Any clues how to convert the xlsl-data to a database and finally to a shapefile? I have email addresses encoded with HTML character entities. Is there anything in .NET that can convert them to plain strings? Use sub and superscript as [optional] parameters for macro Why exactly did the Sorting Hat originally want to put Harry in Slytherin? How to identify unused CSS definitions from multiple CSS files in a project A bunch of CSS files were pulled in and now I'm trying to clean things up a bit. How can I efficiently identify unused CSS definitions in a whole project? Looking for the actual reason of refraction explained precisely without analogies Changing "index.php" Within The Address I work on a HP laptop plugged in most of the time, and after a few months the battery went off-duty.  Of course, I could remove the battery each time the laptop is plugged and replace it each time I must move to where no sockets are around. But I think that:   It would be really BORING! The computer would not avail itself of the useful backup power supply a battery can provide in case of black out.   It should simply switch off the battery charging when a safe power level is reached (i.e. 95%) and start recharging it, not every five minutes, but only under a certain safe threshold (i.e. 40% - 50%).  In its energy-saving profiles, Windows 7 only allows for setting up screen brightness, screen fadeout, screen deactivation and the suspension, not managing any charging issue.  Is there a way to accomplish this? How to get the current URL within a Django template? How to make a through hole using inward extrusion in Blender 2.8? I am trying to make a through hole using inward extrusion. I enterd into edit mode, then I drawed an outline of my hole using knife tool. then I turn into wireframe shading, rotate my view an select snap to faces and then extrude the hole outline inward  so the hole is created successfully, but I still have a face at the hole bottom. I can select this face separately  But If I try to delete it, I siply delete this face (I can't select it anymore after deleteting), but I do not see through hole, so the basic cube face is still here. So how to remove the hole bottom? Are objects in PHP passed by value or reference?