I'm trying to have a FragmentActivity where User's input in an Editext can store in an array then will show to Listview but after entering a value and click the button, the application stopped.  I'm having this kind of output in my logcat  02-16 21:53:05.950    1315-1315/com.tipmanila.cite.traventurev2 E/AndroidRuntime﹕ FATAL EXCEPTION: main     Process: com.tipmanila.cite.traventurev2, PID: 1315     java.lang.NullPointerException             at com.tipmanila.cite.traventurev2.NotesFragment$1.onClick(NotesFragment.java:53)             at android.view.View.performClick(View.java:4442)             at android.view.View$PerformClick.run(View.java:18473)             at android.os.Handler.handleCallback(Handler.java:733)             at android.os.Handler.dispatchMessage(Handler.java:95)             at android.os.Looper.loop(Looper.java:136)             at android.app.ActivityThread.main(ActivityThread.java:5105)             at java.lang.reflect.Method.invokeNative(Native Method)             at java.lang.reflect.Method.invoke(Method.java:515)             at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:792)             at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:608)             at dalvik.system.NativeStart.main(Native Method)   My FragmentActivity look like this  @Nullable @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {     View v = inflater.inflate(R.layout.notes_fragment, container, false);      txt = (EditText) v.findViewById(R.id.txtInput);     show = (ListView) v.findViewById(R.id.listView);     save = (Button) v.findViewById(R.id.btnSave);     save.setOnClickListener(new View.OnClickListener() {         @Override         public void onClick(View v) {             String getInput = txt.getText().toString();              if (addArray.contains(getInput)) {                 Toast.makeText(getActivity(), "Note already added", Toast.LENGTH_LONG).show();              } else if (getInput == null || getInput.trim().equals("")){                 Toast.makeText(getActivity(), "Input field is null", Toast.LENGTH_LONG).show();              } else {                 addArray.add(getInput);                 ArrayAdapter&lt;String&gt; adapter =  new ArrayAdapter&lt;String&gt;(getActivity().getApplicationContext(), android.R.layout.simple_list_item_1, addArray);                 show.setAdapter(adapter);                 ((EditText) v.findViewById(R.id.txtInput)).setText("");              }           }     });       return v;
What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?
I was trying to prove this question.   Q. If G is a group of even order, prove that it has an element a, such that a$\neq$e satisfying $a^2$=e.   I tried solving it using Principle of mathematical induction.  So, Let O(G)=2m, where m$\in$ $N$.   We proceed by induction on m.   For m=1, O(G)=2, $\therefore$ G contains two elements.  G=$\{{e,a}\}$. Now, e has order 1. So, a can not have order 1. $\therefore$ a has order 2. So, it true for m=1.  Now, let it be true for m=k.  Then, we have a group G of order 2k, where $\exists$ an element a$\in$ G, whose order is 2.   We wish to prove it for m=k+1.   Then G has order 2k+2.   I don't know how to proceed further. Sometimes (old) comments break the parser, so it would be nice to view their code to check what was (actually) supposed to be there. Is there any way to view a comment's source just like the source link in a post's revision?  edit Another application for this would be the ability to better quote comments in an answer without having to re-markdown them. Is irrational times rational always irrational? Is an irrational number times a rational number always irrational?  If the rational number is zero, then the result will be rational. So can we conclude that in general, we can't decide, and it depends on the rational number? We are planning a trip with a bike rack attached to our trailer hitch. What is the best way to lock the bikes while the vehicle is unattended? I see some racks have locks on the knobs but they don't seem very strong.   What do you suggest? When using find, how do I return the file name and the line number when searching for a string? I manage to return the file name in one command and the line numbers with another one, but I can't seem to combine them.  File names: find . -type f -exec grep -l 'string to search' {} \;  Line numbers: find . -type f -exec grep -n 'string to search' {} \; Java: Sorting user-input array upon return I am trying to prove the following statement but have trouble  comprehending/going forward with some parts! Here is the statement:     If $A$ is any set, then  $|A|$ $&lt;$ $|P(A)|$   Here is what I have so far:  We need to show that there is an injection from $A$ to $P(A)$ but not a surjection.   A natural choice for an injection is the function $ f(x)$ $=$ $\{x \}$, which in plain English, takes any element $x$ (that is in $A$) and sends it to the one-element set $\{x \}$. Thus $f(x)$ is injective!  To show that there is no surjection, for the sake of contradiction, assume there is a surjection. Here is where I start to have trouble. Surjectivity means that every element of the co-domain is mapped to an element of the domain, correct? Consequently, in this particular case, we are "matching" sets (from $P(A)$) to elements (from $A$) right?  If the above is correct, my problem arises here. I am not sure how to prove that $f$ is not surjective. Unfortunately, I am easily confused by notation so please explain in English.  Thank you in advance!! :) I use Microsoft Outlook 2013 for work and Google Calendar for everything else. I'd like to find an easy way to sync my work calendar to my personal calendar. Ideally, this would be a software application that sits in the background and automates the syncing.  Requirements   Syncing should be one-way only: Outlook to Google. Must support repeating calendar items. Must allow me to specify which calendar in Google to sync to. I will set up a separate calendar for work items. No intermediate server. Export is direct.   Nice to Haves   Automated. Syncs in real time or regularly (say, every fifteen minutes or so). How does the Mac choose which connection to use when both Wifi and Ethernet are connected? When I'm connected to two networks with separate routers using Wifi and Ethernet, how does my Mac know what connection to use when I visit a website? Should I disable google maps scroll wheel zoom? In most applications of google maps the scroll wheel will zoom the map instead of scrolling it.  Personally I find this confusing, and after years of using google maps, both on the google maps web site and embedded google maps, I still often make the mistake of trying to scroll the map with scroll wheel and end up zooming it instead.  The google maps API allows me to disable scrollwheel zoom when I embed a map in my page.  The question is should I disable it?  On the one hand scroll wheel zoom is unconventional in the context of the web as a whole - in the vast majority of cases the scroll wheel scrolls things.  On the other hand scroll wheel zoom is established convention for maps.  It definitely would be a better experience for me if scroll wheel zooming was disabled, but what about the web browsing population in general?  I did some searching on whether I should disable scroll zoom and couldn't find any guidelines. So, to scroll zoom or not to scroll zoom? Are there any concrete rules that say which words (parts of speech) in a title should start with a capital letter? What would be a correct capitalization for the title of this question? Salesforce Internal Server - What's in a GACK? Background  I have been working with Salesforce Support for several weeks now trying to get them to escalate an internal server error with GACK 2134764861-123797 (1611479512) (1611479512). After a long period of waiting I was told that in order to escalate quickly they needed to reproduce the issue in a controlled way. This was again taking them a considerable amount of time so I created a reduced test case myself () that concisely reproduces the issue with a very small amount of code. I was told that this wasn't a valid reproduction because it caused a different GACK (1291518605-518052 (1659192199) (1659192199)) despite reproducing the exact same user experience.  My Question  What makes up a GACK? Is there any information that I can take from their structure that can give me clues on which errors are related without access to the full back-end tools that Salesforce Support uses? It is not infrequent that without premier support it takes me upwards of two weeks to escalate platform bugs and I am hoping that I can somehow use the information from the GACK to reduce this time. How do I write an Apex unit test? Cannot see Samba configuration tool in the Dash in ubuntu 14.04 After a fresh installation of ubuntu 14.04 (my previous installation has seen to be broken somewhere reading .wmv file with VLC), I've installed Samba GUI tool from the software center.  It briefly appears in the launchpad then disappears. From this time I cannot the see in in the dash.  I've found this in askUbuntu   but the command sudo apt-get install samba samba-common gives me nothing to install.  Lecture des listes de paquets... Fait Construction de l'arbre des dépendances        Lecture des informations d'état... Fait samba est déjà la plus récente version disponible. samba passé en « installé manuellement ». samba-common est déjà la plus récente version disponible. Les paquets suivants ont été installés automatiquement et ne sont plus nécessaires :   kde-l10n-engb kde-l10n-fr Veuillez utiliser « apt-get autoremove » pour les supprimer. 0 mis à jour, 0 nouvellement installés, 0 à enlever et 8 non mis à jour.   The following guide  has no result either.  Any idea ?  Laurent06000 Conky Widgets are Opening in their Own Windows I just upgraded to 16.04 and I'm getting all my customization set up again, but it seems that most Conky widgets are opening in their own window, instead of just appearing on the Desktop; although some are working correctly.  For example:  LSD (working properly):    Seamod (not working, opening in own window):    Since it's not affecting every single widget, I assume it could be an issue with the conkyrc with the widgets that aren't working, but this also never happened in 14.04 so I wasn't sure if maybe there was some compatibility issue in 16.04. My Google-fu has failed me in finding a solution.  If anyone can point me in the right direction, it would be much appreciated! :) Is Iron Man stronger than the Hulk? In Avengers: Endgame, when Hulk initially uses the new Infinity Gauntlet, it takes a tremendous effort from him (in addition to almost burning his entire arm), in order to snap his fingers and restore the world as we knew it. Yet at the end of the movie, when Iron Man uses the Gauntlet, it seems very easy for him to snap his fingers.  How was Tony able to wield the stones with such ease when Hulk was clearly struggling with it? Any Set with Associativity, Left Identity, Left Inverse is a Group Is there a term for a foreign word that looks like an English word but has a completely different meaning? examples:         Gift (German) = poison   poisson (French) = fish   embarazada (Spanish) = pregnant   sauce (Spanish) = willow   triviale (Italian) = vulgar   parentes (Portuguese) = relatives   slim (Dutch) = smart Is there any preference given based on how far in advance of the deadline a graduate application is submitted? Finding specific records of US WW2 veterans?