I am parsing user input as an "int", but how do I handle invalid inputs?
What's the main difference between int.Parse() and Convert.ToInt32
Frequent Write to Non-volatile Memory I am designing a device that automatically adjusts it's physical position as temperature changes. If the device it shut off or power is disconnected the device needs to remember it's last temperature and position. I have the ability to store these values in EEPROM but the problem is the position and temperature could be changing very rapidly. If I were to write the temp and pos to EEPROM after every time they changed that would (1) slow down the firmware a bit, and (2) likely kill the EEPROM after a year or two. So as I see it my options are as follows...  1) use a capacitor/battery to keep the device powered for a short time after power is lost so that I can write the values to EEPROM at that time only. I don't like this because the board is kinda power hungry and this would require a big cap. And I don't have a ton of free space. And I don't want the added cost of a battery and battery holder / or a big cap.  2) use F-RAM instead of EEPROM so that I can write to it trillions of times without wearing it out. I don't like this option because FRAM is quite a bit more expensive than EEPROM and this is for a production product (not just one).  3) Only write the position and temperature every 5 minutes or so. That way I always have a fairly recent position/temp recorded but I am not writing every second so my program is not slowed down and the EEPROM won't die as fast. This seems like my best option.  Does anyone else have any suggestions that I'm not thinking of? As I found solutions on making site-to-site VPN between Azure and AWS using a software VPN server, I'm asking myself if it's possible to connect the VPN gateways (Azure VNET / AWS VPC) directly.  Is there a limitation that forbids it ? Why do wet objects become darker? Update 02/02/2019 I appreciate all the responses and help but unfortunately i must have not seen the emails stating there were responses! I am now looking into a NEST thermostat and was curious if they too, use the same connections. Lastly, looking for a quick recommendation on which WiFi Compatible therms are preferred by the memebers that respond! Thanks again your knowledge is highly appreciated! Bob  I Purchased the Honeywell WiFi Prog Thermostat to replace my Round Digital Honeywell Thermostat. I have separate Heating and Cooling (Heating is a Weil McLain Boiler for Hot water baseboard and Hot water(no tank) and Cooling is a separate unit that was added later.)  Wires:  RC Cool R Heat W Heat Y Cool G Cool   3 wires from AC unit and 2 from Heater.  If I were to go the separate transformer route to power the thermostat, where would I land the 2 wires?  C and ??? During U-substitution, is the $du$ that we use as the infinitesimal in $\int f(u) \ du$ changing size? I am familiar and comfortable with the following definition of an integral (defined as the the Riemann Sum where n approaches infinity).    I have circled in red two terms to emphasize a concept that I was taught: the $\frac{b-a}{n}$ term effectively becomes the $dx$ term. This intuitively makes sense to me.   Additionally, I am familiar with the following statement (as expressed here: )    However, I have boxed in red something that I find rather confusing when trying to interpret it through the understanding that $\frac{b-a}{n}$ sorta kinda equals $dx$...  Specifically, the $du$ value appears to be changing throughout the interval $[ g(a), g(b)]$. To reframe this in the "Riemann Sum" version,we would have something like: $\text{ "value that varies depending on where you are"} * \frac{g(b)-g(a)}{n}$  This is very confusing to me...because, if this is the correct interpretation, I'm not quite certain I understand why this is allowed. Autokey (autokey-qt) freezes and won't insert text Derivation of the formula for Ordinary Least Squares Linear Regression How do I convince gdal2tiles to output pngs with transparency? Ubuntu gets stuck in a login loop I am currently working to design a flash virtual tour, but I know little about how the photographs are taken.  Ideally I'd like to be able to take a set of 6 shots from a single focal point, and be able to align them seamlessly into a cube form. The other solution is to take a special fisheye image, and stretch it dynamically in flash.  I've seen examples of both as virtual tours, and ones formatted as a rotating cube are more responsive and have a higher image quality. The airbus and Cruden Homes are definitely in the cube format, I'm not entirely certain which format the New York VT uses:        I have a set of questions, the first is the most important, the others may become separate questions if I don't get an answer here:   How are those photos taken? Is there a specific mount that can be used? How long does it take to set up? How much post-processing is necessary on the images? How can one prove that $\lim_{n \to \infty}a^{1/n}=1$ for every $a>0$? How to pass the password to su/sudo/ssh without overriding the TTY? I want to make a persistent live Ubuntu USB drive with more than 4GB of storage.   I know there is an option of installing directly on the drive but I don't want to do this as it will restrict the drive from working on different computers.   One option is to make an additional partition with extra space but if I do this how can I get newly installed software to be stored on this partition? Adding meta values to permalink I have publications and I want to simply add year and month to the permalink. Currently the year and month of publication is added to the post as a meta value. I've set up publications as a custom post type and created taxonomy for the specific title of the publication. I would like the permalink to be:  publications/publication-title/year-published/month-published/name-of-post  I simply want to add the meta values for the publication year and month to the permalink.   So far, I've been able to pull the year and month published and add it to the url but unfortunately I keep getting a 404 when I try to access posts. I think I'm taking a wrong turn with one of my steps below ...  Any help would be appreciated.  These are the steps I did in the following order:   Since I was adding publication-year and publication-month to the url, I was reading that I had to make WordPress aware of these custom querystring variables. I added the following functions to register these custom variables:  function pubyear_register_rewrite_tag() {       add_rewrite_tag( '%pubyear%', '([0-9]{4})');   }    add_action( 'init', 'pubyear_register_rewrite_tag');  function pubmonth_register_rewrite_tag() {      add_rewrite_tag( '%pubmonth%', '([0-9]{2}');   }    add_action( 'init', 'pubmonth_register_rewrite_tag');    2) Added the year and month to the permalink structure:  add_filter('post_type_link', 'pub_term_permalink', 10, 4);  function pub_term_permalink($permalink, $post, $leavename, $sample) {     if ( false !== strpos( $permalink, '%publication-title%/%pubyear%/%pubmonth%' ) ) {       //get the publication-title      $publicationtype = get_the_terms( $post-&gt;ID, 'publication-type' );       //get the year of the publication      $pubyear = date('Y', get_post_meta($post-&gt;ID, 'pub_date', true));       //get the month of the publication      $pubmonth = date('m', get_post_meta($post-&gt;ID, 'pub_date', true));       $rewritecode = array(          '%publication-type%',          '%pubyear%',          '%pubmonth%',          $leavename? '' : '%postname%',      );       $rewritereplace = array(          array_pop($publicationtype)-&gt;slug,          $pubyear,          $pubmonth,          $post-&gt;post_name      );       $permalink = str_replace($rewritecode, $rewritereplace, $permalink);       }     return $permalink; }   3) Add rewrite rules:  function pub_add_rewrite_rules() {       add_rewrite_rule(  '^([^/]*)/([0-9]{4})/([0-9]{2})/([^/]+)?', 'publications/index.php?pagename=$matches[3]', 'top' );   }    add_action( 'init', 'pub_add_rewrite_rules' );   4) Made sure the custom post type is registered and includes this rewrite array:  'rewrite' =&gt; array     (             'slug' =&gt; 'publications/%publication-type%/%pubyear%/%pubmonth%',     'with_front' =&gt; false          ), I am from a physics background and my mathematics is not very good, so pardon my insolence with the question.  Editing based on the comments : We know that $\pi$ in decimal (i.e. base 10) is transcendental. Is it possible to have a radix base in which $\pi$ can be rational in that base ?  PS : My question is in general for any transcendental number. Cartoon with a young unicorn and a demon Let $A \times \emptyset = \{(x,y)| x\in A, y \in \emptyset \}$. We know there is no element in $\emptyset$. But how does it follow that $A \times \emptyset = \emptyset $? Solution check: Let $f_n$ be fibonacci numbers. Prove: $\sum_{k=0}^{n-1} \binom{n+k}{2k+1} = f_{2n-1}$ and $\sum_{k=0}^n \binom{n+k}{2k} = f_{2n}$ In his 1984 paper , Paul Holland raised one of the most fundamental questions in statistics:     What can a statistical model say about   causation?   This led to his motto:     NO CAUSATION WITHOUT MANIPULATION   which emphasized the importance of restrictions around experiments that consider causation.  Andrew Gelman makes :     "To find out what happens when you change something, it is necessary to change it."...There are things you learn from perturbing a system that you'll never find out from any amount of passive observation.   His ideas are summarized in .  What considerations should be made when making a causal inference from a statistical model? Package for drawing RDF graphs Is there some package to draw nice RDF graphs, such as the one below (taken from )?  Can such a graph (with the same style) be produced in TikZ?