I'm using the below script to log the user in, but when I run an if statement for is_user_logged_in(), but it doesn't seem to return the user as logged in.   &lt;?php if( isset($_POST['username']) ){     $username = $_POST['username'];     $password = $_POST['password'];     $remember = $_POST['remember'];      $user = get_user_by( 'login', $username );     $user_id = $user-&gt;ID;      if( $remember == 'on' ){         $remember_pass = true;     } else {         $remember_pass = false;     }      if ( $user &amp;&amp; wp_check_password( $password, $user-&gt;data-&gt;user_pass, $user-&gt;ID) ){         $credentials = array(             'user_login' =&gt; $username,             'user_password' =&gt; $password,             'remember' =&gt; true,         );         $auth = wp_signon( $credentials, false );         if ( is_wp_error($auth) ){             $auth-&gt;get_error_message();         } else {             echo '&lt;p&gt;Success.&lt;/p&gt;';         }     } else {                             echo '&lt;div class="result-box warning"&gt;Wrong username or password. Please try again.&lt;/div&gt;';     } } ?&gt;   What exactly am I doing wrong here? Everything is posting correctly, and the array() is working fine. If I run a is_wp_error() with the $auth, I still get a success message. So it's login in, just not actually giving them a session?
I use form to send POST request to a page and to login user with wp_signon() in order to authenticate user to my wordpress installation as described in WP documentation:  $creds = array(); $creds['user_login'] = $_POST["user-login"]; $creds['user_password'] = $_POST["user-password"]; $creds['remember'] = true;  $user = wp_signon( $creds, false );   After this little piece of code I'm checking if user was logged in:  if ( is_user_logged_in() ) { echo "SUCCESS"; } else { echo "FAIL!"; }   But I got FAIL! all the time. Then after sniffing around I found this little trick:  wp_set_current_user( $user ); if ( is_user_logged_in() ) { echo "SUCCESS"; } else { echo "FAIL!"; }   I've got SUCCESS on this one but when I leave this page I got FAIL again and again.  Can anyone explain me how to login user with wp_signon() without logging her out after page is changed or reloaded or whatever.    I've got desirable result when I go to /wp_admin and login with WP's default login form. I can navigate through every page of my WP site remaining logged-in all the time. But when I try to do this outside the default form I FAIL.  Guide me! PLEASE!
I want to use the get_option() function of wordpress in one of my theme's files, which is not related to WP, it is just located in the same directory of the other theme files. I need this file because of some extra IPN paypal related actions, but I need some values from the options table that exists in WP to be called in this page in order for it to work. I know I can't just use get_option() as this file is overlooked by wordpress. Is there any approach by including some parts of wordpress in my theme to make this functionality only work? How do suggested edits work? I'm exploring the effects of removing the intercept in a logistic regression model.  Assume a model:  $$logit(Y = 1) = \beta_1 x + \beta_2z + 0$$  with $x$ and $z$ being categorical variables with 2 levels each and no intercept.  I understood that having no intercept with categorical predictors produce coefficients that compare the $P(Y = 1)$ in each level of the two predictor against a null case where $P(Y=1) = 0.5$ or $logit(Y=1) = 0$.  I noticed a phenomenon that can understand. Using glm() function in R if you change the order of the variable in the right hand part of the formula, the coefficients change too. But even more oddly, the coefficient of the first variable is always the same.  Here's an R demo:  y &lt;- as.factor(sample(rep(1:2), 30, T)) x &lt;- as.factor(sample(rep(1:2), 30, T)) z &lt;- as.factor(sample(rep(1:2), 30, T))  coef(glm(y ~ x + z - 1, binomial) #        x1         x2         z2  #-0.1764783  0.3260739 -0.1335192  coef(glm(y ~ z + x - 1, binomial)) #        z1         z2         x2  #-0.1764783 -0.3099976  0.5025523    As you can see the first predictors have the same coefficient while the other are different in the two models.  Here is what I expected and instead behave differently than what I though:   Since every level of the two predictors is compared to the same null case, I expected to have the same coefficients in the two models, independently from the order in which I use them. I expected to see the coefficients of every level of every predictor, instead the coefficient for the 1 level of the second predictor is not shown. I therefore assume that only the first variable is compared against the null case, while the second is compared against a reference level; but what is this level? Is it $P(Y = 1 | X = 1 \cap Z = 1)$? Reproducing one of the models WITH the intercept we get:  coef(glm(y ~ x + z - 1, binomial) #        x1         x2         z2  #-0.1764783  0.3260739 -0.1335192  coef(glm(y ~ x + z, binomial)) #(Intercept)         x2          z2  #-0.1764783   0.5025523  -0.1335192    As expected x1 become the intercept, and x2 is likely relative to x1. z1 is missing also in this case and z2 is the same as in the model without intercept.  Thus should I assume that the comparison against the null case $P(Y = 1) = 0.5$ is made only for the first variable in a formula, while the other are compared against the usual intercept? Is this behavior normal? What about the fact that the first coefficient has the same value whichever the order of the predictors in the formula? What if I want to compare all level of each predictor against the null case and have a coefficient for all levels? Or it's theoretically impossible for some reason I don't get? Is the inverse of a linear transformation linear as well? A question from the field of Linear Algebra. If I have a linear transformation $T$ that is one-to-one and onto, would that mean that the $T^{-1}$ will also be linear? If so, is there any general proof for it?  Thanks How to make a field NULL using MySQL GUI Tools? I'm using the MySQL Query Browser (part of the ) and need to change a field to NULL, but I can't figure out how to do it - if I delete the value it tries to update it to ''. Typing "NULL" makes it try to update to 'NULL' (a string).  I know I could just write a query to do it, but that defeats the entire purpose of the tool, no? Setting a document in MS Word-12pt (12bp) Warning  If you're looking for advice how to make your document look like it's been written in Word, this is most likely not the question you're looking for. This question is mostly of theoretical nature, as it results in tiny differences, which will most likely not be noticed by someone who doesn't allow the use of LaTeX.  Questions that might be more helpful for this matter are:           Question  I learned that MS Word uses a slightly different version of the unit "point" (pt) than TeX does:     The 12 point of Word will be PostScript point, which in TeX would be called 12bp. A TeX pt is slightly smaller: it's 1/72.27 inch, while a bp/PostScript point is 1/72 inch. See also    ( in )  I'm writing a paper that would usually be expected to be "typeset" in MS Word, thus I want to use the same font size as Word would.  How do I set a document e.g. in the "12pt" font size that MS Word would use?  In case it matters, I'm using the article document class, Latin Modern (lmodern) as a font with the T1 font encoding and compile with pdfLaTeX, but input on different set-ups is more than welcome. How do you show that $e^{-1/x^2}$ is differentiable at $0$? Define the real valued function $f(x)$ by $f(x) = e^{-1/x^2}$ if $x \ne 0$ and $0$ if $x = 0$.    How do you show that $e^{-1/x^2}$ is differentiable at $0$? How do you show that this function is infinitely differentiable? grep a file, but show several surrounding lines? The Creative Commons FAQ      Third, if the licensor does not like how the material has been modified or used, CC licenses require that the licensee remove the attribution information upon request [...]  in 4.0, this also applies to the unmodified work.   How do I remove / dissociate my name from a post, in accordance with this clause?  Also, what are the effects of having my post dissociated from my account?  Finally, how will dissociation requests be handled for posts licensed under earlier versions of the license, which do not require dissociation upon request in all cases? Dollar cost averaging - Should I still do it if I have a large pile of cash now? I currently have a large pile of cash savings ($240,000) which I really should have been investing all this time, but the past is past and no point dwelling on it.  I am currently 38 years old (2 kids. Wife who is also a high earner - $100,000), with a high salary ($150,000). I have read "The Intelligent Investor" and am really sold on dollar cost averaging as a strategy, using the index funds offered by Vanguard.  My current dilemma is what to do with the cash I already have. My current plan is to still follow the dollar cost averaging and slowly move it into vanguard over a period of 4 years (~$5000 per month). While leaving the remaining parts of the cash in term deposits. So $50,000 in a 3 year term deposit at 3%, $50,000 in a 2 year term deposit at 2.8% etc.  But in someways it feels overly conservative. Should I just move all the money now? Or perhaps in a shorter time frame (3 years? 2 years? 1 year?).  There are a few other questions on the site similar to mine, but they are from 2013/2014 etc. Given that currently the stock market is at a high and there is a lot of economic uncertainty on the horizon, putting everything in the stock/bond market at once now seems like a risky move. And it seems to violate the principle of dollar cost averaging. Or am I violating dollar cost averaging by trying to "time the market" by looking at it's current value?  Reading this section  seems to indicate that I should just invest everything now. But the first paragraph also seems to suggest giving more weight to that advice if the market was trending upwards (Which I am not certain the current market is/will be for long).  PS: My current investment horizon is long. Basically retirement, about 20 years from now. How can I script the settings made by gnome-tweak-tool? I like to be able to configure things from the command line, so that when I reinstall the OS I can just run a script and get my preferred configuration back.  Since "upgrading" to Ubuntu 17.10, I found I had to use gnome-tweak-tool to get some settings the way I want them.  Once I find a setting in the gnome-tweak-tool GUI, how can I figure out its scriptable translation?  For example the following gsettings lines match the relevant entries in the gnome-tweak-tool screen shot below...  gsettings set org.gnome.desktop.wm.preferences titlebar-font "Tahoma Bold 8" gsettings set org.gnome.desktop.interface font-name "Tahoma 8" gsettings set org.gnome.desktop.interface document-font-name "Tahoma 8" gsettings set org.gnome.desktop.interface monospace-font-name "FixedSC 10"    ...but how could anyone guess that? And how would I, for example, figure out where to get the corresponding settings for hinting and antialiasing? One-sided Fisher's exact test and its complement Entry to The US before 30-day grace period for student visa The F student visa allows me to enter the US up to 30 days before the program starts. For starting to set up things it is of my interest to arrive sooner than that. How hard is it to travel there beforehand with a tourist visa (waiver) and leave to, say Mexico, to then re enter on a proper date within the 30 days with the student visa? This seems easier than requesting for a status change inside the US from tourist to student.. I'm writing a java app using eclipse which references a few external jars and requires some config files to be user accessable.   What is the best way to package it up for deployment? My understanding is that you cant put Jars inside another jar file, is this correct? Can I keep my config files out of the jars and still reference them in the code? Or should the path to the config file be a command line argument? Are there any third party plugins for eclipse to help make this easier? I'm using an ant build file at the moment but I'm not sure I know what I'm doing. Is there an equivelent of the deployment projects in Visual studio, that will figure out everything you need and just make an installer? I've used install4j before, and it was powerful if no where near as automated as  .Net deployment projects.   Cheers. How are Contacts in Marketing Cloud counted? Salesforce bills Marketing Cloud on total number of Contacts within the system. I'd like to know what exactly is used to count these? Is this the Email Studio > All Subscribers list or the Contact Builder > All Contacts list?  When we have Marketing Cloud connector and synchronise the Contacts object, is this counted towards that number? (or only when they have been inserted into the All Subscribers / All Contacts list, as they are not done so automatically) I would like to draw an arrow like this using TikZ:    This is taken from . I didn't succeed in reproducing the arrow; is somewhat beyond my (extremely limited) TikZ abilities. I don't need all the workflow stuff. I simply want to draw such an arrow at a certain place in my text, e.g. -->  \documentclass{article} \usepackage{&lt;???&gt;} \usepackage{tikz} \usetikzlibrary{&lt;???&gt;} \begin{document} Donec vehicula augue eu neque. Pellentesque habitant morbi \tikz &lt;???code for the arrow???&gt; ; tristique senectus et netus \end{document}   PS: Some explanations in your solution would be much appreciated, otherwise it will be difficult to customize it. Is there any way to view Chrome browser notifications history? I get Chrome notifications from several websites and they work when I don't even have any tabs open for those sites.  But sometimes I get these Chrome notifications when I am not at my desk or looking at my laptop.  As some of these notifications are useful to me, I would like to be able to access any that I have missed.  Is there a way to view the notification history? What's the easiest way to download all albums from Google Photos? I have around 950 albums at Google Photos.      I want to back them up now, but organised by albums, not by date.   Whenever I create a backup from within Google Photos, the backup splits my photos by date and adds metadata here and there.  What I am doing now is to click on every album, and choose "Download all". But this will take me ages.  Is there a way through Google Drive or another app to have a easier job? I've seen a lot of people talking about FPGA's before and I know that it stands for field-programmable gate array but how does it work and what is the purpose of using an FPGA? Compiling the following code and got the error of type illegal.  int main() {     // Compilation error - switch expression of type illegal     switch(std::string("raj"))     {     case"sda":     } }   You cannot use string in either switch or case. Why? Is there any solution that works nicely to support logic similar to switch on strings?