I am trying to learn Java. The Eric Roberts text, "The Art and Science of Java" has a programming assignment where we simulate a flight booking console. I wanted to 'class it up' by using a City class where just a City String would do. It only has one field, name, which is a String, but I am trying to learn how to use classes.  Anyway, so then I had to override the equals method in the City class to avoid getting duplicates. So then I had to override the hashCode method.  Now my HashMap&lt;City,ArrayList&lt;Flight&gt;&gt; isn't working. It can't find certain values and it still permits duplicate keys.  My City equals and hashCode overrides are as follows. Can anybody see why my HashMap is going wrong?  /* (non-Javadoc)  * @see java.lang.Object#equals(java.lang.Object)  */ @Override public boolean equals(Object that) {     // TODO Auto-generated method stub     if ( this == that ) return true;     if ( !( that instanceof City) ) return false;     City aThat = (City) that;     return (name == aThat.name ); }  @Override public int hashCode() {     // TODO Auto-generated method stub     return name.hashCode(); }
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?
Function $f(z)$ is holomorphic at least within the unit disk.   If for all arguments $|z|&lt;1$ we have $|f(z)| \le 1$, and there exists a zero of order $n$ at $z=z_0$, then show that $|f(0)| \le |z_0|^n$.  How should I tackle this problem? Can it be generalized if for $|z|&lt;R$ we have $|f(z)| \le M$ ?    So far I only understand that there exists a holomorphic $g(z)$ with $g(z_0) \ne 0$ such that $f(z) = (z-z_0)^n g(z)$,then $|f(z)| = |z-z_0|^n |g(z)| \le 1$ and moreover $|f(0)| = |z_0|^n |g(0)|$, but that doesn't seem useful since apparently I know too little about $g(z)$. In particular why should $|g(0)| \le 1$? What is the possibility of a railgun assisted orbital launch? Basic facts: The  is 2.4 miles deep.  Railguns  of a projectile on the order of 7.5 km/s.  The Earth's  is 11.2 km/s.  It seems to me that a railgun style launch device built into a deep shaft such as an abandoned mine could reasonably launch a vehicle into space.  I have not run the calculations and I wouldn't doubt that there might be issues with high G's that limit the potential for astronauts on such a vehicle, but even still it seems like it would be cheaper to build such a launch device and place a powerplant nearby to run it than it is to build and fuel single-use rockets.  So, what is the possibility of a railgun assisted orbital launch?   What am I missing here?  Why hasn't this concept received more attention? Extra Backslash Required in First Appended Newline in sed When you die, 3 things happen.    You swear  A message appears in the chat log describing how you died A "You died" screen appears, with the options to quit or respawn, and a "Score".   What contributes to this score? Is there a way to install a newer version than in the repository?  Ubuntu installs vagrant 1.4.3 at the moment, but I need at least 1.5 Two column float with [t] using the cas-dc template I am using the cas-dc template for Elsevier. When trying to use \begin{figure*}[t], except I get the error 'The module 'cas/fig' does not have a key called 'cas/fig/t'. Other templates I use work fine. I have included \usepackage{stfloats}. I don't see anything mentioned that strictly forbids it, unless I missed this. Anyone know why? TestMethod do not support Web service callouts, test skipped Disable UpdateOrchestrator Reboot task Last time I asked a similar question but that was about svn related versioning info. Now I am wondering how to query windows "File version" attribute about eg. a dll. I payed attention to wmi and win32file modules as well without success. I read this set of stories in the 80's.  What I recall is this:  A planet where the ruling caste was made up of humanoid women.  These women would, as almost pubescent girls, go out into the wilderness with only a spear and attempt to kill an animal in a life or death struggle.  When it happened, they would burst open a DNA packet in themselves that caused them to rapidly mature, their skin to become bronze colored, and give them some kinds of other "powers", I think over fire.  They were called "Bahronas", I think.  The population of this planet was primitive, but they were in contact with an advanced humanoid species, I think of actual homo-sapiens, who were there observing and advising them.  The advanced species wasn't allowed to intervene, just advise and watch.  The main character was a castaway boy, crash landed on their planet and stranded.  He became friendly with the ruling family of Bahronas and entered their confidence.  We find out through the course of the story that he's been genetically engineered and is not a normal boy.  At some point, the advanced species notices him and explains that he is a clone of a famous explorer and a spy, and they explain that they won't do anything in front of him.  The central part of the story is something of a blur, but, the final part of the story is told in a dramatically different style and shifts to a planet populated by catlike creatures who live in boughs of silk scarves, some of which sing.  THey are recording devices which play back the songs.  On this planet, there is another silk scarf, a white one, which doesn't play a song at all.  The cat creatures are greatly disturbed by it when they hear it's message, which they don't understand.  The narrator then goes on to say that it's a spoken word recording, made by the explorer which the boy was a clone of, explaining that he is captured and held hostage on the planet which makes the scarves, and forced to help make them (I think.) Pass An Instantiated System.Type as a Type Parameter for a Generic Class When I try to connect to Google Play, it would say "download Google play service". After I downloaded it, it says that it is "not supported by your device, please contact the manufacturer". What changes with Kerberos authentication in IPv6 when everyone has a public IPv6 Address? How should Kerberos authentication be set up with IPv6?     What implications are there when client devices each use a public, globally routeable IPv6 IP address?  What changes when setup this way instead of using a NAT as was the norm with IPv4? Could you help me to point out the differences in the following sentences. for me both sentences imply same meaning.      The Restaurant , offers a broad range of locally caught fresh seafood,   prime steak and meat dishes      The Restaurant , offers a wide range of locally caught fresh seafood,   prime steak and meat dishes MySQL convert date string to Unix timestamp Does python have the ability to create dynamic keywords?  For example:  qset.filter(min_price__usd__range=(min_price, max_price))   I want to be able to change the usd part based on a selected currency. How to install Ubuntu on VirtualBox? I would like to know if anyone can help me with installing Ubuntu on VirtualBox We've had a number of instances over on Stack Overflow involving users who get to the reputation level where they can comment, then spam comments across the site. Due to the lack of community review around comments, these spammed comments can remain on the site for months before someone notices and flags one. Moderators then have to go and manually remove each of these comments. In the last few months, I've personally had to deal with two users who spammed their website across 200+ questions each.  This isn't just limited to people spamming comments with a URL in them. We've had a number of users spray the same nonsense comment or insult across tons of posts and have no one seem to notice for months.  What I'd like is some kind of system-generated notification when a user has posted a barrage of copied-and-pasted comments. This could possibly be triggered when a user has posted a set number of identical comments in a row (4 of them, maybe) or maybe even if they've posted the same comment multiple times. We receive similar system-generated flags when users post duplicate answers, edit many of their posts in a row, or delete many of their own posts at a time.  This system-generated flag should ignore comments generated by review (which have the same text in them). I'm thinking that it shouldn't ignore comments generated by custom off-topic reasons, because someone using the exact same close reason over and over again might be something we want to look into.  The flag itself won't do anything to a user, and would only appear to moderators. I imagine there will be a number of false positives, but it should be easy for us to check these and identify the well-intentioned stock comments from the problematic ones.   We currently have no means of detecting comment spam, so even if this didn't have a great hit rate it would still be beneficial on the balance. Running sample queries for this seems to indicate that it wouldn't have that much noise.  This would allow us to catch comment spam early, and prevent it from living on the site or developing into a more serious problem. Handling large numbers in C++? I read this story a long time ago and cannot remember either the title or the author. It was written in the 60s or 70s. The setting is sometime in the 21 century.  Here is a summary of the plot.  One of the great classical composers (maybe it was Schubert, I'm not sure) is revived with some future technology. All the guys in the lab are very happy about it, the world cheers the achievement. The composer is also quite excited to be alive. Naturally, he is asked to perform a concert. He asks for ink and music paper. Nobody knows what that is: in those days everybody writes music directly in "frequency spectrum" and similar stuff.  The composer, excited to create music again, tries to come up with something but he doesn't like anything he writes. The music is well written, but lacks something essential, it doesn't sound like his real music. Finally, the composer realizes that the lab guys recreated his mind from reviews by music critics, and his music just sounds like that. He performs the concert. The audience enjoys it, applauds and bravos. Not only to composer, but also to the lab guys.   At the end, if I remember it right, the composer gloats over the  primitive taste of the audience. The audience who writes music in frequency spectrum and applauds to lab guys at the music concert did not see the failure in the concert and ate it as it is.  Does someone recognize the story?  PS all the recent talk of advent of AI machines with Machine Learning algorithms reminded me of this story.