I have a function which has got data from the API. I want to run this function in every day at a specific time. I have used below code for achieving this, but the blow of run every min. I am using this code on the 5min interval for scheduled tests. My API code is, too much long. I am using just test purpose example code there.  register_activation_hook(__FILE__, 'my_activation'); add_action( 'wp', 'my_activation' );  function my_activation() {     if (! wp_next_scheduled ( 'my_hourly_event' )) {     wp_schedule_event(time(), 'hourly', 'my_hourly_event');     } }  add_action('my_hourly_event', 'do_this_hourly');  function do_this_hourly() {     // do something every hour     $t          = time();     $user_login = 'test-'.$t;     $user_email = 'test-'.$t.'@yahoo.com';     $user_pass  = '123456';      $userdata = compact( 'user_login', 'user_email', 'user_pass' );     $user_id = wp_insert_user( $userdata ) ;      // On success.     if ( ! is_wp_error( $user_id ) ) {         echo "User created : ". $user_id;     }else{         echo "&lt;h1&gt;User already exsist&lt;/h1&gt;";      } }  register_deactivation_hook(__FILE__, 'my_deactivation');  function my_deactivation() {     wp_clear_scheduled_hook('my_hourly_event'); }
I have a site on my webhotel I would like to run some scheduled tasks on. What methods of achieving this would you recommend?  What I’ve thought out so far is having a script included in the top of every page and then let this script check whether it’s time to run this job or not.  This is just a quick example of what I was thinking about:  if ($alreadyDone == 0 &amp;&amp; time() &gt; $timeToRunMaintainance) {    runTask();    $timeToRunMaintainance = time() + $interval; }    Anything else I should take into consideration or is there a better method than this?
Is the "the ... the ..." construction governed by some grammatical rule? We are getting  in M19. What if I enchant my , copying my opponents . Then I pay the cost on my Bolas (previously a Delver) to activate his transform ability.  What will happen? I can think of 3 possibilities:   My Delver is exiled and the aura goes to the graveyard. My Delver is transformed, aura goes to the graveyard, but the Delver transforms into  My Delver is transformed, aura goes to the graveyard, and the Delver transforms into How to unmap TAB and do not make Ctrl-I invalid in VIM Dynamic Paint not showing in rendered image "This is considered..." vs. "This is considered as..." Does this "as" change the meaning or correctness of this sentence?     This is considered as socially desired.   This is considered socially desired.   Are both of them grammatically correct? Why or why not? How do I get current date/time on the Windows command line in a suitable format for usage in a file/folder name? PostgreSQL crash when connection failed Error log is:  016-02-21 21:22:34 GET DETAIL:  Connection matched pg_hba.conf line 83: "host    all             all             ::1/128                 md5" .... .... 2016-02-21 21:22:37 GET DETAIL:  Connection matched pg_hba.conf line 83: "host    all             all             ::1/128                 md5" 2016-02-21 21:22:37 GET FATAL:  password authentication failed for user "postgres" 2016-02-21 21:22:37 GET DETAIL:  Connection matched pg_hba.conf line 83: "host    all             all             ::1/128                 md5" 2016-02-21 21:22:37 GET LOG:  CreateProcess call failed: A blocking operation was interrupted by a call to WSACancelBlockingCall.       (error code 299) 2016-02-21 21:22:37 GET LOG:  could not fork new process for connection: No error 2016-02-21 21:22:37 GET LOG:  incomplete startup packet 2016-02-21 21:22:38 GET FATAL:  password authentication failed for user "postgres" 2016-02-21 21:22:38 GET DETAIL:  Connection matched pg_hba.conf line 83: "host    all             all             ::1/128                 md5" 2016-02-21 21:22:42 GET FATAL:  password authentication failed for user "postgres" 2016-02-21 21:22:42 GET DETAIL:  Connection matched pg_hba.conf line 83: "host    all             all             ::1/128                 md5" 2016-02-21 21:24:26 GET LOG:  could not receive data from client: An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full. 2016-02-21 21:24:26 GET LOG:  incomplete startup packet 2016-02-21 21:24:29 GET FATAL:  password authentication failed for user "postgres" 2016-02-21 21:24:45 GET PANIC:  could not write to log file 000000010000000100000041 at offset 4259840, length 8192: Invalid argument 2016-02-21 21:24:45 GET STATEMENT:  COMMIT 2016-02-21 21:24:53 GET LOG:  server process (PID 470944) was terminated by exception 0xC0000409 2016-02-21 21:24:53 GET DETAIL:  Failed process was running: COMMIT 2016-02-21 21:24:53 GET HINT:  See C include file "ntstatus.h" for a description of the hexadecimal value. 2016-02-21 21:24:53 GET LOG:  terminating any other active server processes   Can anyone help to solve the problem? I spent many hours but didn't find a solution.   Postgres version 9.4 Operating System: Windows  postgresql.conf is:  listen_addresses = '*' port = 5432  max_connections = 100 shared_buffers = 128MB   dynamic_shared_memory_type = windows   pg_hba.conf is:  # IPv4 local connections: host    all             all             127.0.0.1/32            md5 host    all             all             0.0.0.0/0               md5 sort but keep header line at the top I am getting output from a program that first produces one line that is a bunch of column headers, and then a bunch of lines of data. I want to cut various columns of this output and view it sorted according to various columns. Without the headers, the cutting and sorting is easily accomplished via the -k option to sort along with cut or awk to view a subset of the columns. However, this method of sorting mixes the column headers in with the rest of the lines of output. Is there an easy way to keep the headers at the top? Can you reduce yourself, crawl into the Tarrasque's airway, and try to collapse its lung by enlarging inside of it? A player tried to use the spell  on his PC while in the mouth of the Tarrasque to shrink himself, then go deeper into its airway and to try to collapse its lung by enlarging himself inside of it. I imagine there's no real rule for this but I felt silly just denying it, because it seemed like a cool idea that you could only probably do with a creature as large as the Tarrasque.  Can you crawl into a gargantuan creature’s mouth or into its airway via reduce/enlarge and attack its brain or internal organs? In Lieb and Loss's Analysis, I saw that they mentioned  $L^1(\mathbb{R}^n) \cap L^2(\mathbb{R}^n)$ dense in $ L^2(\mathbb{R}^n)$ (dense wrt the $L^2$ norm, I think). But I didn't find its proof in the book. So I wonder why it is?    Does this conclusion hold for $L^1(\Omega, \mathcal{F}, \mu) \cap L^2(\Omega, \mathcal{F}, \mu)$ for any measure space $(\Omega, \mathcal{F}, \mu)$?  Are there similar statements if replace $L^1$ with $L^p$, and  $ L^2$ with $L^q$ for $p \leq q \in (0, \infty ]$ or $\in [1, \infty]$?  Thanks and regards! Can't boot into Ubuntu in Windows 10 / Ubuntu dual boot Another phrase for "a chicken and egg situation" Is there any other phrase that conveys the same meaning as  the phrase "a chicken and egg situation" especially if one has to use this phrase in an official/corporate set up? A bounce-rate attack to manipulate SEO? This is a question to experienced people that might help us shed some light on the issue.   We noticed a very strange behavior on our site, in Google Analytics. Some dude from Finland, namely, from Kouvola city is hitting one of our pages - only one page on our site, 'bout a hundred times per day, all with an average bounce rate of 90%+...  This is causing our overall bounce rate to go up by 1 to 3% per day... which is very disturbing.. since we're trying to do our best in order to keep it as low as possible. And obviously having it jumped from ~24% to 27%, just because of that crazy dude is not making us happy at all... We tried implementing a geo-targeted script in order to catch this particular visitor and deliver him a juicy message, and it seemed like it helped in the beginning, it has stopped for a day or two, but now he's back...   The geo-targeted script was also logging all IP addresses for page requests originating from Finland in order to find out more details and (in order to block them on the server level, later).. but thing is, it was all mainly cable or DSL connections with various, but not constantly repeating IPs... we are all wondering what is he up to really ?   I think that this page should be kept updated with ideas on how to combat this and perhaps someone could also shed light on what it might be ? What is the reason for doing this "bounce-rate attack", as I call it?  There was a similar question asked on stackoverflow earlier, with no meaningful answer - here - Sorry if this is a stupid question, but I am mainly working with 5V PIC circuits and now want to integrate a component (nRF24l01+) that needs a 3.3V supply.  As I have a box full of ~7V wall-warts, I normally use a 7805 or similar LDO regulator to power the circuit. Now I want to also get 3.3V without using a separate external supply.  I'm looking for guidance on the "right" way to do this. I think the options are:   Use a voltage divider on the output of my 5V regulator to get 3.3V Use a 3.3V LDO regulator fed directly from the 7V wall-wart   Use the output of the 5V regulator as input to a 3.3V regulator   I can see that all of these would work (would they?) and that option 3 seems to waste least power, but I don't know what gotchas might arise by chaining two regulators like this.  What things do I need to consider when making this choice? What I want to show is the following statement.  For every prime of the form $2^{4n}+1$, 7 is a primitive root.  What I get is that  $$7^{2^{k}}\equiv1\pmod{p}$$ $$7^{2^{k-1}}\equiv-1\equiv2^{4n}\pmod{p}$$ $$7^{2^{k-2}}\equiv(2^{n})^2\pmod{p}$$ Thus $(\frac{2^n}{p})=(\frac{7^{2^{k-2}}}{p})=1$.  I think that $7$ is important because $7$ is a primitive root but I don't know how to use $7$. Probability to choose specific item in a "weighted sampling without replacement" experiment Given $n$ items with weight $w_n$ each -- what is the probability that item $i$ is chosen in a $k$-out-of-$n$ "weighted random sampling without replacement" experiment? Can a closed-form solution that depends only on $w_i / w_\cdot$ be derived ($w_\cdot = \sum_j w_j$.)?   EDIT: A solution that depends only on $w_i / w_\cdot$ is impossible. Assume $n=3$, $i=1$, $w_1 = 1$, and two cases: (1) $w_2 = 1, w_3 = 1 + \varepsilon$, (2) $w_2 = 2, w_3 = \varepsilon &gt; 0$. In case (1) the probability is almost $2/3$, in case (2) it is almost $1$, but in both cases $w_1 = 1$ and $w_\cdot = 3 + \varepsilon$.  What I have tried so far to solve the problem:  Let $P^n_k(w, i)$ be the probability that item $i$ is chosen in an $k$-out-of-$n$ experiment with weight vector $w$. In the first draw, the item is chosen with probability $w_i / w_\cdot$. Otherwise, we are looking for the probability to choose this item in a $k-1$-out-of-$n-1$ experiment, with the same weight vector except for the item that has been selected. Hence:  $$ P^n_k(w, i) = w_i / w_\cdot + \sum_{j \neq i} w_j / w_\cdot \cdot P^{n-1}_{k-1}(w - j, i) $$ $$ = w_\cdot^{-1} \left( w_i + \sum_{j \neq i} w_j \cdot P^{n-1}_{k-1}(w - j, i) \right) $$  with $w-j$ being "the vector $w$ without the $j$th element".  How to solve this recurrence relation? (If it is correct at all...) Is there a way to do concurrent editing? Is there a MediaWiki-like method for supporting concurrent editing of text bodies in Drupal 7?  If no feature currently exists, what are some decent PHP diff libraries that could be wrapped up by a Drupal module that could do the job? Does separation of variables in PDEs give a general solution? When a partial differential equation is solved using the separation of variables method, is the produced solution the most general one that satisfies the equation or have we lost some forms of the solution because of the assumption that it is in the form of separated variables? In the book &quot;Quantum Mechanics and Path Integrals&quot; Feynman &amp; Hibbs state that  the probability $P(b,a)$ to go from point $x_a$ at time $t_a$ to the point $x_b$ at the time $t_b$ is $P(b,a) = \|K(b,a)\|^2$ of an amplitude $K(b,a)$ to go from $a$ to $b$. This amplitude is the sum of contributions $\phi[x(t)]$ from each path. $$ K(b,a) = \sum_{\text{paths from $a$ to $b$}} \phi[x(t)]$$ The contributions of a path has a phase proportional to the action $S$: $$ \phi[x(t)] = \text{const}\ e^{(i/\hbar)S[x(t)]}$$  Why must the contribution of a path be $\sim e^{(i/\hbar)S[x(t)]}$? Can this be somehow derived or explained? Why can't the contribution of a path be something else e.g. $\sim \frac{S}{\hbar}$, $\sim \cos(S/\hbar)$, $\log(S/\hbar)$ or $e^{- (S[x(t)]/\hbar)^2}$ ? Edit: I have to admit that in the first version of this question, I didn't exclude the possibility to derive the contribution of a path directly from Schrödinger's equation. So answers along this line are valid although not so interesting. I think when Feynman developed his formalism his goal was to find a way to quantize systems, which cannot be treated by Schrödinger's equation, because they cannot be described in terms of a Hamiltonian (e.g. the Wheeler-Feynman absorber theory). So I think a good answer would explain Feynman's Ansatz without referring to Schrödinger's equation, because I think Schrödinger's equation can only handle a specific subset of all the systems that can be treated by Feynman's more general principle. Automate keystrokes in Windows 7 64-bit I need to automate the pressing of the  key then pressing 5 digits then press  in Windows 7 64-bit.  I have an app that comes up on the screen and I need the "script" to press the keys.  I don't even need mouse support.  What can I use to do this?  Any examples or links?