c++ - incomplete type / forward declaration This question has been asked many times but usually it could be easily solved by changing order of classes. In my case it may be not.  class GCRefLink; class GCRef;  class GCRefLink {   friend class GCRef; private:   GCRef * ref;   GCRefLink(GCRef * ref) : ref(ref) {} public:   ~GCRefLink(){this-&gt;ref-&gt;unlink();} };  class GCRef {  friend class GCRefLink; private:   int refCount;    GCRef() : refCount(0) {}   virtual ~GCRef(){}    void unlink(){--this-&gt;refCount;if(this-&gt;refCount==0) delete this;} public:   GCRefLink link(){++this-&gt;refCount;return GCRefLink(this);} };   When I change order of classes I'm getting the same error just about second class. It's meant to be reference class to inherit by managed, undeleteable classes, I know there's already such a thing in stl but as it's university project I need to implement my own.  I'm getting invalid use of incomplete type 'class GCRef' or invalid use of incomplete type 'class GCRefLink' errors
When can I use a forward declaration? I am looking for the definition of when I am allowed to do forward declaration of a class in another class's header file:  Am I allowed to do it for a base class, for a class held as a member, for a class passed to member function by reference, etc. ?
Delete with Join in MySQL Here is the script to create my tables:   CREATE TABLE clients (    client_i INT(11),    PRIMARY KEY (client_id) ); CREATE TABLE projects (    project_id INT(11) UNSIGNED,    client_id INT(11) UNSIGNED,    PRIMARY KEY (project_id) ); CREATE TABLE posts (    post_id INT(11) UNSIGNED,    project_id INT(11) UNSIGNED,    PRIMARY KEY (post_id) );   In my PHP code, when deleting a client, I want to delete all projects posts:  DELETE  FROM posts INNER JOIN projects ON projects.project_id = posts.project_id WHERE projects.client_id = :client_id;   The posts table does not have a foreign key client_id, only project_id. I want to delete the posts in projects that have the passed client_id.  This is not working right now because no posts are deleted. Using the variable "name" doesn't work with a JS object What does ;; do in sh? Question about probable fixed use of "what do you do?" and "how do you do?" Do we always have to use the question how do you do? fixed in greeting people? Can we ask it in other situations rather than greetings? Like when we are wondering how someone is doing the given task.  Do we always have to use the question what do you do? for asking about sojeone's job? Can we use it sonetimes instead of ** what are you doing?** I'd like to show that the class of all limit ordinals, LIM, is cofinal in the class of all ordinals ON.  I thought that I could do this by contradiction and assume that it wasn't cofinal in ON. Then there is an $\alpha \in$ ON such that for all $\beta \in $ LIM: $\beta &lt; \alpha$, i.e. $\beta \in \alpha$ and hence LIM $\subset \alpha$.  This means that LIM is a set so we can consider $\bigcup$ LIM. Then we have $\beta &lt; \bigcup$ LIM for all $\beta \in$ LIM by definition of $\bigcup$ LIM. So LIM $\subseteq \bigcup$ LIM.   $\bigcup$ LIM is either a limit or a successor ordinal.  If it is a limit ordinal then $\bigcup$ LIM $\in$ LIM and by transitivity of ON, $\bigcup$ LIM $\subseteq$ LIM, so $LIM = \bigcup$ LIM in this case which would mean that $\bigcup$ LIM $\in$ LIM $= \bigcup$ LIM which would be a contradiction because sets cannot contain themselves. Hence $\bigcup$ LIM cannot be a limit ordinal.  If $\bigcup$ LIM is a successor ordinal then $\bigcup$ LIM = $\beta \cup \{&#160;\beta \}$ for some $\beta \in $ ON.  Now I'm not sure how to proceed from here. I'm also not sure about whether I'm on the right track with this proof because I think there should be a shorter way  to prove this.  Thanks for your help. Wordpress speed slow after .5 million single image post via wp-cli Creating a unique alphanumeric 10-character string I'm looking to create a simple short-lived reservation system, and I'd like to generate confirmation numbers that are   unique random-looking alphanumeric short-ish, at least much shorter than 32 character-long strings returned by sha1   I'm only looking to have ~500 reservations, so I don't imagine high likelyhood of collissions.  One idea I had is generate an sha1 hash based on a date-time stamp and username, then truncating it to its first 10 characters.  Would something like that be reliably unique enough for the purposes of processing ~500 reservations? Are the rationals a closed or open set in $\mathbb{R}$? C program to convert Fahrenheit to Celsius always prints zero Getting two pictures to appear on the same page Number of ways to pair off $2n$ points such that no chords intersect For $n \geq 0$ evenly distribute $2n$ points on the circumference of a circle, and label these point cyclically with the numbers $1, 2 . . . , 2n$ Let $h_n$ be the number of ways in which these $2n$ points can be paired off as $n$ chords where no two chords intersect  I want to find a recursive formula for $h_n$.  First I find $h_1,h_2,h_3$ to see the recursive nature.    $h_1 = 1$ as their only one way to make one chord  $h_2 = 2$   Now $\require{enclose}      \enclose{horizontalstrike}{h_3=4}h_3=5$ ((1,4), (2,3), (5,6) case is missed in image)  I found a wikipedia link    and it is very close to my problem, But in this link you don't need to pair off $n$ chords.  But I can't get to come up with a recursive formula for my question.  If I would to guess I would say $h_n = 2 \times h_{n-1}$, And would this means that $h_4 = 8$ ?? On Stack Exchange, users may gain a certain level of reputation.  What does reputation do? How can a user gain or lose reputation?   See also   in the Help Center  - Maximum amount of votes a user can use in a day and reputation requirements to vote.  - How to get an exact overview of the actions that got you your reputation.  - A full list of all privileges granted at each reputation level on all sites. Remove category & tag base from WordPress url - without a plugin is the SO chat open source? Get lists of dependent picklist options in Apex I have a pair of dependent picklists.  In Apex code, how can I determine what options are valid in the dependent field for each option in the controlling field?  I've tried using getPicklistValues(), but there doesn't seem to be any way of getting dependency information.  Example  Controlling_Field__c  Fruit, Vegetable, Dairy  Dependent_Field__c  (Fruit): Apple, Banana, Pear  (Vegetable): Tomato, Egglant, Lettuce  (Dairy): Milk, Cheese, Yogurt  What I'm Looking For  (In pseudocode, something like:)  controllingOptions = dependentfield.getPicklistValues(); for (option : controllingOptions) {     dependentOptions = dependentfield.getPicklistValuesFor(option);     do_something_with_it(); } I read it as a paperback book somewhere in the mid-90s, I think. The protagonist lived in an apartment building. He's out on the balcony when a birdlike (but humanoid) alien swooped down and attacked him. The presence of the aliens was commonly known and was a known danger. He kills it with his watering can and is rewarded by either the aliens or the humans for it with money. Other than that, all I remember was that the chapters were started with an internet-like news report which I think chronicled things getting worse and more violent. One of the updates involved the bombing of a bridge with the casualties raised by having two slow-moving trucks moving side by side obstructing traffic and ensuring a full bridge.  The internet system was pretty ubiquitous as I recall. I think that he looked up his watering can shortly after the incident with the aliens, but decided to keep this one, even if it leaks a bit. I want to say that it was by Piers Anthony, but none of the book titles look familiar. I think the cover I had showed the man being attacked by the bird-man, which looked kind of like the illustrations on the cover of The Stand. I'm trying to solve this problem from Hatcher 3.3.24.  Let $M$ be a closed connected 3-manifold, and write $H_1(M, \mathbb{Z})$ as $\mathbb{Z^r} \oplus T$ where $T$ is torsion. Show that $H_2(M, \mathbb{Z})$ is $\mathbb{Z^r}$ if $M$ is orientable or $\mathbb{Z^{r-1}} \oplus \mathbb{Z_2}$ if $M$ is not orientable. In particular $r \geq 1$ if $M$ is not orientable. Using exercise 6 construct examples showing there are no other restrictions on the homology groups of closed 3-manifolds. (In the nonorientable case consider the manifold $N$ obtained from $S^2 \times I$ by identifying $S^2 \times \{0\}$ with $S^2 \times \{1\}$ via a reflection of $S^2$.)  I think I've solved the first part, here's my proof:   First note the following theorem: If $M$ is a closed connected and orientable n-manifold then $H_n(M, \mathbb{Z}) = \mathbb{Z}$ and $Tors(H_{n-1}(M, \mathbb{Z})) = 0$. If nonorientable, then $H_n(M, \mathbb{Z}) = 0$, $Tors(H_{n-1}(M, \mathbb{Z})) = \mathbb{Z_2}$.  Now note by Poincare duality and UCT we have that $H_2(M) \cong H^1(M) \cong \mathbb{Z^r} \oplus T_0 \cong \mathbb{Z^r}$.   In the nonorientable case consider the exact sequence:  $0 \longrightarrow H_2(M) \longrightarrow H_1(M) \longrightarrow H_0(M) \longrightarrow 0$  But we know $H_1(M) = \mathbb{Z^r} \oplus Z_2$ from the earlier theorem and $H_0(M) = \mathbb{Z}$.   Therefore $H_2(M) \cong ker(\mathbb{Z^r} \oplus Z_2 \rightarrow \mathbb{Z}) \cong \mathbb{Z^{r-1}} \oplus \mathbb{Z_2}$.   For the rest of the question I'm quite lost. How can Cooper communicate with his daughter before the time he went to space? Overlapping matches in Regex I'd like to be able to search for questions by multiple tags; for example "questions tagged 'nhibernate' and 'web-services'".  I can get close by searching for "nhibernate web-services" but the results tend to be a few questions that relate to both terms--but much more largely just questions that relate to one or the other.