I have this script, which changes NVIDIA-SETTINGS vibrance, when certain application/process is launched (in my case Counter-Strike:Global Offensive game)  Script:  #!/bin/bash  on="1023" off="0" dv="0"   # RESET sleep 10 log "RESET" nvidia-settings -a "[gpu:0]/DigitalVibrance[DFP-0]=$off"  while true; do #daemon mode dv=`nvidia-settings -q "[gpu:0]/DigitalVibrance[DFP-0]" -t`   if pgrep -l csgo | grep csgo_linux   then #  log "Process csgo_linux found"     if [ $dv -eq $off ]; then       nvidia-settings -a "[gpu:0]/DigitalVibrance[DFP-0]=$on"     fi   else # No process found     if [ $dv -eq $on ]; then       nvidia-settings -a "[gpu:0]/DigitalVibrance[DFP-0]=$off"     fi   fi    if [ $dv -eq $on ]; then   sleep 5   else   sleep 1   fi  done   What is wrong with this script, why it gives me these errors?  622 csgo_linux64 /home/matas/Desktop/vib-gui.sh: line 18: [: -eq: unary operator expected /home/matas/Desktop/vib-gui.sh: line 28: [: -eq: unary operator expected 622 csgo_linux64 /home/matas/Desktop/vib-gui.sh: line 18: [: -eq: unary operator expected /home/matas/Desktop/vib-gui.sh: line 28: [: -eq: unary operator expected 622 csgo_linux64 /home/matas/Desktop/vib-gui.sh: line 18: [: -eq: unary operator expected /home/matas/Desktop/vib-gui.sh: line 28: [: -eq: unary operator expected 622 csgo_linux64 /home/matas/Desktop/vib-gui.sh: line 18: [: -eq: unary operator expected /home/matas/Desktop/vib-gui.sh: line 28: [: -eq: unary operator expected   EDIT:  #!/bin/bash  on="1023" off="0" dv="0"   # RESET sleep 10 nvidia-settings -a "[gpu:0]/DigitalVibrance[DFP-0]=$off"  while true; do #daemon mode dv=`nvidia-settings -q "[gpu:0]/DigitalVibrance[DFP-0]" -t`   if pgrep -l csgo | grep csgo_linux   then #  log "Process csgo_linux found"     if [ "$dv -eq $off" ]; then       nvidia-settings -a "[gpu:0]/DigitalVibrance[DFP-0]=$on"     fi   else # No process found     if [ "$dv" -eq "$on" ]; then       nvidia-settings -a "[gpu:0]/DigitalVibrance[DFP-0]=$off"     fi   fi    if [ "$dv -eq $on" ]; then   sleep 5   else   sleep 1   fi  done
#!/bin/bash  SUBJECT="WARNING CPU USAGE HIGH" TO=gmail id MESSAGE=/tmp/messages echo "#######################" &gt; $MESSAGE echo "CPU statistics as follows.." &gt;&gt; $MESSAGE mpstat &gt;&gt; $MESSAGE echo "#######################" &gt;&gt; $MESSAGE CPU_USAGE=$(top -b -n1 | awk '/^Cpu/ {print $2}' | cut -d. -f1) [ $CPU_USAGE -gt 85 ] &amp;&amp; mail -s "$SUBJECT" "$TO" &lt; $MESSAGE`   ./cpu.sh: line 11: [: -gt: unary operator expected What might be the reason
How does Latex compilers integrate packages into its existing core functions? Can I use the Adwaita theme in Unity without installing GNOME shell? I recently installed Ubuntu 11.10 (new install). I would like to use the Adwaita theme with Unity, but it seems that it is not available in the theme selection dialog. I know I get it there after installing gnome-shell, but is there a way to use Adwaita theme for Unity without installing gnome-shell? What is the use of a persistence layer in any application? I have a problem understanding the proof of Rencontres numbers (Derangements) I understand the whole concept of Rencontres numbers but I can't understand how to prove this equation  $$D_{n,0}=\left[\frac{n!}{e}\right]$$  where $[\cdot]$ denotes the rounding function (i.e., $[x]$ is the integer nearest to $x$). This equation that I wrote comes from solving the following recursion, but I don't understand how exactly the author calculated this recursion.  $$\begin {align*}  D_{n+2,0} &amp; =(n+1)(D_{n+1,0}+D_{n,0}) \\ D_{0,0} &amp; = 1 \\ D_{1,0} &amp; = 0  \end {align*} $$ JMeter : How to record HTTPS traffic? Is there a way in Java to determine if a path is valid without attempting to create a file? I don't know how to prove this example. Let $y(t):\mathbb{R}^+\to \mathbb{R}$ be a nonincreasing function. Assume that there is a constant $A&gt;0$ such that \begin{equation} \int_{s}^{+\infty}y(t)dt \leq Ay(s), \quad 0\leq s&lt;+\infty \end{equation} Then $y(t)\leq y(0)e^{1-\frac{t}{A}}$, for all $t&gt;0$. Accepted answers don't float "on top" when self-answered? On , the accepted answer doesn't float on top. Apart from that, the display is correct (i.e. the V mark and the green border)  If I sort by "vote", I've got the following answer order:   Jezell Marc Gravell chilltemp (Accepted) Shaun Bowe   By "oldest":   Marc Gravell Jezell chilltemp (Accepted) Shaun Bowe   and by "newest":   Shaun Bowe chilltemp (Accepted) Jezell Marc Gravell     I'm using Firefox V.3.5 : Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1) Gecko/20090624 Firefox/3.5 (.NET CLR 3.5.30729)  Feel free to ask for more debug information if needed. How to create complex conditional clauses / queries? I've been reading the documentatoin on  and also studied the api description for  and  but I fail to create a $query with 3 -&gt;conditions:   select all between 0 and 100 but exclude 23, 48 and 97 select also 107, 123, 126 and 128   That's what I have tried so far:  $query-&gt;db_or()   -&gt;condition('my_field', array(107, 123, 126, 128), 'IN')   -&gt;condition(db_and()-&gt;condition('my_field', array(0, 100), 'BETWEEN')                       -&gt;condition('my_field', array(23, 48, 97), 'NOT IN'));   But I get the following error:  PHP Fatal error:  Call to undefined method SelectQuery::db_or() in [... first line]   I've tried to play around with the syntax like that:  $query-&gt;condition(-&gt;db_or()   -&gt;condition('my_field', array(107, 123, 126, 128), 'IN')   -&gt;condition(db_and()-&gt;condition('my_field', array(0, 100), 'BETWEEN')                       -&gt;condition('my_field', array(23, 48, 97), 'NOT IN')));   But again getting errors like that:  PHP Parse error:  syntax error, unexpected T_OBJECT_OPERATOR, expecting ')' in [... first line]   I also tried working with variables:  $cond01 = array('my_field', array(107, 123, 126, 128), 'IN'); $cond02 = array('my_field', array(0, 100), 'BETWEEN'); $cond03 = array('my_field', array(23, 48, 97), 'NOT IN'); $db_and = db_and(); $db_and-&gt;condition($cond02); $db_and-&gt;condition($cond03); $db_or = db_or(); $db_or-&gt;condition($cond01); $db_or-&gt;condition($db_and); $query-&gt;condition($db_or);   But this again yields drupal errors like that:  SQLSTATE[42S22]: Column not found: 1054 Unknown column 'Array' in 'where clause'   How to create a complex conditional database query with both AND and OR statements? font set problems in beamer i want to set the main font in my beamer as "Consolas" i do like this :  \documentclass{beamer} \usepackage{fontspec} \usetheme{Warsaw} \begin{document} \setmainfont{Consolas} \begin{frame} we discuss the ambiguities of existing security definitions and then provide a general framework for defining AKE security when involve strong adversary capabilities \end{frame} \end{document}   but after compile it , the font doesn't change, it is the same with that before the main font was set. what's the reason? I don't know what exactly it's called, by cache refresh I mean, refresh the page after clearing its cache. I don't want to clear the entire browser cache.  I can't seem to cache refresh my pages. In Firefox, I know it to be Shift+Refresh.  In Chrome, I've tried Ctrl+R, Ctrl+Refresh, Alt+Refresh, Shift+Refresh but none of them work. Problem with long chapter title and arsclassica Is there a preinstalled or automatic firewall? Does Ubuntu come with a preinstalled or automatic firewall? If not, do I need one?   I've read some articles about the advantages of Linux over other operating systems about security (no need to have antivirus, ...) but would like to be sure. Can a druid in Ape wildshape use weapons? Why didn't Elizabeth get cursed? Sequential renaming of files I found an answer for  which works fine for renaming filenames as follows :  1.jpg &gt; 00001.jpg 2.jpg &gt; 00002.jpg . . . 9.jpg &gt; 00009.jpg   That uses the following command:  rename 's/\d+/sprintf("%05d", $&amp;)/e' *.jpg   But my filenames aren't numeric. They are an alphanumeric sequence, like: a.jpg, b.jpg, c.jpg...... m.jpg.  In a similar way to the original question, I want to rename these so they display in the correct sequence. How do I do this? How do I prevent a line from appearing by itself:  Orphan: at the bottom of the page, or Widow: at the top of the page? Is it possible to install Ubuntu FROM a smartphone? So, I'm in a situation were I want to install ubuntu in my laptop (currently running windows 8) but I don't happen to have pendrives, CDs or the like available. The only "external" device I have with me is a samsung galaxy s2 with a micro SD-card in it.   Is it possible to use the phone as a pendrive to install ubuntu from it somehow? (without damaging the phone's OS and data) Why does prime factorization for LCM work? A method to finding the LCM of two numbers is to use prime factoring. I know how to do this, but logically why does this work in finding the lcm Solve $x^2+5x+6 \equiv 187 \mod 187$ Solution $$x^2+5x+6 \equiv 187 \mod 187$$ $$ (x+\frac{5}{2})^2 \equiv \frac{1}{4}$$ $$ 4(x+\frac{5}{2})^2 \equiv 1$$ $$ y:= x+\frac{5}{2} $$ $$ 4y^2 \equiv 1 \mod 11 \wedge 4y^2 \equiv 1 \mod 17  $$ $$ ( 2y \equiv 1 \mod 11 \vee 2y \equiv 10 \mod 11 ) \wedge ( 2y \equiv 1 \mod 17  \vee 2y \equiv 13 \mod 17)  $$ $$ ( y \equiv 6 \mod 11 \vee y \equiv 5 \mod 11 ) \wedge ( y \equiv 9 \mod 17  \vee y \equiv 15 \mod 17)  $$ Combining that from CRT I got: $$ y \in \left\{49, 60,83,94 \right\} $$ and for example: $$ x+\frac{5}{2}  \equiv 94 \mod 187$$ $$ 2x  \equiv 183 \mod 187$$ some calculus and get... $$x \equiv 185 $$ And the same thing for each other case. Question Is there any faster (or smarter) way to solve equations like that?