import java.util.Scanner; import java.lang.Math; public class ConvertTemp  {      public static void main(String[] args)      //try making a program that asks if the user wants to convert f to c or vv     {         //declare variables and instantiate         double temp, fahren, cels;         String tempType;         Scanner input = new Scanner(System.in); //try changing this later            //ask user for data         System.out.print("Is this temperature in fahrenheit or celsius (enter F or C)?");         tempType = input.nextLine();          System.out.println(tempType);         System.out.println(tempType=="F");          if(tempType == " F")         {             System.out.print("Enter your temperature in Fahrenheit: ");             temp = input.nextDouble();             fahren = Math.round((9.0/5.0) * (temp + 32.0));             System.out.println(temp + " degrees fahrenheit is " + fahren);         }          if(tempType == " C")          {             System.out.print("Enter your temperature in Celsius: ");             temp = input.nextDouble();             cels = Math.round((temp - 32.0) * 5.0/9.0); //this will round to one decimal bc float param             System.out.println(temp + " degrees celsius is " + cels);         }       }  }   When I run the program and enter F, this is what shows up:  Is this temperature in fahrenheit or celsius (enter F or C)?F F false  Why is it giving me false? Even before I try running through the if statements?
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 QImage able to open and render pure 16-bit images? Let $f:S^{2n} \rightarrow S^{2n}$ be a continuous map. Show that          there exists $x \in S^{2n}$, such that $f(x) =x$ or $f(x) = -x$;   any continous map $g: \mathbb R P^{2n} \rightarrow \mathbb RP^{2n}$ has a fixed point;      I think 1 implies 2. So, how can I find an $x$ in 1?  Thanks for the help. Why is the sky never green? It can be blue or orange, and green is in between! I, like everybody I suppose, have read the  why the colour of the sky is blue:     ... the two most common types of matter present in the atmosphere are   gaseous nitrogen and oxygen. These particles are most effective in   scattering the higher frequency and shorter wavelength portions of the   visible light spectrum. This scattering process involves the   absorption of a light wave by an atom followed by reemission of a   light wave in a variety of directions. The amount of multidirectional   scattering that occurs is dependent upon the frequency of the light.   ... So as white light.. from the sun passes through our atmosphere,   the high frequencies become scattered by atmospheric particles while   the lower frequencies are most likely to pass through the atmosphere   without a significant alteration in their direction. This scattering   of the higher frequencies of light illuminates the skies with light on   the BIV end of the visible spectrum. Compared to blue light, violet   light is most easily scattered by atmospheric particles. However, our   eyes are more sensitive to light with blue frequencies. Thus, we view   the skies as being blue in color.   and why sunsets are red:     ... the light that is not scattered is able to pass through our   atmosphere and reach our eyes in a rather non-interrupted path. The   lower frequencies of sunlight (ROY) tend to reach our eyes as we sight   directly at the sun during midday. While sunlight consists of the   entire range of frequencies of visible light, not all frequencies are   equally intense. In fact, sunlight tends to be most rich with yellow   light frequencies. For these reasons, the sun appears yellow during   midday due to the direct passage of dominant amounts of yellow   frequencies through our atmosphere and to our eyes.      The appearance of the sun changes with the time of day. While it may   be yellow during midday, it is often found to gradually turn color as   it approaches sunset. This can be explained by light scattering. As   the sun approaches the horizon line, sunlight must traverse a greater   distance through our atmosphere; this is demonstrated in the diagram   below. As the path that sunlight takes through our atmosphere   increases in length, ROYGBIV encounters more and more atmospheric   particles. This results in the scattering of greater and greater   amounts of yellow light. During sunset hours, the light passing   through our atmosphere to our eyes tends to be most concentrated with   red and orange frequencies of light. For this reason, the sunsets have   a reddish-orange hue. The effect of a red sunset becomes more   pronounced if the atmosphere contains more and more particles.   Can you explain why the colour of the sky passes from blue to orange/red skipping altogether the whole range of green frequencies?  I have only heard of the legendary 'green, emerald line/ flash'     that appears in particular circumstances     Green flashes are enhanced by mirage, which increase refraction... is more likely to be seen in stable, clear air,... One might expect to see a blue flash, since blue light is   refracted most of all, and ... is   therefore the very last to disappear below the horizon, but the blue   is preferentially scattered out of the line of sight, and the   remaining light ends up appearing green   but I have never seen it, nor do I know anybody who ever did. Access to original contents of mount point How can I execute a terminal command (like grep) from my Objective-C Cocoa application? MicroSD card is set to Read-only state. How can I write data on it? I have a MicroSD card reader in my notebook. When I insert a MicroSD memory card into it, I can't write any data on it - it's read-only. The same thing happens when I try to do it under root. And I can't change the permission policy for it. This problem happens for all microSD cards (I've tested 2 cards). I've encountered it on Ubuntu 12.04 LTS, now I'm on Ubuntu 12.10, the problem is still on it's place. When I try to insert such a "read-only" card in my mobile phone, everything's OK and I can write data on it. So, can anybody tell me, how can I write a data onto the card?  UPD: here's fdisk -l output:  Disk /dev/sdc1: 2013 MB, 2013135360 bytes 62 heads, 62 sectors/track, 1022 cylinders, total 3931905 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000   Device Boot      Start         End      Blocks   Id  System   The file system of the card is msdos. As to me it's weird.   UPD2: I've found a small "lock" switch on my card adapter, and it turns out, that when I insert it in my notebook, it switches on. Perhaps, I have to find some glue or something to get that switch stuck...  UPD3: There was no glue near me, so I've decided to buy another card-reader. How can I search for one label but not another? What search query will return conversations that have the label Reading but not the label Ignore?  I've tried using label:reading -label:ignore but Gmail still returns conversations that have the label Ignore:    The query label:(reading -ignore) gives me the same results. What type of path in shebang is more preferable? I have a dictionary of values read from two fields in a database: a string field and a numeric field. The string field is unique, so that is the key of the dictionary.  I can sort on the keys, but how can I sort based on the values?  Note: I have read Stack Overflow question here  and probably could change my code to have a list of dictionaries, but since I do not really need a list of dictionaries I wanted to know if there is a simpler solution to sort either in ascending or descending order. Gparted: move extended partition on the left I have some free disk space on the left of my ubuntu (sda5)  What is best solution to extend sda5 ?  I can    copy sda3 or sda5 with dd to bigger disk. delete sda3,5,swap create sda3,5,swap dd original partition.   Not sure how to do it properly.  May be there is a simpler solution. What are the grammatical rules determining whether to use which or what?  I usually go by intuition. It's "What car are you looking at?" and "What bicycle do you like most?" but "Which song did you sing?" Quite often, I don't know whether to use what or which.  How can I tell? Imported CSV points are not visible I am trying to import  CSV file and get no reported errors but there are no points visible. If I click on "zoom to extent" nothing happens (even if I move away from the location of the points before doing this.  I have shut off all raster layers but they were not hiding the points.  I have tried to find an answer here but none seem to fit my problem. I have followed the steps in this tutorial:   Here is an image of the CSV file:    here is the import dialog box:   and here is the QGIS attribute table after import:   I am saving in WGS84.  I tried the local projection (NAD83 Zone 19N) but that made no difference.   I am using QGIS 2.12.1 on Windows 10. Any suggestions on what I am doing wrong? Publicity badges might be taking internal links into account? Do particles in a sound wave ever move transversally? I'm trying to visualize how sound waves work and I was curious about something.   So sound moves in longitudinal waves, which I think I understand.  There is a really good  explaining this.  In the video the air particles are depicted as moving from left to right (longitudinally). But do they ever move up and down even a little bit? Are they on some kind of fixed axis where they can only move longitudinally and never move even the slightest bit in a vertical direction? Prove that $\exp(x)>0$ using only formal definition of exp Windows update doesn't progress beyond 0 KB 0% I have Windows&nbsp;7 64-bit and the  isn't working properly. What can I do? Laptop (Asus x555u) screen turns off as soon as you remove the power cord Implementing a PIVOT query What methods can I use to infer a distribution if I know only three percentiles?  For example, I know that in a certain data set, the fifth percentile is 8,135, the 50th percentile is 11,259, and the 95th percentile is 23,611.  I want to be able to go from any other number to its percentile.  It's not  my data, and those are all the statistics I have.  It's clear that the distribution isn't normal.  The only other information I have is that this data represents government per-capita funding for different school districts.  I know enough about statistics to know that this problem has no definite solution, but not enough to know how to go about finding good guesses.  Would a lognormal distribution be appropriate?  What tools can I use to perform the regression (or do I need to do it myself)? I read a collection of Sci-Fi short stories back in the 1970's or early 80's that had one about a couple in love who kept losing each other. The book was my dad's so the story itself could be much older than that. I am very fuzzy on the details as I was young when I read it and it was so long ago. I believe the woman/girlfriend was "taken" (by some bad guy aliens??) while she was sleeping. I think it involved time travel and the man had to search through time to find her. After he found her, when he was asleep one time, he somehow was then "taken" and I think transported through time and had to fight his way back to her again. He may have been some sort of police officer. I just remember in the end, at night when they went to bed, the couple always wore handcuffs so they were never separated when they went to sleep ever again. Does this ring a bell with anyone?  (There is a possibility it is in a short story collection that also contained " The Twonky " by Lewis Padgett (1942), as I remember reading that story around the same time)