My problem:  Prove that for any matrix $A$ and for any polynomial $p(x)$ we have that $\sigma (p(A)) = p(\sigma (A))$, where $\sigma$ is the spectrum of a matrix. Prove that $A$ is an invertible matrix if no root of $p(x)$ is an eigenvalue.  My solution:  For example, if I have the polynomial $\;$ $p(x) = x^2 + x$ $\;$ and the matrix  $$         A= \begin{pmatrix}         1 &amp; 0  \\         0 &amp; 1 \\          \end{pmatrix} $$  then   $$         p(A)= \begin{pmatrix}         1 &amp; 0  \\         0 &amp; 1 \\          \end{pmatrix}^{2}+  {\begin{pmatrix}         1 &amp; 0  \\         0 &amp; 1 \\          \end{pmatrix}}=  {\begin{pmatrix}         2 &amp; 0  \\         0 &amp; 2 \\          \end{pmatrix}} $$ $$ $$  We can see that the spectrum of $p(A)$ contains the eigenvalues $\lambda_{1,2} = 2$  The spectrum of the matrix $A$ contains eigenvalues $\lambda_{1,2} = 1$ and if we substitude it into $p(x)$, then $p(\lambda) = p(1) = 1^2 + 1 = 2$  The spectrum of $A$ is the set of its eigenvalues and the eigenvalues are the roots of the characteristic polynomial, but I am not sure how to prove $\sigma (p(A)) = p(\sigma (A))$ generally. The second proof I think I understand. Can anyone help me?
Clearly if $\lambda$ is an eigenvalue of $A$ then $p(\lambda)$ is an eigenvalue of $p(A)$ where $p$ is a polynomial. And there are cases where $A$ may have eigenvalues other than these.   Is there a general rule for finding all eigenvalues of $p(A)$? Does it depend on the field from which the elements of $A$ are taken? Are their any partial solutions to this problem?
Generate four random words from a list for XKCD-like passwords For start, we know how can we output random lines from a txt file:   perl -MList::Util -e 'print List::Util::shuffle &lt;&gt;' words.txt   But we need a general solution (perl is usually installed on every unix-like OS) to output 4 random words from a txt file, how can we do it?    $ cat words.txt ... alpha beta gamma delta epsilon ... $   The "..." represents many other words.   Example output (without newline between them, but one unix newline is needed at the end, spaces should separate them):  $ perl SOMEMAGIC words.txt gamma alpha delta beta $   Using only perl, the shortest possible solution (oneliner).   It will be used as human memorable password generator:    Since afaik perl is enough good to be named "random generator".   Example common english wordlist with 32768 unique lines: I was wondering if there is such a thing as an shapefile PRJ to PostGIS SRID lookup table?  Something that can translate the most standard shapefile PRJ definitions into the likely SRID.  When using PostGIS and pgAdminIII, if you use the postgisgui to import your shapefiles, the SRID is left as "-1".  It seems like the tool should be able to parse the Esri PRJ and determine the correct (or at least a couple of options) that are the likely SRID, rather than just leave the default.  Or does the importer have the capability to reproject on the fly if you choose another SRID?  It may seem lazy on my part, but to me it seems curious that this function hasn't already been put in place.  Does anyone know if this concept is in the works, or good reason's why it has been left out? Use grep --exclude/--include syntax to not grep through certain files I'm looking for the string foo= in text files in a directory tree. It's on a common Linux machine, I have bash shell: grep -ircl &quot;foo=&quot; *  In the directories are also many binary files which match &quot;foo=&quot;. As these results are not relevant and slow down the search, I want grep to skip searching these files (mostly JPEG and PNG images). How would I do that? I know there are the --exclude=PATTERN and --include=PATTERN options, but what is the pattern format? The man page of grep says: --include=PATTERN     Recurse in directories only searching file matching PATTERN. --exclude=PATTERN     Recurse in directories skip file matching PATTERN.  Searching on grep include, grep include exclude, grep exclude and variants did not find anything relevant If there's a better way of grepping only in certain files, I'm all for it; moving the offending files is not an option. I can't search only certain directories (the directory structure is a big mess, with everything everywhere). Also, I can't install anything, so I have to do with common tools (like grep or the suggested find). I'm trying to load a field value (machine name: field_theme_image) from a content of node value 3, in "page--front.tpl.php".  &lt;?php   $node=node_load(3);   print $node-&gt;field_theme_image[$node-&gt;language][0]['uri']; ?&gt;   Using the above code I'm not getting full URL value. Please see the image below. I can see the path value in Devel themer. Fixing the sucktastic merge UI (for tags) How to "freeze" a cloth animation at X frame? How would one freeze a simulated body at frame X and use it as a static mesh?  Following a , I've been able to do a cloth animation to my model, now I'd like to have that made static, without the use of the timeline.   The thing is, I'm modelling something that's not going to be an animation, but a static object (something like a statue/figurine). So I don't need the animation, only the shape at a particular frame that I find convenient. I'd like eventually once this is done, to also modify that deformed grid.   I've tried to follow what was said , but couldn't figure out what chipmasque was saying. I'm quite new to blender (been using it on and off, just enough to forget everything).  I'm using blender 2.63, if it is of any relevance. How do I execute a string containing Python code in Python? How do I execute a string containing Python code in Python? Partition around bad drive sectors? I've seen a lot of hard drives with only a few bad (unrecoverable) sectors (as indicated by SMART). Of course the proper thing to do with a bad drive is replace it, as there's a good chance of the drive crashing completely in the near future; I'm aware of that. However, in the interim, or for those who don't want to spend $70 to save data they don't value highly anyway (sigh, non-technical people), or just to get some use out of old hardware instead of throwing it away, I'm wondering if there's a way to identify where the unrecoverable sectors are ("where" meaning numerically, from 0 to the number of sectors on the drive), so I could stick a blank partition in that general area. Yes, this would involve low-level-formatting the drive and reinstalling the OS, of course.  So:  Would partitioning around unrecoverable sectors even be a workable way of reducing the disk of losing data?  If so, is there a way to find the location of these unrecoverable sectors? Extracting embedded images from a PDF I noticed the other day when serving the public that when asking for something, people were saying "Can I get an xyz, please". The previous time I had such a job it was "Could I have an xyz", or "May I have..." if they were being very polite.  Does anyone know when this trend started and what caused it? Limit of the sequence $a_n=\sqrt[n+1]{(n+1)!}-\sqrt[n]{n!}$ With the advent of the WordPress Answers Stack Exchange site, there's undoubtedly going to be overlap.  But I just want to get some advice:  I'm a developer and I kinda hate WordPress, but have to use it occasionally. My WordPress questions are usually development ones (when I have them), and most often related to 'how WordPress handles things', which are pretty obvious in straight programming terms.  But with the WordPress layer of abstraction, they become problematic.  I find that most developers that have gone near WordPress are usually also PHP/JS/CSS/MYSQL guys who dabble with WordPress and, as a result, hangout more on SO. And theres a die hard bunch who are heavy into the WP.SE site, but generally the WP site is for people trying to muddle through the day to day operation of using WordPress and its many themes/plugin etc.    As a result, if I were to ask something pretty in-depth about writing / integrating new &amp; strange features or something, I'm talking to a much smaller group of devs than I would be on SO.  So, enough of the ramble, my question:  Should I be posting heavy development questions relating to WordPress on the WP.SE site or to SO? Can I post to both, or is cross posting frowned upon in these cases still? Merge duplicate records into 1 field Let $a,b,c$ real numbers. Prove the inequality $|a-b| \leq |a-c| + |c-b|$. Prove that equality holds if and only if $a \leq c \leq b$ or $b \leq c \leq a$.   I've tried starting with just $a \leq c$ and using field properties to reconstruct the inequality, however I haven't been able to make it work. I also tried making the negatives positive and stripping the inequalities and making something happen but again I don't know if that's a proper rule and it didn't seem to get me anywhere. Posting and answering questions you have already found the answer to Sometimes you spend a day or more solving a technical problem, and when you finally solve it, you may want to post it on your blog (if you have one) to share with the community.  However, most developers don't have a lot of time to update their blogs, and that is why personal blogs are not ranked very highly on Google/Bing.  So even if you describe a brilliant idea, chances are that, except a few of your friends, nobody will ever find it. This is a common reason why some developers start their blogs and soon give up; it is not interesting to write for the community if you have no feedback on your posts.  Unlike personal blogs, Stack Exchange sites are highly ranked in Google (I was amazed when I saw that a question asked on SO just an hour ago appeared 3rd in my Google search!), so if your question and answer are valuable for others, they will be rated highly and will be visible for other developers.  With this in mind, is it good practice to post a question and answer it yourself immediately when you want to share an idea with the community? Variable variable class extensions in PHP--is it possible? Is something like the following possible in PHP?  $blah = 'foo1';  class foo2 extends $blah {     //... }  class foo1 {     //... }   This gives an error.  I want to dynamically set $blah so I can extend whatever class I want.  Edit: The reason for wanting to do this because I wanted to use a function out of another class in a related class. In the end it would have been something like:  Final extends foo1 extends foo2 extends foo3 extends foo4 extends parent { ... }   In the end I decided to instantiate the other class within the class and use it. Not the best options because they both you 2 of the same classes, but this won't be used that often, so it will work for now. Prove that $\frac{a_1^2}{a_1+a_2}+\frac{a_2^2}{a_2+a_3}+ \cdots \frac{a_n^2}{a_n+a_1} \geq \frac12$ Let $a_1, a_2, a_3, \dots , a_n$ be positive real numbers whose sum is $1$. Prove that $$\frac{a_1^2}{a_1+a_2}+\frac{a_2^2}{a_2+a_3}+ \ldots +\frac{a_n^2}{a_n+a_1} \geq \frac12\,.$$  I thought maybe the Cauchy and QM inequalities would be helpful. But I can't see how to apply it. Another thought (might be unhelpful) is that the sum of the denominators on the left hand side is $2$ (the denominator on the right hand side). I would really appreciate any hints. Correct usage of "persons" (vs. "people") I had a little fight about persons vs. people.  Could you advise if both of the following are correct, if possible with reference to a dictionary?        A table for two people please.   A table for two persons please.      Besides that, how would you ask for a table in a restaurant?  I read  and , but they didn't really solve the question if both are correct.  I also found the last paragraph of , which suggests that (1) is "more correct", but doesn't say (2) is wrong. iOS 12 tapping on notification to open app not working $AB-BA=I$ having no solutions The following question is from Artin's Algebra.      If $A$ and $B$ are two square matrices with real entries, show that $AB-BA=I$ has no solutions.    I have no idea on how to tackle this question. I tried block multiplication, but it didn't appear to work.