Suppose I have an ArrayList, which has paths to the specific file to be processed. But this file can only be proccessed, if there's only one in a folder. Here's what I mean:  My ArrayList  List&lt;String&gt; pathsToTheFile = new ArrayList&lt;&gt;();   has  C:\123\456\NameOfUniqueFolder0 C:\123\456\NameOfUniqueFolder1 C:\123\456\NameOfUniqueFolder2 C:\123\456\NameOfUniqueFolder3 C:\123\456\NameOfUniqueFolder4   Suppose my 5th element is   C:\123\456\NameOfUniqueFolder0  Obviosuly, it's a duplicate of my 0 element, since the file inside this folder  SHOULD NOT be proccessed at all. C:\123\456\NameOfUniqueFolder0 should be removed form the list.  I can not use a SET here, because it will "remove" the duplicate, but one path to the folder will be still there, and the file inside get proccessed.
I have an ArrayList&lt;String&gt;, and I want to remove repeated strings from it. How can I do this?
How can I remove the qed symbols from all lemma proofs? the following code will only make the qed not appear in the second proof. However, it it possible to make the qed symbol never appear at the end of the proofs without having to specify it locally every time?  \documentclass{article} \usepackage{amsthm} \begin{document} \begin{proof} This has the QED symbol. \end{proof} \begin{proof}\renewcommand{\qedsymbol}{} This hasn't. \end{proof} \begin{proof} And this has it again. \end{proof} \end{document} Help identifying an error type "tried to help me learning" I have a friend from Russia who is trying to learn English and recently used the sentence "He tried to help me learning..." (implied: the English language)  It is obviously wrong and I corrected it telling her that she was supposed to say: "He tried to help me learn.", but I have a hard time explaining to her why it is incorrect since I'm not an expert on grammar either.  Is it a case of confusing the present simple and present continuous or does it have something to do with gerunds and infinitives? Any help would be highly appreciated! Getting the default text editor used in system I have used select-editor and I note that I am using /usr/bin/nano. Is this the default text editor I am using?  When I open text files, It opens with gedit  What command in terminal must be specified to get the default text editor that I am using, and have it returned to e in terminal? Prove $(x+y) \text{ mod } n = ((x \text{ mod } n)+(y \text{ mod } n)) \text{ mod } n,\,$ and product analog For all $n \in \mathbb{N}$, $n &gt; 1$ and $x,y \in \mathbb{Z}$ prove that      \begin{equation}   (x+y) \text{ mod } n   = ((x \text{ mod } n)+(y \text{ mod } n))\text{ mod } n. \end{equation}   Would this be a proof if I say:  Let $x = x' \text{ mod } n$ and let $y=y' \text{ mod } n$. Then  \begin{equation}   x+y = x'+y' \text{ mod } n. \end{equation}  Now, if we look at the current thing we want prove, this will follow:  \begin{equation}   x+y \text { mod } n = (x \text{ mod } n + y \text{ mod } n) \text{ mod } n. \end{equation}    I'm not sure if this is allowed or will count as a "proof" at all. Maybe you can show me some other ways of doing this, more precise ones? How can I evaluate a C# expression dynamically? I would like to do the equivalent of:  object result = Eval("1 + 3"); string now    = Eval("System.DateTime.Now().ToString()") as string   Following Biri s , I got this snippet (modified to remove obsolete method ICodeCompiler.CreateCompiler():  private object Eval(string sExpression) {     CSharpCodeProvider c = new CSharpCodeProvider();     CompilerParameters cp = new CompilerParameters();      cp.ReferencedAssemblies.Add("system.dll");      cp.CompilerOptions = "/t:library";     cp.GenerateInMemory = true;      StringBuilder sb = new StringBuilder("");     sb.Append("using System;\n");      sb.Append("namespace CSCodeEvaler{ \n");     sb.Append("public class CSCodeEvaler{ \n");     sb.Append("public object EvalCode(){\n");     sb.Append("return " + sExpression + "; \n");     sb.Append("} \n");     sb.Append("} \n");     sb.Append("}\n");      CompilerResults cr = c.CompileAssemblyFromSource(cp, sb.ToString());     if (cr.Errors.Count &gt; 0)     {         throw new InvalidExpressionException(             string.Format("Error ({0}) evaluating: {1}",              cr.Errors[0].ErrorText, sExpression));     }      System.Reflection.Assembly a = cr.CompiledAssembly;     object o = a.CreateInstance("CSCodeEvaler.CSCodeEvaler");      Type t = o.GetType();     MethodInfo mi = t.GetMethod("EvalCode");      object s = mi.Invoke(o, null);     return s;  } GUI/Unity crashing in 16.04 LTS after updates 2018-01-04, compiz segfaults The latest updates (4/1/2018) make my laptop constantly crash the GUI/Unity:  (Intel Pentium su4100 processor)  syslog:  Jan  5 11:38:53 1810 kernel: [ 1850.327738] compiz[11911]: segfault at 0 ip 00007f6c7baf0c16 sp 00007ffd5ec71c60 error 4 in i965_dri.so[7f6c7b513000+82d000]   After login I end up with an empty desktop, just a wallpaper, GUI/Unity are in a crash loop:   No panel.  No dash.  Can't start a program. Launcher disappears. Sidebar disappears. System crash. Windows key not working. The key combination Alt+Tab not working.   Simply, the computer is not usable. Same for guest login. The only thing working: open up a terminal CTRL+ALT+T to examine log files.  I somehow forced  to let me log in and file the bug, but still lots of problems:   Dash not working Alt+Tab not working Sometimes windows all disappear for a few seconds     Any ideas for a solution or workaround?   UPDATE     If you have the same/ very similar problems, follow the link to my    report and mark there that you're affected too. Or file your own. Please leave a comment   if you wish, or upvote - this is a nasty problem - but an answer should   offer a fix or a workaround so users can use their computer again.    Without , Ubuntu can't fix issues. I have written a C++ program and complied it to produce a.out file. However, whenever I try to run it, I get Permission Denied. I read that we can use sudo, but I can't quite get it to work. I use something like, sudo "./a.out" but that too doesn't work.  Edit:  Here is the message I get when I try "./a.out".  bash: ./a.out: Permission denied Given a string file path such as /foo/fizzbuzz.bar, how would I use bash to extract just the fizzbuzz portion of said string? Is it possible to cancel or clear a notification created by using notify-send? So I wrote a little script that makes sure a certain user plugs in a laptop when he logs on (it disables if he doesn't). The script uses notify-send to tell him to plug it in. If he plugs it in, the script quits. Is it possible to clear the notification automatically when he plugs it in? I'm thinking it might require somehow getting the process id spawned by notify-send and killing that PID, but I don't know how to do this.  Here's the current script:  #!/bin/bash   cat /sys/class/power_supply/BAT0/status OUTPUT="$(cat /sys/class/power_supply/BAT0/status)" echo "${OUTPUT}" if [ "${OUTPUT}" = "Charging" ] || [ "${OUTPUT}" = "Unknown" ]; then     echo charging or full elif [ "${OUTPUT}" = "Discharging" ]; then     notify-send -i /home/evamvid/Documents/Programming/OokiNoUse/power25.png "Hey there brother" "plug it in"     COUNTER=0 while [ "$COUNTER" -le 12 ] do     cat /sys/class/power_supply/BAT0/status     OUTPUT="$(cat /sys/class/power_supply/BAT0/status)"     echo "${OUTPUT}"     if [ "${OUTPUT}" = "Charging" ] || [ "${OUTPUT}" = "Unknown" ]; then         exit     elif [ "${OUTPUT}" = "Discharging" ]; then         COUNTER=$(($COUNTER+1))         echo $COUNTER         sleep 1     fi done fi Can Minecraft Pocket Edition play with a desktop Minecraft? How do I jump to the next or previous word with CTRL + arrow keys in a console? In terminal emulation applications, pressing CTRL + Left / Right arrows jumps from one word to the previous or next one. Is it possible to have the same functionality in a Linux console, whether it is in text or in framebuffer modes?  In my configuration, the CTRL + arrow keys are transformed into escaped character sequences and not interpreted. Killing form on $\mathfrak{sp}(2n)$ Why do we say "try and" [verb] instead of "try to" [verb]? (E.g., "Try and call me tomorrow.") In written and standard semi-formal (and above) spoken English, one would use &quot;try to&quot;:  Try to be a better person. Try to get the fishhook out of my thumb, please. Try to find a pharmacy when you need one.  But in spoken English, we (Americans, at least) usually substitute &quot;try and&quot; for all those cases. &quot;Try to&quot; makes sense because the &quot;to&quot; begins the construction of an infinitive: &quot;try to be&quot;, &quot;try to do&quot;, &quot;try to act&quot; and so on. &quot;Try and&quot; on the other hand doesn't seem to make any sense. I'm curious how the &quot;try and&quot; crept in, and when. It's really tough to Google small words like these, so I'm not finding anything on the Web. Is it a contraction of something like &quot;Try hard, and ...&quot;? Note: I've seen  and it is somewhat related but doesn't tell me what I want to know. Edit Observe how, even on this site,  construction. Turning it on its head Note that you can't make a negative construction with &quot;try and&quot;:  It's raining. Try not to get wet. It's raining. Try not and get wet. [?]  Even adding do doesn't help. The following means something different from &quot;try not to get wet.&quot;  It's raining. Don't try and get wet.  Even use of to instead of and there means something else:  It's raining. Don't try to get wet.  &quot;Try not to get wet&quot; means try to stay dry. &quot;Don't try to get wet&quot; means avoid actively seeking out a soaking, and implies that a soaking might in fact be what you are looking for. MORE I just happened to notice a video from an editor for Merriam-Webster on this very topic, so I include the link here: . Interpolating functions returned by NDSolve do not plot Preventing applications from stealing focus Are there any solutions to prevent applications stealing focus from the active window?   This is especially annoying when I'm starting an application, switch to do something else and the new application starts receiving half a sentence of text. ''More than one row returned by a subquery used as an expression'' postgres error $\sum x_n^2$ and $\sum y_n^2$ converge, what does $\sum (x_n + y_n)^2$ do? So I know that $\sum x_n^2$ converges, and $\sum y_n^2$ converges. ${x_n}$ and ${y_n}$ are both sequences of real numbers. How can I prove that $$\sum(x_n+y_n)^2$$ converges? So far I have $$\sum(x_n+y_n)^2=\sum(x_n)^2 +\sum (y_n)^2 +\sum(2x_ny_n)$$ so I need to prove that $\sum 2x_ny_n$ converges. Is this the right way to approach it? If it is, I am completely lost as to the next step.  I also need to prove that $$\sqrt{\sum(x_n+y_n)^2}\leq \sqrt{\sum(x_n)^2}+\sqrt{\sum(y_n)^2}$$  I assume this will follow pretty easily from a result in the first proof, but I'm stuck on that now, and perhaps it is easier to start with the second one. I have a lot of work I've done on the first problem, but none of it seemed to go anywhere. Any hints?  Thanks! Good books for a high schooler self-studying Abstract Algebra? Does anyone have any suggestions for abstract algebra books particularly suited to self-study?     Here is some background and motivation, if it's helpful.  I'm currently a junior in high school, but I have some familiarity with groups, rings, polynomials and fields, as I went through Fraleigh's book. I liked its writing style, but many of the problems were not helpful. I would like to get better at algebra with some other book, particularly one that's aimed at someone who already has a little familiarity with the objects, but is by no means completely comfortable.  One of my longer-term goals is to learn a bit of algebraic number theory, as I've only been studying elementary number theory. That's why I feel it  good to learn more algebra first. (I'd also be interested in suggestions of other good subjects to learn prior to tackling algebraic number theory.)  I was considering using one of Lang's books, since they seem pretty universal, but I've heard rumors that they are very terse and not good for self-learning. Is there a list of the names used for Sauron in Lord of the Rings? How to turn off Facebook notifications on Mac OS X? How to turn off Facebook notifications on Mac OS X Mountain Lion?