whether a given date lies between other two dates (where dates are manually created using dd-MM-yyyy format)      Date startDate, endDate, dateToCheck; if (dateToCheck.equals(startDate) || dateToCheck.equals(endDate) ||      (dateToCheck.after(startDate) &amp;&amp; dateToCheck.before(endDate))
I have a series of ranges with start dates and end dates. I want to check to see if a date is within that range.  Date.before() and Date.after() seem to be a little awkward to use. What I really need is something like this pseudocode:  boolean isWithinRange(Date testDate) {     return testDate &gt;= startDate &amp;&amp; testDate &lt;= endDate; }   Not sure if it's relevant, but the dates I'm pulling from the database have timestamps.
Is B1 visa in perfect condition valid on old damaged passport? I got my US B1 visa last month on my Indian passport. Someone in my family wrote a phone number on one of the blank page of my passport. As my passport is damaged now, can I travel with my current passport to US or I should apply for new passport? Also, will B1 visa be valid on old damaged passport if I get new passport? What if the universe is rotating as a whole? Suppose in the milliseconds after the big bang the cosmic egg had aquired some large angular momentum. As it expanded, keeping the momentum constant (not external forces) the rate of rotation would have slowed down, but it would never reach zero.  What implications would that have to measurments to distant supernova and CMB radiation? Do we have any experimental data that definitely rules out such as scenario? And to what confidence level?  Edit A  suggests that the universe might indeed be spinning as a whole. Anyone care to poke holes at it?  Edit 2 Even more  places limits on possible rotation. Why does cout print char arrays differently from other arrays? I'm using C++ to understand how exactly pointers work. I have this piece of code using arrays, which I'm using just to understand how the equivalent works with pointers.  int main() {         int arr[10] = {1,2,3};         char arr2[10] = {'c','i','a','o','\0'};     cout &lt;&lt; arr &lt;&lt; endl;     cout &lt;&lt; arr2 &lt;&lt; endl; }   However when I run this, arr outputs the address of the first element of the array of ints (as expected) but arr2 doesn't output the address of the first element of the array of chars; it actually prints "ciao".  What is it that I'm missing or that I haven't learned yet about this? Is it really going to damage a bike to wash it with a hose? I was chatting to the guys at my LBS the other day about how they get my bike so clean when I take it in for a service. They said they use compressed air to clean it.   They warned I shouldn't use any high pressure water because it can get into the sealed bearings and cause damage. I also noted on the  (right at the end) that you should "Never spray your bicycle with water under pressure".  How much of an issue is this? Rinsing the bike with the hose is such a convenient way to wash off loose grit and then the soap after washing. How do you clean your bikes? This discussion informed our process for seven years, but eventually required updates and augmentation. For discussion regarding the successors to this process, please see:    Stack Exchange has some of the best Moderators around — seriously — and that is due in no small part to the communities who scrutinize and vote in our Moderator elections.  We have a rather formal process for electing moderators, but up until now  has been quite informal. On those rare, rare occasion when things just aren't working out, you can see why it becomes such a sticky business to remove someone from a democratically elected position. Our current process is one of &quot;we've got your back.&quot; The Community Team routinely monitors moderator activities, so if a moderator violates the  or fails to uphold the , we can and do intervene. If the disputes and problems persist without resolution, eventually we can ask someone to step down. That's not good enough. We need a much more transparent and prescribed process for when — and more importantly how — to intervene when on-going problems are going unresolved. In urgent situations, we'll step in to protect a site, but ideally the process should be impartial and not subject to accusations of Stack Exchange simply applying undue influence over a community when the whim strikes. The Question: Before we start bouncing around ideas internally, I'd like to hear what you think. What process should be in place to add some checks and balances to deal with higher issues like possible impeachment of a moderator? When and how would such a process come into play? How should such situations be resolved? How do we keep it from being abused? Have at it. This is a round table vetting of ideas. For those who duplicated my previous question - ; am NOT asking how to install Skype for God's sake!!   The question was rather - I already have Skype installed, the thing is there is no possible option for me to do group video call or group screen share. The interface itself resembles the times when Skype was newly born. While on Windows, Skype's latest version is around 6.(something), here it's only 4.3. In Windows group video call is now free on Skype, here I can't even do video call! I think this is a major drawback for an otherwise so good OS! Is there anything that can be done about it?  Thanks for any help!  For those who don't have an answer for me, I still thank you for at least understanding my question!!  Have a good day! Why does the new review page sometimes shows questions to vote to close without anybody having voted to close it? how I can continue this limit resolution?  The limit is:   $$ \lim_{n \to \infty}{\sqrt[n]{\frac{n!}{n^n}}} $$  This is that I have done:  I apply this test: $ \lim_{n \to \infty}{\sqrt[n]{a_n}} = \frac{a_{n+1}}{a_n} $  Operating and simplifying I arrive to this point: $$ \lim_{n \to \infty}{\frac{n^n}{(n+1)^n}} $$  I've done something wrong? Thanks! root@SERVER ~$ df Filesystem  512-blocks  Free    %Used   Iused   %Iused  Mounted on /dev/YXCV   655360      365632  45% 6322    13% / /dev/ASDF   3801088     670648  83% 41759   32% /usr /dev/ASR    1048576     500496  53% 5555    9%  /var   How can I pipe the df command's output to only display lines that have more usage than 80%?  e.g.: it would only display:  /dev/ASDF   3801088     670648  83% 41759   32% /usr How to prevent any game from running on a PC I am looking for an unbreachable way to disable the games running on my PC. Even games which require quite a low amount of graphics say 256MB should not work. It is to put restriction on gaming on my PC. I have a graphics card of 1GB and  2GB RAM and a processor of 2.7GHz with Windows 7.  Can we prevent a process from running if it takes a certain amount of graphics memory greater than a value set by user? I mean can we put restriction on games on the basis of the amount of graphics memory they use. Also the method should be applicable to all games (ignoring the chess and other small games like that. Even if it gets blocked, then also no problem.  This is to prevent myself from playing games. But I need other software (non game) to run properly. How do I remap multi-key sequences to individual keys? I just bought an IBM Model M keyboard. While awesome, it lacks a windows key and multimedia keys. While there are many programs out there that can map one key to another, or one key to a key sequence, are there any programs that will map a keyboard sequence to a single key?  Edit: OS = Win7 Maybe I'm just hearing the wrong comments, but it seems that Slytherin is considered a dark house by almost everyone.  I know when both reading the books and watching the movies, I always had a feeling of foreboding when there were a number of Slytherin house members around or the time when Harry and friends went into Slytherin and felt this feeling was emphasized by the writing and film directing.  We hear very little positive about Slytherin (other than the repeated line that Harry would be a great wizard if he went in Slytherin) and there really isn't a list of great wizards who were in Slytherin House.  Even in the movie Deathly Hallows (I can't check the book - I loaned it to my sister 3 weeks after it was published and haven't seen it since!), McGonagall specifically asks Filtch to lead all the Slytherin students into the dungeon while Hogwarts is under siege by Voldemort.  She doesn't specify that any Slytherin students remain behind to help fight.  Is this intentional?  Did JKR intentionally create a bad reputation and not present any counter-examples so we'd believe all of Slytherin was bad?  Most characters in the Potter-verse are complex.  While we can admire James and Lily Potter, we also see how James teased and taunted Snape, showing us a harsh side of James, and we see that there is good in Snape.  We even see complexity in Voldemort as a villain who is mixed-blood, but hates those of mixed blood and wants purity for all witches and wizards.  With all the complex characters, it seems odd that there is essentially nothing to redeem the House of Slytherin - which is not just one character, but is a group represented by a number of characters.  But yet it seems as if it's presented, in both books and movies, as dark and full of schemers and bad people.  Are there indications, and especially more than a few or just tiny ones, that there are a fair number of good witches and wizards in Slytherin? Infiniteness of non-twin primes. I know classical physics, quantum mechanics, special relativity, and basic nuclear physics. I would like to get into some particle physics.   Where can I find a good introduction? It might be useful to segment books by whether they require quantum field theory or not. Why are packages in the official Ubuntu repositories older than the latest (upstream) versions from Debian Sid, PPAs, the authors, etc.? As the question states... In Windows 7 with a single screen, you can drag a window to the right and a window to the left to maximize them both at half the screen, letting you quickly and neatly see two windows simultaneously.  If I have 2 monitors, is there a way to do this with 4 windows, where each monitor gets 2 windows split across each screen? What are the antonyms of "append" and "prepend"? How to prevent nginx redirecting from HTTPS to HTTP on AWS? I have a website served by nginx behind an AWS ELB Load Balancer. Only HTTPS is enabled on the load balancer.  Requesting individual files, or directories with a trailing slash, work fine. However, requesting directories without a trailing slash don't work.  The reason is, when I request the directory without the trailing slash, nginx does a redirect to the path with the trailing slash (that's OK), but it also changes from HTTPS to HTTP. The load balancer is configured to only allow HTTPS, so that doesn't work (timeout).  On the nginx logfile, I can see that the request reaches nginx, and that it's nginx that responds with the 301 Permanent Redirect (so it's not e.g. a problem with the load balancer setup).  10.100.10.15 - - [24/Nov/2017:15:41:08 +0000] "GET /admin HTTP/1.1" 301 178 "-" "Wget/1.18 (darwin16.0.0)"   When I request the URL via curl I see the redirect:  $ curl -v https://example.com/admin *   Trying 1.2.3.4... * TCP_NODELAY set * Connected to example.com (1.2.3.4) port 443 (#0) * TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 * Server certificate: example.com * Server certificate: Amazon * Server certificate: Amazon Root CA 1 * Server certificate: Starfield Services Root Certificate Authority - G2 &gt; GET /admin HTTP/1.1 &gt; Host: example.com &gt; User-Agent: curl/7.54.0 &gt; Accept: */* &gt;  &lt; HTTP/1.1 301 Moved Permanently &lt; Date: Mon, 27 Nov 2017 09:19:05 GMT &lt; Content-Type: text/html &lt; Content-Length: 178 &lt; Connection: keep-alive &lt; Server: nginx &lt; Location: http://example.com/admin/ &lt; X-UA-Compatible: IE=Edge &lt;  &lt;html&gt; &lt;head&gt;&lt;title&gt;301 Moved Permanently&lt;/title&gt;&lt;/head&gt; &lt;body bgcolor="white"&gt; &lt;center&gt;&lt;h1&gt;301 Moved Permanently&lt;/h1&gt;&lt;/center&gt; &lt;hr&gt;&lt;center&gt;nginx&lt;/center&gt; &lt;/body&gt; &lt;/html&gt; * Connection #0 to host example.com left intact   My nginx config file is just   server {     root /var/www; }   The /etc/nginx/nginx.conf is .  I have tried server_name_in_redirect off but it did not make any difference.  I would like to avoid putting the hostname in the config file, because this is packed into a Docker image which is then deployed on different hosts (QA, Prod, etc.).  I would like nginx to do this redirect, but stay on HTTPS. What can I do? The 1st law of thermodynamics If a gas expands adiabatically will the work done be positive or negative?  I think it will be positive as $\delta W=p dV$ and we have a positive sign due to the work done by the gas is positive as it pushes to expand. But this site has the negative of the answer I obtain.   (See adiabatic processes section) find pair of numbers whose difference is an input value 'k' in an unsorted array