I am studying bitwise operations in bash and understand all the other operations, but this one. It will be a great help if someone can explain (with examples) what the negation (~) operator does in bitwise operations. Couldn't understand from what I read here and elsewhere. TIA!
$ echo $(( 255 )) 255 $ echo $(( 33 )) 33 $ echo $(( ~33 )) -34 $ echo $(( ~255 )) -256 $    and my kernel is:  $ uname -a Linux HOSTNAME 3.2.0-40-generic-pae #64-Ubuntu SMP Mon Mar 25 21:44:41 UTC 2013 i686 i686 i386 GNU/Linux     QUESTION: ~ is for negating the number AFAIK. But why does ~33 produce -34 and why does ~255 produce -256?
Creating a copy of primary database and attaching the copy database in the same sql instance I just got into a project in which we have only one SQL Server 2012 copy. We have 12 databases attached to the primary instance of SQL Server 2012.  As I don't have SQL Server 2012 or supporting OS, I have to depend on the primary instance of SQL Server 2012.  I am not sure whether it is good to create copy/clone of all 12 databases and attach it to same instance and work on the copy for data manipulation and query testing purpose.  Based on Kin's query  SELECT    SERVERPROPERTY ('MachineName') AS PhysicalMachineName,    SERVERPROPERTY ('ServerName') AS SQLServerName,    SERVERPROPERTY ('Edition') AS ServerEdition,    CAST(SUBSTRING(@@Version,charindex('SQL',@@version, 1),15) AS VARCHAR(255)) +  ' + '         + CAST (SERVERPROPERTY ('productlevel')AS VARCHAR (50)) + ' + (Build'        + CAST (SERVERPROPERTY ('ProductVersion') AS VARCHAR (50)) +')' AS ProductVersion,     RIGHT(@@version, (Len(@@Version)-charindex('Windows',@@version, 1))+1) AS [O.S.],  SERVERPROPERTY ('Collation') AS Collation   Following is the output. I ignored PhysicalMachineName and SQLServerName.  ServerEdition : Business Intelligence Edition (64-bit) ProductVersion : SQL Server 2012 + RTM + (Build11.0.2100.60) O.S.           : Windows NT 6.1 &lt;X64&gt; (Build 7601: Service Pack 1)  Collation      : SQL_Latin1_General_CP1_CI_AS Didn't Harry have any other family he could have searched for? You'd think that as soon as Harry met someone who was friends with his dad, he'd have asked about his family.  Certainly Lupin or Sirius could have told him something of his family, given that they were James' closest friends, and Sirius was "always welcome at the Potters".  Obviously there's nothing in the books, but did J.K. Rowling ever explain why there was no mention of any living relative other than Aunt Petunia, or even what happened to Harry's grandparents? Can ANOVA be significant when none of the pairwise t-tests is? Is it possible for one-way (with $N&gt;2$ groups, or "levels") ANOVA to report a significant difference when none of the $N(N-1)/2$ pairwise t-tests does?   In  @whuber wrote:      It is well known that a global ANOVA F test can detect a difference of means even in cases where no individual [unadjusted pairwise] t-test of any of the pairs of means will yield a significant result.   so apparently it is possible, but I do not understand how. When does it happen and what the intuition behind such a case would be? Maybe somebody can provide a simple toy example of such a situation?  Some further remarks:   The opposite is clearly possible: overall ANOVA can be non-significant while some of the pairwise t-tests erroneously report significant differences (i.e. those would be false positives). My question is about standard, non-adjusted for multiple comparisons t-tests. If adjusted tests are used (like e.g. Tukey's HSD procedure), then it is possible that none of them turns out to be significant even though the overall ANOVA is. This is covered here in several questions, e.g.  and . Update. My question originally referred to the usual two-sample pairwise t-tests. However, as @whuber pointed out in the comments, in the ANOVA context, t-tests are usually understood as post hoc contrasts using the ANOVA estimate of the within-group variance, pooled across all groups (which is not what happens in a two-sample t-test). So there are actually two different versions of my question, and the answer to both of them turns out to be positive. See below. How do I move Steam games to a new computer without re-downloading them? I have just bought a new computer and I have everything migrated over except for my Steam games.  I looked in Program Files/Steam/ and I found a folder full of the games I have downloaded, but I do not know if it is safe to just copy these folders from one computer to another (seeing as a lot of other applications will not work if you do this), or is there another recommended way?  I don't really feel like re-downloading all my games. I don't have the time nor bandwidth to download 20GB over a 1.5mbps connection.  Is it possible to contact Valve and get a disk with the games on it? Add/Delete table rows dynamically using JavaScript AIC versus Likelihood Ratio Test in Model Variable Selection The software that I am currently using to build a model compares a "current run" model to a "reference model" and reports (where applicable) both a chi-squared p-value based on likelihood ratio tests and AIC values for each model.  I know that one advantage of AIC over likelihood ratio tests is that AIC can be compared on non-nested models.  However, I am not aware of any reason why AIC couldn't or shouldn't be compared on nested models.  In my model, when comparing nested models for variable selection, I'm finding several cases where the likelihood ratio test and the AIC comparison are suggesting opposite conclusions.  Since both are based on likelihood calculations, I'm struggling to interpret these results.  However the documentation of my software says (without explaining),   "If two models are nested (i.e. one is a sub-set of the other) then the more usual chi-squared test is the most appropriate to use. If the models are not nested, the AIC can be used..."  Can anyone elaborate on this and/or explain why AIC is not as helpful as likelihood ratio tests on nested models? How can I take shallow depth of field photos with a point-and-shoot camera? I have a compact digital camera, and in macro mode I can manage to achieve a blurred background, if the background is far enough away. Can this be done when taking non-macro pictures, and if not, is there a way to simulate it?  When I shoot portraits with my brother's DSLR, it is quite easy to fade out the background. But with my point and shoot camera, I haven't been able to take such photos.   I choose a large aperture for my camera but it still doesn't work. I know that standing further and zooming will result in a smaller depth of field, but it doesn't seem to be enough to get the really nice "bokeh" look. I've tried macro mode, and that will work if the subject is close enough and the background far enough away, but how can it be done with non-macro pictures?   Why are DSLR cameras are so much better in this area? What are the general recommendations to do this using a compact or super-zoom camera? Restrict the access to suggested edit reviews on deleted posts on an answer deleted as rude/abusive is visible, even without logging in (and for users with less than 10k reputation). These users can't see the answer , via the , or a direct link to the .    This is a potential avenue for spammers, just like the suggested edit spam used to be, but is ; according to the :     In addition, in order to reduce the incentive for spammers to make spam edits that get rejected, suggested edit spam is hidden from logged-out users, so they can't show their clients public-facing pages with spam (so they won't get paid).   For this to work, the spammer would need two accounts, one to post the spam and a second one to suggest an edit. Even if the spam post is quickly nuked, the review link will be active forever. One could argue that logged-in users without 10k reputation shouldn't be able to see the suggested edits either; I'm partial to that. Are there any reserved words in SQLite? Why is the net speed of Stack Overflow so fast? This question is about the net speed.  I'm from China, and I find that opening pages on Stack Overflow is very fast, normally within a range of 1 to 4 seconds. This speed is very good for a website outside China; it's even faster than some native websites.  Not every website outside China has such good speed, so I am wondering why and how Stack Overflow manages to be so quick. Proving which QM interpretation is correct Let's assume that the existence of gravitons is theoretically proven or they are detected by LHC could one interpretaion be proven correct? How is dark energy consistent with conservation of mass and energy? I initially thought that dark energy must in some way violate conservation of mass and energy since the component of the energy density of space that comes from dark energy is constant, and space is expanding. Therefore, as space expands the energy in the universe that comes from dark energy would increase. I presumed the source of this energy was not coming from the conversion of other types of energy to dark energy, so it must violate conservation.  I decided to Google this and came upon this article:    It says that dark energy does NOT violate conservation and quotes Carroll, Press, and Turner (1992):  "…the patch does negative work on its surroundings, because it has negative pressure. Assuming the patch expands adiabatically [i.e. without loss or gain of heat], one may equate this negative work to the increase of mass/energy of the patch. One thereby recovers the correct equation of state for dark energy: P = – ρ c2. So the mathematics is consistent."  Is there a way to explain this in layman's terms? (The blog attempted to do this, but it was very unclear to me.) More specifically, can you explain where my initial train of thought described above fails when I erroneously concluded that dark energy violates conservation?  Thank you. Irreducible cyclotomic polynomial I want to know if there is a way to decide if a cyclotomic polynomial is irreducible over a field $\mathbb{F}_q$? Abstract, Interface, Classes OH MY - Question on Approach How to query MongoDB with "like"? Jewish Law prohibits the  However, butter, a milk product, is a kitchen staple for most cooked emulsions (eg. pan-sauces, sauces béchamels, or roux-based sauces). While I use appropriate cooking fats for making non-dairy versions for meat dishes, this frequently doesn't work.  What is a non-dairy fat which may be used to as an emulsifier or roux ingredient? Detecting the onload event of a window opened with window.open Surfing the web anonymously What is the best, fastest, safest way to surf the web anonymously, and how much anonymity can you really achieve? "Use Option as Meta key" with ability to type the # symbol I am using Terminal version 2.5, where I have two requirements:  I need to be able to type the Meta key. I need to be able to type the # character, too (Option+3 for the UK keyboard layout)  How can I satisfy both of these? By default, (2) is satisfied, but (1) is not. I can then turn on &quot;Use Option as Meta key&quot;, which satisfies (1), but breaks requirement (2). How can I have both? (It shouldn't be so hard for me to just be able to type.) Edit: what I'm looking for, for example, might be a way to just &quot;Use Option as Meta key&quot; for the left/right Option key, or a way to override the &quot;Use Option as Meta key&quot; for the sole exception of the # character. C state-machine design