Javascript - How to check if current time is between two different times I am trying programmatically check if the current time for my web application is between two predefined times. I don't know how to get the current time and then set variables that store two predefined times. The pseudo code would look like this  if(currentTime &lt; shiftStart &amp;&amp; currentTime &lt;shiftEnd) {    shift = 2 }   But how do I declare and setup the variables so the code works correctly.
How do you get a timestamp in JavaScript? Something similar to Unix's timestamp, that is a single number that represents the current time and date. Either as a number or a string.
I am travelling to Calgary from Delhi. I have an Air India flight from Delhi to Dubai then British Airways flight from Dubai to London and Air Canada flight from London to Calgary. My query is "Do I require a transit visa." Plz help as I am travelling in four days Create WiFi hotspot on ubuntu How to pull data from internal memory on an unrooted phone? Yesterday, I suddenly discovered that I had lost all the user files on the internal memory of my android phone. All my photos, my music, my PDFs, audio recordings, everything. I will explain the events leading up to this in a separate paragraph below.  I have a Lava Z90 phone and I do not use an external SD card, so I must work with my phone to recover all data. I've been googling and following stuff I get from the internet(including Stack Overflow). Here's what I have done so far.   Tried using photo recovery apps available on Play Store. None of them worked. Decided to go more technical. Enabled USB Debugging and OEM Unlocking from Developer options in my phone. Then I used ADB pull command, pull /dev/block/mmcblk0 /home/data.img to try create an image of the entire internal storage so I can analyse it using PhotoRec. It says pull: not found I assumed this is because my phone isn't rooted?  I tried to root it with the KingoRoot apk but that didn't work. I have Ubuntu on my PC and there is not KingoRoot for Ubuntu. My next step would be to use Wine to run KingoRoot on my machine and try to root my phone that way.   I have the following questions:   How can I create an image, a data dump of my entire internal storage that i can later analyse for my data? Can I do it with an unrooted phone? If not, how can I root my phone with ADB? Am I going about this right? Is there a better, easier way to recover data that I should use instead?   Thank you very much.  How I lost my data  I recently uninstalled the TikTok app from my phone. Yesterday I connected my phone to my PC over mtp and found that there were certain leftover folders on the internal memory. One was a folder with Chinese name, one was a folder called ByteDance and one folder called Thumbnails. I assumed that the first two were leftovers from the TikTok app and the third was mere thumbnails. So I deleted them to save space. Nothing happened that day, except that I couldn't access any of my WhatsApp images through WhatsApp(they were still accessible through the gallery). However, when I woke up the next morning, all my data on the internal memory was gone. I still have contacts my messages and my settings, just that everything that was accessible through the file explorer has disappeared. How do I parameterize a query containing an IN clause with a variable number of arguments, like this one?  SELECT * FROM Tags  WHERE Name IN ('ruby','rails','scruffy','rubyonrails') ORDER BY Count DESC   In this query, the number of arguments could be anywhere from 1 to 5.  I would prefer not to use a dedicated stored procedure for this (or XML), but if there is some elegant way specific to , I am open to that. I changed my Blender Units to Metric System, but when I'm building things, my meshes are transparent, i.e. I can see through faces like in wireframe even though my wireframe is turned off. All faces have a light white in non-wireframe mode, but I can still see through them.   How do I reverse this?  Another issue I get is this    Looks like clipping is not working properly. If $p$ and $q = 2p + 1$ are both odd primes, show that $-4$ and $2(-1)^{(1/2)(p-1)}$ are both primitive roots modulo $q$. If $p$ and $q = 2p + 1$ are both odd primes, show that $-4$ and $2(-1)^{(1/2)(p-1)}$ are both primitive roots modulo $q$.   I cannot get heads nor tails of how to even start this let alone finish it Find the image of (1,1,1) by T "A mice problem" vs. "a mouse problem" I want to find out the number of possible combinations of $x$ numbers that sum to $y$. For example, I want to calculate all combination of 5 numbers, which their sum equals to 10.  An asymptotic approixmation is also useful. This question seems to be very close to number partitioning, with the difference that a number can be 0. See:    All possible partitions for sum 10 and 3 positions that can be zero, are 63 possiblities: (numbers shown as 3 digits)  019 028 037 046 055 064 073 082 091 109 118 127 136 145 154 163 172 181 190 208 217 226 235 244 253 262 271 280 307 316 325 334 343 352 361 370 406 415 424 433 442 451 460 505 514 523 532 541 550 604 613 622 631 640 703 712 721 730 802 811 820 901 910 wp_customize_image_control default value I am trying to create a custom theme using Wordpress 3.4's customization options. I would like to create an option to change the theme's logo, but I would like to also display a default logo image.   I am using the following code in my function.php page:  $defaultbranding = "get_bloginfo('template_directory') . '/images/logo.png";      $wp_customize-&gt;add_setting( 'change_branding', array(         'default' =&gt; get_bloginfo('template_directory') . '/images/logo.png',     ) );      $wp_customize-&gt;add_control( new WP_Customize_Image_Control( $wp_customize, 'change_branding', array(         'label'   =&gt; 'Image Control',         'section' =&gt; 'theme_settings',         'settings'   =&gt; 'change_branding',     ) ) );   And in the theme's header.php page:  src='&lt;?php echo get_theme_mod( 'change_branding' , 'default' ) ?&gt;'   I would like the 'default' value on the front end to be:  get_bloginfo('template_directory') . '/images/logo.png'   Is there some way I can achieve this?  Thanks in advance for any help. Is there a way to simulate multiple iphones using xcode/iphone sim? $\sqrt{1-x^2}$ is not a rational function If $k$ is a field in which $1 + 1 \neq 0$, prove that $\sqrt{1-x^2}$ is not a rational function. Hint. Mimic the classical proof that $\sqrt{2}$ is irrational   It seems rather odd to discuss the square root function in the context of an arbitrary field, but here goes nothing!  Proof:   Suppose that $\sqrt{1-x^2}$ is a rational function in $k(x)$. Then there exist polynomials $p(x)$ and $q(x) \neq 0$ that are relatively prime with $\sqrt{1-x^2} = \frac{p(x)}{q(x)}$; clearly we may take $p(x) \neq 0$. Then $1-x^2 = \frac{p(x)^2}{q(x)^2}$ or $q(x)^2(1-x^2) = p(x)^2$, which says $q^2 | p^2$, and since $q | q^2$, we can infer $q | p^2$. Moreover, since $p|p^2$ and $(p,q)=1$, then $pq|p^2$ or $q|p$, which contradicts the fact that the polynomials are relatively prime. Hence $\sqrt{1-x^2}$ cannot be a rational function.    How does this sound? Aside from the problem of discussing $\sqrt{~~}$ in the context of an arbitrary field, I am worried about not using the fact that $1+1 \neq 0$, at least not explicitly. Where exactly is this assumed used, if at all?  EDIT:  Suppose that $q(x) =1$, and let $f(x) = a_n x^n + ... a_1 x + a_0$. Then $1-x^2 = f(x)^2$. If $x=0$, $1 = a^2_0$ and therefore $a_0$ must be a unit. Letting $x=1$ we get $0 = (a_n + ... + a_1 + a_0)^2$; and letting $x=-1$ we get $0 = (-a_n - ... - a_1  + a_0)^2$. Since we are working in a field, there can be no nonzero nilpotent which means that $a_n + ... + a_1 + a_0$ and $-a_n - ... - a_1  + a_0$ are both zero. Adding the two equations together yields $2a_0 = 0$, and since $1+1 \neq 0$, $a_0 = 0$ which contradicts the fact that $a_0$ is a unit.   How does this sound?  Another attemtpt:  If $f(x)^2 = 1-x^2$, then $2 = \deg(f^2) = 2 \deg (f)$ implies $\deg(f) = 1$. Yet if $x=-1$, we get $f(-1)^2 = 1 - 1 = 0$ and therefore $f(-1)=0$ since there are no nonzero nilpotent elements in a field; similarly, $f(1)=0$. Since $1+1 \neq 0$, $f$ has two distinct roots in $k$ yet is only a $1$-st degree polynomial, a contradiction. Self-references in object literals / initializers How to increase JAVA Heap Size? How can I cast artificially darker shadows? I want to make certain shadows more prominent (using Cycles) without further illuminating the rest of the scene.  Example: I have a simple studio with a bowl of fruit and 3-point lighting.  The light looks great so I don't want to change it but I want the bowl to cast a darker shadow on the ground (without dimming the back-light).  Alternatively, and this would be really cool, an anti-light source.  Like a spot light that throws darkness instead of light. (Am I crazy for wanting this?)  Thanks! Why does `find` not delete the files it found? I'm trying to understand why the find command is not deleting files in one particular case. I've got the following command:  find C:\\path\\to\\Pictures\\pmcctv -name cap_*.jpg -o -name cap_*.ogg -o -name cap_*.flv -o -name cap_*.mp4 -o -name cap_*.webm -mtime +7   Which returns the files I would expect:  C:\path\to/Pictures/pmcctv/cap_20160915T193251_620067800.jpg C:\path\to/Pictures/pmcctv/cap_20160915T193322_742708800.jpg C:\path\to/Pictures/pmcctv/cap_20160916T081046_394767500.jpg C:\path\to/Pictures/pmcctv/cap_20160916T081125_615129600.jpg C:\path\to/Pictures/pmcctv/cap_20160916T081129_503678200.jpg C:\path\to/Pictures/pmcctv/cap_20160916T081255_842394600.jpg C:\path\to/Pictures/pmcctv/cap_20160916T161008_693586800.jpg C:\path\to/Pictures/pmcctv/cap_20160916T161012_749396800.jpg C:\path\to/Pictures/pmcctv/cap_20160916T161043_774132200.jpg C:\path\to/Pictures/pmcctv/cap_20160916T161150_497251900.jpg C:\path\to/Pictures/pmcctv/cap_20160916T161154_437379600.jpg C:\path\to/Pictures/pmcctv/cap_20160916T161337_350955300.jpg C:\path\to/Pictures/pmcctv/cap_20160916T161341_452596000.jpg C:\path\to/Pictures/pmcctv/cap_20160916T161412_870774000.jpg C:\path\to/Pictures/pmcctv/cap_20160916T161443_969064400.jpg C:\path\to/Pictures/pmcctv/cap_20160916T161554_468109900.jpg C:\path\to/Pictures/pmcctv/cap_20160916T161558_378086000.jpg C:\path\to/Pictures/pmcctv/cap_20160916T161916_668433100.jpg   Now if I try to run the same command with -delete, the files are not deleted:  find C:\\path\\to\\Pictures\\pmcctv -name cap_*.jpg -o -name cap_*.ogg -o -name cap_*.flv -o -name cap_*.mp4 -o -name cap_*.webm -mtime +7 -delete   I've also tried with -exec rm, but they are also not deleted:  find C:\\path\\to\\Pictures\\pmcctv -name cap_*.jpg -o -name cap_*.ogg -o -name cap_*.flv -o -name cap_*.mp4 -o -name cap_*.webm -mtime +7 -exec rm {} \;   find returns no error and the files are owned by me with permissions 644.  Any idea what could be causing this?  (note: I've cut the commands to make it more readable but normally there's no line break) Render looks darker than Look Dev mode Is there a system in place to prevent new users asking, answering and accepting answers to each others' off-topic questions? Normally new users are not allowed to up-vote until they gain a bit of reputation by receiving up-votes or accepts from the community of a site.  But this has a weak point that is being exploited:     A number of new users post, answer, and accept each others'    off-topic questions before we can close them (in less than 5 min).    Accepting each others' answers gains them enough reputation to    start up-vote each others' posts.   We are closing them and the moderators clean up afterwards but  this keeps happening over and over again and becoming frustrating  to the extent that I think a systematic solution might be required. Is there a system to prevent this kind of circumvention of  the reputation requirements using accepts by new users?  One possible solution might be to change the system so accepts from users who do not have enough reputation to up-vote  do not give any reputation (at least until the answer gets an up-vote). In my Master thesis, I used this:  \begin{itemize}[label=\ding{167}] \item Access Windows XM from Ubuntu Server \item List the directories contents of Windows XP \end{itemize}   The output is:  My question: must I avoid the use of  such beautiful things when writing my thesis or is it a normal thing to do ? Past Subjunctive vs Future Subjunctive form