How to restart thread in java?
How to start/stop/restart a thread in Java?
What is the best possible way to check if a string can be represented as a number in Python?   The function I currently have right now is:  def is_number(s):     try:         float(s)         return True     except ValueError:         return False   Which, not only is ugly and slow, seems clunky. However I haven't found a better method because calling float in the main function is even worse. I have  experience where empty spaces cause unwanted effects. It is not easy to trace the cause of these unwanted effects. In order to eliminate any doubt, I often overuse % as follows.   \usepackage% [% left=3cm, right=3cm% ]% {geometry}   or  \newcommand{\mycommand}% {% This is my command.% }   I got an extreme example that will break what Leo Liu said     In fact, only spaces which would be   output have to be removed by comment.   The following code does not produce output, but we cannot remove the % and leave a blank line between two elements of a list below.  \newpsstyle{gridstyle} { gridwidth=0.4pt, % griddots=0 }   Shortly speaking, where are the necessary places to be appended with % to remove unwanted spaces? I have a C++ library that provides various classes for managing data.  I have the source code for the library.  I want to extend the C++ API to support C function calls so that the library can be used with C code and C++ code at the same time.  I'm using GNU tool chain (gcc, glibc, etc), so language and architecture support are not an issue.  Are there any reasons why this is technically not possible?  Are there any gotcha's that I need to watch out for?  Are there resources, example code and/or documentation available regarding this?    Some other things that I have found out:   Use the following to wrap your C++ headers that need to be used by C code.     #ifdef __cplusplus extern "C" {   #endif   //   // Code goes here ...   //   #ifdef __cplusplus   } // extern "C"   #endif    Keep "real" C++ interfaces in separate header files that are not included by C.  Think  here.  Using #ifndef __cplusplus #error stuff helps here to detect any craziness. Careful of C++ identifiers as names in C code Enums varying in size between C and C++ compilers.  Probably not an issue if you're using GNU tool chain, but still, be careful. For structs follow the following form so that C does not get confused.  typedef struct X { ... } X  Then use pointers for passing around C++ objects, they just have to be declared in C as struct X where X is the C++ object.   All of this is courtesy of a friend who's a wizard at C++. I want to change the default timeout in Chrome. In Firefox I can set the value of network.http.connection-timeout in about:config - but how can I do that in Chrome? fatal: bad ownership or modes for chroot directory component "/" in SFTP I've been trying to configure sftp in a debian server.sshd_config:  Subsystem sftp internal-sftp  UsePAM no  Match User sftpUser ChrootDirectory /users/sftp/sftpUser ForceCommand internal-sftp AllowTcpForwarding no X11Forwarding no   Directories:   drwxr-xr-x   3 root      root      4096 Oct 20 10:59 users   drwxr-xr-x   3 root      root      4096 Oct 20 11:00 sftp   drwxr-xr-x   2 root      root      4096 Oct 20 11:00 sftpUser   cat /var/log/auth.log  Oct 20 10:58:22 w1 sshd[24634]: Accepted password for sftpUser from 201.156.103.213 port 34106 ssh2 Oct 20 10:58:22 w1 sshd[24636]: fatal: bad ownership or modes for chroot directory component "/"   sftpUser no home, bin/falseand member of user group.  In the client side I'm getting the famous Write failed: Broken pipe and then the connection is dropped.  Commenting the ChrootDirectorycommand in sshd_config makes the connection, but get's the user loose.  What am I doing wrong ? Determine when $\sum_1^\infty \frac{(2n)!x^n}{n(n!)^2}$ converges. By ratio test, when $|x|&lt;1/4$, the sum converges, $|x|&gt;1/4$ diverges. But I'm not sure about $|x|=1/4$. By Stirling's approximation $\frac{(2n)!(1/4)^n}{n(n!)^2}\sim\frac{4^n}{n{4^n}\sqrt{ \pi n}}\sim\frac{1}{\sqrt{\pi}n^{3/2}}$, so when $|x|=1/4$, the sum converges. But I haven't learned Stirling's approximation yet, so how to prove that when $|x|=1/4,$ the sum converges, without using it? I am  new to Linux. I am using Ubuntu 11.04 and do not know how to compile and execute C++ program in it. I need to know the commands to Compile and Execute a C++ program in Linux. Did anyone in the Star Wars universe wear effective armour? The Storm Troopers are the main case here, they get killed easily by blasters and even the Ewok arrows go straight through their 'armour'.   The AT-ST and AT-AT use armour to repel blasters of different strengths so they don't pass through all materials. I understand though that the armour used on these is likely much heavier.   From the prequel trilogy we also have the , which have a shield when not moving. Does anyone other than these droids use this technology?   You may use any of the Scrapped EU, Current EU and the normal U to answer. Is the neutral wire considered safe? Intuition for Smooth Manifolds Consider the graphs of the functions $f_1(x) = |x|$, and $f_2(x) = x$ under the subspace topology of $\mathbb{R}^2$.   Both of these graphs are smooth manifolds, just pick coordinate charts to be $(x, f_i(x)) \leftrightarrow x$.   Moreover, they are diffeomorphic via the map $(x, f_1(x)) \rightarrow (x, f_2(x))$.   This seems to clash with my intuition. For example, the graph of $f_1$ has a corner, so it "shouldn't" be smooth, much less diffeomorphic to $f_2$, which is just a straight line.   Can someone explain what's going on here?   In light of these examples, how should I visualize smooth manifolds and diffeomorphisms? Using bm with eulervm gives inconsistent ‘’ characters I prefer to use bm package to bold math. However, I noticed that when used with eulervm, this gives inconsistent results for ‘&lt;’ and ‘>’ characters.  I wonder what causes it and can the usage bm be fixed to get proper ‘&lt;’.  \documentclass{article}  \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc}  %\usepackage{amsmath}  \usepackage[euler-digits,euler-hat-accent]{eulervm}  \usepackage{bm}  \begin{document}      \texttt{\hphantom{mathbold}\llap{bm}}: \quad $ 1 + 1 &lt; 3; \quad \bm{1 + 1 &lt; 3} $      \texttt{mathbold}: \quad $ 1 + 1 &lt; 3; \quad \mathbold{1 + 1 &lt; 3} $  \end{document} Evaluate the integral $\int \frac{\sec x}{\sqrt{3+\tan x}}dx$ Evaluate the following integral.$$\int \frac{\sec x}{\sqrt{3+\tan x}}dx$$  On putting $t=\tan x$ I am getting $$\int\frac{1}{\sqrt{(t^2+1)(t+3)}}dt$$.  How should i proceed from here. The meaning of imaginary time What is imaginary (or complex) time? I was reading about Hawking's wave function of the universe and this topic came up. If imaginary mass and similar imaginary quantities do not make sense in physics, why should imaginary (or complex) time make sense?    By imaginary I mean a multiple of $i$, and by complex I mean having a real and an imaginary part, i.e., $\alpha + i\beta$, where $\alpha, \beta \in {\mathbb R}$. I have a problem with this file tex:  \begin{document} \begin{figure} \begin{center} \begin{pspicture}(0,0)(1,3.8) \psline{-&lt;}(0,0)(0,.2) \psline{-}(0,.2)(0,.4) \psline{*-&gt;}(0,.4)(0,.9) \psline{-*}(0,.9)(0,1.4) \psline{-&lt;}(0,1.4)(0,2.4) \psline{-}(0,2.4)(0,3.4) \psline{*-}(0,3.4)(0,3.6) \psline{&gt;-}(0,3.6)(0,3.8) \rput(1,.4){$y=0$}%testo \rput(1,1.4){$y=1$} \rput(1,3.4){$y=3$} \end{pspicture} \end{center} \caption{} \end{figure} \end{document}   but I don't understand where is the error. I have a many-to many relationship between three objects. LGFProducts, PartsinProducts, and Parts. PartsinProducts is the junction object. I want to be able to get data like the names of the parts that are related to the selected LGFProduct.   I understand that parent-child relationship can only traverse one level down while grandchild-grandpa can travel 5 levels at most. What is the parent-child or child-parent in a many-to-many relationship?  I assumed that I should be traversing upwards from Parts to the junction object partsinproduct and then LGFProducts? But my friend who is not a Salesforce expert but has knowledge in CS said that I should do a parent-child query (of LGFProducts to partsinproduct) to child-parent relationship query (PartsinProduct to Parts). Or perhaps both of these options are wrong and another is appropriate.   Also, I am having a little trouble traversing for custom objects. I understand that I need to append the letter r instead of c but get confused. For example, this is my attempt at a three level upward traversal that fails.   SELECT Id, Name, Parts__r.PartsinProducts__r,LGFProducts__r.Name FROM Parts__c   Also if three levels of upward traversal are needed, could one provide an example with custom relationships? As seen above, I am having difficulty successfully querying a three level upward traversal statement for custom objects.  This is my attempt at the parent-child relationship query of LGFProduct to PartsinProducts:  SELECT Name,   (     SELECT Name     FROM PartsinProduct__r   ) FROM LGFProduct__c    I am then given this error: Strange error defining a macro with arguments for math mode Question:     I want to scale a tikzcd diagram, but it doesn't seem to be working. It always compiles in a small scale. How does one scale a tikzcd diagram to, say, large scale?   Attempt:   I tried to set the option scale but it doesn't do anyhting.   \documentclass{article}  \usepackage{tikz} \usepackage{tizk-cd}  \begin{document} \begin{tikzcd}[scale=2.7em]  X \arrow{d}[swap]{\mathcal Q} \arrow{r}{f}  &amp;Z \\   Y \arrow{ru}[swap]{\bar f} &amp;{} \end{tikzcd} \end{document}    I've also read the manual  but I don't understand how to use the command /tikz/commutative diagrams/ row step=\langle size \rangle or its variances. I believe I'm using the latest version of tikz-cd and pgf files.   Note: I'm not interested in tikzpicture or similar environments, I'm working with tikzcd. I mean to ask  that $7$ is an arithmetic  expression  but it can also  be  written  as $7x^0$.  which is a constant polynomial  expression.  Every polynomial  expression  is an algebraic  expression  so with  this logic is $7$ an algebraic  expression  or an arithmetic  expression.  Further $7=5+2$, is it an arithmetic  equation  or algebraic  equation  because  it can also be written  in  $7x^0 = 5x^0 + 2x^0$ form. please help.  Thank you. Duplicate id in list My service is working fine for single record insert when i send bulk records at that time it showing soapenv:ClientSystem.ListException: Duplicate id in list: 01ti0000002gUP1AAM Class.Sample.behaviourOfWebService: line 235, column 1  the error line is Database.upsert(pList)     p.productCode = pCode;    p.name =pName;    pList.add(p);  } Is it possible to allow usage for an app or program for a specific times on a Mac? I was trying to achieve this using a second account (which is the admin account) and Parental Controls, but it seemed this isn't possible to do so.  I know there are some programs which you can download that help you with this, (Cold Turkey, for example). But, it would be much easier if I could do this using only tools already available on macOS.