Show $a_{n+1}=\sqrt{2+a_n},a_1=\sqrt2$ is monotone increasing and bounded by $2$; what is the limit? Let  the sequence $\{a_n\}$ be defined as $a_1 = \sqrt 2$ and $a_{n+1} = \sqrt {2+a_n}$. Show that $a_n \le$ 2 for all $n$, $a_n$ is monotone increasing, and find the limit of $a_n$.  I've been working on this problem all night and every approach I've tried has ended in failure. I keep trying to start by saying that $a_n&gt;2$ and showing a contradiction but have yet to conclude my proof.
$\sqrt{c+\sqrt{c+\sqrt{c+\cdots}}}$, or the limit of the sequence $x_{n+1} = \sqrt{c+x_n}$ (Fitzpatrick Advanced Calculus 2e, Sec. 2.4 #12)  For $c \gt 0$, consider the quadratic equation $x^2 - x - c = 0, x &gt; 0$.  Define the sequence $\{x_n\}$ recursively by fixing $|x_1| \lt c$ and then, if $n$ is an index for which $x_n$ has been defined, defining  $$x_{n+1} = \sqrt{c+x_n}$$  Prove that the sequence $\{x_n\}$ converges monotonically to the solution of the above equation.  Note: The answers below might assume $x_1 \gt 0$, but they still work, as we have $x_3 \gt 0$.    This is being repurposed in an effort to cut down on duplicates, see here: .  and here: .
notify-osd replaced with dunst after switching back to unity from i3wm I was testing i3wm (sudo apt-get install i3 is what I ran, and chose i3 from the log in screen) on my machine and after a while, decided to switch back to Unity. Upon switching back, I noticed that notifications came in the top right corner similar to i3 even though I was using Unity.  I'd really like it to use the normal Unity notification bubbles instead.  I looked into it and turns out instead of notify-osd, dunst is being used.   I tried using sudo vim /usr/share/dbus-1/services/org.freedesktop.Notifications.service and editing the file, but it has the correct line (i.e. Exec=/usr/lib/x86_64-linux-gnu/notify-osd) as expected.  I also tried unity-tweak-tool --reset-unity but that didn't do anything.  Is it possible for me to return to the normal notifications? Any help would be greatly appreciated. Thanks :)  Edit: I was able to return to the normal notifications by removing i3wm itself (and dunst). What I am actually asking is: is it possible to change to normal notifications while still keeping i3 and dunst on my system?  Note: This is NOT a duplicate of . The solution there is to remove dunst and I would like to keep dunst and have that work when I choose i3, and have notify-osd work when I choose Unity. I've read a number of the helpful Q&amp;As on photons that mention the mass/mass-less issue. Do I understand correctly that the idea of mass-less (a rest mass of 0) may be just a convention to make the equations work?  From a layperson's view, it's difficult to understand how a particle of light (photon) can be mass-less. A physical object (everyday world-large or quantum-small) must have a mass. Yet, if my understanding is correct, the mass of a moving object/particle increases in proportion to its speed/velocity...so that at the speed of light, its mass would be infinite. A photon travels at the speed of light, but it obviously doesn't have infinite mass, right? Can someone formulate a practical explanation that can be understood by middle-school to high school kids? Much thanks for the help.    Wow--your answers to my original Q below clear up much of my confusion. I now have the daunting task of going over these nuggets and working up an equation-less (hopefully) explanation of the mass-less photon for non-physicist types.  Yes, from a layperson's view, it does seem remarkable that an existing piece of matter-- which has to be made of physical substance--could have zero mass at rest (though a photon is never at rest). It would be almost understandable if a piece of matter made of nothing had zero mass, but that  seems to be an oxymoron, and "nothing" would equate to nonexistent, right?  In case you might find it interesting: I'm working on a writing project that posits we inhabit a universe that consists of matter (physical stuff) only, and that the NON-physical (aka supernatural) does not (and cannot) exist. For instance, if a purported supernatural phenomenon is found to actually exist, then by definition, its existence is proof that it is mundane/natural. All it would take to disprove this premise is reliable proof that ONE supernatural event has occurred. Despite thousands of such claims, that's never yet happened.  Who else better than physicists to confirm my premise? However, I do wish the TV physicists would explain the terms they throw about, some of which mislead/confuse their lay viewers. Case in point: "The universe is made up of matter and energy" (without properly defining the term "energy" as a property of matter).  The result is that laypersons are left with the impression that energy must therefore be something apart from or independent of matter (ie, nonphysical). Their use of the term "pure energy" without specifying exactly what that means adds to the confusion. (Thanks to your replies on this forum, I now understand that "pure energy" refers to photon particles.) However, "psychics" and other charlatans take advantage of such confusion by hijacking terms like energy (as in "psychic energy"), frequencies, vibrations, etc to give perceived scientific legitimacy to their claims that a supernatural spirit world, etc., exists. As you may realize, the majority of people in the US (per 2009 Harris Poll) and around the world believe in the existence of nonphysical/supernatural stuff such as ghosts and spirits.  My purpose is to give laypersons the information they need to distinguish what's real from what's not.  Thanks so much for help...And, PLEASE, add any further comments you think might be helpful/insightful to better inform laypersons. byte[] to hex string How do I convert a byte[] to a string? Every time I attempt it, I get      System.Byte[]    instead of the value.  Also, how do I get the value in Hex instead of a decimal? execute command on a defined range of directories Is it possible to 'partition' a directory listing - say in to blocks of some number, to perform different actions on each 'range'?  For example, lets say I have the following directories inside another folder:  $ ls test abc/ def/ hij/ klm/ nop/ qrs/ tuv/ wxy/ zzz/   And I want to perform some action on the first 3 directories, another on the second 3, and so on.  My thought was that perhaps a loop across numbers would work, based on the output of something like ls | nl (but before anyone mentions it, I know parsing ls is a no-no!)  This obviously doesn't work, but illustrates my point I hope:  for dir in `ls | nl`;  do     do-something-with ${dir{1..3}} # Where $dir has taken on some numerical value linked to the folder)     do-something-with ${dir{4..6}}  # And so on...     do-something-with ${dir{n-3..n}}  done   The folders I intend to actually do this on, can be worked on in any order (i.e. the final splits can be totally arbitrary), but they have no logical naming consistency - by which I mean they can't be organised sensibly alphabetically or numerically based on any key within the directory name themselves. How to prove that center of $GL_n(\mathbb R)$ is scalar matrices?  Again what can you say about the center of set of all upper triangular matrices and center of set of all diagonal matrices. When a divination wizard character uses their Portent ability:     Starting at 2nd level when you choose this school, glimpses of the   future begin to press in on your awareness. When you finish a long   rest, roll two d20s and record the numbers rolled. You can replace any   attack roll, saving throw, or ability check made by you or a creature   that you can see with one of these foretelling rolls. You must choose   to do so before the roll, and you can replace a roll in this way only   once per turn.   ... to replace a roll, can a player with the Lucky Feat:     Whenever you make an attack roll. an ability check, or a saving throw,   you can spend one luck point to roll an additional d20. You can choose   to spend one of your luck points after you roll the die, but before   the outcome is determined. You choose which of the d20s is used for   the attack roll, ability check, or saving throw.      You can also spend one luck point when an attack roll is made against   you. Roll a d20, and then choose whether the attack uses the attackers   roll or yours.      If more than one creature spends a luck point to influence the outcome   of a roll, the points cancel each other out; no additional dice are   rolled.   ... use the Luck Roll to replace the result? Or does the Portent trump all rolls and simply give you the final outcome?  This question spun off from  on .  Some relevant points:  .  Mike Mearls tends to believe that luck can triumph in some cases, but admits this is , and further seems to conflate the question with .  I would suggest reading the linked discussion before formulating an answer. There's some good thought there. I know that the movies were written to be a stand alone universe on their own, but what key elements were missing in the movies that were vital in the books that viewers are missing out on? TZInfo::DataSourceNotFound error starting Rails v4.1.0 server on Windows jQuery .ready in a dynamically inserted iframe We are using jQuery  to dynamically display an iframe when someone clicks on a picture.  In this iframe, we are using  a javascript library to display multiple pictures.  The problem seems to be that $(document).ready in the iframe seems to be fired too soon and the iframe content isn't even loaded yet, so galleria code is not applied properly on the DOM elements.  $(document).ready seems to use the iframe parent ready state to decide if the iframe is ready.  If we extract the function called by document ready in a separate function and call it after a timeout of 100&nbsp;ms. It works, but we can't take the chance in production with a slow computer.  $(document).ready(function() { setTimeout(ApplyGalleria, 100); });   My question: which jQuery event should we bind to to be able to execute our code when the dynamic iframe is ready and not just it's a parent? What is the difference between logistic regression and Fractional response regression? As far as I know, the difference between logistic model and fractional response model (frm) is that the dependent variable (Y) in which frm is [0,1], but logistic is {0, 1}. Further, frm uses the quasi-likelihood estimator to determine its parameters. Normally, we can use glm to obtain the logistic models by glm(y ~ x1+x2, data = dat, family = binomial(logit)). For frm, we change family = binomial(logit) to family = quasibinomial(logit). I noticed we can also use family = binomial(logit) to obtain frm's parameter since it gives the same estimated values. See the following example library(foreign) mydata &lt;- read.dta(&quot;k401.dta&quot;)   glm.bin &lt;- glm(prate ~ mrate + age + sole + totemp,                 data = mydata, family = binomial('logit')) summary(glm.bin)  return,  Call: glm(formula = prate ~ mrate + age + sole + totemp,      family = binomial(&quot;logit&quot;),      data = mydata)  Deviance Residuals:      Min       1Q   Median       3Q      Max   -3.1214  -0.1979   0.2059   0.4486   0.9146    Coefficients:               Estimate Std. Error z value Pr(&gt;|z|)     (Intercept)  1.074e+00  8.869e-02  12.110  &lt; 2e-16 *** mrate        5.734e-01  9.011e-02   6.364 1.97e-10 *** age          3.089e-02  5.832e-03   5.297 1.17e-07 *** sole         3.636e-01  9.491e-02   3.831 0.000128 *** totemp      -5.780e-06  2.207e-06  -2.619 0.008814 **  --- Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1  (Dispersion parameter for binomial family taken to be 1)      Null deviance: 1166.6  on 4733  degrees of freedom Residual deviance: 1023.7  on 4729  degrees of freedom AIC: 1997.6  Number of Fisher Scoring iterations: 6  And for family = quasibinomial('logit'), glm.quasi &lt;- glm(prate ~ mrate + age + sole + totemp,   data = mydata ,family = quasibinomial('logit')) summary(glm.quasi)  return,  Call: glm(formula = prate ~ mrate + age + sole + totemp,      family = quasibinomial(&quot;logit&quot;),      data = mydata)  Deviance Residuals:      Min       1Q   Median       3Q      Max   -3.1214  -0.1979   0.2059   0.4486   0.9146    Coefficients:               Estimate Std. Error t value Pr(&gt;|t|)     (Intercept)  1.074e+00  4.788e-02  22.435  &lt; 2e-16 *** mrate        5.734e-01  4.864e-02  11.789  &lt; 2e-16 *** age          3.089e-02  3.148e-03   9.814  &lt; 2e-16 *** sole         3.636e-01  5.123e-02   7.097 1.46e-12 *** totemp      -5.780e-06  1.191e-06  -4.852 1.26e-06 *** --- Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1  (Dispersion parameter for quasibinomial family taken to be 0.2913876)      Null deviance: 1166.6  on 4733  degrees of freedom Residual deviance: 1023.7  on 4729  degrees of freedom AIC: NA  Number of Fisher Scoring iterations: 6  The estimated Beta from both `family` are the same, but the difference is the SE values.  However, to obtain the correct SE, we have to use `library(sandwich)` as in this [post][1].  Now, my questions:  1. What is the difference between these two codes? 2. Is frm about to obtain robust SE?  If my understanding is not correct, please give some suggestions.      [1]: https://stackoverflow.com/questions/37584715/fractional-response-regression-in-r Transformation of Random Variable $Y = X^2$ I'm learning probability, specifically transformations of random variables, and need help to understand the solution to the following exercise:      Consider the continuous random variable $X$ with probability density function $$f(x) = \begin{cases} \frac{1}{3}x^2 \quad  -1 \leq x \leq 2, \\ 0 \quad \quad \text{elsewhere}. \end{cases}$$ Find the cumulative distribution function of the random variable $Y = X^2$.   The author gives the following solution:   For $0 \leq y \leq 1: F_Y(y) = P(Y \leq y) = P(X^2 \leq y) \stackrel{?}{=} P(-\sqrt y \leq X \leq \sqrt y) = \int_{-\sqrt y}^{\sqrt y}\frac{1}{3}x^2\, dx = \frac{2}{9}y\sqrt y.$  For $1 \leq y \leq 4: F_Y(y) = P(Y \leq y) = P(X^2 \leq y) \stackrel{?}{=} P(-1 \leq X \leq \sqrt y) = \int_{-1}^{\sqrt y}\frac{1}{3}x^2\, dx = \frac{1}{9} + \frac{1}{9}y\sqrt y.$  For $y &gt; 4: F_{Y}(y) = 1.$    Previous to this exercise, I've managed to follow the solutions of two similar (obviously simpler) problems for a strictly increasing and strictly decreasing function of $X$, respectively. However in this problem, I don't understand the computations being done, specifically:    How does the three intervals $0 \leq y \leq 1$, $1 \leq y \leq 4$ and $y &gt; 4$ are determined? In the two previous problems I've encountered, we only considered one interval which was identical to the interval where $f(x)$ was non-zero. In the case where $0 \leq y \leq 1$, why does $P(X^2 \leq y) = P(-\sqrt y \leq X \leq \sqrt y)$ and not $P(X \leq \sqrt y)$? I have put question marks above the equalities that I don't understand.   I think I have not understand the theory well enough. I'm looking for an answer that will make me understand the solution to this problem and possibly make the theory clearer. Text won't appear in interface? There is one problem, it seems that text won't appear on my program. The three images show the errors and also my laptop specs (I believe I just have very small amount of laptop power that makes Blender glitch).  Everything else works fine (zooming, panning, rotating, etc.) and the buttons are still there and do what they're supposed to do, but the text just won't appear.  Might anybody know how to fix this?        The drive update didn't help either. I know a way around it though, does anybody know a page which shows screenshots of more or less the buttons on blender I had posted a  last week about customizing a ToolValidator class and got some very good answers.  In working with the proposed solutions, I have created a custom module that performs queries on a db, and will be called by both the ToolValidator class (to provide values for the drop-down lists) and later in the geoprocessing script (to get other parameters based on items selected in drop-down lists).  However, I can't seem to actually call the custom module in the ToolValidator class.  I have been trying to append to path with no luck.  When I try to apply these changes to the script, I get a runtime error:  [Errno 9] Bad file descriptor.  If I comment out import line, no errors.  sys.path.append('my_custom_module_directory') import my_custom_module   Many of you may be asking why don't I just implement a custom tool with ArcObjects.  The reason is that my end users don't have the privleges necessary to register ANY dlls on their computer.  UPDATE:  This was happening to me in ArcGIS 10.  Interestingly enough, I was initially appending to the path inside of the initialiazeParameters function of the ToolValidator class.  If I do the append outside (i.e., on top of) of the ToolValidator class, everything works as expected.  sys.path.append('C:/Working/SomeFolder') import somescript --------&gt;THIS WORKS  class ToolValidator:   """Class for validating a tool's parameter values and controlling   the behavior of the tool's dialog."""    def __init__(self):     """Setup arcpy and the list of tool parameters."""     import arcpy     sys.path.append('C:/Working/SomeFolder')     import somescript -------&gt; THIS DOESNT WORK     self.params = arcpy.GetParameterInfo()   UPDATE 2:  I think I found the true cause of my problem.  In the code snippets in this post, I have been appending what appear to be real paths (ex C:/Working/SomeFolder) to the sys.path.  In my actual ToolValidator class, I was constructing a relative path using os.path.dirname(__file__) +"\my_special_folder...".  I was anticipating that os.path.dirname(__file__) would return the path of the toolbox, since that contains the ToolValidator class.  I have come to find this is not the case.  As far as I can tell, the ToolValidator class is never actually written to a .py file, and I speculate the the this code is passed to the python interpreter in memory, so __file__ is useless, or some temp script is persisted and then execfile(path_to_script) is called, again rendering __file__ useless.  I'm sure there are other reasons I am missing as well.    Long story short, if I use a hardcoded path, the sys.append works anywhere, relative paths don't work so well in the ToolValidator class. MySQL convert date string to Unix timestamp Multiple Inheritance in C# Since multiple inheritance is bad (it makes the source more complicated) C# does not provide such a pattern directly. But sometimes it would be helpful to have this ability. For instance I'm able to implement the missing multiple inheritance pattern using interfaces and three classes like that: public interface IFirst { void FirstMethod(); } public interface ISecond { void SecondMethod(); }  public class First:IFirst  {      public void FirstMethod() { Console.WriteLine(&quot;First&quot;); }  }  public class Second:ISecond  {      public void SecondMethod() { Console.WriteLine(&quot;Second&quot;); }  }  public class FirstAndSecond: IFirst, ISecond {     First first = new First();     Second second = new Second();     public void FirstMethod() { first.FirstMethod(); }     public void SecondMethod() { second.SecondMethod(); } }  Every time I add a method to one of the interfaces I need to change the class FirstAndSecond as well. Is there a way to inject multiple existing classes into one new class like it is possible in C++? Maybe there is a solution using some kind of code generation? Or it may look like this (imaginary c# syntax): public class FirstAndSecond: IFirst from First, ISecond from Second { }  So that there won't be a need to update the class FirstAndSecond when I modify one of the interfaces.  EDIT Maybe it would be better to consider a practical example: You have an existing class (e.g. a text based TCP client based on ITextTcpClient) which you do already use at different locations inside your project.  Now you feel the need to create a component of your class to be easy accessible for windows forms developers. As far as I know you currently have two ways to do this:  Write a new class that is inherited from components and implements the interface of the TextTcpClient class using an instance of the class itself as shown with FirstAndSecond.  Write a new class that inherits from TextTcpClient and somehow implements IComponent (haven't actually tried this yet).   In both cases you need to do work per method and not per class. Since you know that we will need all the methods of TextTcpClient and Component it would be the easiest solution to just combine those two into one class. To avoid conflicts this may be done by code generation where the result could be altered afterwards but typing this by hand is a pure pain in the ass. is it possible to redefine { and } in C? At the end of a makefile I saw   rm -f *~ *.class   I understand the *.class, but what's *~? Construct a command by putting a string into a tty Is the XP for an encounter split among the party members or not? At this point, I am unclear as to how to handle encounter XP. Does each surviving party member receive a proportional share, or the full amount? That is, assume a 4-character party had completed an encounter worth 400 XP. Would each party member receive 100 XP, or 400 XP? Tikz and ctable incompatibility, gives error when printing When I print a report I get an error:     An error exists on this page. Acrobat may not display the page   correctly. Please contact the person who created the PDF document to correct the problem   After a lot of debugging, I've found that this MWE reproduces the problem. I've tried it on three different computers with the same error.   \documentclass{standalone}           \usepackage{tikz} \usepackage{ctable} \begin{document} \begin{tikzpicture} \filldraw[opacity=.5] (0,0) rectangle (1,1); \end{tikzpicture} \end{document}   When loading the ctable package, the image is changed (the opacity disappears), so it seems the error comes from some incompatibility between ctable and opacity in tikz. The error only appears when trying to print though, acrobat before attempting to print. (Printing either to a pdf file or to a real printer)  I have the following versions of tikz and ctable:      tikz.sty    2013/12/13 v3.0.0   ctable.sty    2014/04/25 v1.29   How can I fix this?    EDIT: I found the warning Transparency disabled: incompatible with tikz package from ctable so I guess this incompatibility can explain the error in the first MWE.  However, I continued digging and found that the spy library seem to be incompatible with ctable as well.   Here's an MWE that generates the same error when printing (either to a pdf file or to a real printer):   \documentclass{standalone}           \usepackage{tikz} \usetikzlibrary{spy} \usepackage{ctable} \begin{document} \begin{tikzpicture}[spy using outlines={size=2cm,connect spies}] \begin{scope} \spy on (-3,.25) in node at (2,0); \end{scope} \end{tikzpicture} \end{document}   There seem to be a serious problem with using tikz + ctable, can it be fixed?