I have a custom listview in my app which fills by JSON and I'm using bitmap to fill images in listView and I want to get a TextView value inside the list item that has been clicked  lView.setOnItemClickListener(new AdapterView.OnItemClickListener() {   @Override   public void onItemClick(AdapterView&lt;?&gt; adapterView, View view, int i, long l) {     try {           hotel_id = (int) adapterView.getItemIdAtPosition(i);           TextView id= (TextView) lView.getChildAt(i).findViewById(R.id.aNametxt);           type_id_post = deleteIcon.getText().toString();            backgroundTask = new BackgroundTask(textView);           backgroundTask.execute();            Intent intent = new Intent(RoomList.this, RoomPopUp.class);           startActivity(intent);          }     catch (RuntimeException e){           e.printStackTrace();     }   } });   and it works for the first two items of the list but for another item app will stop on hotel_id definition line and this is logcat when I click an item except for the first two items :  08-07 11:43:36.026 14747-14747/com.moalem.khane.khanemoalem W/System.err: java.lang.NullPointerException 08-07 11:43:36.026 14747-14747/com.moalem.khane.khanemoalem W/System.err: at com.test.RoomList$1.onItemClick(RoomList.java:126) 08-07 11:43:36.026 14747-14747/com.moalem.khane.khanemoalem W/System.err: at android.widget.AdapterView.performItemClick(AdapterView.java:299) 08-07 11:43:36.026 14747-14747/com.moalem.khane.khanemoalem W/System.err: at android.widget.AbsListView.performItemClick(AbsListView.java:1158) 08-07 11:43:36.026 14747-14747/com.moalem.khane.khanemoalem W/System.err: at android.widget.AbsListView$PerformClick.run(AbsListView.java:2957) 08-07 11:43:36.026 14747-14747/com.moalem.khane.khanemoalem W/System.err: at android.widget.AbsListView$3.run(AbsListView.java:3849) 08-07 11:43:36.026 14747-14747/com.moalem.khane.khanemoalem W/System.err: at android.os.Handler.handleCallback(Handler.java:733) 08-07 11:43:36.026 14747-14747/com.moalem.khane.khanemoalem W/System.err: at android.os.Handler.dispatchMessage(Handler.java:95) 08-07 11:43:36.026 14747-14747/com.moalem.khane.khanemoalem W/System.err: at android.os.Looper.loop(Looper.java:136) 08-07 11:43:36.026 14747-14747/com.moalem.khane.khanemoalem W/System.err: at android.app.ActivityThread.main(ActivityThread.java:5105) 08-07 11:43:36.026 14747-14747/com.moalem.khane.khanemoalem W/System.err: at java.lang.reflect.Method.invokeNative(Native Method) 08-07 11:43:36.026 14747-14747/com.moalem.khane.khanemoalem W/System.err: at java.lang.reflect.Method.invoke(Method.java:515) 08-07 11:43:36.026 14747-14747/com.moalem.khane.khanemoalem W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:792) 08-07 11:43:36.026 14747-14747/com.moalem.khane.khanemoalem W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:608) 08-07 11:43:36.026 14747-14747/com.moalem.khane.khanemoalem W/System.err: at dalvik.system.NativeStart.main(Native Method)   the point is all item's id TextView of the list are casting to one id but it for "SOME" items that id is null is there anyone who knows what is the problem of this?
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?
Optional argument to \item Operation 'Split, All The Metas!' Shall Commence On April 16, 2014 Update 2014-04-17 04:47 UTC: Stable, with some odds and ends to clean up      The main MSO/MSE sites are stable, but there are plenty of corners left to sweep. For details, see:    Not all of them mind you, just Meta Stack Overflow into Meta Stack Exchange.  I'll have you know, factually, that we really did believe this would take place in six-to-eight weeks when it was , but we've finally got a tentative date established.  If things go according to plan, we'll begin the operation shortly after 8:30 PM EDT on the 16th, completing everything within a few hour window. Ideally, all service disrupting endeavors will be completed within the first hour, which include:   The availability of Meta Stack Overflow The availability of Stack Overflow (more on this shortly) The availability of Chat on Meta Stack Overflow   As you know, we'll be bolting on a standard issue per-site meta on Stack Overflow, while breaking the link between what will have become Meta Stack Exchange and Stack Overflow. There's some irritable innards in that particular region, so we'll be asking folks to expect the unexpected during the maintenance window. Affected sites will be in and out of read-only mode, or quite possibly just down for maintenance while we're doing the actual break.  I'll be posting a system message on both Meta Stack Overflow as well as Stack Overflow itself 24 hours before we begin the actual work.   Did I say tentative in a six-to-eight-something time frame again? Why yes, I did - we're currently running some tests on the dev tier to simulate the split as closely as possible, so that we can better anticipate quirks that we need to address prior to actually doing it.  Once the sites have actually been stood up functionally on the production tier, we're going to get to work on finishing touches. This will include things like site settings (which determine bits of text you see in the question prompts, rep thresholds, etc) and all sorts of other fine tuning.  Once we're done:   Stack Overflow will have a blank, empty child meta site just like every other site The new Meta Stack Exchange will be up and running All rooms on Chat Meta Stack Overflow will be moved to Chat Meta Stack Exchange  I'll send over about 150 - 200 questions from MSE to MSO, most of which will be tag or SO-specific feature related posts that got buried by the network stuff without resolution.   If the tentative date moves, I'll update this post with the new date. However, we do not anticipate this happening any later than Saturday, April 19 - in the case that we see down time we can't mitigate and need to do it on a weekend.  The ground work is basically done, we're finishing up sanity now with a great deal of confidence, and we're pretty certain that we'll hit between those dates, if not directly on the tentative 16th.  Questions? Kvetch? Anonymous confessions? Answer below, and I'll address each in comments. If I have a tar file, bob.tar, which contains real_file and link_to_real_file, in which the latter is a symlink, is there a way to extract the contents of bob.tar so that link_to_real_file will not be a symlink, but be a copy of real_file.    I know this is indeed possible on the creation side, if I use the -h flag.    The command tar -cvhf bob.tar real_file link_to_real_file will dereference link_to_real_file, but I want to do this on the extraction side regardless of how the tar file was created. Request root privilege from within a script Is there a PPA with the latest version of LibreOffice? There was recently another release of , but it is  a pain to have to manually go to their website and download the packages every time there is a new release. Is there a PPA that always has the latest version of LibreOffice? An unclear sentence in the book "Griffiths, Harris-Principles of algebraic geometry" Let $X$ be a complex manifold and consider a holomorphic vector bundle $\pi:E\to X$ of rank $r$. By the usual correspondence between vector bundles and locally free sheaves, we consider $E$ as a sheaf by abuse of notation. We denote with $\mathscr A_X^{p,q}$ the sheaf of $C^\infty$ $(p,q)$-differential forms on $X$ and we define: $$A^{p,q}(E):=\Gamma(X,\mathscr A^{p,q}\otimes_{\mathscr O_X} E)$$ $$A^k(E):=\bigoplus_{p+q=k}A^{p,q}(E)$$  Now suppose that $\nabla:A^\bullet(E)\to A^\bullet(E)$ is a linear connection on $E$, then the curvature operator is defined as: $$\nabla^2:A^0(E)\to A^2(E)$$ where $\nabla^2$ is the composition of the maps $\nabla: A^0(E)\to A^2(E)$   and $\nabla: A^1(E)\to A^2(E)$. One can show that $\nabla^2$ is $C^\infty(X)$-linear.    I don't understand the following sentence from the Griffiths-Harris book at page 75 (I rephrase it by using my notation):     Since $\nabla^2$ is $C^\infty(X)$-linear, then it is induced by a bundle map $E\to\bigwedge^2T^*X\otimes E$, or in other words, $\nabla^2$ corresponds to a global section $\Theta$ of the bundle $\bigwedge^2T^*X\otimes\operatorname{Hom}(E,E)$.   I absolutely don't understand how I can see the operator $\nabla^2$ as the section $\Theta$. I am using pgfplot to draw graphs in latex. Now this is the problem I am facing:  \begin{tikzpicture}[scale=1] \begin{axis}[ybar,grid=major,bar width=2pt,width=8cm, height=8cm,xmin=1,xmax=540,ymin=1,ymax=240] \addplot [draw=black,fill=green]  table [x=size, y=cluster, col sep=comma] {sim-0.4-0.6.csv}; \end{axis} \end{tikzpicture}   It generates the following graph:    Since, I have values mainly between 0-50 on x-axis, I want to zoom there. After that, values comes around 500. S0, there are no graph points between 50 - 450. How should I do that? Run TTY script every time I open a GUI terminal What is a good introduction to statistics for a mathematician who is already well-versed in probability?  I have two distinct motivations for asking, which may well lead to different suggestions:   I'd like to better understand the statistics motivation behind many problems considered by probabilists. I'd like to know how to better interpret the results of Monte Carlo simulations which I sometimes do to form mathematical conjectures.   I'm open to the possibility that the best way to go is not to look for something like "Statistics for Probabilists" and just go to a more introductory source. $$L~=~ \frac{1}{2} \dot{q}  \sin^2{q} $$  Is it zero or not defined? The ideal generated by $2$ and $ x$ in $\mathbb{Z}[x]$ How do you transpose tensors? We transpose a matrix $A$ by replacing $A_{ij}$ with $A_{ji}$, for all $i$ and $j$.  However, in case $A$ has more than two dimensions (that is, it is a tensor), I don't know how to apply the transpose operation.   If A has dimensions $3\times 3 \times 8$, then what will replace $A_{ijk}$?  If $A$ has shape $3\times 3\times 8\times 8$, then what will replace $A_{ijkl}$? This is probably a dumb question. I guess what I'm trying to ask is if radio waves travel the same speed as gamma rays, how do gamma photons carry more energy than radio photons? Do they spin faster? What other energy sources could they carry if they are moving the same speed through space? Can SQL Server's Page Life Expectancy be too high? I've read several articles about SQL Server's Page Life Expectancy and what it means and what kind of information you can glean from it. In most of these articles that I've read, a common, healthy PLE value is somewhere around 1000-2000 seconds. I've read that getting down to around 300 seconds can mean you're likely low on RAM.  I recently just upgraded our hardware to have 64GB of RAM, up from 14GB. On the 14GB my PLE was around 300 seconds, and I was having a lot of 5-6 memory grants pending per second. So, that was bad and I increased the RAM. Now, my PLE is much, much higher around 5000 seconds, and no more pending memory grants. I've seen it 7000 seconds, if I recall. This is much higher than anything I've read.  Can a high PLE be a bad thing? Or is it the higher the better?  EDIT: I'm sorry, my PLE wasn't 7000 seconds, it was 70,000 seconds! Although, at the moment it is down to around 7000.     The database size is around 160GB. A few tables have 5+ million rows. max_server_memory is set to 2147483647. How does the double strike mechanic interact with other mechanics like lifelink or trample? I understand that the double strike mechanic allows a creature to attack in both a first strike combat damage step and a normal combat damage step.  It's clear that when a creature with no other abilities aside from double strike is blocked that even if the defender has lethal damage marked in the first strike step that the additional damage does not carry forward to the player.  How does this view of double strike change with relation to trample and lifelink?  I believe the correct interpretations are (not accounting for other effects or abilities) that 2 times the attacker's power is marked as damage on the defender.  For trample this amount is reduced by the defender's toughness and additional damage carries forward as normal.  Similarly for lifelink the active player gains life equal to 2 times the attacker's power.  Thus a 10/10 trampling double striking life linker blocked by a 1/1 creature would deal 19 points of trample damage and the active player would gain 20 life.  Is this interpretation correct? Probability of winning the game "1-2-3" What is the plural form of "Software"? Missing Schengen entrance stamp Last night I took a night train from Romania to Hungary. I shared a compartment with another American backpacker (and others.) The border crossing on the Romanian side was normal -- all of our passports were stamped and the border officer recorded our data in his notepad. On the Hungarian side, some sort of commotion broke out further down the train car while we were being processed. The officer who was scanning and stamping our passports left and never came back. As a result, the other American backpacker never had her passport scanned or stamped.  What sort of difficulties might she run into since her passport has not been recorded as entering the schengen zone, nor does she have an extra stamp? What might get options be now, from within Schengen, to get her entrance recorded?  (When I say "scanned", the officers had hand-held devices that read the passport biometrics and I assume, recorded some sort of data somewhere.) Determining ethnicity according to ancestry? Can I leave the UK and come back in, on a Tourist visa?