shell for loop with find with filenames containing spaces Consider a directory with typical Microsoft Windows filenames:   New Document.txt Foo.doc Foo - Copy.doc   I'd like to do something on each file such as:   for sendfile in $(find ${POLLDIR} -type f -mmin +1 -print0) do   echo \"${sendfile}\"   ls -l "${sendfile}"   and-so-on   if success_above   then     mv "${sendfile}" "${donedir}/."   fi done   Please note that I don't want to just run 1 command with "${sendfile}" as the argument. I need the loop to do error checking and other things (like moving "${sendfile}" on success and logging on failure).  What is a "correct" construct to escape/quote the filenames from find so I can use them in a for look like in the ls command above? If possible, I'd like to avoid storing the filenames in a temp file one by one.  I don't think that find -printf '"%p"\n' as suggested by triplee in the comments to question [  ] would work in a for foo in $(...) do construct.  I think replacing "illegal" chars with ? would work for me in this case, but it would be very ugly. The for loop ultimately processes files in ${POLLDIR} and then moves them when done, so the chance of "Foo bar.txt" colliding with "Foo-bar.txt" is 0 (-ish).  My best attempt so far is:   for sendfile in $(find ${POLLDIR} -type f -mmin +1 -print | tr ' ' '?') do   ... done   Any cleaner suggestions?
Looping through files with spaces in the names? I wrote the following script to diff the outputs of two directores with all the same files in them as such:  #!/bin/bash  for file in `find . -name "*.csv"`   do      echo "file = $file";      diff $file /some/other/path/$file;      read char; done   I know there are other ways to achieve this.  Curiously though, this script fails when the files have spaces in them.  How can I deal with this?  Example output of find:  ./zQuery - abc - Do Not Prompt for Date.csv
$g\in G$ maximal order in $G$ abelian then $G=\left\oplus H$ If $g\in G$ is an element of maximal order in a finite abelian group $G$ then exists $H\leq G$ such that $G=\left&lt;g\right&gt;\oplus H$  Attempt: Using fundamental theorem I know that $G=C_{n_1}\times\cdots\times C_{n_k}$ where $n_i|n_{i+1}$. With some work I proved $|\left&lt;g\right&gt;|=n_k$, so $C_{n_k}\cong \left&lt;g\right&gt;$. Then $G\cong H\times \left&lt;g\right&gt;$, but this is not an equality. Why do DNGs only show in low resolution on Google Photos? Through my NAS at home I store and backup all my photos on Google Drive. These photos also show up on Google Photos. I use Lightroom and convert all photos to DNG when copying to my NAS.  When I look at the photos in Google Photos the image is rather small. Clicking the (i) info button tells me the image has a resolution of 1024x680, file size 9.8 MB and a MP of 0.7. This is probably just a preview or thumbnail of some sort, but how do I view the image in larger resolutions in Google Photos? Suppose that $f(x)$ is continuous on $(0, \infty)$ such that for all $x > 0$,$f(x^2) = f(x)$. Prove that $f$ is a constant function. Suppose that $f(x)$ is continuous on $(0, +\infty)$ such that for all $x &gt; 0$,$f(x^2) = f(x)$. Prove that $f$ is a constant function. My attempt is to show that for any point $a \neq b$ , we have $f(a)=f(b)$. But I have no idea on how to get this. Anyone can help? Rendering smoke in Cycles? Convergence $I=\int_0^\infty \frac{\sin x}{x^s}dx$ Hi I am trying to find out for what values of the real parameter does the integral $$ I=\int_0^\infty \frac{\sin x}{x^s}dx $$ (a) convergent and (b) absolutely convergent.     I know that the integral is convergent if $s=1$ since $$ \int_0^\infty \frac{\sin x}{x}dx=\frac{\pi}{2}. $$ For $s=0$ it is easy to see divergent integral since $\int_0^\infty \sin x\, dx$ is divergent.  However I am stuck on figuring out when it is convergent AND or absolutely convergent.  I know to check for absolute convergence I can determine for an arbitrary series $\sum_{n=0}^\infty a_n$ by considering $$ \sum_{n=0}^\infty |a_n|. $$ If it helps also $$\sin x=\sum_{n=0}^\infty \frac{(-1)^{2n+1}}{(2n+1)!} {x^{2n+1}}$$. Thank you all For the recently reported production (January 2017) of metallic hydrogen in the laboratory - what is the evidence exactly? My google news page has burst forth the news that metallic hydrogen has been produced in a laboratory using a diamond anvil cell. Only  mentions (at this particular moment) that it has been called into question at - at least - premature. That can be read about in Nature:   Here I only want to ask about the evidence. Is it only the sudden change in visual appearance change as recorded in a camera on top of the microscope, at a specific temperature and pressure? That it "looks shiny?" Or is there actually more direct data than that?  note: I am not asking if the data is sufficient or not, nor if it is convincing, or metallic or not. Just a narrowly defined question about the extent of the observations that have lead to the proposal that a metallic state was achieved.     above: potentially three states of hydrogen as viewed in a diamond anvil cell, from . decode a quoted printable message in php I have the string which that encoded in .  How do I decode this in php?  Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vestibulum felis = pede, vestibulum et, ullamcorper in, ultrices eget, metus. Suspendisse in n= ulla. Sed justo. Donec dapibus auctor neque. Pellentesque faucibus ante nec=  metus. Vivamus feugiat, velit rhoncus semper suscipit, libero augue venena= tis leo, nec ornare nulla elit eget diam. Nullam sollicitudin. If a product of relatively prime integers is an $n$th power, then each is an $n$th power Are ores replenished over time? Can't install Oracle JDK 9 I uninstalled jdk packages and now can't install them back. I managed to install oracle-java7-installer and oracle-java8-installer but can't install oracle-java9-installer. It seems that my computer tries to download wrong version of oracle-java9-installer 177 when version i would be able to download is 178.    $ wget http://download.java.net/java/jdk9/archive/178/binaries/jdk-9+178_linux-x64_bin.tar.gz --2017-07-21 11:00:02--  http://download.java.net/java/jdk9/archive/178/binaries/jdk-9+178_linux-x64_bin.tar.gz Connecting to 10.144.1.10:8080... connected. Proxy request sent, awaiting response... 200 OK Length: 293348142 (280M) [application/x-gzip] Saving to: 'jdk-9+178_linux-x64_bin.tar.gz'  jdk-9+178_linux-x64_bin.tar.gz     1%[&gt;                                                          ]   5.42M  5.04MB/s               ^C  $ wget http://download.java.net/java/jdk9/archive/177/binaries/jdk-9+177_linux-x64_bin.tar.gz --2017-07-21 11:00:16--  http://download.java.net/java/jdk9/archive/177/binaries/jdk-9+177_linux-x64_bin.tar.gz Connecting to 10.144.1.10:8080... connected. Proxy request sent, awaiting response... 404 Not Found 2017-07-21 11:00:17 ERROR 404: Not Found.   Can you help? apt-get tries to install Oracle JDK 9.  I run Ubuntu 16.04 in virtual machine hosted by win7  Full error message:  sudo apt-get install oracle-java9-installer Reading package lists... Done Building dependency tree        Reading state information... Done oracle-java9-installer is already the newest version (9b177-1~webupd8~0). 0 upgraded, 0 newly installed, 0 to remove and 147 not upgraded. 1 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Do you want to continue? [Y/n] Y Setting up oracle-java9-installer (9b177-1~webupd8~0) ... Using wget settings from /var/cache/oracle-jdk9-installer/wgetrc Downloading Oracle Java 9... --2017-07-21 10:54:11--  http://download.java.net/java/jdk9/archive/177/binaries/jdk-9+177_linux-x64_bin.tar.gz Connecting to 10.144.1.10:8080... connected. Proxy request sent, awaiting response... 404 Not Found 2017-07-21 10:54:13 ERROR 404: Not Found.  download failed Oracle JDK 9 is NOT installed. dpkg: error processing package oracle-java9-installer (--configure):  subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing:  oracle-java9-installerE: Sub-process /usr/bin/dpkg returned an error code (1) Is there a missing definite article before caliph in 'the group's leader, XYZ, as (the) caliph'? I read news on the BBC (on its website) this morning. When I was reading the news I noticed the definite article the was missing in a sentence. As per my opinion, the reporter missed the article the. But I also thought that the reporter also had some point as he did not use the article there. So I just wanted to confirm so landed here to get some help on it.     On the website:      It also proclaimed the group's leader, XYZ  (name), as caliph and   "leader for Muslims everywhere".      As per my opinion it should have been:      It also proclaimed the group's leader, XYZ  (name), as the caliph and   "leader for Muslims everywhere".   Source link: Upvoting a downvoted answer will do +2 upvote? I have first downvoted an answer. Then, I decided to leave it the way it was before, meaning to undo my downvote just like it never existed, so I upvote to remove my downvote. Suprise! SO seems to consider it as two upvotes!  Let's say I have an answer with -3, then I decide to downvote it making it -4. After deeper thoughts, I prefer to remove my downvote to let it the way it was before I downvoted, meaning -3, but SO makes it -2 automatically!     Wouldn't it be supposed -3, and not -2? If someone else would have upvoted, it would have made it an upvote +1, not a +2!   Am I missing something here?  In fact, is there a way to tell SO that I only wish to undo my downvote, and not upvote the answer? I may understand why it does behave this way. I only wish to undo my downvote, though. What does "65" mean? How do I check if a package is installed on my server? I recently installed Ubuntu Server edition 13.10 (Saucy Salamander). But I have run into a bit of problem. At the end of the installation, it asks about several extra packages whether you want them or not, like OpenSSH server and virtual machine host. Here's what I'm looking at:  Now, my problem is that I can't remember if I have checked the &quot;virtual machine host&quot; checkbox. How do I check if my server has the corresponding packages? What packages come with the virtual machine host? What is a rocket engine thrusting against in space? I know Newton's third law of motion might be the answer for this but still I am wondering how the rockets could thrust in the empty space and move in the opposite direction. I guess an astronaut wouldn't be able to push in the empty space with his hands or legs to move himself, but with a rocket engine it's possible. How? What might be the explanation for this in General Relativity? Auto size image to page size in InDesign I've got an InDesign document with 100 A4 pages.   I've got 100 assets (a mixture of .jpg and .pdf files) and I want to place 1 per page. If an image is not the proportion of the A4 page I would like to get it as big as it can be on the page before it hits into the margin. Ex. if it's a portrait image it should be as large as it can be before hits the top/bottom margin. If it's a landscape image it should be as large as it can be before hits the left/right margin.   At the moment I'm dragging each file across and resizing them manually. Is it possible just drop them on the page and get them auto resized ? I have read so many things already that I'm more confused than before. So decided to ask this by myself.  My paladin just got his Find Steed spell, and after some tweaking and talking, he decided to get a Worg and I was okay with it. This last session was his first time using it and I have few doubts when it comes to combat.  I know that while mounted, he uses the mounts movement and actions. But what about when unmounted? What if the combat began with him walking by his mount's side?   Does the mount share his initiative? Are the actions that the mount do, part of the Paladin's actions? Or are they both separately, having his Action, Movement and Bonus Action and then the mounts Action and movement?   We've stated that it can understand him but not talk back, he just telepathically receives feelings as a feedback to his commands, knowing that the mount understood what he needed. Last session he just said things to the mount like "I tell the mount to protect the ranger and the druid" and in case they got hit, it would attack them, but it didn't really do anything at all, as I didn't know when it would act and I had too many things already to remember about the mount. How to measure capacitance without LC meter? I would like to use capacitors salvaged from old electronics, but I currently don't have an LC meter.    What would be some really simple circuits, that would convert capacitance to something I can measure (voltage, current, frequency)? Need help understanding "getbits()" method in Chapter 2 of K&R C In chapter 2, the section on bitwise operators (section 2.9), I'm having trouble understanding how one of the sample methods works.  Here's the method provided:  unsigned int getbits(unsigned int x, int p, int n) {     return (x &gt;&gt; (p + 1 - n)) &amp; ~(~0 &lt;&lt; n); }   The idea is that, for the given number x, it will return the n bits starting at position p, counting from the right (with the farthest right bit being position 0). Given the following main() method:  int main(void) {     int x = 0xF994, p = 4, n = 3;     int z = getbits(x, p, n);     printf("getbits(%u (%x), %d, %d) = %u (%X)\n", x, x, p, n, z, z);      return 0; }   The output is:     getbits(63892 (f994), 4, 3) = 5 (5)   I get portions of this, but am having trouble with the "big picture," mostly because of the bits (no pun intended) that I don't understand.  The part I'm specifically having issues with is the complements piece: ~(~0 &lt;&lt; n). I think I get the first part, dealing with x; it's this part (and then the mask) that I'm struggling with -- and how it all comes together to actually retrieve those bits. (Which I've verified it is doing, both with code and checking my results using calc.exe -- thank God it has a binary view!)  Any help? Gummy residue from baking spray/oil I'm sure everyone's seen this - that brownish stuff left behind when you grease an area of a baking dish that gets left exposed to the heat. Soap doesn't bother it too much, and it likes to gum up my scrubber. What's going on there, and are there any easy ways to get it off?