This is my Java code to read text from a text file  import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException;  public class checking { public static void main(String[] args) throws IOException {  // Create a BufferedReader from a FileReader. BufferedReader reader = new BufferedReader(new FileReader("pw.txt"));  // Loop over lines in the file and print them. while (true) {     String line = reader.readLine();     if (line == null) {     break;     }      System.out.println(line); // The output is abc     if(line=="abc"){         System.out.println("true");     } else {         System.out.println("false"); //However it show false...     } }  // Close the BufferedReader. reader.close(); } }   Inside pw.txt, there is only one line which the only text in there was abc.  I did an if statement to check if the line is equal to "abc" however the output was false... which I don't quite understand. Did I made any stupid mistakes?
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 install packages with apt-get on a system connected via proxy? I've got an Ubuntu 11.10 system connected via a proxy to the internet, and I would like to install packages via apt-get. When I try to do that I get this error message:  sudo apt-get install libboost-program-options-dev [...] Err http://gb.archive.ubuntu.com/ubuntu/ oneiric/main libboost1.46-dev i386 1.46.1-5ubuntu2 407  Proxy Authentication Required   Any ideas? Getting raw SQL query string from PDO prepared statements Is there a way to get the raw SQL string executed when calling PDOStatement::execute() on a prepared statement? For debugging purposes this would be extremely useful. I'm Australian and have obtained my Canadian working visa. However rather than flying direct to Canada I am meeting an American friend in LA and driving across the border. I have a return flight booked back to Australia from LA in March of next year too. Will the esta visa will be enough to enter the USA because I have my Canadian working visa and plan to travel there? Or will there be a problem because my return flight is booked later then the 90 days allowed on the visa. Do sets, whose power sets have the same cardinality, have the same cardinality? The exercise is: Prove that $-(-v)=v$ for every $v \in V$  Proof Suppose  $v \in V$ and $V$ is a vector space. Then $-(-v) \in V$ as result of the scalar multiplication property and $-(-v)=-(-1\cdot v)=-1 \cdot(-1\cdot v) =(-1 \cdot-1)\cdot v = 1 \cdot v = v $ The desired result $-(-v)=v$ holds.  The solution manual gives the proof:  Proof   I just wanted to make sure that the way I did the proof isn't missing anything?Thanks What is a "locked" post? A post can be locked.   What does it mean to lock a post? Who can lock a post? When should a post be locked? Show that  $$t(n) = 1 + \sum_{ j=0}^{n-1} t(j)$$  is the same as  $$t(n) = 2^n$$  Initial condition $t(0) = 1$ Switching from MTB to road handlebars Is there a word for the sadness over "What might have been"? How to get the valid URL of a Link field from within a Twig template? I have a Link field named field_my_link (machine name).  Within a Twig template I can get the link's URL value with this:  {{ node.field_my_link.uri }}   If inside the Link's URL there is an external URL, e.g. http://example.com it works good.  But, if inside the Link's URL there is stored an internal URL, e.g. "/node/11", I get a value like this:  "internal:/node/11"   with the "internal:" prefix.  How can I get the valid URL?  For example, if the link's URL is "http://example.com" I want "http://example.com" (this already works), if the link's URL is "/node/11" I want the relative URL "/node/11", if the link's URL is "&lt;front&gt;" I want the URL "/", etc.    EDIT  I can get the value I want within a PHP preprocess function, using this:  $url = $variables['node']-&gt;get('field_my_link')-&gt;first()-&gt;getUrl();   How can I access the same value within the Twig template?  I know I can do this within the preprocess function:  $variables['my_url'] = $url;   Then access the url within Twig using {{ my_url }}, but I would avoid to write a preprocess function each time I have a link field. Subsubsection: remove the newline (like paragraph) Using the article document class, how can one remove the newline at the end of a subsubsection title?  I am using \documentclass{article}; I do not currently use titlesec or any of the alternatives; I do use fancyhdr. apache2 mod_rewrite redirect without http body Android App sometimes loses answer drafts Question regarding the validity of the big bounce I have several questions regarding the "big bounce" theory. It appears to be popular among LQG researchers. My questions are as as follows.  1) How one reconciles it with the fact that it is now experimentally established that the universe is expanding in an accelerating manner?  2) The entropy of the universe should have been very very low (maybe zero) at the time of the big bang/ big bounce. What was the entropy "before" that event? Was it even lower? If it was lower then doesn't that mean entropy decreases indefinitely? On the other hand if we accept the entropy was higher then doesn't that violate the second law of thermodynamics?  3) What observational evidence can confirm pre-bounce physics? According to GR there are some points near the bang/bounce where one simply can't easily define time in a meaningful way. Even for a quantum gravity theory, is it possible for any theory to extrapolate itself "before" the "bounce"? If there are no observational consequences after the bounce shouldn't one apply Occam's razor? $\sum \cos$ when angles are in arithmetic progression How to find unused/dead code in java projects What tools do you use to find unused/dead code in large java projects? Our product has been in development for some years, and it is getting very hard to manually detect code that is no longer in use. We do however try to delete as much unused code as possible.  Suggestions for general strategies/techniques (other than specific tools) are also appreciated.  Edit: Note that we already use code coverage tools (Clover, IntelliJ), but these are of little help. Dead code still has unit tests, and shows up as covered. I guess an ideal tool would identify clusters of code which have very little other code depending on it, allowing for docues manual inspection. What does standard deviation tell us in non-normal distribution In a normal distribution, the  imparts standard deviation a lot of meaning, but what would standard deviation mean in a non-normal distribution (multimodal or skewed)? Would all data values still fall within 3 standard deviations? Do we have rules like the 68-95-99.7 one for non-normal distributions? When reading a stack trace like:  [FormatException: Input string was not in a correct format.]    System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer&amp; number, NumberFormatInfo info, Boolean parseDecimal) +2755599    System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) +112    System.Convert.ToInt32(String value) +68   What do the +68, +112, etc. numbers mean. I'm guessing that they're offsets to something. If so, what? Why do my LED lights stay on, even when the switch is off? Typesetting a full citation whose title ends with a word in braces I am using Biblatex and need to typeset full citations in my document text, so I'm using .  While it works correctly most of the time, it has trouble with Biber/BibTeX entries where the last word of a field is enclosed in braces (to force capitalization).  In these cases, \longfullcite may fail to properly capitalize the following word.  Take the following example:  \documentclass{article}  \usepackage{biblatex} \makeatletter \newcommand{\tempmaxup}[1]{\def\blx@maxcitenames{\blx@maxbibnames}#1} \makeatother \DeclareCiteCommand{\longfullcite}[\tempmaxup]   {\usebibmacro{prenote}}   {\usedriver      {\DeclareNameAlias{sortname}{default}}      {\thefield{entrytype}}}   {\multicitedelim}   {\usebibmacro{postnote}}  \usepackage{filecontents}  \begin{filecontents}{test.bib} @inproceedings{blow2015,   author       = {Blow, Joe},   title        = {{GNU} loves me},   year         = 2015,   booktitle    = {Proceedings of Some Conference}, }  @inproceedings{blow2016,   author       = {Blow, Joe},   title        = {I love {GNU}},   year         = 2016,   booktitle    = {Proceedings of Some Conference}, } \end{filecontents}  \addbibresource{test.bib}  \begin{document} \nocite{*} \noindent \longfullcite{blow2015}\\ \longfullcite{blow2016} \printbibliography \end{document}   Here is the output:    Note the inconsistent capitalization of the word "In" produced by the two \longfullcite commands.  By contrast, the citations emitted by \printbibliography correctly capitalize "In" for both entries.  What is causing this inconsistency and how can I fix or work around it (preferably by changing the definition of \longfullcite rather than changing the .bib file)?