I am having listview with employeename and radiobutton. I am using setonclicklistner for radioButton but i am getting nullpointer exception and app got crashes. Can someone help me with this problem?  delivery.setOnClickListener(new View.OnClickListener() {         @Override         public void onClick(View v) {             LayoutInflater inflater1 = (LayoutInflater) ct.getSystemService(Context.LAYOUT_INFLATER_SERVICE);             View v1 = inflater1.inflate(R.layout.activity_employees_list_for_pop_up, null);             RadioButton employeechecked = (RadioButton) v1.findViewById(R.id.employeeChecked);             final Button ok = (Button) v1.findViewById(R.id.do_ok);             Button cancle = (Button) v1.findViewById(R.id.do_cancle);             ok.setEnabled(false);             listView = (ListView) v1.findViewById(R.id.employeePopUpList);             employeePopUpAdapter = new EmployeePopUpAdapter(ct, employeeIdNameBeans);              //enable ok button if listitem is checked             employeechecked.setOnClickListener(new View.OnClickListener() {                 @Override                 public void onClick(View v) {                     int pos=listView.getCheckedItemPosition();                     if (pos &gt; -1)                     {                         ok.setEnabled(true);                     }                     else if (pos &lt;= -1)                     {                         ok.setEnabled(false);                     }                  }             });   error I am getting nullpointer exception when i click on textview   java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.RadioButton.setOnClickListener(android.view.View$OnClickListener)' on a null object reference   at com.example.jithendra.businessstorestart.adapters.DeliveryOrdersListAdapter$3.onClick(DeliveryOrdersListAdapter.java:300)   at android.view.View.performClick(View.java:4756)   at android.view.View$PerformClick.run(View.java:19749)   at android.os.Handler.handleCallback(Handler.java:739)   at android.os.Handler.dispatchMessage(Handler.java:95)   at android.os.Looper.loop(Looper.java:135)   at android.app.ActivityThread.main(ActivityThread.java:5221)   at java.lang.reflect.Method.invoke(Native Method)   at java.lang.reflect.Method.invoke(Method.java:372)   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)   Here is layout file  &lt;LinearLayout     android:id="@+id/lv1"     android:layout_width="match_parent"     android:layout_height="wrap_content"     android:orientation="horizontal"&gt;      &lt;TextView         android:id="@+id/employeeId"         android:layout_width="0dp"         android:layout_height="wrap_content"         android:layout_weight="1"         android:text="@string/loading"         android:textColor="@color/TextcolorforBlack"         android:textSize="20dp" /&gt;      &lt;TextView         android:id="@+id/empFullName"         android:layout_width="0dp"         android:layout_height="wrap_content"         android:layout_weight="3"         android:text="@string/loading"         android:textColor="@color/TextcolorforBlack"         android:textSize="20dp" /&gt;      &lt;RadioButton         android:id="@+id/employeeChecked"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:background="@color/TextcolorforBlack"         /&gt;  &lt;/LinearLayout&gt;  &lt;LinearLayout     android:layout_width="match_parent"     android:layout_height="wrap_content"     android:orientation="horizontal"&gt;      &lt;ImageView         android:layout_width="match_parent"         android:layout_height="1dp"         android:layout_weight="0"         android:background="@color/TextcolorforBlack" /&gt;  &lt;/LinearLayout&gt;   This is list I am inflating it in listview. In this listview I am having radiobutton. If radiobutton check I need to enable button
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?
Creating a textarea with auto-resize There was , which I've tried. But there is one problem: the textarea doesn't shrink if you delete the content. I can't find any way to shrink it to the correct size - the clientHeight value comes back as the full size of the textarea, not its contents.  The code from that page is below:  function FitToContent(id, maxHeight) {    var text = id &amp;&amp; id.style ? id : document.getElementById(id);    if ( !text )       return;     var adjustedHeight = text.clientHeight;    if ( !maxHeight || maxHeight &gt; adjustedHeight )    {       adjustedHeight = Math.max(text.scrollHeight, adjustedHeight);       if ( maxHeight )          adjustedHeight = Math.min(maxHeight, adjustedHeight);       if ( adjustedHeight &gt; text.clientHeight )          text.style.height = adjustedHeight + "px";    } }  window.onload = function() {     document.getElementById("ta").onkeyup = function() {       FitToContent( this, 500 )     }; } Bolding with ** isn't working properly Have a look at   One of the bolds works, and the other one just turns up as ** in the actual post.  This is the string that isn't working: **x**ml n**ib**  Which renders as: xml nib SSL certificate for a public IP address? I just tried buying a Comodo Positive SSL but it was rejected due to not supporting a public IP address, but instead they only support a domain name.  Does anyone know any SSL certificate provider that supports public IP address instead of a domain name?  My company has a dedicated server hosted with a web hosting company, which is used for running a bugtracker for multiple projects (for multiple clients). Since it's only used for a bugtracker, we don't need a domain name (our clients access it by typing the public IP in their browser). How does a magnet work? strtok segmentation fault Ever since I upgraded to 15.10, fdisk -l reports 16 ram disks (/dev/ram0 ... /dev/ram15). I'm a bit unsure what those are needed for. Is it safe to delete them? If not, how can I get rid of that fdisk output? How can I prove that if $\gcd(a, b) = 1$, then $\gcd(ab, c) = \gcd(a, c) \times \gcd(b, c)$?  By eea there exists $ax+by=1$ from $\gcd(a,b)=1$ so a and be are co-primes there also exists $dk=a$ and $dj= b$ where $d=\gcd(a,b)=1$ this is all the information I have gathered from the question but I dont know how to approach and solve it. Can anyone help explain to me how to arrive at the answer? Thanks! So, in my physics textbook it's written that the kinetic energy possessed by a body is equal to the amount of work done by an opposing force to stop the body, now that got me thinking that when a ball hits a wall, the wall which is the opposing force does no work  because there is no displacement, so to say isn't the kinetic energy possessed by the ball zero? I have installed QGIS3 from the AUR package, as well as all optional dependencies:   However, when launching, I receive the following error:  Couldn't load plugin 'processing'   ModuleNotFoundError: No module named 'osgeo'  Traceback (most recent call last):   File "/usr/share/qgis/python/qgis/utils.py", line 311, in loadPlugin     __import__(packageName)   File "/usr/share/qgis/python/qgis/utils.py", line 664, in _import     mod = _builtin_import(name, globals, locals, fromlist, level)   File "/usr/share/qgis/python/plugins/processing/__init__.py", line 28, in      from processing.tools.dataobjects import *          # NOQA   File "/usr/share/qgis/python/qgis/utils.py", line 664, in _import     mod = _builtin_import(name, globals, locals, fromlist, level)   File "/usr/share/qgis/python/plugins/processing/tools/dataobjects.py", line 51, in      from processing.algs.gdal.GdalUtils import GdalUtils   File "/usr/share/qgis/python/qgis/utils.py", line 664, in _import     mod = _builtin_import(name, globals, locals, fromlist, level)   File "/usr/share/qgis/python/plugins/processing/algs/gdal/GdalUtils.py", line 35, in      from osgeo import gdal   File "/usr/share/qgis/python/qgis/utils.py", line 664, in _import     mod = _builtin_import(name, globals, locals, fromlist, level) ModuleNotFoundError: No module named 'osgeo'   Python version: 3.6.4 (default, Jan  5 2018, 02:35:40) [GCC 7.2.1 20171224]  QGIS version: 3.0.0-Girona Girona, exported   Python Path: /usr/share/qgis/python /home/thiago/.local/share/QGIS/QGIS3/profiles/default/python /home/thiago/.local/share/QGIS/QGIS3/profiles/default/python/plugins /usr/share/qgis/python/plugins /usr/lib/python36.zip /usr/lib/python3.6 /usr/lib/python3.6/lib-dynload /usr/lib/python3.6/site-packages /home/thiago/.local/share/QGIS/QGIS3/profiles/default/python   It seems to be a path issue, but I am not sure how to solve it. Pacman shows gdal and python-gdal both as installed. How would I go about evaluating this integral? $$\int_0^{\infty}\frac{\ln(x^2+1)}{x^2+1}dx.$$ What I've tried so far: I tried a semicircular integral in the positive imaginary part of the complex plane, excluding the negative real axis, but had trouble calculating the residue at $z=i$ (perhaps there is a way of doing this that I don't know of). After that didn't work, I tried a rectangular box integral from $\epsilon$ to $R$, from $R$ to $R+i/2$, from $R+i/2$ to $-S+i/2$, from $-S+i/2$ to $-S+i\epsilon$, from $-S+i\epsilon$ to $-\epsilon+i\epsilon$ and finally a semicircle around the origin, radius $\epsilon$.   Any help would be appreciated. convergence of $\sum_{n=1}^{\infty }\frac{(-1)^{[\sqrt{n}]}}{n}$ where $[a]$ means floor function of $a$ I have a problem with solving the convergence of $\sum_{n=1}^{\infty }\frac{(-1)^{[\sqrt{n}]}}{n}$ where $[a]$ means floor function of $a$. I've already made the first thep and rewrote it with the $\sum_{n=1}^{\infty }(-1)^{n}\sum_{k=n^2}^{(n+1)^2-1}\frac{1}{k}$, which converges if and only if the previous one converges. Now I want to use Leibniz criterion, but I cannot prove that the second sum in the previous expression is monotonic. Does anyone know how to do it? (I cannot use Riemann integral, we haven't defined it yet) I need another LP-E5 type battery for my Canon 450D. Should I buy an original Canon battery or one of the many generic brands available? There are loads of cheapos on , for example.  I should add that the new battery will be added to my existing Canon battery in a battery grip.  Does anyone have any experience (good or bad) of using generic batteries? My child has chickenpox, am I infectious? My 3-year-old has had chickenpox for about 2-3 days, but a close friend has just had a baby and I want to go and help. Is it possible that I am infectious, despite not having the illness? I had it as a child, so (hopefully) can't actually get it myself. Thanks! Does anyone know how to make the character picker appear more quickly?   I use it enough now in my German language studies that it has become second nature for the critical marks and much faster than using the alt+keypress shortcuts.   Only problem is that it's so second nature that sometimes it doesn't pop up quickly enough so I end up typing the character and the number shortcut sometimes (IE u2 instead of ü). Anyone know how to make it appear with less delay? Ideally, I'd love if I could just hold the character and press the number but it appears that OSX insists on waiting for the menu to pop up. Additional Boxes - Criteria, Longevity, Manipulability This feature has existed for a while (I'm not sure since when exactly), but I'm mainly interested in the Gen VI implementation (hence the tag).  Usually, at the start of a game, you have some number of Boxes available. In B/W, those were 8, in X/Y I think it was 15. Under certain conditions though, you receive additional Boxes that just appear at the end of your current Boxes list. Which brings me to Part 1 of my question:     1) What are the exact conditions for additional Boxes to appear and do you always get 8 additional Boxes? (Using Pokemon Bank reveals that in X/Y, the maximum number of Boxes is 31, which I have experienced to be unlocked in 2 steps of 8 Boxes each.)   Since I'm a person who really likes to order and organize stuff, my Boxes have names and are used to categorize my Pokemon. This results in some Boxes ending up empty for a while most of the time. So here's to     2) Do additional Boxes you receive stay forever or do they disappear if the conditions for them are no longer met?      3) If they disappear, is there a way (such as renaming or putting any Pokemon in the last Box) to make them stay no matter what, even if you released all your other Pokemon? I tried a couple of substitutions but have so far gotten nowhere. Can anyone guide me in the right direction? Thanks for your time. Why are there two Address lines in Address forms? Experience and a quick Google Images search suggests that it's standard to provide two fields for Address/Street. A colleague argues that it's perceived as two alternative addresses, and that the fact that there's only one country, state, zip, phone just makes it more confusing. I tried to think of a good explanation for having two fields but couldn't. To the reason of "there are some very long addresses" he replies "then why don't they use a multiline input field which would make it clearer that it's the same address".  So, what's the reason? And is it only standard for the US or for Europe as well? How do I mimic Pathauto transliterated output for an alias in my custom PHP code? When writing my custom function I need to manually append node name to a taxonomy term link. To get the taxonomy term part done I use:    $link_uri = taxonomy_term_uri($term);   $path_alias = drupal_get_path_alias($link_uri['path']);   This works ok, now - I want to append node name ("/" . $node_name), but instead of raw string, I want the Pathauto transliterated output, as set in the URL alias configuration, for that node context.  What function should I use to mimic that output? I looked at hook_pathauto_alias_alter(&amp;$alias, array $context) but I'm not sure that's what I need. How do I change the MAC address of my network card? I have a local network in a Windows system where the Admin gives permission to the PCs by their MAC address. But he is on vacations and I have a new PC.  How can I change the MAC address of my new PC to have the same MAC address as the old one?  I know this can be used for spoofing the address, but this is local, so I don't think I will have a problem. Do Skyrim mods work with the Special Edition? I typically play Skyrim with a number of mods installed, and while I'm excited to try the Special Edition, there are a few mods that I'd much rather not play without.  Can I install mods built for the normal Skyrim game with the Special Edition, or do I have to wait until mod authors write new versions before I can play with those mods?