I have the following program in which I have 2 classes, namely Class A and Class B in which each class has instance of another class declared as a private member.  FYI, for one class I'm using dynamic allocation (pointer instance) and in the other class I'm using automatic allocation (normal instance).  (Program.h)   class A; class B;  class A {     A();     ~A();     public:     void InitA();     void funcA;     private:     B b; // ERROR! on code compilation: "A::b uses undefined class B" }  class B {     B();     ~B();     public:     void InitB();     void funcB;     private:     A *a; } &lt;/code&gt;   (Program.cpp)   B::B() : a(new A())     {     }     B::~B()      {          SAFE_DELETE (a);      }     B::InitB()     {         a-&gt;funcA(); // works beautifully!     }       A::A()      {     }     A::~A()      {       }     A::InitA()     {         b.funcB(); // DUE TO ERROR, code never compiles so I don't see this.     }   ERROR: "A::b uses undefined class B"  Now, I've deliberately not declared a pointer instance of class B in class A, which I believe should not be the reason for this error. This error is probably because I'm not doing forward declaration properly.
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. ?
Phrase to give a non-detailed answer/explanation What expression could I use when giving non-detailed answers/explanations about how something works? Let's say I want to explain how a printer works without getting into too much detail, Would it be OK to say:   "At a very superficial level, a printer ...." "At a very high level, a printer ..."   I feel like there are more appropriate expressions to begin such type of sentence. Any help would be greatly appreciated. Question I use pgfplots with the ultra thick option ans without explicitly giving the domain for the y-axis. It seems that in this case, some part of my graph is &quot;eaten&quot; by the margin: see the picture below to understand what I mean. Is there a way to avoid this? Code \documentclass{article} \usepackage{pgfplots} \begin{document}  \begin{tikzpicture}  \pgfplotsset{every axis/.append style={                     axis x line=middle,    % put the x axis in the middle                     axis y line=middle,    % put the y axis in the middle                     axis line style={-&gt;},  % arrows on the axis                     xlabel={$x$},          % default put x on x-axis                     ylabel={$y$},          % default put y on y-axis                     grid = major                     }}  \begin{axis}[xmin=-5,xmax=5] \addplot[orange,smooth, ultra thick] {sin(deg(x))} ;                  \end{axis} \end{tikzpicture}  \end{document} Starting digits of $2^n$. Krull dimension of this local ring I want to know what the Krull dimension of this ring $\mathbb C[x,y]_p/(y^2-x^7,y^5-x^3)$ is, where $p\neq (0,0)$. I know the dimension of it in the origin point, but I don't know other cases. Let $X_1, X_2, \ldots X_n$ be random variables with mean $\mu$ and variance $\sigma^2$. We define the sample mean $\bar{X} = \sum_{i = 1}^n X_i$.  I am having trouble understanding why the variance of $\bar{X}$ is $\sigma^2 / n$.  Here is what I worked out thus far:  $$\begin{gather} \sigma_\bar{X}^2 = E((\bar{X} - \mu)^2) = E(\bar{X}^2 - 2\bar{X}\mu + \mu^2) = E(\bar{X}^2) - 2\mu E(\bar{X}) + E(\mu^2) = E(\bar{X}^2) - \mu. \end{gather}$$  However, I'm not sure what to do with the $E(\bar{X}^2)$. Testing a UPS by unplugging it from the wall At an Not For Profit/Charity I volunteer for occasionally we were very fortunate to be provided (donated) with a brand new 3Kva APC UPS. This is total overkill for our modest server rack (four mid-range servers and a switch!) but hey, I'll take what I can get!  Pressing the TEST button on the front indicates that yes, the UPS does work. Brilliant. But it only tests it for about 15 seconds.  My question is - will I degrade the UPS by unplugging it from the wall to see how long it will last? My plan is to unplug it, and wait until the battery meter reaches its last LED before plugging it back in, so that I know about how long I will have in the event of a power outage.  Do people do this on a regular basis? I'm guessing no (Lead Acid is very different to Li-Ion batteries)... but what kind of harm would it do if this were to happen (on purpose) every 6 months? How do I list all available shell builtin commands? We know bash supports number of  buitin commands  like:  $ type type cd help command type is a shell builtin cd is a shell builtin help is a shell builtin command is a shell builtin   I want to get list of all available shell builtin commands. How do I do that by command-line? I am doing , and am having a few problems with function notation. I understand the form f(x).  What does the form f: x ↦ y mean? Could you also give one or two examples?  And, if possible, state your source. Thank you. Let $M_n(\mathbb{F})$ be the set of all $n\times n$ with entries in $\mathbb{F}$ and let $\exp:M_n(\mathbb{C})\to M_n(\mathbb{C})$ be defined by  $$ \exp(A)=\sum_{k=0}^{\infty}\frac{A^k}{k!},$$ for all $A\in M_n(\mathbb{C}).$  I want to prove that $\exp$ is a surjective map from $M_n(\mathbb{C})$ to $GL(n,\mathbb{C})=\left\{A\in M_n(\mathbb{C})\,\middle| \det(A)\neq0\right\}$, how do I go about that?   I mean saying that $\exp:M_n(\mathbb{R})\to GL(n,\mathbb{R})$ is an analogous to saying $\exp:\mathbb{R}\to \mathbb{R}_{&gt;0}$ and this is also pretty intuitive, since, in analogy with the case of numbers, $A^0=I\;\forall A$, so $\exp(0)=I+0+\frac{0^2}{2!}+\dots=I$, so even for $A=0$ we get $\det\left(\exp(A)\right)\neq0$ and so because of the first term we can never get a zero determinant. But I have no idea how to prove the subjectiveness.  Thanks in advance. How to show $\sum_{k=0}^{n}\binom{n+k}{k}\frac{1}{2^k}=2^{n}$ How does one show that $$\sum_{k=0}^{n}\binom{n+k}{k}\frac{1}{2^k}=2^{n}$$ for each nonnegative integer $n$?  I tried using the  but I guess I am applying it incorrectly. With the snake oil technique we have $$F(x)= \sum_{n=0}^{\infty}\left\{\sum_{k=0}^{n}\binom{n+k}{k}\frac{1}{2^k}\right\}x^{n}.$$ I think I have to interchage the summation and do something. But I am not quite comfortable in interchanging the summation. Like after interchaging the summation will $$F(x)=\sum_{k=0}^{n}\sum_{n=0}^{\infty}\binom{n+k}{k}\frac{1}{2^k}x^{n}?$$ Even if I continue with this I am unable to get the correct answer.  How does one prove this using the Snake oil technique?  A combinatorial proof is also welcome, as are other kinds of proofs. Let's say we have two models trained. And let's say we are looking for good accuracy.  The first has an accuracy of 100% on training set and 84% on test set. Clearly over-fitted. The second has an accuracy of 83% on training set and 83% on test set.   On the one hand, model #1 is over-fitted but on the other hand it still yields better performance on an unseen test set than the good general model in #2.   Which model would you choose to use in production? The First or the Second and why? Can a plan "age" reach zero? How can I serialize an object to JSON without properties that are null? To communicate with a REST interface on a private system, I need to send a JSON message from a trigger. I have a message object that has some fields, lists and a child object:  public class MerchantConfig {  public class MIDConfig {     public String mid;     public String currencyCode;     public String cardTemplateName;     public String paymentPanelRestriction;     public List&lt;String&gt; restrictedCountries;      public String paymentPanelRestrictionForCountries; }  public String merchantName; public String sopgTemplateName; public Integer dispositionTimeWindowInMinutes; public List&lt;String&gt; features; public Boolean activateImmediately; public List&lt;MIDConfig&gt; midConfiguration; }   I can serialize it to JSON using the built-in serializer:  String body = JSON.serializePretty([MerchantConfig instance]);   The result:  {   "sopgTemplateName" : null,   "midConfiguration" : [ {     "restrictionCountries" : [ "DE", "AT" ],     "paymentPanelRestrictionForCountries" : "MANDATORY",     "paymentPanelRestriction" : "OPTIONAL",     "mid" : "1000000001",     "currencyCode" : "EUR",     "cardTemplateName" : null   }, {     "restrictionCountries" : [ ],     "paymentPanelRestrictionForCountries" : "",     "paymentPanelRestriction" : "OPTIONAL",     "mid" : "1000000002",     "currencyCode" : "USD",     "cardTemplateName" : null   }, {     "restrictionCountries" : [ ],     "paymentPanelRestrictionForCountries" : "",     "paymentPanelRestriction" : "PROHIBITED",     "mid" : "1000000003",     "currencyCode" : "AUD",     "cardTemplateName" : null   } ],   "merchantName" : "Test Merchant",   "features" : [ XYZ ],   "dispositionTimeWindowInMinutes" : 10,   "activateImmediately" : true }   How can I serialize this object so that all properties that are null don't show up in the JSON string?   In this example, "sopgTemplateName" and all "cardTemplateName" properties are null and should not appear in the JSON string. The empty list "restrictionCountries" should still appear as an empty list, though. How long was Luke Skywalker's training with Yoda? I have a Visual Studio 2008 solution with two projects (a Word-Template project and a VB.Net console application for testing).  Both projects reference a database project which opens a connection to an MS-Access 2007 database file and have references to System.Data.OleDb.  In the database project I have a function which retrieves a data table as follows   private class AdminDatabase    ' stores the connection string which is set in the New() method    dim strAdminConnection as string     public sub New()    ...    adminName = dlgopen.FileName    conAdminDB = New OleDbConnection    conAdminDB.ConnectionString = "Data Source='" + adminName + "';" + _        "Provider=Microsoft.ACE.OLEDB.12.0"     ' store the connection string in strAdminConnection    strAdminConnection = conAdminDB.ConnectionString.ToString()    My.Settings.SetUserOverride("AdminConnectionString", strAdminConnection)    ...    End Sub     ' retrieves data from the database    Public Function getDataTable(ByVal sqlStatement As String) As DataTable         Dim ds As New DataSet         Dim dt As New DataTable         Dim da As New OleDbDataAdapter         Dim localCon As New OleDbConnection           localCon.ConnectionString = strAdminConnection          Using localCon             Dim command As OleDbCommand = localCon.CreateCommand()             command.CommandText = sqlStatement             localCon.Open()             da.SelectCommand = command             da.Fill(dt)             getDataTable = dt         End Using      End Function End Class   When I call this function from my Word 2007 Template project everything works fine; no errors. But when I run it from the console application it throws the following exception     ex = {"The 'Microsoft.ACE.OLEDB.12.0'   provider is not registered on the   local machine."}   Both projects have the same reference and the console application did work when I first wrote it (a while ago) but now it has stopped work.  I must be missing something but I don't know what.  Any ideas? Explicitly accept change for PPA 'Label' When I run apt-get update on my ubuntu 17.10 I receive the following error:  E: Repository 'http://ppa.launchpad.net/ondrej/php/ubuntu artful InRelease' changed its 'Label' value from '***** The main PPA for PHP (5.6, 7.0, 7.1) with many PECL extensions *****' to '***** The main PPA for supported PHP versions with many PECL extensions *****' N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details."   The man page doesn't really point to a solution.  My question is, how do I explicitly accept the change? Related to Meta Super User efforts:  and Meta Server Fault efforts:  We already auto-remove negatively voted unanswered old questions automatically after 30 days, network wide, with no human intervention required. I was thinking we might extend that to remove old, unanswered zero score questions... based on the following criteria:  fewer than (question age in days * 1.5) views 0 score or lower, or 1 score or lower if the original author is deleted no answers 1 comment or fewer asked more than 1 year ago (thus based on creation date, not last activity date, so , or a user editing it, does not give a doomed question 365 more days of zombie &quot;life&quot;)  See the results of this query on:  (10509) |  (787) |  (650) This query has been refined based on the comments, and this is the final version that will roll out tonight. Every site in the network (except metas) will automatically delete old questions that meet this criteria from this point forward. Describe the set of points on the complex plane... Java inner class and static nested class What is the main difference between an inner class and a static nested class in Java? Does design / implementation play a role in choosing one of these? Modify a shape and have modifications apply to clones Is there any any "Symmetry Modifier" option in illustrator?   Let's say I want to create a head that is totally symmetric. I created one half then mirrored it to get another half. Flipped the other half, aligned them and joined them together with Pathfinder→Unite option.   Now I modified some portion of the right half outline. But how can I get that same modification to be updated on the left option? I thought it would happen automatically.