If I do a simple loop with a while, it is evaluating my ++ operator after the first loop, does this mean that my while operator makes a small scope saving my i and after it finishes evaluating it applies the ++ operator on it? Why does this happen with this operator and also happens on the -- but not with lets say a simple sum i + 1?  var i = 0; while(i++ &lt; 1) { console.log(i) }   My output is 1  var i = 1; while(i-- &gt; 1) { console.log(i) }   My output is 0  var i = 0; while(i + 1 &lt; 1) { console.log(i) }   My output is undefined
Is there a difference in ++i and i++ in a for loop? Is it simply a syntax thing?
I found there are so much excellent answer to questions about how to product high quality typesetting output. But I wonder how to save ink with LaTeX. What we need to think about to manage cost. page layout or something else? In almost every canon (that is, visual) source, Force users typically wave a hand to invoke the Force to move or manipulate objects, people and thoughts. I get out-of-universe this is a visual cue that the Force is being used, but in-universe is it strictly necessary?  (The only exception I can think of is when Luke is training on Dagobah and is balancing rocks while standing on one hand with Yoda on his foot. He doesn't appear to be waving his hand to move the rocks.)  Is this addressed anywhere in-universe, even in Legends? Why is my Mega Stone not in the location it should be? I upgraded my Mega Ring and have been looking for Mega Stones, and I found . However, the Mega Stone isn't in the place it's supposed to be, and I'm sure the location is right. Why isn't my Mega Stone here? Assumptions of linear regression Consider a block cipher with a key of size 128 bits but a small block size, say 32 bits.  Is this kind of block cipher secure?  I would like to know to what extent I can use a small block cipher, like a 32 bit block cipher. What are the constraints so that the use is acceptable in a real life application.  For instance, if we use a one-time key, that is, to encrypt only one message. Besides, the message could be small.  Suppose that when we want so send one file, we perform a key agreement so that we use the key for one message. This scenario is not efficient, but the CPA find-then-guess game is not adequate in this case. To change URL to user friendly URL I'm refactoring my ASP.net application from ASP.net 3.5 to 4.0. Also I'm changing the URLs to user friendly URLs /product.aspx?id=100 to /product-name/100.  All my pages are indexed by search engines and the site has already been online for 6 years. I'm planning to do 301 redirect from the old pages to the new one.  I want to make sure I won't lose the rankings and traffic.  Any suggestion how to do it properly? While learning about Random variables I came across the mean of random variable X.  The definition says that the expected value of random variable E(X) = Mean of Random variable X  I am not able to understand why is that so. Can any one please help me with it I've noticed the following happen a few times:   A user posts a question. The question is closed as a duplicate and the usual "Possible Duplicate" links are added at the top. The user promptly removes the duplicate links, even though the question is still closed as a duplicate. (excessive use of list items =P)   Now, I could understand this behavior if there was some dispute about whether or not the question was a duplicate, and the OP were to remove the links and post reasons why they disagree with the closing. However, I've noticed this happening without any attempt to defend the question (such as ).  In my opinion, no one should be allowed to remove the "Possible Duplicate" links as long as the question is still closed as a duplicate. The links should remain for the benefit of the community, so they can navigate to the duplicate questions and either post answers there or read them over and judge if the closing was actually fair. Once/if the question is reopened the links could be edited out if one so chooses.  I guess this is part discussion, part feature request:  Could the "Possible Duplicate" links remain un-editable for as long as the question is still closed? I am running logistic regression on a small dataset which looks like this:    After implementing gradient descent and the cost function, I am getting a 100% accuracy in the prediction stage, However I want to be sure that everything is in order so I am trying to plot the decision boundary line which separates the two datasets.  Below I present plots showing the cost function and theta parameters. As can be seen, currently I am printing the decision boundary line incorrectly.    Extracting data  clear all; close all; clc;  alpha = 0.01; num_iters = 1000;  %% Plotting data x1 = linspace(0,3,50); mqtrue = 5; cqtrue = 30; dat1 = mqtrue*x1+5*randn(1,50);  x2 = linspace(7,10,50); dat2 = mqtrue*x2 + (cqtrue + 5*randn(1,50));  x = [x1 x2]'; % X  subplot(2,2,1); dat = [dat1 dat2]'; % Y  scatter(x1, dat1); hold on; scatter(x2, dat2, '*'); hold on; classdata = (dat&gt;40);   Computing Cost, Gradient and plotting  %  Setup the data matrix appropriately, and add ones for the intercept term [m, n] = size(x);  % Add intercept term to x and X_test x = [ones(m, 1) x];  % Initialize fitting parameters theta = zeros(n + 1, 1); %initial_theta = [0.2; 0.2];  J_history = zeros(num_iters, 1);   plot_x = [min(x(:,2))-2,  max(x(:,2))+2]  for iter = 1:num_iters  % Compute and display initial cost and gradient     [cost, grad] = logistic_costFunction(theta, x, classdata);     theta = theta - alpha * grad;     J_history(iter) = cost;      fprintf('Iteration #%d - Cost = %d... \r\n',iter, cost);       subplot(2,2,2);     hold on; grid on;     plot(iter, J_history(iter), '.r');  title(sprintf('Plot of cost against number of iterations. Cost is %g',J_history(iter)));     xlabel('Iterations')     ylabel('MSE')     drawnow      subplot(2,2,3);     grid on;     plot3(theta(1), theta(2), J_history(iter),'o')     title(sprintf('Tita0 = %g, Tita1=%g', theta(1), theta(2)))     xlabel('Tita0')     ylabel('Tita1')     zlabel('Cost')     hold on;     drawnow      subplot(2,2,1);     grid on;         % Calculate the decision boundary line     plot_y = theta(2).*plot_x + theta(1);  % &lt;--- Boundary line      % Plot, and adjust axes for better viewing     plot(plot_x, plot_y)     hold on;     drawnow  end  fprintf('Cost at initial theta (zeros): %f\n', cost); fprintf('Gradient at initial theta (zeros): \n'); fprintf(' %f \n', grad);   The above code is implementing gradient descent correctly (I think) but I am still unable to show the boundary line plot. Any suggestions would be appreciated.    logistic_costFunction.m  function [J, grad] = logistic_costFunction(theta, X, y)      % Initialize some useful values     m = length(y); % number of training examples      grad = zeros(size(theta));      h = sigmoid(X * theta);     J = -(1 / m) * sum( (y .* log(h)) + ((1 - y) .* log(1 - h)) );      for i = 1 : size(theta, 1)         grad(i) = (1 / m) * sum( (h - y) .* X(:, i) );     end  end   EDIT:  As per the below answer by @Esmailian, now I have something like this:  [m, n] = size(x);  x1_class = [ones(m, 1) x1' dat1']; x2_class = [ones(m, 1) x2' dat2'];  x = [x1_class ; x2_class] I've read that it is possible to add a method to an existing object (i.e., not in the class definition) in Python.   I understand that it's not always good to do so. But how might one do this? Problem is to find sum  $$\frac{1}{3!}+\frac{4}{4!}+\frac{9}{5!}\cdots$$  What I knew doesn't apply on this problem  Some series are telescoping, some types are solvable using binomial , both look useless here Binomial gives  $$n (n-1) (n-2)x^3=1$$  $$n (n-1)( n-2)(n-3)x^4=4$$  What approach to use here? Is there a W3C valid way to disable autocomplete in a HTML form? When using the xhtml1-transitional.dtd doctype, collecting a credit card number with the following HTML  &lt;input type="text" id="cardNumber" name="cardNumber" autocomplete='off'/&gt;   will flag a warning on the W3C validator:     there is no attribute "autocomplete".   Is there a W3C / standards way to disable browser auto-complete on sensitive fields in a form? In sketchup you can move an object based on two points. This makes it very easy to align a vertex in one object to vertex in another object. Here is an example:    I want to know how to do this in Blender. It seems that Translate can't align vertexs How can I change the default date format? When I paste a date into Excel 2010 in the format "2012-12-07 00:00:00.000" I'd like it to be displayed by default as "2012-12-07", but it is actually displayed as "00:00.0".   I know I can work around this by prepending a ' or changing the cell format, but I'm interested in changing the default format.  An approach that almost works is going to Control Panel->Region and Language->Long Time format and changing it to something like "h". This results in Excel displaying the dates I paste in as "2012-12-07 00:00:00.000", but screws up times displayed outside of Excel.  The dates I'm pasting in are from SQL Server. I play several games on Steam and I love the achievement system. It would be great to get an overview of all the achievements ever gained in Steam games. Does Steam support this? I haven't found such an overview.  If such a feature does not exist, I would already be happy with an easy way to calculate the sum of all my achievements automatically.  Edit: I stumbled upon an interesting website called  today. Unfortunately it only works for XBox-Achievements. Does anyone know of a similar service for Steam? This would solve my question right away. Implementing my own solution based on the links posted in the answers didn't work because the APIs are not sufficient for my needs. $$\dfrac{1}{\sqrt 1}+\dfrac{1}{\sqrt 2}+\dfrac{1}{\sqrt 3}+\cdots+\dfrac{1}{\sqrt n}\geq \sqrt n$$ I want to prove this by Induction  $$n=1 \checkmark\\ n=k \to \dfrac{1}{\sqrt 1}+\dfrac{1}{\sqrt 2}+\dfrac{1}{\sqrt 3}+\cdots+\dfrac{1}{\sqrt k}\geq \sqrt k\\ n=k+1 \to \dfrac{1}{\sqrt 1}+\dfrac{1}{\sqrt 2}+\dfrac{1}{\sqrt 3}+\cdots+\dfrac{1}{\sqrt {k+1}}\geq \sqrt {k+1}$$ so $$\dfrac{1}{\sqrt 1}+\dfrac{1}{\sqrt 2}+\dfrac{1}{\sqrt 3}+\cdots+\dfrac{1}{\sqrt k}+\dfrac{1}{\sqrt {k+1}}\geq \sqrt k+\dfrac{1}{\sqrt {k+1}}$$now we prove that $$\sqrt k+\dfrac{1}{\sqrt {k+1}} &gt;\sqrt{k+1} \\\sqrt{k(k+1)}+1 \geq k+1 \\ k(k+1) \geq k^2 \\k+1 \geq k \checkmark$$ and the second method like below ,   and I want to know is there more Idia to show this proof  ? forexample  combinatorics proofs  , or using integrals ,or fourier series ,....    Is there a close form for this summation ?  any help will be appreciated . Good day. I'm not too sure how I should go about asking my question, so if it is in anyway confusing, feel free to edit it.   In my Group Theory course we defined and showed a few properties of the commutator subgroup $[G,G]$ of a group $G$. And then we stated and proved a lemma in lecture that I'm having some difficulty wrapping my head around. I'll state it here for clarity.  Lemma a) The commutator subgroup $[G,G]$ of $G$ is a normal subgroup of $G$. b) The quotient group $G / [G,G]$ is the largest abelian quotient of G in the sense that every homomorphism $\varphi : G \to A$ where $A$ is an an abelian group, induces a unique homomorphism $\bar \varphi : G/[G,G] \to A$ so that $\varphi =\bar \varphi \circ \pi$ where $\pi : G \to G/[G,G]$ is the quotient homomorphism.  Now, it's not the proof of this lemma that I'm having trouble with, it's the italicized text that is messing with me. I completely understand what it is that the italicized text is saying, I'm just not too sure why it is that the property gives us the "largeness" that is claimed. I can see that the above forces $G$ to "pass through" $G/[G,G]$ before it "reaches" $A$ (I apologize for the casual terminology), so I can sort of see why $G/[G,G]$ should be the largest quotient, in a non-rigorous sort of way.  Overall I'm very confused. Perhaps I'm missing something very simple. Any help or nudges in the right direction would be much appreciated.   As a side note I did try a search on Google and here on Stack Exchange and couldn't find anything that answered my question. So if I missed something obvious, then my apologies. Thank you in advance. Let's say you have a few expressions like the following:  $$\begin{array}((x+17)^2 \\ x^2 + 34x + 289 \end{array} \\ 288 + \frac{x^2}{2} + \frac{x^2}{2} + 34x + 1 \\ [...] $$  You get the idea: there's an infinite number of ways of representing the same expression. The challenge is that my application is validating answers to math problems, input by math students practicing a certain concept. I'd like to make sure that whenever they submit an answer, the checker is completely insensitive to the issues of ordering, simplification, formatting etc. which would be plain frustrating. I'd also ideally like to support more than one variable such as x, y, z in the same expression.  What's a reliable way to check that two expressions are the same? The most brute force way I can think of would be to just plug a number into each variable of each expression and see what the result is.  I have a hunch however that there might be ways of getting false positives this way. That, and I might be either missing something really obvious about this, or there might be a better way of doing the comparison.  Would love to hear what you think. Any javascript event occurring when user clicks Stop load button? Why do we use GLM?