How can I compute the gradient of f(x)= $||Ax-b||_{R^{-1}}^2$ I'm also confused about how to compute the gradient of g(x) = $||y-Ax||$ using the chain rule. I think the first step to take the gradient of g(x) would be $\nabla(g(x)) = \frac{d(y-Ax)^\top}{dx}(y-Ax)+ \frac{d(y-Ax)}{dx}(y-Ax)^\top$. However, I'm unsure of how to take the derivative of (y-Ax) or the derivative of $(y-Ax)^\top$. Any help is highly appreciated.
It's stated that the gradient of:  $$\frac{1}{2}x^TAx - b^Tx +c$$  is   $$\frac{1}{2}A^Tx + \frac{1}{2}Ax - b$$  How do you grind out this equation? Or specifically, how do you get from $x^TAx$ to $A^Tx + Ax$?
Which balancing issues, if any, would arise from allowing PCs to spend actions on bonus action features? Fastest way to determine if an integer's square root is an integer I'm looking for the fastest way to determine if a long value is a perfect square (i.e. its square root is another integer):    I've done it the easy way, by using the built-in  function, but I'm wondering if there is a way to do it faster by restricting yourself to integer-only domain. Maintaining a lookup table is impractical (since there are about 231.5 integers whose square is less than 263).   Here is the very simple and straightforward way I'm doing it now:  public final static boolean isPerfectSquare(long n) {   if (n &lt; 0)     return false;    long tst = (long)(Math.sqrt(n) + 0.5);   return tst*tst == n; }   Note: I'm using this function in many  problems.  So no one else will ever have to maintain this code.  And this kind of micro-optimization could actually make a difference, since part of the challenge is to do every algorithm in less than a minute, and this function will need to be called millions of times in some problems.    I've tried the different solutions to the problem:   After exhaustive testing, I found that adding 0.5 to the result of Math.sqrt() is not necessary, at least not on my machine. The  was faster, but it gave incorrect results for n >= 410881.  However, as suggested by , we can use the FISR hack for n &lt; 410881. Newton's method was a good bit slower than Math.sqrt().  This is probably because Math.sqrt() uses something similar to Newton's Method, but implemented in the hardware so it's much faster than in Java.  Also, Newton's Method still required use of doubles. A modified Newton's method, which used a few tricks so that only integer math was involved, required some hacks to avoid overflow (I want this function to work with all positive 64-bit signed integers), and it was still slower than Math.sqrt(). Binary chop was even slower.  This makes sense because the binary chop will on average require 16 passes to find the square root of a 64-bit number. According to John's tests, using or statements is faster in C++ than using a switch, but in Java and C# there appears to be no difference between or and switch. I also tried making a lookup table (as a private static array of 64 boolean values).  Then instead of either switch or or statement, I would just say if(lookup[(int)(n&amp;0x3F)]) { test } else return false;.  To my surprise, this was (just slightly) slower. This is because . Partitions for Ubuntu and Windows 7 dual boot on SSD + HDD setup I have purchased a new SSD (120GB) and I had a HDD (1TB) already installed. I will install both Ubuntu and Windows on these drives. As the file space on the SSD is limited and I've read that writing to an SSD drive is discouraged, I would like to store most of the data on the HDD drive. I am aiming at faster system but also keeping the valuable data safe on the more reliable HDD and expanding the life span of the SSD.  I have already set up Windows on these drives (system files and applications on SSD, Users folder and ProgramData on HDD) and now it's time to set up Ubuntu.  So my question is which partitions I should create, on which drive should they be placed and how large they should be.  Based on my experience and articles I've read, I will probably create /swap, /home and / partitions.   Does it seem reasonable to place /swap and /home partitions on the HDD and / on the SSD?  And how large should / partition be?  Also, will the applications be installed in / partition? If so, is it rational to store the applications on separate partitions on the HDD instead of / on the SSD, and what should the size of the / partition be in this case? My English is pretty basic, please don't mind. Wondering how to make the liquify wave and distort color effect in Photoshop? I'd tried using distort>shear/wave/zigzag, but still can't make it similar like the photo below. I'm trying to install KDE 5 on my Ubuntu 16.04 system as per the instructions in , but I'm getting the below error message when running sudo apt-get install kubuntu-desktop.  Is there something I can do to resolve this?  Need to get 682 kB/326 MB of archives. After this operation, 1,272 MB of additional disk space will be used. Do you want to continue? [Y/n] y Err:1 http://ir.archive.ubuntu.com/ubuntu xenial/universe amd64              gtk2-engines-oxygen amd64 1.4.6-1ubuntu1   Temporary failure resolving 'ir.archive.ubuntu.com' Get:2 http://ir.archive.ubuntu.com/ubuntu xenial/universe amd64              libkf5sendlater5 amd64 4:15.12.3-0ubuntu1 [45.2 kB] Get:3 http://ir.archive.ubuntu.com/ubuntu xenial/universe amd64              libthreadweaver4 amd64 4:4.14.16-0ubuntu3 [46.6 kB] Get:4 http://ir.archive.ubuntu.com/ubuntu xenial/universe amd64              libfarstream-0.2-5 amd64 0.2.7-0ubuntu1 [192 kB] Fetched 284 kB in 1min 9s (4,093 B/s)         E: Failed to fetch http://ir.archive.ubuntu.com/ubuntu/pool/universe/g/             gtk2-engines-oxygen/gtk2-engines-oxygen_1.4.6-1ubuntu1_amd64.deb               Temporary failure resolving 'ir.archive.ubuntu.com'  E: Unable to fetch some archives, maybe run apt-get update or              try with --fix-missing? Switching between windows with scroll wheel on Ubuntu Dock I would like to switch between windows using the scroll wheel of the mouse over each app icon in Ubuntu dock, as we could do in Unity, but apparently this doesn't work in Ubuntu 17.10. Is there a way to enable it?   Related: How I can recover files when the folder shows empty but the files are not deleted? Localizing Dynamic Plural Noun messages (e.g. "5 Items Processed") on iPhone using Objective-C Log form of variables and descriptive measures Because of larger values of variables, I did a log- transformation in my dataset. Now I want to give a descriptive table regarding my variables like mean, max, min, median, skewness, kurtosis. Can I give standard measures like arithmetic mean or should I give geometric mean? In terms of skewness or kurtosis, do I need a transformation? Does a family of a distribution have a different definition for statistics than in other disciplines?  In general, a  is a set of curves, each of which is given by a function or parametrization in which one or more of the parameters is varied. Such families are used, for example, to .  For statistics, a family according to  is the result of varying the shape parameter. How then can we understand that the gamma distribution has a shape and scale parameter and only the generalized gamma distribution has, in addition, a location parameter? Does that make the family the result of varying the location parameter? According to @whuber the meaning of a family is implicitly A "parameterization" of a family is a continuous map from a subset of ℝ$^n$, with its usual topology, into the space of distributions, whose image is that family.  What, in simple language, is a family for statistical distributions?  A question about relations among of the statistical properties of distributions from the same family has already generated considerable controversy for a  so it seems worthwhile to explore the meaning.  That this is not necessarily a simple question is born out by its use in the phrase , which has nothing to do with a family of curves, but is related to changing the form of the PDF of a distribution by reparameterization not only of parameters, but also substitution of functions of independent random variables. Spacetime Torsion, the Spin tensor, and intrinsic spin in Einstein-Cartan theory In  gravity, the action is the usual  but now the Torsion tensor is allowed to vary as well (in usual GR, it is just set to zero).  Variation with respect to the metric gives:  $$R_{ab}-\frac{1}{2}R g_{ab}=\kappa P_{ab} \quad (1)$$  where $P_{ab}$ is the canonical stress energy tensor.  Variation with respect to the torsion tensor ${T^{ab}}_c$ gives:  $${T_{ab}}^c + {g_a}^c{T_{bd}}^d - {g_b}^c {T_{ad}}^d = \kappa {\sigma_{ab}}^c \quad (2)$$  where ${\sigma_{ab}}^c$ is the .  By contracting that equation, I can see that if the spin tensor is zero, the Torsion tensor is identically zero:  $${T_{ab}}^c + {g_a}^c{T_{bd}}^d - {g_b}^c {T_{ad}}^d = \kappa {\sigma_{ab}}^c = 0$$ $$ {g^b}_c({T_{ab}}^c + {g_a}^c{T_{bd}}^d - {g_b}^c {T_{ad}}^d) = 0$$ $$ {T_{ab}}^b + {g_a}^b{T_{bd}}^d - {g_b}^b {T_{ad}}^d = 0$$ $$ {T_{ab}}^b + {T_{ad}}^d - 4 {T_{ad}}^d = 0$$ $$ {T_{ad}}^d = 0$$ $${T_{ab}}^c + {g_a}^c{T_{bd}}^d - {g_b}^c {T_{ad}}^d = 0 \quad \Rightarrow \quad {T_{ab}}^c =0$$  My understanding is that:  The spin tensor and the stress energy tensor, are defined entirely in terms of whatever matter Lagrangian we add to the theory.  Therefore, from above, the equations in vacuum are exactly the same as normal GR (so solving for outside matter, only the boundary conditions with the matter could be different).  Assuming my understanding up to here is correct, my line of questioning is:   How is the Spin tensor (and hence Torsion) related to the concept of material with intrinsic spin? Hopefully answered by 1, but if the matter has zero intrinsic spin, yet we have an extended "spinning" body, is the spin tensor still zero (as I'd consider that orbital angular momentum then)? Does this mean Einstein-Cartan predictions are identical to normal Einstein GR if (and only if) the instrinsic spin of any particles and fields in the theory are zero? Minecraft Vanilla 1.9 crash with problematic frame ig8icd64.dll I go to the Minecraft menu and click on singleplayer to test out the 1.9 update. I made a new world (no mods), it said downloading terrain and then it crashes every time (I've tried about 20 times now).  Has anyone else experienced similar issues and know what the fix may be?  Here is the launcher log:  Completely ignored arguments: [--nativeLauncherVersion, 301] [00:35:12] [Client thread/INFO]: Setting user: Teddy_Cromwell [00:35:12] [Client thread/INFO]: (Session ID is &lt;censored&gt;) [00:35:14] [Client thread/INFO]: LWJGL Version: 2.9.4 [00:35:14] [Client thread/WARN]: Removed selected resource pack resources (no region and battle music).zip because it's no longer compatible [00:35:14] [Client thread/INFO]: Reloading ResourceManager: Default [00:35:15] [Sound Library Loader/INFO]: Starting up SoundSystem... [00:35:16] [Thread-5/INFO]: Initializing LWJGL OpenAL [00:35:16] [Thread-5/INFO]: (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org) [00:35:16] [Thread-5/INFO]: OpenAL initialized. [00:35:16] [Sound Library Loader/INFO]: Sound engine started [00:35:18] [Client thread/INFO]: Created: 1024x512 textures-atlas [00:35:26] [Server thread/INFO]: Starting integrated minecraft server version 1.9 [00:35:26] [Server thread/INFO]: Generating keypair [00:35:27] [Server thread/INFO]: Preparing start region for level 0 [00:35:28] [Server thread/INFO]: Preparing spawn area: 5% [00:35:29] [Server thread/INFO]: Preparing spawn area: 8% [00:35:30] [Server thread/INFO]: Preparing spawn area: 15% [00:35:31] [Server thread/INFO]: Preparing spawn area: 21% [00:35:32] [Server thread/INFO]: Preparing spawn area: 27% [00:35:33] [Server thread/INFO]: Preparing spawn area: 34% [00:35:34] [Server thread/INFO]: Preparing spawn area: 42% [00:35:35] [Server thread/INFO]: Preparing spawn area: 48% [00:35:36] [Server thread/INFO]: Preparing spawn area: 56% [00:35:37] [Server thread/INFO]: Preparing spawn area: 66% [00:35:38] [Server thread/INFO]: Preparing spawn area: 74% [00:35:39] [Server thread/INFO]: Preparing spawn area: 81% [00:35:40] [Server thread/INFO]: Preparing spawn area: 91% [00:35:41] [Server thread/INFO]: Preparing spawn area: 98% [00:35:42] [Server thread/INFO]: Teddy_Cromwell[local:E:6d7525a7] logged in with entity id 301 at (244.5, 69.0, 244.5) [00:35:42] [Server thread/INFO]: Teddy_Cromwell joined the game # # A fatal error has been detected by the Java Runtime Environment: # #  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007fffcf6e6b37, pid=15456, tid=12424 # # JRE version: Java(TM) SE Runtime Environment (8.0_25-b18) (build 1.8.0_25-b18) # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.25-b02 mixed mode windows-amd64 compressed oops) # Problematic frame: # C  [ig8icd64.dll+0x16b37] # # Failed to write core dump. Minidumps are not enabled by default on client versions of Windows # # An error report file with more information is saved as: # C:\Users\Connor\AppData\Roaming\.minecraft\hs_err_pid15456.log # # If you would like to submit a bug report, please visit: #   http://bugreport.sun.com/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # AL lib: (EE) alc_cleanup: 1 device not closed Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release How I would go about getting the current users username or first and last name?  I have been looking at this for the last couple of hours - I was just wondering how I would go about getting their name and then displaying it on the page.  For example the current user is 'John Smith' and in the lightning component I want to output John Smith's name like:     Welcome to our community John Smith! How to pronounce decimals? Something like:  0.1 0.23 0.999   How to pronounce them correctly in English? Capturing SOAP requests to an ASP.NET ASMX web service MySQL: LEFT JOIN not working as expected Finding $\int_0^{\infty}xe^{-\lambda x} \, dx$ How to integrate:  $$\int_0^\infty x \, \lambda e^{-\lambda x} \, dx$$    I tried using integration by parts:  Let $u = x$ and $dv = \lambda e^{-\lambda x} \, dx$  Then $du = dx$  And $v = - \lambda e ^{-\lambda x}$  Correct so far?   Then   $$\begin{aligned} uv - \int v \, du &amp;= -\lambda x e^{-\lambda x} - \int (- \lambda e^{- \lambda x}) dx \\ &amp;= -\lambda x e^{-\lambda x} - \lambda e^{-\lambda x} \end{aligned}$$    The correct answer from lecture notes      UPDATE 2  Let $u=\lambda x$ and $dv = e^{-\lambda x} dx$  Then $du = \lambda \, dx$  $$dv = e^{-\lambda x} \, dx$$  Let $y = -\lambda x$  Then $dy = -\lambda \, dx$  So $dx = -\frac{1}{\lambda} dy$  $$\begin{aligned} v &amp;= \int e^u \cdot - \frac{1}{\lambda} du \\ &amp;= - \frac{1}{\lambda} e^{-\lambda x} \end{aligned}$$  But here I seem to have an extra $- \frac{1}{\lambda}$ in $v$?  If I continue using integration by parts, I get:   $$-x e^{-\lambda x} + \color{red}{\frac{1}{\lambda}} \int e^{-\lambda x} \, dx$$ How do the sets $\emptyset\times B,\ A\ \times \emptyset, \ \emptyset \times \emptyset $ look like? If we have a function $f:A \rightarrow B$, then one way to give meaning, I think, to this function, in terms of set theory, is to say, that $f$ is actually a binary relation $f=(A,B,G_f)$, where $G_f \subseteq A \times B$ is the graph of the function. Now my question is: what is $f$ if   $\bullet \ A=\emptyset, \ B\neq\emptyset$,?  $ \bullet \ B=\emptyset, \ A\neq\emptyset$ ?  $ \bullet \ B=\emptyset, \ A=\emptyset$ ?  (Another way to formulate this, I think, would be: How do the sets $\emptyset\times B,\ A\ \times \emptyset, \ \emptyset \times \emptyset $ look like? Are they all $\emptyset$ ?) I am in the last year of MSc. and would like to read string theory. I have the Zwiebach Book, but along with it what other advanced book can be followed, which can be a complimentary to Zwiebach. I would like a more mathematically rigorous book or lecture notes along with Zwiebach.   Specifically, mention whether the book discusses string theory   Rigorously? Intuitively?   What's the scope of the book? Does it cover the advanced materials, e.g. Matrix string theory, F-theory, string field theory, etc. Maybe even String Phenomenology? I have noticed that while asking questions and scrolling to the bottom of the page, the right sidebar containing recent questions covers the footer partially. Also, a part of it goes beyond the browser's boundary. It may not be a big problem but it still doesn't look good.    This also happens on the  page