I'm new to C++. I've searched around a bit but cannot find something that helps.  Very simple program, just trying to store 'Person' objects in a Vector and access those objects. My Vector, as of now, holds one object of type 'Person'. 'Person' objects have a 'name' field. I'm simply trying to display that 'name' field. But when the program runs, nothing prints to the console.   I'm still getting comfortable with Vectors and pointers, so my vector setup may be the cause. My 'getName()' function is setup correctly. Can someone please let me know if the way I'm declaring and inserting objects into my vector, as well as the vector declaration/iteration, is correct?   #include &lt;iostream&gt; #include &lt;string&gt;  #include &lt;ctime&gt; #include &lt;vector&gt; #include "Person.h"  #include "Record.h"    //addition of a user to list  void addUser(int id, int age, std::string name, std::vector&lt;Person*&gt; userList)  {     Person *newPerson = new Person(id, age, name);      userList.push_back(newPerson);   }  //deletion of a user of the list by ID  void deleteUserByID(int id, std::vector&lt;Person*&gt; userList)  {      for(int i = 0; i &lt; userList.size(); i++) {          if (userList.at(i)-&gt;getID() == id)         delete userList.at(i);      } }  //Print all user names in the list  void printUserList(std::vector&lt;Person*&gt; userList)  {     for(auto it = std::begin(v); it != std::end(v); it++)    {         std::string name = it-&gt;getName();       }   }   int main ()  {     //create vector     static std::vector&lt;Person*&gt; userList;      //add first user    addUser(626968231, 21, "Ryan", userList);       //print all users (just one so far)     printUserList(userList);       return 0;  }
What is the difference between    a parameter passed by reference a parameter passed by value?   Could you give me some examples, please?
How is effect precedence determined? I was using  and my opponent has a . I attacked Sylvanas, fearing that the Deathrattle will take control of one Hyena. I feel lucky, because it did not happen.  I want to know if there are some general rules of effect precedence.   Has Blizzard published something about this?  Are there articles teaching about precedence?   Please note, I want guidance about effect precedence in general, not just about Deathrattle. Can the Ubuntu logo be used for a commercial website? Is there an Ubuntu logo that can be used on a commercial website to indicate that Ubuntu can be installed for customers? Ranking based on binomial data (example: website conversions) Is there a reason why people can't just take the helicopter to mount Everest? Why is it that helicopters can't reach that high? How will multiple GPUs improve Cycles' rendering performance? I have an NVIDIA Titan GPU and I'm able to add another card, but I wonder whether  Blender will benefit from more than one GPUs?  Should I do it as SLI or should I just do it as an added card? I just need some help in understanding how Blender will use either SLI or a second GPU.  Note that I only use Cycles. I am fairly sure that I understand the how Monte Carlo integration works but I am not understanding the formulation of how it is used to estimate Pi.  I am going by the procedure outlined in the 5th slide of this presentation   I understand the preliminary steps.  Pi is equal to 4 times the area of a quarter of the unit circle.  And the area of the top-right quarter of the unit circle centered at (0,0) is equivalent to the integral of the curve that is the top-right quarter of the unit circle in $0&lt;x&lt;1$ and $0&lt;y&lt;1$.    What I don't understand is how this integral is  $\iint I((x^2+y^2)&lt;1)P(x,y)dxdy$  where $P(x,y)$ is uniformly distributed in the unit square around the quarter circle (i.e. it is always equal to 1 if $0&lt;x&lt;1$ and $0&lt;y&lt;1$ and 0 otherwise).  So this would mean that  $I((x^2+y^2)&lt;1)P(x,y)$ is the function that is the top-right quadrant of the unit circle at $0&lt;x&lt;1$ and $0&lt;y&lt;1$ but I do not understand how this is true since the indicator function can only be 1 or 0.  I understand that it is probably written in this way to make Monte Carlo sampling easy (i.e. it is an expectation so just sample from $P(x,y)$ and get the average of the samples applied to $I((x^2+y^2)&lt;1)$) but it just does not make intuitive sense to me why that integral represents the area under that curve.  Could someone provide an intuitive explanation of this.  Maybe show how that integral was derived in a step-by-step way?  EDIT:  I was able to gain a better understanding by relating the expectation to an area.  I will explain it here in case it helps anyone.  First start with relating Pi to the area of the top-right quadrant of the unit circle  $\pi=4\times A_{tr}$  Then we place the top-right quadrant into the unit square.  And under a uniform distribution over the unit square, the area of the circle quadrant is proportional to the probability of obtaining a sample from it.  It follows that the following equality holds  $P(x^2+y^2&lt;1)=\frac{A_{tr}}{A_{square}}$  and $A_{square}=1$ so  $P(x^2+y^2&lt;1)=A_{tr}$  And substituting into the original equation  $\pi=4\times P(x^2+y^2&lt;1)$  and it is also true that $P(x^2+y^2&lt;1)=E[I(x^2+y^2&lt;1)]$ which is equal to the original double integral.  So I understood it by relating the area to a probability then relating that probability to an expectation that is equivalent to the integral.  Let me know if I have made any mistakes. Update Manager is constantly offering me updates (e.g. security fixes, updates from PPAs).  How can I tell my Ubuntu installation to automatically download and install updates whenever they become available? Why does my front derailleur not work when it is cold? When it is warm outside my front derailleur works just fine. But when it gets colder (40F) the lever on the handle bar does not catch and I can move it without any resistance the whole way without the derailleur shifting.  Update: The wire is not moving and the shifter is a Shimano Deore.  Any idea what can cause that and how to fix it? Using Static Variables in a Custom Module I'm trying to define a static variable for use in my custom module. I want it to let me pass a number from function to function. I'm using drupal_static() but I can't get it to work. How do I do this?  This is the code I'm using to define my static variable.  $var = &amp;drupal_static(__FUNCTION__); if (!isset($var)) {   // generate contents of static variable   $var = '8'; } return $var;   I've tried putting it in a custom module.    function viewusercontact_locateuser($value, $key, &amp;$counter) {    global $user;     /**********In here***********/     if ($value['uid'] == $user-&gt;uid) {       ........    } }   I can't seem to get it to work. What am I doing wrong?  (I got my code from the following guides) What does a star-preceded property mean in CSS? How to suppress certain .bib fields (e.g. year) only for certain entry types (e.g. inproceedings) How do we control web page caching, across all browsers? Our investigations have shown us that not all browsers respect the HTTP cache directives in a uniform manner.  For security reasons we do not want certain pages in our application to be cached, ever, by the web browser. This must work for at least the following browsers:   Internet Explorer 6+ Firefox 1.5+ Safari 3+ Opera 9+ Chrome   Our requirement came from a security test. After logging out from our website you could press the back button and view cached pages. Docker ppa package for Ubuntu 19.10 Does someone knows if it exists some ppa packages source for the newest Ubuntu version 19.10 i had problem with that when i upgraded from Ubuntu 19.04 to 19.10 i didn't work? Given $(a_n)$ with $a_n \geq a_{n+1} \geq 0$ show that if $\sum \sqrt{a_n a_{n+1}} < \infty \implies \sum a_n < \infty$ Drag and drop not working inside Nautilus on Ubuntu 17.10 Disable HTTPS for a domain that shares IP with another domain that is under HTTPS I am running into a weird problem trying to disable HTTPS for one domain, but the other domain has HTTPS. They both are different websites running on a dedicated server, sharing the same IP address for the domains.  However, I have a domain that does not have a SSL certificate, but the other does. I want to disable HTTPS for the non-certified domain while leaving the other domain with HTTPS on.  I have two different separate vhosts in /etc/nginx/sites-enabled/,   domain1.org (no HTTPS)  server {      listen                      80;     server_name                 www.domain1.org domain1.org;     root                        /var/www/domain1.org;     index                       index.html index.php index.htm;      error_log                   /var/www/logs/domain1.errors.log;      [ ... ]   domain2.com (with HTTPS)  server {      listen                      443 ssl;     server_name                 domain2.com www.domain2.com;      # INCLUDE SSL CERTIFICATE     include                     sites-enabled/domain2_ssl_include;       root                        /home/domain2/www/www;     index                       index.html index.php index.htm;      [ ... ]   I've included a listener to the port 443 for domain1.org, but once I do that, I get an aborted error from Firefox saying (when accessing ):     This Connection is Untrusted      You have asked Firefox to connect securely to domain1.org, but we can't confirm that your connection is secure.   I opened the technical data, it appears that the domain1.org is using the domain2.com SSL certificate:     domain1.org uses an invalid security certificate.      The certificate is only valid for the following names:    *.domain2.com , domain2.com        (Error code: ssl_error_bad_cert_domain)   So I added this to domain1.org vhost configuration:  server {      server_name                 domain1.org www.domain1.org;      listen                      443 ssl;      rewrite ^ http://domain1.org permanent; }   Which still gets me prompted with the Firefox error.  Now... when I access to , I get an 400 error from nginx saying this:     400 Bad Request      The plain HTTP request was sent to HTTPS port   I am not entirely sure what to do, disabling the https with ssl off; has no effect. How can I actually disable HTTPS for domain1.org but not for domain2.com?  I am using Ubuntu 12.04 running nginx 1.2.6. I am designing a hobby project that will run on a battery so I am trying to reduce power consumption. The SoC I am using has the ability to go into a deep sleep mode where it consumes very little power, and then can be interrupted by a falling edge on a pin.  I want to generate a high-low-high pulse when the state of a reed switch changes in either direction. I have been reading a lot and it seems that a one-shot monostable circuit can be built from a couple of transistors and an RC circuit to generate an output pulse when an edge is detected. I understand how that works. However, I can't figure out the best way to also pulse on the opposite edge.  One thought, was to just combine two one-shots that are configured to trigger on rising and falling edges respectively, and use the transistors at the output to pull the common pull-up low (kind of like a NOR gate).  Since I am a hobbyist, I am mostly using passive components. What is the "real" way of doing this in a low-power configuration using logic devices?  Edit: I figure I should mention something about the timing requirements. Normally the reed switch will be either open or closed for many seconds at minimum before changing states.  Edit: Here is an example of the circuit I was using for detecting only the falling edge:    And here is the ~20ms pulse it was producing for ~200ms button press simulating the reed switch (Channel 1 is Vbe for T1 and Channel 2 is measured at RST): How to avoid duplicating assigned materials when duplicating a mesh? how can I prevent Blender 2.8 from duplicating materials every time (?) I duplicate a mesh. Combinef in R HTS package- constrain to keep forecasts positive? When using the combinef function from Rob Hyndman's very useful  for forecasting hierarchical and grouped time series, there does not seem to be a way to constrain the optimally combined forecasts to be positive- the starting forecasts can be positive, but can go negative through the reconciliation process.  The forecast.gts and forecast.hts functions have an argument to keep forecasts positive, but this does not seem to be an option when using combinef by itself with forecasts obtained by other methods.  Am I correct in this understanding, and if so is there a decent workaround? SSH Permission denied (publickey) I am trying to connect to a Linode (running Ubuntu 12.04 LTS) from my local machine (also running Ubuntu 12.04 LTS)  I have created a private and public key on my local machine and copied my public key to my Linode's authorized_keys file.  However, whenever I try to ssh to my Linode I get the error message Permission denied (publickey).    It's not a problem with how ssh is set up on my Linode because I can ssh to it from my Windows machine using key authentication.    In my .ssh directory on my local Ubuntu machine, I have my id_rsa and id_rsa.pub files.  Do I need to create an authorized_keys file on my local machine?    EDIT:  This is what I get when I run ssh -vvv -i id_rsa [youruser]@[yourLinode]:  debug3: authmethod_lookup publickey debug3: remaining preferred: keyboard-interactive,password debug3: authmethod_is_enabled publickey debug1: Next authentication method: publickey debug1: Offering RSA public key: id_rsa debug3: send_pubkey_test debug2: we sent a publickey packet, wait for reply debug1: Authentications that can continue: publickey debug2: we did not send a packet, disable method debug1: No more authentication methods to try. Permission denied (publickey).