edit: the linked one doesn't solve this particular case, since in my case there is a nested type.  Lets imagine the situation is like this:  //foo.hpp //include guards  template &lt;typename T&gt; class foo {     class bar; };   The code for bar is too big, so I'd like (not really me, but it doesn't matter) to another file.   So, the current situation is this:  //foo.hpp #include &lt;bar.hpp&gt; //include guards  template &lt;typename T&gt; class foo {      class bar; };  //bar.hpp #include &lt;foo.hpp&gt; //include guards      template &lt;typename T&gt; class foo::bar {     //... }   This is certainly circular dependency. But the thing is that compiler (clang and gcc) accepts it.   Should I fix it or there is nothing to fix? If it is an error, how should I fix it? Should I just dump everything into one file and call it a day?  In reality, that bar is an iterator, which I wouldn't want to make standalone.  There are include guards there, so I guess that is what prevents it from being included many times, but still the circular dependency makes me worried.
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; }
Is kryptonite made of the element krypton? How can I set the value of auto property backing fields in a struct constructor? Given a struct like this:  public struct SomeStruct {     public SomeStruct(String stringProperty, Int32 intProperty)     {         this.StringProperty = stringProperty;         this.IntProperty = intProperty;     }      public String StringProperty { get; set; }     public Int32 IntProperty { get; set; } }   Of course, a compiler error is generated that reads The 'this' object cannot be used before all of its fields are assigned to.  Is there a way to assign values to the backing fields or the properties themselves, or do I have to implement properties the old-fashioned way with my own explicit backing fields? How to force the user to download a file, not to view it? Temporary locks on answers not showing lock duration Tested on Stack Overflow, Stack Overflow Meta and Pets.  Questions  Temporary locks on questions are showing the duration (mod only).  Stack Overflow.   Meta Stack Overflow.   Pets.   Answers  On answers they are not and there's no way to find the lock duration when we use timeline tools to examine the post.  Pets.   Stack Overflow.   Meta Stack Overflow.   Is this something that hasn't been implemented or is it a bug?  If it hasn't been implemented can we please have it implemented? 403 error after upgrading to apache2.4 The problem:  Assume $f: \mathbb{R} \rightarrow \mathbb{R}$ satisfies $|f(t) - f(x)| \leq |t - x|^2$ for all $t, x$. Prove $f$ is constant.  I believe I have some intuition about why this is the case; i.e. if $t$ and $x$ are very close, ($|t - x| = \epsilon$), then $\sqrt{\epsilon}$ will converge to 0, so $|f(t) - f(x)|$ will also converge to zero if you keep taking $t$ and $x$ closer and closer to each other. However, how do I formalize this argument? Thanks. Nexus 7 is stuck in reboot loop after full discharge I have a few day old Nexus 7 tablet, unrooted, bootloader still locked, and otherwise in factory condition. This morning, it ran its charge out. When I plugged in it, this happens:   Google Logo appears. Nexus Logo appears. Lock screen which shows charging: 0%. White screen, device powers off. Repeat.   What is happening? Thanks! How do I select an object in the 3D viewport? I am trying to select the cube that in the middle of the scene. How can I select it? All I see is a crosshair appearing everywhere I click. Is this a bug? What hinge is this? Bit of a newbie to DIY here.  We've moved in to a house that came with a summer house but the double doors were a bit wonky/wouldn't open easily without breaking in the door. I need to get 4 new hinges for the doors but I'm not sure where I can find these ones. I've looked online on UK sites such as Screwfix but as I'm not sure of the particular name I'm not having much luck.  I've attached a drawing (sorry it's the best I can do as my camera isn't working). My Paint skills aren't the best, it's actually a cylinder shape and half of it spins/moves (this is what is broken/doesn't move anymore so it breaks in to the door).    Cheers, Jack In the , the icon color for the various sites seems* incorrect: Whenever I select a main site, the icon is greyed out, and when ever I select the corresponding meta site, the icon is colored. My initial instinct was to think that the colors of the main/meta sites following the &quot;Switch sites:&quot; prompt should be switched. (Actually, it seems like it's just a UI thing. See the edit below.)  *Edit: Actually, the colors are technically not incorrect, since (as Jeremy Banks has pointed out) the icon shows &quot;the other&quot; site of the main/meta pair, and clicking on it is for switching to the respective other site. See the comment thread for some UI improvement ideas. What is the English equivalent of gatasan? No more updates for Google Chrome 32-bit I am using Google Chrome 48.0 32-bit. Today when I launched Google Chrome, I got this message:    This computer will soon stop receiving Google Chrome updates because this Linux system will no longer be supported   I thought Ubuntu 14.04 is supported for five years, what's exactly happening here?  And on 64-bit Ubuntu, I get an error from Update Manager and apt-get update:  Failed to fetch http://dl.google.com/linux/chrome/deb/dists/stable/Release  Unable to find expected entry 'main/binary-i386/Packages' in Release file (Wrong sources.list entry or malformed file)   Some index files failed to download.   They have been ignored, or old ones used instead. /A problem from the 2012 MIT Integration Bee is $$ \int_0^1\frac{x^7-1}{\log(x)}\mathrm dx $$ The answer is $\log(8)$. Wolfram Alpha gives an indefinite form in terms of the logarithmic integral function, but times out doing the computation. Is there a way to do it by hand? Suppress "In:" biblatex How do I suppress the "In: " before the journaltitle? Like so:     In: Journal of Applied Physics A children's book series about a farm that grows massive food There was a series of illustrated children's books that I was introduced to as a child in the late 1980's early 1990's.  The main character was a farmer - I can't remember the name, but I think it was Mc or Mac something. He bought his farm from a sleazy character who was trying to cheat him. The farmland was originally some kind of swampy land, but this industrious character (and his family) discovered that the land would grow plants to a massive size - radishes the size of basketballs, etc.  There were some pretty fantastic stories and adventure that the character would get into, such as one winter the weather got so cold that the wind (not the air) outside froze. They went out and cut it up and stored it in the icebox and would thaw out some of the cold breeze later in the hot summer.  The sleazy character made a constant appearance, trying to swindle this family out of the farm.  My Google-Fu seems to fail me at every turn. Do you know what this series is? How to render world position pass Claim: if $f$ is differentiable at $x = x_0$ then $f$ is continuous at $x = x_0$.   Please, see if I made some mistake in the proof below. I mention some theorems in the proof:   The condition to $f(x)$ be continuous at $x=x_0$ is $\lim\limits_{x\to x_0} f(x)=f(x_0)$.  (1) If $f(x)$ is differentiable at $x-x_0$, then $f'(x)=\lim\limits_{x\to x_0} \dfrac{f(x)-f(x_0)}{x-x_0}$ exists and the function is defined at $x=x_0$.   (2) Therefore, by the Limit Linearity Theorem, $\lim\limits_{x\to x_0} f(x)$ exists and we'll show it is equals $f(x_0)$.   (3) We'll do this by the Precise Limit Definion: given $ \epsilon&gt;0, \exists\delta|0&lt;|x-x_0|&lt;\delta$, then $0&lt;|f(x)-f(x_0)|&lt;\epsilon$. As this limit exists by (2), we can make $f(x)$ as close to  $f(x_0)$ as one wishes, therefore $\lim\limits_{x\to x_0} f(x)=f(x_0)$, what satisfies the condition for $f(x)$ be differentiable at  $x=x_0$. The end. How to achieve this 3D "Card" effect How do I create this type of effect with an image? I'm wondering how to get the thick edges and the tilted look. Is there an online tool that will convert a flat image to look like this? How to extract BibTeX entries (as DOI, abstract, etc.) I want to automate personal reading notes generation, I'd like to be able to automatically extract a field's content from a BibTeX entry (other than year or author).  E.g. given a BibTeX entry  @article{einstein05,    author={Albert Einstein},    title={Zur Elektrodynamik bewegter K{\"o}rper},    abstract={Interesting article, which claims that time is relative.},    journal={Annalen der Physik und Chemie},    volume={17},    year={1905},    pages={891--921} }   I want to have a macro in my TeX file (e.g. \citeabstract) that will return the string Interesting article, which claims that time is relative. (the same for DOI, etc.)  I've found the \printfield command that might help me, but I'm not smart enough to know how to use it.  I don't know if it has any influence on the answer, but I'm using BibLaTeX+BibTeX. The FAQ says that Community Wiki works:     by transferring ownership of the post   from the original author to the   community. They make the post easier   to edit and maintain by a wider group   of users, but they do not contribute   to any user's reputation.   But using the new edit suggestion system, everyone can edit. It's no longer true that community wiki makes a post easier to edit.  Does community wiki still serve a function?    What are good examples of community wiki mode doing what it's supposed to do?