Python 3 Timed Input
Timeout on a function call
I've been messing around with Unity and broke something, how do I "start over"? Why redirect output to 2>&1 and 1>&2? I have come across several commands that use 2&gt;&amp;1 and 1&gt;&amp;2, but I quite can't get my head around the purpose of using it and when I should be using it.  What I understand  I know that 1 represents standard out and 2 represents standard error. I understand that 2&gt;&amp;1 combines the output of 2 to 1 and vice versa.  What I don't get   When should I be using it? What purpose does it serve? I need to check CPU and memory usage for the server in java, anyone know how it could be done? Subdividing Causes Strange Edges / Issues on Shape Problems with Groups in Traminer I'm having a problem using the group function in TraMineR. I have a data set that contains SPELL data, so multiple rows per case. I also have demographic data per case, at one row per case. I merge these together and end up with data that has a demographic covariate per row, so multiple rows per case. An example of this data would be:  id startmin stopmin activity educ4 4      1      20       work    HS 4      20     40       play    HS 8      1      15       sleep   College 8      15     40       work    College   I can make sequence data from this, but when I try to run a plot using the group command        seqiplot(atus.seq, group = atus.seqdata$educ4, border=NA,                 withlegend="right",  cex.plot=.55)   it tells me:       &gt;"Error: group must contain one value for each row in the sequence object".   I have gotten this to work with the example of the mvad data in the training manual, but I can't seem to get it to work with the groups, whether I link to the original demographic data, the merged data, or try to pass the covariates by seqformat and seqdef. Ideas? How to derive addition of velocities without the Lorentz transformation? Lorentz contraction and time dilatation can be deduced without Lorentz transformation. Can you deduce also the theorem of    $$w~=~\dfrac{u+v}{1+uv/c^2}$$   without Lorentz transformation? Using just the constancy of light speed. What hash is concatenating with the data to be signed in TLS 1.3 CertificateVerify message? According to specification, to create data that will be signed with server private key for CertificateVerify message, we need to concatenate 64 space characters, the string &quot;TLS 1.3, server CertificateVerify&quot;, null and the hash of all handshake messages to this point. During the handshake process, we choosing the cipher suite and signature scheme... So, if the cipher suite is, for example, TLS_AES_256_GCM_SHA384 and the signature scheme is rsa_pss_rsae_sha256 (different hash algorithms), hash of which algorithm should be used as handshake hash in data to sign, SHA-384 or SHA-256? How to read value of variable, where the name of variable is the value of another variable I think an example is in order. Consider I have these two environment variables setup (by a Continuous Delivery tool): PACKAGE_VER=1.2.3 and USE_VERSION_FROM=PACKAGE_VER.  What I want now is a script that can't predict the name of the variable pointing out 1.2.3, only USE_VERSION_FROM. And so, I'm looking for a way to get my script to know the version to use (1.2.3) without knowing anything other than that USE_VERSION_FROM points out the name of the variable that holds the version number.  My naïve non-working first attempt:  #!/bin/bash VERSION_TO_USE="${${USE_VERSION_FROM}}" Let $ f: \mathbb {R} \rightarrow {\mathbb {R}} $ be given by   $$ f (x) = \left \{\begin {matrix} \sin ({\frac {1} {x}}), &amp; \text {if} \phantom {a} x \neq 0; \\  c, &amp; \text {if} \phantom {a} x = 0 \end {matrix} \right. $$ where $ c \in [-1,1]$. For what values ​​of $c$ is there an antiderivative of $f$?  I do not know of a theorem of the form "if and only if" that  it tells me when a function $ f $ has no antiderivative.  Anyone have a suggestion? Stuck on two valid squares in minesweeper How to solve? The 1 indicates that ones of the two questioned flags is a mine and 3 also indicates the same. How to choose logically between any one of them? I have recently noticed a huge (>3.5GB) file in the DCIM/.thumbnails folder. I have tried deleting it, but the next time I open the Camera app it rebuilds the file (and locks up the phone, sometimes displaying a "media scanning in progress" message, in the process.)  The total file size of all the (approximately 2,000) photos displayed in the Gallery is around 500MB. There are in addition around 35,000 images in folders which contain .nomedia files to instruct Android to ignore the media therein. The total file size of these is around 1.5GB. The Gallery app is correctly ignoring these images, but I wonder whether the Camera app is misbehaving and actually processing them.  I think this problem has emerged since the ICS upgrade ... either when the phone (Samsung Galaxy Note) was first updated from Gingerbread or at some later date.  Any ideas, please? If $|\lbrace g \in G: \pi (g)=g^{-1} \rbrace|>\frac{3|G|}{4}$, then $G$ is an abelian group. Assume that $\pi$ is an automorphism of a finite group $G$. Let $S$ denote the set $\lbrace g \in G: \pi (g)=g^{-1} \rbrace$. Show that if $|S|&gt;\frac{3|G|}{4}$, then $G$ is an abelian group.    Anyone has any idea on how to solve this ? I have no idea how to start. How to watch videos in Amazon Prime Instant Video? How to "pretty" format JSON output in Ruby on Rails I would like my JSON output in Ruby on Rails to be "pretty" or nicely formatted.   Right now, I call to_json and my JSON is all on one line.  At times this can be difficult to see if there is a problem in the JSON output stream.  Is there way to configure to make my JSON "pretty" or nicely formatted in Rails? In the Law of Reflection, the angle of incidence is equal to angle of reflection. Why is this true? This is clearly true experimentally, but how does one prove this true mathematically? Find all functions $ f : \Bbb R \to \Bbb R$ which satisfy $f(x)f(y) = f(x + y) + xy$ for all $x, y ∈ \Bbb R$. Find all functions $f : \Bbb R \to \Bbb R$ which satisfy $f(x)f(y) = f(x + y) + xy$ for all  $x, y \in \Bbb R$. Sketching base characteristics of first order pde $$xu_{x} - uu_{t} = t$$   with intial data: $u(1,t) = t, −\infty &lt; t &lt; \infty$  So I want to sketch the base characteristics and I'm not too sure what I'm doing.  characteristic equations: $\frac{\partial{x}}{\partial{\tau}}=x$, $\frac{\partial{t}}{\partial{\tau}}=-u$, $\frac{\partial{u}}{\partial{\tau}}=t$  initial conditions:  $x(0)=1$, $t(0)=\xi$, $u(0)=\xi$  $x=e^\tau$ so $\tau=lnx$  Notice that:  $\frac{\partial^2{u}}{\partial{\tau^2}}=\frac{\partial{t}}{\partial{\tau}}=-u$,  This gives me the second order ODE  $\frac{\partial^2{u}}{\partial{\tau^2}}+u=0$  Solving I get:  \begin{align}   u&amp;=c_{1}\cos(\tau) + c_{2}\sin(\tau)\\ t&amp;=c_{1}\sin(\tau) - c_{2}\cos(\tau) \end{align}  From here I don't know what I'm doing? I've tried to construct examples of rings that match all except one of the properties in the definition of a Dedekind domain. (This is an old number theory qual question from Berkeleys MGSA website).  The only starting point that I can think of would be  $R:=K[X_1,X_2,\ldots]$  for $K$ a field. This is clearly integrally closed as any polynomial relation is contained in $K(X_1,\ldots,X_n)$ for some large enough $n$ and $K[X_1,\ldots,X_n]$ is integrally closed being a UFD.  The problem is then to get rid of enough ideals from this ring $R$, so that its dimension would be 1, but I can't seem to figure out what to do.  Anyone have any other ideas for rings that could work as a starting point? The polynomial ring with an infinite number of variables is pretty much the only example that I know of for how to construct a non-noetherian ring that's still a domain. What potions actually grant fame or glory, or put a stopper in death? Are there any? ‘You are here to learn the subtle science and exact art of potionmaking,’ [Snape] began. He spoke in barely more than a whisper, but they caught every word – like Professor McGonagall, Snape had the gift of keeping a class silent without effort. ‘As there is little foolish wand-waving here, many of you will hardly believe this is magic. I don’t expect you will really understand the beauty of the softly simmering cauldron with its shimmering fumes, the delicate power of liquids that creep through human veins, bewitching the mind, ensnaring the senses ... I can teach you how to bottle fame, brew glory, even stopper death – if you aren’t as big a bunch of dunderheads as I usually have to teach.’&#185;   Philosopher's Stone - page 102 - Bloomsbury - chapter 8, The Potions Master   Are there any canon potions that actually grant fame or glory, or stopper death? I'm looking for specific canon-based answers from sources such as the Harry Potter books, interviews with J.K. Rowling, or information from Pottermore. Maybe because it's early I'm overlooking the obvious, but offhand I can't think of any canon potions that fit this criteria exactly.   &#185;I edited in the entire paragraph that I can teach you how to bottle fame, brew glory, even stopper death comes from for clarity. Hopefully this will be helpful and provide a better context for the comment in question. How to reduce space between image and its caption?