choosing $5$ non consecutive books from a shelve of $12$
How many ways can $r$ nonconsecutive integers be chosen from the first $n$ integers?
Finding a set of continuous functions with a certain property 2 I need help finding the set of continuous functions $f : \Bbb R \to \Bbb R$ such that for all $x \in \Bbb R$, the following integral converges:  $$\int_0^1 \frac {f(x+t) - f(x)} {t^2} \ \mathrm dt$$  I think it might be the set of constant functions but i havent been able to prove it :(   I was thinking that you can use the stone weiestrass theorem considering the set of continuous functions on a closed  interval(non trivial) ,and a subset which contains the set of continuous functions whose integral above diverges in some point in that interval along with  with the set of constant functions. So in order to solve the problem i need only to prove that if two functions do not meet the condition of the problem then their product does not as well .  I hope you can provide some insight and thank you . Proximal Operator Fixed Point Property for Matrices $\newcommand{\prox}{\operatorname{prox}}$ $\newcommand{\argmin}{\operatorname{argmin}}$ $\newcommand{\dom}{\operatorname{dom}}$  Recall again that the proximal operator for vectors $\prox_{f}: R^n \rightarrow R^n$ of $f$ is defined as:  $\prox_f(v) := \argmin_{x} \left(f(x) +(1/2)\|x-v\|_2^2 \right) $,  where $f: R^n \rightarrow R \cup \infty$ is a closed proper convex function and $\|\cdot \|_2$ is the Euclidean norm. $\prox$ is strongly convex and not everywhere infinite, so there it will have a unique minimizer for every $v \in R^n$  The crucial property of proximal operator is that $x^*$ minimizes $f(x)$ iff $x^* = \prox_f(x^*)$, i.e. $x^*$ is a fixed point of $\prox_f$.  Let us consider the proof of this property. The first part, namely, that if $x^*$ minimizes $f$ then $\prox_f(x^*)=x^*$, is trivial:  $f(x) +(1/2)\|x-x^*\|_2^2 \le f(x^*) = f(x^*) +(1/2)\|x^*-x^*\|_2^2$  The second part uses the notion of subdifferential. In the proof authors say that $\tilde{x}$ minimizes  $f(x) +(1/2)\|x-v\|_2^2$  i.e. $\tilde{x} = \prox_f(v)$ iff $0 \in \partial f(\tilde{x}) + (\tilde{x}-v)$,   where the sum is of a set and a point. Recall the definition of the subdifferential:  $\partial f(x) = \{ y$ |  $ f(z)\le f(x) + y^T(z-x)$ $\forall z \in \dom{f}\}$  Take $\tilde{x}=v=x^*$, it follows that $0 \in \partial f(x^*)$ so $x^*$ minimizes $f$.  Question 1:  Consider proximal operator defined for matrices now:  $\prox_f(Y) := \argmin_{X} \left(f(X) +(1/2)\|X-Y\|^2 \right)$,  where $X$ is some real $m$ by $n$ matrix. What norm function should be taken in the definition of the $\prox$ in this case? Frobenius? Or spectral norm (induced 2nd norm) which is the largest eigenvalue (is spectral norm even differentiable?)? Or something else?  Question 2:   Can the norm for the definition of $\prox$ in case of matrices be chosen in different ways? What conditions does the proof above impose on the norm function? PHP class: Global variable as property in class Does $ \int_0^{\infty}\frac{\sin x}{x}dx $ have an improper Riemann integral or a Lebesgue integral? In  wikipedia article for improper integrals,  $$ \int_0^{\infty}\frac{\sin x}{x}dx $$ is given as an example for the integrals that have an improper Riemann integral but do not have a (proper) Lebesgue integral. Here are my questions:   Why does this one have an improper Riemann integral? (I don't see why $\int_0^a\frac{\sin x}{x}dx$ and $\int_a^{\infty}\frac{\sin x}{x}dx$ converge.) Why doesn't this integral have a Lebesgue integral? Is it because that $\frac{\sin x}{x}$ is unbounded on $(0,\infty)$ and Lebesgue integral doesn't deal with unbounded functions? How to add a dot after the section number? I wonder is there any way to change the format of section numbering from 1.1 to 1.1. ? I know this is trivial, but I really need to add one more dot after the section number. Does anybody know how to do that?  Thanks a lot "The ticket is printing" vs "...is being printed" You're standing in front of a ticket vending machine and it says "The ticket is printing". Is that correct or should it be "The ticket is being printed"?  EDIT:  If both are correct, which one should be preferred or is more common? Travel to Australia with new passport (with visa in old passport) I was granted a visa to Australia few months ago. I’d like to travel to Australia in few days. However, I’ve just renewed my passport and I don’t have enough time to inform them about my passport renewal. Can I travel to Australia by carrying both my old and my new passports? Give an example of a sequence of real numbers with subsequences converging to every real number While I was investigating a problem I had with lexical closures in Javascript code, I came along this problem in Python:  flist = []  for i in xrange(3):     def func(x): return x * i     flist.append(func)  for f in flist:     print f(2)   Note that this example mindfully avoids lambda. It prints "4 4 4", which is surprising. I'd expect "0 2 4".   This equivalent Perl code does it right:  my @flist = ();  foreach my $i (0 .. 2) {     push(@flist, sub {$i * $_[0]}); }  foreach my $f (@flist) {     print $f-&gt;(2), "\n"; }   "0 2 4" is printed.  Can you please explain the difference ?    Update:   The problem is not with i being global. This displays the same behavior:  flist = []  def outer():     for i in xrange(3):         def inner(x): return x * i         flist.append(inner)  outer() #~ print i   # commented because it causes an error  for f in flist:     print f(2)   As the commented line shows, i is unknown at that point. Still, it prints "4 4 4". I have recently upgraded SQL Server 2000 database to 2008 R2.    What I did was:   Shutdown SQL Server 2000 (express) service on old machine, Move datafiles (mydatabase.mdf and mydatabase.ldf) to new machine, Run SQL Server Management Studio 2008, Connect to local database engine, Attach datafiles to database. Change the compatibility level of database to SQL 2008 (100).     Question: What else should I do to make migration complete?  I want to:   use new features like checksumming and full recovery model, make this database to be exactly as it was created in SQL 2008 R2, make this database to be fully compatibile, correct and be perfect suited for new, SQL 2008 R2 database engine.     In other words: I just want to know how to correctly and completly convert old SQL 2000 database to new 2008 R2 database, be calm that everything is done right and be happy with all new features.    I'm asking this question, because I've found a lot of sites on the Internet that says so many different things that makes me confused: some say that it is required to rebuild indexes, another says to do other things... and now I know nothing so I want to hear experienced person opinion and clear, step-by-step instructions. I work for very small company, I'm on my own and I don't want to screw things up.    Sir, I'm really impressed with your answer, I wasn't expecting so much.    So some comments:   The database is now in production. As I said, it was upgraded using deattach-attach method as I desribed in first post and as described on MSDN:  It had to be done quickly, so I was forced to do it that way. Let's forget about how inappropriate could it was and focus on current situation. The users/persmission is not a problem here - there are only few and permissions are simple. The application which use database is compatibile with SQL 2000 till 2012 so this is not a problem either. The database file (MDF) isn't big - only about 1GB.     Few more questions:   You recommend to use backup/restore method, but I did as written above, so can I encounter any problems now? Everything worked without any problem. About checksumming and full recovery model: it wasn't available/enabled on SQL 2000, so I want to use them now. You said that the only thing I need to do is to enable those options in database properties? I've read somewhere, that it isn't enough and I should also rebuild indexes or something. I really don't know, I just asking. I'm prepairing to migrate this database to SQL 2012 - so first it was from SQL 2000 to 2008 R2, now it will be from 2008 R2 to 2012 (it was impossible to do this directly because of lack of support of SQL 2000 databases in SQL 2012). So I understand that I should follow your guide: backup it in 2008 R2 and restore in 2012, then do the rest of your tips, right? Please explain me the backup/restore method: Is it like a dump of database to SQL queries and then restoring it by executing a bunch of queries? Will this method by the way "defragment" my database? If not, how to defragment/optimize it manually? As we were using SQL 2000 Express for years (no management interface), we were doing backups simply by stopping engine and RAR the DATA directory. For now, as we are on SQL 2008, isn't this still better than using backup function in Management Studio? Full recovery mode with frequent Transaction log backups - Where is the Transaction log stored - is it the LDF file? How sould I backup it properly?     I know that my questions may sound silly, I'm not professional database admin, but I am the only person here who can do such "hard core" task like upgrading the database engine. I'm also sure that your knowleadge will help a lot to other people like me.  Thank you very much for your time and knowleadge, I really appreciate this. I have heard several times that some mathematician has given another and more rigorous for an established theorem, but I don't know what does it really mean and what differences makes it to be more 'rigorous'. My understanding of a proof is that a proof is some explanation to convincing others that a statement is true. If some proof is not rigorous, does it mean that while the proof is acceptable for many but it is not for everybody? If so, the proof is not correct since it going to be rejected by some people and it is not a proof at all. Or, does rigorous mean it uses more advanced tools? If so, why not any alternative (but simpler) proof is also acceptable as rigorous (which is more 'valuable' as well since it's simpler!)?   Saying those limited insight of mine, my questions are:   $1-$ What does rigorous proof mean, in general definition?  $2-$ In order to understand your answers, as an example I am re-writing three of the proofs for the compactness of the torus. Which of the following proofs are most rigorous, 'normal' and least rigorous; and why so?    Theorem: The torus $T^2$ is compact.  First proof: The torus is homeomorphic to the product space $S^1 \times S^1$. The circle $S^1$ is compact. Therefore the torus is the product of two compact spaces, and thus it is compact.   Second proof: The torus $T$ is the subspace of $\mathbb{R}^3$ obtained by rotating a circle about the $z$-axis. The torus is closed since given any point in its complement, there is an open ball of sufficiently small radius centered at that point and disjoint from the torus. Also, the torus is bounded since it is contained in the ball of radius $4$ centered at the origin. Since the torus is closed and bounded in $\mathbb{R}^3$, it is compact.   Third proof: The torus is homeomorphic to a space obtained as a quotient  space of the square by identifying opposite edges. The square is a closed and  bounded subset of $\mathbb{R}^3$ and therefore is compact. Furthermore, a quotient map on the square is a continuous function, and the image of a compact space under a continuous function is compact. Therefore the torus is compact.   Thanks a lot for your guidance. What is the process for a moderator to request reinstatement or appeal a removal? Please leave any feedback or questions about this process on .   From time to time, moderators will step down or be removed from their positions — they may have expressed their wish to step down due to time constraints or they may have had behaviors unfitting of a moderator and have been forcefully removed, along with a number of other possibilities that fall somewhere between those two. What is the process for evaluating moderator reinstatement or removal appeal requests?  Note: Feedback on the original version of this post can still be found . How to show $a,b$ coprime to $n\Rightarrow ab$ coprime to $n$? Let $a,b,n$ be integers such that  $\gcd(a,n)=\gcd(b,n)=1$. How to show that $\gcd(ab,n)=1$?   In other words, how to show that if two integers $a$ and $b$ each have no non-trivial common divisor with and integer $n$, then their product does no have a non-trivial common divisor with $n$ either.     This is a problem that is an exercise in my course.   Intuitively it seems plausible and it is easy to check in specific cases but how to  give an actual proof is not obvious. The square of an integer is congruent to 0 or 1 mod 4 Losing permissions by adding capability? I observed the following phenomenon that I can not explain. After adding the CAP_SYS_ADMIN capability, unshare is no longer able to write to /proc/self/setgroups.   In fact, writing to this file requires the capability, but that is achieved by changing the user namespace. So why does adding the capability to the parent process prevents writing to this file?  me@myhost:~$ unshare -r root@myhost:~# exit logout  me@myhost:~$ sudo setcap cap_sys_admin=ep /usr/bin/unshare me@myhost:~$ unshare -r unshare: cannot open /proc/self/setgroups: Permission denied  me@myhost:~$ sudo setcap cap_sys_admin= /usr/bin/unshare me@myhost:~$ unshare -r root@myhost:~#   By the way: I am running Ubuntu 16.04.4 LTS with kernel version 4.4 and the version of util-linux (including unshare) is 2.27.1. Can I downgrade to macOS Mojave if I buy the new 2019 MacBook Pro? Ubuntu system is broken after accidentally uninstalling many packages I accidentally removed all the packages starting with the name jpeg with:  sudo apt-get remove jpeg*   This screwed up a lot of things, removed Unity, Firefox, Flash player etc.  I somehow managed to recover the desktop and unity but then a lot of things are still buggy. For example .rpm files and .tag.gz just won't open up at all.  What I want is a way to fix everything that's amiss. Something that is the equivalent of a 'repair installation' with a windows disc.  Any tips, anyone? Replace arbitrary characters in the middle of an IP address string with sed I need to find and replace either one or two numerical characters in strings in a file.  The strings are IP addresses of the form:   10.xx.y.z    Where xx can be one or two characters.    I want to replace the xx with the single character 0, so I have  10.0.y.z    preserving the values of y and z.   The string may appear multiple times in the file.  What is the sed invocation to do this? Disable mouse speed check between monitors in windows 8.1 update 1 In windows 8.1 and below, the mouse would seamlessly move through all my monitors.  However, in windows 8.1 update 1 the mouse needs to be going at a certain speed before it goes to a different monitor. How do I disable this?  A google search has turned up nothing, so I'm not sure what exactly is going on Python gives us the ability to create 'private' methods and variables within a class by prepending double underscores to the name, like this: __myPrivateMethod(). How, then, can one explain this  >>> class MyClass: ...     def myPublicMethod(self): ...             print 'public method' ...     def __myPrivateMethod(self): ...             print 'this is private!!' ...  >>> obj = MyClass() >>> obj.myPublicMethod() public method >>> obj.__myPrivateMethod() Traceback (most recent call last):   File "", line 1, in  AttributeError: MyClass instance has no attribute '__myPrivateMethod' >>> dir(obj) ['_MyClass__myPrivateMethod', '__doc__', '__module__', 'myPublicMethod'] >>> obj._MyClass__myPrivateMethod() this is private!!   What's the deal?!  I'll explain this a little for those who didn't quite get that.  >>> class MyClass: ...     def myPublicMethod(self): ...             print 'public method' ...     def __myPrivateMethod(self): ...             print 'this is private!!' ...  >>> obj = MyClass()   What I did there is create a class with a public method and a private method and instantiate it.  Next, I call its public method.  >>> obj.myPublicMethod() public method   Next, I try and call its private method.  >>> obj.__myPrivateMethod() Traceback (most recent call last):   File "", line 1, in  AttributeError: MyClass instance has no attribute '__myPrivateMethod'   Everything looks good here; we're unable to call it. It is, in fact, 'private'. Well, actually it isn't. Running dir() on the object reveals a new magical method that python creates magically for all of your 'private' methods.  >>> dir(obj) ['_MyClass__myPrivateMethod', '__doc__', '__module__', 'myPublicMethod']   This new method's name is always an underscore, followed by the class name, followed by the method name.  >>> obj._MyClass__myPrivateMethod() this is private!!   So much for encapsulation, eh?  In any case, I'd always heard Python doesn't support encapsulation, so why even try? What gives?