Preamble: In general it's a big no-no, but believe me that are rare cases when space is really needed. For example Express Edition is limited to 10GB. Imagine that you discovered that with a data type conversion (a blob column) you can free up significant amount of space. But after that the DB file still has the same size as we know, and the 10GB limit also didn't change magically. So some kind of SHRINK is needed. That was an example.  In my test environment I performed:  DBCC SHRINKFILE (DBFile, NOTRUNCATE) DBCC SHRINKFILE (DBFile, TRUNCATEONLY)   That did the trick (I know that that minimizes the free space, in real world I would leave free space). it took many-many hours to finish. As we know it's a single threaded process , "it works as a series of very small system transactions so there is nothing to rollback." - Paul Randal . We also know that it messes up the index fragmentation big time  and I can confirm that. I didn't experience log file grow though described in   I issued some INDEX REBUILD and REORGANIZE and those finished within seconds.  My questions:   What's the big deal about shrink if I can just fix the index fragmentation after the shrink within seconds? I don't understand. Here on DBA stackexchange the "shrink" topic () says "Pretty much the worst thing you could do to a SQL Server database. In short: It sacrifices performance to gain space." plus refers to another popular article about it. But index fragmentation can be fixed. Why I didn't experience any log file growth? What if REBUILD the index first after the space free-up operation. Can that substitute the first DBCC SHRINKFILE (DBFile, NOTRUNCATE) so I just need to DBCC SHRINKFILE (DBFile, TRUNCATEONLY)? I have a feeling that the two work on different logical level but I have to ask this.   Bottom line: I promise I won't do shrink regularly or anything. But this is a situation where a cap is hit and shrink is needed.    Answer to my 2nd question: I didn't experience transaction log file growth, because I was fiddling in a developer test environment. The transaction log file would grow in a production environment (assuming Full Recovery Model). You should mimic that in your testing environment too. The tr log file growth is actually bigger than the space you can free up inside the database file. In the end you not only want to shrink the database file, but also the transaction log (how and when to do that depends on the recovery model). Production environments I saw had so screwed up index fragmentation that it can be just better. My script reindexes every index which fragmentation level is above 30%.  To handle the growth, you may have to switch from full recovery to simple while you are doing the once-in-a-lifetime conversion. But that will break the backup chain.    Answer to my 3rd question: do the reindex/index rebuild after the DB file shrink, because the shrink messes up index fragmentation.  I haven't experimented how all of this affects query statistics.    Script for reindexing: see Example D of . An article on incremental shrink, which will lead to other valuable content:
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?
What to do after visiting unsafe site Will I be demoted to a lower league in Starcraft 2 if I don't play? I've just been promoted from platinum league to diamond and master pretty fast (in 4 vs 4). This was totally amazing for me but I'm afraid I will be demoted again to a lower league as fast as I came higher.   If I don't play any 4 vs 4 anymore, will they demote me to a lower league automatically or do they only do so, if I play? Converting to upper and lower case in Java I would like to delete, from the following figure:  the top circle, but without removing the black edge that separate the orange part from the gray part. The figure above has been obtained by the following code: \documentclass[border=0.2cm]{standalone}  % Required packages \usepackage[dvipsnames]{xcolor} \usepackage{tikz}   \begin{document} \begin{tikzpicture}[thick, set/.style = {circle,      minimum size = 3cm,      fill=black!30}]  % Set A \node[set,label={135:$A$}] (A) at (0,0) {};  % Set B \node[set,label={45:$B$}] (B) at (1.8,0) {};   % Intersection \begin{scope} \clip (0,0) circle(1.5cm); \clip (1.8,0) circle(1.5cm); \clip (0.9,1.5) circle(1.5cm); \fill[orange!60](0,0) circle(1.5cm); \end{scope}  % Circles outline \draw (0,0) circle(1.5cm); \draw (1.8,0) circle(1.5cm); \draw (0.9,1.5) circle(1.5cm);  \end{tikzpicture} \end{document}  A rough example of the desired result is: I am trying to work through Hartshorne's book and while working through one of the exercises, I need to show the following:  Let $k$ be an algebraically closed field. Let $Y \subseteq A^3$ be the set $Y=\{(t,t^2,t^3)\;|\;t \in k\}$. Show that $Y$ is an affine variety.  The rest of the problem I have completed. I'm just not sure how to show that this set is closed and irreducible. I assume that they intend for $A^3$ to have the Zariski topology. I have 2 ADS1299 analog to digital converters(). I need to give them bipolar mode supplying but I must use a powerbank of 5V 3A. I wonder how can I create a bipolar supply of +2.5v -2.5v as mention in the datasheet from the 5V of the powerbank. I am new in this field. Thank you I was thinking about writing a partial derivative macro that has a similar syntax to the . ()  The syntax could be like this:   \D{f}{x} expands to \frac{\partial f}{\partial x} \D{f}{x,y} expands to \frac{\partial^2 f}{\partial x\,\partial y} \D{f}{{x,2},y} expands to  \frac{\partial^3 f}{\partial x^2\,\partial y} et cetera for any number of derivatives.   Bonus points for an optional argument so that for instance   \D[subscript]{f}{{x,2},y} expands to f_{xxy}   I looked at the  package but the syntax is a little tedious.  For instance, to get \frac{\partial^3 f}{\partial x^2\,\partial y} with that package I would need to do \md{f}{3}{x}{2}{y}{}.  And it doesn't generalize to three variables.  Before I dive in I thought I'd ask the hive and see what's been done. Let $G$ be a simply connected algebraic group defined over $C$.   Note : I see the definition of simply connected as "Every isogeny to $G$ is an isomorphism" as given in Hochschild's  "Basic Theory of Algebraic Groups and Lie algebras".   $C$ is an algebraically closed field.   Please help me realise the follwoing things provided they are true:   $G_C$ (the $C$-points of $G$) is simply connected as well. $Lie(G) \cong Lie(G_C)$    Thanks ! How to install the latest Arduino IDE? Why can current only flow in loops? In the following image:   Why can't current flow across the following wire? It's a simple question, but I've kind off always wondered.  Thanks! I'm trying to watch for any new output of a log file. Another script (not under my control) is deleting the file then creating a new one with the same name. Using tail -f doesn't work because the file is being deleted. How to show that $f_{0}f_{1}+f_{1}f_{2}+...+f_{2n-1}f_{2n} = f^{2}_{2n}$ The following problem:  The Fibonacci number is denoted by  $f_{n}$, show that the following holds when $n$ is a positive integer:  $f_{0}f_{1}+f_{1}f_{2}+...+f_{2n-1}f_{2n} = f^{2}_{2n}$  My idea was to do an induction proof, which holds for $n$ = 1  $f_{0}f_{1} + f_{1}f_{2} = f^{2}_{2}$  So we assume it holds for $n$ and show for $n+1$  $f_{0}f_{1}+f_{1}f_{2}+...+f_{2n-1}f_{2n} + f_{2n}f_{2n+1} = f^{2}_{2n} + f_{2n}f_{2n+1}$  I fail to get  $f^{2}_{2n+1}$ out of the term  $f^{2}_{2n} + f_{2n}f_{2n+1}$  Is there a difference between "show that" and "prove that". So might be induction the wrong tool here?  Many thanks for your hints in advance :-) How to completely remove Notepad++ in Ubuntu 18.04 terminal?  I can't find it in Synaptic package manager, and don't know where is on system, but I can see an icon in Activity. It is probably not completely installed, because I can't open it. When moving around the sites on Stack Exchange using Safari on my iPad (not the Stack Exchange App), I am fine when moving to any site other than SuperUser.  When logged in, I can switch sites and stay logged in, but when I switch to Super User I need to log in again. If I choose not to log in and switch to another site, I am logged in there. Is there a problem with the login handling for Super User? If it helps, I log in with a Stack Exchange account, not through Facebook or Google. Update After getting fed up with the problem, I took the advice given in the answer below which was to use Chrome, and the problem still exists. The same goes for Firefox. Have I missed something?  As you can see from the screenshots below, there are no cookie settings to be found. Chrome for iOS settings page  Privacy settings page  Content settings page  Google app settings page For every prime of the form $2^{4n}+1$, 7 is a primitive root. apex:inputField can only be used with sObjects I am trying to create a custom visualforce page that saves new opportunity contact roles to an opportunity. I am having trouble creating the first step of listing out all contacts that relate to that account. The error I am getting is...     Save error: Could not resolve the entity from  value binding '{!u.contact}'.   can only be used with SObjects, or objects that are Visualforce field component resolvable.   I do not understand why I am receiving this error. u.contact should resolve to a Contact object, which is an sObject. Am I misunderstanding something?  Here is my code...  Controller  public class ChooseContactController  {     public String accountId = ApexPages.currentPage().getParameters().get('accountId');     public Account account { get; set; }     public List&lt;UnfundedOpportunityContactRole&gt; unfundedOpportunityContactRoles { get; set; }      public ChooseContactController()      {          unfundedOpportunityContactRoles = new List&lt;UnfundedOpportunityContactRole&gt;();         List&lt;Contact&gt; contacts = [SELECT Id, Name FROM Contact WHERE AccountId =: accountId];         account = [SELECT Id, Name FROM Account WHERE Id =: accountId];          for(Contact c: contacts)          {             unfundedOpportunityContactRoles.add(new UnfundedOpportunityContactRole(c, 'The Man'));         }     }      public void Save() {}     public void Create() {}      public class UnfundedOpportunityContactRole     {         public Contact contact { get; set; }         public String role { get; set; }          public UnfundedOpportunityContactRole() { }          public UnfundedOpportunityContactRole(Contact contactParam, String roleParam)         {             this.contact = contactParam;             this.role = roleParam;         }     } }   VF page  &lt;apex:page controller="ChooseContactController"&gt;   &lt;apex:form &gt;     &lt;apex:pageBlock title="Choose a contact" mode="edit"&gt;       &lt;apex:pageBlockButtons &gt;         &lt;apex:commandButton action="{!create}" value="New"/&gt;         &lt;apex:commandButton action="{!save}" value="Save"/&gt;       &lt;/apex:pageBlockButtons&gt;         &lt;apex:pageBlockSection title="{!account.Name}"&gt;           &lt;apex:dataTable value="{!unfundedOpportunityContactRoles}" var="u"&gt;             &lt;apex:column headerValue="Contact"&gt;               &lt;apex:inputField value="{!u.contact}" /&gt;             &lt;/apex:column&gt;             &lt;apex:column headerValue="Role"&gt;               &lt;apex:inputField value="{!u.role}" /&gt;             &lt;/apex:column&gt;           &lt;/apex:dataTable&gt;         &lt;/apex:pageBlockSection&gt;     &lt;/apex:pageBlock&gt;   &lt;/apex:form&gt; &lt;/apex:page&gt; What my thought was that the bijection was a piecewise function:  $f(x) = 1/n+1$ if $x = 1/n$ for some $n \in \Bbb N$ and $x=1/n$ if $x \neq1/n$ for some $n \in \Bbb N$.  However, the textbook says this is incorrect. I don't actually see why. Was it a matter of brackets or the open variable $(0,1]$, which is what I tend to think. I am studying statistics and I am wondering when it comes to standard error or a sampling if the calculation changes when there are weights added.   I have a weighted mean:  $$\mu_{w} = \dfrac{\sum_{i=1}^Nw_ix_i}{\sum_{i=1}^Nw_i}$$ and a weighted variance calculated by:  $$s^2_{w}=\dfrac{\sum_{i=1}^Nw_i}{(\sum_{i=1}^Nw_i)^2-\sum_{i=1}^Nw_i^2}\cdot \sum_{i=1}^N(x_i-\mu)^2$$  is the sampling error still calculated as  $$\text{SE}=\sqrt{\dfrac{s^2_{w}}{n}}$$ Take the following two lines of code:  for (int i = 0; i &lt; some_vector.size(); i++) {     //do stuff }   And this:  for (some_iterator = some_vector.begin(); some_iterator != some_vector.end();     some_iterator++) {     //do stuff }   I'm told that the second way is preferred. Why exactly is this? How can I manually create a pixel perfect image sprite?