I'm running some test codes (my own) and I'd like them to self-report how much memory they use. Ideally this would be a high-water mark. Something like what Activity Monitor or top report.  C++ code, and needs to work on OSX and/or Linux. An approach that works for both would be great, if not something that works on either one would be welcome.  How can an OSX program find out how much memory it's using?
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.
In Obi-Wan's Order 66 warning transmission why didn't he tell the surviving Jedi about the Sith, including Palpatine's true identity? If you've seen the premiere episode of Rebels, you will have seen Obi-Wan's warning message that he broadcast to Jedi throughout the galaxy in RotS. In this message he speaks cryptically &amp; warns of a "dark shadow" falling &amp; to avoid the temple &amp; await a "new hope".   Wouldn't it have been useful to inform the Jedi that their mortal enemy the Sith had returned? And specifically that Palpatine himself was a Sith? You'd assume that the majority of the Jedi who were not in the loop of the Council would be unaware of the existence of the Sith. Yoda mentions a few times that they should keep it under wraps. I think now would've been the time to reveal the truth. The more info the surviving Jedi have the better. Who knows if the likes of Kanan knows anything about the Sith's return! I find Obi-Wan's omission of this information bizarre. How to request a random row in SQL? How can I request a random row (or as close to truly random as is possible) in pure SQL? Windows Starter Edition, Home and Home Premium do not include gpedit, how do I install it? I want to make some changes to Windows that require using the Group Policy Editor (gpedit.msc).  Unfortunately the Group Policy Editor is not included with the Starter Edition, Home and Home Premium editions of Windows.  How can I install it? Why do we say "is it" when asking a question rather than "it is"? I read a novel where several enemy alien species were stranded together on an interdicted planet.  They had to recycle everything and keep hidden. By "keep hidden" I mean make sure there is no evidence of their presence visible from space. They recycled everything and lived in camouflaged dwellings.  The younger generation was building a mixed culture community until the older home species showed up.  One of the alien races had a body made of rings or donuts of gases that mixed to express itself. Members of this species could be taken over and controlled by rings transferred from another member of the species.  The book may be 20 years old or more. How can I take pictures through a skyscraper, airplane, or train window? Why "Dark Energy" is called energy instead of force? The overly simplified explanation I'm giving myself right now is  causes the opposite of what gravity does, that's why the universe is expanding. Now where gravity is a force, why dark energy is "energy"? Why it's not called "Dark Force" instead? I think I must be missing something here. Copying applications from applications folder to external and reinstalling osx Is it possible to copy all my applications from the applications folder onto an external, format my mac, reinstall OS X and finally copy the applications back into the applications folder for installing them?  Will that work? I am asking because my macbook seems to be behaving in a very odd manner, has become excessively sluggish and is preventing me from recording anything in logic.. I have tried the usual freeing up space, clean desktop, fixing permissions, verifying and repairing disk as well as resetting pram and making sure I have all the latest software and firmware updates. The macbook is only 8 months old and is running Lion with 8gb of ram, I really cannot understand what is wrong with it. Even when trying to watch a movie, the player will get serious audio/video synchronisation issues and I noticed that every time my wifi is on the fans speed up like a plane taking off. I even checked and it is clean from any dust. I am perplexed :(   If anyone could help me please, I would greatly appreciate it.  Thanks in advance! Sum of odd Fibonacci Numbers Trying to prove that the sum of odd-index consecutive Fibonacci numbers is the next even-index Fibonacci number. I have a gap in my proof that I cannot figure out. I know that induction would be easier and I have already done it that way, I am looking to use alpha and beta. $$\sum_{i=1}^n F_{2i-1} = F_{2n}$$  $$\begin{align*} \sum_{i=1}^n F_{2i-1}&amp;=\sum_{i=1}^1  \frac{1}{\sqrt{5}}(\alpha^{2i-1}-\beta^{2i-1})\\ &amp;=\frac{1}{\sqrt{5}}\left(\sum_{i=1}^1\alpha^{2i-1}-\sum_{i=1}^1\beta^{2i-1}\right)\\ &amp;\;\;\vdots\\ &amp;=\frac{1}{\sqrt{5}}[(\alpha^n-\beta^n)(\alpha^n+\beta^n)]\\ &amp;=\frac{1}{\sqrt{5}}(\alpha^{2n}-\beta^{2n})\\ &amp;=F_{2n} \end{align*}$$ Generating ordered combination of numbers How do I get lightning:datatable to do some undocumented thing X? Canonical Question  I want to do &lt;some really cool thing&gt; with a lightning:datatable, but I can't seem to figure out how to do it. I checked the , but I did not see a way to implement &lt;this really cool feature I need&gt;.  Perhaps I want to provide tooltips, or a pick list, or alter the behavior of the menus, or display images, or show a custom component I created, or define a new row-level click behavior, or alter the keyboard event handlers, etc.  Can I somehow do this? su command + authentication failure How do I make my document use the Times font, both for the text and the math? I know that I can put \usepackage{times} in the preamble in order to use the Times font instead of Computer Modern for my document.  But this only affects the text; the math is still typeset using Computer Modern.  How can I make Latex use Times also for the math? Average distance between two random points in a square A square with side $a$ is given. What is the average distance between two uniformly-distributed random points inside the square?  For more general "rectangle" case, see . The proof found there is fairly complex, and I am looking for a simpler proof for this special case. I expect it could be significantly simpler.  See also . How to understand dot product is the angle's cosine? How can one see that a dot product gives the angle's cosine between two vectors. (assuming they are normalized)  Thinking about how to prove this in the most intuitive way resulted in proving a trigonometric identity: $\cos(a+b)=\cos(a)\cos(b)-\sin(a)\sin(b)$.  But even after proving this successfully, the connection between and cosine and dot product does not immediately stick out and instead I rely on remembering that this is valid while taking comfort in the fact that I've seen the proof in the past.  My questions are:   How do you see this connection? How do you extend the notion of dot product vs. angle to higher dimensions - 4 and higher? how to pass objects between intents $\textit{Why}$ the cases in 4 $\nmid n^2 - 3?$ (bases cases in modular induction) This question has already been answered . My question is, when we suppose the hypothesis is not true (proof by contradiction), namely that $4 \mid (n^2 - 3)$, we get $n^2 - 3 = 4k$ for some integer $k$ and then we have two cases. But where does the two cases come from? In addition, why does putting them into two cases work to prove the statment? My thought process would be to try to prove this statement by contradiction and somehow figure out a way to produce a contradiction similar to how $\sqrt{2}$ is proved by contradiction. Any help is great! Let me know if I need to clarify more! I've been modeling an F-15, but when I rotate the flaps on Y-Axis the Flaps offset from the wing and they look like they are about to fall out, so I end up correcting it by rotating in the X and Z-axis to align them correctly.  However when I rotate them back from the Y-Axis they look distorted again because I did rotations on the X and Z axis. I tried riding it, no help. I saw something about custom orientation to fix it but that was not clearly explained and it was done on an ideal plane that was (0,0,0); mine is pre-rotated on all axis.   I'll take scripts if needed and I'm using Blender 2.8.  When I rotate it on the Y-Axis:    Fixing it using X and Z rotation:    Rotating it back on the Y distorted it again:    Here's the wing with ailerons and flaps: How to find users by name I have a whole bunch of people I would love to follow or at least check out on Stack Overflow. I know them from places like Github as well as personal friends. However I am having a really hard time finding them even though I know e.g. their Gmail address and that they use OpenID via Gmail to login and their full name.   How come this is so painful? Note that I don't want to have to fuzz around with the data explorer just to find a friend of mine on Stack Overflow. What am I missing? Is it just not there or just not working properly? How can I migrate a Windows 10 from BIOS/MBR boot to UEFI/GPT without reinstalling?