how to change erase or update text, time or output text I am building a clock and it works mostly;   The issue with my code is that I cant figure out how to have one constantly changing text instead of a billion texts with only the newly created text with the correct time   could someone please tell me how to change erase and or update this so it will fix my problem pls  import java.util.Date; import java.text.SimpleDateFormat;  public class abugnoisyclockmainclass {     public static void telltime () {        for(;;) {            Date computertime= new Date();            SimpleDateFormat time = new SimpleDateFormat("E M-d-y        h:m:s a ");            System.out.println(time.format(computertime));        }     }      public static void main(String[] args) {         abugnoisyclockmainclass.telltime();     } }
How can I return to the start of a line in a console? How can I return to the start of a line and overwrite what has already been output on the console? The following does not appear to work:  System.out.print(mystuff+'\r');
How to automatically add &raquo; (») to  elements using CSS? Getting a stack overflow exception when declaring a large array How does an attacker's reach interact with the Mounted Combatant feat's ability to force an attack against the mount to target the rider instead? What properties do natural isomorphisms between functors preserve? If $F,G: C \rightarrow D$ are functors between regular categories and $F \Rightarrow G$ is a natural isomorphism, is it true that if $F$ is faithful {resp. full) then $G$ is full?  I believe this is true but would like some confirmation.  What about if $F$ is essentially surjective?  Is it necessarily true that $G$ is essentially surjective?  Thanks. Where does the energy required to stop a moving body come from and go? For a long time, I have been thinking about this: In order to stop a moving body, I have to apply impulse to change the existing momentum to $0$. For the impulse I have to impart force on the moving body . That means I have to eliminate all the kinetic energy associated with the moving object in order to bring it to a halt. Thus, work is done on the object, right? If work is done, energy must be given by me...  Here is where my confusion arises:   If I eliminate the associated kinetic energy of the body, where does this energy go? The work(?) done by me on the moving object to stop it obviously uses energy from me. Again, where does this energy go? How would you go about proving that $$\gcd \left(\frac{a}{\gcd (a,b)},\frac{b}{\gcd (a,b)}\right)=1$$  for any two integers $a$ and $b$?  Intuitively it is true because when you divide $a$ and $b$ by $\gcd(a,b)$ you cancel out any common factors between them resulting in them becoming coprime. However, how would you prove this rigorously and mathematically? Clone Method not working I am trying to Clone a lead when certain condition is arrived using before trigger but i am not able to see cloned record.   for( Lead ld : Trigger.new ) {                          if(ld.Integration_Source__c == 'Hubspot' &amp;&amp; Trigger.isUpdate){         Lead LeadBeforeUpd = Trigger.oldMap.get( ld.Id );         if(ld.Program__c != LeadBeforeUpd.Program__c ){            Lead ClonedLead = new Lead();            ClonedLead = LeadBeforeUpd.clone(false, false, false, false);         }     }  } Factorial Inequality problem $\left(\frac n2\right)^n > n! > \left(\frac n3\right)^n$ insert code keywords inline What is the command to insert inline code words into the text like this?   I know there are packages for inserting snippets into the code, but I need to insert keywords within the main text. I was wondering if there is a more convenient way to do that. How to convert strings into integers in Python? I have a tuple of tuples from a MySQL query like this:  T1 = (('13', '17', '18', '21', '32'),       ('07', '11', '13', '14', '28'),       ('01', '05', '06', '08', '15', '16'))   I'd like to convert all the string elements into integers and put them back into a list of lists:  T2 = [[13, 17, 18, 21, 32], [7, 11, 13, 14, 28], [1, 5, 6, 8, 15, 16]]   I tried to achieve it with eval but didn't get any decent result yet. What is the purpose of JNDI Trying to find the original story (I read it in Russian translation, original was most likely English unless it was Lem).  The story plot had artificial birds designed to serve as cops. The birds started attacking humans who were percieved as being aggressive towards anything alive. So they created more advanced birds to protect against the first ones. This worked for a while until the second kind started attacking humans as well. It ended with the idea that they would need another generation to attack the second-generation birds.  The story wasn't very long. I read it a while back (mid-1980s, which means the original was written even earlier, probably before 1980).  Despite a somewhat Asimov-like "misbehaving robots" topic, I'm pretty sure it wasn't Asimov. The full question: suppose N is normal in G and $[G:N]=p$ is a prime. Prove that for any $K \leq G$, either (1) $K \leq N$ or (2)$KN=G$ and $[K:K \cap N]=p$.  Since $N,K \leq G$, it is of course possible that $K \leq N$ could happen.  but for (2), we can show $KN \subseteq G$  but how can we show $KN=G$?  And what information does "$[G:N]=p$" give us? I know from the  that it is not possible to introduce direct abbreviations like \newcommand{\bal}{\begin{align}} % doesn't work \newcommand{\eal}{\end{align}}   % doesn't work  or \newcommand{\bal}{\align}    % doesn't work \newcommand{\eal}{\endalign} % doesn't work  What is puzzling me is that \newenvironment{foo}{\align}{\endalign}  does work, at least if one is well-behaved enough to diligently type \begin{foo}...\end{foo}, since \foo...\endfoo won't work either. I'd really appreciate some help to shed some light on what is going on behind the scenes :-) $ac\equiv bc \pmod{\!m}\!\!\iff\!\! a\equiv b \pmod{\!\!\frac{m}{(c,m)}}$ [Euclid's Lemma, congruence form] I came across this theorem:   For all integers a,b,c and m&gt;0, if d = GCD(c,m) then a*c ≡ b*c (mod m) iff a ≡ b (mod m/d).  The =&gt;proof states this:  a*c ≡ b*c (mod m) =&gt; m|(a-b)*c                    =&gt; m/d | (a-b)*c/d                   =&gt; m/d | (a-b)                   =&gt; a ≡ b (mod m/d)   I don't understand how to go from step 2 to step 3. The proof states that this is possible because m/d and c/d are coprime. To me this means GCD(m/d, c/d) = 1 but how does this cancel out the whole term? Example of a Subgroup That Is Not Normal Can you kindly provide an example of a subgroup that is not normal?  I have been told many times that, for coset multiplication to be defined, the subgroup must be normal.  I have seen the proof and examples of quotient group multiplications.  Now, I am trying to find out where the process will break down if the subgroup is not normal.  Suppose that $x \in a_1H = a_2H, y \in b_1H = b_2H$, where $H$ is not normal. So $x = a_1h_1 = a_2h_2$ for some $h_1, h_2 \in H$, and $y = b_1h_1^* = b_2h_2^*$ for some $h_1, h_2 \in H$.  $xy = (a_1b_1)(h_1h_1^*) = (a_2b_2)(h_2h_2^*)$.  However, both $h_1h_1^*, h_2h_2^*$ are still elements of $H$.  So I don't see how $a_1b_1H \neq a_2b_2H$. A uniformly continuous function maps bounded set to bounded sets I am trying to prove the following:  If $A\subset\mathbb R$ is bounded and $\,f:A\to \mathbb R\,$ is uniformly continuous, then $f[A]$ is bounded.  Could you check my proof?  Let $A \subseteq [-K,K]\subseteq \mathbb R$. Let $\varepsilon = 1$. If $f$ is uniformly continuous there is $\delta$ wuth $|x-y| &lt;\delta$ imply that $|f(x)-f(y)|&lt;1$ for all $x,y\in A$. Let $a \in A$. Then because $A$ is bounded there is a finite number of balls $B(a_n,\delta)$ that cover $A$. Let the number be $N$. Then $f(a)-N \le f(x) \le f(a) + N$ for all $x\in A$. How to find python installation directory on Ubuntu I have just migrated from Windows environment. I have installed Python 3.2 in a separate directory. How can I get the python installation path in Ubuntu shell?  Is there any way I can let the shell know/choose at runtime which python version is to be used for further code execution?  Are there any environment variables and search path kind of things in Ubuntu Linux as well? How do I make a fully statically linked .exe with Visual Studio Express 2005? My current preferred C++ environment is the free and largely excellent Microsoft Visual Studio 2005 Express edition. From time to time I have sent release .exe files to other people with pleasing results. However recently I made the disturbing discovery that the pleasing results were based on more luck that I would like. Attempting to run one of these programs on an old (2001 vintage, not scrupulously updated) XP box gave me nothing but a nasty "System cannot run x.exe" (or similar) message.  Some googling revealed that with this toolset, even specifying static linking results in a simple hello-world.exe actually relying on extra .dll files (msvcm80.dll etc.). An incredibly elaborate version scheming system (manifest files anyone?) then will not let the .exe run without exactly the right .dll versions. I don't want or need this stuff, I just want an old fashioned self contained .exe that does nothing but lowest common denominator Win32 operations and runs on any old win32 OS.  Does anyone know if its possible to do what I want to do with my existing toolset ?  Thank you. I would like to say something like     The boy, Adam's, favorite toy was a bike.   What is the proper way to say this?