NullPointerException when initialising database android
What is a NullPointerException, and how do I fix it?
Desoldering/soldering 1/4" chip with eight pins The Feeds bot’s translate command is no longer working for moderators Why is my membership length only "Six months"? I was viewing the  and I noticed that I've apparently only had my account for six months, which is news to me... I opened my first site account here in February of 2014.  My account is much older than this, what's causing this bug?  To add some detail... On the per-site list, it does line up the &quot;member for X&quot; text with my actual membership time on that site. For example, when I look at the Meta Stack Exchange leaderboard, it shows me as a member for 2 years, 10 months. This is expected.  Update. With some work, today, I've managed to exceed my Interpersonal Skills hat count of with my Meta Stack Exchange hat count. This has changed my account age to match my MSE account age...  Still not reflective of my actual age... but better. Modular exponentiation by repeated squaring How to find the list of all available packages along with the lastest version number available in the repositories? I want to list all the packages(installed or not installed) along with the latest version number available in the repositories.  For example:  The output of apt-cache policy chromium-browser shows like below  $ apt-cache policy chromium-browser chromium-browser:   Installed: (none)   Candidate: 34.0.1847.116-0ubuntu2   Version table:      34.0.1847.116-0ubuntu2 0         500 http://ftp.cuhk.edu.hk/pub/Linux/ubuntu/ trusty/universe amd64 Packages   So the latest version of chromium-browser package available in the repository is 34.0.1847.116-0ubuntu2. Like that, i want to list the version number along with the package names that are available in repositories. And all i want to do this through command-line.  I want the output to be like this,  chromium-browser 34.0.1847.116-0ubuntu2 xxxxxxxxxxxxxx   yyyyyyyyyyy ............     ............ Extrusions causing problems in edit mode When I extruded vertices in edit mode, for some reason one of the sides of my 3-D model (the textured-looking side to the right) is creating a lot of errors. First off, it automatically sets extrusions on the x-axis. Secondly, it doesn't allow me to extrude planes into 3-D shapes. Thirdly, I can't increase the height of vertices without it creating a new face. Finally, it renders those automatic textures to create a grainy black texture in render mode. I attached an image with the solid object (top) and the rendered object (bottom). Note: I did not set any textures or alter the lighting on the model. Also, the left gray side is working perfectly fine without errors. Chance of selecting the last k pages in correct order from a set of n pages I have a set of documents numbered 1 to n. If I arrange the documents randomly, what is the chance of selecting the last k pages in the correct order if I select them at random from the documents?   Because order is important, I use the following formula:  $\displaystyle\frac{n!}{(n-k)!}$  From this I calculate how many ways there are to select k pages from n pages in the correct order. I need to have the last k pages. Which I can do in only one way. So is the chance   1/$\displaystyle\frac{n!}{(n-k)!}$?   It seems unlikely. It seems to me spontaneously that the chance should be smaller. How to pipe the result of 'date' command to 'mv' command I want to rename my file to the current timestamp.I know how to get the current timestamp("date +%s") but how can I pipe it to 'mv' command? I want to close one tab of chrome. I tried killing the pid of the tab, but the tab doesn't close instead says "Aw, Snap! Something went wrong while displaying this webpage. To continue, reload or go to another page". How can I get rid of this. Select Permissions Across Multiple Schemas Within the Same Database I have been asked by a client to implement some views for reporting purposes, the views will be accessed via PowerBI, Excel and SSRS. The designated user will only have access to the view and no underlying tables must be available to the user.  The problem I have encountered in that the SQL within the view touches 3 different schemas (All within the same database):   Pupil Provider  Security   The view is:  CREATE VIEW dbo.vTestPermissions AS SELECT a.Column1,        b.Column1,        c.Column1 FROM Pupil.Table1 a JOIN Provider.Table2 b ON a.Column1 = b.Column1 JOIN Security.Table3 c ON a.Column1 = c.Column1   The owners of the Tables/View are as follows:   Pupil.Table1 - Owner Pupil Provider.Table2 - Owner Provider Security.Table3 - Owner Security vTestPermissions - Owner dbo   When I select from the view I get an error:     The SELECT permission was denied on the object 'table3', database   'TEST', schema 'Security'   I have tried giving SELECT permission with and without the GRANT option to the schema, and the tables, but that makes the underlying tables available to the user.  Any help on this will be greatly appreciated. Cleaning Contaminated Disc Rotors I've had an eternal struggle with my current bike over brake contamination. The levers and calipers are shimano ultegra r8000, so the latest and (almost) greatest.  I first noticed it when I took it to a repair shop (i no longer use) for a bleed, it came back and the front brake would squeal like crazy and at low speeds had little to no braking force. You can stop from speed but then struggle to come to a halt without using your foot.  At around 2000 miles I tried to replace the brake pads, when I took them out they were black with grime on both sets (front &amp; back), not to mention worn down to the metal. I replaced them with the L04C sintered pads, gave the callipers a good cleaning with a towel (no chemicals) and fitted the new set.  Annoyingly all of my braking issues are back, now I probably should have cleaned the rotors, I simply used some muc off disc brake cleaner on them. I would like to know the best way to clean the rotors, I've inspected the pads and they are looking fairly black now, with plenty of tread left. I'm going to abandon these pads and fit a new set. For the rotors I plan to completely remove them from the wheels (they are center lock fitted) and try and treat them off the bike, what is the best way to fully clean them? They have plenty of wear left in them but you can see these black grooves in them, and plenty of muck on the back that I struggle to get off.  Below are images of the rotors after soaking them in disc brake cleaners, waiting and then wiping them down with a clean, microfiber towel.   Front Wheel Outside Rotor   Front Wheel Inside Rotor - note the increased dirt on this side  Looking at ways people clean their disc rotors, I've seen plenty of suggestions that I would need to burn the contaminants off the discs. Would the best approach be to remove them and use a blowtorch, should I soak them in some nasty chemicals overnight before I try to heat them? Do I try baking them in the oven?  And finally, what is the best way to prevent the brakes from becoming contaminated in the future? it's really off putting when they squeal and don't perform how I'd expect because it means I'm more reserved whilst out riding on the bike, leading to reduced time riding around outside. I commute on this bike (50 miles a week) and then ride about 50 on the weekends also, so it see's it's fair share of road use. I tend to wash it once after my big ride on saturdays and will rinse it off if it's been raining, any day that occurs (since I live in north east england, the acid rain..). I've owned disc brake bikes before and never had half the issues I've had with this, I had a cheap trek with tektro brakes and the brakes were sharper and never had any issues with contamination whatsoever (i did around 500 miles on that bike before a motorist happened).  Thanks for any and all advice :) I am pretty sure $(B_{t}^{2})$ not Markov because the squared random walk is not.    I guess I can repeat the method since to be Markov it must satisfy the discrete.  Thanks Why does my NTFS partition mount as read only? Until recently both my Windows Partition (C:) and my Data Partition (E:) would mount as read/write. Now both seem to only mount as read-only.    GParted Resize (Error)  ntfsresize v2.0.0 (libntfs 10:0:0) Device name : /dev/sda4 NTFS volume version: 3.1 Cluster size : 4096 bytes Current volume size: 86207623680 bytes (86208 MB) Current device size: 86207627264 bytes (86208 MB) New volume size : 78662066688 bytes (78663 MB) Checking filesystem consistency ... Accounting clusters ... Space in use : 62126 MB (72.1%) Collecting resizing constraints ... Needed relocations : 1606868 (6582 MB) Schedule chkdsk for NTFS consistency check at Windows boot time ... Resetting $LogFile ... (this might take a while) Relocating needed data ... ERROR: Extended record needed (1032 &gt; 1024), not yet supported! Please try to free less space.   chkdsk Output:     Checking file system on E: The type of the file system is NTFS. Volume label is Data.  A disk check has been scheduled. Windows will now check the disk.                            99482 file records processed.   495 large file records processed.                        0 bad file records processed.                            0 EA records processed.                                  0 reparse records processed.                             104412 index entries processed.                          0 unindexed files processed.                             99482 security descriptors processed.                    2466 data files processed.                              CHKDSK is verifying Usn Journal...   4479208 USN bytes processed.                                      Usn Journal verification completed. Windows has checked the file system and found no problems.  84187132 KB total disk space.   60479688 KB in 69969 files.      15520 KB in 2467 indexes.          0 KB in bad sectors.     174336 KB in use by the system.      65536 KB occupied by the log file.   23517588 KB available on disk.       4096 bytes in each allocation unit.   21046783 total allocation units on disk.    5879397 allocation units available on disk.  Internal Info: 9a 84 01 00 00 1b 01 00 fc 1a 01 00 00 00 00 00  ................ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 42 00 00 00 52 73 5c 77 b0 e7 1d 00 b0 df 1d 00  B...Rs\w........   fstab  # /etc/fstab: static file system information. # # Use 'blkid' to print the universally unique identifier for a # device; this may be used with UUID= as a more robust way to name devices # that works even if disks are added and removed. See fstab(5). # # &lt;file system&gt; &lt;mount point&gt;   &lt;type&gt;  &lt;options&gt;       &lt;dump&gt;  &lt;pass&gt; proc            /proc           proc    nodev,noexec,nosuid 0       0 # / was on /dev/sda5 during installation UUID=8213cc89-2438-41b9-899f-13b4c5b299af /               ext4    errors=remount-ro 0       1 # swap was on /dev/sda6 during installation UUID=45873767-d9ae-4f0c-baab-ffc2726ac24e none            swap    sw              0       0   Checked the drive in GParted, GSmartControl and with ntfsfix, all completed successfully, no change.  Partitions  dev/sda1 NTFS WinRE dev/sda2 NTFS Windows C: dev/sda3 Extended dev/sda4 NTFS Data E: dev/sda5 EXT4 Ubuntu dev/sda6 linux-swap    I am looking for an explanation of:    Internal Info: 9a 84 01 00 00 1b 01 00 fc 1a 01 00 00 00 00 00  ................ 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................ 42 00 00 00 52 73 5c 77 b0 e7 1d 00 b0 df 1d 00  B...Rs\w........   and    Resetting $LogFile ... (this might take a while) Relocating needed data ... ERROR: Extended record needed (1032 &gt; 1024), not yet supported! Please try to free less space. Eclipse: Can you format code on save? In Eclipse, under Windows -> Preference -> Java -> Code Style, you can define code templates for comments and code, and you can setup a code formatter.   I'm wondering if it is possible in Eclipse to have these setting take affect every time I save a source file.  Basically, instead of me highlighting everything and pressing Ctrl+Shift+F, I want Eclipse to be responsible for making sure my code is formatted properly.  Is this possible and how do you set it up?  Note On Using the Auto-Format:  It's probably best to choose "Format Edited Lines" as merging changes becomes very difficult when you reformat a whole file that is in source control already that was not formatted properly. Already did this to a co-worker. In the following snippet:  public class a {     public void otherMethod(){}     public void doStuff(String str, InnerClass b){}     public void method(a){         doStuff("asd",             new InnerClass(){                 public void innerMethod(){                     otherMethod();                 }             }         );     } }   Is there a keyword to refer to the outer class from the inner class?  Basically what I want to do is outer.otherMethod(), or something of the like, but can't seem to find anything. Objects vs arrays in Javascript for key/value pairs We often see new users make offtopic, low quality posts, with broken English and cries for help. These questions look significantly different from most on SO.  When I worked in publishing, we would frequently receive documents that were incorrectly formatted. This was a major problem and we wasted a lot of time sending emails back and forth.  I made a small JavaScript quiz asking our authors about the formatting directions and the number of emails drastically dropped. I felt this was much nicer than simply rejecting them, additionally providing us a chance to make the directions more clear.  It is slightly unconventional but, would showing new users a quiz where they have to identify good and bad posts help to improve the quality of SO questions?  Edit (3/8/2017)  Recently a Norwegian website got some media attention for . Posting and answering questions you have already found the answer to Is $\le$ defined by $\langle 𝑥_1, 𝑦_1 \rangle \le \langle 𝑥_2, 𝑦_2 \rangle$, if $𝑥_1 \le 𝑥_2 \land𝑦_1 \ge 𝑦_2$ a linear order? I need to tell if the relation $\le$ defined by relationship $\langle 𝑥_1, 𝑦_1 \rangle \le \langle 𝑥_2, 𝑦_2 \rangle$, if $𝑥_1 \le 𝑥_2$ $\land$ $𝑦_1 \ge 𝑦_2$ linear order?   I have already proven that the relation is an order, but I need to decide if it is a linear order and why. Thanks for any help! Distance between two hyperplanes I have two parallel hyper planes $$a^Tx=b_1,a^Tx=b_2$$ where $a \in \mathbb{R}^n, x \in \mathbb{R}^n ,b \in \mathbb{R}$ and I want to find the distance between the two. I have read that the distance between the two hyperplanes is also the distance between the two points $x_1$ and $x_2$ where the hyperplane intersects the line through the origin and parallel to the normal vector $\vec a$. These points are given by $$x_1=\frac{b_1}{\|a\|^2_2}a$$ and $$x_2=\frac{b_2}{\|a\|^2_2}a$$ Then the distance is $|x_1-x_2|$ but I don't really understand how we got $x_1$ and $x_2$.