I have a class A as mentioned below:-  class A{      int iData; };   I neither want to create member function nor inherit the above class A nor change the specifier of iData.  My doubts:-   How to access iData of an object say obj1 which is an instance of class A? How to change or manipulate the iData of an object obj1?   Note: Don't use friend.
Disclaimer Yes, I am fully aware that what I am asking about is totally stupid and that anyone who would wish to try such a thing in production code should be fired and/or shot.  I'm mainly looking to see if can be done. Now that that's out of the way, is there any way to access private class members in C++ from outside the class?  For example, is there any way to do this with pointer offsets? (Naive and otherwise non-production-ready techniques welcome) Update As noted in the comments, I asked this question because I wanted to write a blog post on over-encapsulation (and how it affects TDD).  I wanted to see if there was a way to say &quot;using private variables isn't a 100% reliable way to enforce encapsulation, even in C++.&quot;  At the end, I decided to focus more on how to solve the problem rather than why it's a problem, so I didn't feature some of the stuff brought up here as prominently as I had planned, but I still left a link. At any rate, if anyone's interested in how it came out, here it is:   (I suggest reading it before you decide that I'm crazy).
Compare two dates with JavaScript Can someone help me figure out the big-O for the recurrence relation $T(n) = T(n^{1/2}) + 1$?  I didn't think the master theorem would work since it requires $T(n) = T(n/b)$... to have $b$ as a constant. I was wondering if anyone could shed some light on a method to approach this problem? (not looking for a solution) I've got a recipe that calls for some buttermilk, but none on-hand. Is there some way I could use some common ingredient(s) as a substitute? Flagging "look at my answer pls" comments I've started to flag a few of these once I had seen one too many of them, but I'm not sure whether I'm doing the right thing.  This is an example of what I'm talking about (this comment is on the question, but sometimes on their own answers too):    Are they something that should be considered acceptable, and if not, are they bad enough to be "flaggable"? How to use the symbol \angle at the section title How to make a cycles light emisson object invisible to the camera? In my scene it is required to position the lights close to the main object like this:    How I can make the light source invisible to the camera? If we have two circles in the plane described by $(x_1, y_1, r_1)$ and $(x_2, y_2, r_2)$ we can determine if they are completely disjoint by simply:  $$(x_1 - x_2)^2 + (y_1 - y_2)^2 &lt; (r_1 + r_2)^2$$  Assume this is not the case, we now want to know if one completely overlaps the other.  (That is: if the second circles interior is a subset of the first circles interior.)  If $(x_1, y_1) = (x_2, y_2)$ than we can trivially compare radii, so lets assume their centers are distinct.  The way I have imagined is to create a parametric equation of the line that connects the two centers:  \begin{align} x_p(t) &amp;= x_1 + t(x_2 - x_1) \\ y_p(t) &amp;= y_1 + t(y_2 - y_1) \end{align}  Then we calculate the two line segments (represented as two pairs of t values) where the circles intersect this line.  One is a subset of the other if and only if the corresponding circles are subsets of each other.  Is there a simpler approach I am overlooking? Can a .NET windows application be compressed into a single .exe? Lemma vs. Theorem I've been using Spivak's book for a while now and I'd like to know what is the formal difference between a Theorem and a Lemma in mathematics, since he uses the names in his book. I'd like to know a little about the ethymology but mainly about why we choose Lemma for some findings, and Theorem for others (not personally, but mathematically, i.e. why should one classify a finding as lemma and not as theorem). It seems that Lemmas are rather minor findings that serve as a keystone to proving a Theorem, by that is as far as I can go.  NOTE: This  doesn't address my concern, so please avoid citing it as a duplicate. I have 4 time series. One of them is stationary and rest of them are not. I need to find relation between them. I will use AIC to decide lag length.   Should I use VAR or VECM to find relation between them?  Will VAR or VECM give me relation in terms of equation which can be used for forecasting?  Do I need to perform Johansen's test of cointegration?  What good would it do? I have been playing for almost 2 days, and today it is asking me to sign up again.  I have all my game saved in my google account, but I wonder if I just log in from a trainer account will I keep my progress? Drush from GitHub stopped working I have a  that has been working since it moved there.  I did a git pull this morning, and am now getting errors:     $ drush      Warning: require(/home/mpd/drush/vendor/autoload.php): failed to open   stream: No such file or directory in   /home/mpd/drush/includes/bootstrap.inc on line 1007      Fatal error: require(): Failed opening required   '/home/mpd/drush/vendor/autoload.php' (include_path='.:') in   /home/mpd/drush/includes/bootstrap.inc on line 1007   How can I fix this? Are "w/o", "w/", "b/c" common abbreviations in the US? Comparing object properties in c# This is what I've come up with as a method on a class inherited by many of my other classes. The idea is that it allows the simple comparison between properties of Objects of the same Type.  Now, this does work - but in the interest of improving the quality of my code I thought I'd throw it out for scrutiny. How can it be better/more efficient/etc.?  /// &lt;summary&gt; /// Compare property values (as strings) /// &lt;/summary&gt; /// &lt;param name="obj"&gt;&lt;/param&gt; /// &lt;returns&gt;&lt;/returns&gt; public bool PropertiesEqual(object comparisonObject) {      Type sourceType = this.GetType();     Type destinationType = comparisonObject.GetType();      if (sourceType == destinationType)     {         PropertyInfo[] sourceProperties = sourceType.GetProperties();         foreach (PropertyInfo pi in sourceProperties)         {             if ((sourceType.GetProperty(pi.Name).GetValue(this, null) == null &amp;&amp; destinationType.GetProperty(pi.Name).GetValue(comparisonObject, null) == null))             {                 // if both are null, don't try to compare  (throws exception)             }             else if (!(sourceType.GetProperty(pi.Name).GetValue(this, null).ToString() == destinationType.GetProperty(pi.Name).GetValue(comparisonObject, null).ToString()))             {                 // only need one property to be different to fail Equals.                 return false;             }         }     }     else     {         throw new ArgumentException("Comparison object must be of the same type.","comparisonObject");     }      return true; } I tried to install ffmpeg in trusty/Ubuntu 14.04 and got the following message:  $sudo apt-get install ffmpeg  Reading package lists... Done Building dependency tree        Reading state information... Done Package ffmpeg is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source  E: Package 'ffmpeg' has no installation candidate   Why isn't the package available? Correct usage of "lest" What is the difference between "till" and "until"? What is the difference between till and until?    When to use till or until? Please explain with examples. Confusion on Derived Sets and the $n$-the Derived Set I want to solve the following exercise 1.3.C. from page 27 of R. Engelking: General Topology.  For every positive integer $n$ the $n$-th derived set $A^{(n)}$ of a subset $A$ of a topological space $X$ is defined inductively by the formulas: $$  A^{(1)} = A^d \quad \textrm{and} \quad A^{(n)} = (A^{(n-1)})^d. $$ (a) Give an example of a set of real numbers that has three consecutive derived sets distinct from each other.  (b) Give an example of a set of real numbers that has infinitely many derived sets distinct from each other.   The definition is $$   A^d := \{ x \in X \mid x \in \overline{A \setminus \{ x \}} \}. $$ I am confused, cause the set $A^d$ ist closed, i.e. $\overline{A^d} = A^d$. And closed means it already contains all its limit points, so how can than $(A^d)^d$ be different from $A^d$? O-Rings vs. Washers for Garden Hoses? Methods to see if a polynomial is irreducible Given a polynomial over a field, what are the methods to see it is irreducible? Only two comes to my mind now. First is Eisenstein criterion. Another is that if a polynomial is irreducible mod p then it is irreducible. Are there any others?