I have 1 directory. In this directory it contains 9folders(subdirectory). Each folder(subdirectory) contains a variable number of folders(subsubdirectory), and also in (subsubdirectory) it contains some folder....so on.... I tried this method but i dont know how to expand it because of variable number of subdirectory.          public static long GetDirectoryNumberOfFiles(string directory, bool includeSubDir)         {             long numberFiles = Directory.GetFiles(@directory).Length;              string[] subfolderEntries = Directory.GetDirectories(directory);//result 9              //i tried this, but without luck.             var dirInfo =new DirectoryInfo(directory);             int dirCount = dirInfo.GetDirectories().Length;//result 9               if (includeSubDir)             {               for (int i = 0; i &lt; subfolderEntries.Count(); i++)               { numberFiles += Directory.GetFiles(subfolderEntries[i]).Length; }//result 38             }            return numberFiles;     }   When I right clicked the directory, it contains 23,026 files and 440folders. But with this method, i got 38files and 9folders. I know it just count the subdirectories but not all folders inside directory.
Is there a way to find the number of files of a specific type without having to loop through all results inn a Directory.GetFiles() or similar method? I am looking for something like this:  int ComponentCount = MagicFindFileCount(@"c:\windows\system32", "*.dll");   I know that I can make a recursive function to call Directory.GetFiles , but it would be much cleaner if I could do this without all the iterating.  EDIT: If it is not possible to do this without recursing and iterating yourself, what would be the best way to do it?
has played the role of Wolverine as a major character in various X-Men films since 2000 and contributed highly to the brand of the X-Men movie series. But is he playing the Wolverine character for the last time in Logan?  I am getting to know from my friends that  is the last movie in which he is playing Wolverine and they all say that this is his last contracted film.  Are these rumors true? Is there any official information that confirms that this is Hugh Jackman's last movie as Wolverine? Let $f(z)$ be a holomorphic function on a disk of radius $&gt;1$ about the origin, and suppose that $|f(z)|\leq 1$ for $z$ with $|z|=1$ and $\text{Re}(z)&gt;0$ and $|f(z)|\leq 2$ for $z$ with $|z|=1$ and $\text{Re}(z)\leq 0$.  How does one show the bound $|f(0)|\leq \sqrt{2}$? Using round function in QGIS expression? How to represent kWh usage by year against average temperature? After much trial and tribulation, I thought I had drush all ready to roar. Much excitement. But then, no joy...  Drush is working. The sites operate fine via MAMP. Regardless, a "drush cc all" command returns:   No Drupal site found, only 'drush' cache was cleared.                                          [warning] 'all' cache was cleared.                                                                       [success]   This question has stumped drupalcon attendees and very experienced developers. Any ideas?  I am on Mac OS 10.9.3 using MAMP (free) Version 3.0.5  Here is my drush status:   Drupal version         :  7.29-dev                                 Site URI               :  http://default                           Database driver        :  mysql                                    Database hostname      :  localhost                                Database username      :  db_user                             Database name          :  db_name                        PHP executable         :  /usr/bin/php                             PHP configuration      :                                           PHP OS                 :  Darwin                                   Drush version          :  7.0-dev                                  Drush temp directory   :  /tmp                                     Drush configuration    :                                           Drush alias files      :                                           Drupal root            :  /Applications/MAMP/htdocs/mysite.dev   Site path              :  sites/default       Have tried executing drush from /Applications/MAMP/htdocs/mysite.dev; from /Applications/MAMP/htdocs/mysite.dev/sites/default; and using drush cc all --uri=http://localhost/mysite.dev  Tried running drush from sites/default. Same result. Double decimal formatting in Java How do I save a variable or function definition to a file? I have a long line of code that I want to break up among multiple lines. What do I use and what is the syntax?  For example, adding a bunch of strings,  e = 'a' + 'b' + 'c' + 'd'   and have it in two lines like this:  e = 'a' + 'b' +     'c' + 'd' Execute sudo without Password? I have a bunch of SD cards that do not have the little plastic switch for the read only setting. so Windows thinks it’s write protected or something. The card is not write protected by the software lock present on the SD card standard.  I’m using one with tape over the notch and it’s ugly. Also, the Thinkpad slot drags on the tape all the time so I’m afraid it will might loose in there eventually.  So, is there any way to tell Windows to ignore this lame write-protect feature?  I’m not interested on the SD card itself as it’s irrelevant for the issue at hand. Read this question as being about a 5.25” floppy disk drive instead of an SD card if you wish. I’m pretty sure the Windows settings are the same for both, really.  I’m  that there are 3 ways to secure an SD card. I’m talking about only the mechanical switch, which is the responsibility of the host to handle. Making adult decisions "is" or "are" really not fun: Which is correct? Easy way to write contents of a Java InputStream to an OutputStream I was surprised to find today that I couldn't track down any simple way to write the contents of an InputStream to an OutputStream in Java. Obviously, the byte buffer code isn't difficult to write, but I suspect I'm just missing something which would make my life easier (and the code clearer).  So, given an InputStream in and an OutputStream out, is there a simpler way to write the following?  byte[] buffer = new byte[1024]; int len = in.read(buffer); while (len != -1) {     out.write(buffer, 0, len);     len = in.read(buffer); } Cycles not rendering image or movie clip used as background in the viewport First time I've used cycles rendering engine.  I'm using a movie clip as the background in short animation. Selected RBGA under Property Tab, and Transparent under Film Tab.  It looks good and individual frames in OpenGL active viewport render, and looks fine.  When I try to get it to spit out PNG files of the finished animation the objects render out fine, except no movie clip background as Blender Render engine did when using Paper Sky setting.  Operator error, or am I trying to do something Cycles won't do?  Haven't found an answer in my searches so far.  Can anyone point me in the right direction please.   Addition:  I think I found my problem after a couple more hours of research.  Post should read "operator ignorance" instead of operator error.  Too tired to try the solution tonight, everything looks better in the morning. Thanks anyway.  Sorry, I just saw your posts.  Really tired.  Much appreciation. Cube of an integer $\frac{x}{y}+\frac{y}{z}+\frac{z}{x}=k$ and $x, y, z, k$ are integers.  Prove that $xyz$ is cube of some integer number.    I was wondering about giving a parametrization for the rational points on the elliptic curve in $\mathbb{P}^2(\mathbb{R})$ $$ x^2 y + y^2 z + z^2 x = k xyz$$ but I am not too confident in the topic, so I am asking you to shed some light.  Thank you for your help. I already have an Apple ID, made at Apple.com. Now, when I want to access the App Store from my iPad, I am told that I have to review my information. On the credit card page, I am not presented with a "None" option, even though I am in the United States.   What can I do to proceed without entering this information? I am creating a controller for a 12 V system using an Arduino Uno microcrontroller. For the outputs I am using a relay shield to switch the 12 V components. I have a 12 V toggle switch that turns on some 12 V components in the system and I want to use a trigger signal off of this same switch to send to an Arduino digital input. I know that the Arduino can only handle 5 V max. What would be the best way to step down the 12 V coming off of the switch to the 5 V for the input?  EDIT: The system is for use in a car. Would the amperage of the car battery need to be lowered somehow as to not blow up the components? Count the number occurrences of a character in a string I've used git clone to make a local copy of a GitHub repository containing a  I'd like to use. The local copy contains all of the source for the program; but as a newbie to Ubuntu, I've no idea of what tools or steps are involved in compiling and installing the driver.   I'd really appreciate if anyone could provide a step-by-step guide? How to show that $\int_{0}^{\pi}{\sin^5 x\over 1+\cos^3 x}\mathrm dx=\ln 3?$ Given the integral $(1)$     $$\int_{0}^{\pi}{\sin^5 x\over 1+\cos^3 x}\mathrm dx=\ln 3\tag1$$   This integral seems to be quite tough, I can't even know where to start. I have try substitution $u=1+\cos^3 x$ and $u=\cos^3 x$, can seem to remove the x variables.  We have the following identities   $$\sin^5a={5\over 8}\sin a-{5\over 16}\sin 3a+{1\over 16}\sin 5a\tag2$$  $$\cos^3 a={3\over 4}\cos a+{1\over 4}\cos 3a\tag3$$  We may write $(1)$ as  $$\int_{0}^{\pi}{\sin x(1-\cos^2 x)^2\over 1+\cos x(1-\sin ^2 x)}\mathrm dx\tag4$$  $u=1-\sin^2 x\implies \mathrm du=-2\sin x\cos x\mathrm dx$ then $(4)$ becomes  $${1\over 2}\int_{0}^{1}{(1-u)^2\over \sqrt{u}+u^2}\mathrm du\tag5$$  $u=v^2\implies du=2vdv$ then $(5)$ becomes  $$\int_{0}^{1}{(1-v^2)^2\over v+v^4}\cdot{v\mathrm dv}\tag6$$ Simplify to  $$\int_{0}^{1}{(1-v)(1-v^2)\over 1-v+v^2}\mathrm dv\tag7$$  I guess using partial decomposition of fraction and integrate term by term, seem lengthy process  How else can we prove $(1)$? How to develop RPG Damage Formulas?