All I want to do is load information I saved to a plain text file about the position of a  and set the frame to the state it was saved as. For some reason I'm unable to compare capture groups with strings; that is, matcher.group("state") compared to the string it should be ("min", "max", or "normal") is not returning true, and the same goes with matcher.group("vis").  String fileArrayStr = "WINDOW_LAYOUT:0,0|779x768|max|show"   My code is:  byte[] fileArray = null; String fileArrayStr = null; try {     fileArray = Files.readAllBytes(PathToConfig); } catch (IOException e) {     e.printStackTrace(); } try {     fileArrayStr = new String(fileArray, "UTF-8"); } catch (UnsupportedEncodingException e) {     e.printStackTrace(); }  // checking the value of fileArrayStr here by outputting it // confirms the data is read correctly from the file  pattern = Pattern.compile(     "WINDOW_LAYOUT:\\s*" +     "(?&lt;x&gt;[0-9\\-]+),(?&lt;y&gt;[0-9\\-]+)\\|" +     "(?&lt;length&gt;\\d+)x(?&lt;height&gt;\\d+)\\|" +     "(?&lt;state&gt;[minaxorl]+)\\|" +     "(?&lt;vis&gt;[showide]+)\\s*"); matcher = pattern.matcher(fileArrayStr); if (matcher.find()) {     frame.setLocation(Integer.parseInt(matcher.group("x")),                     Integer.parseInt(matcher.group("y")));     frame.setSize(Integer.parseInt(matcher.group("length")),                     Integer.parseInt(matcher.group("height")));     DialogMsg("state: " + matcher.group("state") + "\n" + "vis: "                     + matcher.group("vis"));      // the above DialogMsg call (my own function to show a popup dialog)     // shows the     // data is being read correctly, as the values are "max" and "show"     // for state     // and vis, respectively. Same with the DialogMsg calls below.      if (matcher.group("state") == "min") {         try {             frame.setIcon(true);         } catch (PropertyVetoException e) {             e.printStackTrace();         }     } else if (matcher.group("state") == "max") {         try {             frame.setMaximum(true);         } catch (PropertyVetoException e) {             e.printStackTrace();         }     } else {         DialogMsg("matcher.group(\"state\") = \""                         + matcher.group("state") + "\"");     }     if (matcher.group("vis") == "show") {         frame.setVisible(true);     } else if (matcher.group("vis") == "hide") {         frame.setVisible(false);     } else {         DialogMsg("matcher.group(\"vis\") = \"" + matcher.group("vis")                         + "\"");     } }   The code is always falling back to the else statements. What am I doing wrong?  is supposed to return a string, is it not?
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 it legal to study while on a tourist Schengen visa? If, say, you acquired a 90-day tourist Schengen visa, would it be legal to use it for the purpose of visiting a language course or a university class? Or do you have to apply for a special education visa if you have such intents?  Answers linking to official EU pages on that matter would be highly appreciated :) I've grown quite fond of HTTP reverse proxies in our development environment and found the DNS based virtual host reverse proxy quite useful. Having only one port (and the standard one) open on the firewall makes it much easier for management.  I'd like to find something similar to do SSH connections but haven't had much luck. I'd prefer not to simply use SSH tunneling since that requires opening port ranges other than the standard. Is there anything out there that can do this?  Could HAProxy do this? SQL Server: Cannot insert an explicit value into a timestamp column Communicating with all potential clients as a multi niche photographer This may be seen as a bit off topic, but I'm hoping it's a question that some photographers can associalte with and clear up for me.  I'm an amateur wanting to get more serious in the new year, and aiming to build up a portfolio of work that I will showcase on my own website, which will hopefully build up a client base.  I figured that a good way to get started would be to create a few 365 style projects that I can publish on my site and on social media. However, my interests vary a great deal, and therefore my photography will more than likely range from nature and local events, to more NSFW style topics.  My problem is, how to successfully communicate with people who will be interested in certain aspects of my work, without losing touch with those interested in others.  In theory, I'd like to set up a single social media presence, preferably Twitter, where I can freely post anything I want, and connect with anyone I want. Essentailly pointing people in the direction of whatever content they will be interested in. Problem is, social media sites like Twitter publicise ALL of your posts to ALL of your followers, so people who are following for nature/local photography will possibly unfollow me for my NSFW content. At the same time, some SFW followers may be potential clients in other areas, and vice versa.  So as a multi niche photographer, how can you engage with all potential clients, and showcase all portfolio peices ( in my case all 365 project shots ) via a single or limited number of social networks? How are you doing it? On webmail every user gets error "ERROR: Message not sent. Server replied: 354" while sending mails.   But mails are sent properly and reaches properly.  Can you tell me where is problem, and why it is occurred?  UPDATE: I found in some resources that this is not an error but standard information message. On the other side, it's annoying. Can you tell me if it is a true, and if it is how can I avoid it? PHP get number of week for month How would one throw an unwilling creature? My bugbear barbarian, who can lift about double the weight of a wolf, wanted to throw the wolf at a second wolf. How would we go about doing that given existing rules options? How many actuations are "too many actuations"? Can Conjure Animals beasts be used as mounts? Is it possible to use the animals that are summoned using Conjure Animals as mounts?  As an example: Summoning Giant Eagles to carry a group up the mountain or over a wall. List all the directories under the current one Make gedit embedded terminal colours the same as the default terminal I've just updated to 11.10 and now my embedded terminal in gedit does not match my default terminal. I hate looking at a white and black terminal. Does anyone know how to make the embedded terminal match the default terminal?  This is a screenshot:    I want my embedded terminal in gedit to match my default terminal. Blender is saving as a blend1 file, not blend I teach Blender to classes of game design students in the University of California and a student came to me yesterday with a problem I haven't seen before. She's created a very simple file, but when it's saved Blender puts a .blend1 extension on it every time, not the normal .blend. This means that after it's saved twice there are two .blend1 files in the directory, and no .blend file. I have no idea why this is happening. What has she done? Anyone seen this before?  thanks - Chris Listings: text highlighting based on prefix How can I apply different styles to keywords depending on their prefix?  Here is some sample code:  (-2,0,0) (2,1,1) op-registerbox !box1 ;box1 /Blue op-setproperties   I'd like to typeset   words starting with ! and ; in color red, words starting with / in color green, words starting with cp- in bold.   So far, this is what I've got:  \lstdefinelanguage{XX} { basicstyle=\small\sffamily\fontseries{c}, emphstyle=\underbar, keywordsprefix=[2]{/}, alsoletter={/}, keywordstyle=\textbf, keywordstyle=[2]\color{green}, morekeywords={op,registerbox, ...}, morestring=[b][\color{green}]", columns=flexible, escapechar=\%, numbersep=6pt, numberstyle=\scriptsize }   I'm aware that only one keywordsprefix can be defined at the moment: specifying more than one class of prefix (keywordsprefix=[2]{/}) is currently not supported. I'd like to avoid having to list all the words that match my description into morekeywords. Is that possible? How? Related:  (not a dupe, that's a feature request and was closed as a dupe of another one)        (old) post does indeed say that Link-only answers can be flagged as NAA, but there are a lot of posts like  which define Not An Answer is a way that it doesn't apply to link-only answers.  Can we get some up-to-date consensus on this? That link only answers are not allowed is . Dynamic google-code-prettify doesn't work LINQ's Distinct() on a particular property I am playing with LINQ to learn about it, but I can't figure out how to use Distinct when I do not have a simple list (a simple list of integers is pretty easy to do, this is not the question). What I if want to use  on a list of an Object on one or more properties of the object?  Example: If an object is Person, with Property Id. How can I get all Person and use Distinct on them with the property Id of the object?  Person1: Id=1, Name="Test1" Person2: Id=1, Name="Test1" Person3: Id=2, Name="Test2"   How can I get just Person1 and Person3? Is that possible?  If it's not possible with LINQ, what would be the best way to have a list of Person depending on some of its properties in .NET 3.5? How can I edit this trigger to only fire once? I'm looking for the antonym of -cide (as in suicide, pesticide, etc.). Essentially the ending to words that would mean "to create or embrace". Is there a way for non-root processes to bind to "privileged" ports on Linux? It's very annoying to have this limitation on my development box, when there won't ever be any users other than me.  I'm aware of , but none of them do exactly what I want:    (The version in Debian testing, 1.0, only supports IPv4)  (the "nat" table is not yet implemented for ip6tables, the IPv6 version of iptables) sudo (Running as root is what I'm trying to avoid) SELinux (or similar). (This is just my dev box, I don't want to introduce a lot of extra complexity.)   Is there some simple sysctl variable to allow non-root processes to bind to "privileged" ports (ports less than 1024) on Linux, or am I just out of luck?  EDIT: In some cases, you can  to do this. How to deal with perfect separation in logistic regression?