Why I'm getting MySQL error that server has gone away? I'm running: Drupal 7.34, PHP 5.4.16, MySQL 15.1 Distrib 5.5.41-MariaDB, for Linux  I am getting a WSOD on just the module page after a move of server, everything else seems to be running ok.  I've added:  error_reporting(E_ALL); ini_set('display_errors', TRUE); ini_set('display_startup_errors', TRUE);   to index.php and see the below errors:     Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 2006 MySQL server has gone away' in /public_html/includes/database/database.inc:2171 Stack trace:      #0 /public_html/includes/database/database.inc(2171): PDOStatement->execute(Array)      #1 /public_html/includes/database/database.inc(683): DatabaseStatementBase->execute(Array, Array)      #2 /public_html/includes/database/database.inc(2350): DatabaseConnection->query('SELECT expire, ...', Array, Array)      #3 /public_html/includes/lock.inc(167): db_query('SELECT expire, ...', Array)      #4 /public_html/includes/lock.inc(146): lock_may_be_available('theme_registry:...')      #5 /public_html/includes/theme.inc(449): lock_acquire('theme_registry:...')      #6 /public_html/includes/bootstrap.inc(455): ThemeRegistry->set(Array) #7 [internal function]:      DrupalCacheArray->__destruct()     #8 {main} thrown in /public_html/includes/database/database.inc on line 2171      Fatal error: Access to undeclared static property: Database::$activeKey in /public_html/includes/database/database.inc on line 1466
Solving "MySQL server has gone away", mysql error 2006 I have a site at hostgator, using their "Business account". It's cheap, and comes with a private SSL cert. HOWEVER, their MySQL settings are such that any db connection goes stale fairly quickly, and then the hostgator staff try to convince you to use a VPS or dedicated server at multiple times the expense.  I'm creating and deploying WebAPIs, which can have a 'conversation' which exceeds 60 seconds. When this occurs, the db connection handle is stale, causing any db operations after my timeout to fail.  I'm in the process of implementing the following solution, but am curious if anyone else has solved this issue (where they can not modify their my.ini or my.cnf to give MySQL more resources) in a similar or completely different manner.  last part of a hook_update:  $ret = db_query( "UPDATE {my_table} set field1 = '%s', field2 = %d ... WHERE vid - %d", $node-&gt;field1, $node-&gt;field2, ... $node-&gt;vid ); if (!$ret) {        // get private storage directory for this node:        $cexStorage    = _cex_front_getCexStore();        $nodeFilesPath = DRUPALROOT.'/'.$cexStorage.'/'.$node-&gt;storeDir;        $fname         = $nodeFilesPath.'/recover.node';         $readyToWrite  = serialize( $node );        file_put_contents( $fname, $readyToWrite );        if (file_exists( $fname )) {          _dbgReport( 'seems to have worked!' );        }     }   Then this is called in my hook_form, right after I determine that node->nid is valid:  function _cex_front_recover_node( &amp;$node ) {   if (!isset($node-&gt;storeDir)) {      _dbgReport( '**************************** _cex_front_recover_node: no storeDir!!!' );      return;   }    // get private storage directory for this node:   $cexStorage    = _cex_front_getCexStore();   $nodeFilesPath = DRUPALROOT.'/'.$cexStorage.'/'.$node-&gt;storeDir;   $fname         = $nodeFilesPath.'/recover.node';   if (file_exists( $fname )) {     $recovered = file_get_contents( $fname );     if ($recovered) {       // no longer needed:       unlink( $fname );       $recoveredNode = unserialize( $recovered );       // restore the key values I need to proceed with this node:       $node-&gt;stage = $recoveredNode-&gt;stage;       $node-&gt;rnid  = $recoveredNode-&gt;rnid;       $node-&gt;iris  = $recoveredNode-&gt;iris;       cex_front_update( $node );     }     else {       _dbgReport( '********* failed to read "'.$fname.'"' );     }   } }   I'll be pairing the logic down to only store the key fields I need, but this works! Sure beats upgrading my server at 3x the expense. Anyone else doing something like this?
Word caption style -- different style for label and number? This should be a common problem for anyone involved in technical writing.  When you insert an image (or table etc.) caption in Word, you get  dialog. You enter your caption,  "A happy bicycle" (in yellow).  This might be fine for a happy bicycle, but I want to have captions that have one style for the "enumeration" (label and number) and one style for the description (caption text, as called by Word), as such:    I have tried searching for this but I haven't found anything yet... I'm being asked to find 2 subgroups of $S_3$, one of which is normal and one that isn't normal. I guess, to find the non normal subgroup is easier. I would do this by trial and error, but since the group is $S_3$ and easily visualizable, I guess that there should be a geometrical property that makes it easy to find a normal subgroup. Any of you guys know one? Or should I try this by brute force? Trying to find a Sci-Fi movie, probably from the 50's or 60's I’m trying to identify a movie I saw when I was very young.  It was a “Saturday Matinee” playing on one of the local stations, and I likely watched it in the late 60’s.  So I expect that the movie is from the 50’s or 60’s.  I watched it in black and white, but it could have been a color movie on a black and white set. I clearly recall a scene where scientists enter a lab and some see something move past them in a blur.  Later in the movie, they come upon themselves in the same lab where they appear to be frozen and not moving.  Then they notice that their “other selves” are moving, just almost inperceptibly slowly.  They are encountering themselves but at a completely different time scale. Unfortunately, I don’t recall much else about the movie, just the idea that they encounter themselves once with the others flashing past, and again seemingly not moving at all.  If this rings any bells with anyone, I’d love some pointers to try to track this movie down. If $n\ne 4$ is composite, then $n$ divides $(n-1)!$. I have a proof and need some feedback. It seems really obvious that the statement is true but it is always the obvious ones that are a little trickier to prove. So I would appreciate any feedback. Thank you!  Here is what I am asked to prove:     If $n$ is composite then $(n-1)! \equiv 0 \pmod n$.   Proof:  $n$ is composite $\implies n=ab$ where $a,b \in \mathbb{Z}$ and $0&lt;a,b&lt;n$.  Case 1: If $a=b$ then $n=a^{2}$. Now $n \mid (n-1)! \implies a \mid (n-1)!$, so $$\begin{aligned} (n-1)! &amp;\equiv 1\times 2\times \dotsb \times a \times\dotsb\times (n-a)\times\dotsb\times (n-1) \\ &amp;\equiv 1\times 2\times \dotsb\times a \times\dotsb\times -a\times\dotsb\times -1 \\ &amp;\equiv 0 \pmod n \end{aligned}$$  Case 2: $0&lt;a&lt;b&lt;n$.  Then, since $a \mid n$, $b \mid n$ and $n \mid (n-1)!$ we have that $a \mid (n-1)!$ and $b \mid (n-1)!$.  So this implies $(n-1)! \equiv 1\times 2\times \dotsb\times a \times\dotsb\times b\times\dotsb\times (n-1) \equiv 0 \pmod n$, Q.E.D. How can I change the colors of lightning-button?  I tried doing this in my css:  .my-button {     background-color: #14a6bc;     color: #ffffff; }   and applying that class to my &lt;lightning-button&gt; and removing the variant but I still get the base colors? I am trying to use these examples: What is *Cell standby* and how can I keep it from eating my battery? Looking up my battery statistics, I almost always find Cell standby amongst the top consumers:    I never thought that "idle" would use so much energy. I saw that other people encounter similar problems:       Answers on those questions just give some raw ideas. I would like to know what exactly stands behind this, an whether there are ways to keep this "standby" from eating my battery? When I type dpkg -l | grep xserver-xorg, I get list of installed packages and their versions:  ii  xserver-xorg               1:7.7+3~deb7u1 ii  xserver-xorg-core          2:1.12.4-6 ii  xserver-xorg-input-evdev   1:2.7.0-1+b1 ii  xserver-xorg-input-kbd     1:1.6.1-1+b1 ii  xserver-xorg-input-mouse   1:1.7.2-3 ii  xserver-xorg-video-radeon  1:6.14.4-8   I am wondering what the number  infront of the colon means, ie the number 2 in 2:1.12.4-6 Evaluate forecasting ability of GARCH models with RMSE and MAE Every convergent sequence in a metric space has a unique limit. Is this mold? Black? White? Guys I need to find out what this is- it's also on my wooden bed racks Least rank of a matrix Let $A$ be a $7\times 7$ matrix such that it has rank $3$ and $a$ be $7\times 1$ column vector.  Then least possible rank of $A+(a a^T)$ is? ($a^T$ is transpose of the vector)  Intuitively I think it's $2$ as $a a^T$ has rank $1$, and the most it could affect is one row of $A$. Error message "sudo: unable to resolve host (none)" When I run sudo the terminal is stuck for a few seconds and then outputs an error message. My terminal looks like this:  ubuntu@(none):~$ sudo true sudo: unable to resolve host (none)   What can I do to solve it? What gifts would be welcome for a Swedish host family? Is it possible to change the color of a single bar when the bar plot is based on symbolic values? I am beginner in LaTeX, trying to use it for industrial documents. I wonder if there is a way to change the color of only one bar of the plot below, ie "TestDetails", to illustrate it is a local macro and not a LaTeX keyword. I have been trying to experiment with point meta, but could not find a way.  \documentclass{article} \usepackage{filecontents}  \usepackage{pgfplots}  \usepackage{pgfplotstable} \pgfplotsset{width=.95\textwidth, compat=newest}   \begin{document}  \begin{filecontents}{data.csv} {Occurences}, {keyword} 215, item 159, SI 134, subsubsection 106, TestDetails 58, caption \end{filecontents}  \pgfplotstableread[col sep=comma]{data.csv}{\datatable}  \begin{tikzpicture} \begin{axis}[ /pgf/number format/.cd,1000 sep={}, width=0.8\linewidth,height=6cm, xbar, xmin=30, xmax=250, xtick=\empty, enlarge x limits={value=0.1, upper}, enlarge y limits=0.1, ytick=data,  y dir=reverse, xlabel= {}, y tick label style={major tick length=0pt}, yticklabels from table={\datatable}{[index]1}, nodes near coords, nodes near coords align=horizontal, ] \addplot [draw,fill=blue!50]table[ y expr=\coordindex, x index=0]{\datatable}; \end{axis} \end{tikzpicture}  \end{document} indefinite article before proper names Kafka, discovered in the 1920s by the Expressionists, damned by the Nazis in the 1930s and by the Marxists at more or less the same time, was reinvented after World War II by the French Existentialists. They saw in him the father of Angst and the Angst for the father: an Albert Camus before his time.   Can you tell me what the purpose of using the indefinite article before the proper name is in the sentence above. What it be a mistake to write just "Albert Camus" without the article? What is "umask" and how does it work? I believe that umask is something that controls , but do not fully understand it.  After running umask 0644 in a , I cannot read the files I create with the command-line text editor nano. I noticed that the permissions of that file are set to 0022 instead of the default 0755.  How does umask work? I thought I could just remove the each digit in the umask from 0777, 7 - 6 = 1 and 7 - 4 = 3, so I expect the permissions to be 0133, but apparently, this is not the case.   What is umask exactly? Explain it to me like I was a "Linux noob" How do I calculate with umask? What are use cases for umask? I've observed several incidents where users inadvertently posted detailed, sensitive information. For example, a Server Fault user who posted a question with working login credentials to his actual production server, or the Stack Overflow user who posted actual medical records as example data for his question.   What should be the procedure for handling such cases? At what times before $1{:}30$ in the afternoon do all three doctors schedule their appointments to begin at the same time? In a certain medical group, Dr. Schwartz schedules appointments to begin $30$ minutes apart, Dr. Ramirez schedules appointments to begin $25$ minutes apart, and Dr. Wu schedules appointments to begin $50$ minutes apart. All three doctors schedule their first appointments to begin at $8{:}00$ in the morning, which are followed by their successive appointments throughout the day without breaks. Other than at $8{:}00$ in the morning, at what times before $1{:}30$ in the afternoon do all three doctors schedule their appointments to begin at the same time?  I'm not sure how to approach this question. They all begin at the same time at $8{:}00$. Also doesn't the overlapping of appointments depend on how long their respective appointments take? How to get correlation between two categorical variable and a categorical variable and continuous variable? I am building a regression model and I need to calculate the below to check for correlations   Correlation between 2 Multi level categorical variables Correlation between a Multi level categorical variable and continuous variable  VIF(variance inflation factor) for a Multi level categorical variables   I believe its wrong to use Pearson correlation coefficient for the above scenarios because Pearson only works for 2 continuous variables.   Please answer the below questions   Which correlation coefficient works best for the above cases ?  VIF calculation only works for continuous data so what is the alternative?  What are the assumptions I need to check before I use the correlation coefficient you suggest?  How to implement them in SAS &amp; R? I have:  &lt;?php  $file=fopen(date("Y-m-d").".txt","r+") or exit("Unable to open file!");  if ($_POST["lastname"] &lt;&gt; "") {    fwrite($file,$_POST["lastname"]."\n"); }  fclose($file);  ?&gt;   but it overwrites the beginning of the file.  How do I make it insert?