INPUT:   [user@notebook test]$ cat a.txt  music musicsheet sheetmusic  [user@notebook test]$ cat a.txt | cat -vte - $ ^[[1mmusic^[[22m$ ^[[1mmusicsheet^[[22m$ ^[[1msheetmusic^[[22m$ ^[[4m^[[24m$ [user@notebook test]$    NEEDED OUTPUT (after removing these interesting characters):   [user@notebook test]$ cat a.txt  music musicsheet sheetmusic [user@notebook test]$ cat a.txt | cat -vte - music$ musicsheet$ sheetmusic$ [user@notebook test]$    Question: How can I remove the interesting/unknown characters:   ^[[1m ^[[22m ^[[4m ^[[24m   what are these characters? could there be more similar?   Trying to use tr to remove non-printable characters just makes these interesting chars visible and removes newline, what is both bad:   [user@notebook test]$ cat a.txt | tr -cd '[:print:]' [1mmusic[22m[1mmusicsheet[22m[1msheetmusic[22m[4m[24m[user@notebook test]$
I have some Java executable (jar) that is run my some shell script from a cron job once every night. That executable does not print log statements &quot;as usual&quot; just by printing them out in a sequential manner like line after line (print after print), but while it processes its data its printing a single line with status data and then &quot;overwrite&quot; or &quot;update&quot; just that single line over and over again, until its done with this part of processing. Examples: A common program would output something line this: Program XYZ started..&lt;cr+lf&gt; processing 1&lt;cr+lf&gt; processing 2&lt;cr+lf&gt; processing 3&lt;cr+lf&gt; im done&lt;cr+lf&gt;  Simple! I can easily redirect its output to a file and I'm done. But the program I will have to deal with does it more like this: Program XYZ started..&lt;cr+lf&gt; processing 1&lt;cr&gt; processing 1 - part a&lt;cr&gt; processing 1 - part b&lt;cr&gt; processing 1 - part c&lt;cr&gt; processing 1 - part d&lt;cr&gt; &lt;cr+lf&gt; processing 2&lt;cr&gt; processing 2 - part a&lt;cr&gt; processing 2 - part b&lt;cr&gt; processing 2 - part c&lt;cr&gt; processing 2 - part d&lt;cr&gt; &lt;cr+lf&gt; processing 3&lt;cr+lf&gt; im done&lt;cr+lf&gt;  but much more intensive than I showed here. So it just not always overwrite status lines, but does it a lot while processing. So just redirecting or appending its output to a log file does not seem to make a lot of sense here, since it will just clutter the log file with millions of screen-updates that can not be viewed and understood that easily by humans. So my question is: is there a way or tool for programs that may behave like that to &quot;log&quot; or maybe &quot;screenshot every 30 seconds&quot; their output to a log file?
How to show $u \in R^{x} \implies u \in R[X]^{x}$ for integral domain $(R,+, \times)$ Why do sunbeams diverge even though the sun is much more than a few kilometers away? Consider this picture of sun beams streaming onto the valley through the clouds.    Given that the valley is only (at a guess) 3km wide, with simple trigonometry and the angles of the beams, this gives the result that the position of the light source is being a few tens of km away at most.   What is wrong with the analysis? Finding a tricky limit The "I Get It" Reputation Problem How to increase the Java stack size? Let $a,b,c$ be $3$ distinct integers, and let $P$ be a polynomial with integer coefficients.Show that in this case the conditions $$P(a)=b,P(b)=c,P(c)=a$$ cannot be satisfied simultaneously.  Any hint would be appreciated. Is it ok to ask to explain a certain piece of code on SO? Is it OK to ask on SO for help in explaining someone else's working piece of code, from Open Source projects or library examples etc.? Or does this belong somewhere else? 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. Free visual similarity image for a local hard drive search? I'm looking for a desktop search engine for finding images on my local hard drive with high visual similarity. I've only found paid for ones so far. It could be Linux or windows one, either would be helpful.  A Google desktop plug-in would be nice! Non-normality in residuals Show that $\{\cos\ n:n \in \mathbb{N}\}$ is dense in $[-1,1]$ by using the fact below:      Suppose $x$ is irrational. Then there exists $p_n,q_n \in \mathbb{Z}$   such that $\bigg|x -\frac{p_n}{q_n}\bigg| &lt; \frac{1}{q_n^2}$   I have no idea on how to apply the fact above to show the set is dense in $[-1,1]$. Can anyone help me? Fixed background image with ios7 Why would a slug thrower be more effective against a lightsaber/Jedi than a blaster? From  question about gunpowder in the Star Wars universe it is  that the shot from a  slug thrower is not completely deflectable by a lightsaber. This seems to be listed as an advantage (over blasters) against lightsabers and Jedi.     For example, during the days of the Galactic Republic, mercenaries fearing an intervention by Jedi Knights used rapid-fire slugthrowers that were impossible to completely deflect, unlike blaster bolts.   This doesn't make much sense though. A slug, while maybe not as deflectable should be just as ineffective against a lightsaber as a blaster shot is, due to the nature of a . That is, a blade made of plasma should simply vaporize the slug, should the slug manage to penetrate the containment field.     The weapon consisted of a blade of pure plasma emitted from the hilt and suspended in a force containment field. The field contained the immense heat of the plasma, protecting the wielder, and allowed the blade to keep its shape.   While a slug would seem to be more accurate than a blaster bolt (at least when used by a skilled marksman), I can't imagine that the slug would be faster than a bolt. Or if it is faster I wouldn't imagine it would be so fast that a Jedi would be unable to react with enough speed to block it, either with their saber or with the force. So what is the implied advantage of a slug thrower, versus a blaster, when used against a Jedi? I just had a case of a user who re-posted his question because his first question was closed as a duplicate. And, logically, I closed his re-post as a duplicate of his original, asking him to edit his original and explain why it's not a duplicate, so we can reopen it.  This process has worked like that for years now, but suddenly I realized that with the new message, question repetition is even encouraged:     This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.   Clearly, a new user who finds their questions closed will now be happy to just post their question again and again, until it's not a duplicate anymore, instead of just fixing their original post.  We need to be more explicit about this, and show this message to the OP of the question:     If those answers do not fully address your question, please edit your question and explain why it is not a duplicate.   The original message should still be visible to other users and visitors, as they can't fix that question, of course. Is hiding the ball allowed in football? Imagine all our football team except one player form a tight circle, with our hands on the shoulders of the people next to us.  Inside the circle there is the eleventh person with the ball. The whole "construction" is moving slowly towards the opponent's goal. It is inevitable that we will score.  Is this illegal? If yes, according to what rule? IE 11 Missing F12 Developer Tools the F12 Developer Tools windows is empty on my machine.    I've tried the following solutions, but nothing worked How to stop a script from running if it's not root (and echo "Not running as root! Exiting...") Open subscheme of an irreducible component remains open? Getting an error in W3C Markup Validation when trying to get a whole  element as a link in a page Find Neural Network Inputs Given Outputs I've trained a neural network with two inputs, a single hidden layer with two neurons, and one output using a bipolar sigmoid activation function. If a single input is known, how would I determine the second input to create a desired output?  For example, let's say the neural network is trained to add two inputs to produce an output. So if input_1 = 3 and input_2 = 4, the output will be 7, (3 + 4 = 7). Given input_1 = 3 and the desired output is 7, I want to calculate the second input required to produce the desired output (the answer should be 4).  How would I do this for a network that is more complicated than basic addition and has multiple inputs/outputs? For example, for a network with four inputs and two outputs, how would I calculate input_3 and input_4 given input_1, input_2, output_1 and output_2?