There's a class below  class A {     public:         string&amp; getStr()         {           // Do a lot of work to get str           return str         }         const string&amp; getStr() const; };   Can I call the first function within the second function? I want to do this, because the second function have a lot of code in common with the first one. It cannot be like this:  const string&amp; A::getStr() const {     // Wrong     A temp;     return temp.getStr(); }   because there is added a new temp and the inner status between *this and temp is different (*this != temp).  Can it be called like I described?
Let's say I have the following class X where I want to return access to an internal member:  class Z {     // details };  class X {     std::vector&lt;Z&gt; vecZ;  public:     Z&amp; Z(size_t index)     {         // massive amounts of code for validating index          Z&amp; ret = vecZ[index];          // even more code for determining that the Z instance         // at index is *exactly* the right sort of Z (a process         // which involves calculating leap years in which         // religious holidays fall on Tuesdays for         // the next thousand years or so)          return ret;     }     const Z&amp; Z(size_t index) const     {         // identical to non-const X::Z(), except printed in         // a lighter shade of gray since         // we're running low on toner by this point     } };   The two member functions X::Z() and X::Z() const have identical code inside the braces.  This is duplicate code and can cause maintenance problems for long functions with complex logic.    Is there a way to avoid this code duplication?
When is a CDATA section necessary within a script tag? Are CDATA tags ever necessary in script tags and if so when?  In other words, when and where is this:  &lt;script type="text/javascript"&gt; //&lt;![CDATA[ ...code... //]]&gt; &lt;/script&gt;   preferable to this:  &lt;script type="text/javascript"&gt; ...code... &lt;/script&gt; Limit points of the set $\{\frac {\varphi(n) }n : n\in \mathbb{N}\}$ The RSA signature operation is basically the same as encrypting with the private key.  In particular, both operations use the same kind of keys.  Is it safe to use the same RSA keypair both for encryption / decryption and for signing / verification? UMVUE of $e^{-\lambda}$ from poisson distribution Let $X_1,\ldots,X_n \sim$ Poisson$(\lambda)$. I wish to find UMVUE of $e^{-\lambda}$. Here $\overline{X}_n$ is complete and sufficient for $\lambda$ (hence for $e^{-\lambda}$??). Define $Y_i=1$ if $X_i=0,$ $Y_i=0$ otherwise. Clearly (I checked!) each $Y_i$ and hence $\overline{Y}_n$ is unbiased for $e^{-\lambda}$. Then I should be able to use the Lehmann Scheffe theorem to deduce the UMVUE. The estimator I get looks like $$\frac{1}{n} E\left\{\#X_i:X_i=0 \mid \sum_{i=1}^n X_i\right\}$$ whereas the correct answer is $$\left(\frac{n-1}{n}\right)^{\sum_{i=1}^n X_i}$$ I'd appreciate if anyone lets me know where I'm going wrong and guides me into the right path. Thank you. Posting a Solution of a problem that You faced to Help Newbies About an Hour ago, I faced a problem and tried different ways to solve it.  At last I was going to post my Question on Stack Overflow, but the last trick which came in my mind worked, and the problem got resolved.    Now, if I want to post that problem on Stack Overflow with the solution which worked for me, for the purpose to help other newbies to get their answer if they face the same problem, what is the proper way of posting such solution to a problem? Why the number of indexed pages decreased for a "site:" search Recently I created a website with hundreds of thousands of unique pages. A week ago, Google had indexed about 250,000 pages. It has now decreased to 90k URLs (using a site:domain.com query).   What should I do to have Google index all the pages again? Why did all these pages get de-indexed from Google?. When I'm using rendered viewport it initially takes a while before rendering starts, but once it does, I can freely move around and rendering a new view happens almost instantaneously. When on the other hand I'm rendering a movie, for each frame Blender takes a significant amount of time before rendering even starts, usually doing the following:  Synchronizing object, Updating images, Updating meshes, Updating Scene BVH, Packing BVH,  Why does it do this? And is it possible to disable this to increase movie rendering speed? So I really like the tag cloud on Climate Deal. Is there anyway we could get something similar to this on StackOverflow? I don't necessarily mean that we should replace the interesting/ignored tags with this but something like this on the front page would be nice. This is all in iTerm2 on OS X.  I used to have  export TERM='xterm-256color'   in my .bashrc. This meant Vim in tmux did use 256 colors.  And once I added  set -g xterm-keys on   then keyboard shortcuts with modifiers worked fine in Vim. Namely: shift+left/right that I mapped to switch Vim tabs, ctrl+up/down that I mapped to move ("bubble") lines, and shift+left/right which worked out of the box to jump by word in the command-line mode (e.g. when typing something like :e foo bar baz).  However, this setup had the problem that the Vim background color only shows behind text, as mentioned .  So I removed  export TERM='xterm-256color'   from my .bashrc and instead put this in my .tmux.conf:  set -g default-terminal "screen-256color"   That fixed the Vim background color, but broke the keyboard shortcuts - they do unexpected things (move the cursor, delete text) instead.  By using ctrl+v to insert the verbatim output from the key combinations (as described ), I was able to work around it:  map [1;5A &lt;C-Up&gt; map [1;5B &lt;C-Down&gt; map [1;2D &lt;S-Left&gt; map [1;2C &lt;S-Right&gt; cmap [1;2D &lt;S-Left&gt; cmap [1;2C &lt;S-Right&gt;   This makes the shortcuts work, but it doesn't feel like the right solution. Could anyone tell me what's happening here and how to fix it? How do you round a number to two decimal places in C#? I'm looking for a 90s (or early 2000s) scifi (mini)series where a boy and old man chase a black guy in metal suit. I think they were going through different dimensions. I remember part of it, but I don't think I ever saw how it ended. I remember my friend telling me there was a twist at the end. I think they were trying to find something and he was always ahead of them.. How do I enable error reporting in PHP? How do I display a decimal value to 2 decimal places? Can I use the "Scan" button with SANE? I have an HP Deskjet with integrated scanner. It has a "Scan" button on its top, but this button does not interact with the xsane program on my Debian machine: To get a page scanned, I have to initiate the scanning process from xsane.  Is there a setting (or a scan program) that allows me to press the scan button and cause the program to scan a page? Is there a more accurate way to create a Javascript timer than setTimeout? Something that has always bugged me is how unpredictable the setTimeout() method in Javascript is.  In my experience, the timer is horribly inaccurate in a lot of situations. By inaccurate, I mean the actual delay time seems to vary by 250-500ms more or less. Although this isn't a huge amount of time, when using it to hide/show UI elements the time can be visibly noticeable.  Are there any tricks that can be done to ensure that setTimeout() performs accurately (without resorting to an external API) or is this a lost cause? I want to put some symbols in green color with lstdefinelanguage in latex, but it seems that symbols are not recognized.  The symbols I need to be colored are =, > and &lt;. Is it possible? How can I do this?  The main file:  \documentclass{article}   \usepackage{graphicx,color} \usepackage{booktabs} \usepackage{listings}   \lstdefinelanguage{NeoIDL}{   sensitive = true,   keywords = [1]{module, resource, enum, annotation, for, import, entity, path,   @get, @post, @put, @delete, require, ensure, otherwise, call},   %ndkeywords={int, \char{}  },   %ndkeywordstyle=\color{blue}\bfseries,   morekeywords=[2]{&gt;, &lt;, ==},   keywordstyle=[2]\color{green},   numbers=left,   numberstyle=\scriptsize,   stepnumber=1,   numbersep=8pt,   showstringspaces=false,   breaklines=true,   frame=top,   comment=[l]{//},   morecomment=[s]{/*}{*/},   commentstyle=\color{purple}\ttfamily,   stringstyle=\color{red}\ttfamily,   morestring=[b]',   morestring=[b]"   }  \begin{document}  \begin{figure}[htb] \begin{small} \lstinputlisting[language=NeoIDL,firstnumber=1]{store_pos_servico.neo} \end{small} \caption{Service 1} \end{figure}   \end{document}   The file to be formatted:  module store {    (...)     resource order  {      path = "/order/{id}";       @post   int postOrder (Order order)     require (call store.getOrder(id) == "NotFound"),     otherwise "InvalidPrecondition"    }; } What happens to global variables declared in a DLL? Let's say I write a DLL in C++, and declare a global object of a class with a non-trivial destructor.  Will the destructor be called when the DLL is unloaded? I remember reading it while in middle school in English in the United States, so the latest it would have come out was 1998. I don't remember if it was all one author, or even the same universe. These are the stories I remember:   A man finds a way to create a medicine that prevents radiation poisoning (or possibly makes someone fireproof... it's a little confused in my head) and learns that part of the problem is finding a market for it. I vividly remember the inventor telling someone to not "let the doorknob ream you" as it slams shut. A bout of graffiti artists leads to the city buying anti-graffiti paint that dissolves any other paint put on top of it. After learning the futility of trying to paint over it, the protagonist consults with a friend and learns that the anti-graffiti paint will eat away at the paint above it at a steady rate, and will even eat successive layers of the anti-graffiti paint. he uses this property to engineer an animation involving a harlequin thumbing this nose at the officials even as they try to wash it away. Some guys (I want to say a gang) go to a clinic for an illegal nanotech transformation. The viewpoint character gets turned into a woman while a friend gets turned into a dog. After roaming about in their new forms, they return to find the clinic being raided, meaning there's no one to turn them back. I think I remember something bad happening to the one transformed into a dog where the transformation continued, erasing his human thought patterns. There was also a scene where the viewpoint character submitted to being sexually assaulted by his former friends as if it was simply to be expected given his form.   I don't remember if the first or the second story was the actual first story of the collection... I want to say that those are the order that they showed up as in the book. Extruding surface while keeping the shape here is the picture of what I would like to get(example nr. 2). I need the edge frame to be same in width and length. Also the extrusion is on surface (without depth) I tried extruding region, but it did not give me the result I wanted.   I know I could just adjust the scale and do it manually, but that would be eyeballing without achievign accuracy. I would like to know if it is possible to extrude or inset while keeping the shape (even edge space) How to format a USB or external drive? Using Ubuntu 11.10, how do I format an external or USB drive? I don't find an option to 'format' when I right click. In the new version, the drives don't come up on the desktop, but instead come on the Launcher.