How do I asynchronously run tasks in a loop?
Captured variable in a loop in C#
Magic leaves "smudges" and a sorceress becomes a book I could use some help identifying a book I read some time in the last year or so. The book goes between two different stories:  1) A student of magic finds a book in a cave that turns out to be a person transformed into a book. The book talks to the student and they share thoughts. At some point, the student runs away, chase ensues, and at the very end of the book, he manages to travel to another plane.  2) A girl in a religious society where magic is forbidden. She is the daughter of painters. She discovers she can see magic. Falls in love with some random painter, risks performing magic to not be pregnant, does it again so she can, and is arrested and sent to some prison thing.  The common element between the stories is that magic use leaves behind a smudge of some kind that can be visible.  Any assistance is appreciated. Find all functions $f$ such that $f:\mathbb{N}\rightarrow\  \mathbb{N}$ and $f(f(n))+f(n+1)=n+2$   Let us plug in $n=1$  $f(f(1))+f(2)=3$  Since the function is from $\mathbb{N}$ to $\mathbb{N}$, $f(2)$ can only take the values $1,2$. Now we divide the problem into cases.  Case-1: $f(f(1))=2,f(2)=1$  We can assume that $f(1)=c$ for the time being. Then plugging in $n=3$ and using $f(2)=1$ gives $$f(3)=4-c$$ and again since the range of the function is positive integers,then $4-c$ has to be positive and hence $c$ belongs to  {$1,2,3$}. Now, $$f(1)=c$$$$\implies f(f(1))=f(c)$$$$\implies 2=f(c)$$ by the assumption that $f(f(1))=2$ . Now,since $c$ can only take the values $1,2,3$,we start treating cases. If $c=1$,$$f(c)=2$$$$\implies f(1)=2$$ but we know from the deinition of $c$ that $f(1)=c=1$,a contradiction.If $c=2$,then $2=f(c)=f(2)$ but $f(2)=1$ by assumption. Finally,if $c=3$ $$2=f(c)=f(3)$$ but $$f(3)=4-c=4-3=1$$ which is once again a contradiction. Therefore there are no such functions in this case.  Case-2: $f(f(1))=1,f(2)=2$  Again assuming $f(1)=c$ and using $f(n)\le n$ along with plugging $n=c-1$ will give us that $f(1)=1$ and then it is easy to prove that such a function exists by recursion. I can only give a "sort of recursive" way to define the function. Here it goes $$f:\mathbb{N}\rightarrow \mathbb{N}$$$$f(1)=1$$$$f(n)=n+1-f(f(n-1))$$  But this case is harder to deal with.Some help will be appreciated. Redirect to SSL only if browser supports SNI truecrypt 7.1a requires Mac OS X 10.4 or later on Yosemite 10.10 After reading articles about the state of Truecrypt in February 2015, I decided to download the last stable version of Truecrypt that allows full usage of Truecrypt: that is, version 7.1a     7.2 version that can only be used to view, but no longer to create new, TrueCrypt volumes.   see   I then proceeded to install this on my Mac, running on Yosemite 10.10  But I got the error message "truecrypt 7.1a requires  Mac OS X 10.4 or later", see below.    I guess it's simply a schoolboy error from a developer of the Truecrypt team, as it considers 10.4 being above 10.10, or maybe it's rather Apple who messed up &amp; should have consistantly used 2 digits after the dot (i.e. use 10.04 rather than 10.4).  In any case, I find myself unable to install Truecrypt. Anyone found a solution for this? Ask to install program after "The program 'x' is currently not installed" If you try to execute a program that is not installed you will get a message  The program 'x' is currently not installed. You can install it by typing:  sudo apt-get install x   and instead of offering you to install the program for you, you have to type the actual command. How can this behavior be changed? Prologue:  This is an effort to follow up on  which is marked as a duplicate of  highly voted and status-declined feature request (although they seem to be different, one focusing on the OP and the other on the downvoter).   My New Year's resolution was to downvote more.  So on January 3rd or so, I saw a post that was low quality, and downvoted.  Two days later, I came back to see if it was ready to be deleted or had gotten piled with downvotes, to find it with a significant positive score!  At which point, I noticed that the answer had been significantly improved.  So I retracted my downvote, changed it to an upvote, and immediately resumed my dearth of downvoting again.  I think I have a responsibility to downvote bad posts, despite that oh-so-painful -1 rep penalty.  But if I am also going to have the responsibility to follow up on every downvote I cast, I'm not going to bother. I don't want my downvote to leave a residual penalty on posts that were once low quality, and I am not going to trouble myself to keep checking up on every post I downvoted.  Can a downvoter have an option to be notified when a post they voted down was edited?  I wouldn't make this an automatic thing, because not all downvoters want it, and it isn't applicable to all cases of downvoting (although  that this should be part of the responsibility of a downvoter).  Personally, I would make this a universal toggle on-off option on the user profile page, not a question-by-question option, but I don't have strong feelings about it. Condition on a,b and c satisfying an equation(TIFR GS 2017) Let $a,b,c$ be positive real numbers satisfying $$(1+a+b+c)\left(1+\frac{1}{a}+\frac{1}{b}+\frac{1}{c}\right)=16,$$ then $a+b+c=3$.  I thought about the application of the AM-GM-HM inequality, but in vain. I also thought about splitting 16 into factors and comparing but went nowhere. Any ideas. Thanks beforehand. Does the fact that matrices $A, B$ are similar imply that $A+cI$ is similar to $B+cI$? Let $A, B$ be similar $n \times n$ matrices over (say) $\mathbb{R}.$  Is it the case that $A+cI$ is similar to $B+cI$?    Here is an argument (which seems too good to be true...)  Since $A, B$ are similar, they have the same Jordan form. So we can write $PAP^{-1}=QBQ^{-1}=J$ for $P, Q$ invertible matrices.   Hence we have $P(A+cI)P^{-1}=PAP^{-1}+cI= J+cI.$ Similarly, we find $Q(B+cI)Q^{-1}=J+cI.$  Hence $A+cI$ and $B+cI$ are both similar to $J+cI$ and hence similar to each other.   Is this correct? I want to plot the function 1/(x²+y²), but since it tends to infinity in (0,0), I get a horrible plot:  \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{tikzpicture}   \begin{axis}[grid=both]     \addplot3 [surf] {1 / (x^2 + y^2)};   \end{axis} \end{tikzpicture} \end{document}     By restricting the domain of z, I get anyway a not so nice plot:  \documentclass{article} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{tikzpicture}   \begin{axis}[grid=both,restrict z to domain=0:1]     \addplot3 [surf] {1 / (x^2 + y^2)};   \end{axis} \end{tikzpicture} \end{document}     I would like to get something smooth, which finish in a circle (the circle of the intersection of this function with the plane z=1 for example).  Something like this would be great: Can't reach wi-fi signal on Ubuntu, but can do it on other OS/devices (ath9k) I'm doing a bit of self study, but I'm uncomfortable with a certain idea. I want to show that $f(z)$ is analytic if and only if $\overline{f(\bar{z})}$ is analytic, and by analytic I mean differentiable at each point. Here $f$ is a complex valued function.  What I do is write $f(z)=u(x,y)+iv(x,y)$, where $u$ and $v$ are real functions of two variables. Then $\overline{f(\bar{z})}=u(x,-y)-iv(x,-y)$.  These two forms look very similar, in the sense the one function being differentiable should immediately imply the other is differentiable, since the only thing really changing might be a $-$ sign popping out due to the chain rule.   How can I more rigorously express that $f(z)$ is analytic iff $\overline{f(\bar{z})}$ using this? Many thanks. How do i know which wheels will fit my bike? "right" vs "correct" Except when we use right to denote direction, what is the difference between these two terms?  Also, which one is the preferred construction between these two     Am I right?   or     Am I correct? Homotopic maps have homotopy equivalent mapping cones How do I create a line graph which ignores zero values? I want to create a graph showing trends over time, calculated from a formula of various data.  However, some data is missing, resulting in zeroes in the calculated data which the chart uses.  When plotting this data against as a line graph, it's drawing a line down to the axis, which I don't want.  I'd like either a gap in the line, or skip the data point and draw from directly previous to next.  i.e. given this data:  00.0    61.6    39.5    74.6    86.8    72.0    66.5    99.5    85.6    80.6    95.0    122.4 81.0    83.1    88.2    00.0    94.3    60.5    00.0    99.5    95.8    86.2    00.0    111.4 84.1    110.8   78.9    62.0    75.9    102.2   89.9    87.1    81.6    73.5    00.0    116.9   All the 00.0 items mean "no data", so I'd like them ignored (not treated as 0 value).   This is the chart I currently have:   This is how I'd like the chart to come out:   Again, I don't mind if the dotted lines are blank or solid, so long as they don't go down to zero.  The data is dynamic/calculated, so I can't just say =AVERAGE(prev,next) since I don't know where missing data will occur in advance - I need a solution which takes this into account.  Any ideas? I've recently started maintaining someone else's JavaScript code. I'm fixing bugs, adding features and also trying to tidy up the code and make it more consistent.  The previous developer used two ways of declaring functions and I can't work out if there is a reason behind it or not.  The two ways are:  var functionOne = function() {     // Some code };     function functionTwo() {     // Some code }   What are the reasons for using these two different methods and what are the pros and cons of each? Is there anything that can be done with one method that can't be done with the other? $X$ is a random variable, if $\Bbb E(X^2)=1$ and $\Bbb E(X)\geq a>0$, prove that $\Bbb P(X\geq\lambda a)\geq(a-\lambda a)^2$ for $0\leq\lambda\leq 1$. This is a problem in KaiLai Chung's A Course in Probability Theory.     Given a nonnegative random variable $X$ defined on $\Omega$, if $\mathbb{E}(X^2)=1$ and $\mathbb{E}(X)\geq a &gt;0$, prove that $$\mathbb{P}(X\geq \lambda a)\geq (a-\lambda a)^2$$   for $0\leq\lambda \leq 1$.   Let $A=\{x\in \Omega:X(x)\geq \lambda a\}$, we get $$\int_A (X-\lambda a)\geq a-\int_A\lambda a -\int_{A^c}X$$ and $$\int_A (X^2-\lambda^2 a^2)=1-\int_A\lambda^2a^2-\int_{A^c}X^2$$ I want to contrast $\int_A (X-\lambda a)$ and $\int_A (X^2-\lambda^2 a^2)$, but I don't know how to do it, could anyone gives me some hints? How can I use variables in the LHS and RHS of a sed substitution? I want to do:  cat update_via_sed.sh | sed 's/old_name/new_name/' &gt; new_update_via_sed.sh   in my program.  But I want to use variables, e.g.  old_run='old_name_952' new_run='old_name_953'   I have tried using them but the substitution doesn't happen (no error). I have tried:  cat update_via_sed.sh | sed 's/old_run/new_run/' cat update_via_sed.sh | sed 's/$old_run/$new_run/' cat update_via_sed.sh | sed 's/${old_run}/${new_run}/' Why does arXiv have a multi-day lag between submission and publication? If you go on the  (now, 8th December 2020, 19:24 Italian time), there is for example the article &quot;Exploring the Usage of Online Food Delivery Data for Intra-Urban Job and Housing Mobility Detection and Characterization&quot;. This article is under the heading &quot;8 December&quot;. But if you , it was &quot;Submitted on 4 Dec 2020&quot;. Why there is a lag between submission time and the header under which it appears for recent publications? I guess the arXiv staff have to approve the article before is being published .... is my guessing correct? Regarding the `book`, `report`, and `article` document classes: what are the main differences?