switch statement in while loop
Problems with character input using scanf()
Have you used any of the C++ interpreters (not compilers)? I am curious if anyone have used UnderC, Cint, Cling, Ch, or any other C++ interpreter and could share their experience. Baby Rudin claim: $1+\frac{1}{3}-\frac{1}{2}+\frac{1}{5}+\frac{1}{7}-\frac{1}{4}+\frac{1}{9}+\frac{1}{11}-\frac{1}{6}...$ converges This sequence is a rearrangement of the series $1-\frac{1}{2}+\frac{1}{3}-\frac{1}{4}+\frac{1}{5}...$. Note that at this point in the text we do not have any theorem about the convergence of rearrangements.  Let $\{s_n\}$ be the sequence of partials sums of the series then for $n \ge 0$  $s_{3(n+1)} = \sum ^n _ {k=0} \frac{1}{4k+1} + \frac{1}{4k+3} - \frac{2}{4k+4}$  We can view it as the sequence(on $n$) of partials sums of  $\sum_0 a_n = \sum_0 \frac{1}{4n+1} + \frac{1}{4n+3} - \frac{2}{4n+4}$  Where $|a_n| = a_n = \frac{1}{4n+4}\{\frac{3}{4n+1}+\frac{1}{4n+3}\} \le \frac{1}{4n^2}$.  By the comparison test $s_{3(n+1)}$ converges to some real $\alpha$.  But $s_{3(n+1)+1} = s_{3(n+1)}+ \frac{1}{4n+5}$ and $s_{3(n+1)+2} = s_{3(n+1)}+ \frac{1}{4n+5}+\frac{1}{4n+7} $hence we have a partition of $\{s_n\}$ into subsequences which tend to $\alpha$ and this implies $s_n \rightarrow \alpha$.  Is my proof correct? Any alternative solutions are appreciated. What flash slaves can be used with a Canon Speedlite 600EX-RT? My current flash setup is a standard shoe mount but I've been thinking about getting a remote.  I've been drooling over the Speedlite 600EX-RT. It uses radio to control slaves, which is nice (longer distance, doesn't require line of sight, etc.).  One thing I don't understand: do slaves also have to be 600EX-RTs or do other flash units use radio to communicate already? Can any (cheap?) flash slaves can be used with a Canon Speedlite 600EX-RT or do I need to buy the 600EX and a ST-E3-RT transmitter in order (or multiple 600EX-RTs) to have a radio-controlled remote flash setup? Is an expanding map on a compact metric space continuous? How do I determine the size of my array in C?   That is, the number of elements the array can hold? How do lexical closures work? While I was investigating a problem I had with lexical closures in Javascript code, I came along this problem in Python:  flist = []  for i in xrange(3):     def func(x): return x * i     flist.append(func)  for f in flist:     print f(2)   Note that this example mindfully avoids lambda. It prints "4 4 4", which is surprising. I'd expect "0 2 4".   This equivalent Perl code does it right:  my @flist = ();  foreach my $i (0 .. 2) {     push(@flist, sub {$i * $_[0]}); }  foreach my $f (@flist) {     print $f-&gt;(2), "\n"; }   "0 2 4" is printed.  Can you please explain the difference ?    Update:   The problem is not with i being global. This displays the same behavior:  flist = []  def outer():     for i in xrange(3):         def inner(x): return x * i         flist.append(inner)  outer() #~ print i   # commented because it causes an error  for f in flist:     print f(2)   As the commented line shows, i is unknown at that point. Still, it prints "4 4 4". Where do I put my systemd unit file? Let $G$ be a group. Show that a nonempty subset $H$ is a subgroup of $G$ if any only if $ab^{-1} \in H $ for any $a,b \in H$.  The forward direction is quite easy. Suppose $H$ is a subgroup. Then by closure, $ab \in H$ for any $a,b \in H$. Every element has an inverse. Hence, if $b \in H $, then $b^{-1} \in H$. Hence, by closure again, $ab^{-1} \in H$.   Backward direction, suppose $ab^{-1} \in H $ for any $a,b \in H$. Let $a=b$. Then we have $bb^{-1}=1_H\in H$. Let $a=1_H$ , we have $1_Hb^{-1}=b^{-1} \in H$. I don't know how to show closure.  Reference: Fraleigh p. 58  Question 5.45 in A First Course in Abstract Algebra Syntax highlighting in app differs from normal web view hard disks spin up by processes / applications that simply get a list of disks? How to prevent? I have a 24/7 always-on Debian Jessie based headless home server that has a large 1TB SSD for the OS and all of my frequently accessed files. This same system has 4 larger hard disk drives in a SnapRAID array. These are mainly for archiving infrequently accessed Blu-rays and want those drives to remain spun down in standby unless I actually read or write to them. They are all formatted as ext4 and mounted with noatime and nodiratime enabled.  So even though no process or program should be regularly accessing those drives in any direct way, the hard drives constantly get spun up from standby. It seems to be related to graphical programs that provide a gui file browser, even something like Chromium. If I don't even browse into those drives, I'm thinking that these processes by simply getting a list of available drives spins up the hard disks. Much like blkid does. The problem is, it's hard to determine the root cause of this since none of these processes are actually reading or writing the filesystem on those drives, so no files are actually changing or being touched. Is there some sort of cache that I can populate or a buffer to prevent these programs from spinning up the hard drive simply by getting a list of available disks? This is honestly driving me insane, since I can't find a reliably way to keep these disks spun-down even though there is no direct access of the filesystem.  UPDATE: Thanks to Stephen's answer, I was able to trace the disk activity to gvfs and udisks. It's a real shame that these processes insist on waking up disks in standby when they aren't actually being accessed to do any real I/O with the filesystem. So far I just uninstalled them, knowing that it will remove some functionality from PCManFM and the like. My last name is not the same on ticket as on passport; rest of details are same I'm traveling from JED Saudi Arabia to Singapore by Saudi airlines. My last name doesn't match the passport. But all other details are same, e.g. passport no., DOB, etc. File changed listener in Java I'd like to be notified when a file has been changed in the file system. I have found nothing but a thread that polls the lastModified File property and clearly this solution is not optimal. If $a^3 =a$ for all $a$ in a ring $R$, then $R$ is commutative. Let $R$ be a ring, where $a^{3} = a$ for all $a\in R$. Prove that $R$ must be a commutative ring. How do I install minecraft 1.9 on mac? Can I use two different cards with the same name in Commander? Normal blocks I can mine fine, but when it comes to diamond and gold ores, the block just gets "destroyed" (as in you can't pick it up). I'm playing on multiplayer with no spawning monsters. Asymptotics of uniformly continuous functions over $\mathbb R$ Simple Smart Phone detection pgfplots fillbetween with multiple curves Can I use a one time pad key twice with random plaintext?