C++ file including itself I have two classes that are inter-dependent. I am pretty sure, I am designing it in a wrong way but I don't know how to fix it.  So, I have a situation like following- My car class includes the truck class.  #include "stdafx.h" #include "truck.h"  using namespace std;  class car {     int wheels;     float speed;  public:     car(int wheels, int speed);     int numberOfWheels();     float speedRate();      bool isFaster(truck &amp; truck); };   and then my truck class needs to include the car class-  #include "stdafx.h" #include "car.h"  using namespace std;  class truck {     int wheels;     float speed;  public:     truck(int wheels, int speed);     int numberOfWheels();     float speedRate();      bool isFaster(car &amp; car); };   I am getting the include itself error and I know why but I can't find a way to get around that.  Can anyone please help me with it.
Resolve build errors due to circular dependency amongst classes I often find myself in a situation where I am facing multiple compilation/linker errors in a C++ project due to some bad design decisions (made by someone else :) ) which lead to circular dependencies between C++ classes in different header files (can happen also in the same file). But fortunately(?) this doesn't happen often enough for me to remember the solution to this problem for the next time it happens again.  So for the purposes of easy recall in the future I am going to post a representative problem and a solution along with it. Better solutions are of-course welcome.     A.h  class B; class A {     int _val;     B *_b; public:      A(int val)         :_val(val)     {     }      void SetB(B *b)     {         _b = b;         _b-&gt;Print(); // COMPILER ERROR: C2027: use of undefined type 'B'     }      void Print()     {         cout&lt;&lt;"Type:A val="&lt;&lt;_val&lt;&lt;endl;     } };       B.h  #include "A.h" class B {     double _val;     A* _a; public:      B(double val)         :_val(val)     {     }      void SetA(A *a)     {         _a = a;         _a-&gt;Print();     }      void Print()     {         cout&lt;&lt;"Type:B val="&lt;&lt;_val&lt;&lt;endl;     } };       main.cpp  #include "B.h" #include &lt;iostream&gt;  int main(int argc, char* argv[]) {     A a(10);     B b(3.14);     a.Print();     a.SetB(&amp;b);     b.Print();     b.SetA(&amp;a);     return 0; }
Compact space and Hausdorff space A continuous map from a compact space to a Hausdorff space is closed. Why this is true?  Help me please I want to learn why this is correct. How is offside determined in football? The offside rule on the pitch is often unclear and called suddenly. How do I know if a player is offside? How to fix "-5 No address associated with hostname error" while updating? What's a good back-up strategy for 1 desktop PC? If $x>0$, $\,x^{1/n}$ tends to $1$ as $n\to\infty$ I am looking for a proof possibly using the sandwich theorem and/or Bernoulli's inequality for proving the following statement:  If $x&gt;0$ then $x^{1/n}$ tends to $1$. Logo Pack - What should I include? What files should i put in a logo pack to give to clients? Should I put small, medium and large version of my logo as well as the vector file. Calculate $\sum_{k=1}^n (-1)^{k+1} \binom{n}{k}\frac{1}{k}$ How can I make realistic looking potions as handouts I've lost my portal home, and I am invincible. How can I leave the nether? I've gone into the Nether and seemed to have lost my portal out of it, I also can't die in lava or by mobs attacking me, I'm appear to be invincible and can't die.  This is Single Player by the way.  Why is this happening? Why does the (relativistic) mass of an object increase when its speed approaches that of light? I'm reading Nano: The Essentials by T. Pradeep and I came upon this statement in the section explaining the basics of scanning electron microscopy.     However, the equation breaks down when the electron velocity approaches the speed of light as mass increases. At such velocities, one needs to do relativistic correction to the mass so that it becomes[...]   We all know about the famous theory of relativity, but I couldn't quite grasp the "why" of its concepts yet. This might shed new light on what I already know about time slowing down for me if I move faster.  Why does the (relativistic) mass of an object increase when its speed approaches that of light? Why is posterior density proportional to prior density times likelihood function? According to Bayes' theorem, $P(y|\theta)P(\theta) = P(\theta|y)P(y)$. But according to my econometric text, it says that $P(\theta|y) \propto P(y|\theta)P(\theta)$. Why is it like this? I don't get why $P(y)$ is ignored. Can Hydrogen Fusion via CNO Cycle Occur in First Generation Stars CNO cycle requires the presence of carbon, nitrogen and oxygen to undergo hydrogen fusion. Does this mean that for first generation stars, no matter how big they are, can't undergo hydrogen fusion by CNO cycle because there is no carbon, nitrogen and oxygen present?   I can't seem to find any website which mentions this. All they say is if a star is large enough, it will undergo hydrogen fusion via CNO cycle, they don't specifically mention it having to be a second generation star. Find an element by id and replace its contents with php Can regular expressions be used to match nested patterns? Is there a deb package to install Firefox ESR? I would like to have  on my system but I would like to install it via apt-get. Is there a special package to install this?  Download link would be: Automatically turn on VPN on computer unlock Ubuntu 18.04 When I wake the laptop from the sleep I need to get the VPN state as I left it (turned on). Can't find the setting of autoconnect in VPN settings... Need some easy way to ask the system to autoconnect the VPN when the internet is available.  Edit based on comments:  Ubuntu 18.04 has no option to Always connect to VPN when using using this connection. Flows/Processes, Version Control and CI I've started using Processes and Flows and am really excited about these features -- but am still wrapping my mind about how to manage them in Version Control (which I use) and Continuous Integration (which I don't yet... but am trying to work in that direction). The underlying challenge is that each time a process or flow is edited, the metadata file is renamed to reflect its update version, e.g. MyFlow-1.flow, MyFlow-2.flow, etc. The Challenge for Version Control If each version of the flow has its own file name, this makes it more complicated to track changes to flows.  It seems like there could be two strategies here:  Rename the files to remove the version number.  I'd need a script to run through my src folder pre-commit, and remove the number so that my file name is always MyFlow.flow.  This is an annoying extra step, but makes version control simpler.  On the other hand, it probably makes deployment much harder.  Track each file in version control with its original name.  We'd need to be diligent about deleting MyFlow-1 in the commit where we add MyFlow-2 so that git would recognize this as a rename/move and show helpful diffs.  Otherwise, the whole file appears to change with every change, which makes version control rather less useful.   The Challenge for Deployment/Continuous Integration From my experiments so far, once a flow has been activated in a given environment, the metadata file can't be deployed again (either it is currently active, or has been active in the past and superseded). That means that I need to prevent my previous flow versions from being included in a deployment package (either by not tracking them at all, or by using a script to delete earlier versions).  I also need some way to determine whether the current version (in my repo) should be included in the deployment payload for a given environment or not. I could imagine a script that (1) downloads flows from the target environment, and removes *.flow files from the payload if they already exist in the target environment, but that feels complicated.  And it's even harder if I've removed the version numbers from my flow files. Are you using flows in VS or CI?  How are you managing these issues? Note:  I'm not sure whether VC and CI should be one question or two - depends on how integrated the strategy for dealing with these two challenges.  If you think these should be separate questions, comment and I'll re-post. Is a set without limit points necessarily closed? According to the definition on Rudin' Principles of Mathematicial Analysis, closed set is defined as:      $E$ is closed if every limit point of $E$ is a point of $E$.   Then I have a question: if a set has no limit point, is it necessarily closed? I think this idea doesn't contradict the definition of closed sets. Am I right?  And another question is #10 in Chap.2 of Rudin's:      Let $X$ be an infinite set. For $p\in X$ and $q\in X$, define    $d(p,q)=0$ when $p=q$. Otherwises,$d(p,q)=1$.    I have known that every set in the metric space is closed. To prove it, we can show that the complement of any set is open, which is quite trivial. My question is: how can we prove that every set is closed just by checking according to the definition of closed set, i.e. how can we show that every limit point of any arbitrary set $E$ in the metric space is a point of $E$?   Thanks in advanced! We've tried this a few times. First time we used an old ceramic container and it started sheding on the inside and ruined it. Next time we used a new metal garbage can with one of those super sized 10 gallon zip lock bags as a liner. It went rank very quickly. This could have been due to our packing though. Before we get into this again, what is you recommendation for a good container? I hate the thought of plastics but it seems it might just be the best choice as long as it's made for food storage. How to Remove URLs from Google Search Engine