I am trying to solve a  and one thing I didn't realize earlier came up: public class Kata {     private static int y(int x) =&gt; 2 * x + 1;     private static int z(int x) =&gt; 3 * x + 1;      private static int self(int x) =&gt; x;      public static int DblLinear(int n)     {         Func&lt;int, int&gt; lowerBound = self;         Func&lt;int, int&gt; upperBound = self;          int result = 1;          for (int i = 1; i &lt;= n; ++i)         {             lowerBound = (x) =&gt; y(lowerBound(x)); // [1]             upperBound = (x) =&gt; z(upperBound(x)); // [2]         }          ...     } }  My intention was to calculate y(y(y(y(... (x)))) and z(z(z(z(... (x)))) iteratively, but lowerBound and upperBound do not appear to function as actual variables; they work more like delegates here. When I run the program, a StackOverflowException is thrown. Is there any way I can accomplish this?
I met an interesting issue about C#. I have code like below.  List&lt;Func&lt;int&gt;&gt; actions = new List&lt;Func&lt;int&gt;&gt;();  int variable = 0; while (variable &lt; 5) {     actions.Add(() =&gt; variable * 2);     ++ variable; }  foreach (var act in actions) {     Console.WriteLine(act.Invoke()); }   I expect it to output 0, 2, 4, 6, 8. However, it actually outputs five 10s.  It seems that it is due to all actions referring to one captured variable. As a result, when they get invoked, they all have same output.  Is there a way to work round this limit to have each action instance have its own captured variable?
Why is $\arctan(x)=x-x^3/3+x^5/5-x^7/7+\dots$?  Can someone point me to a proof, or explain if it's a simple answer?  What I'm looking for is the point where it becomes understood that trigonometric functions and pi can be expressed as series.  A lot of the information I find when looking for that seems to point back to arctan. A formal name for "smallest" and "largest" partition Consider a set $A=\{1,2,3,4,5\}$, is there any terminology for the following partitions of $A$ ?  (1) $A=\{ \{1\},\{2\},\{3\},\{4\},\{5\} \}$  (2) $A=\{\{1,2,3,4,5\}\}$. Getting command-not-found working under zsh What is the relationship between a chi squared test and test of equal proportions? Suppose that I have three populations with four, mutually exclusive characteristics.  I take random samples from each population and construct a crosstab or frequency table for the characteristics that I am measuring.  Am I correct in saying that:   If I wanted to test whether there is any relationship between the populations and the characteristics (e.g. whether one population has a higher frequency of one of the characteristics), I should run a chi-squared test and see whether the result is significant. If the chi-squared test is significant, it only shows me that there is some relationship between the populations and characteristics, but not how they are related. Furthermore, not all of the characteristics need to be related to the population.  For example, if the different populations have significantly different distributions of characteristics A and B, but not of C and D, then the chi-squared test may still come back as significant. If I wanted to measure whether or not a specific characteristic is affected by the population, then I can run a test for equal proportions (I have seen this called a z-test, or as prop.test() in R) on just that characteristic.   In other words, is it appropriate to use the prop.test() to more accurately determine the nature of a relationship between two sets of categories when the chi-squared test says that there is a significant relationship? Probability that the sum of 6 dice rolls is even Does a photon exert a gravitational pull? I know a photon has zero rest mass, but it does have plenty of energy. Since energy and mass are equivalent does this mean that a photon (or more practically, a light beam) exerts a gravitational pull on other objects? If so, does it depend on the frequency of the photon? Hide UIToolbar UIBarButtonItems How can I make extra money with photography? I have photos in Getty Images, in Shutterstock, Imagekind and I recently added some to RedBubble, but I'm not having the expected results.  Does anyone have some history of success selling photographs or working as a photographer?  Examples of my work are available in .    Also asked by   I am an amateur who sometimes takes pictures of nature or random things. I've been told by several people that my pictures are worth money.  How can I monetize my best shots?  I don't really want to do a lot of work, editing, SEO or whatever. I'm looking for an easy way where I would just upload my pictures somewhere and let it go.  Maybe stock photos? People buying prints? I have no idea how that works...  EDIT: maybe a link to see which type of photography I do can help How do I block unwanted callers without jailbreaking? $$\lim_{n \to\infty} \frac{n!}{n^n}$$  I have a question: is it valid to use Stirling's Formula to prove convergence of the sequence? Understanding QGIS buffer tool units I  have had no luck getting the buffer tool to accept anything but degrees as units of measure.  I have found lots of stuff saying the layer needs to be reprojected and saved but it hasn't worked at all for me.   Is there a way I could create a buffer without using ftools or at least force the units to meters somehow?  As a workaround I converted meters to degrees (lat) and used that but the final product needs to be as close to reality as possible.  Things I've tried:   setting every unit option I could find to meters (where possible). setting everything to NAD83/Maryland (data is for Washington, DC) and saving it as such (as layers in ESRI shape files). reimporting the reprojected layers setting relevant layers to Google Mercator   The was tried followed by creating a buffer. Many were tried in combination. QGIS 1.7.3 Slackware64 current (qgis from SBo-13.37 repo, tried on multilib and plain 64it with same results) I am trying to design a circuit and was wondering how to design it that the 12V 800mAH NimH battery I am using will not overcharge. I have researched trickle charging and as far as I understand, a zener diode that regulates the voltage down to about 13.3-13.7V should do. I chose a 14V Zener, taking into account the .6-.7V drop.   I have heard that trickle charging is not the best for the battery, but am not sure how much more work designing a smart charger would take.  I was also thinking of using another diode to prevent flow back to the panels from the battery.         &ndash; Schematic created using  The three voltage sources on the left represent the solar cells, with the NiMH battery on the right.  I was wondering if I needed any additional components if I were to use three 5.5V solar cells in parallel outputting 40mA (16.5V total at 40mA, regulated to 13.3V by the zener) in order to prevent overcharging.  A similar question to mine was asked at  However, this dealt more with a larger lead-acid battery and used a voltage regulator with a schottky diode.   This link discusses almost my exact same question, but I was confused to the answer given which said that up to 1.45V per cell could be charged, taking my max charge voltage up to 14.5V.   Considering I am only outputting 40mA to an  800mAH battery, it seems that I may not need any more battery protection, but would love any input. Issue with regex backreference in Python What’s the rule to decide whether you add -er or whether you add -or when creating an agent noun from a verb?    Sometimes it’s -er:      read > reader hate > hater hit > hitter   But other times it’s -or:    meditate > meditator collect > collector How to create a bootable USB stick? Why can I put an electrolytic capacitor on AC? I have seen here and there schematics with electrolytic capacitors put on AC. And this sounds weird to me.  Electrolytic capacitors have a polarity, right? If we invert the polarities on DC, bad things happen. As far as I understand, AC inverts polarity every now and then (commonly 50Hz). Why can we put such capacitors on AC without damaging them?  Example:    from demonstration here: Book Recommendation for mathematical finance Does anyone know a book which covers topics on:  Brownian Motion   Martingales   Stochastic Calculus  Stochastic Differential Equations   Options pricing. Black-Scholes model  Fundamental Theorems. Interest Rates   Random Walk   Applications in Insurance   Simulations. Convergence   Simulation methods   I would like something in-depth, but at an undergraduate level. Encrypting/Decrypting a single file in Ubuntu 12.04 LTS I need to be able to encrypt/decrypt a single text file stored on my external HD in 12.04 LTS, preferably a GUI application, if any, or the command line otherwise. Thank you. How can I update to Ubuntu 21.04? Today is the release of Ubuntu 21.04 (Hirsute Hippo). And I can't update to this version. And also I selected ‘Notify me of a new Ubuntu version’ and changed it to ‘For any new version' on the Updates tab on Software &amp; Update, but it's still not working. In addition, in the terminal, I've written: sudo do-release-upgrade -c  And output was: Checking for a new Ubuntu release No new release found.  What should I do? How to correctly add a path to PATH?