Finish the logic of search on java When the array argi has more than one partition, its only begins to find word from the second url of the array, but why? Correct it please in code. Here the part of it: I make regular expresion for search by title in url:  private final Pattern TITLE = Pattern.compile("\\&lt;title\\&gt;(.*)\\&lt;\\/title\\&gt;", Pattern.CASE_INSENSITIVE | Pattern.DOTALL);   And searh logic here:  public String search(String url, String someword) {                      try {                         InputStreamReader in = new InputStreamReader(new URL(url).openStream(),"UTF-8");                         StringBuilder input = new StringBuilder();                         int ch;                         while ((ch = in.read()) != -1) {                             input.append((char) ch);                         }                         if (Pattern.compile(someword, Pattern.CASE_INSENSITIVE).matcher(input).find()) {                             Matcher title = TITLE.matcher(input);                             if (title.find()) {                                 return title.group(1);                             }                         }                     } catch (IOException e) {                         e.printStackTrace();                     } catch (PatternSyntaxException e) {                         e.printStackTrace();                     }                     return null;                 }              String[] argi = {"http://localhost:8080/site/dipnagradi","http://localhost:8080/site/contacts"};                                  for (int i = 0; i &lt; argi.length; i++) {                                      String result = search(argi[i], word);                                      if (result != null) {               str = "Search phrase " + "&lt;b&gt;"+ word + "&lt;/b&gt;" + " have found " + "&lt;a href=\"" + argi[i] + "\"&gt;" + result + "&lt;/a&gt;"+ "&lt;p&gt;&lt;/p&gt;";                       }                                     else{                                         str="Search word not found!";                                     }                                          if (word == null||word=="") {                                          str = "Enter a search word!";                                       }                             }                             return null;                   }
How do I compare strings in Java? 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 convert an array into comma separated strings in smarty template? I have accounts in Stack Overflow, Programmers, Unix &amp; Linux and Area 51. I don't want to continue my Area 51 account, so I planned to delete my Area 51 account. I have performed the following steps to delete my account, but I couldn't!  Case 1     If your account has votes or posts do the following steps:         Edit the "About Me" section of your profile to say “please delete me”.   Contact the SE support to request deletion.      I edited my "About Me" section to "please delete me". When I contacted SE Support to delete my account, I couldn't make a request. I am getting the following error:  This operation is incomplete. please do it in main site.   For deleting Area 51 account, when I do it main site, in link for deletion column I gave the Area 51 link. It says that:  it is not valid link!   Case 2     If the account has not interacted with the site yet (votes or posts), click on the delete button on your user page next to the edit link.   I am not eligible for this case!  Then how to delete my Area 51 account? Any help is appreciated! Using LINQ to concatenate strings What is the most efficient way to write the old-school:  StringBuilder sb = new StringBuilder(); if (strings.Count &gt; 0) {     foreach (string s in strings)     {         sb.Append(s + ", ");     }     sb.Remove(sb.Length - 2, 2); } return sb.ToString();   ...in LINQ? Bending of light - photon's inertia instead of mass Let $\{s_n\}$ and $\{t_n\}$ be sequences.  I've noticed this inequality in a few analysis textbooks that I have come across, so I've started to think this can't be a typo:  $\limsup\limits_{n \rightarrow \infty} s_n + \liminf\limits_{n \rightarrow \infty} t_n \leq \limsup\limits_{n \rightarrow \infty} (s_n + t_n) \leq \limsup\limits_{n \rightarrow \infty} s_n + \limsup\limits_{n \rightarrow \infty} t_n$.  I understand the right two-thirds of the equation, and can prove it.  I'm stuck on the far-left third.  I don't understand how that is true. I was viewing some old posts on Stack Overflow (two-year-old posts) and found that due to "fast technology trend changing," some of them are no longer valid. Stack Overflow (and the Stack Exchange sites generally) should have some sort of criteria to tag questions as Obsolete, or a vote-based system to mark them as such.  I am not in favour of closing obsolete questions. What's the function of the "|" (pipe) operator? Changing Login Logo What's the difference between Invoke() and BeginInvoke() Just wondering what the difference between BeginInvoke() and Invoke() are?   Mainly what each one would be used for.  EDIT: What is the difference between creating a threading object and calling invoke on that and just calling BeginInvoke() on a delegate? or are they the same thing? How To Make A Solid Object Drop To The Ground Like It Was Liquid So I have a simple bouncing ball animation, but I just wanted to something "weird" for the ending. Is there a way to change the ball's material on the fly, where after the last bounce it changes materials and physical composition from a rigid body(baked animation now) to a fluid sim?  (within 30-40 frames) How to round pixel values of a raster in QGIS? I have a raster with float number values for example: 2.544459104537964 and I want to round these up to integers. I have seen other posts on ArcGIS like  but when I use Raster Calculator in QGIS, Int(myraster + 0.5) only makes the first value (which is 0) to 0,5 and the last one (which is 100) to 100,5. The other pixels stay float. What is the meaning of the axes in t-SNE? I'm currently trying to wrap my head around the  math. Unfortunately, there is still one question I can't answer satisfactorily: What is the actual meaning of the axes in a t-SNE graph? If I were to give a presentation on this topic or include it in any publication: How would I label the axes appropriately?  P.S: I read  Reddit question but the answers given there (such as "it depends on interpretation and domain knowledge"), don't really help me to understand this. Assume I have many TeX files. For the sake of simplicity, also asssume they are in a single folder or directory.  I want to input all files from within my main LaTeX document. Actually I can create a list of those files using C# in advance.  To enrich my view about LaTeX or TeX, could you tell me whether or not this job can be done only by using pure TeX or LaTeX? I am trying to find a story where a children's nursery turns into a jungle I read this short story(I believe it was under novella length, but I could be mistaken) a while back, and I am trying to identify the title for a friend.   Plot:      Parents(male and female) get a computer aided/holographic nursery for their children. The mother becomes increasingly agitated as the children withdraw more. The children are barely even featured in the story, and the ending concludes with lions possibly eating the parents.   Publishing date: Years ago.   Tech level: Seemingly functional AI, not much more. I've had a couple of answers today where the OP indicated via a comment that I solved their problem, but the question wasn't upvoted or accepted.  In both cases the person probably wasn't able to upvote since they were new, but they could have accepted my answer. I felt a little guilty asking them to accept the answer, but since it solved their problem I felt that it would help others who stumbled on the question trying to solve their own problem to know that my solution really was the answer. Is asking the OP to accept your answer when they've said that it solved their problem a reasonable thing to do or does that feel like nagging for reputation? I'm learning JavaScript and while browsing through the jQuery library I see : (colon) being used a lot. What is this used for in JavaScript?   // Return an array of filtered elements (r) // and the modified expression string (t)    return { r: r, t: t }; About fullscreen scrolling webpages There are recently many websites using full screen scrolling pages since Apple launched their own with the iPhone 5C. (website not available anymore, but a reproduction can be found )  Some other examples are:            Is there any study about this practice from the UX point of view? More than about the scroll highjacking, about the use of full screen content?  It seems to me that it's an easy way to present information to the user when used properly and in a simple way, just like a good Power Point presentation. A way to show the user the most important things in a beautiful and smart way.  I see many developers complaining nowadays about this kind of sites, mainly because of the scrolling highjack, but it seems to me users in general, as well as clients, like them.  Any thoughts about this? What would be the differences between a persistent USB Live Session and a installed Ubuntu in a USB drive? I'm a teacher and will ask my students to either bring their laptops with Ubuntu installed with an specific list of packages preinstalled or bring a USB Drive or External Hard Drive with Ubuntu and the packages preinstalled.  For those who are going to bring the USB are two posibilities:   Install with the Ubuntu's "Startup disk creator" program, and telling it to reserve some space for persistence. Boot with a LiveCD and Install Ubuntu in the USB drive.   Then, in either case, boot with that media and install the packages.  So, for my purpose or any other purpose:   What is the best choice and why? Do we have another option? full explanation please. Cut one side of a rectangle node in TikZ I would like to draw two consecutive rectangle nodes (one is next to the other with an intersected edge). How to cut one side of a rectangle node in TikZ so that the intersected side looks like others?   Consider the example below, I don't want the "duplicated" edge between node 1 and 2.   \begin{tikzpicture}    \node [style={draw, inner sep=0pt, minimum size=0.5cm}]           (1) at (0, 0)  { $1$ };   \node [style={draw, inner sep=0pt, minimum size=0.5cm}]           (2) at (0.5, 0)  { $2$ };  \end{tikzpicture} Ordinal dependent variable with continuous independent variables