I'm writing a simple code to test the value that was inputted to my constant value.  I declared this code as my constant value.  String LetMeThrough = "drunk"; String GotAnID = "drunk";   This is the whole code.  import java.util.Scanner;  public class Main {  public static void main(String[] args) {     Scanner DrunkTest = new Scanner(System.in);      String InputDrunk;     String InputDrunkAgain;      String LetMeThrough = "drunk";     String GotAnID = "drunk";        System.out.print("Type drunk: ");     InputDrunk= DrunkTest.next();     System.out.print("Re Type drunk: ");     InputDrunkAgain = DrunkTest.next();      if(InputDrunk == LetMeThrough &amp; InputDrunkAgain == GotAnID){         System.out.print("You're not DRUNK");     }     else         System.out.print("You're F***** DRUNK");  }}   The problem is that if I type "drunk" on both. I will get "You're F****** DRUNK" instead of the "You're not DRUNK". When the inputted values is the same as my constant values.
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?
Derivative of function solved from NDSolve can't be plotted Unintentional Lies and Misinformation Is there anything in Objective-C similar to C# yield return How to highlight an entire paragraph? Vectors, structs and std::find iPhone 6s with iOS 12.4 not connecting to MacBook Pro mid2015 with macOS 10.14.6 I am using an iPhone 6s with iOS 12.4 and a MacBook Pro mid2015 with macOS 10.14.6. Since recently (I am not exactly sure when it started), I cannot charge the phone with my computer anymore. As soon as I plug the phone in, it will play the charging sound repeatedly. The right-hand side port sometimes works, the lefthand side port never works. When I connect my old iPhone 5 (using the same cable), it charges without any issues. My iPad mini 4 shows the same issue.  Sometimes the "Do you trust this computer" setting flashes on the phone and disappears before I can click anything.   How can I fix this?  Update 1  Sometimes I get the Software Update dialogue in macOS. After approx. 2 minutes it shows the following:     Update 2  For some reason the issue disappeared for a while but is back now. Disabling "Settings" > "Touch ID &amp; Passcode" > "USB Accessoires" seems like it makes the problem a bit less bad, but not go away.  Update 3  This is driving me crazy. I upgraded to Mojave 10.14.3 mostly to get rid of the issue. It persists. Some more random information: Before logging in (Filevault pre-boot authentication), the phone will charge fine. Only when a user account is loaded, the issue appears. The likelihood of a successful connection increases with the battery state of the iPhone. Workaround 2 in my answer below suggest that this a "Trust issue" from the iPhone's side. I suppose the solution will have to be hidden somewhere there...    What I tried so far (will update):   Reset Privacy settings on iPhone Different (original, almost new Apple) lightning cables   Remove and add "iPhone USB" in Network Settings  SMC reset (), PRAM reset Upgrade to latest iOS 12.4 and MacOS 10.14.6 Can you make a bonus-action attack from Two-Weapon Fighting before you take your action? Prove $GL_n(\Bbb{R})/SL_n(\Bbb{R}) \cong \Bbb{R}^\times$ $$GL_n(\Bbb{R})/SL_n(\Bbb{R}) \cong \Bbb{R}^\times$$  This is trivial to prove with the first isomorphism theorem - by using the determinant as a endomorphism, then as $SL_n(\Bbb{R})$ is $1$ under the determinant, it is the kernel, and by FIT, the above is proved.  I was wondering how to prove this without the isomorphism theorem ? This question dovetails with this post on .  I am familiar with some of larger, paid-for business registry's like  and .  While the detailed information their business listings database include (like # of employees, annual sales, industry code, etc) is fantastic, if you are on a limited budget, sometimes the cost of purchasing the data outweighs the value you can get from it.  If you have geocoding capabilities in house, one could potentially create a reasonable surrogate by spatially-enabling (geocoding) a publicly available business listing on your own.    If you were looking to take on this type of project, where would you start your research? Do you know of US agencies at a State or National level that maintain this type of information, AND are publicly available for download or minimal purchase? No SA password. No SQL Server Management Studio. No OS authentication I have this problem.  I need to do some administrative tasks on a MS SQL Database using SA account.   OS authentication is not set. SQL Server Manager Manager Studio is not installed. I have no other admin database account. I do have access to a Windows admin account The only tools installed on the database server are as shown:     How can I activate OS authentication so I can log into the database an reset the SA password ? How to send emails and avoid them being classified as spam? This is a  about how to handle email sent from your server being misclassified as spam.  For additional information you may find these similar questions helpful:                    Sometimes I want to send newsletters to my customers. The problem is, that some of the emails get caught as spam messages. Mostly by Outlook at the client (even in my own Outlook 2007).  Now I want to know what should be done to create "good" emails. I know about reverse lookup etc., but (for example), what about a unsubscribe link with an unique ID?  Does that increase a spam rating? Looking for a command to create the geometry line symbol (\overline with arrows on both ends) I need a way of encoding the geometry line symbol. $\overline{AB}$ gives me the line segment symbol and $\overrightarrow{AB}$ gives me the ray symbol, I need a way to get a bar over the letters that has arrows on both ends. $\overrightleftarrow{AB}$ does not work.   Thanks! Performance impact of updating target columns with same values ON CONFLICT This is a question about the inner-workings of Postgres (v10) and performance.  Given a table, github_repos, with a multi-column unique index on org_id and github_id columns, is there any performance difference (or other issues to be aware of) between the two bulk upsert operations below? The difference is that in the first query, the org_id and github_id columns are included in the UPDATE, whereas in the second query they are not. Since the UPDATE runs ON CONFLICT, the updated values of org_id and github_id will be the same as the old values, but those columns are included in the UPDATE because the underlying library I am using is designed that way. I'm wondering if its safe to use as-is or whether I should be explicitly excluding those columns in the UPDATE.  Query #1:  INSERT INTO "github_repos" ("org_id","github_id","name") VALUES (1,1,'foo') ON CONFLICT (org_id, github_id) DO UPDATE SET "org_id"=EXCLUDED."org_id","github_id"=EXCLUDED."github_id","name"=EXCLUDED."name" RETURNING "id"   Query #2:  INSERT INTO "github_repos" ("org_id","github_id","name") VALUES (1,1,'foo') ON CONFLICT (org_id, github_id) DO UPDATE SET "name"=EXCLUDED."name" RETURNING "id"   github_repos table:        Column       |       Type        | Collation | Nullable  -------------------+-------------------+-----------+----------+  id                | bigint            |           | not null |  org_id            | bigint            |           | not null |  github_id         | bigint            |           | not null |  name              | character varying |           | not null |  Indexes:     "github_repos_pkey" PRIMARY KEY, btree (id)     "unique_repos" UNIQUE, btree (org_id, github_id) Switches needed in an n-location multiway switching system we can construct a two location multiway switching system with two 3-way switches:    They also teach us how to perform three location multiway switching with two 3-way switches and one 4-way switch:    Is it possible to make a similar system (three locations, all able to switch the light in any situation) with only three 3-way switches?   What can be said in general about the switches needed to make an n-location multiway switching system? Why is saltatory conduction in myelinated axons faster than continuous conduction in unmyelinated axons? Unitl now I haven't found the option to enable the curved representation of connectors between nodes. The  doesn't mention such an  option. Is there a keyboard shortcut? Discrete and compact subset must be finite Status of B1/B2 visa after citizenship change? I have a valid B1/B2 visa valid to US till March 2019 on Indian passport, I changed my citizenship to Australian. Is my B1/B2 visa on Indian passport valid? How can gravity affect light? Is there any pair of 128-bit strings M and K such that AES$_K$(M) = M?  If yes, how do I go about (efficiently) finding such a pair?