I have one activity one tab with fragment . But it keeps giving me the error &quot;java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.os.Bundle.getString(java.lang.String)' on a null object reference&quot;. Send data to fragment: final DescriptionDetailFragment ddf = new DescriptionDetailFragment();  Bundle bundleddf =new Bundle();         bundleddf.putString(&quot;description&quot;, massageModel.getDescription());         ddf.setArguments(bundleddf);  Called activity: desc = v.findViewById(R.id.description);          Bundle b1 =getArguments();          String description = b1.getString(&quot;description&quot;);          desc.setText(description);  Can someone help me out why this is happening?
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 do I change permissions on a FAT32 formatted drive? How can I have `date` output the time from a different timezone? I have a server running with the timezone set to UTC. It seemed like that was generally a good practice (please correct me if I'm wrong).  Anyhow, one of the servers I connect to, in order to scp files, is running on EDT and stores files that I need to copy in the format /path/to/filename/data20120913  I looked at trying to rsync files using something like find's -mtime -1 flag for files modified in the last day, but I didn't have any luck.  I don't mind just using scp to copy the current day's file, but as of right now there is a 4-hour window where running date +%Y%m%d will give a different day on each server and that bugs me a little.  Looking through man date I see that I can have the time output as UTC, but I don't see a way to have it output as another timezone like EDT  I suppose I could also use something like the GNU date extension date -d 20100909 +%s to get the date in seconds from the epoch, apply a manual 4 * 60 * 60 second calculation, and see about rendering that as a date - but then when daylight time kicks in it will still be an hour off.  Is there a simpler way to output the date in a YYYYMMDD format for EDT on a server that is set to UTC ? If I wanted to just view, sort, and organize (via tags or folders or both), what programs are geared toward doing this quickly?  I know I could do this in most any photo editor, but it's not ideal for reviewing hundreds of images. I've also seen people use the image previewers built into their computer's OS, but that can't be the best option either.  What program would you suggest instead?  Extra info on the program is appreciated, i.e. OS requirements and cost. How can I force a line break in the table of contents? SUB-TREE WITHIN A TREE in MySQL  In my MYSQL Database COMPANY, I have a Table: Employee with recursive association, an employee can be boss of other employee. A self relationship of kind (SuperVisor (1)- SuperVisee (∞) ).     Query to Create Table:    CREATE TABLE IF NOT EXISTS `Employee` (   `SSN` varchar(64) NOT NULL,   `Name` varchar(64) DEFAULT NULL,   `Designation` varchar(128) NOT NULL,   `MSSN` varchar(64) NOT NULL,    PRIMARY KEY (`SSN`),   CONSTRAINT `FK_Manager_Employee`                 FOREIGN KEY (`MSSN`) REFERENCES Employee(SSN) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;   I have inserted a set of tuples (Query):    INSERT INTO Employee VALUES   ("1", "A", "OWNER",  "1"),     ("2", "B", "BOSS",   "1"), # Employees under OWNER   ("3", "F", "BOSS",   "1"),   ("4", "C", "BOSS",   "2"), # Employees under B  ("5", "H", "BOSS",   "2"),   ("6", "L", "WORKER", "2"),   ("7", "I", "BOSS",   "2"),   # Remaining Leaf nodes     ("8", "K", "WORKER", "3"), # Employee under F        ("9", "J", "WORKER", "7"), # Employee under I        ("10","G", "WORKER", "5"), # Employee under H   ("11","D", "WORKER", "4"), # Employee under C  ("12","E", "WORKER", "4")     The inserted rows has following Tree-Hierarchical-Relationship:                A     &lt;---ROOT-OWNER         /|\                     / A \               B     F      //| \    \              // |  \    K        / | |   \                       I  L H    C         /     |   / \  J     G  D   E   I written a query to find relationship:    SELECT  SUPERVISOR.name AS SuperVisor,          GROUP_CONCAT(SUPERVISEE.name  ORDER BY SUPERVISEE.name ) AS SuperVisee,          COUNT(*)   FROM Employee AS SUPERVISOR    INNER JOIN Employee SUPERVISEE ON  SUPERVISOR.SSN = SUPERVISEE.MSSN  GROUP BY SuperVisor;   And output is:    +------------+------------+----------+ | SuperVisor | SuperVisee | COUNT(*) | +------------+------------+----------+ | A          | A,B,F      |        3 | | B          | C,H,I,L    |        4 | | C          | D,E        |        2 | | F          | K          |        1 | | H          | G          |        1 | | I          | J          |        1 | +------------+------------+----------+ 6 rows in set (0.00 sec)   [QUESTION] Instead of complete Hierarchical Tree, I need a SUB-TREE from a point (selective) e.g.: If input argument is B then output should be as below...  +------------+------------+----------+ | SuperVisor | SuperVisee | COUNT(*) | +------------+------------+----------+ | B          | C,H,I,L    |        4 | | C          | D,E        |        2 | | H          | G          |        1 | | I          | J          |        1 | +------------+------------+----------+      Please help me on this. If not query, a stored-procedure can be helpful. I tried, but all efforts were useless! Random plot based on a specific random seed Square root of Positive Definite Matrix Can I see why a package is installed? Why is negative times negative = positive? Someone recently asked me why a negative $\times$ a negative is positive, and why a negative $\times$ a positive is negative, etc.  I went ahead and gave them a proof by contradiction like so:  Assume $(-x) \cdot (-y) = -xy$  Then divide both sides by $(-x)$ and you get $(-y) = y$  Since we have a contradiction, then our first assumption must be incorrect.  I'm guessing I did something wrong here. Since the conclusion of $(-x) \cdot (-y) = (xy)$ is hard to derive from what I wrote.  Is there a better way to explain this?  Is my proof incorrect?  Also, what would be an intuitive way to explain the negation concept, if there is one? Related questions with over 99 score display incorrectly What length of rope should be used to tie a cow to an exterior fence post of a circular field so that the cow can only graze half of the grass within that field?  updated: To be clear: the cow should be tied to a post on the exterior of the field, not a post at the center of the field. Multiple runnable classes inside JAR, how to run them? If I take a loss when I sell my car, can I claim a capital loss deduction on my income tax return? Reset password in Drupal 6? How can I prove that prove $n^5 - n$ is divisible by $30$? I took $n^5 - n$ and got $n(n-1)(n+1)(n^2+1)$ Now, $n(n-1)(n+1)$ is divisible by $6$. Next I need to show that $n(n-1)(n+1)(n^2+1)$ is divisible by $5$. My guess is using Fermat's little theorem but I don't know how. Training involved to ride 175 miles (281 km) in a day I want to be able to ride 175 miles (281 km) in a day (to do the ). I used to be able to do about 60 miles (96.5 km), only once hitting 80 miles (128 km), but I'm out of shape now. Wondering how I can systematically train to get to 175 miles at an average of 15 mph (24 km/h) Are there guides out there to help with this?  What's some advice?  [update] The  will happen each year, so my intention isn't to ride this year, rather what do I need to do to ride it in some future year? What is "cloning a hard drive" and how does one go about doing it? What does cloning a hard drive mean? Is it just simply copying over all the "CONTENT" of the hard drive EXCLUDING the operating system, drivers, all the installed programs? or is it copying the ENTIRE hard drive BIT for BIT? Is the cloned hard drive bootable?  I have an external USB hard drive and trying to make a exact copy of my computer system by cloning, so that I can connect the cloned hard drive to another machine and boot into it, or install the cloned disk on another computer system and boot into it. Is this possible? Or am I going about this totally wrong?  What is ghosting a hard drive? Approximating commuting matrices by commuting diagonalizable matrices Suppose the matrices $A$ and $B$ commute. Do there exists sequences $A_n$ and $B_n$ of matrices such that   $A_n \rightarrow A$, $B_n \rightarrow B$.  Each $A_n$ is diagonalizable  and the same for each $B_n$.  For every $n$, $A_n$ commutes with $B_n$.    Moreover, it would be nice if the following property was additionally satisfied: if $A,B$ are real, then $A_n,B_n$ can be chosen to be real as well. Count where any 3 columns have values (not null) Find probability using distribution function method Let $X_1$ and $X_2$ be two independent random variables with distribution $U(0,1)$. Let $Y=|X_1-X_2|$. Find the distribution function and density of $Y$.   Solution:  f(x1)=1 whenever x1 between 0 and 1          =0 Else where f(x2)=1 whenever x2 between 0 and 1          =0 Else where f(x1,x2)=1 whenever x1,x2 between 0 and 1           =0 Else where G(y)= P[-y &lt;= x1-x2 &lt;= y]       =\int_{-y}^y \int_{x1_y}^{y+x1} 1 dx2 dx1       =\int_{-y}^y -2y dx1       =4y^2 when y between 0 and 1       =0 when y less than 0       =1 when y greater than 1 Thus, g(y)= \diff G(y) =8y  Is it correct?