Is there an easy way to find out how much RAM (in MB) does my program use after different operations (large matrix manipulation)? I am using Windows 10.
I once had the task of determining the following performance parameters from inside a running application:   Total virtual memory available Virtual memory currently used Virtual memory currently used by my process Total RAM available RAM currently used RAM currently used by my process % CPU currently used % CPU currently used by my process   The code had to run on Windows and Linux. Even though this seems to be a standard task, finding the necessary information in the manuals (WIN32 API, GNU docs) as well as on the Internet took me several days, because there's so much incomplete/incorrect/outdated information on this topic to be found out there.  In order to save others from going through the same trouble, I thought it would be a good idea to collect all the scattered information plus what I found by trial and error here in one place.
$f$ a real, continuous function, is it measurable? Let $f: \mathbb{R} \to \mathbb{R} $ be a continuous function. I need to show that is a measurable function.   I tried working with the definition:  Let $f: X \to \mathbb{R}$ be a function. If $f^{-1}(O)$ is a measurable set for every open subset $O$ of $\mathbb{R}$, then $f$ is called a measurable function.  Since $f^{-1}(O)$ also lies in $\mathbb{R}$, I think it is sufficient to show that every subset of $\mathbb{R}$ is measurable. But is this possible?   So far I concluded that $\mathbb{R}$ itself is measurable, since $$\mu(A) = \mu(A \cap \mathbb{R}) + \mu(A \cap \mathbb{R}^c) = \mu(A) + \mu(\emptyset) = \mu(A).$$ How do I need to approach? How quickly is antibiotic resistance lost? What are the differences between sudo, su, visudo, chroot, and gksu? What are the differences between sudo, su, visudo, chroot, and gksu ? What is purpose of /etc/shadow and shadow cache files in Linux operating system? What is the purpose of the /etc/shadow file in Linux Operating system?  Also, is it same for SUSE clients? There is one shadow cache file is maintained what is purpose of that? Monday morning mistake: sudo rm -rf --no-preserve-root / Please note: The answers and comments to this  question contains content from another, similar question that has received a lot of attention from outside media but turned out to be hoax question in some kind of viral marketing scheme. As we don't allow ServerFault to be abused in such a way, the original question has been deleted and the answers merged with this question.      Here's a an entertaining tragedy. This morning I was doing a bit of maintenance on my production server, when I mistakenly executed the following command:  sudo rm -rf --no-preserve-root /mnt/hetznerbackup /  I didn't spot the last space before / and a few seconds later, when warnings was flooding my command line, I realised that I had just hit the self-destruct button. Here's a bit of what burned into my eyes:  rm: cannot remove `/mnt/hetznerbackup': Is a directory rm: cannot remove `/sys/fs/ecryptfs/version': Operation not permitted rm: cannot remove `/sys/fs/ext4/md2/inode_readahead_blks': Operation not permitted rm: cannot remove `/sys/fs/ext4/md2/mb_max_to_scan': Operation not permitted rm: cannot remove `/sys/fs/ext4/md2/delayed_allocation_blocks': Operation not permitted rm: cannot remove `/sys/fs/ext4/md2/max_writeback_mb_bump': Operation not permitted rm: cannot remove `/sys/fs/ext4/md2/mb_stream_req': Operation not permitted rm: cannot remove `/sys/fs/ext4/md2/mb_min_to_scan': Operation not permitted rm: cannot remove `/sys/fs/ext4/md2/mb_stats': Operation not permitted rm: cannot remove `/sys/fs/ext4/md2/trigger_fs_error': Operation not permitted rm: cannot remove `/sys/fs/ext4/md2/session_write_kbytes': Operation not permitted rm: cannot remove `/sys/fs/ext4/md2/lifetime_write_kbytes': Operation not permitted # and so on..   I stopped the task and was relieved when I discovered that the production service was still running. Sadly, the server no longer accept my public key or password for any user via SSH.  How would you move forward from here? I'll swim an ocean of barbed wire to get that SSH-access back.  The server is running Ubuntu-12.04 and hosted at Hetzner. Redshifting of Light and the expansion of the universe I've encountered issues posting comments or answers numerous times over the last month, I've narrowed it down that it only occurs when I use UNION and ALL next to each other (ie SQL).  If I separate them by a dash it works fine. The error is always generic:  'An error occurred during ____ submission'  The blank being either comment or answer. Someone suggested I post this question here.  I do not see a similar question, interestingly even trying to search the site for UNION and ALL errored, similarly separating them with + returns an error. Screenshot:  This occurs in Chrome or IE, on Win 7, will test tonight from personal machines. UPDATE:  Apparently through good coincidence I just never had attempted to use UNION ALL when answering questions from home, works fine here.  So it must indeed be some firewall/policy setting at my office with very specific criteria, never found any other code bits I couldn't post, and don't have a problem with UNION ALL on other sites.  Still interested to find out how it's being blocked given our high level of access. Could the Horcruxes be destroyed with Avada Kedavra? In The Deathly Hallows Hermione says this about destroying Horcruxes:     “It doesn’t have to be a basilisk fang,” said Hermione patiently.   “It has to be something so destructive that the Horcrux can’t repair   itself. Basilisk venom only has one antidote, and it’s incredibly   rare—"      "That’s a problem we’re going to have to solve though, because ripping, smashing, or  crushing a Horcrux won’t do the trick. You’ve got to put it beyond magical repair.”   Mad-Eye Moody from The Goblet of Fire tells us this about Avada Kedavra,     ...there's no countercurse. There's no blocking it.   but also that,      Avada Kedavra's a curse that needs a powerful bit of magic behind it - you could   all get your wands out now and point them at me and say the words, and I doubt   I'd get so much as a nosebleed.    Harry is also seen once attempting to use Crucio on Bellatrix Lestrange in The Order of the Phoenix out of anger at the death of Sirius, but he fails. She tells him,     "You need to mean [Unforgivable Curses], Potter! You need to really want to cause pain - to enjoy it - righteous anger won't hurt me for long - I'll show you how it is done, shall I? I'll give you a lesson -"   Even if Harry and company are not powerful enough to perform the curse themselves, they know several powerful wizards (Kingsley, Lupin, et al.) who could likely perform the curse.  Lastly we know that Voldemort himself destroyed the last bit of his soul that was inside Harry with Avada Kedavra.  Could the Horcruxes be destroyed with Avada Kedavra as well? How to calculate temperature in Wire? Let's say I have 1m of 2,5mm² copper wire, insulated with H07V-K. The wire carries 40A and environment temperature is 25°C. The wire is suspended in free air. How hot will the wire get? And how can I calculate it for other values?  The use case is a 12V-230V AC converter I want to hook up to my car and determine the minimum wire thickness required. Because it's only used from time to time and not buried in a wall I suspect I can use thinner wires. This is a temporary thing and doesn't need to be up to code. mkfs on raw software raid device or partition I am making a huge RAID10 device (8 TB) for storage on CentOS. I have created the 4 partitions on my 4 physical hard disks and have created the raid device /dev/md2 out of those 4 partitions.  Now it's time to put a filesystem on it. I am wondering whether I should do just:  mkfs.ext4 /dev/md2   which totally works (I tried it), or I should first create a single partition on that device (with fdisk, gdisk or parted?), that takes up all the space, and then do the mkfs stuff on that partition.  Googling the Web, I found another person asking the very same question here:  but, although a responder said:      Partitions go on the array members.   Filesystem goes on the array.   they didn't give him a definitive, non-ambiguous answer or an explanation when one approach should be preferred over the other. Sequence of positive integers such that their reciprocals are in arithmetic progression Explosive AR(MA) processes are stationary? How to snap and align 2 objects Hi! I'm a beginner learner and I'd like to know how to snap these three objects. I'd like to snap the two cylinders with the different faces of the cube. The short one on the left and the highest cylinder on the top of the cube. I'd like to have the center of the cylinder aligned with the center of the cube (the base of the cylinder inscribed into the face of the cube)  I'm sorry for bad explanation I hope someone can help me  Thanks!   I add a screenshoot in which you can see what I have to do   Thanks again if someone can help me with this! Show sub reasons in close review queue Currently close vote review queue shows the top level close reason in the header, but some close reasons, for instance, off topic have very different sub reasons. For instance, "demonstrate minimal understanding" is different from "This question belongs on a different site in the stack exchange network".  It would be nice if sub close reasons were also shown. Linearization of PDE: $0$ is an eigenvalue since all translates of travelling waves are also travelling waves Consider the following PDE: $$ u_t=u_{xx}+f(u)-w,~~~~~w_t=\varepsilon (u-\gamma w),~~~~~~~~~(1) $$ where $f(u)=u(u-a)(1-u), 0&lt;a&lt;\frac{1}{2}, \varepsilon,\gamma &gt;0, \varepsilon\ll 1,\gamma\ll 1$.  A travelling wave for (1) is a solution that is a function of the single variable $\xi=x-ct$, i.e., $(u(\xi),w(\xi))$ satisfies $$ -cu'=u''+f(u)-w,~~~~~~-cw'=\varepsilon (u-\gamma w)~~~~~~~('=d/d\xi).~~~~~~(2) $$  If (1) is recast in a moving coordinate frame, i.e., in terms of variables $\xi=x-ct$ and $t$, it becomes $$ u_t=u_{\xi\xi}+cu_{\xi}+f(u)-w,~~~~~~w_t=cw_{\xi}+\varepsilon (u-\gamma w).~~~~~~~~(3) $$  One can see by (2), that a travelling wave is an equilibrium solution of (3). So one nearby question is to ask whether a travelling wave is stable.    For a fixed $\varepsilon$, let $U_{\varepsilon}(\xi)=(u_{\varepsilon}(\xi),w_{\varepsilon}(\xi))$ be a travelling wave for (1), i.e., an equilibrium solution for (3).          A standard technique for determining stability of $U_{\varepsilon}(\xi)$ is to linearize: If the right-hand side of (3) is linearized along $U_{\varepsilon}(\xi)$, the resulting operator is     $$ L\begin{pmatrix}p\\r\end{pmatrix}=\begin{pmatrix}p_{\xi\xi}+cp_{\xi}+f'(u_{\varepsilon})p-r\\cr_{\xi}+\varepsilon (p-\gamma r)\end{pmatrix}, $$     where $\begin{pmatrix}p\\r\end{pmatrix}(\xi)\in\text{BC}(\mathbb{R},\mathbb{R}^2):=\left\{u\colon\mathbb{R}\to\mathbb{R}^2 | u\text{ is bounded and uniformly continuous}\right\}$.      (The linearized criterion for stability of the travelling wave is that the spectrum of $L$ (except for $0$) lies in a left half-plane and $0$ is a simple eigenvalue.)  Thats the background.  Now, there is a statement that I could not understand yet.          Note, that $0$ must be in the spectrum because the translate of a travelling wave is another travelling wave.      I know that a translate of a travelling wave is again a travelling wave. But why does this imply that $0$ is in the spectrum of $L$?  Edit  After some looks at definitions, I have an idea:  Consider a solution $U(\xi,t)$ that is a translate of the travelling wave $U_{\varepsilon}(\xi)=(u_{\varepsilon}(\xi),w_{\varepsilon}(\xi))$, i.e.  $$ U(\xi,t)=U_{\varepsilon}(\xi-k)=(u_{\varepsilon}(\xi-k),w_{\varepsilon}(\xi -k)) $$ for some $k$. Then $U$ is an equilibrium solution of (3), too.  If I am not totally wrong, then we have  $$ p=u_{\varepsilon}(\xi-k)-u_{\varepsilon}(\xi),~~~~r=w_{\varepsilon}(\xi-k)-w_{\varepsilon}(\xi) $$ and  $$ p_t=0,~~~w_t=0, $$ because travelling waves are equilibria for (3) and a translate of a travelling wave is a travelling wave.  Hence $$ L\begin{pmatrix}p\\r\end{pmatrix}=\begin{pmatrix}0\\0\end{pmatrix}, $$ meaning that $$ \text{ker}(L-0\text{ id })\neq\left\{\begin{pmatrix}0\\0\end{pmatrix}\right\}, $$ because for each translate of the travelling wave, $p,r\neq 0$ and  $\begin{pmatrix}p\\r\end{pmatrix}\in\text{ker}(L-0\text{ id})$.  Hence $0$ is in the spectrum (point spectrum) of $L$.  Is this what was meant? Infinite Series: Fibonacci/ $2^n$ I presented the following problem to some of my students recently (from Senior Mathematical Challenge- edited by Gardiner)  In the Fibonacci sequence $1, 1, 2, 3, 5, 8, 13, 21, 34, 55,\ldots$ each term after the first two is the sum of the two previous terms. What is the sum to infinity of the series: $$\frac{1}{2} + \frac{1}{4}+ \frac{2}{8} + \frac{3}{16} + \frac{5}{32} +\frac{8}{64} + \frac{13}{128} +\frac{21}{256} +\frac{34}{512}+ \frac{55}{1024} + \cdots$$  Now, I solved this using an infinite geometric matrix series (incorporating the matrix version of the relation $a_n= \frac{a_{n-1}}{2}+ \frac{a_{n-2}}{4}$), and my students, after much hinting on my part, googled the necessary string to stumble across Binet's formula (which allows one to split the series into two simple, if rather messy, geometrics). Both of these are good methods, but neither really seems plausible for a challenge set for 15-18 year olds under exam conditions. So how is one supposed to do it? Combining the second elements of a set of ordered pairs based on their first element Show that $\sum_{n=1}^{\infty}(n^{3}\sin\left(\frac{1}{n}\right)-n^{2}+\frac{1}{6})$ converges Let $t\in \mathbb R$. Prove that $\displaystyle{\sum_{n=1}^{\infty}n^{3}\sin\left(\frac{1}{n}\right)-n^{2}+t}$ converges iff $t=\frac{1}{6}$.  While the $(\Rightarrow)$ direction was fairly easy (as $a_n$ should converge to $0$, forcing $t=\frac{1}{6}$), i'm facing some hard time trying to prove the second direction, that is $\displaystyle{\sum_{n=1}^{\infty}(n^{3}\sin\left(\frac{1}{n}\right)-n^{2}+\frac{1}{6})}$ converges. I did notice that $a_n=a_{-n}$ and tried to write this series as a Leibnitz series, but had no luck since the sequence doesn't decrease. I also tried to prove absolute convergence but then again, no luck. Thanks. Why is $\pi$ irrational? I've a few questions in mind:   Why is $\pi$ irrational? If it is, then how can 2 rational quantities (circumference, diameter) can produce irrational number? How are we able to determine digits of $\pi$ accurately? qt4 / libqt4-* in Ubuntu 20.04