$\mathbf{B = P^{^-1} A P} \iff$ ($\mathbf{B}$ is similar to $\mathbf{A}$)  I'm a little confused about matrix similarity. Let's say we have the following matrix $A$:   \begin{bmatrix}2&amp;5\\4&amp;1\end{bmatrix}  Its eigenvalues are $6$ and $-3$. Respective eigenvectors $\left&lt;(5,4)\right&gt;, \left&lt;(-1,1)\right&gt;$.  How do I find out whether its similar to another matrix (B)?  Let's say matrix $B$:  \begin{bmatrix}4&amp;5\\1&amp;4\end{bmatrix}  Trying to actually find the regular $P$ so that the equation would be satisfied seems like way too much calculating.  My idea is to try and diagonalize both of them - and if I end up with same eigenvalues on the diagonal (in whatever order), then they are both similar? (using the transitive property, since similarity is an equivalence).  Thank you in advance.
I have two $2\times 2$ matrices, $A$ and $B$, with the same determinant. I want to know if they are similar or not.  I solved this by using a matrix called $S$: $$\left(\begin{array}{cc} a&amp; b\\ c&amp; d \end{array}\right)$$ and its inverse in terms of $a$, $b$, $c$, and $d$, then showing that there was no solution to $A = SBS^{-1}$. That worked fine, but what will I do if I have $3\times 3$ or $9\times 9$ matrices? I can't possibly make system that complex and solve it.  How can I know if any two matrices represent the "same" linear transformation with different bases?  That is, how can I find $S$ that change of basis matrix?  I tried making $A$ and $B$ into linear transformations... but without the bases for the linear transformations I had no way of comparing them.  (I have read that similar matrices will have the same eigenvalues... and the same "trace" --but my class has not studied these yet. Also, it may be the case that some matrices with the same trace and eigenvalues are not similar so this will not solve my problem.)  I have one idea. Maybe if I look at the reduced col. and row echelon forms that will tell me something about the basis for the linear transformation? I'm not really certain how this would work though? Please help.
What is the best way to convert an array to a hash in Ruby In Ruby, given an array in one of the following forms...  [apple, 1, banana, 2] [[apple, 1], [banana, 2]]   ...what is the best way to convert this into a hash in the form of...  {apple =&gt; 1, banana =&gt; 2} apt-get build-dep is unable to find a source package I have already followed  to disable middle mouse button paste on my Ubuntu 12.04.   Works like a charm.   Now I am trying to achieve the same on my Linux Mint 17. When I try to  sudo apt-get build-dep libgtk2.0-0   it gives me the following output:   Reading package lists... Done Building dependency tree        Reading state information... Done Picking 'gtk+2.0' as source package instead of 'libgtk2.0-0' E: Unable to find a source package for gtk+2.0   For me it looks like apt-get is somehow "resolving" 'libgtk2.0-0' to 'gtk+2.0', but then does not find any package named like that.   EDIT:  although I am now able to compile the program (see my answer), I still do not know what  Picking 'gtk+2.0' as source package instead of 'libgtk2.0-0' is supposed to mean. Any insight on this would be appreciated, thanks! How can I use Netflix on Ubuntu? Is there a way to stream Netflix content to my Ubuntu machine? Creating new users using PHP not recognized by Apache 2.4 I have a server setup where new linux users are created using (PHP)  shell_exec ( '/usr/sbin/useradd ' . $username ); exec ('usermod -a -G ' . $username . ' '. $username); #add user into the usergroup exec ('usermod -a -G ' . $username . ' www-data'); #add usergroup with the www-data   And then the user script changes the owner and group of the files to this owner. The server is setup with suPHP which then allows these files to be run as the owner.  This setup worked fine with Apache 2.2 but is breaking in Apache 2.4. Everything works fine except when I try to oepn the files, it gives a 403 forbidden error. Restarting apache after the user is added fixes the issue but that is not a viable solution for me. The users are added using a web server and hence I need to be able to do this without having to reload/restart apache everytime.  I have searched for serveral hours and tried to fix the issue but haven't been able to do so! I am running ubuntu 14.04 and I am not able to downgrade to apache 2.2 as well. I am firmly convinced he is innocent and his accusation is the result of the police conspiracy.     I am firmly convinced he is innocent and his accusation is the result of the police's conspiracy.    Which sentence do you think is a better choice? Recalculate google sheet on demand: I have the following formula in a sheet:  =if(E1="HOLD",,query(Cust_Orders!B6:Z5000,"Select Y,G,I,H,K where H&gt;0  "))   With E1 being a drop down with values HOLD and FETCH  The recalculation when I go to FETCH takes about 13 seconds.  But when it is in HOLD, the query doesn't exceute, and everything goes blank. Not what I want.  I'm trying to avoid recalculating this query every time I make a change in the Cust_Orders range, but keep the old values, as two different pivot tables that are viewed by other people are dependent on it.  Google spreadsheet recalc settings all are 'on change and foo'  Is there a way to do this? What's the difference between dot syntax and square bracket syntax? How can I automatically shutdown the system after a specific time? The list has several empty strings in it for me right now: Does it have or has? I was wondering if there is a simpler way to find the last to digits of a power such as $3^{45}$. I reduced it modulo 100 to get the answer, which is 43. But I was curious if there was a simpler, or more eloquent way to get this result.  Here's my method:  Using the fact that $3^4=81\equiv -19 \pmod{100}$ and $19^5=2,476,099\equiv -1 \pmod{100}$  $$ 3^{45}\equiv 3(3^4)^{11}\equiv 3(-19)^{11}\equiv 3(-19)(19^5)^2\equiv 3(-19)(-1)^2 \equiv -57 \equiv 43 \pmod {100} $$  I just felt like this was sort of a messy way to find out that the last two digits are 43. What would happen to a teaspoon of neutron star material if released on Earth? I've read on NASA's page on neutron star that one teaspoonful of that star would weigh over 20 billion tonnes on Earth. If it was somehow possible to bring it to earth would it:   Burn and disappear during Earth atmosphere entry? Assuming we have 20 billion tonnes of mass occupying the volume of a teaspoon here on Earth, would it fall through the ground under its own weight? Simple Linq query has duplicated join against same table? I'd like to have a horizontal line extending from the end of the text on a line to the right margin. So far I've found \hrulefill and \leaders\hrule\hfill, but these draw a line that's flush with the baseline of my text — how can I get it to be vertically centered? Lack of Articles in Headlines Are there any rules as to an article before a noun in the singular in headlines please, i.e. lack of an article?       Description of Type of Investment When discussing a treaty or international agreement, which is correct?  "There are 100 states party to the treaty." (for example, as used )  Or:  "There are 100 state parties to the treaty." (for example, as used )   Or: "There are 100 states parties to the treaty."  (for example, as used ) Setting a background image on a JFrame using Swing What is crop factor and how does it relate to focal length? I'm reading that a 50mm lens is recommended as a first prime lens for DSLR owners as it's supposed to give a 'natural' perspective, but when used on (most) DSLRs, the view is cropped, as if you were zoomed in by 1.5-1.6x, so it's more of a telephoto lens when used on a DSLR. I've also read however that the 50mm lens gives the same perspective on a DSLR and a 35mm, and shouldn't really be considered to be 'equivalent' to an 80mm lens as the crop factor isn't really a magic focal length changer.  Can someone explain how the image is different from (for example) a 50mm lens on a DSLR and an 80mm lens (assuming 1.6x crop factor) on a 35mm camera? read.csv warning 'EOF within quoted string' prevents complete reading of file Refresh Icon Cache Without Rebooting Normally, to refresh the icon cache in Windows, we have to reboot.  Is there a way to refresh the icon cache in Windows 7/8 without rebooting?