I have a simple program that reads all the files from a given directory into an array. The array is then looped through and the file names listed in a JFrame as individual JLabels.   I am also able to read the file extension using this code:                   String extension = "";                 int i = FileName.lastIndexOf('.');                 if (i &gt; 0) {                     extension = FileName.substring(i+1);                 }   This works fine, however when I try to use the extension in an if statement like this:                      if(extension == "java")                      {                         System.out.println(FileName);                      }                      else                     {                       System.out.println("error");                     }   all i get is error statements in the console, even though there are several java files in the directory (as can be seen in the results JFrame!)  Can anyone tell me what the problem is? Thanks!
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?
Crash with error "No more room to grow table" The direction of static friction? My actual question is to find the number of transversal given a collection of set ...  After a little bit of study it has come down to:  How can we count the number of matchings in a bipartite graph with parts of size $m$ and $n$ such that it covers all $m$ vertices of the first part, $m \le n$?  I already know that there is a way to count the number of perfect matchings in a bipartite graph with $m=n$ using the permanent of its (square) incidence matrix. Export each image from a collection in Google Earth Engine I am trying to export each image in a filtered stack of Sentinel-1 images and cannot seem to get it right.   suggests using imageCollection.map() and a custom function (such as a geometric clip).  // Create a geometry representing an export region. var roi = ee.Geometry.Rectangle([-63.0, 9.2, -63.1, 9.3]);   // Load the Sentinel-1 ImageCollection. var sentinel1 = ee.ImageCollection('COPERNICUS/S1_GRD');   // Filter by metadata properties. var IW_H = sentinel1   // Filter to get images with VV and VH dual polarization.   .filter(ee.Filter.listContains('transmitterReceiverPolarisation', 'VV'))   .filter(ee.Filter.listContains('transmitterReceiverPolarisation', 'VH'))   // Filter to get images collected in interferometric wide swath mode.   .filter(ee.Filter.eq('instrumentMode', 'IW'))   // Filter IWs to get High res.   .filter(ee.Filter.eq('resolution', 'H'))   // Filter IW-Highs to get 10m res   .filter(ee.Filter.eq('resolution_meters', 10));   // Filter to get images from different look angles  var DescCollection = IW_H.filter(ee.Filter.eq('orbitProperties_pass', 'DESCENDING'));   var ClipFunc = function(iImage, geom) {   var iClip = clip(iImage, geom);   return(iClip); };   imageCollection.map(ClipFunc(DescCollection, roi)); Improving Review Queues - Design overview II: Changing review bans and other new features This is one of three project announcements for Improving Review Queues. We’ve summarized the project objectives and goals . As a reminder, this project is still in the . In this post, we are sharing proposed changes to review bans and other new features. We are asking for your feedback before we begin implementation. After we collect community feedback, we will be open to including changes into the next design iteration. Suspension of privileges  Most users learn how to be good reviewers by actually reviewing posts, but sometimes find themselves making wrong decisions. This can lead to a less than obvious suspension of privileges, with too little guidance as to what they did wrong and how they can improve in the future. In the event of a suspension, a user will be notified in the Review Queue dropdown. A post notification will be available with reason and time remaining on the Review Queue main page, along with guidance for continued learning in this area. We’re also proposing softening the language by renaming “review bans” to “review suspensions.” Open questions:  Do you have suggestions of other ways we can notify reviewers of a ban? What information would be most helpful to you in this situation?  New features  My tasks We’re considering introducing a new, additional workflow and means of task discovery. My Tasks is a curated experience that’s currently based on your Watched Tags. This page includes an overview of pending tasks that may require more immediate attention or pique interest in a user’s subject-matter expertise.  Queue filtering We’d also like to add more useful, robust filtering options on all queues. Right now, the filter function is difficult to discover. We want to make this feature more noticeable and add queue-specific options. For example, you will be able to filter by your Watched Tags and sort tasks that are soon to expire out of each queue. Badges Currently, the gold Steward badge is awarded once at 1,000 reviews per queue regardless of whether you’ve performed 1,000 or 10,000 reviews. We propose that reviewers can now earn this badge multiple times, adding more opportunities to earn badges while reviewing - this change is intended to be retroactive. Open questions:  How would you want to be able to customize in My Tasks? Are there other review-centric badges you would like to see added?  In case you missed it... We propose changes to Onboarding and Updated workflows/pathways here: . How can I set the location (as it's picked up in CoreLocation services) in the iPhone Simulator? Is Responsive Design good for web based software? I host am ExpressionEngine based website on a single Amazon EC2 instance in the US East (Virginia) region. I use Ubuntu.    The website allows members to post their content, and displays it for other members and for users who are not logged in.   Goal: I need to begin serving the same website across the globe, equally fast to Hong Kong, New York, and Los Angeles.   I considered two solutions:  1.Setting up three separate EC2 instances for three regions: Virginia, Oregon, and Singapore. Use Amazon Rot53 Geo Location to direct traffic to instances based on the browser's IP address.   Pro: the website will load fast for the region.   Contra: these will be essentially three separate websites. Unless I am mistaken?   Setting up one instance in a region equally remote from all three locations: (Ireliand), and boost the server to the highest performance available.    Pro: It will be the same website for all regions.   Contra: it will cost a lot to make it fast enough.   My challenges:   a) I do not know a way to sync server settings, database, and content between multiple Ubuntu instances in real time. If a knowledgeable person could explain to me how to do that, I would be most grateful.   b) I am not thoroughly familiar with all Amazon AWS resources. Does AWS has a built-in method that would allow me to achieve my goal of serving a single PHP / MySQL based membership website across the globe equally fast in all three chosen locations? When is $\sin(x)$ rational? Evaluating $ \lim_{x \rightarrow 0}\left (\frac{\sin(x)}{x}\right)^\frac{1}{x^2}$ At some point in (I think) the 90s, I saw an episode of something like Outer Limits or Twilight Zone where nobody was allowed to have more than average intelligence. Smarter children had to wear headsets which inhibited them from being too intelligent, administering minor electric shocks if intellectual thought was detected.  I can remember a final (or near final) scene of somebody watching his suicide and being upset but not remembering why because of the headset.  Can anybody identify the show and episode? Where's my 5 minute grace period gone? I just posted an answer. (Revision history .)  I edited it a few seconds later (within my 5 minute grace period), and it comes up as a new revision!? Why?    ^^You can see 'answered 1 min ago', and then 'edited 1 min ago' - how is that possible?  Additionally, !?    I don't think this is a dupe of . See my comments on AI.E's answer. If you're a mod, it will really help. show that $$\lim_{n\to \infty}\sin{(n^m)}$$  divergent,where $m\in N^{+}$  I have kown $$\lim_{n\to\infty}\sin{n^2}$$  to be divergent and dense in $[-1,1]$. This is very  famous problem,the problem is first is post $AMM$( The American Mathematical Monthly,1970-1975) problem,and after some years  $AMM$ post $\sin{(n^{14})}$ in $[-1,1]$ was dense? and this is open problem.so I Guess  $$\sin{(n^m)}$$ is dense in $[-1,1]$. What damage can person/s do if they have your passport number and visa control number? I read  as well as  but it doesn't tell of what damages can be done. I have seen several sites on which people share/show the visa without the numbers and sometimes without name as well.   The only reason which many people perceive is identity theft but am unable to see how is that possible. I have to use public facilities such as printing, scanning etc. where it is easy for the operator to make copies without my consent. Also as shared, both these details are widely circulated when you stay in a hotel or anywhere else (when abroad) where identity information is needed.   Also particular to visas, as I'm given to understand, for short-stay visas (less than 3 months) which most tourist visas operate under, the window of doing anything nefarious activities (such as terrorism) would be extremely small. If I were a terrorist and I needed those bits to make work, then I would probably go for somebody who has a long-term stay as those credentials would look valid and I could jump from place to place under the radar under a fraudulent identity. Also as a terrorist, I would take quite a long view as any such attack takes years of planning, as shown in the investigation of various terrorist attacks in India as well as the U.S. Also, although I don't know (am speculating here) don't most airports might/should be checking on status quo of a passport to ensure issues such as showing 2 entries of a passport without exit (in some database where this information is collected and collated.)   Am I missing something in the logic here ? Contracting with Levi-Civita (totally antisymmetric) tensor Can you raise $\pi$ to a real power to make it rational? When do relativistic effects need to be explicitly included? Does an unplugged hard drive used for data archival deteriorate? If I were to archive data on a hard drive, unplug it, and set it on a (not dusty, temperature-controlled) shelf somewhere, would that drive deteriorate much?  How does the data retention of an unplugged hard drive compare to tapes? Whether and how to thank a girlfriend or boyfriend in the acknowledgements of thesis? How is it received by the academia if someone thanks to his/her girlfriend/boyfriend in the acknowledgements of the thesis?  I have seen writers including his/her fiancee in the acknowledgements, however I don't know if including an informal relationship in the thesis will be received well.  If it is acceptable, how should I refer to my girlfriend? How do shock waves form in space? Today my aerodynamics professor mentioned that the equations we were learning for atmospheric shock waves can also be applied by astrophysicists to study black hole-related shock waves in space.  How is this possible? Isn't space too rarefied for shock waves? What is an example application? He mentioned something about the density limit before/after a relativistic shock approaching 6.