So, I want to change the selected value of comboBox depending on values I read from my object. This is what I have so far:  public String[] waluta=new String[] {"EUR","PLN","USD"};  public GameEditFrame(int index) {      ...      JComboBox walutaBox = new JComboBox(waluta);     String tmp=main.katalog.gra.get(index).cena.getWaluta();      if (tmp=="EUR" || tmp==null){         walutaBox.setSelectedItem(waluta[0]);     }else if (tmp=="PLN"){         walutaBox.setSelectedItem(waluta[1]);     }else if (tmp=="USD"){         walutaBox.setSelectedItem(waluta[2]);     }      ... }   Sadly, this is not working. Any ideas?    EDIT: SOLVED  Thanks to ZouZou and MadProgrammer comments I've modded previous code. Now it looks like this and it works fine:  public String[] waluta=new String[] {"EUR","PLN","USD"};  public GameEditFrame(int index) {      ...      JComboBox walutaBox = new JComboBox(waluta);     String tmp=main.katalog.gra.get(index).cena.getWaluta();      if (tmp==null)         tmp="EUR";      walutaBox.setSelectedItem(tmp);      ...  }
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 do I set a monitor resolution that is not available in the Display Settings dialog? What is the setting in bash for globbing, to control whether * matches dot files I was surprised recently when I did something like mv ./* ../somedirectory and found that files like .gitignore were not moved.  I do most of my work in zsh on OS X, and this surprise bit me in bash on CentOS.  I tried bash on OS X and found the same behavior: * does not match dot files.  This seems very undesirable to me, but apparently it's the bash default.  (It may be the zsh default too for all I remember, but I may have changed it years ago in my .zshrc and forgotten it ever worked differently.)  How can I configure bash to behave as I expected: for * to match all files, and not ignore dot files.  In case this is at all unclear, here's how to reproduce it    cd /tmp mkdir {t,d}est touch test/{.,}{1,2,3,4,5,6,7} ls -hal test mv test/* dest ls -hal test     # notice dot files are still there ls -hal dest     # notice only some files were mv'ed $ \int_1^2\int_1^2 \int_1^2 \int_1^2 \frac{x_1+x_2+x_3-x_4}{x_1+x_2+x_3+x_4}dx_1dx_2dx_3dx_4 $ Permanent xmodmap in Ubuntu 13.04 I cannot make xmodmap run on login in Ubuntu 13.04. I have searched around, including in askubuntu and all answers I found do not work.  I have a file named .Xmodmap in my home folder which contains the desired mappings. If I run it manually it works fine, so there is no error there. In order to make it run on startup, I have tried:     Using various .xinitrc containing one of the following commands:      xmodmap .Xmodmap xmodmap ~/.Xmodmap   /usr/bin/xmodmap /home/NAME/.Xmodmap if [ -s ~/.Xmodmap ]; then xmodmap ~/.Xmodmap fi  Using .Xresources instead of .xinitrc with the same variations. Setting it as a startup application.   None of the above works in Ubuntu 13.04 (64-bit). I also saw a few ideas about globally changing the keyboard mappings, but most of them were not applicable in Ubuntu 13.04 (i.e. the corresponding files did not exist where specified) and I prefer not to touch the global settings anyway. How to throttle callback of jQuery event? Java volatile reference vs. AtomicReference Subsections as an enumerate I want to have subsections named all the same with a number behind it. The straight forward approach I came up with is this:   \section{User Stories} \subsection*{Userstory 1} This is story 1 \subsection*{Userstory 2} This is story 2   But I though isn't this possible as a list? So I have tried a few things but none worked. I have just learned the basics of LaTeX, and I want to try some more advanced tricks in LateX, but it won't work. I have tried this and some things very similar to this:   \section{User Stories} \begin{enumerate} [label=\subsection*{Userstory \arabic*}]     \item This is story 1     \item This is story 2 \end{enumerate}   Is this behaviour even possible to automatically? What is the best approach, for not typing the number and the title every time. Thanks in advance! How do levers amplify forces? This is really bothering me for a long time, because the math is easy to do, but it's still unintuitive for me.  I understand the "law of the lever" and I can do the math and use the torques, or conservation of energy. or whatever... And I can see that a lever can amplify a force you apply to it  if you apply a force on the longer side of the beam.  If I were to look at the molecular lever and see what actually happens when I push on the lever, and I give acceleration to the molecules, how does it actually happen that more force is transmitted to the other side?  Thank you all  p.s I'm looking just for an explanation in terms of forces and acceleration, it's clear to me how to do this in terms of energy or torques I'm an idiot, I was writing an image to a USB drive using dd when instead of typing /dev/sdb I typed /dev/sdd and wrote the 135mb image to my 750gb External Hardrive full of files. Is there ANY possibility of recovering the files or did dd completely zero out the drive? Please help, as this is one of the lowest points of my life EVER.  dd finished writing the 135mb image in 5 seconds, so I didn't have a chance to stop it. By the time I knew what happened to was too late. The command was as follows:   sudo dd if=generic.img of=/dev/sdd bs=1M   EDIT2: The External Harddrive's filesystem was FAT32(I've had the drive for awhile and FAT32 was the most Universal FS at the time). I also have a 2TB drive I just got which I was planning on moving most of the files to from the 750gb, If needed I can use it to transfer the Recovered files to. diameter on a compact metric space I have troubles showing the following:  Let $(X,\rho)$ be a compact metric space and $F \subset X$ a closed subset. Prove that if diam $F &lt; \infty$, then there exist $x_{0}, y_{0} \in F$ such that diam $F= \rho(x_{0},y_{0})$.  It looks so trivial yet hard to find the trick. Pluralizing Noun Phrase? Is it appropriate to use a question mark at the end of a compound sentence where the first independent clause is a question but the second is a statement? For example:     Do you want attribution for that quotation, because I'm definitely sharing it and want to know if I should give you credit?   or      Do you want attribution for that quotation, because I'm definitely sharing it and want to know if I should give you credit.   I suppose this could work, but it's a little niche, as the second clause might not always be appropriate for a parenthetical.     Do you want attribution for that quotation (because I'm definitely sharing it and want to know if I should give you credit)? Creating a new DOM element from an HTML string using built-in DOM methods or Prototype DataGridTextColumn.IsReadOnly seems to be faulty What do they do with all the plates and cups in Star Trek? When functions commute under composition Today I was thinking about composition of functions.  It has nice properties, its always associative, there is an identity, and if we restrict to bijective functions then we have an inverse.  But then I thought about commutativity.  My first intuition was that bijective self maps of a space should commute but then I saw some counter-examples. The symmetric group is only abelian if $n \le 2$ so clearly there need to be more restrictions on functions than bijectivity for them to commute.  The only examples I could think of were boring things like multiplying by a constant or maximal tori of groups like $O(n)$ (maybe less boring).  My question: In a euclidean space, what are (edit) some nice characterizations of sets of functions that commute? What about in a more general space?   Bonus: Is this notion of commutativity important anywhere in analysis? What are LiDAR returns? Can someone help with an explanation and some references, in order to understand the nature of return pulses within a LiDAR system. I got a bash script to synchronize data between two computers. It works fine but I have to type my password every time the rsync command is called.   #!/bin/bash  sourceIP="192.168.178.128" sourceUser="user1" destinationUser="user2"  function sync() {      rsync --archive --progress -v -e "ssh -l $sourceUser " $sourceIP:/home/$sourceUser/$1/ /home/$destinationUser/$1 }  sync Pictures sync Music sync Videos sync Documents   How to store the password (via prompt) in a variable and pass it to rsync/ssh? Hyphenation in compound adjectives Possible Duplicates:                In the sentence "Portland is known to be one of the most bike friendly cities in the US", is a hyphen necessary in "bike friendly"? As far as I know, the hyphen is only required when leaving it out would cause ambiguity. Wikipedia uses the example of "a small appliance factory" vs "a small-appliance factory".   As far as I can tell, the sentence above is pretty clear. A quick google search for "bike friendly city" brings up instances of both hyphenated and non-hyphenated usage. Thoughts?  Please excuse the poor formatting, sent from my iPhone. Using OR comparisons with IF statements When using IF statements in Python, you have to do the following to make the "cascade" work correctly.  if job == "mechanic" or job == "tech":         print "awesome" elif job == "tool" or job == "rock":         print "dolt"   Is there a way to make Python accept multiple values when checking for "equals to"? For example,  if job == "mechanic" or "tech":     print "awesome" elif job == "tool" or "rock":     print "dolt"