I have a question on creating a batch script. I want to get the folder name as a variable in inside a path. For example:  I have a path, E:\ and there is several folders, i.e., E:\folderA, E:\folderB.  Could anyone tell me how to run a for loop and set the name of the two folders, folderA and folderB, inside a variable in a for loop using batch file?
How can I iterate over each file in a directory using a for loop?  And how could I tell if a certain entry is a directory or if it's just a file?
There's a story my grandpa use to tell me when I was younger, about the sole survivor of of an attack on a mining vessel in space. The man lives in space for months/years, ignored by the company he worked for and never rescued. Then when he thinks he is being rescued, it's actually another set of raiders who attack him and kidnap him.  He then wakes up in captivity in some sort of prison inside of an asteroid, and has a word tattooed on his forehead. My grandpa called him Ronin (that's what the tattoo on his forehead said) but I don't know what the character's real name is. Anyways, he learns that he has the ability to teleport after having a brush with death and decides to make his way back to Earth so that he can exact revenge on the mining company who abandoned him and left him floating to die.  Does anyone know what this story or book may be? My grandpa told it to me when I was little, he said that he got it from a book he use to love reading when he was younger. I'm assuming the book is very old (possibly pre 1940's as he was born in the 20s). I can't ask him as he is no longer alive. I'm also unsure as to whether or not all the details in the story he told me, are the same as in the original. How to initialize private static members in C++? What is the best way to initialize a private, static data member in C++?  I tried this in my header file, but it gives me weird linker errors:  class foo {     private:         static int i; };  int foo::i = 0;   I'm guessing this is because I can't initialize a private member from outside the class.  So what's the best way to do this? How can I escape white space in a bash loop list? I have a bash shell script that loops through all child directories (but not files) of a certain directory.  The problem is that some of the directory names contain spaces.    Here are the contents of my test directory:  $ls -F test Baltimore/  Cherry Hill/  Edison/  New York City/  Philadelphia/  cities.txt   And the code that loops through the directories:  for f in `find test/* -type d`; do   echo $f done   Here's the output:   test/Baltimore test/Cherry Hill test/Edison  test/New York City test/Philadelphia   Cherry Hill and New York City are treated as 2 or 3 separate entries.  I tried quoting the filenames, like so:  for f in `find test/* -type d | sed -e 's/^/\"/' | sed -e 's/$/\"/'`; do   echo $f done   but to no avail.  There's got to be a simple way to do this.    The answers below are great.  But to make this more complicated - I don't always want to use the directories listed in my test directory.  Sometimes I want to pass in the directory names as command-line parameters instead.  I took Charles' suggestion of setting the IFS and came up with the following:  dirlist="${@}" (   [[ -z "$dirlist" ]] &amp;&amp; dirlist=`find test -mindepth 1 -type d` &amp;&amp; IFS=$'\n'   for d in $dirlist; do     echo $d   done )   and this works just fine unless there are spaces in the command line arguments (even if those arguments are quoted).  For example, calling the script like this: test.sh "Cherry Hill" "New York City" produces the following output:   Cherry Hill New York City Sophomore's dream: $\int_0^{1} x^{-x} \; dx = \sum_{n=1}^\infty n^{-n}$ Shortcut or button for copying posted code from Stack Overflow I might just be lazy, but do you ever find it tiresome to select all the source code from a large post on Stack&nbsp;Overflow to copy it?  I would like a feature, possibly a Firefox extension, but preferably a JavaScript script, for automatically copying source examples to the clipboard. It's no big deal for a small snippet, but a 1000+ line posting is cumbersome to copy.  Do you guys have a better way of copying large source posts? I'm using Firefox 3.5.5 on Windows&nbsp;7. GCD of the already GCD I am given $f,f' \in L^1(\mathbb{R})$, and f is absolute continuous, I want to show that:  $$\lim_{|x|\rightarrow \infty} f(x)= 0$$  Not sure how to show this, I know that $f(x)=\int_0^x f'(t) \, dt+f(0)$, and I can assume without loss of generality that $f(0)=0$, any help?  Thanks in advance. Present Perfect vs. Present Perfect Continuous how are you?  Well, my biggest doubt at the moment is the difference between these two tenses. Actually, the more I study the more I have doubts with these tenses.      /         These similar threads helped me to clarify and reiterate my previous understanding.   I'm not posting in these threads because the site suggests avoiding asking for clarification (I don't know why because it would avoid new threads with the same content).  My main doubt is as follows:     I've lived in New York for two years.   In my understanding, the sentence above implies (1) that I lived in NY for two years and now I live in another place; or (2) I'm moving to another city after two years living in NY; or (3) I lived in NY for two years, then I moved to another place for some period and, finally, I'm returning. Is that correct?     I've been living in New York for two years.   Whereas the sentence above, in my understanding, implies that I lived in NY for two years and I still living there.  Anyway, many sources that I've already read say that these two sentences have the same meaning and are interchangeable. Therein lies my question. Is that correct? Because if these two sentences are interchangeable, it destroys all my understanding.  Thanks in advance. Why does speed of light have to be constant? My question is not about why speed of light has a particular constant value which has been sufficiently addressed in other questions on SE already. I want to know whether the fact that speed of light has to be constant is a consequence of other fundamental laws of Universe, or is it just a fundamental law itself.  My motivation for asking this question is thinking about Special Theory of Relativity. One way of understanding why time dilation and length contraction happen is to look at it from the perspective of constancy of speed of light. Alice who is on the moving source of light and Bob, a fixed observer see the speed of light as constant. In order for Alice to see the speed of light as a constant value, time slows down and length expands (in forward direction) thus keeping the speed constant.   In the  I'm doing, the Professor tells that this constancy of speed of light could be more generally referred to as, "Principle of wave constancy". That is, the speed of any wave is a property of the medium (and thus it remains constant). So, the speed of a wave in water, for example, remains constant even if the source of the waves (say a paddle keeps moving). Frequency and wavelength may change but the speed remains constant. In a similar fashion, light is an electromagnetic wave and thus its speed is constant. And the constant speed is defined by the medium (which happens to be vaccum i.e., no medium for light).   My questions are twofold now -    Is the above reasoning correct to explain why speed of light is constant? (i.e., thinking of it as constancy of any wave in general) Theoretically, could there be other waves that could travel through vaccum at a different speed? If yes, time dilation and length contraction will have to be different.   I'd appreciate it if the answer is kept non-technical (essential math is okay). More importantly, I request you to try and explain without using General Theory of Relativity. Because I'm thinking how the scientific understanding by 1905 had already knew that speed of light has to be constant. I am trying to solve a variation on the .  In this scenario, someone is selecting coupons at random with replacement from n different possible coupons. However, the person is not selecting coupons one at a time, but instead, in batches.  Here's an example problem formulation: There are 100 distinct coupons. A person makes selections in 10-coupon batches at random (each coupon with replacement). What is the expected number of batches necessary to have selected 80 unique coupons?  I have been able to determine the expected number of selections necessary to have selected k unique coupons when selecting one at a time (much like Henry's ), but I'm a bit stumped as to how to go about solving it with this particular wrinkle.  Any tips/guidance would be greatly appreciated. My understanding is that a question is historically locked because the information in it is too valuable for the question to be deleted.   But if the "valuable information" becomes obsolete, what happens then?  We cannot modify the question content, or the answers for a historically locked question, right? Capitalizing "the" when mid-sentence in a company name? Consider a company called:     The Association of Examples Ltd.   When you refer to this company, should you have to capitalize "the" when it's mid-sentence and would have been used even if it wasn't in the name?   It looks odd to me:     In other news, The Association of Examples announced that...      Sarah is the founder of The Association of Examples and has...   But I imagine it's the correct way.  For the grammar-conscious, why or why not?    To give you context, I am asking also when branding ones own company like that. The Economist did it (as did ) and , but I can imagine it can cause confusion. In System Info in 11.10, the graphics driver wasn't detected. I use ACER Aspire 4750 with Intel Core i3-2340M and Intel HD Graphics 3000 graphic card  How to install the driver for my Ubuntu? When using a new Windows 8 search bar:    What is the syntax of the search expression? Is it possible to use wildcards like "*", "?" or any other special symbol?  For example, when searching with Google i can use:   '-' (minus) for excluding certain words; "quoted phrase" for exact phrase matching. Prove F test is equal to T test squared I need to show that F test is equal to T test squared, when the T test is for 2 independent groups and assuming variances are equal.  I know that $F=\frac{MSB}{MSW}=\frac{SSB/k-1}{SSW/N-K}$ and I know that $T=\frac{X-Y}{S_p \sqrt{\frac{1}{n}+\frac{1}{m}}}$,   so $T^2=\frac{(X-Y)^2}{S_p^2 ({\frac{1}{n}+\frac{1}{m}})}$  I've seen this proof in Regression but here we're not using MSE and MSR, so i'm not sure how to connect between the two. Posting to friends' wall with Graph API via 'feed' connection failing since Feb 6th 2013 Problem with ListVectorPlot3D Is there an invalid pthread_t id? How to make a bootable ISO image from a bootable DVD? I want to make a .iso image of a bootable OS DVD, to use in VirutalBox.    Nautilus can make a .iso, but only of data files, it seems. The .iso it created was not bootable.  What is available to make a bootable .iso from a bootable DVD? How can I mass rename files? I've got a bunch of files named with a the pattern 99 - DescriptiveName.txt and I'd like to remove the number from the front so I just have DescriptiveName.txt.  How can I do this? Can I do it from the command line or is there a utility that can do this?