Ok, so I got an error when I tried to print something based on the user's input. Pretty standard stuff, right? So, if the program would have worked correctly, the user would have entered six words or phrases that would be stored in the string named PhrasesAndWords. Then, each part of the array would have been tested, by creating a while-loop, using the counter as the index in the switch statement. Well, apparently, this didn't work, because it wasn't a constant expression, or a constexpr. The variable can't be a constant expression, though, since that would result in an infinite loop. By the way, here is the error:  C:\Users\henry\Desktop\NotTheActualPathForThisProject\main.cpp|34|error: switch quantity not an integer|  Aaand here's the code I wrote (I have gotten rid of irrelevant variables and such, though):  int main() {  string phrasesAndWords[6];  cin &gt;&gt; phrasesAndWords[0] &gt;&gt; phrasesAndWords[1] &gt;&gt; phrasesAndWords[2] &gt;&gt; phrasesAndWords[3] &gt;&gt; phrasesAndWords[4] &gt;&gt; phrasesAndWords[5]; // Recieve input  int counter = 0;      while (counter &lt; 6) {     switch(phrasesAndWords[counter]) {          case "RandomString":             print("That sure was quite random. \n")         default:             print("I don't understaahnd... \n")     };     counter++; };   };
Compiling the following code and got the error of type illegal.  int main() {     // Compilation error - switch expression of type illegal     switch(std::string("raj"))     {     case"sda":     } }   You cannot use string in either switch or case. Why? Is there any solution that works nicely to support logic similar to switch on strings?
How do I get timestamp from e.g. 22-09-2008? I have ubuntu mate. I have recently changed my password using the passwd command. I know now that I have made a mistake because I also have my home directory encrypted with the previous password.  Consequently after enter my new password at login screen it return me back to the login screen.  Can someone please help me?  I am able to enter to grub boot menu and shell, i am also able to log into guest user. Sorry if the topic is duplicate but I haven't found the same question  Thanks in advance. How can I see the history of stories I've read on Apple News? Sometimes I'll be interrupted in the middle of reading a story on Apple News and later when I open the app, it didn't save the story I was previously reading. I want to be able to resume reading the article, how can I find it again? Inner automorphisms form a normal subgroup of $\operatorname{Aut}(G)$ For an arbitrary group $(G,\cdot)$ let $\operatorname{Aut}(G) = \{f: G \to G \mid f \text{ is an isomorphism}\}$ be the set of all automorphisms of the group $G$. We assume that $(\operatorname{Aut}(G),\circ)$ where $\circ$ is composition of mappings is a group.  1) Prove that for arbitrary $a \in G$ there is an automorphism $p_a: G \to G;\quad p_a(x) = a^{-1}xa$.  2) Prove, that $\operatorname{Inn}(G) = \{p_a \mid a \in G\}$ is a normal subgroup of $(\operatorname{Aut}(G),\circ)$. Is there any way to add pasta to soup without the pasta doubling in size and getting mushy in the fridge later.I've even tried putting uncooked pasta in with the same result. How do I login as root? Who turned on the lightsaber? Spoilers for The Last Jedi:      Just before Snoke is slain,   he narrates Kylo Ren's thoughts/feelings (saying things like "he turns the lightsaber towards his enemy" and so on) we see the Skywalker lightsaber being manipulated through the Force to point towards and then slay Snoke. My question is, do we know for sure who was using to Force to use the Skywalker lightsaber in this scene?   It could have been   A) Kylo Ren was turning igniting the Skywalker lightsaber with the Force. Snoke assumed the thoughts/feelings he was sensing were directed at Rey but they weren't.   Or... B) Snoke was so preoccupied with Kylo's thoughts that he wasn't paying any attention to Rey's thoughts. Rey takes advantage of this and uses the Force to turn and ignite the Skywalker lightsaber to slay Snoke. This option is reinforced by the fact that  1) the Skywalker lightsaber then zooms into Rey's hand, not Kylo's.  2) after the ensuing scuffle, Kylo Ren reveals that he hasn't switched sides; he is still a believer in the First Order.  3) Kylo Ren even tells Hux that Rey slew Snoke. Prove that the additive groups $\mathbb{R}$ and $\mathbb{Q}$ are not isomorphic. Is there a better (or other) way(s) to prove the following statement? Also, the same argument works for multiplicative groups $\mathbb{R}-\{0\}$ and $\mathbb{Q}-\{0\}$, right?       Problem Prove that the additive groups $\mathbb{R}$ and $\mathbb{Q}$ are not isomorphic.   Solution By cantor's diagonal argument, there is no possible bijection between $\mathbb{Q}$ and $\mathbb{R}$. Since an isomorphism needs to be a bijection, there is no possible isomorphism between the additive groups $\mathbb{R}$ and $\mathbb{Q}$.    Thanks TeXnicCenter & Adobe Reader DC I am going through Shankar's Principles of Quantum Mechanics and am having trouble finding the free particle propagator $U(t)$ that satisfies $$\lvert\psi (t)\rangle = U(t)\lvert\psi (0)\rangle$$ due to the degeneracy of the $E$ eigenkets. Shankar says that if the Hamiltonian has degenerate eigenvalues, we change the propagator equation from $$U(t) = \sum_{E} \lvert E\rangle\langle E\rvert e^{-iEt/{\hbar}}\tag{4.3.13}$$ to $$U(t) = \sum_{E} \sum_\alpha \lvert E, \alpha\rangle\langle E, \alpha\rvert e^{-iEt/\hbar} $$ where $\lvert E, \alpha \rangle $ are the orthonormal eigenkets for the $E$ eigenspace. This makes sense to me, because it seems like whenever we deal with degeneracy to use a projection. He also says for a Hamiltonian with no degeneracy to change the sum into an integral, so I imagine that for a Hamiltonian with a continuous, degenerate spectrum we would have this propagator: $$ U(t) = \sum_\alpha\int_\Re dE\lvert E, \alpha\rangle\langle E, \alpha\rvert e^{-iEt/\hbar}$$  I tried applying this to the free particle and had some trouble. In the book, after solving for the eigenkets and eigenvalues, $\lvert E\rangle = \lvert p\rangle$ and $p = \pm\sqrt{2mE}$, he chooses the propagator as a function of the momentum eigenvalues $p$ so that $$U(t) = \int_\Re dp\lvert p\rangle\langle p\rvert \exp(-ip^2t/2m).\tag{5.1.9}$$ I understand how he got to this, but I'm having some trouble because this doesn't appear to be the same expression that I have above. Splitting the integral up, we have $$U(t) = \int_{-\infty}^0dp\lvert p\rangle\langle p\rvert \exp(-ip^2t/2m) + \int_0^\infty dp\lvert p\rangle\langle p\rvert \exp(-ip^2t/2m)$$ The left integral can changed to an integral over $-p$, and the bounds switch from $0$ to $\infty$ such that: $$U(t) =  \int_{0}^\infty d(-p)\lvert -p\rangle\langle -p\rvert \exp(-ip^2t/2m) + \int_0^\infty dp\lvert p\rangle\langle p\rvert \exp(-ip^2t/2m)$$ Now we can substitute and interchange $\lvert p\rangle = \lvert E, + \rangle$,  $\lvert -p\rangle = \lvert E, - \rangle$, $E = p^2/2m$, and $dp = \pm mdE/\sqrt{2mE}$ to get: $$U(t) = \sum_{\alpha = \pm} \int_0^\infty dEm/\sqrt{2mE}\lvert E, \alpha\rangle\langle E, \alpha\rvert e^{-iEt/\hbar}. $$ This is the result that we are asked to prove in Exercise 5.1.1. Why is this not the same as the first expression for the propagator? Where did the extra $ m/\sqrt{2mE} $ come from? Am I just wrong in assuming that that is the general expression for a Hamiltonian with continuous and degenerate eigenvalues? Suppose $A$ is a $n \times n$ constant matrix. How can I prove $\det(e^A) = e^{\displaystyle \sum_{\lambda_i\in\sigma(A)} \lambda_i}$,  where $\sigma(A)$ is the multiset of eigenvalues of $A$?  The following matlab code shows this is true in $n = 3$ case:  A = rand(3) detA = exp(sum(eig(A))) detmA = det(expm(A)) I'm running CentOS 7.0 build 1503. I'm trying to search for commands I don't know the name of by searching the man descriptions for multiple keywords using AND (e.g. search for a command containing the both words "create" and "group" in the description).  So I came across the command apropos (which is an alias for man -k). The default behaviour when given multiple keywords is to return any command matching any of the keywords, which isn't what I want. According to the man page the option -a specifies using AND, to return matches only when all words match.  But this isn't what I'm seeing in practice, so I need some help here - e.g. using Centos 7, if I do:  apropos create user   I see a huge list of commands, seemingly matching any command with create or user in the description, as expected. Noting the list includes an entry for the command 'useradd (8) - create a new user...'.  If I do:  apropos -a create user   I only get 2 commands (environ and open). This is what I'm confused by - I would expect it to return the command 'useradd (8) - create a new user', because i can see from the previous search that command does contain those words in the description. Also the 2 returned commands don't obviously seem to be anything about creating users. What am I doing wrong? I'm sure it's something embarrassingly obvious, for that I apologise in advance.  Thanks How do I find the Arch-mage at the end of the quest "Under Sarhaal"? I have a function defined as follows: $f(x,y)= \dfrac{x^2-y^2}{\left(x^2+y^2\right)^2}$, if $(x,y)\neq (0, 0)$ and $f(x,y)=0$ if $(x,y)=(0,0)$.  Now, $$\int_0^1\int_0^1 f(x,y)\,\text{d}x~\text{d}y=-\frac{\pi}{4}$$ and $$\int_0^1\int_0^1 f(x,y)\,\text{d}y~\text{d}x=\frac{\pi}{4}.$$   The question I have is this: why does this not contradict Fubini's theorem?    thanks. I'm looking for a closed-form expression (in terms of $n$), that will give the sequence  $$ (s_n) = \left( \frac{3}{10}, \, \frac{3}{10} + \frac{33}{100}, \, \frac{3}{10} + \frac{33}{100} + \frac{333}{1000}, \dots \right). $$  Can anyone think of one? I made a related post to this question several minutes ago but I realized I was interpreting the sequence wrong. /usr/sbin/grub never finishes I did apt-get upgrade it never finishes at this point:  Searching for GRUB installation directory ... found: /boot/grub Searching for default file ... found: /boot/grub/default Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst Searching for splash image ... none found, skipping ... Found kernel: /boot/vmlinuz-3.2.0-24-virtual Updating /boot/grub/menu.lst ... done  You already have a NoLOADER configuration in /etc/grub.conf Running boot loader as requested Running /usr/sbin/grub  ...    The system does not freeze (Ctrl-Z works, I get my console back) just that that /usr/sbin/grub seems to never complete.  What should I do? What is the idiom for "as anyone can see" or "clearly"? I keep wanting to say "the handwriting on the wall," but that's not correct. The place I'm trying to use it is, "Alice likes Bob, Carol likes Bob, Alice thinks Bob likes her, but Bob dates Carol, and so as anyone can see, Bob did not like Alice."  What is the appropriate idiom here? $\operatorname{Aut}(\mathbb Z_n)$ is isomorphic to $U_n$. I've tried, but I can't solve the question. Please help me prove that:  $\operatorname{Aut}(\mathbb Z_n)$ is isomorphic to  $U_n$. If I said, &quot;I will run, not if it is snowing, if I my shoes are comfortable.&quot; Does the &quot;if my shoes are comfortable&quot; modify the &quot;I will run&quot; clause? I agree the sentence would be clearer with the addition of &quot;and&quot; in place of the comma. However, without the &quot;and&quot; is it still clear that the &quot;if my shoes are comfortable&quot; clause modifies the &quot;I will run&quot; clause? How to avoid the pop up message while downloading an application (.exe) using selenium I am trying to download an application and check if it's downloaded into my local system or not. But when I click the download link I have a popup with Save or Cancel options, which is stopping me from downloading the file. I googled and found some solutions and tried to change the profile of Firefox by adding the below code, but it is not working.  firefoxProfile.setPreference("browser.download.folderList", 2); firefoxProfile.setPreference("browser.download.alertOnEXEOpen", false); firefoxProfile.setPreference("browser.helperApps.neverAsksaveToDisk", "application/x-msexcel,application/excel,application/x-excel,application/excel,application/x-excel,application/excel,application/vnd.ms-excel,application/x-excel,application/x-msexcel"); firefoxProfile.setPreference("browser.download.manager.showWhenStarting", false); firefoxProfile.setPreference("browser.download.manager.focusWhenStarting", false); firefoxProfile.setPreference("browser.helperApps.alwaysAsk.force", false); firefoxProfile.setPreference("browser.download.manager.alertOnEXEOpen", false); firefoxProfile.setPreference("browser.download.manager.closeWhenDone", false); firefoxProfile.setPreference("browser.download.manager.showAlertOnComplete", false); firefoxProfile.setPreference("browser.download.manager.useWindow", false); firefoxProfile.setPreference("browser.download.manager.showWhenStarting", false); firefoxProfile.setPreference("services.sync.prefs.sync.browser.download.manager.showWhenStarting", false);   This is the code I added for setting up Firefox preferences, but I still get the popup.