I have this code:  if($key == 'b306') {     $fieldType = 'date';   }   In my PHP Storm debugger, it says that key = 0 (integer). When I leave it as a ==, the code does pass into the if. Only if I change it to === does it skip it, as expected. Why? I thought that the difference between == and === is that === matches type and value, vs == only does value. But this shouldn't allow 0 to be equal to 'b306'.
What is the difference between == and === in php. I am unsure when to use both.  Updated note: So that it shows up in StackOverflow search, the difference between == and === is the same as the difference between != and !==.
Is it possible to add a list of hosts that are only specific to a certain user? Perhaps a user-specific hosts file?  This mechanism should also complement the entries in the /etc/hosts file. An "urgent" tag for questions that need answers within minutes I often find myself in a spot of trouble, and when I have minutes left to fix it, I sometimes turn to SO/SF to start the "community help process". I suppose a tag like "urgent" or "immediate-attention" could enable contributors with spare time easily find the most desperate situations, giving more attention to those issues and solving them quicker. Or could this be a special tab on the home page? "register" keyword in C? What does the register keyword do in C language?  I have read that it is used for optimizing but is not clearly defined in any standard.  Is it still relevant and if so, when would you use it? how I can draw an skew cylinder (rotate around x axis) and fill it (in 3D tikz)? How do I restart the SSH service? I want to print the floating point number with exactly two significant digits in bash (maybe using a common tool like awk, bc, dc, perl etc.).  Examples:   76543 should be printed as 76000 0.0076543 should be printed as 0.0076   In both cases the significant digits are 7 and 6. I have read some answers for similar problems like:      but the answers focus on limiting the number of decimal places (eg. bc command with scale=2 or printf command with %.2f) instead of significant digits.  Is there an easy way to format the number with exactly 2 significant digits or do I have to write my own function? What does "+6 to hit, Hit: 13 (2d8 + 4)" mean in a creature's stat block? My friends and I are very new to D&amp;D, played like 3 times. In a monster's stats next to weapon damage it says stuff like "+11 to hit" and "Hit: 5 (1d8+1)". For the premade characters it just says things like "+4, 2d6 + 2 slashing", though. Why are there two "hit" numbers for monsters? Which do I use for the d20 roll to hit against a target's AC?  I mean for example like in the Ogre entry in the "" article on monsters. The probability that an initial quantum state $|\psi_i\rangle$ becomes the final quantum state $|\psi_f\rangle$ is given by  \begin{eqnarray} P(i \rightarrow f) &amp;=&amp; |\langle\psi_f|\psi_i\rangle|^2 \tag{1}\\ &amp;=&amp; \langle\psi_f|\psi_i\rangle^*\langle\psi_f|\psi_i\rangle \\ &amp;=&amp; \langle\psi_i|\psi_f\rangle\langle\psi_f|\psi_i\rangle. \end{eqnarray}  Equation (1) seems to show that the probability for the transition ($i\rightarrow f$) can be interpreted as the system both moving forward in time ($i\rightarrow f$) with amplitude $\langle\psi_f|\psi_i\rangle$ and backward in time ($f\rightarrow i$) with amplitude $\langle\psi_i|\psi_f\rangle$ simultaneously.  Does this reasoning help to explain the Born rule? (Is it like the Transactional Interpretation of QM?)  I guess we must experience the macroscopic direction of time ($i\rightarrow f$) in accord with increasing entropy in an expanding universe whereas microscopically QM works both forwards and backwards in time.  Addition  This is an improved version of the argument including time-evolution operators.  The probability that an initial quantum state $|\psi_i\rangle$ evolves to become the final quantum state $|\psi_f\rangle$ is given by  \begin{eqnarray} P_{i \rightarrow f} &amp;=&amp; |\langle\psi_f|U_{i \rightarrow f}|\psi_i\rangle|^2 \tag{2}\\ &amp;=&amp; \langle\psi_f|U_{i \rightarrow f}|\psi_i\rangle^*\langle\psi_f|U_{i \rightarrow f}|\psi_i\rangle \\ &amp;=&amp; \langle\psi_i|U^\dagger_{i \rightarrow f}|\psi_f\rangle\langle\psi_f|U_{i \rightarrow f}|\psi_i\rangle \\ &amp;=&amp; \langle\psi_i|U_{f \rightarrow i}|\psi_f\rangle\langle\psi_f|U_{i \rightarrow f}|\psi_i\rangle \end{eqnarray} where $U_{i \rightarrow f}$ is the forward-time evolution operator and $U_{f \rightarrow i}=U^\dagger_{i \rightarrow f}$ is the corresponding backward-time evolution operator.  Equation (2) seems to show that the probability $P_{i\rightarrow j}$ can be interpreted as the system first evolving forwards in time and then evolving backwards in time.  Perhaps this is an example of Murray Gell-Mann's  that "Everything not forbidden is compulsory"? At the quantum level, below observable probabilities, there is nothing to stop time flowing both forwards and backwards. Let's say I am building a logistic regression model where the dependent variable is binary and can take the values $0$ or $1$. Let the independent variables be $x_1, x_2, ..., x_m$ - there are $m$ independent variables. Let's say for the $k$th independent variable, the bivariate analysis shows a U-shaped trend - i.e., if I group $x_k$ into $20$ bins each containing roughly equal number of observations and calculate the 'bad rate' for each bin - # observations where y = 0 / total observations in each bin - then I get a U shaped curve.  My questions are:   Can I directly use $x_k$ as input while estimating the beta parameters? Are any statistical assumptions violated which might cause significant error in estimating the parameters? Is it necessary to 'linearize' this variable through a transformation (log, square, product with itself, etc.)? Is it possible to combine processing power of 2 computers? Here are a few questions, I wish you could enlighten me.   Is it possible to combine processing power of 2 computers? How do I do it? Will $\sum^{\infty}_{n=1}|a_n|^p$ converge? Isomorphisms preserving integral domains and fields Let $R \simeq S$ be isomorphic commutative rings with unity. Prove the following:  a). If $R$ is an integral domain then $S$ is an integral domain.  For this, I said that If I let $f: R \to S$ be an isomorphism and $(R, + , \circ), (S, \oplus, \ast)$, then let $x, y\in R$,  such that $x \circ y = 0_R$, because $f$ is an isomorphism, $f(x \circ y) = f(x) \ast f(y) = f(0_R)$. If I let $R$ be an integral domain then, as per the definition $R$ is commutative, has unity, and no zero divisors.   So $f(x \circ y) = f(x) \ast f(y) = f(0_R)$ where we have either $f(x \circ y) = f(0_R) \ast f(y) = f(0_R)$ or $f(x \circ y) = f(x) \ast f(0_R) = f(0_R)$.   Since $f$ is an isomomorphism, let $s = f(x), t = f(y)| s,t \in S$. Then $s \ast t = f(0_R)$. By definition, $S$ also has unity so $0_S$ exists. If we map $0_R \to 0_S$. Then either $s = 0_S$ or $t = 0_S$.   So then, since $S$ has unity, is commutative, and has a no zero divisors as we showed above, it is also an Integral domain.  I'm not sure I have this correctly.  b). If $R$ is a field then $S$ is a field. I don't really understand how to do this one. Since $S$ is an integral domain, it has a $0_S$. So I need to show that $S$ distributes $\ast$ over $\oplus$.  Any help with these is appreciated Does leaning (banking) help cause turning on a bicycle? I'm confused about why we should change door in the Monty Hall Problem, when thinking from a different perspective  gives me equal probability.   Think about this first: if we have two doors, and one car behind one of them, then we have a 50/50 chance of choosing the right door.   Back to Monty Hall: after we pick a door, one door is opened and shows a goat, and the other door remains closed. Let's call the door we picked A and the  other closed door B. Now since 1 door has already been opened, our knowledge has changed such that the car can only be behind A or B. Therefore, the problem is equivalent to: given two closed doors (A and B) and one car, which door should be chosen (we know it's a 50/50 thing)? Then, not switching door = choosing A, and switching door = choosing B. Therefore, it seems that switching should be equally likely, instead of more likely.   Another way to think: no matter which door we choose from the three, we know BEFOREHAND that we can definitely open a door with a goat in the remaining two. Therefore, showing an open door with a goat reveals nothing new about which door has the car.   What's wrong with this thinking process? (Note that I know the argument why switching gives advantage, and I know experiments have been done to prove that. My question is why the above thinking, which seems legit, is actually wrong.) Thanks. Can I ever play Undertale again normally? The ending I got is :      the genocide   When I reset my file, my past choices still take effect. I want to start a clean run.  I don't want to buy the game again, what do I do? How to prevent nginx redirecting from HTTPS to HTTP on AWS? I have a website served by nginx behind an AWS ELB Load Balancer. Only HTTPS is enabled on the load balancer.  Requesting individual files, or directories with a trailing slash, work fine. However, requesting directories without a trailing slash don't work.  The reason is, when I request the directory without the trailing slash, nginx does a redirect to the path with the trailing slash (that's OK), but it also changes from HTTPS to HTTP. The load balancer is configured to only allow HTTPS, so that doesn't work (timeout).  On the nginx logfile, I can see that the request reaches nginx, and that it's nginx that responds with the 301 Permanent Redirect (so it's not e.g. a problem with the load balancer setup).  10.100.10.15 - - [24/Nov/2017:15:41:08 +0000] "GET /admin HTTP/1.1" 301 178 "-" "Wget/1.18 (darwin16.0.0)"   When I request the URL via curl I see the redirect:  $ curl -v https://example.com/admin *   Trying 1.2.3.4... * TCP_NODELAY set * Connected to example.com (1.2.3.4) port 443 (#0) * TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 * Server certificate: example.com * Server certificate: Amazon * Server certificate: Amazon Root CA 1 * Server certificate: Starfield Services Root Certificate Authority - G2 &gt; GET /admin HTTP/1.1 &gt; Host: example.com &gt; User-Agent: curl/7.54.0 &gt; Accept: */* &gt;  &lt; HTTP/1.1 301 Moved Permanently &lt; Date: Mon, 27 Nov 2017 09:19:05 GMT &lt; Content-Type: text/html &lt; Content-Length: 178 &lt; Connection: keep-alive &lt; Server: nginx &lt; Location: http://example.com/admin/ &lt; X-UA-Compatible: IE=Edge &lt;  &lt;html&gt; &lt;head&gt;&lt;title&gt;301 Moved Permanently&lt;/title&gt;&lt;/head&gt; &lt;body bgcolor="white"&gt; &lt;center&gt;&lt;h1&gt;301 Moved Permanently&lt;/h1&gt;&lt;/center&gt; &lt;hr&gt;&lt;center&gt;nginx&lt;/center&gt; &lt;/body&gt; &lt;/html&gt; * Connection #0 to host example.com left intact   My nginx config file is just   server {     root /var/www; }   The /etc/nginx/nginx.conf is .  I have tried server_name_in_redirect off but it did not make any difference.  I would like to avoid putting the hostname in the config file, because this is packed into a Docker image which is then deployed on different hosts (QA, Prod, etc.).  I would like nginx to do this redirect, but stay on HTTPS. What can I do? Replace HTML page with contents retrieved via AJAX I have an HTML page with a typical structure:  &lt;html&gt;   &lt;head&gt;    &lt;script src="..." &gt;&lt;/script&gt;    &lt;style&gt;...&lt;/style&gt;   &lt;/head&gt;   &lt;body&gt;    content   &lt;/body&gt;   &lt;script&gt;     var success_callback = function(data) {       // REPLACE PAGE CONTENT &amp; STRUCTURE WITH "data"     }     ajax(url, params, success_callback);   &lt;/script&gt; &lt;/html&gt;   Do you think it is possible ?  I've already tried to give the html tag an id and doing $(id).replace(data); with no success.  Don't ask me why, but that is what I need (I'm working with a special "mashup builder" site... it is a long story).  EDIT : I forgot to say that scripts in the received content have to be executed, even external scripts included using &lt;script src="..."&gt;. I gave Google my phone number to verify it, not knowing that it would change it, and now my phone number is completely different? What have I done, and how do I unverify it and change my phone number back? Duplicity Backup Browse Why can't a single ReLU learn a ReLU? As a follow-up to  I simplified even more and tried to train a single ReLU (with random weight) to a single ReLU.  This is the simplest network there is, and yet half the time it fails to converge.  If the initial guess is in the same orientation as the target, it learns quickly and converges to the correct weight of 1:      If the initial guess is "backwards", it gets stuck at a weight of zero and never goes through it to the region of lower loss:        I don't understand why.  Shouldn't gradient descent easily follow the loss curve to the global minima?  Example code:  from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense, ReLU from tensorflow import keras import numpy as np import matplotlib.pyplot as plt  batch = 1000   def tests():     while True:         test = np.random.randn(batch)          # Generate ReLU test case         X = test         Y = test.copy()         Y[Y &lt; 0] = 0          yield X, Y   model = Sequential([Dense(1, input_dim=1, activation=None, use_bias=False)]) model.add(ReLU()) model.set_weights([[[-10]]])  model.compile(loss='mean_squared_error', optimizer='sgd')   class LossHistory(keras.callbacks.Callback):     def on_train_begin(self, logs={}):         self.losses = []         self.weights = []         self.n = 0         self.n += 1      def on_epoch_end(self, batch, logs={}):         self.losses.append(logs.get('loss'))         w = model.get_weights()         self.weights.append([x.flatten()[0] for x in w])         self.n += 1   history = LossHistory()  model.fit_generator(tests(), steps_per_epoch=100, epochs=20,                     callbacks=[history])  fig, (ax1, ax2) = plt.subplots(2, 1, True, num='Learning')  ax1.set_title('ReLU learning ReLU') ax1.semilogy(history.losses) ax1.set_ylabel('Loss') ax1.grid(True, which="both") ax1.margins(0, 0.05)  ax2.plot(history.weights) ax2.set_ylabel('Weight') ax2.set_xlabel('Epoch') ax2.grid(True, which="both") ax2.margins(0, 0.05)  plt.tight_layout() plt.show()     Similar things happen if I add bias: 2D loss function is smooth and simple, but if the relu starts upside down, it circles around and gets stuck (red starting points), and doesn't follow the gradient down to the minimum (like it does for blue starting points):    Similar things happen if I add output weight and bias, too.  (It will flip left-to-right, or down-to-up, but not both.)