I'm trying to implement a simple cesar cipher. I'm having trouble with the function that codes a string based on a new key[]. Here I shown, how I setup my key.   private String[] alphabet =  {"a", "b", "c","d", "e", "f","g", "h", "i","j", "k", "l","m", "n", "o",             "p", "q", "r","s", "t", "u","v", "w", "x","u", "z"};  public String[] CoderNewKey(int shift) {     _NewKey = null;     _NewKey = new String[25];      for (int i = 0; i &lt; 25; i++) {         _NewKey[i] = alphabet[(i + shift) % 25];     }     return _NewKey; }   The problem I have is with Coder, none of the if statements are ever true, and rtnstring is always just "".  public String Coder(String[] key, String msg){     String rtnstring = "";      for ( int i = 0; i &lt; msg.length();i++){          for (int x = 0; x&lt;26 ; x++){             if ( msg.substring(i, i+1) == alphabet[x]){                  rtnstring.concat(key[x]);             }if (msg.substring(i, i+1) == " "){                  rtnstring.concat(" ");             }         }     }     return rtnstring; }   Here is my logic for the coder method.  It goes through the String msg 1 letter at a time. It matches the letter with its index in the alphabet, then it creates a new string based on the index's in the given key.
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?
What is $\Delta t$ in the time-energy uncertainty principle? In non-relativistic QM, the $\Delta E$ in the time-energy uncertainty principle is the limiting standard deviation of the set of energy measurements of $n$ identically prepared systems as $n$ goes to infinity. What does the $\Delta t$ mean, since $t$ is not even an observable? For a moderately complex query I am trying to optimize, I noticed that removing the TOP n clause changes the execution plan.  I would have guessed that when a query includes TOP n the database engine would run the query ignoring the the TOP clause, and then at the end just shrink that result set down to the n number of rows that was requested.  The graphical execution plan seems to indicate this is the case -- TOP is the "last" step.  But it appears there is more going on.  My question is, how (and why) does a TOP n clause impact the execution plan of a query?  Here is a simplified version of what is going on in my case:  The query is matching rows from two tables, A and B.    Without the TOP clause, the optimizer estimates there will be 19k rows from table A and 46k rows from table B.  The actual number of rows returned is 16k for A and 13k for B.  A hash match is used to join these two results sets for a total of 69 rows (then a sort is applied).  This query happens very quickly.  When I add TOP 1001 the optimizer does not use a hash match; instead it first sorts the results from table A (same estimate/actual of 19k/16k) and does a nested loop against table B.  The estimated number of rows for table B is now 1, and the strange thing is that the TOP n directly affects the estimated number of executions (index seek) against B -- it appears to always be 2n+1, or in my case 2003.  This estimate changes accordingly if I change TOP n.  Of course, since this is a nested join the actual number of executions is 16k (the number of rows from table A) and this slows down the query.  The actual scenario is a bit more complex but this captures the basic idea/behavior.  Both tables are searched using index seeks.  This is SQL Server 2008 R2 Enterprise edition. How to contact Canonical? So I am doing a College research project for my Computer Information Systems department and it is about alternative Linux server distribution for small businesses. From my findings I would really like for this research to actually take off into a Distribution project (Using Ubuntu as a base OS).   However I would like to rename the distribution as "Bizbuntu" or something related to that ("Biz" being shorthand for business) however I don't know if I can name the distribution without consent from Canonical.   So my question is do I have to contact Canonical about this, if so, does anyone know a mailing list or email that I can contact them about this? Mass dropped on a spring I thought this would be a particularly simple problem but it is turning out to be quite the opposite. I am sure I am doing a very simple mistake.   The problem statement is that there is a mass which is just barely kept on the spring (help by the force equal to the weight of the spring) such that the spring is uncompressed. As soon as I let the object go, it will compress the spring and come to rest at some height. The energy stored in the spring will be equal to the difference in the potential energy at the two height of the spring (compressed and uncompressed),  $$mgh_i -mgh_f= 1/2 kx^2$$ Furthermore, the compression of the spring would just be the difference in the $h_f -h_i$. This gives me two roots for compression,  $$ x=0 $$ And the second would be, $$ mg=1/2kx $$ But then by this, $kx=2mg$ and $kx$ is force by Hooks law, but then does it means that the force compressing the spring is twice the weight of the object? That sounds odd. I was expecting I would just recover Hooks law but I guess I am doing something wrong here. But I am not sure what that is.   Any help will be much appreciated.  P.S. This is not a homework problem. We are designing a project for our school.  Thanks for your time. I need help to find the Galois Group of $x^5 +1$. I know that it has a 5-cycle and a 4 cycle and is not a subgroup of $A_5$. Thanks! How to mount PCIe SSD from MacBook Air in another computer I got this SSD out of an Apple laptop that's broken from liquid damage.  What is this connection called and how do I mount this storage device to retrieve data from it? It looks like PCIe. Does Apple sell a part to mount this via USB adapter or something? Crontab entry executing every hour Notifications in browser tab A very nice feature for Stack Overflow (and other Stack Exchange sites) would be to indicate the number of notifications (if any) in the browser tab like seen on Facebook:    Of course that would require automatic update if content has changed. Some kind of 'push-notification' which would be a nice feature as well. How to sync gnome-calendar with an online calendar? I thought it was awesome that Ubuntu 16.04 shipped with gnome-calendar, but I noticed that holidays were not included.  I also noticed that there is an option to sync the calendar with an online one, how do I do this?  I don't know of any online calendars I could use. Prove: $$ (a+b)^\frac{1}{n} \le a^\frac{1}{n} + b^\frac{1}{n}, \qquad \forall n \in \mathbb{N} $$ I have have tried using the triangle inequlity $ |a + b| \le |a| + |b| $,  without any success. The first time I learnt LaTeX, I thought \newcommand properly fits for inline mode and \newenvironment for displayed mode.  Later I noticed it is not correct. So the question is   What is the rule of thumb when deciding whether we should use one over the other one? I wanted to create an account for Ubuntu One, but I got impatient when the email with the verification code didn't arrive... I thought I might have typed the wrong address, closed the window and tried again. it told me the address already existed and I just got the code. But since I closed the window I missed it. Is there any way to recover the code? When I'm watching a film in Mythtv the screen turns to black every 10 - 15 mins and I have to log back into Ubuntu. Very annoying!  How do I disable the black screen / screensaver / logout in Unity?  There no longer seems to be any options to turn the screen saver off as there were in Ubuntu prior to Unity. R-squared: X "explains" the percentage of variation of the Y values. Does axis order matter? In Data Extension one field 'HTML' have Data that I have shown below, Now I have to Find the 'Href', and and at the last of URL append some text like '&amp;MC='. It may have Multiple 'Href'. Please help me on this.   &lt;table width="540" style="margin: 0px; padding: 0px;" bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="0"&gt;  &lt;tbody&gt;   &lt;tr&gt;    &lt;td valign="top"&gt;    &lt;h5 style="margin: 0px; padding: 0px 0px 2px; line-height: normal; font-family: &amp;quot;Segoe UI&amp;quot;, &amp;quot;Lucida Grande&amp;quot;, Verdana, Arial, Helvetica, sans-serif; font-size: 16px; font-weight: normal;"&gt;    &lt;a style="text-decoration: none;" href="https://test.4.com/testRegistration/testLobbyServlet?target=reg20.jsp&amp;eventid=897605&amp;sessionid=1&amp;key=2F3D1EB963D9DB7738BF2877DFFDBA01&amp;partnerref=Social&amp;sourcepage=register&amp;loc=zOTlocz&amp;prod=zWAz&amp;tech=zsecz&amp;prog=zOTprogz&amp;type=zOTtypez&amp;media=zWCz&amp;country=zUSz" alias="Success with Enterprise Mobility: Making email and Office 365 secure on mobile devices"&gt;    Success with Enterprise Mobility: Making email and Office 365 secure on mobile devices     &lt;/a&gt;    &lt;/h5&gt;    &lt;p style="margin: 0px; padding: 0px; line-height: 20px; font-family: &amp;quot;Segoe UI&amp;quot;, &amp;quot;Lucida Grande&amp;quot;, Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: normal;"&gt;    &lt;span style="color: rgb(103, 103, 103);"&gt;    &lt;em&gt;December 9, 2014, 10:30 A.M.&amp;ndash;11:30 A.M. Pacific Time&lt;/em&gt;&lt;br&gt;    An enterprise mobility strategy involves identity, management, and productivity. In this session featuring Brad Anderson, you will learn about the integration and the Office mobile apps while enabling secure mobile productivity.    &lt;/span&gt;    &lt;/p&gt;    &lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;    &lt;td valign="top"&gt;&amp;nbsp;    &lt;/td&gt;   &lt;/tr&gt;   &lt;tr&gt;    &lt;td valign="top"&gt;    &lt;h5 style="margin: 0px; padding: 0px 0px 2px; line-height: normal; font-family: &amp;quot;Segoe UI&amp;quot;, &amp;quot;Lucida Grande&amp;quot;, Verdana, Arial, Helvetica, sans-serif; font-size: 16px; font-weight: normal;"&gt;    &lt;a style="text-decoration: none;" href="http://test.TTr.com/?Wt.mc_id=IG15W2NWTN&amp;loc=zOTlocz&amp;prod=zWAz&amp;prod=zWSz&amp;tech=zCLz&amp;prog=zOTprogz&amp;type=zEVz&amp;media=zOTmediaz&amp;country=zUSz" alias="Test: Everything about enterprise technology under one roof"&gt;    Test: Everything about enterprise technology under one roof    &lt;/a&gt;    &lt;/h5&gt;    &lt;p style="margin: 0px; padding: 0px; line-height: 20px; font-family: &amp;quot;Segoe UI&amp;quot;, &amp;quot;Lucida Grande&amp;quot;, Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: normal;"&gt;    &lt;span style="color: rgb(103, 103, 103);"&gt;    &lt;em&gt;May 4&amp;ndash;8, 2015, Chicago, IL&lt;/em&gt;&lt;br&gt;    If you&amp;rsquo;re serious about technology, you don&amp;rsquo;t want to miss Test. This event will be the intersection of everything in enterprise technology. Get ahead in your job and your career.    &lt;/span&gt;    &lt;/p&gt;    &lt;/td&gt;   &lt;/tr&gt;  &lt;/tbody&gt; &lt;/table&gt; How do I drill a 2⅛ inch door knob hole over an existing 1½ inch hole? I need to replace the door knob for this interior door:    The door knobs I've found at the stores require a 2⅛ inch hole.  Mine is only 1½:    Did door knobs used to be smaller?  Is there some place I can find a replacement door knob that will fit my door?  If I need to modify the door to fit a modern door knob, will the new hole completely overlap the old? and can I reuse the latch hole? How to copy file path to clipboard? Is there a way to copy the currently selected filename, including the path, to the clipboard? Ideally this would be through the right-click menu.  Some degree of flexibility would be useful, like the ability to copy just the filename, path+filename, filename minus extension, etc. This isn't essential, though, as long as it can copy the path+filename.  The solution must be compatible with Windows XP, Windows Vista and Windows 7. How can I customize different nodepart with different textures? My question is how can I customize hatch patterns(grid, vertical line, etc.) for different nodepart in a node?  The following is a failed try.  \documentclass[border=2mm,convert]{standalone} \usepackage{tikz} \usetikzlibrary{shapes.multipart,patterns}  \begin{document} \begin{tikzpicture} \node[rectangle split,rectangle split parts =2,rectangle split part fill={red!30,red!10}, rectangle split part pattern={grid,},draw]{one \nodepart{second}two}; \end{tikzpicture} \end{document} How to change the Play Store language? Any way to see mail sent by other user through shared address? My wife and I have a "shared" email address, like thesmiths@example.com which we both use from Gmail when we both want to get replies or for signing up for certain websites.  When an email is received at that address, it gets forwarded to both of our personal Gmail accounts.  The problem is that when either one of us "sends as" that address, the other does not see the sent message. So we have to cc or bcc each other (and she usually forgets.)  Is there any automagic way to have those sent emails appear in BOTH of our Gmail accounts?  I've tried filters but I don't think they work on outgoing messages. Basically we want a filter that would automatically forward emails from that address to the other person.  I know this can be done with standalone mail clients, but neither of us uses those.