I have a program that I am writing and I have it completed but I keep receiving an error in a counter that I am using.  The purpose of the program is to build a plate stacker and I have finished that but need to write a counter based on the particular colors used (how many green plates...etc.).  As I know several classmates use this site to cheat, I will not post the code in whole but only the fragments I feel are necessary.  Below is an example of a statement that I am using to attempt to get a count of the beige plates in the text file.  The statement is in a while loop with the other colors having the same coding.  I also have initialized the counter (int beige = 0;) prior to this and outside of the while loop:           if(line == "beige")         {             beige++;         }   I have a System.out following these statements to display the count but it always comes up as 0 so I believe the problem is in this particular fragment.  If I need to send additional coding I will but I believe it is something to do with this or the placement of it in the while loop.
I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?
Is there a fast way (without looping over all edges/faces/verts) using ops.mesh or bmesh to get the lists of indices associated with mesh islands as shown below? These islands are part of one mesh but are disjoint from each other.    I know how to select the boundaries by running the operator Select boundary Loop or calling bpy.ops.mesh.region_to_loop() but can't find any API calls to return the vert/edge/face indices associated with the individual islands. Integrating MySQL with Python in Windows As a non-native speaker, I cannot grasp any difference between the expressions "here we go" and "there we go": both expressions seem to underline an event that is going to happen immediately.  Is there any subtle usage detail that I am missing? If $A$ commutes with $B$ and $B$ commutes with $C$, then $A$ commutes with $C$ How to create a cross-browser sub document with iframe or shadow dom? Difference between get "off of" and "off" How do I install the latest version of EMACS and pick the appropriate UI? I'm running the latest Kubuntu (12.04 beta 2) and I would like to run the latest emacs (currently v24). The repos are one version behind. What's the best way to install v24 or later (and avoid future version conflicts)?  Also, is there any reason not to aways use the GUI version of emacs if X is running? For example, could I set the GUI emacs version as the default text editor and use it to edit cron jobs (crontab -e)? I'm assuming the answer is yes, but since I haven't done that yet (my default editor is nano), I want to check if there are reasons I should leave nano as the default editor.  Usually when I'm working on the command line I end up using nano. Now that I think about it, I have no idea why I keep doing that. Is there any downside to calling a GUI editor when working in an X terminal?  EDIT: I briefly tested these two versions   GNU Emacs 24.0.94.1 (x86_64-pc-linux-gnu, GTK+ Version 3.3.20) from  GNU Emacs 23.3.1 (x86_64-pc-linux-gnu) installed by default in Kubuntu.   .  Unfortunately (for me) the defaults installed version (23.3.1, 23.3+1-1ubuntu9) is the nox version.   Package: emacs23-nox Status: install ok installed Version: 23.3+1-1ubuntu9 Replaces: emacs23, emacs23-gtk, emacs23-lucid   The package with version 24 opens in GUI mode by default. That's what I prefer. Some of the version 24 changes that interest me are listed in the references below.   But there appear to be a multitude of different packages and versions I could install.  References:   What’s New In Emacs 24 (part 1) | Mastering Emacs  "    shell-mode uses pcomplete rules, with the standard completion UI.  Yowzah! There’s a lot of cool, new functionality hidden away in this gem of a change." EmacsWiki: Recent Changes How to simulate slow internet connections on the mac What's a good software solution to slow down internet connections on the mac for testing and simulations?  My primary need is when testing code in the iPhone / iOS simulator, so slowing down the connection for specific applications or processes would be great. Alternatives to "and/or"? As a programmer, I have no problem with seeing or using "and/or" in technical documentation. For example,     I can upvote an answer that satisfies me and/or mark it as accepted.   That's perfectly good English to me. However, if I were writing a novel, or even just an essay, or — heaven forbid — a poem, "and/or" would seem extremely out of place.  My question is, what should I be using instead? (I solemnly swear I will not use that knowledge to actually write a poem.) Show that every prime $p>3$ is either of the form $6n+1$ or of the form $6n+5$ Show that every prime $p&gt;3$ is either of the form $6n+1$ or of the form $6n+5$, where $n=0,1,2, \dots$ How would I write the equivalent of C#'s  in JavaScript?  var haystack = 'hello world'; var needle = 'he';  haystack.startsWith(needle) == true   Note: This is an old question, and as pointed out in the comments ECMAScript 2015 (ES6) introduced the  method. However, at the time of writing this update (2015) . How do you write (and run) a correct micro-benchmark in Java?  I'm looking for some code samples and comments illustrating various things to think about.  Example: Should the benchmark measure time/iteration or iterations/time, and why?  Related: In normal line integration, from what I understand, you are measuring the area underneath $f(x,y)$ along a curve in the $x\text{-}y$ plane from point $a$ to point $b$.  But what is being measured with complex line integration, when you go from a point $z_1$ to a point $z_2$ in the complex plane?  With regular line integration I can see $f(x,y)$ maps $(x,y)$ to a point on the $z$ axis directly above above/below $(x,y)$.  But in the complex case, when you map from the domain $Z$ to the image $W$, you are mapping from $\mathbb{R^2}$ to $\mathbb{R^2}$ ...it is not mapping a point to 'directly above/below'...so I don't have any intuition of what is happening with complex line integration. TV series with pull out phone screens and pink/purple space ships I’m looking for a TV show where an alien race comes to Earth and sets up big purple/pink cylindrical or cone shaped spaceships in various cities around the world. The Aliens are not hostile but actually created peace and eliminated hunger on Earth.    I believe the aliens had some human features and were wise and calm the main actor had a phone with a pull out screen I believe the main actor worked for or with the aliens I believe that in the last episode some humans and aliens go into some kind of pods and perhaps leave Earth? one of the space ships was located in a major US city. Maybe Washington DC or another East Coast city   Could someone please tell me what TV series this is? I have been searching everywhere and cannot find it. Thanks! Link broken on desktop but work on nautilus file manger I created a shortcut to a text file called &quot;imp&quot; on right-clicking it from the default file manager everything works well. But on clicking it on the desktop I get this  Any Idea why? Narration cartoon about a town that has weird paranormal occurrences in it Why does a 'sudo -i' login shell break a here-doc command string argument? In the sequence of five commands below, all depend on single-quotes to hand off possible variable substitution to the called bash shell rather than the calling shell. The calling user is xx, but the called shell will be run as user yy. The first command substitutes $HOME with the calling shell's value because the called shell is not a login shell. The second command substitutes the value of $HOME loaded by a login shell, so it is the value belonging to user yy. The third command does not rely on a $HOME value and creates a file in the guessed home directory of user yy.  Why does the fourth command fail? The intention is that it writes the same file, but relying on the $HOME variable belonging to user yy to ensure it actually does end up in her home directory. I don't understand why a login shell breaks the behaviour of a here-doc command passed in as a static single-quoted string. The failure of the fifth command verifies that this problem is not about variable substitution.  xx@host ~ $ sudo -u yy bash -c 'echo HOME=$HOME' HOME=/home/xx xx@host ~ $ sudo -iu yy bash -c 'echo HOME=$HOME' HOME=/home/yy xx@host ~ $ sudo -u yy bash -c 'cat &gt; /home/yy/test.sh &lt;&lt; "EOF" &gt; script-content &gt; EOF &gt; ' xx@host ~ $ sudo -iu yy bash -c 'cat &gt; $HOME/test.sh &lt;&lt; "EOF" &gt; script-content &gt; EOF &gt; ' bash: warning: here-document at line 0 delimited by end-of-file (wanted `EOFscript-contentEOF') xx@host ~ $ sudo -iu yy bash -c 'cat &gt; /home/yy/test.sh &lt;&lt; "EOF" &gt; script-content &gt; EOF &gt; ' bash: warning: here-document at line 0 delimited by end-of-file (wanted `EOFscript-contentEOF')   These commands were issued on a Linux Mint 18.3 Cinnamon 64-bit system, which is based on Ubuntu 16.04 (Xenial Xerus).  Update: The here-doc aspect is just clouding the issue. Here's a simplification of the problem:  $ sudo bash -c 'echo 1 &gt; echo 2' 1 2 $ sudo -i bash -c 'echo 1 &gt; echo 2' 1echo 2   Why does the first of those two commands preserve the linebreak and the second does not? sudo is common to both commands, yet seems to be escaping/filtering/interpolating differently depending on nothing but the "-i" option. Why do some actors in credits appear as - Character (As Actor) Let A and B be sets. Show that A is a subset of B if and only if for any set C, one has A union C is a subset of B union C. Can you verify my proof if it is right?  Let $A$ and $B$ be sets.  (a) Show that $A$ is a subset of $B$ if and only if for any set $C$, one has $A$ union $C$ is a subset of $B$ union $C$. (b) Show that $A$ is a subset of $B$ if and only if for any set $C$, one has $A$ intersect $C$ is a subset of $B$ intersect $C$.  Edited Solution :  (a)  (=>) Given A is a subset of B, this implies A U B = B. Given a set C, A U B U C = B U C. Since A is a subset of B, this implies A U C is a subset of B U C.      Solution 1 :(&lt;=) Given A U C is a subset of B U C , For A U C , x is a member of A U C . For B U C, x is a member of B U C. Suppose x is a member of A but not a member of B, meaning A is not a subset of B. Therefore , A U C is not a subset of B U C. Hence, A must be a subset of B.      Solution 2 :(&lt;=) Given A U C is a subset of B U C, For A U C, x is a member of A U C and for B U C, x is a member of B U C. Suppose C is a disjoint set. Since A U C is a subset of B U C, it follows that A is a subset of B.  (b) (=>) Since A is a subset of B , it follows that A U B = B. [A intersect C] is a subset of A and  [B intersect C ] is a subset of B by definition of intersection. Let x be member of A and member of C. Since [ A intersect C ] is a subset of A, x must be in A. Let x be a member of B and member of C. Since [ B intersect C ] is a subset of B, x must be in B. Therefore, A intersect C is a subset of B intersect C.  (&lt;=) Since A intersect C is a subset of B intersect C, suppose we let Set C be a subset of B and a subset of A as well. C is a subset of A implies A intersect C is equals to C. C is a subset of B implies B intersect C is equals to C as well. Since A intersect C is equals to B intersect C, A is a subset of B. Multiple Apple Developer Accounts