Release unused space from SQL Server database We have deleted a large part of the data from a two-digit terabyte sized database, and would now like to release some of the space back to the operating system. The database is currently about 80 % unused space. It will never reach its former size again (the load has been transferred elsewhere).  We have tried running SHRINKDATABASE on a copy of the database on a separate server (non-production). Running for 2 days (on our hardware) it was able to release the space.  I'm assuming it will take much longer on the database in production, as this is heavily used (mostly for querying now though, less so inserts).  Only hours of downtime (at a time) is acceptable on the production system. Some performance degrade over extended periods would be acceptable too.  Any ideas on how to release this amount of unused space, without having excessive downtime, or introduce severe performance degrade during the process?
I Need to Shrink My Database - I just freed a lot of space This question is asked in various forms here but the question boils down to:  I know shrinking a database is risky. In this case, I've removed so much data and I'll never use it again.   How can I shrink my database? What files do I shrink?  What should my considerations be while doing this?  Should I do anything after? What if it is a large database? Can I shrink it in smaller increments?
In which ways did scanning Nero's ship enhance/change Starfleet technology? I've heard the explanation that the Enterprise from 2009's Star Trek looked so much more advanced was because data gathered from the Kelvin initially scanning Nero's ship when it first appeared enabled them to upgrade their tech. I'm wondering if they've ever detailed exactly what technologies were advanced or enhanced or discovered. $\text{Let }y=\sqrt{5+\sqrt{5-\sqrt{5+\sqrt{5-...}}}} $, what is the nearest value of $y^2 - y$? I found this question somewhere and have been unable to solve it. It is a modification of a very common algebra question.          $\text{Let }y=\sqrt{5+\sqrt{5-\sqrt{5+\sqrt{5-...}}}} $,  what is the     nearest value of $y^2 - y$?          $\textbf {(1) } 1 \qquad \textbf {(2) } \sqrt5 \qquad \textbf {(3) } 4 \qquad \textbf {(4) } 2\sqrt5$      I worked the problem and got $$y^2 - y = 5+ \sqrt{5-\sqrt{5+\sqrt{5-...}}} -\sqrt{5+\sqrt{5-\sqrt{5+\sqrt{5-...}}}} \\ = 5+ \sqrt{5-y} - y = 5-y + \sqrt{5-y}$$ What do I do next? Hey I want to connect the bottom loop with the top loop so that it forms a solid.  I have tried selecting multiple vertices and pressing F but that just creates a large face which I do not want. I have tried using grid fill bu that doesn't work either. The solution that seems to work is by selecting four vertices and pressing F and then selecting the next 4 and pressing F and on and on. That just takes too long. Evaluate $\sum_{n=1}^\infty nx^{n-1}$ How can you evaluate $\sum_{n=1}^\infty nx^{n-1} = \frac{1}{(1-x)^2}$ without relying on the fact that it's the derivative of $\sum_{n=1}^\infty x^n = \frac{1}{1-x} $? Martingale formulation of Bellman's Optimality Principle From David Williams' Probability with Martingales     Related question:   What I tried: For no 2, if $\ln Z_n - n \alpha$ is a supermartingale, then for $m &lt; n$, $$E[\ln Z_n - n \alpha | \mathscr F_m] \le \ln Z_m - m \alpha$$ $$ \to E[\ln Z_N - N \alpha | \mathscr F_0] \le \ln Z_0 - 0 \alpha$$ $$ \to E[\ln Z_N - N \alpha] \le \ln Z_0$$ $$ \to E[\ln \frac{Z_N}{Z_0}] \le N \alpha$$ Is that right?  For no 1, for $m &lt; n$, $$E[\ln Z_n - n \alpha | \mathscr F_m] = E[\ln Z_n | \mathscr F_m] - n \alpha$$ $$ = E[\ln \frac{Z_n}{Z_0} | \mathscr F_m] - n \alpha + \ln Z_0$$ $$ = E[\ln \frac{Z_n}{Z_{n-1}} | \mathscr F_m] + ... + E[\ln \frac{Z_{m+1}}{Z_{m}} | \mathscr F_m]$$ $$+ \ln \frac{Z_m}{Z_{m-1}} + ... + \ln \frac{Z_{1}}{Z_{0}} - n \alpha + \ln Z_0$$ Note that $$Z_n - Z_{n-1} \le |Z_n - Z_{n-1}| \le C_n |\epsilon_n - \epsilon_{n-1}| \le 2C_n \le 2Z_{n-1}$$ Also, I think $$\ln \frac{Z_n}{Z_{n-1}} \le |Z_n - Z_{n-1}|$$ Hence we have $$E[\ln \frac{Z_n}{Z_{n-1}} | \mathscr F_m] + ... + E[\ln \frac{Z_{m+1}}{Z_{m}} | \mathscr F_m]$$ $$+ \ln Z_m - n \alpha$$ $$\le E[2Z_{n-1} | \mathscr F_m] + ... + E[2Z_{m} | \mathscr F_m]$$ $$+ \ln Z_m - n \alpha$$ $$= 2(E[Z_{n-1} | \mathscr F_m] + ... + E[Z_{m} | \mathscr F_m])$$ $$+ \ln Z_m - n \alpha$$ One thing to do would be to show that $$2E[Z_{n-1} | \mathscr F_m] + ... + 2E[Z_{m} | \mathscr F_m] \le (n-m) \alpha$$ possibly by showing that $2E[Z_{\{\cdot\}} | \mathscr F_m] \le \alpha$ How would I do that? Something else: $$E[\ln \frac{Z_n}{Z_m} | \mathscr F_m] + \ln Z_m - n \alpha$$ $$ \le E[|Z_n - Z_m| | \mathscr F_m] + \ln Z_m - n \alpha$$ $$ \le E[2Z_m | \mathscr F_m] + \ln Z_m - n \alpha$$ $$ \le 2Z_m + \ln Z_m - n \alpha$$ Now $2Z_m \le (n-m) \alpha?$ We have $$2Z_m = 2\sum_{k=1}^{m} C_k(\epsilon_k - \epsilon_{k-1})$$ $$\le 2\sum_{k=1}^{m} Z_{k-1}$$ I'm not quite sure how to show that $$2\sum_{k=1}^{m} Z_{k-1} \le (n-m)\alpha$$ if that's even true. How can/else can I approach this problem?  For no 3, no idea. Any hints? I think it has something to do with a stopping time. Might we have to use the ff lemma (red box):    ? xslt processing on select attribute on apply-templates Modular Arithmetic - Find the Square Root Compact topological space with closed graph implies continuity Let $X,Y$ be topological spaces and $f:X \rightarrow Y$  If $Y$ is compact and $G(f)$ (graph of $f$) is closed, show that $f$ is continuous.   I consider an open set in $X$, and as $G(f)$ is closed, $(X \times Y)-G(f)$ is open. And I guess I need to do something here. Then I can get some open sets. Also, I notice that compact is something relate to "finite". I guess I can use the compactness to do finite intersection or union and get the result finally.  But what should I do in the middle or I am not even on a right track. So lets say I have this interface:  public interface IBox {    public void setSize(int size);    public int getSize();    public int getArea();   //...and so on }   And I have a class that implements it:  public class Rectangle implements IBox {    private int size;    //Methods here }   If I wanted to use the interface IBox, i can't actually create an instance of it, in the way:  public static void main(String args[]) {     Ibox myBox=new Ibox(); }   right? So I'd actually have to do this:  public static void main(String args[]) {     Rectangle myBox=new Rectangle(); }   If that's true, then the only purpose of interfaces is to make sure that the class which implements an interface has got the correct methods in it as described by an interface? Or is there any other use of interfaces? I have just started special theory of relativity. The limiting speed known as speed of light fascinated me most. I asked my teacher:      Consider two massless objects moving in the same direction at the speed of light. What would be their relative velocity w.r.t each other?   My teacher tells me that their relative velocity would be zero. But then the speed of light is universal constant regardless of the motion of its frame of reference, so shouldn't their relative velocity be $c$? What is their relative velocity and how? Do objects moving at the speed of light obey law of addition of velocities? What is the CVE-2014-6271 bash vulnerability (Shellshock) and how do I fix it? Recently, there have been news going around regarding "CVE-2014-6271" (See ), which is a vulnerability in Bash. How do I know if I am affected by this, how can I fix it, and why should I care?  This is designed as a canonical answer for this vulnerability, due to its scope and severity. Why is it dangerous to eat meat which has been left out and then cooked? What if robots.txt disallows itself? Is there an elegant way to have performant, natural sorting in a MySQL database?  For example if I have this data set:   Final Fantasy Final Fantasy 4 Final Fantasy 10 Final Fantasy 12 Final Fantasy 12: Chains of Promathia Final Fantasy Adventure Final Fantasy Origins Final Fantasy Tactics   Any other elegant solution than to split up the games' names into their components    Title: "Final Fantasy" Number: "12" Subtitle: "Chains of Promathia"   to make sure that they come out in the right order? (10 after 4, not before 2).  Doing so is a pain in the a** because every now and then there's another game that breaks that mechanism of parsing the game title (e.g. "Warhammer 40,000", "James Bond 007") What is the function of "do" in this sentence? Trying to prove that $H=\langle a,b:a^{3}=b^{3}=(ab)^{3}=1\rangle$ is a group of infinite order. I'm trying to prove that the following group has infinite order: $$H=\langle a,b\mid a^{3}=b^{3}=(ab)^{3}=1\rangle.$$  Currently I'm checking on some cases using the relations, but my problem is the reducibility for large products.  Naively I started to check that $ab$ is different than $1,a,b$ and then $ba$ than $1,a,b,ab$, just to understand $H$ in some extent.   Now I'm wondering about some more effective method to prove that $|H|=\infty$, I'm tempted to look for an injection from some group of infinite order into $H$, but I'm still stuck.  More than asking for a solution I'd rather appreciate some hints or thoughts about it. Thanks a lot. How do I use the latest GCC on Ubuntu? I want to compile my program with the latest version of gcc.  Ubuntu 14.04 comes with gcc 4.8.2, however there's 4.9.0 available, moreover, I see that it is available as a package: . I tried to install it  sudo apt-get install gcc-4.9   but it says  Reading package lists... Done Building dependency tree        Reading state information... Done Note, selecting 'gcc-4.9-base' for regex 'gcc-4.9' gcc-4.9-base is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.   Looks like it is already installed, just not as the default one? How do I utilize it to build my program? Prove that $(p+q)^m \leq p^m+q^m$ Is there a command like "watch" or "inotifywait" on the Mac? I want to loop over the contents of a text file and do a search and replace on some lines and write the result back to the file. I could first load the whole file in memory and then write it back, but that probably is not the best way to do it.  What is the best way to do this, within the following code?  f = open(file) for line in f:     if line.contains('foo'):         newline = line.replace('foo', 'bar')         # how to write this newline back to the file