I have a variable which contains the value 1234567.  I would like it to contain exactly 8 digits, i.e. 01234567.  Is there a PHP function for that?
I need to cast single figures (1 to 9) to (01 to 09). I can think of a way but its big and ugly and cumbersome. I'm sure there must be some concise way. Any Suggestions
Given that $a$~$\mathcal{N}(\mu, \Sigma)$ and $\mu$~$\mathcal{N}(0, \sigma^2 I)$, Is $p(a|\Sigma, \sigma)=\int p(a|\mu, \Sigma)p(\mu|\sigma)d\mu$ again a Normal distribution? And how to estimate the mean and variance respectively? Thanks a lot! Mysql Pivot rows into dynamic columns with unknown number of columns I have an output of a query as follows:  bid  | code | amount        | ----------------------------- 2915 | BF   |   -10700.00   | 2915 | YQ   |   -300.00     | 2915 | YR   |   0.00        | 2915 | YM   |   0.00        | 2915 | WO   |   -153.00     | 2915 | IN   |   -329.00     | 2915 | K3   |   0.00        | 2915 | CUTE |   -50.00      | -----------------------------   I need to convert the values in code column to individual columns with column name as corresponding code and amount shall be the value.  bid  | BF       | YQ     | ... | CUTE  | ---------------------------------------- 2915 | -10700.00| -300.00| ... | -50.00|   The issue is that the result of my initial query has dynamic codes and hence need to generate columns accordingly.  Already tried the following logic but couldn't achieve the goal:   , ,   All the above links use some expression or the other to generate the columns.   My original resulting rows are result of simple select on multiple joined tables, and has no calculation or expression scope.  Kindly suggest some pointer or hint on how to achieve this.  Many thanks in advance. reversing plot axis for Plot, LogPlot, LogLogPlot Why are there $736$ matrices $M\in \mathcal M_2(\mathbb{Z}_{26})$ for which it holds that $M=M^{-1}$? I'm currently trying to introduce myself to cryptography.  I'm reading about the Hill Cipher currently in the book Applied Abstract Algebra. The Hill Cipher uses an invertible matrix $M$ for encryption and the inverse matrix $M^{-1}$ for decryption. The book recommends to use a matrix $M$ for which it holds that $M=M^{-1}$, since we then have the same key for encryption and decryption.  In the book, they use a $2 \times 2$ matrix $M$ over $\mathbb{Z}_{26}$ as example, and state that for there are 736 $2 \times 2$ matrices for which it hold that $M=M^{-1}$.  I'm trying to pick up on as much as possible when reading things, since I find it counter-productive for learning to skip something, when you don't get the theory behind it. Can someone enlighten to me, as to why it is that there are 736 possible $2 \times 2$ $M=M^{-1}$ matrices and how to find them? Can't move files to trash without any permission issues This is not like one of the cases addressed before - I've checked them all.  I've suddenly begun getting that message "... can't be put in the trash. Do you want to delete it immediately?" this morning in my Home directory only.  I have a Home partition (ext4, mounted properly) with symlinks for user folders like Downloads, Documents, etc. to folders with the same names in a Data partition (ntfs, mounted properly).  For example, I cannot move a file in Downloads folder to Trash when I try via Home, but no problem if I try via Data partition, although the file in question has the same ownership and permissions at both locations.  Also no problem at all with files in my Home folder, including sub-folders like Public that are not symlinked to my Data partition.  Interesting puzzle for me...  PS: Just upgraded to 15.04 but I don't think it matters... On second thought, it might perhaps be something to do with upgrading from Nautilus 3.10 to 3.14?  PPS: This bug has been finally resolved some time later in version 16.10, and no longer exists under Ubuntu 17.04. Is there a single word that is a more vicious connotation of "competition"? What graphics packages are there for creating graphics in LaTeX documents? Searching through ODT documents without opening them? Let's say I have 2000 .ODT files. Their names are random numbers. How do I go about searching for, let's say, "pricing list"? How do I find the document I need without opening all of them one by one and checking to see if it's the right one?  Is there some program to search through the words in the documents without opening them? Do we use abstract algebra in real life? Do we use abstract algebra in real life?   Is there any application of abstract algebra in real life? How can I copy the path to a folder or a file? The Info Dialog doesn't allow me to copy the information that stands there ...    Is there an easy way to do this? 'Just' and 'only' carry a similar meaning, and while my feel for language usually helps me decide which one to use, there are times when I'm at a loss.  From my understanding, 'just' is used as a softener, to add flexibility and politeness. 'Only', on the other hand, is a relatively sharp exclusion. 'Just' also has a wider range of meanings, for instance to denote time.  While this sounds simple enough, it can get messy in practical usage. The sentence that made me stumble was "Not only airports are part of the target customer group, but also other large infrastructures".  Would the meaning of this sentence change when using 'just' instead? The way I see it, there is no difference in this case, except 'just' would make it sound a tad more colloquial. Floating point calculations in LaTeX? How can I remap Caps lock to both Escape and Control? I generally run Linux. I use Vim a lot, so the Escape key is extremely important. I also use other keyboard shortcuts a lot, so Control is "key" as well. On Linux, I've solved this by using  to map the Caps lock key to Escape if pressed by itself, or Control if pressed in combination with another key. This puts the best of both worlds within quick reach of my pinky finger. Is there any way I can do this on a Mac? Modiagram will not compile What is the solution of $\cos(x)=x$? There is an unique solution with $x$ being approximately $0.739085$. But is there also a closed form solution? SQL - Query to get server's IP address I sold an investment in a standard brokerage account at a small loss because I needed the money for a down payment.  I still think it is a good investment, can I buy the same investment in a standard IRA without running into wash sale problems?  I will probably just wait the 30 days any way to avoid any headaches, but I want to know if there is a definitive answer on this.    Being as the cost basis in the traditional IRA doesn't matter, I wouldn't think there would be a problem. Repeating something with (1/n)th chance of success n times How can I add "Show desktop" to the GNOME dash or Ubuntu Dock? Generalized Euler sum $\sum_{n=1}^\infty \frac{H_n}{n^q}$