Retrofil Attempt to invoke interface method call on a null object
What is a NullPointerException, and how do I fix it?
I must have a blind spot, but I cannot find what it is.   I made a small python script that removes VLC from the sound menu. It runs perfectly in any way I run it from the terminal or from a launcher or whatever you can think of.   What the script actually does is nothing more than get the get the current settings:  gsettings get com.canonical.indicator.sound interested-media-players   edit the list, and set the changed list by:  gsettings set com.canonical.indicator.sound interested-media-players "['newlist']"   These commands are executed by a python script,. However, when run from a cronjob (crontab -e) only the gsettings - get - part works, but not the gsettings - set - section. That the get section works fine with cron, I checked by making the script write data (the original as well as the edited) to an external file.  Not a python problem  To see if the problem is related to python code, I created a bash script that applies a changed sound menu items list. The story is the same: the bash script runs fine from the command line or a launcher, not from cron, while any other command in the same script would run fine. Also, if I add any command at the end of the script below, it works fine and it looks like the script is satisfied with its own work.  Why is the gsettings set command not working when initiated from cron?  This is the script:  #!/usr/bin/python3 import subprocess  def read_soundmenu():     # read the current launcher contents     get_menuitems = subprocess.Popen([         "gsettings", "get", "com.canonical.indicator.sound", "interested-media-players"         ], stdout=subprocess.PIPE)     return eval((get_menuitems.communicate()[0].decode("utf-8")))  def set_current_menu(current_list): # this takes no effect from cron     # preparing subprocess command string     current_list = str(current_list).replace(", ", ",")     subprocess.Popen([         "gsettings", "set", "com.canonical.indicator.sound", "interested-media-players",         current_list,         ])  current_list = read_soundmenu() for item in current_list:     if item == "vlc.desktop":         current_list.remove(item) set_current_menu(current_list) Is there a case where including the same header twice is actually helpful? Does any one know the exact expression of the integral,  $$E_n(s)=\int_0^\infty \frac{r^{n-1}}{(1+r^2)^{\frac{s}{2}}}\,dr~~~~s&gt;n, n\in \mathbb{N}$$ or more generally, $$E_a(s)=\int_0^\infty \frac{r^{a-1}}{(1+r^2)^{\frac{s}{2}}}\,dr~~~~s&gt;a, a\in \mathbb{R}$$ For the special case $s=n, n+2$ I find out by induction that $$ E_{n-1}(n)=\frac{\omega_{n-1}}{2\omega_{n-2}}~~\text{and}~~E_{n-1}(n+2)=\frac{\omega_{n-1}}{2n\omega_{n-2}}. $$ where $\omega_{n-1} = \frac{\pi^{\frac{n}{2}}}{\Gamma(\frac{n}{2})}$ is the  surface measure of the n-dimensional sphere of $\mathbb{R}^n$. Further result is welcome Find an example of a function sum $\sum_{n=1}^\infty u_n $ that converges   uniformly on $[a,b]$ and converges absolutely pointwise, but   $\sum_{n=1}^\infty |u_n| $ doesn't converge uniformly on $[a,b]$.   This seems pretty straightfoawrd but it's really hard to find an example. The choice of $u_n$ must be very specific. You can actually prove any power series wont work (due to Abel's theorem)  In addition, in order to prove the uniform convergence, $u_n$ must not satisfy Weierstrass' M-Test (because then $\sum |u_n|$ would converge uniformly aswell) What is the volatile keyword useful for? Does a four-divergence extra term in a Lagrangian density matter to the field equations? Greiner in his book "Field Quantization" page 173, eq.(7.11) did this calculation:     ${\mathcal L}^\prime=-\frac{1}{2}\partial_\mu A_\nu\partial^\mu A^\nu+\frac{1}{2}\partial_\mu A_\nu\partial^\nu A^\mu-\frac{1}{2}\partial_\mu A^\mu\partial_\nu A^\nu $   $\space\space\space\space=-\frac{1}{2}\partial_\mu A_\nu\partial^\mu A^\nu+\frac{1}{2}\partial_\mu[A_\nu(\partial^\nu A^\mu)-(\partial_\nu A^\nu) A^\mu]$        The last term is a four-divergence which has no influence on the field equations. Thus the dynamics of the electromagnetic field (in the Lorentz gauge) can be described by the simple Lagrangian        ${\mathcal L}^{\prime\prime}=-\frac{1}{2}\partial_\mu A_\nu\partial^\mu A^\nu$     Yes, if it is a four-divergence of a vector whose 0-component doesn't contain time derivatives of the field, indeed according to the variational principle this four-divergence will not influence the field equation.  And actually I calculated the time-derivative dependence of 0-component of $[A_\nu(\partial^\nu A^\mu)-(\partial_\nu A^\nu) A^\mu]$, in which only $[A_0(\partial^0 A^0)-(\partial_0 A^0) A^0]$ could possibly contain time-derivative, which vanishes fortunately, so whatever the general case it doesn't matter in this present case.  But how can he seem to claim that it holds for a general four-divergence term,The last term is a four-divergence which has no influence on the field equations?  EDIT: I only assumed the boundary condition to be $A^\mu=0$ at spatial infinity, not at time infinity. And the variation of the action $S = \int_{t_1}^{t_2}L \, dt$ is due to the variation of fields which vanish at time, $\delta A^\mu(\mathbf x,t_1)=\delta A^\mu(\mathbf x,t_2)=0$, not having the knowledge of $\delta \dot A^\mu(\mathbf x,t_1)$ and $\delta \dot A^\mu(\mathbf x,t_2)$, which don't vanish generally, so the four-divergence term will in general contribute to the action, $$\delta S_j=\delta \int_{t_1}^{t_2}dt\int d^3\mathbf x \partial_\mu j(A(x),\nabla A(x),\dot A(x))^\mu =\delta \int_{t_1}^{t_2}dt\int d^3\mathbf x \dot j^0 =\int d^3\mathbf x [\delta j(\mathbf x, t_2)^0-\delta j(\mathbf x, t_1)^0]$$ which does not vanish in general! I want to transfer my current system hard drive to a larger hard drive. Doing so, I thought of creating an image of my system hard drive which is 320 GB in size.   Would I be able to restore this image on a larger hard drive? I plan buying a 1TB hard drive.  If yes, how? I prefer no data loss.  I am using Windows 7 PSTricks error "Undefined control sequence  \c@lor@to@ps" How small a quantity should be added to x to avoid taking the log of zero? I have analysed my data as they are. Now I want to look at my analyses after taking the log of all variables. Many variables contain many zeros. Therefore I add a small quantity to avoid taking the log of zero.   So far I've added 10^-10, without any rationale really, just because I felt like adding a very small quantity would be advisable to minimize the effect of my arbitrarily chosen quantity. But some variables contain mostly zeros, and therefore when logged mostly -23.02. The range of the ranges of my variables is 1.33-8819.21, and the frequency of zeroes also varies dramatically. Therefore my personal choice of "small quantity" affects the variables very differently. It is clear now that 10^-10 is a completely unacceptable choice, as most of the variance in all the variables then comes from this arbitrary "small quantity".  I wonder what would be a more correct way of doing this.  Maybe it's better to derive the quantity from each variables individual distribution? Are there any guidelines about how big this "small quantity" should be?  My analyses are mostly simple cox models with each variable and age/sex as IVs. The variables are the concentrations of various blood lipids, with often considerable coefficients of variation.  Edit: Adding the smallest non-zero value of the variable seems practical for my data. But maybe there is a general solution?  Edit 2: As the zeros merely indicate concentrations below the detection limit, maybe setting them to (detection limit)/2 would be appropriate? when is this series convergent. Let $(x,y)\in \mathbb{R^2}$ and consider the series   $$\lim_{n\rightarrow \infty}\sum_{\ell,\,k=0}^n \frac{k^2 x^k y^\ell}{\ell!}$$  Then for what values $(x,y)$ the series converges. I have absolutely no idea how to deal with it. Solve $x=y\frac{dy}{dx}-\left(\frac{dy}{dx}\right)^{2}$ bash - problems reading text file and printing line by line I want to set an environment variable from the command prompt and then be able to access it globally (for instance, I should see it by going to System -> Environment Variables).    When I use the set command, it isn't accessible in a new cmd session.  set NEWVAR=SOMETHING echo %NEWVAR%   Related questions: How to make a press proof with crop marks and color bars? A standard proof for press needs crop marks and color bars as below    With the package crop, the crop marks can be easily added.  But how about the color bar ?  Is there a way or a package to make it ?  An example is   \documentclass[b5paper,10pt]{article} \usepackage[utf8]{inputenc} \usepackage[cross,a4,center,info,axes]{crop}  \title{Test} \author{User} \begin{document} \maketitle \section{Fox} The quick brown fox jumps over a lazy dog. \end{document} Use (or non-use) of articles before abstract nouns How can I connect two different DC power sources together? How can I connecting two different DC power sources together? for example 15Vdc(5Amp) with 5Vdc(2Amp). I want to make one DC source (20Vdc,7Amp) by more powerful supplies. Finite group with isomorphic normal subgroups and non-isomorphic quotients? I know it is possible for a group $G$ to have normal subgroups $H, K$, such that $H\cong K$ but $G/H\not\cong G/K$, but I couldn't think of any examples with $G$ finite. What is an illustrative example? The following message keeps appearing on my Samsung Galaxy S4 phone screen about every three seconds  "Unfortunately, Google Play Services has stopped".    Is it actually a virus or it is a problem with the Google Play Service?  I have tried disabling the Google Play Service but the message keeps appearing.  I have Norton Mobile running on my phone to pick up on viruses and to alert me to any possible security issues and also Lookout. They haven't picked up anything.  Does anyone have any suggestions? A subgroup of a cyclic group is cyclic - Understanding Proof I'm having some trouble understanding the proof of the following theorem  A subgroup of a cyclic group is cyclic  I will list each step of the proof in my textbook and indicate the places that I'm confused and hopefully somewhere out there can clear some things up for me.  Proof Let  G be a cyclic group generated by &quot;$a$&quot; and let H be a subgroup of G. If $H = {\{e\}}$, then $H \text{ = &lt;e&gt;}$ is cyclic. If $H \neq \space {\{e\}}$, then $a^n \in H$ for some $n \in \mathbb{Z}^{+}$. Let $m$ be the smallest integer in $\mathbb{Z}^{+}$ such that $a^m \in H$. We claim that $c = a^m$ generates H; that is, $$H \space = \space &lt;a^m&gt; \space = \space &lt;c&gt;.$$ We must show that every $b \in H$ is a power of c. Since $b \in H$ and $H \leq G$, we have $b = a^n$ for some $n$. Find $q$ and $r$ such that $$ n = mq + r \space \space \space \space for \space \space \space 0 \leq r &lt; m,$$  Alright this is the first part in the proof where I start to get confused. Where does the division algorithm come from and why are we using it? The proof continues as follows:  $$a^n = a^{mq + r} = (a^m)^q \cdot a^r,$$ so $$ a^r = (a^m)^{-q} \cdot a^n.$$ Now since $a^n \in H$, $a^m \in H$, and $H$ is a group, both $(a^m)^{-q}$ and $a^n$ are in $H$. Thus $$(a^m)^{-q} \cdot a^n \in H; \space \space \space \text{that is,} \space \space a^r \in H.$$  This is another point at which I’m a little confused. What exactly about $a^n$ and $a^m$ being elements of $H$ allows us to accept that $(a^m)^{-q}$ and $a^{n}$ are in $H$? The proof continues:  Since $m$ was the smallest positive integer such that $a^m \in H$ and $0$ $\leq r$ $&lt; m$, we must have $r = 0$. Thus $n = qm$ and $$b \space = \space a^n \space = \space (a^m)^q \space = \space c^q,$$ so b is a power of c.  This final step is confusing as well, but I think its just because of the previous parts I was confused about. Any help in understanding this proof would be greatly appreciated Update: Universal login is in place and considered &quot;done&quot;. If you see anything weird, please submit new bug reports.   As y'all know, our current flavor of &quot;global authentication&quot; leaves a few things to be desired. It's flaky, requires a page refresh, etc. etc. Wouldn't it be nice if you could just sign in once and be automatically logged in across the network?  We are ready to roll out Stage 1 of Project &quot;Make Authentication Suck Less&quot;. It is live as of a few minutes ago. What this means right now:  When you log into any Q&amp;A site on the stackexchange.com domain, you will be automatically logged into all other Q&amp;A sites on the stackexchange.com domain + stackexchange.com itself.   is excluded from this.   , , and other Q&amp;A sites with their own domains will still use the old flow.  We are going to recognize you in some ways on sites where you don't have a profile. This is still a work in progress, but most notably you will see &quot;join this community&quot; in the top bar instead of &quot;sign up&quot; and &quot;log in&quot;.   But I use multiple accounts! What do? We aren't intending to break the ability to run multiple accounts. The same guidelines as before still apply — we don't officially support that, you might end up with an accidental automatic merge if you're not careful with your credentials, any interaction between the accounts is right out, and so on. If you're already using different browsers or different browser profiles for your accounts, nothing will change for you. If you are somehow logged into multiple accounts in the same browser... I'm sorry to say, but that's a bug even for our current global auth setup. You will now only be able to log into one at a time, and you'll need to log out when you want to switch. (Or start using different browsers.) What's next:  Remember  we tested a few months ago? It's coming back. Stage 2: bring other domains into the fold (this is also live now) Stage 3: make cross-domain experience smoother and support browsers that reject third-party cookies in all conditions (looking at you, Safari) - this is not currently feasible. Safari users and users who reject third-party cookies will need to sign in separately to every second-level domain (e.g. stackexchange.com, stackoverflow.com, etc).  If you see any issues… Good luck, because you probably can't log in to report them here. =) But seriously, let us know via the contact form linked at the bottom of any page. If you are able to log in, report issues here on meta as normal. So, in conclusion…