I have a listview and when it clicks on a certain option I want it to create a new intent. Like a menu item. This is my first time working with list views, so I'm probably just missing the right way to do this, but is there an easy fix?   private void registerClickCallback() {     ListView list = (ListView) findViewById(R.id.mainlist);     list.setOnItemClickListener(new AdapterView.OnItemClickListener() {      @Override     public void onItemClick(AdapterView&lt;?&gt; parent, View viewClicked, int position, long id) {         TextView textView = (TextView) viewClicked;         Toast.makeText(main.this, position, Toast.LENGTH_SHORT).show();         if(textView.getText().toString() == "my Profile"){             Intent intent = new Intent(this.getApplicationContext(), myProfile.class);             startActivity(intent);         }     } });      cannot resolve method 'getapplicationcontext'
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?
My disk already has 4 primary partitions, how can I install Ubuntu? Imaginary line on the Earth is straight or not? I was watching Google map. Saw a line which is joinging north to south pole. It is going between middle of China and Mexico. But, the line is not straight. Tried to search in net but not able to get anything. Can anyone check and let me know  or Wiki-tag edit error is non-descriptive I've been editing some wiki entries on the new Expatriates site, and started to get the following error:    When I go to a normal post, I see what is presumably the proper explanation:    Can the Wiki Tag edit error be updated to show a more meaningful error message? Is a droid a ‘he/she’ or an ‘it’? Inspired by  question.  Are droids in the Star Wars universe referred to with gendered pronouns (i.e. he or she), or are they referred to as objects (i.e. it)? How prove this diophantine equation $x^2+y^2+z^3=n$ always have integer solution show that: For any postive ineteger $n$,then the equation    $$n=x^2+y^2+z^3$$   always have integer solution   My idea: such as $n=1$,then we have $$1=0^2+0^2+1^3$$ $$2=0^2+1^2+1^3$$ $$3=1^2+1^2+1^3$$ $$4=2^2+0^2+0^3$$ $$5=1^2+2^2+0^3$$ $$6=1^2+2^2+1^3$$ $$7=2^2+2^2+(-1)^3$$ $$8=0^2+0^2+2^3$$ $$9=1^2+0^2+2^3$$ $$10=1^2+1^2+2^3$$ $\cdots\cdots\cdots$  But for  general $n$, How prove it? Are C++ enums signed or unsigned? And by extension is it safe to validate an input by checking that it is &lt;= your max value, and leave out >= your min value (assuming you started at 0 and incremented by 1)? When does $P(x)=\sum_{n=0}^{\infty}{\frac{n!}{n^n}\cdot x^n}$ with $x\in \mathbb{C}$ converge? What is the best way to close an ASPX page from the code-behind?    I have a button event handler that I want to close the page after the user has clicked an ASP.NET button on the page.  I have tried to programmatically add a JavaScript method that contains a window.close() command to the OnClientClick event to close the page but it does not work.  The button is also a asp:AsyncPostBoskTrigger for an AJAX Update Panel.  The application uses .NET Framework 3.5. Selecting an ID with a colon in it with jQuery How to gather full network usage statistics on a freebsd router? I have a freebsd box, which serves as a router from LAN to the outside world. It has several Internet providers, OpenVPN servers and clients, NAT and so on.  I would like to have complete statistics on when, who, to whom, via which provider, via which protocol, and how many bytes have been sent.   I agree that the minimal time scale will be an hour, i.e. no need for millisecond precision.  I tried vnstat2, ntopng and some other programs, but they don't seemed to have what I need or it is not obvious.   I don't understand, why this feature is not easily available. But I am not good in freebsd, so please, give me some clues. I get the following error when i do sudo apt-get update  W: GPG error: http://ppa.launchpad.net precise Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 6AF0E940624A220   I tried following ways after reading various questions here and also by googling.  I tried  sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6AF0E1940624A220   It did not help. I also tried  sudo gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys   thinking port 11371(default) may be blocked due to firewall.  I also tried to reset everything as follows  sudo rm /var/lib/apt/lists/* -vf sudo apt-get update &amp;&amp; sudo apt-get upgrade   still i get the same error or get update. Any other possible solution I can try? Does the series $\sum \sin^{(n)}(1)$ converge, where $\sin^{(n)}$ denotes the $n$-fold composition of $\sin$? How can I achieve the correct garden tap orientation when threading it in? I'm installing an external tap using a wall plate like this one:    And a tap like this one:    This might be a stupid question, but if I screw the tap into the wall plate it will end up at a certain angle. I can install the wall plate with that angle and the tap will end up with the correct orientation (i.e. pointing down). But what if I want to put another tap in later that has its thread cut slightly differently? How do I prevent it ending up upside-down or whatever? Are all the threads cut exactly the same in these taps?  This seems like a stupid design. The total number of locks exceeds the lock table size What is the value of $i^{i^{i^\ldots}}$? What is the value of $i^{i^{i^\ldots}}$?   My effort is the following: If $z, \alpha \in \mathbb{C}$ with $z \neq 0$ then we can write $z^{\alpha}=e^{\alpha \log z} = e^{\alpha [ \log |z|+i \text{ Arg z} + 2 \pi i m]}$ where $ m=0, \pm 1, \pm 2, \ldots$  and Arg z is the principle argument of the complex number $z$. But in above expression we don't have the finite no of exponents, so I am not sure how should I use this formula to the solve above problem. Thanks and Regards! I was playing terraria today, and my friend came and deleted the my world.  Is there a way for me to recover my world? The code for reference is this  @article{matcontcl,  title= {MATCONT and CL MATCONT},  author = {A. Dhooge, W. Govaerts, Yu.A. Kuznetsov, W. Mestrom, A.M. Riet and  B.Sautois},  year = {2006},  journal = {Continuation toolboxes in matlab}, }   This is the error that follows  This is BibTeX, Version 0.99d (TeX Live 2015/W32TeX) The top-level auxiliary file: PropuestaInvestigacion.aux The style file: abbrv.bst Database file #1: biblio.bib Too many commas in name 1 of "A. Dhooge, W. Govaerts, Yu.A. Kuznetsov, W. Mestrom, A.M. Riet and B.Sautois" for entry matcontcl while executing---line 1049 of file abbrv.bst Too many commas in name 1 of "A. Dhooge, W. Govaerts, Yu.A. Kuznetsov, W. Mestrom, A.M. Riet and B.Sautois" for entry matcontcl while executing---line 1049 of file abbrv.bst Too many commas in name 1 of "A. Dhooge, W. Govaerts, Yu.A. Kuznetsov, W. Mestrom, A.M. Riet and B.Sautois" for entry matcontcl while executing---line 1090 of file abbrv.bst Too many commas in name 1 of "A. Dhooge, W. Govaerts, Yu.A. Kuznetsov, W. Mestrom, A.M. Riet and B.Sautois" for entry matcontcl while executing---line 1090 of file abbrv.bst (There were 4 error messages)   How could I fix it? How can one prove that $\lim_{n \to \infty}a^{1/n}=1$ for every $a>0$? Prove that $\lim_{n \to \infty} a^{\frac{1}{n}} = 1$ if $a &gt;0$.  In my textbook, we are given a suggestion to let $a^{\frac{1}{n}} = (1+h_n)$ and then show that the $h_n$ term goes to zero using a Theorem that states the following conditions:  $\lim_{n \to \infty} = \infty,$ if $a &gt;1, 1,$ if $a = 1,$ and 0, if $\vert a \vert &lt; 1$. I apologize for not formatting the above cases appropriately; I could not figure out how to use a giant left brace to group them altogether.  If I rewrite it as $a^{n^{-1}}$, then I thought that this might help, but I don't think the Binomial Theorem would then apply since the exponent is negative. Furthermore, the problem is only concerned with the positive, real $n$-th roots. I am quite stuck on this problem and any suggestions or advice would be greatly appreciated.   I am using the textbook Introduction to Analysis by Arthur Mattuck. Subspaces of separable normed spaces Let $X$ be a separable normed space. Is it true that every subspace is separable? If it was Hilbert space I would take the dense set and then their projections.  It sounds trivial but I cannot prove or disprove it...  Thank you. alias fo rm command ( cp comand issue )