I have text file that has got datas in "%02x " format. For example my text's content like "AA 00 11 CC...". I want to have bitmap from this text file.  I have tried many solutions about this. Firstly I have converted this datas to byte array like that;      Inputstream is = getResources().openRawResource(R.raw.ep2data);     InputStreamReader inputStreamReader = new InputStreamReader(is);     BufferedReader bufferedReader = new BufferedReader(inputStreamReader);      String line;     StringBuilder text = new StringBuilder();      try {          while ((line = bufferedReader.readLine()) != null) {              text.append(line);             text.append('\n');         }      } catch (IOException e) {          e.printStackTrace();     }      String s = text.toString();      //convert string to byte array     String[] tokens = s.split(" ");     Log.d("string array length", "" +tokens.length);     byte[] data = new byte[tokens.length];      for (int i = 0; i &lt; tokens.length - 1; i++) {          data[i] = (byte) ((Character.digit(tokens[i].charAt(0), 16) &lt;&lt; 4)                 + Character.digit(tokens[i].charAt(1), 16));      }      Bitmap bitmap = BitmapFactory.decodeByteArray(data, 0, data.length, options);   As a result, I'm getting bitmap as null. So I can not create bitmap from this text. How can I create bitmap from text string. I have tried many solution but I couldn't get solution about this subject.
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?
How to avoid using sudo when working in /var/www? I am buying a new desktop PC in early 2013, anyway this question should apply to someone intending to buy a new laptop/ultrabook as well.  This machine is not meant for gaming, and if I ocasionally do it, I can survive with minimum graphics. However I may need some heavy multimedia edition or multitasking at times, so basically  my greatest priority is a good processor, after that perhaps average graphic card (if onboards are not enough, I am still not informed enough about that), at least 4GB of RAM with possibility of expansion.  I know there are some PC models specially designed to ship with Ubuntu, which is the OS I use the most these days. However, most people around me use Windows and some software with unsupported versions for Linux and not having a Windows license becomes a bit problematic.  Given that, I would like to find information about which PC models or even manufacters currently on the market have the best compatibility with Ubuntu, I am still undecided between building my own desktop or buying a pre-made model, so I would like to find information both for certified models and certified hardware or even Ubuntu partners that may work closely with Canonical.  Where to find this information in order to make sure that I will have a good experience with Ubuntu on my new PC in the years to come? Why is the console window closing immediately once displayed my output? Given two equivalent norms, convergence in one implies convergences in other. Suppose we have two equivalent norms, $\|\cdot \| \sim \left\vert\!\left\vert\!\left\vert \cdot\right\vert\!\right\vert\!\right\vert$. We assume that $x_n \rightarrow x $ in $(X,\|\cdot \|)$. Show that $x_n \rightarrow x $ in $(X,\left\vert\!\left\vert\!\left\vert \cdot\right\vert\!\right\vert\!\right\vert)$  We observe since the norms are equivalent, there exits constants $\alpha, \beta$, such that $\alpha \|\cdot \| \leq \left\vert\!\left\vert\!\left\vert \cdot\right\vert\!\right\vert\!\right\vert \leq \beta \|\cdot \|$, with $0 \lt \alpha \leq \beta$  Since, $x_n \rightarrow x$ in $(X,\|\cdot \|$) we know that for all $\epsilon&gt;0, \exists K(\epsilon)$ such that for n>$K(\epsilon),$ we have $\|x_n -x\| \leq \epsilon$  Since, we know $\beta \gt 0$ , then $ \beta \|x_n -x\| \leq \beta \epsilon$, Thus we see that $\left\vert\!\left\vert\!\left\vert x_n-x\right\vert\!\right\vert\!\right\vert\leq \beta \epsilon$.  This is how far I've gotten, our goal to is to find a a $J(\epsilon)$ such that for all $\epsilon&gt;0, \exists J(\epsilon)$ such that for n>$J(\epsilon),$ we have $\left\vert\!\left\vert\!\left\vert x_n-x \right\vert\!\right\vert\!\right\vert \leq \epsilon$  My candidate for $J(\epsilon$) is $J(\epsilon) = \frac{K(\epsilon)}{\beta}$ from my above argument, but I'm not exactly sure how to validate this. If someone could help me on the proof, it would be very appreciated. I believe I'm pretty close, just missing something small. How can I install Sun/Oracle's proprietary Java JDK 6/7/8 or JRE? JTable won't show column headers Expanding an event group shows more events than labeled when there are new events Ubuntu system is broken after accidentally uninstalling many packages I accidentally removed all the packages starting with the name jpeg with:  sudo apt-get remove jpeg*   This screwed up a lot of things, removed Unity, Firefox, Flash player etc.  I somehow managed to recover the desktop and unity but then a lot of things are still buggy. For example .rpm files and .tag.gz just won't open up at all.  What I want is a way to fix everything that's amiss. Something that is the equivalent of a 'repair installation' with a windows disc.  Any tips, anyone? Refreshing SFDC page from VF frame: CORS issue Ssh login hook? I want to advance in the ranks of Senator Lavigny-Duval. How can I get merit points? I know I can participate in expansion goals, but is there a better way than that? Error: 'else' without 'if' I used the upgrade manager to upgrade from 17.04 to 17.10. When I start the machine, I only get a black flickering screen now. I was using the nvidia binary drivers before the upgrade.     NOTE: This question (and answer) relate to a specific issue when upgrading from 17.04 to 17.10 while using Nvidia or AMD binary drivers. You might experience a completely different issue. For that please see the more general question . Is division of matrices possible? Multiple registration phases It seems like to deleted too much files by rm -r and now I have the error of "the system is running a low-graphic mode" in Ubuntu and I have to work in Windows because of that.  However I can load it in recovery mode. I need to copy the files from Downloads folder to a flash drive. Downloads folder has them as I can see by ls command.   When I plug in a flash drive, there will be some messages saying that everything is ok (as I understood) and it's plugged. But when I go to /media/my_name and do ls then I don't see anything. I don't see anything in /run/media/my_name either(I'm not sure if should though).  I can't connect to the Internet for some reason. Ubuntu was installed by wubi.exe file.  How do I save the content of my Downloads folder to a flash drive? Should I sign, watermark or otherwise label a framed print? And if so how? I have an opportunity to show some of my work in a small local coffee shop.  Are there any guidelines/practices to signing, labeling or watermarking a photo which is to be on display?  Or should a photo be signed, labelled or marked at all? Is signing the back of the photo and showing my name on a separate card below the frame itself the "better" way to do this?   I noticed many people on the web put a very noticeable watermark with their logo, copyright and name right on the photo.  Personally, I find this distracting as it often ruins the photograph itself often turning what could be art to kitsch. Painters most often sign the painting itself but this to me is not distracting because it is done with the painter's own hand and it often "works" with the painting. Strange book where teen protagonist is sent to a warzone, uses illusory magic to grow male genitalia I have an issue which I've been struggling with today. The JSON is returned back to me with a project Id as the key, this Project Id is dynamically generated and due to this I have not been able to come up with a way to deserialize this response. Any suggestions?   {      "success":true,    "numRows":5,    "data":{         "23000079":{            "projectId":"23000079",          "name":"Mcdonalds",          "departmentId":"9383",          "responsibleUserId":"7444434"       }    } } How can you prove that a function has no closed form integral? In the past, I've come across statements  along the lines of &quot;function $f(x)$ has no closed form integral&quot;, which I assume means that there is no combination of the operations:  addition/subtraction multiplication/division raising to powers and roots trigonometric functions exponential functions logarithmic functions  which when differentiated gives the function $f(x)$. I've heard this said about the function $f(x) = x^x$, for example. What sort of techniques are used to prove statements like this? What is this branch of mathematics called?  Merged with &quot;&quot; by : Sometimes we are told that some functions like $\dfrac{\sin(x)}{x}$ don't have an indefinite integral, or that it can't be expressed in term of other simple functions. I wonder how we can prove that kind of assertion?