tar in parallel I have a directory with several hundred sub-directories. I want to tar and compress each sub-directory and name the resulting file &lt;currentDirName&gt;.tar.bz2.  I have done:  find ./dir -type f -print0 | xargs -0 -n1 -P100 bunzip2  to decompress 100 files at one time. (I do ocean modeling so my machine is quite powerful with many quad cores.) I do not know how to do something like the above while including information on naming the compressed archive file on the fly. I don't want to do tar cfj dir.tar.bz2 dir for each one.  Can I do it with each directory name being used automatically as the tar file name - via either find or parallel so that 100 or more can be done at a time as in the bunzip command above?  Thank you for input.  ....Peter
tarring in parallel An Oceanographer friend at work needs to back up many months worth of data.  She is overwhelmed so I volunteered to do it.  There are hundreds of directories to be backed up and we want to tar/bzip them into files with the same name as the directory.  I can do this easy enough serially - but - I wanted to take advantage of the several hundred cores on my work station.  Question:  using find with the -n -P args or GNU Parallel, how do I tar/bzip the directories, using as many cores as possible while naming the end product:  origonalDirName.tar.bz2?  I have used find to bunzip 100 files simultaneously and it was VERY fast - so this is the way to approach the problem though I do not know how to get each filename to be that of each directory.
The energy of an electromagnetic wave The intensity of an electromagnetic wave is only related to its amplitude $E^2$ and not its frequency. A photon has the same wavelength as the wave that's carrying it, and its energy is $h  f$.   So if a laser wave is kept at the same amplitude and the wave length is reduced, why does its intensity remain the same even though its photons now carry less energy?  Why are the intensities of electromagnetic waves so different to sound waves (and other waves travelling through a medium) which are related to $f^2  E^2$? I have a list of arbitrary length, and I need to split it up into equal size chunks and operate on it. There are some obvious ways to do this, like keeping a counter and two lists, and when the second list fills up, add it to the first list and empty the second list for the next round of data, but this is potentially extremely expensive.  I was wondering if anyone had a good solution to this for lists of any length, e.g. using generators.  I was looking for something useful in itertools but I couldn't find anything obviously useful. Might've missed it, though.  Related question: General term of Taylor Series of $\sin x$ centered at $\pi/4$ What makes the number of neutrons the number of proton similar? Grid System in LaTeX How to remove a watermark from a PDF file? I thought this would be a simple task, but it turned out the other way.  The watermark is the very same (overlapping, but transparent) image on every single page. I created the PDF file myself (so no copyright worries here) using PDFCreator 0.9.8.  I have already tried my friend's Adobe Acrobat Pro, but it didn't work. It tries to remove it, but it can't. I tried to remove header/footer, etc., but the watermark just won't disappear.    How can I remove the watermark? The youngest person on Earth in a society of immortals The protagonist is the youngest person on Earth -- the only one to be born in many centuries. Terrestrial society is small but every individual is unique and multitalented, as they are all immortal and have lived for centuries. They live in flying habitats.  No one knows how to raise children anymore; the protagonist wears diapers into adulthood because he was never potty-trained, and his education was haphazard. Consequently, he is quite lost in this advanced society, and only tolerated by the sophisticates around him.   When the Earth is invaded, the immortals put up only a show of a fight, arriving at the scene of battle in a colorful flotilla of unarmed flying habitats. To the horror of the protagonist, they are wiped out by the invaders. He realizes that the immortals were weary of life and welcomed this end.   This is probably a novel, though it might be a novella. It was written in English and I read it probably in the 1970s or 1980s. the following code will only make the qed not appear in the second proof. However, it it possible to make the qed symbol never appear at the end of the proofs without having to specify it locally every time?  \documentclass{article} \usepackage{amsthm} \begin{document} \begin{proof} This has the QED symbol. \end{proof} \begin{proof}\renewcommand{\qedsymbol}{} This hasn't. \end{proof} \begin{proof} And this has it again. \end{proof} \end{document} How do I prove this form of mean value theorem for integral? I only knew the standard mean value theorem for integrals. (i.e. $\int_a^b f(x)dx= f(c)(b-a)$ for some $c$ between $[a,b]$ where $f$ is continuous. This is directly derived by applying mean value theorem and Fundamental theorem of calculus) I'm taking numerical analysis this year and there is one theorem stated without a proof in my text. That is:  Let $f,g$ be continuous real-valued functions on $[a,b]$ such that $g$ is nonnegative. Then there exists some $c$ between $a,b$ such that $\int_a^b fg(x) dx = f(c) \int_a^b g(x) dx$  How do I prove this? Background: I am currently employed by a start-up that, so far, is doing really well. As part of my contract, I have stock options that will come available on a typical vesting schedule. A quarter of my options are set to vest later this year. Also, the company is not public yet, and it may be several years before it is public / I could sell my shares of the company.  My question is, is there any reason I should exercise them as soon as they vest? As far as I know they don't expire as long as I work at my company (if I leave for any reason, then I only have 3 months to exercise).  I don't foresee leaving any-time soon, and if I did, I would have 3 months to make a final decision.  Is there any disadvantage to just letting the option stay an option for a while? Stack Overflow reputation in CV Should I mention my Stack Overflow (and other Stack Exchange sites) reputation in my CV while applying for a post-graduate position? Given the following class  public class Foo {     public int FooId { get; set; }     public string FooName { get; set; }      public override bool Equals(object obj)     {         Foo fooItem = obj as Foo;          if (fooItem == null)          {            return false;         }          return fooItem.FooId == this.FooId;     }      public override int GetHashCode()     {         // Which is preferred?          return base.GetHashCode();          //return this.FooId.GetHashCode();     } }   I have overridden the Equals method because Foo represent a row for the Foos table.  Which is the preferred method for overriding the GetHashCode?  Why is it important to override GetHashCode? How to find which RAM to get for my computer? I don't have any knowledge in hardware and would like to know which RAM should I buy for my laptop.  How do I discover what RAM I need &amp; how much my machine can take?  I have a Razer Blade 15 (RZ09-02705F76) 2018 but don't know if there is a specific type or format of RAM that suits it and don't know where to find this information. Universal type tranformer in Haskell Big-O Notation Proof Given the definition of Big-O, prove that $f(n) = n^2 - n$ is $O(n^2)$.  When I use the given definition, I get $n^2 - n \leq n^2 - n^2$ which means that $n^2 -n \leq 0$, which is not true. Is there some step I'm missing? Well, may be this is not really useful, but I've thought if it was possible to put all the document in one long page. I mean, if your document is going to be read in a computer, mix all the pages in a continuous page. If your document has 90 pages (A4), where each one is 21cm by 29.7cm the continuous document should be (more or less) one page which is 21cm by 90 · 29.7 = 2673cm. Is this possible? EDIT: Some things I would like to achieve:  The \newpage, \chapter{}, \part{}, etc. shouldn't go to a new page, they should only add more vertical space. The package pdfpages should add the pages continuously with almost no space between them. The titlepage, in this case, has a different color, so it could go alone in a basic A4 page (just to make things easier).  Question Is this possible? Find remainder when $f(x^{12})$ is divided by $f(x)$ How do I get a consistent byte representation of strings in C# without manually specifying an encoding? How do I convert a string to a byte[] in .NET (C#) without manually specifying a specific encoding?  I'm going to encrypt the string. I can encrypt it without converting, but I'd still like to know why encoding comes to play here.  Also, why should encoding even be taken into consideration? Can't I simply get what bytes the string has been stored in? Why is there a dependency on character encodings? I need to include a couple of Python code listings, where the indentation of the lines (using some number of spaces) is significant. I would like for the code listings to be copyable, so the spaces at the beginning of the line need to be be copied along with the text.  This question has been asked in various ways before (e.g. , or ). Those questions focus on making line numbers uncopyable, though.  Making the spaces at the beginning of a line copyable seems to be harder: "I am not sure it is possible to specify in the PDF (at least in a viewer-independent way) that the indentation should be copied too" (). At , Philippe Goutet suggests a solution (turning the spaces into visible spaces, and coloring them in the background color so that they appear invisible) that works using Acrobat Reader, but not all readers. He says "It works under Acrobat Reader and it's extremely pleasant to be able to quickly copy/paste code without problem (perhaps the problem can be circumvented by writing direct PDF code to tell that it's a space, I've never had the time to try)".  Is it possible to produce a PDF with a code listing with copyable real spaces at the beginning of a line?  Minimal example: The line return x should start with four spaces.  \documentclass{article}  \begin{document} \begin{verbatim} def myfunction(x):     return x \end{verbatim} \end{document}   I know that I could attach the code to the PDF as a file, but that's not what I want. Can't access pre populated SQLite database using PhoneGap/Cordova in Android