How do I index into an enum via &quot;item index&quot; instead of the &quot;value indexing&quot;: &quot;Value indexing&quot; (not useful to me with what I am doing): eSerialBauds eBaud = static_cast&lt;eSerialBauds&gt;(1200); // yields eBaud1200  I want &quot;item indexing&quot;: ( How to get the following? ) eSerialBauds eBaud = static_cast&lt;eSerialBauds&gt;(3); // to yield eBaud1200   // values (from WinBase.h) #define CBR_110             110 #define CBR_300             300 #define CBR_600             600 #define CBR_1200            1200 #define CBR_2400            2400    enum class eSerialBauds {   eBaud110 = CBR_110,   eBaud300 = CBR_300,   eBaud600 = CBR_600,   eBaud1200 = CBR_1200,   eBaud2400 = CBR_2400, }   Please note that I am given this enum class from another class.  There are many. So I have to work with what is given to me. I did write a work around method but it would be nice to have a more elegant way of getting the result.
I was wondering in C++ if I have an enum can I access the value at the second index?  For example I have  enum Test{hi, bye};   if I want 'hi', can I do something like Test[0], thanks.
What is the remainder of $\,3^{3^{3^{\:\!\phantom{}^{.^{.^.}}}}}\!\!\!$ divided by $46$?  The level of powers is $2020$.  First there is no parenthesis so it means 3 power of 3 which is also power 3 and so on 2020 times  Second I think that we can use Fermat's Little Theorem but I don't know how, and maybe there is a better way. Can somebody please check if my proof is okay?  Prove that $||z_1|-|z_2|| \leq |z_1-z_2|$.  Attempt: This proof seems similar to the triangle inequality proof.  $$\begin{split} |z_1-z_2|^2 &amp;= (z_1-z_2) \overline{(z_1-z_2)} \\ &amp;= (z_1-z_2)(\bar z_1 - \bar z_2) \\ &amp;= z_1\bar z_1 - z_1 \bar z_2 - \bar z_1 z_2 + z_2 \bar z_2\\ &amp;=|z_1|^2 - 2Re(z_1 \bar z_2) + |z_2|^2\\ &amp; \geq |z_1|^2 -2|z_1 \bar z_2| + |z_2|^2 \\ &amp;= |z_1|^2 - 2|z_1||z_2| + |z_2|^2 \\ &amp;= (|z_1| - |z_2|)^2. \end{split}$$  Taking the square root of both sides gives $|z_1|-|z_2| \leq |z_1-z_2|$  Can I just take the norm of both sides so that $||z_1|-|z_2|| \leq ||z_1-z_2|| = |z_1-z_2|$?  Thank you. Why does no physical energy-momentum tensor exist for the gravitational field? Starting  with the Einstein-Hilbert Lagrangian  $$ L_{EH} = -\frac{1}{2}(R + 2\Lambda)$$  one can formally calculate a gravitational energy-momentum tensor   $$ T_{EH}^{\mu\nu} = -2 \frac{\delta L_{EH}}{\delta g_{\mu\nu}}$$  leading to  $$ T_{EH}^{\mu\nu} = -G_{\mu\nu} + \Lambda g_{\mu\nu} = -(R_{\mu\nu} - \frac{1}{2}g_{\mu\nu}R) + \Lambda g_{\mu\nu}. $$  But then, in the paragraph below Eq. (228) on page 62 of  paper, it is said that this quantity is not a physical quantity and that it is well known that for the gravitational field no (physical) energy-momentum tensor exists.  To me personally, this fact is rather surprising than well known. So can somebody explain to me (mathematically and/or "intuitively") why there is no energy-momentum tensor for the gravitational field? How can we move an object with zero velocity? Why there are real numbers with infinite digits, but no such natural numbers (or another reason why real numbers are uncountable) This question is me trying to understand (again) why there can be no one-to-one correspondence between the sets of natural and real numbers.  The source of confusion is this: if we abstract completely from the properties and operations on numbers and just think of them as strings of digits, it appears to be possible to list all the real numbers between $0$ and $1$ and all positive integers having the same digits in the same (or reverse) order, for example:  $$0.1 \to 1$$  $$0.01 \to 10$$  $$0.0101 \to 1010$$  $$0.110101 \to 101011$$  I use binary expansion for simplicity.  Since irrational numbers have infinite expansions, we would have to consider some kind of 'infinite natural numbers', like:  $$101110001\dots$$  or  $$\dots101110001$$  I think the main (and only) reason why such numbers don't exist is this requirement:   We need the sets of real and natural numbers to be ordered. We need to be able to do arithmetics on real and natural numbers.   Obviously, if we consider any of two types of 'infinite natural numbers' and the usual absolute value, we find that it's impossible to order them, or do arithmetics with them.  The only way is to change the norm (to $p-$adic norm for example).  While with the real numbers it's still possible to order them, and do arithmetics with them when they have infinite amount of digits in their expansion (or at least in principle).     Is my reasoning correct? Are the two requirements (ordering and arithmetics) enough to explain why natural numbers with infinite amount of digits do not exist, while real numbers do?   This confusion is not restricted to me alone, see  for example "There is no point in" or "There is not a point in" I was thinking about these negations. Do these mean the same thing?     There is no point in ...   There is not a point in ...   or:     I have no clue   I do not have any clue     etc. Are there well known HTTP-only sites? Captive WIFI portals suck.  So often when I open in a browser (Desktop Chrome or Mobile Chrome) a HTTP site, I get the captive portal, but with auto-completion and so quickly I connect again to WIFI.  The problem is that after the captive portal redirects, I'll have also a HTTPS redirect and Chrome remember the certificate and to use only HTTPS.  So I cannot use the same site twice (in a session).  A well-known public HTTP only site will resolve this.  Well-known sites usually work, causing some less debugging of the WIFI connection. Using TP4056 module to charge battery while load remains connected Why are the Ringwraiths fearful of coming into contact with water? At least twice in The Lord of the Rings: The Fellowship of the Ring, Ringwraiths cower away from bodies of water.  The second time (the ford of Bruinen) can be explained away by their fear of some Elvish magical trap through the enchantment of the water; but what about the first time, at the ferry? One of the Nazgûl could have easily made the jump onto the barge and quickly dispatched those pesky Hobbitsses. How to insert a figure between two texts? I'd like to create something similar to what is give below: text on either side of a vertically centred image: Defining font color inside highlight fails Since I wanted a better readability of highlights of a would be black &amp; white-printed document, I needed to change both the highlighting color (gray) AND the font color (white).  Depending which command you implement inside the other will compile or not: \hl{\textcolor{white}{Fail}} does not work, compiling returns Package xcolor Error: Undefined color '{white}'.  Here's the mwe:  \documentclass{article} \usepackage{xcolor} \usepackage{color} \usepackage{soul} % Enables highlighting \sethlcolor{gray}  \begin{document}      \textcolor{white}{\hl{Success}}     %% Error:     %% Package xcolor Error: Undefined color `{white}'.     \hl{\textcolor{white}{Fail}}  \end{document}   So, in the end, the problem is sorta solved but I thought you might have an answer as to what happens. Looking for a short story about a robot evolving to have supernatural powers I'm looking for a short story from about 50 years ago about a robot who escapes after being slated to be melted down and discovers while in hiding that it has evolved to have some supernatural powers. Why does Python pep-8 strongly recommend spaces over tabs for indentation? Shell command to sum integers, one per line? I am looking for a command that will accept (as input) multiple lines of text, each line containing a single integer, and output the sum of these integers.  As a bit of background, I have a log file which includes timing measurements. Through grepping for the relevant lines and a bit of sed reformatting I can list all of the timings in that file.  I would like to work out the total. I can pipe this intermediate output to any command in order to do the final sum.  I have always used expr in the past, but unless it runs in RPN mode I do not think it is going to cope with this (and even then it would be tricky).  How can I get the summation of integers? $ \int_{0}^{ \infty} \int_{0}^{ \infty} \frac { e^{-(x+y)}}{x+y} dx dy $ Playing a video in full screen after startup I had read a story / article about artificial intelligence, I think it was last year (2012) but I'm not sure when it was published. It was on an online blog for an institute I believe. I am telling the story in quotes, just to demarcate where the story begins and ends.  In the story, a scientist is trying to build a perfect AI system which can respond to human interaction perfectly. Apparently the only way this is possible is to make the computer believe that it is human. He creates what he believes is the solution, and asks a friend to volunteer for a test, and the friend agrees. For the test the friend is supposed to step into a tank full of a liquid. As soon as he enters the tank, he is told, he will lose all his sensations - no vision, no hearing etc. After entering the tank, he talks to the computer and responds, and isn't able to recognise that he is in fact talking to a computer. After some time (days? Don't remember) has passed, he begins to worry - why is he still trapped in the tank? At this point the scientist tells him that he is in fact the computer he has made, the memory that he has of the human life till the time he enters the tank has been implanted in the machine, so he thinks he is human. He is not in a tank, he is a computer, and that is why he can't see or feel anything. The story ends here.  It is told from the perspective of the computer itself, but since it is an article in a science blog / forum for a technical college, it feels like you're reading an actual experiment when you start reading. It was a rather nice surprise ending to the story in my opinion. I just can not seem to be able to locate the article / story anywhere. Can somebody who might have read this help me? Even just pointing me in the direction of the site it is hosted on would be great. Is the axiom of choice used in the proof that every open set is the union of basis elements (Mukres, Lemma 13.1) Can you find all classes in a package using reflection? Is it possible to find all classes or interfaces in a given package? (Quickly looking at e.g. , it would seem like no.) Will everything eventually be a single black hole? Given the idea that gravity is always a factor (even though greater distances are excessively tiny), would everything eventually end up forming a single black hole?  My thinking is that, with infinite time, all mass will eventually be pulled together.