My code is for a java 101 course and it works fine until the while loop. I put in the last input for the t, c, r, q options but it always goes to the else option where it shows "invalid input". The if statements just don't catch the 'answer' variable and always goes to the else statement.  import java.util.Scanner;  public class homework {       public static void main(String[] args) {        Scanner input = new Scanner (System.in);       System.out.printf ("Enter number of rows: ");       int rows = input.nextInt();       Scanner input2 = new Scanner (System.in);       System.out.printf ("Enter number of columns: ");       int column = input2.nextInt();       int[][] array = new int[rows][column];        for (int i =0; i &lt; rows ; i++) {           for(int j = 0; j &lt; column; j++) {               array[i][j] = (i*10)+j;               System.out.printf("%4d", array[i][j]);           }           System.out.println();       }        System.out.printf("T transpose - Rows become columns (and vice versa)%n");       System.out.printf("C columnSum - Calculate the sum of the values in each column%n");       System.out.printf("R reverseRows - Reverse all elements in every row of the matrix%n");       System.out.printf("Q quit - Exit the program%n");        boolean isValid = true;       while (isValid) {           Scanner input3 = new Scanner (System.in);           String answer = input3.next().toLowerCase();            if (answer == "t") {               for (int i =0; i &lt; rows ; i++) {                   for(int j = 0; j &lt; column; j++) {                       array[i][j] = (j*10)+i;                       System.out.printf("%4d", array[i][j]);                   }                   System.out.println();               }               isValid = false;             }            if (answer == "c") {            }            if (answer == "r") {             }            if (answer == "q") {               System.out.println("Goodbye");               isValid = false;            }            else {               System.out.println("Invalid input, please try again...");               isValid = true;           }        }      }   }
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 $n!$ when $n=0$? What are the pros and cons of the leading Java HTML parsers? How to call a function in a Twig file Let's say I create a function in a module file:  function _get_test() {   return 'test'; }   How can I call this in any Twig file? For example *.html.twig, page.html.twig, node.html.twig etc.   OR   How can I pass a variable from PHP to Twig and display in any Twig file.  For example *.html.twig, page.html.twig, node.html.twig etc. I saw a lot of times claims that they have to be exhaustive (the examples in such books were always set in such way, that they were indeed), on the other hand I also saw a lot of times books stating they should be exclusive (for example $\mathrm{H}_{0}$ as $\mu_1=\mu_2$ and $\mathrm{H}_{1}$ as $\mu_1&gt;\mu_2$) without clarifying the exhaustive issue. Only before typing in this question I found somewhat stronger statement on the  -- "The alternative need not be the logical negation of the null hypothesis".  Could someone more experienced explain which is true, and I would be grateful for shedding some light on the (historical?) reasons for such difference (the books were written by statisticians after all, i.e. scientists, not philosophers). I am new to Game Development, All I have developed is some 2d Games, using Game Maker by . There game development is much more easy, just as simple as Drag and Drop. But, Now I wish to evolve in Game Development, and wanna try some hands with the common programming languages like, Java, C++ or C. In order to achieve this, I came around the first topic, Game Engine. So, What is Game Engine.? That is a broad question, with various answers. I came out with some conclusion after reading various links,  Wikipedia: A game engine is a system designed for the creation and development of video games. The core functionality typically provided by a game engine includes a rendering engine for 2D or 3D graphics, a physics engine or collision detection (and collision response), sound, scripting, animation, artificial intelligence, networking, streaming, memory management, threading, localization support, and a scene graph.  It exists to abstract the (sometime platform-dependent) details of doing common game-related tasks, like rendering, physics, and input, so that developers (artists, designers, scripters and, yes, even other programmers) can focus on the details that make their games unique. Engines offer reusable components that can be manipulated to bring a game to life. Loading, displaying, and animating models, collision detection between objects, physics, input, graphical user interfaces, and even portions of a game's artificial intelligence can all be components that make up the engine.  Now what I understand is, Game Engine takes care of all the common work, like physics, loading etc... As far my question is concerned, what is a Game Engine (Programmatically)? Is it a Library? With pre-defined functions and classes, which can be inherited? Or what so ever, what is it? Find all natural numbers $n$ and $m$ for which $n^m=(n-1)!+1$ Does something like  exist for topological (eg. braided) circuits?   Alternatively, any ideas on how @ is getting  (or something similar)? Why is human vision restricted to 400-700 nm? Across the electromagnetic spectrum, 400-700 nm is a narrow spectrum of frequencies and focused in the region of short wavelengths. For example, radio waves cover a large range of frequencies unexploited by the visual system. So what biological reason is there that evolved us to use such a small frequency bandwidth for vision? Non-https links to other StackExchange sites in User profile when using https How to show $a^{2^n}+1 \mid a^{2^m}-1$? I've been struggling with this all day today. I imagine it's not very hard, but my algebra skills are terrible. So, how can I show that if $m&gt;n$ and $a$ is a positive integer, then $$a^{2^n}+1 \mid a^{2^m}-1.$$ I just can't get a coherent picture of what I'm supposed to do. If this too (see yesterday's question) boils down to the Unique Factorization Theorem, I would be very grateful for any intuition on how to think about this! Newsletter open and click tracking use http. Can i configure it that it uses https with our certificate? Can this cause block bounces? Convergence of the arithmetic mean Let $(a_n)_{n \in \mathbb{N}}$ be a convergent sequence with limit $a \in \mathbb{R}$. Show that the arithmetic mean given by: $$s_n:= \frac{1}{n}\sum_{i=1}^n a_i \tag{A.M.} $$ also converges to $a$.  I have read:  but unfortunately the answers there don't help me much because I don't understand their substitutions and most of it all, why their substitutions seem to work.   What I know from the problem is that since $a_n$ is convergent and $\epsilon &gt;0$ is given, I can say that:   $$\exists N_1 \in \mathbb{N}, \forall n \geq N_1: |a_n-a|&lt;\epsilon_1 $$ I also know that since $a_n$ is convergent, it is bound, so $(a_n) &lt; M, \ \forall n \in \mathbb{N}$   I need to show that: $$\exists N_2 \in \mathbb{N}, \forall n \geq N_2: |s_n-a|&lt; \epsilon_2$$ I started as follows: $$ \left|s_n-a \right| = \left|\frac{1}{n}\sum_{i=1}^na_i -a\right|= \left|\frac{1}{n}\sum_{i=1}^m(a_i-a)+\frac{1}{n}\sum_{i=m+1}^n(a_i-a) \right| \\ \leq \frac{1}{n} \sum_{i=1}^m|(a_i-a)|+\frac{1}{n}\sum_{i=m+1}^n|a_i-a|$$ I believe to understand that the left sum after the $\leq$ is finite, bound and doesn't depend on the values that $n$ takes on. However, I don't understand where all the substitutions come from and make this proof so seemingly easy to complete.   Is there a general idea I can follow to complete such proofs? Because I know that the last step is to show that the given sum is smaller than $\epsilon$. I also know that I should bring the condition $a_n &lt; M$ into place somewhere, but I don't know where.  If I choose an $n \geq N: |a_n-a|&lt; \epsilon'$ what does that tell me about $|a_i-a|$? I know that they are seemingly the same just with a different index. Writing string at the same position using Console.Write in C# 2.0 I have a console application project in C# 2.0 that needs to write something to the screen in a while loop. I do not want the screen to scroll because using Console.Write or Console.Writeline method will keep displaying text on console screen incremently and thus it starts scrolling.  I want to have the string written at the same position. How can i do this?  Thanks Backup to Azure Storage Container: Shared Access Signature the only way? RESTORE FILELISTONLY FROM URL = '' WITH CREDENTIAL = '' fails in SQL Server 2016.  Copied script from SQL Server 2012 environment, successfully restoring from Azure Storage Container, with create credential statement, and it failed in 2016.  Error message "Forbidden".  Only after logging into the Azure Portal, creating a Shared Access Signature for the container, could I execute the restore, and only by not specifying the credential did the restore work.  No documentation advises that a SAS (Shared Access Signature) is required in SQL Server 2016 for Azure container backup / restore.  Is there another way to use T-SQL to access blob backups on Azure storage containers in SQL Server 2016, than using SAS?    Looking at the MSDN tutorial on how to configure the backup service SQL 2016 introduces, a SAS is used. Refer Date and Time only partially visible in Big Sur Update:   Once upon a time there was a feature called . Its goal was to help our most active users find the questions they can answer. &quot;New nav&quot; never made it out of beta and that beta only ever made it to Stack Overflow users. Several months ago we gave new nav a sad, but overdue burial. As we promised, we've been working on a replacement for new nav, and now it's time for us to start rolling it out. We're calling it custom question lists and we are really excited about its potential to help all users get at the questions that are most interesting to them. While we hope what we've built hits the mark for many of you who have requested a feature like this (e.g., , , , , , ), we know how difficult it is to make something complex simple. So, we are rolling this out in beta to gather feedback from you and iterate on it. (Don't worry, we promise to actually release it this time.) When it's live later you'll be able to opt-in to the beta by turning on a new account preference. This will enable the feature for Stack Overflow, Meta Stack Overflow, and Meta Stack Exchange. It will be available for all network sites when the beta period is over. Schedule for future improvements This feature will roll out in four phases:  Phase I: Filter and sort controls to let you modify a question list view (Julyish) Phase II: Saved custom lists (In progress, ETA November 2018) Phase III: Notifications on custom lists (December 2018) Phase IV: Final fixes and official release (January 2019)  Sneak peak Phase I: Filter and sorts We'll add filter and sort controls to question lists. This does two things:  Clarifies the definition of built-in views - Naming is hard and short names can't always describe what a view is showing you. By exposing the filter and sort controls it is more obvious. Introduces the ability to create new custom views - This won't be super useful until we add the ability to save the views to the UI (phase II). Until then you can bookmark the URL and get back to your views.  Question list with new controls   Views drop down   Filter   Sort   Phase II: Saved custom question lists In this phase we will add the ability to save your custom questions lists. Create custom list In our current design, a dialog will be pre-populated based on the filters and sorts you're currently using. Give it a name, confirm your options, and click save.  Accessing your saved lists When you save your custom lists they will show up in the &quot;More&quot; drop down for question list views. Additionally, you can add them to the left navigation bar for easy access (see image below).  Phase III: Notifications For phase III we'll enable indicators for when new items are available in a custom question list. When you pin a question list to the left nav you can see a dot on any list with new items.  Feedback welcome As usual, we're interested in your constructive feedback. This is a work in progress and, as mentioned, will be rolled out in phases. You can provide feedback on the concepts now based on the information in this post and provide feedback based on the working elements as they are released. "Specially" vs "especially" When should I use specially and when especially? Lost supplementary user groups for GUI login session Ubuntu 16.04.5  Very weird situation - after Xorg crash, now every time when I login into Unity, my user account doesn't have it's system groups like adm, sudo, plugdev, fuse etc. But when I login on virtual console (Alt+F1) or over SSH - all my additional groups are there, as reported by id command.  Neither of /etc/group* or /etc/gshadow* files have changed, my user is still listed there in many system groups.  It looks like some systemd session parameters for GUI logins or lightdm cache files got screwed. But I have no idea where to start looking..  A lightdm log:  $ journalctl -au lightdm  -- Reboot -- systemd[1]: Starting Light Display Manager... systemd[1]: Started Light Display Manager. lightdm[3223]: pam_kwallet5(lightdm-greeter:setcred): (null): pam_sm_setcred lightdm[3223]: pam_unix(lightdm-greeter:session): session opened for user lightdm by (uid=0) lightdm[3345]: pam_succeed_if(lightdm:auth): requirement "user ingroup nopasswdlogin" not met by user "chm" lightdm[4867]: pam_ecryptfs: Passphrase file wrapped lightdm[3345]: pam_kwallet5(lightdm:auth): (null): pam_sm_authenticate lightdm[3345]: pam_kwallet5(lightdm:setcred): pam_kwallet5: pam_sm_setcred lightdm[3345]: pam_unix(lightdm:session): session opened for user chm by (uid=0) lightdm[3046]: Error writing to daemon: Bad file descriptor lightdm[3046]: Error writing to daemon: Bad file descriptor lightdm[3046]: Error writing to daemon: Bad file descriptor lightdm[3046]: Failed to write utmpx: Permission denied Always allow commenting on posts I have previously commented, irrespective of current rep Reset or remove the BIOS password on my laptop