So far my code is like this in Java. I tried it in C and I used a FFLUSH() function to do this. Is there any such function in Java that can do this?  /**  *   */ package UserInput;  import java.util.Scanner;  /**  * @author ypava  *  */ public class UserInput {      private static Scanner s,p5,q5,p4,q4,p3,q3,p2,q2,p,q,ch;      //static float a,b,c;      /**      * @param args      */     public static void main(String[] args) {         // TODO Auto-generated method stub           //float a,b,c;          int choice;          String Rch;         do{         System.out.println("\t\t\t Menu");         System.out.println("\t 1.Addition");         System.out.println("\t 2.Subtraction");         System.out.println("\t 3.Multiplication");         System.out.println("\t 4.Division");         System.out.println("\t 5.Modulus");         System.out.println("");         System.out.println("Please Enter Your Choice");         s = new Scanner(System.in);         choice=s.nextInt();           switch(choice)         {         case 1:         {             System.out.println("Enter the Values of a &amp; b");             p5 = new Scanner(System.in);             float a=p5.nextFloat();             q5 = new Scanner(System.in);             float b= q5.nextFloat();             float c=a+b;             System.out.println("The Sum is: \t" +c);             break;          }         case 2:         {             System.out.println("Enter the Values of a &amp; b");             p4 = new Scanner(System.in);             float a=p4.nextFloat();             q4 = new Scanner(System.in);             float b= q4.nextFloat();             float c=a-b;             System.out.println("The Difference is: \t" +c);             break;         }         case 3:         {             System.out.println("Enter the Values of a &amp; b");             p3 = new Scanner(System.in);             float a=p3.nextFloat();             q3 = new Scanner(System.in);             float b= q3.nextFloat();             float c=a*b;             System.out.println("The Multiplication is: \t" +c);             break;         }         case 4:         {             System.out.println("Enter the Values of a &amp; b");             p2 = new Scanner(System.in);             float a=p2.nextFloat();             q2 = new Scanner(System.in);             float b= q2.nextFloat();             float c=a/b;             System.out.println("The Division is: \t" +c);             break;         }         case 5:         {             System.out.println("Enter the Values of a &amp; b");             p = new Scanner(System.in);             float a=p.nextFloat();             q = new Scanner(System.in);             float b= q.nextFloat();             float c=a%b;             System.out.println("The Modulus is: \t" +c);             break;         }         default:            System.out.println("Wrong Option Entered");            break;          }          System.out.println("Do you Want to Perform any other operation Y/N");         ch = new Scanner(System.in);          Rch=ch.nextLine();           }while(Rch=="Y"|| Rch=="y");       }  }
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?
How to use a decimal range() step value? Another question on almost sure and convergence in probability Convergence in probability implies convergence on a subsequence almost surely.  But this means we fix a subsequence, such that $X_{n_k}$ converges for almost every $\omega$, right? The subsequence we pick does not depend on the $\omega$ right? GRUB does not detect Windows I have finally installed Ubuntu on my second drive. When I start my computer GRUB only offers me to boot Ubuntu, not Windows 7. What needs to be done so that I can choose between Ubuntu and Windows in GRUB?  When I press F12 for boot menu at startup and I choose Windows Boot Manager it boots into Windows 7.    I ran command sudo fdisk -l and here is log ():  WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.   Disk /dev/sda: 1000.2 GB, 1000204886016 bytes 255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0xc3ffc3ff     Device Boot      Start         End      Blocks   Id  System /dev/sda1               1  1953525167   976762583+  ee  GPT Partition 1 does not start on physical sector boundary. Unchained Flurry of Blows with Natural Weapons and Feral Combat Training using natural attacks as primary Calculating MEAN and STANDARD DEVIATION confussed How can I make my Photoshop text appear like it does on the web? Do I really have to design everything in Photoshop with anti-aliasing set to "none"?  I'm sure there is a better way.    I'd like to have a setting so that when picking a basic web-safe (such as Tahoma) in Photoshop so I can see what it will actually look like when on the web.  For example: The difference between Tahoma with anti-aliasing set to "crisp" in Photoshop and how it renders in Firefox is major.  It looks nice and smooth in Photoshop and looks like crap on the web.  Is there a anti-aliasing choice that is best to start with (that has the most similar outcome) when planning to have the content live on the web? About integer factorization Cheap/free tool to view/convert Canon CR2 RAW format photo files on Windows? How large is it possible for a PC to get?  For clarity, here are my parameters:   This is about size categories, not 'feet' or 'inches' or 'meters' or any other precise measurement. This is about Medium to Large to Huge to Gargantuan categories.  This is for an NPC charlatan using this to trick people. (It's an NPC but will have a full PC sheet, so the distinction between PC and NPC doesn't matter). Any means of size category enlargement works for this purpose, including magic spells, magic items, etc. Illusions do not count because it's about actually becoming larger, not just casting an illusion of a gargantuan giant version of yourself.  The character must remain the same physical structure. Polymorphing into a Gargantuan Dragon would not satisfy the need here. Consumable items are fine. This does not need to be permanent. Mathematical Basis behind inflation of Standard errors of Regression estimates due to multicollinearity We know that due to multi-collinearity, the standard errors of beta estimates get inflated. But what is the mathematical basis to it?   I am looking for some mathematical relationship or something to explain this.   Like I understand if standard error of betas goes up, then t-statistics goes down and we might not be able to reject the null or the variables would appear non-significant.   But what is the mathematical relationship between multicolllinearity and inflation in variance of coefficients? Is there a convenient way to import a schema into Oracle 11gR2 using a single new or different tablespace than where the data originated?  As an example, I have exported BLOG_DATA from OLDDB, where all user data is stored in the USERS tablespace.   On NEWDB, I would like to import the BLOG_DATA schema, but store the user objects in the BLOG_DATA tablespace, created specifically for this user.   I have created the BLOG_DATA user, created the BLOG_DATA tablespace and set it as the default tablespace for that user and added an appropriate unlimited quota.  CREATE TABLESPACE blog_data DATAFILE SIZE 1G;  CREATE USER blog_data IDENTIFIED BY secretpassword DEFAULT TABLESPACE blog_data QUOTA UNLIMITED ON blog_data;  GRANT connect,resource TO blog_data   The schema was exported from OLDDB with something like  exp blog_data/secretpassword@OLDDB file=blog_data.dmp    After reading Phil's excellent answer below, I found myself wondering:   Since data has no other place to go than the default tablespace - the only tablespace the user has a quota on - will this effectively force imp to put all user objects in that default tablespace?  imp blog_data/secretpassword@NEWDB file=blog_data.dmp   Would this then place the entire blog_data schema in the blog_data tablespace on NEWDB? Is there any reason why this wouldn't work or that I would run into problems with certain objects etc?  update:  I did a quick test and found this to be the case. Imp places objects in the default tablespace for that user, provided it can't place it in the original tablespace (eg. the tablespace does not exist). Full explanation:   Still, I suppose that using Data Pump like Phil suggests might be the preferred option. List of IP addresses/hostnames from local network in Python How can I get a list of the IP addresses or host names from a local network easily in Python?  It would be best if it was multi-platform, but it needs to work on Mac OS X first, then others follow.  Edit: By local I mean all active addresses within a local network, such as 192.168.xxx.xxx.  So, if the IP address of my computer (within the local network) is 192.168.1.1, and I have three other connected computers, I would want it to return the IP addresses 192.168.1.2, 192.168.1.3, 192.168.1.4, and possibly their hostnames. Title of short story: God granting immortality to others to find a way to kill himself I want a single word embedded in whole logo. How do i do it in adobe illustrator?  I want to design a logo like this. Kindly help me What Is Energy? Where did it come from? The simplistic undergrad explanation aside, I've never really understood what energy really is. I've been told that it's something when converted from one kind of something to another kind, or does some "work", as defined by us, but what is that something?  Moreover, if the total amount of energy in the universe is finite and we cannot create energy. Then, where did it come from? I've learned from thermodynamics where it goes, but where does it come from?  I know this sounds like something trivially simple, but there is so much going on in the physical universe and I just can't grasp what it is. Maybe it is because I lack the mathematical understanding that I can't grasp the subtle things the universe is doing. Still, I want to understand what it is doing.  How do I get to the point of understanding what it's doing?  (Note: What prompted me to ask this was . I'm afraid that it just puzzled me further and I sat there staring at the screen for a good 10 minutes.) Why are heatmaps on qgis 2.8.1 produced in the wrong CRS? I noticed that the heatmap calculation on the new upgrade version of qgis is given the raster map without any coordinate system.   Have you got the same problem? By the year 1582 vs in 1582 1.In 1582, scientists pointed out that the calendar was 10 days behind the sun      2.By the year 1582, scientists pointed out that the calendar was 10 days behind the sun.   I wanted to know the difference between "by the year 1582" and "in 1582". Disable ohead on a single page hyperlink name with biblatex authoryear I am using biblatex with the authoryear styles.  So far I've been able to find everything I need easily in the excellent documentation, but I'm stuck on one thing.   With my current settings (below) citations only have the year hyperlinked to the bibliography entry. I think prior to using biblatex I would have the whole citation (authors + year) as a reference - I think this is easier to click etc. when browsing.  Is there an easy way to get this (or does it involve creating a new style).  \usepackage[style=authoryear,             bibstyle=authoryear,             citestyle=authoryear,             natbib=true,             hyperref=true,             backref=true,             abbreviate=true]{biblatex} access parent object in javascript