How to get the date and hour information for a given datetime object in Transact-SQL?  E.g. 2014-12-18 21:00:00 for 2014-12-18 21:24:05.  I need to truncate off all parts after the hour - i.e. minutes, seconds, and partial seconds.
In SQL Server, how do I "floor" a DATETIME to the second/minute/hour/day/year?  Let's say that I have a date of 2008-09-17 12:56:53.430, then the output of flooring should be:   Year:  2008-01-01 00:00:00.000 Month: 2008-09-01 00:00:00.000 Day: 2008-09-17 00:00:00.000 Hour: 2008-09-17 12:00:00.000 Minute: 2008-09-17 12:56:00.000 Second: 2008-09-17 12:56:53.000
So I integrate the holomorphic function $\frac{e^{iz} -1}{iz}$ over the half disk in the upper half plane, let me name it $\Gamma$. By using Cauchy's theorem, it equals 0.  $$0 = \int_{\Gamma} \frac{e^{iz} -1}{iz} = \int_{0}^{\pi}(e^{iRe^{i\theta}}-1)d\theta + \int_{-R}^{R} \frac{e^{it}-1}{it}dt$$  ($Re^{[0, \pi]}$ and $t: [-R, R]$ being the respective parametrizations.)  By splitting the left integral in two, I get $\int_{0}^{\pi} e^{iRe^{i\theta}}d\theta \rightarrow 0$ by dominated convergence, and $\int_{0}^{\pi} -1d\theta = -\pi$. By making $R \rightarrow \infty$, I'm left with  $$\pi = \int_{-\infty}^{\infty} \frac{e^{it} - 1}{it}dt = \int_{-\infty}^{\infty}\frac{\sin t}{t}dt + \int_{-\infty}^{\infty}\frac{\cos t -1}{it}dt.$$  How do I get rid of the integral on the right? I welcome all feedback. What to include in my portfolio? I am a relatively recent graphic design graduate. I have been working at a small printing house for about two years, but will soon be interviewing for a different position in another city.  My question is about what to include in my design portfolio. When I was in school, my professors all insisted that work included in a portfolio should be 100% original: my original photography, my original logos, my original layout, my original written content etc. However, at my current office, we rely heavily on client-supplied logos, type content, and photography—and stock photography (shutterstock, etc).  What do other designers include in their portfolios? Has anyone else had this issue and can I reasonable include these more recent projects in my portfolio if I label them appropriately (something like "layout design")? Access images inside jar Statistics module doesn't show the "Enable access log" checkbox I dont know what to do to show "Enable access log" option.  I activated logging all messages and checked all statistics permissions.  Thanks. Invariance, covariance and symmetry Though often heard, often read, often felt being overused, I wonder what are the precise definitions of invariance and covariance. Could you please give me an example from field theory? Hello. I was trying to make a bootable flash drive from the startup disk creator, and when I went to erase the flash drive I accidentally erased the wrong drive, a 1TB removable drive. The operation took less than a second and gave no warning. I tried erasing the flash drive and it took about a minute, but it took but a second to erase the 1 TB drive, which is very surprising.  Please help, Gabriel What is the ancestral form of language used in the fable that David was studying during the flight? David studies linguistics during the flight to LV-223. We get to listen and read a fable. Is it written in a real language? What is the name of the language? Can the fable be translated?  Approximate quotation:     hjewis jasma hwaelna nahast akwunsez dad'kta, tam ghermha vagam ugenthe On iPhone it's very easy to clone an app (running multiple copies of the app on the same device); e.g.:    Is it possible to do this on Android? macOS Catalina File Structure: Cannot remove &gt; sudo rmdir /sw rmdir: /sw: Read-only file system  &gt; mount | grep read /dev/disk1s5 on / (apfs, local, read-only, journaled)  &gt; sudo mount -o rw / &gt; mount /dev/disk1s5 on / (apfs, local, journaled) &gt; sudo rmdir /sw rmdir: /sw: Operation not permitted     root /&gt;$ mkdir a root /&gt;$ rmdir a root /&gt;$ rmdir sw &lt;b&gt;rmdir: sw: Operation not permitted&lt;/b&gt; root /&gt;$ rmdir opt &lt;b&gt;rmdir: opt: Operation not permitted&lt;/b&gt; root /&gt;$ rmdir mnt &lt;b&gt;rmdir: mnt: Operation not permitted&lt;/b&gt; root /&gt;$ rmdir home &lt;b&gt;rmdir: home: Operation not permitted&lt;/b&gt;   What exactly is preventing me from removing these directories even with SIP disabled? macOS Mojave won't install updates past 10.14.1 due to requirement for APFS formatting I have a MBP 2012 I upgraded from High Sierra to Mojave after it came out as GA. I don't recall if I was asked about upgrading to APFS when Id id that, but at this time the main volume is Mac OS Extended (Journaled).  My current About This Mac...version is Mojave 10.14.1 (18B75). Now, when updates are advertised from the App Store, I'm unable to upgrade because 10.14.3 is required.  No OS updates show in the App Store, and when I searched for the updaters (10.14.2 Combo, etc), I can't install because the installer reports "macOS 10.14.2 Update can't be installed on this disk. This Mac can only install macOS on APFS-formatted drives."  I tried the search results recommending to boot in Recovery Mode and use Disk Utility, but APFS is not available as a type.  I have good backups and I can reformat the boot volume if I need to, but I have not done this before. Should I get a 10.14.3 installer to do this and boot from an external drive? The only guies and message boards I've found just keep saying to install 10.14.3 (I can't) or convert the disk in Recovery Mode (APFS is not available as an option.)  Any known-good ways to get my 10.14.1 upgraded so I can keep getting App Store updates? What happens to a bounty question if it gets migrated? clearly belongs elsewhere, but the asker already put a bounty on the question.  If the question is migrated, does the rep get refunded? Does the question continue to be a bounty question on the target site if the user has enough rep? (The asker in the referenced question does not have any associated accounts, but I'm curious about what happens.)  Edit: I just tried to add my own close vote, but apparently you can't when there's an open bounty. However, a mod should still be able to close/migrate/etc. How to derive this version of variance formula A probably very easy computational question, but I don't really understand how it's done:  I try to compute the point estimates of a normal distribution as $N \sim (\beta, \sigma)$. Using the method of moments, we get:  $$\frac{1}{n} \sum_{i=1}^{n} X_{i} = \hat{\beta}$$  $$\frac{1}{n} \sum_{i=1}^{n} X_{i}^{2} = \hat{\sigma}^2 + \hat{\beta}^2$$  Solving the two equations for the two parameters, we get:  $$\hat{\beta} = \overline{X} $$   and   $$\hat{\sigma}^2 = \frac{1}{n} \sum_{i=1}^{n} (X_{i} - \overline{X}_n)^2 $$  My question is: How do we get to the term of $\hat{\sigma}^2$? If I try to compute it, I get:  $$\hat{\sigma}^2 = \frac{1}{n} \sum_{i=1}^{n} X_{i}^2 - (\frac{1}{n} \sum_{i=1}^{n} X_{i} )^2 $$  Can someone show me how to simplify the last term to what is stated above and what "rule" or law" is used there? Since it is used so often, I really wanna understand this. Why is the comma splice an error? It's always drilled into us that we shouldn't use comma splices. They're bad, to be avoided and poor form.  But why? What makes the comma a faulty choice in something like this:     I never liked school, it was boring and repetitive most of the time.   It could be replaced with a semicolon, dash, period or colon and be "correct." Yet to a fair amount of people, the comma seems fine. If it weren't, it wouldn't be found so often in online forums, text messages, emails and so on.  What makes the comma between two sentences an error? Domain of ProbabilityDistributions Noun for "person with intermediate skill" I'm looking for the noun form of "person with intermediate skill". For example, in the context of a particular activity, "person with no skill" might be designated a novice, and "person with much skill" might be designated an expert. However I know of no such word in between these two extremes.   My only thought is amateur, which has a distinct meaning from describing level of skill, although skill level can often be inferred. I'm looking for a better solution.  EDIT: due to the attention this question has received, I'll try to offer some clarification in order to reduce repeat questions.   "Journeyman" would certainly not work. I am a software developer by profession. However the word I'm looking for should hopefully be profession-agnostic. I am trying to designate the skill level of the person that some learning material might be appropriate for. The word that I'm looking for follows the preposition "for".   For Beginners  For [word for intermediate-skilled person] For Experts  Sorry, but even after all the great answers, I'm still learning towards "amateur" even though it is technically incorrect. Also, the word should not be so esoteric that only people with English degrees know what it means. Keep the ideas coming! Defender of the Realm hat broken, or just badly worded? Description of the hat unlock requirement:     at least 5 flags dismissed as helpful and at most 20% of non-disputed flags declined   Does "dismissed" mean something unusual here, or is this hat not unlocking properly? I'm not sure if that means "since winter bash started" or "since your account was created": if the former, I've flagged 8 items so far today, of which 6 were marked "helpful" (the other two are still active; none have been disputed or declined). If the latter, the flag page indicates I've flagged 391 items (plus 6 for spam), of which 1 was declined (which incidentally, I assume that was by accident, given that the question was closed soon after for the reason I flagged it for), 1 was disputed (that one was legitimate), and 21 are still open. That is definitely way under 20%.  So what's up with that unlock?  edit: it appears to be the case (further edit: this has now been confirmed first-hand) that this hat unlock disregards any flags that are the flag equivalent of voting to close. I put forth that if this is intended behavior, well, it shouldn't be (if it's to equalize the playing field for over-3k-rep people, it should just also count votes-to-close. Though granted, I suppose in the scheme of things it really doesn't matter much, as it'll all go away in a couple weeks anyway. But dang it, I want to show off all the flagging I do! :p) How do I properly use the "Not an Answer" flag? What is the "Not an Answer" flag and what is its purpose? When should I use this flag? When should I not use this flag? But I'm still not sure if I'm using the flag correctly... An answer is "Not an Answer", but the flag was declined or disputed!   See also: Is 'clamp' a formally recognized mathematical function? I was surprised to find the clamp function absent from  and . Is this mainly a concept particular to computer programming? Is it known by another name in mathematics? I'll be editing the Wikipedia shortly to include a reference to this function but I want to make sure I'm not omitting some synonymous terms I'm currently unaware of.  $$   \operatorname{clamp}(x) = \max( a , \min( x , b ) ) \in [a,b] $$ Notify question OP (and those who marked it a favourite) if an answer has been modified Seriously, I had not noticed e.g. Jeff's edit  had he not also retagged my question. How to setup a restricted SFTP server on Ubuntu? I would like to know how to set up root, sudo, sftp-only user accounts which won't be required public key authentication at log in. I would also like to know how to set up sftp-only users' home directories where they can't access upper level other directories.