Python loop counter in a for loop
Accessing the index in 'for' loops?
I'm trying to do something like the following:  enum E;  void Foo(E e);  enum E {A, B, C};   which the compiler rejects.  I've had a quick look on Google and the consensus seems to be "you can't do it", but I can't understand why.  Can anyone explain?  Clarification 2: I'm doing this as I have private methods in a class that take said enum, and I do not want the enum's values exposed - so, for example, I do not want anyone to know that E is defined as  enum E {     FUNCTIONALITY_NORMAL, FUNCTIONALITY_RESTRICTED, FUNCTIONALITY_FOR_PROJECT_X }   as project X is not something I want my users to know about.  So, I wanted to forward declare the enum so I could put the private methods in the header file, declare the enum internally in the cpp, and distribute the built library file and header to people.  As for the compiler - it's GCC. Where can I get more favourable exchange rate, in general?changing baht to Canadian dollars in Thailand or Canada or make a bank transfer to my Canadian account I'm working on the question     Let $G$ be the group of invertible real matrices of the form $\left [\begin{array}{c c}a &amp; b\\ &amp; a^2\end{array}\right ]$. Determine the Lie algebra $L$ of $G$, and compute the bracket on $L$.   I'm familiar with how to derive the Lie algebra for a linear group like $U_n$, $SU_n$, etc. but I'm not sure what to do in a more explicit case like this. Migrating to full Ubuntu after dual installation on WinXP I previously ran 12.04 alongside WinXP to see how it performed on my mom's older laptop.  i also migrated her email to Thunderbird. If I now convert from dual WinXP/Ubuntu to only run Ubuntu will things like her Thunderbird emails be transferred as part of the Ubuntu full install? Or must I do something else? I am fairly tech aware, but not a full IT boffin! I need to prove that $H$ is a maximal normal subgroup of $G$ if and only if $G/H$ is simple.  My proof to the $(\Rightarrow)$ direction seems too much trivial:  Let us assume there exist $A$ so that $A/H\lhd G/H$. Then by definion, $H$ must be normal in $A$. Because $H$ is maximal, we get $H=A$ and therefore $A/H={1}$  Is it correct?  Update:  Now I see that I need to prove that not only $A\lhd H$ but also $A\lhd G$. Assumig I have proven that, is the proof correct? ModernCV Remove horizontal line in sections I want to write my cv with moderncv-Classic style. Can you tell me, how I can remove the horizontal line in the left of each section? If anonymity is so important, why is it not universal? A frequent argument brought up in support of voting anonymity is that it can lead to potential grudges. Certainly the review system is of the same nature.  I cannot wrap my mind around the fact that voting is anonymous and reviewing is not. Either both should be public--and this would be fine since public reviewing has been successful--or both should be anonymous--and I assume this would be the desired option since this community holds anonymity so dear.  One could say that voting rates the posts, the actual meat of the site, while reviewing is based on clarifying the purpose of the site and cleaning it up.   answer makes the point that the community can trust that votes are a good measure of quality for the very reason that they do not know who cast them; the mentality that a high-ranking member may have supported something could blur the line between "science" and "politics/religion."  Reviewing, then, can be seen as a judgment of specific members rather than quality of edit/questions, which seems to fall precisely under the "politics/religion" umbrella--the review system is much more vulnerable to grudges due to this.  So let's discuss the differences and the implications of these disjointed anonymity policies. How do you set, clear, and toggle a single bit? What does the helpful flag mean? I don't see "Helpful" in the list of things I can do when I press the flag link.   In my profile page I saw "6 helpful flags."  How do I earn these flags?  May I make them on other peoples' posts or comments?   This is what I am talking about: How to create a generic array in Java? Due to the implementation of Java generics, you can't have code like this:   public class GenSet&lt;E&gt; {     private E a[];      public GenSet() {         a = new E[INITIAL_ARRAY_LENGTH]; // error: generic array creation     } }   How can I implement this while maintaining type safety?  I saw a solution on the Java forums that goes like this:  import java.lang.reflect.Array;  class Stack&lt;T&gt; {     public Stack(Class&lt;T&gt; clazz, int capacity) {         array = (T[])Array.newInstance(clazz, capacity);     }      private final T[] array; }   But I really don't get what's going on. Why is the wild card character * so different between the zip and rm commands? I put together a script to do some file operations for me. I am using the wild card operator * to apply functions to all files of a type, but there is one thing I don't get. I can unzip all files in a folder like this  unzip "*".zip   However, to remove all zip files afterward, I need to do   rm *.zip   That is, it does not want the quotation marks. The unzip, on the other hand, does not work if I just give it the * (gives me a warning that "files were not matched").   Why is this different? To me, this seems like the exact same operation. Or am I using the wild card incorrectly?   in Unix do not really go into this, and I could not locate anything in the rm or zip docs.  I am using the terminal on a Mac (Yosemite). Difference between int[] array and int array[] Finding basis of $\mathbb{Q}(\sqrt{2},\sqrt{3},\sqrt{5})$ over $\mathbb{Q}$ Why can't I import a file in the init.m file? Looking for a book, wormhole, space ship Crash landing From what I remember of the book:   A spaceship goes through a wormhole (I think) and crash lands on a planet They salvage what they can from the ship and build a castle on a mountain, cutting the stone with the lasers from the crashed ship The crew develop some sort of powers, the captain (She) seems to develop some sort of Precognition The planet's inhabitants where men rule and women are second class citizens Some women escape to the crew's castle so they can be equal citizens After they build the castle the crew fight the inhabitants the that came to attack them   What is the name of this book? How do you close windows/tabs in 2.8? I've tried a lot of stuff, but always end up opening up more. Smallest dense subset of $\mathbb{R}$ I am not sure if what I am looking for even makes sense (or) exists. Anyway I would be happy if someone can clear my confusion.  The set of real numbers $\mathbb{R}$ is obtained as completion of $\mathbb{Q}$. However, $\mathbb{Q}$ is not the only set which is dense in $\mathbb{R}$. $\mathbb{Q} \backslash \mathbb{Z}$ is also a dense subset of $\mathbb{R}$. I am wondering if it makes sense to talk of the "smallest" dense subset of $\mathbb{R}$. To phrase what I am looking for precisely and what I mean by smallest, I am looking for a dense set $A$ of $\mathbb{R}$ such that if $B$ is a proper subset of $A$ then $B$ is not dense in $\mathbb{R}$. I am able to "see" that the set $A$, I am looking for doesn't exist since any open interval consists of infinite rationals. But I am unable to precisely argue out to myself and convince why $A$ doesn't exist. Could some one throw more light on this? Which way is up? (electric outlet) PostgreSQL crash when connection failed Error log is:  016-02-21 21:22:34 GET DETAIL:  Connection matched pg_hba.conf line 83: "host    all             all             ::1/128                 md5" .... .... 2016-02-21 21:22:37 GET DETAIL:  Connection matched pg_hba.conf line 83: "host    all             all             ::1/128                 md5" 2016-02-21 21:22:37 GET FATAL:  password authentication failed for user "postgres" 2016-02-21 21:22:37 GET DETAIL:  Connection matched pg_hba.conf line 83: "host    all             all             ::1/128                 md5" 2016-02-21 21:22:37 GET LOG:  CreateProcess call failed: A blocking operation was interrupted by a call to WSACancelBlockingCall.       (error code 299) 2016-02-21 21:22:37 GET LOG:  could not fork new process for connection: No error 2016-02-21 21:22:37 GET LOG:  incomplete startup packet 2016-02-21 21:22:38 GET FATAL:  password authentication failed for user "postgres" 2016-02-21 21:22:38 GET DETAIL:  Connection matched pg_hba.conf line 83: "host    all             all             ::1/128                 md5" 2016-02-21 21:22:42 GET FATAL:  password authentication failed for user "postgres" 2016-02-21 21:22:42 GET DETAIL:  Connection matched pg_hba.conf line 83: "host    all             all             ::1/128                 md5" 2016-02-21 21:24:26 GET LOG:  could not receive data from client: An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full. 2016-02-21 21:24:26 GET LOG:  incomplete startup packet 2016-02-21 21:24:29 GET FATAL:  password authentication failed for user "postgres" 2016-02-21 21:24:45 GET PANIC:  could not write to log file 000000010000000100000041 at offset 4259840, length 8192: Invalid argument 2016-02-21 21:24:45 GET STATEMENT:  COMMIT 2016-02-21 21:24:53 GET LOG:  server process (PID 470944) was terminated by exception 0xC0000409 2016-02-21 21:24:53 GET DETAIL:  Failed process was running: COMMIT 2016-02-21 21:24:53 GET HINT:  See C include file "ntstatus.h" for a description of the hexadecimal value. 2016-02-21 21:24:53 GET LOG:  terminating any other active server processes   Can anyone help to solve the problem? I spent many hours but didn't find a solution.   Postgres version 9.4 Operating System: Windows  postgresql.conf is:  listen_addresses = '*' port = 5432  max_connections = 100 shared_buffers = 128MB   dynamic_shared_memory_type = windows   pg_hba.conf is:  # IPv4 local connections: host    all             all             127.0.0.1/32            md5 host    all             all             0.0.0.0/0               md5 Iterating each character in a string using Python In C++, I can iterate over an std::string like this:  std::string str = "Hello World!";  for (int i = 0; i &lt; str.length(); ++i) {     std::cout &lt;&lt; str[i] &lt;&lt; std::endl; }   How do I iterate over a string in Python?