I have written a script to manipulate my wallpapers. It works fine in the terminal, but not in cron. Upon careful investigation I have found the offending line in the script: gsettings set org.gnome.desktop.background picture-uri &quot;file://$wpp&quot;  Where $wpp contains the full pathname of the image.  All of my other variables that are saved to disk as text files are properly written.  I find that the 'wallpaper index number' in increasing, as it should, but the org.gnome.desktop.background picture-uri  is unchanged. In a terminal I can enter gsettings set org.gnome.desktop.background picture-uri &quot;file:///fullpath/new-pic-name.jpg&quot;  and the background changes.  But future iterations of the cron job leave the background unchanged. I want this little bash script to automatically update MY wallpapers, not those that come with my system. This should be accessed in alpha order; not in file/directory order as it would be if I were updating automatically in Gnome Settings. And there's something else I don't understand: when I select a background from the gnome settings panel, the org.gnome.desktop.background picture-uri doesn't change. What's going on here?
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)
Rendering an animation the way 3D view looks Is there some way to render exactly whats in the camera view in the 3D view? By that I mean just like a screenshot really, all paths, lamps, and cameras, just like things look in the camera view. The reason I can't just take a screenshot is that I need an animation and it would be too cumbersome to take 1000+ screenshots! I'd like to remove my phone number from my iMessage account, but still have my phone enabled to receive messages sent to my email address (also used on iPad, Mac). Is there a way of doing this? Python idiom to return first item or None Highlight a word with jQuery I basically need to highlight a particular word in a block of text. For example, pretend I wanted to highlight the word &quot;dolor&quot; in this text: &lt;p&gt;     Lorem ipsum dolor sit amet, consectetuer adipiscing elit. &lt;/p&gt; &lt;p&gt;     Quisque bibendum sem ut lacus. Integer dolor ullamcorper libero.     Aliquam rhoncus eros at augue. Suspendisse vitae mauris. &lt;/p&gt;  How do I convert the above to something like this: &lt;p&gt;     Lorem ipsum &lt;span class=&quot;myClass&quot;&gt;dolor&lt;/span&gt; sit amet, consectetuer adipiscing elit. &lt;/p&gt; &lt;p&gt;     Quisque bibendum sem ut lacus. Integer &lt;span class=&quot;myClass&quot;&gt;dolor&lt;/span&gt; ullamcorper     libero. Aliquam rhoncus eros at augue. Suspendisse vitae mauris. &lt;/p&gt;  Is this possible with jQuery? Edit: As  , this is quite possible without jQuery - but I was hoping there might be a special method of jQuery which would let you do selectors on the text itself. I'm already using jQuery heavily on this site, so keeping everything wrapped up in jQuery would make things perhaps a bit more tidy. Lens upgrade paths (sub $1000) for the EF-S 18-55mm IS kit lens for Canon APS-C cameras Locking a vertex group from modification In a mesh there is a group of vertices which should not move after being positioned once. I would like to find a way to lock them in place for the whole duration of the project.   Currently I 'lock' them by hiding them and then sculpting. I imagine it is possible also to create shape keys for the vertices. Or I could write a script which would save position of the vertices.   Is there a better way to do it? NSdate Assuming wrong time zone I am trying to understand how to find the orthogonal complement of a subspace $M$ of a vector space $V$.   From my understanding, $M^\perp$ is also a subspace of $V$ where all its vectors are perpendicular (orthogonal) to the columns of $M$, which would mean that the dot product of those vectors with each column of $M$ is $0$.  However, how do I find the $M^\perp$ subspace, when $M = \{ \vec{x} \in \mathbb{R}:  2x_2 + 3x_1 = 0\}$? In general, if there's a general approach, how does one attempt to find $M^\perp$ of an arbitrary $M$?  From my understanding, in this case, $M$ is the set of vectors in a plane that satisfy that equation, where $x_1$ and $x_2$ should respectively be the first and second components of the vector $\vec{x}$. How do I set the default program? Is there a word for a question asked despite knowing the answer, but meant to elicit a response for the sake of the audience? In journalistic writing I often see writers, correspondents, and interviewers use questions in non-literal ways.  Of course there are rhetorical questions designed to make a point and not meant to literally elicit an answer.   Instead of that, I have in mind when an interviewer asks a correspondent, "why did she not go to the police?" when the interviewer already knows the story and knows the answer to the question, but wants the correspondent to articulate the answer for the audience's benefit.    Is there a commonly used term for this sort of a question?  A "leading" question generally implies an attempt to manipulate the respondent into giving certain responses, which is not exactly the same as what I'm describing. GParted won't let me edit a partition I recently saw a question titled "" (10k+ users only). I thought, "surely someone has asked this question before", and began looking for a duplicate.  is a question with the exact same title, just with a little different punctuation and casing. It was "Jquery vs Javascript" and "jQuery vs. Javascript?". The only difference being the ., ?, and the casing.  Since we now , I propose that when checking for questions with duplicate names, certain punctuation be striped out to prevent the duplicate from occurring in the first place.  As pointed out in the comments, if isn't already, white-space and non-printable characters may want to be removed for duplicate detection as well. How do I see the type of a variable whether it is unsigned 32 bit, signed 16 bit, etc.?  How do I view it? Is there any easy way on Windows to log %CPU time per process over time to a file for later analysis?  As far as I can see...   Task manager shows me the %CPU per process but only visually - no way to save to a file. Perfmon will let me save to a file, and will additionally create a time-based file (taking snapshots at specified time intervals) - which is almost what I want, except that as far as I can see it can't break down the %CPU by process. Process Explorer will let me break down by process, but it will only save the file as a snapshot of a single point in time   So, none of these are quite what I need: I need to get a file that contains something like 'top 10 processes by CPU, every 15 seconds, until I stop the monitoring' The reason I need this because I have a machine on which some process is causing occasional brief spikes in CPU usage several times a day and I need to find out which process is the culprit.    Can anything do that, or have I missed some feature of perfmon or process explorer? Variance of sample mean. Let $X_1, X_2, \ldots X_n$ be random variables with mean $\mu$ and variance $\sigma^2$. We define the sample mean $\bar{X} = \sum_{i = 1}^n X_i$.  I am having trouble understanding why the variance of $\bar{X}$ is $\sigma^2 / n$.  Here is what I worked out thus far:  $$\begin{gather} \sigma_\bar{X}^2 = E((\bar{X} - \mu)^2) = E(\bar{X}^2 - 2\bar{X}\mu + \mu^2) = E(\bar{X}^2) - 2\mu E(\bar{X}) + E(\mu^2) = E(\bar{X}^2) - \mu. \end{gather}$$  However, I'm not sure what to do with the $E(\bar{X}^2)$. This may have been asked before, however I was unable to find any duplicate. This comes from  of "Mathematical Analysis: An Introduction" by Browder. Problem 14:     If $(a_n)$ is a sequence in $\mathbb R$ and $a_n &gt; 0$ for every $n$. Then show:   $$ \liminf(a_{n+1}/a_n) \le \liminf((a_n)^{(1/n)}) \le \limsup((a_n)^{(1/n)}) \le \limsup(a_{n+1}/a_n)$$   The middle inequality is clear. However I am having a hard time showing the ones on the left and right. (It seems like the approach should be similar for each). This is homework, so it'd be great if someone could give me a hint to get started on at least one of the inequalities.  Thanks. Anyone can comment this ruby code? We know that the Maiar sent to Middle-earth as Istari are not using their full Maiar power. Gandalf the Gray is more than a human power wise, but not nearly equal to his full real power.  Is it known (from canon) whether there is something explicitly restricting Olorin's power when he's Gandalf the Gray, or is he merely prohibited from using it but still has it at his disposal?  Question arose from  comment. Daniel was using Saruman having greater powers once he turned "bad" as his reasoning. Limiting Length of Input in JTextField is not working Why LastModifiedbyid in Trigger.new gives old value I have noticed the strange behaviour of salesforce due to which even my code broke down in production.  I was trying to stop the user from updating some field..I used before udpate trigger and code like Trigger.new[i].LastModifiedbyId..  Ideally it should give the current user in Trigger.new[i].LastModifiedbyId in  but it gives oldrecordLastModifiedbyId..  Although userinfo.getuserid resolves the problem later.  Any idea about this behaviour of salesforce.