What i need to do here is simple but for some reason i'm just drawing a blank on this and need some assurance on how to do it correctly.  I'm trying to determine the UTC equivalent of 5AM Pacific Time tomorrow. I'm trying to do this without relying on the server time as i have no way of knowing what time zone this is.  I just need a sanity check on the following. Is this the best way to do this? Am i going to run into issues with the server time being off? Is this going to give me a accurate representation of 5am tomorrow UTC?  DateTime datetime = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.AddDays(1).Day, 5, 0, 0); //5AM tomorrow TimeZoneInfo pstZone = TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time"); DateTime pstTime = TimeZoneInfo.ConvertTimeToUtc(datetime, pstZone);   TIA
I'm trying to create a unit test to test the case for when the timezone changes on a machine because it has been incorrectly set and then corrected.  In the test I need to be able to create DateTime objects in a none local time zone to ensure that people running the test can do so successfully irrespective of where they are located.  From what I can see from the DateTime constructor I can set the TimeZone to be either the local timezone, the UTC timezone or not specified.  How do I create a DateTime with a specific timezone like PST?
Example:  A tall(,) green pole.   says that cumulative adjectives don't need comma. In my example, &quot;tall&quot; describes shape, and &quot;green&quot; describes color. So they are cumulative adjectives. But  says that &quot;tall&quot; and &quot;green&quot; are equivalent and coordinate adjectives ... I'm confused. Should there be a comma or not? Custom Adapter for List View Do I need to have antivirus software installed? I thought that there was no need to scan for viruses either in Ubuntu or any Linux distros until I found virus scanner packages clamtk and klamav in Ubuntu software center yesterday.  This leads to the following questions:   How do viruses differ between Linux and Windows? How do the strategies for protection differ between Linux and Windows? Should a virus scanner package be installed on my system? If so, which would be a better option? ChaCha with 64bit integers as a PRNG with streams Can I use ChaCha with four rounds as a good non-cryptographic PRNG with different streams if I use 64 bit integers instead of the standard 32 bit integers? I need a bigger state and this seems the easiest way to do it. Is there a better name for this than "emphatic and"? In semi-poetic writing, I have had occasion to deviate from the standard prose list practice (interpose commas or semicolons between items, with an "and" preceding the final item), by utilizing a second or third and to separate three or four items.  That is,       Bob likes beer, wine and liquor.   The variant would be:     Bob likes beer and wine and liquor.   Now, the usage is obviously nonstandard and should be avoided in formal writing, but for those instances where poetic variation may be justified.    What is it called?  "Emphatic And" is the best I can coin on my own, but I wonder if there is a more established name for this variation. Then what is the probability that out of $n$ men $A_1,A_2,....,A_n$ each aged $x$ years,$A_1$ will die and will be the first to die Let $p$ be the probability that a man aged $x$ years will die in a year time.Then what is the probability that out of $n$ men $A_1,A_2,....,A_n$ each aged $x$ years,$A_1$ will die and will be the first to die?  The probability that a man aged $x$ years will die in a year time$=p$  The probability that a man aged $x$ years will not die in a year time$=1-p$  But from here on,i got stuck.Some hints and suggestions are welcome. Linux - why do the su and sudo binaries need to be set-UID root? I am trying to find the correct reason for the stated question. My understanding is that:   sudo needs to read the /etc/sudoers file which is only readable by root, which is why it needs to be set-UID root su is going to create a new shell with a different real and effective UID, and needs to check the password. To check the password, it needs to read /etc/shadow, which is why it needs to be set-UID root. After checking password, it would need to call setuid() on the forked process, and to use an arbitrary UID argument, its parent process must have root as effective UID, so this also makes another reason.   Are the above reasons correct ? Mid 2012 MBP shuts down claiming no power with charge at 30% or 40% or more I have two mid 2012 MBPs. Sometime last year they both started randomly shutting down and showing the 'please plug me in to power' image when trying to start them up. That would be fine if the batter was at 1% or less but this happens when the battery is at anywhere from 30% to as high as 48% full. The power cycle info says 500 cycles or so. Both of them do this. They are both patched current, always. I asked Apple they suggested NVRAM PRAM and SMC reset, as expected, which had no effect. Any ideas? Why is current a scalar quantity? How do I get the difference between two Dates in JavaScript? I'm creating an application which lets you define events with a time frame.  I want to automatically fill in the end date when the user selects or changes the start date.  I can't quite figure out, however, how to get the difference between the two times, and then how to create a new end Date using that difference. Can't download any app from AppStore! I'm using iPhone 6s 16 GB. My storage isn't full but still I can't download anything. Every time I wanted to start a download it keeps telling:  app name* could not be download at this time How to redirect with "www" URL's to without "www" URL's or vice-versa? I am using ASP.NET 2.0 C#. I want to redirect all request for my web app with "www" to without "www"  www.example.com to example.com  Or  example.com to www.example.com  Stackoverflow.com is already doing this, I know there is a premade mechanism in PHP (.htaccess) file. But how to do it in asp.net ?  Thanks File changed listener in Java I'd like to be notified when a file has been changed in the file system. I have found nothing but a thread that polls the lastModified File property and clearly this solution is not optimal. Show that if $u$ is harmonic in $\mathbb R^n$ and $u=o(|x|)$, then $u$ is a constant.(Hint: use the solid version of the mean value property $u(x)=\frac{1}{\omega R^n} \int _{B_{R(x)}} u(y)dy$, and estimate $|u(x)-u(x')|$.)  Can anyone tell me how to use this hint? Determine $4$ specific digits in $34!$ Find the values of $a,b,c,d\in\mathbb{N}$ such that      $$ 34!=295232799cd9604140847618609643ab0000000 $$   My Attempt:  The factorial of $34$ contains a $3$, so the RHS must be divisible by  $3$. Similarly, it must be divisible by $7$, $11$, $13$, $19$ etc.  But I do not understand how can I calculate $a,b,c,d$ in this equation. Prove that 10101...10101 is NOT a prime. So basically we have a number $10101...10101$ that contains $2016$ zeros and can be written as$ \sum _{ k=0 }^{ 2016 }{ 100^{ k } }$ . I want to prove that this number is not a prime without using anything besides a piece of paper and a pen. I'm stuck on this for quite a few days now. Give a combinatorial proof to show the following for all integers $n \geq 2$. $$2^{n-2} n (n -1) = \sum\limits_{k=2}^n k (k - 1) \binom{n}{k}.$$  I'm completely stumped. I just have no idea how to do this. What I've tried so far has been simplifying the right hand side slightly to $\sum\limits_{k=2}^n \binom{n}{k - 2}$, and then proving that this somehow is equal to some manipulation of the left hand side. I can't seem to find any breakthroughs that way though.  If anyone could help out or point me in the right direction that would be great.  EDIT: I've actually just realized my simplification of the right hand side is wrong. Now I'm even more stuck. $\lim_{h\to 0}\int \frac{f(x+h)-f(x)}{h}\,\mathrm{d}x = f(b)-f(a)$ Let $f:[a,b]\to  R$ be integrable and continuous on $(a,b)$. Prove that: $$\lim_{h\to 0} \int_a^b\frac{f(x+h)-f(x)}{h} \,\mathrm{d}x = f(b)-f(a).$$  What I've tried so far: make a change of variables, which didn't help. I also thought of using the intermediate value theorem inside the integral, but the function being differentiable is not specified. Any help, tips? Thanks in advance! Prove that the graph is connected I was wondering if someone can help me understand how prove that this graph is connected.  Given a graph with n vertices, prove that if the degree of each vertex is at least $(n − 1)/2$ then the graph is connected.  So far I know that about connected graphs:  An undirected graph is called connected if there is a path between every pair of distinct vertices of the graph  The distance between two vertices in a graph is the length of the shortest path between them.  The diameter of a graph is the distance between the two vertices that are farthest apart. Are there any disadvantages to using your companions for transporting Power Armor