Pasar variable desde php a ajax y redireccionar mediante location.href

tengo una funcion en ajax que recibe parametros de formulario y los procesa en un archivo php que busca el registro, si coincide lo redirecciona a otra pagina, caso contrario muestra mensaje de error. El problema es que no logro que pase el parametro $id para redireccionar, me recibe el valor 2 del echo. Adjunto codigo. Es un sistema para validar y activar usuarios. Agradeceria su colaboracion y gracias.

Archivo Ajax:

submitHandler: function(form){
                    var thisForm = $(form);
                        type: "POST",
                        url : "sesuser.php",
                        data: thisForm.serialize(),
                        success: function(msg){
                            setTimeout(function() {
                            }, 4000);

                            if(msg == "1"){
                            }else if(msg == "2"){
                           /// aqui esta mi problema ////
                                var objJson=JSON.parse(msg);
                                location.href ='activar?id=' + objJson;
                            }else if(msg == "3"){

                            setTimeout(function() {
                            }, 4000);

Archivo PHP:

if ((isset($_POST['correo'])) and (isset($_POST['passw1']))) {

    $res = mysqli_query($con, "SELECT * FROM visitantes");
    $fila = mysqli_fetch_array($res);
    if ($fila){
        $usuario = mysqli_real_escape_string($con, $_POST['correo']);
        $pass    = mysqli_real_escape_string($con, $_POST['passw1']);
        $result = mysqli_query($con, "SELECT * FROM visitantes WHERE correo = '" . $usuario. "' and clave = '" . md5($pass) . "'");

        if ($row = mysqli_fetch_array($result)) {
            $act = $row['activado'];
            if ($act == "0"){
                $id = $row['id_vis'];  // no logro pasar este parametro $id ////
                echo "2";
                $_SESSION['usr_id'] = $row['id_vis'];
                $_SESSION['usr_name'] = $row['usuario'];
                $_SESSION['usr_tipo'] = $row['id_tipo'];
                $_SESSION["ultimoAcceso"]=date("Y-n-j H:i:s");
                echo "3";
        } else {
            echo "1";
            //$errormsg = "Usuario o Contraseña incorrectos!!!";

When is an ellipsoidally (elliptical) distributed random variable spherically symmetric?

If $Y$ is ellipsoidally distributed, and $mu_y propto 1_p$ and $sum_y = sigma^2 I$ is $Y$ spherically symmetric? EDIT: added – Is it exchangeably distributed? Please give a proof not a yes/no.

Equality of Transformation of a Random Variable

I’m having trouble proving something I’m reading in a research paper, and wanted to get some other thoughts:

Suppose we define the transformation $psi : [-infty, infty] times [0,1] rightarrow [0,1]$ given by
$$ psi(x,u) = P[X

It is proved in the paper that
$$ P[psi(X,U) leq psi(x,u)] = P[(X,U) preceq (x,u)] $$

The part I don’t understand is the following: If $T$ is strictly increasing and continuous on the range of $X$, then $$ psi(T(X),U) = psi(X,U) [1] $$

What I have worked out so far is the following. Suppose we define $X^* := psi(X,U)$ and $X_T^* := psi(T(X),U)$. Then, the claim that the paper is making the transformed random variables are equivalent, meaning that the following statement should be true: $$P[X^* leq z] overset{?}{=} P[X_T^* leq z] forall z$$, where $z := psi(x,u)$. This means, we can do the following simplifications:
P[psi(X,U) leq psi(x,u)] &overset{?}{=} P[psi(T(X),U) leq psi(x,u)] \
= P[(X,U) preceq (x,u)] &overset{?}{=} P[(T(X),U) preceq (x,u)] \
= P[X

This is as far as I’ve gotten mathematically. If I assume that X is a continuous random variable, then we know that $P[X=x] = P[T(X)=x] = 0$, and the expression simplifies to

What methods can be used to select the lag variable for a multivariate time series?

I have a time series, it looks something like this (where X are the predictors and Y is the output variable):

Year   X1    X2    X3    Y
Y1    val1  val2  val3 val4
...    ...   ...   ...  ...

I have seen autocorrelation and partial autocorrelation plots being used for finding the optimal lag variable for univariate time series problems, but I don’t know if these can be expanded to include multivariate ones. If so, is there any Python implementation for that? If not, can VAR somehow be configured to perform lag variable selection?

What is largest value (number) that I can store in an Excel VBA variable?

I am using Microsoft Office Excel 2007.

Suppose I have the number 12500000000000.

Dim value1 as long

value1 = CLng(copyrng2.value)

'where copyrng2 is a range (cell) variable containing 12500000000000

The above code will fail because of overflow.

Can I store that number in any Excel (VBA) variable? If not, what can I do to store it, preferably in a format (Integer, Long, etc.) on which calculations can be performed?

Software controlled variable voltage AC supply with SSR relays

I have an autotransformer like this one :


I would like to control it with an arduino solid state relay like this one:

relay board

What would happens if I wire every output of the transformer together to the same output and accidentally turn on more than one relay at the same time ?

For example, the 80v, 120v and 150v turned on at the same time would output :

  • 80 + 120 + 150 = 350v ?
  • (80 + 120 + 150)/3 = 116v ?
  • 230v because this is the maximum input ?

Would it be dangerous ? I don’t really understand how an autotransformer work. Any idea how I could achieve it safely ?

Keeping a fixed constant (like letter “M”) and a variable (like a number “100”) in the same cell in excel but…

In excel, is there a method where a constant term can be fixed in the cell and I only need to input the variable term.
(this is difficult to put in words)

So, I have different values, like 100M, 50M, 30M, 40M, etc.

Now, can I keep the “M” fixed so that I only need to input the numerical value?
Like I just type “100” but it shows “100M”?

Is it also possible to have a formula that ignores the “M”?

Like, A1=100M, B1=30M. Now, I want C1=A1-B1 to be “70M” instead of “#value!”?

Is this possible to do if I can keep the “M” as a fixed value instead of manually inputting it?

SPI receives data but does not write into variable

I am currently working on reading SPI data from the Wi-Fi module as in the topic. It maintains the correct data from the transmitter but by using HAL_SPI_Receive() I am not able to save them to the variable. I do not know at what moment I’m wrong.

The code I use and the waveforms from the analyzer below.

#define NRF24L01_PAYLOAD                    5  
uint8_t  dataIn[NRF24L01_PAYLOAD];
 void NRF24L01_GetData(void) {
    uint8_t  reg_commnad;
    reg_commnad = NRF24L01_R_RX_PAYLOAD_MASK;


Edit: i mean time i have change spi1 port to spi2 and i can write into variable. I try spi1 miso pin use as simple input pin and it doest work. I use cheap stm32f103 from china friends so i think it happens but first time for me

How to put the variable in a certain order after using “Solve[]”

I have this code:

eq1 = 4 x1 + 5 x2 - 9 x11 == 5;
eq2 = 5 x1 - 3 x2 + 3 x11 == 99;
eq3 = 2 x1 + 5 x2 - 4 x11 == 7;
system = {eq1, eq2, eq3};
solution = Solve[system]

and the output is:

{{x1 -> 2574/161, x11 -> 1094/161, x2 -> 71/161}}

I would like the output to go in order i.e. x1, x2, and then x11, but I cannot figure out how.