I have a program which gives random files. It is simple but I'm quite new to this. Im having trouble with creating fileinfo list of files. I added a contextmenustrip which has multiple choose of file genre (e.g: video files, text files..)  I wanted to define string array with cntxtmnustrp. and want it make new array and combine with previous. But it didnt work. Should I create a arraylist and add each list to this?     public partial class Form1 : Form {     public Form1()     {         InitializeComponent();     }     Random r = new Random();     string path1;              DirectoryInfo dif;   // List&lt;FileInfo&gt; files;     FileInfo[] files;     FileInfo[] newfiles;       int randomchoose;     int fok;     int kok, pd;      string[] filetypes;             private void button1_Click(object sender, EventArgs e)     {          FolderBrowserDialog hoho = new FolderBrowserDialog();  // yeni dosya yeri          hoho.ShowNewFolderButton = true;          if (hoho.ShowDialog() == DialogResult.OK)          {             path1 = hoho.SelectedPath;              textBox1.Text = path1;             dif = new DirectoryInfo(path1);                            foreach (string ft in filetypes)         {            files = dif.GetFiles("*.ft", SearchOption.AllDirectories);           //files.AddRange(dif.GetFiles(string.Format("*.{0}", ft), SearchOption.AllDirectories));              newfiles = newfiles.Concat(files);         }                                                                         //pd = liste.Length;             pd = files.Length;             kok = pd;         }                       }          }            private void button1_Click_1(object sender, EventArgs e)     {         listBox1.Sorted = true;      }      private void cesit_Click(object sender, EventArgs e)     {         //contextMenuStrip1.Show();         contextMenuStrip1.Show(this.PointToScreen(cesit.Location));     }       private void videoFilesToolStripMenuItem_Click(object sender, EventArgs e)     {         filetypes = new string[2] { "txt", "png" };      }      private void musicFilesToolStripMenuItem_Click(object sender, EventArgs e)     {         //tur = ".png";         //textBox4.Text = tur;     }      private void textFilesToolStripMenuItem_Click(object sender, EventArgs e)     {      }  }
I am trying to use the Directory.GetFiles() method to retrieve a list of files of multiple types, such as mp3's and jpg's.  I have tried both of the following with no luck:  Directory.GetFiles("C:\\path", "*.mp3|*.jpg", SearchOption.AllDirectories); Directory.GetFiles("C:\\path", "*.mp3;*.jpg", SearchOption.AllDirectories);   Is there a way to do this in one call?
We know that if a finite field $F$ has characteristic $p$ (prime), then $F$ has cardinality $p^r$ where $r = [F:\mathbb{F}_p]$.   I'm now trying to say something about the possible cardinalities of subfields of $F$. I can see that there is a subfield of cardinality $p^s$ for each $s$ that divides $r$, given by the fixed field of the group generated by $\phi^s$, where $\phi$ is the Frobenius automorphism.  Now suppose $K$ is a subfield of $F$. Then (since both are additive groups), Lagrange gives us that $|K|$ divides $|F|$, so $|K| = p^t$ for some $1 \leq t \leq r $ (alternatively, $K$ contains $\mathbb{F}_p$ and so is a vector space over $\mathbb{F}_p$ and is thus isomorphic to $\mathbb{F}_p^t$, where $t = [K:\mathbb{F}_p]$). By considering the multiplicative group of units of $K$ and $F$ respectively, we get that $ p^t - 1$ divides $p^r -1$. I want to make the leap to $t|r$, but I'm failing to see why this needs to be true. Any help would be appreciated. I have a common scenario in app design, where I need to store an ordered list, and make the ordering easily accessible and adjustable via an application UI.    The ordering operations are simple and operate on only one item at a time - move to top, move to bottom, move up one position, or down one position.  These positioning operations may be interspersed in with typical add / edit / delete list operations.  For discussion, this is a single-user app and db store.  Because the objects can be highly complex, I'd like to avoid caching the entire list client-side, and tracking newly created objects in memory until a big save operation occurs.    I am using MS-SQL almost exclusively on these projects, and I'm wondering if there are db features, SQL features, or design patterns I should be using to better support the management of ordered lists.    My current approach is to use a DECIMAL column to store the list positions, which become fractional during the item move process.  Then I sort the list and re-generate integer positions to normalize list.  Following this operation, it's ready for another item move.   In an example implementation, I create a column named Seq for position tracking.  Once decimal place is enough for the .5 storage.   [Seq] [decimal](10, 1) NOT NULL   When an item is re-positioned in the app UI,    I UPDATE that record with new Seq value I retrieve the full table, sorted ascending by Seq and regenerate all Seq values in the table from a 1-based integer series   The new Seq value is easily calculated-    Move to top = 0 Move to bottom = MAX(Seq) + 1 Move up = subtract 1.5 from the current Seq value Move down = add 1.5 to the current Seq value   As lists get longer, updates get slower, since I'm doing N UPDATE statements, where N is the number of rows in the table, so it seems only suitable for small tables.    Is there some kind of in-built capability for managing an ordered list in SQL or MS-SQL? Is there a means to update multiple rows in one call?    A far more performant approach would be to allow more decimal places, and then position at the median of the two adjacent items, with no re-sequencing on the list.     Move to top = Min(Seq) - 1 Move to bottom = MAX(Seq) + 1 Move up = median of the 2 previous item Seq values Move down = median of the 2 following item Seq values   This approach only requires one SELECT (containing 2 rows max) and one UPDATE.    However with enough re-positions I imagine the field would run out of decimal places. For example, if I start with items at positions 10 and 11, and keep moving items down the list from position 9, they'd be given sequences of 10.5, then 10.25, then 10.125.  After 10 moves, the positions get lengthy... 10.0009765625.    UPDATE #1 - IMPROVED RE-SEQUENCING OF THE LIST  Regarding re-sequencing, I'm more caught up on row_number(), OVER, and WITH capabilities in MS-SQL.  It's nice to find that there's a much smoother way to re-sequence the list in a single UPDATE operation;  with OrderedItems as  (     select         ItemID,         Seq,         row_number() over (order by Seq asc) NewSeq     from          Items ) update OrderedItems set Seq = NewSeq I would like to show the author names using \citet but I get just the reference number. Here is a minimal code:  \documentclass{report} \usepackage[utf8]{inputenc} \usepackage[english]{babel} \usepackage{natbib}  \begin{document}   The author \citet{toschi09} has shown that ..  \bibliographystyle{plain} \bibliography{foo}  \end{document}   And here is foo.bib  @article{toschi09, author = {Toschi, F. and Bodenschatz, E.}, title = {Lagrangian Properties of Particles in Turbulence}, journal = {Annual Review of Fluid Mechanics}, volume = {41}, number = {1}, pages = {375-404}, year = {2009},  }   What I get is:     The author (author?) [1] has shown that ..   Any help will be more than welcome, thank you! There's a new popup helping you with searching, but one of the hints is wrong:    Searching for  will return answers as well as questions, and it's not the number of (up/down)votes which counts, it's the score. Better would be "posts with a score of 3 or higher" or "questions and answers with a score of 3 or higher". After upgrading to 12.10 quantal, the packaged version of fglrx no longer works. I discovered that this is because there is a separate 'legacy' fglrx driver for the HD 2k-4k series cards, but it is incompatible with the xorg server on 12.10.  This is the most current version of the driver for HD 2000 through HD 4000 series cards. You can't use the non-legacy fglrx driver, but you can use the open-source radeon driver if you prefer your WM compositing to be laggy and your YouTube videos to play like they would on a Pentium MMX series:    Usually this driver can be installed in the following way, necessary because apt-get install fglrx would pull in the non-legacy driver:  wget http://www2.ati.com/drivers/legacy/amd-driver-installer-12.6-legacy-x86.x86_64.zip unzip amd-driver-installer-* sudo sh ./amd-driver-installer-*.run --buildpkg Ubuntu/quantal sudo dpkg -i fglrx*.deb sudo aticonfig --initial -f   If you use a different version of fglrx (for example, a newer 12.9 that doesn't support those cards) then the final command will give you an error no supported hardware detected or something similar. However, everything works at this point and you will get a reasonable xorg.conf:  ... other stuff  Section "Device"         Identifier  "aticonfig-Device[0]-0"         Driver      "fglrx"         BusID       "PCI:1:5:0" EndSection  ... other stuff   At this point you're supposed to reboot and everything will be working with the fglrx driver. However, upon rebooting, you'll be treated to the following errors in Xorg.0.log when fglrx attempts to load:  (EE) Failed to load /usr/lib/xorg/modules/drivers/fglrx_drv.so: /usr/lib/xorg/modules/drivers/fglrx_drv.so: undefined symbol: noXFree86DRIExtension   Some searching around will show that this is a problem with the legacy ATI drivers not supporting xserver 1.13 or newer. () ATI has released a fixed driver for its most recent (HD 5000 series or later) cards, but not for the 'legacy' cards yet. The non-legacy ATI drivers can't be used with the old cards.  What should an Ubuntu user, using one of these HD 2000-4000 series cards, do?    Wait for an updated 'legacy' ATI driver that properly works with xserver 1.13?   Downgrade back to 12.04 Precise, which uses xserver 1.11? Try to downgrade xserver on 12.10 Quantal to 1.12, which could possibly break Unity and GNOME? Forced upgrade to HD 5000 series or later card? (Not possible with integrated graphics...) Some other 1337 action that fixes this problem painlessly? House wiring and grounding. How do you retrofit an old house and ground it? A contractor looked at our house and told me that you can't fix a house (with old wiring) that has some outlets that are not grounded.  He said that you can go on YouTube and search the internet and it will tell you that you can.  He says that the only way to properly fix and ground everything is to do a whole house rewire.  Is he correct?  If, theoretically, you have an old house that has no ground whatsoever, can you run a grounding wire from the panel to all of the outlets to fix this?  updated  We have BX/AC wiring. And also apparently we have "...old-style AC (BX) with cloth insulated wires in a paper overall wrap under the spiral armor (no bonding tape)" Courtesy of @ThreePhaseEel. I don't understand the proof to the a/m claim. How we know that $\eta &lt; \kappa$ and $(\alpha,\beta)&lt;_{cw} (0, \eta) $ and hence $h: \mu \to \eta \times \eta$ is injective? Appreciate if anyone could advise.  Here is an excerpt of the proof:  For an infinite ordinal $\kappa,$ the canonical well-ordering of $\kappa \times \kappa,$ denoted by $&lt;_{cw}$ is defined as follows: $(\alpha_1, \beta_1)&lt;_{cw} &lt; (\alpha_2, \beta_2)$ iff either one of the following holds.  $(1): \max\{\alpha_1,\beta_1\} &lt; \max\{\alpha_2,\beta_2\}$  $(2): \max\{\alpha_1,\beta_1\} =\max\{\alpha_2,\beta_2\}$ and $\alpha_1&lt;\alpha_2$   $(3): \max\{\alpha_1,\beta_1\} =\max\{\alpha_2,\beta_2\}$ and $\alpha_1 = \alpha_2$ and $\beta_1 &lt; \beta_2.$  Claim: For all infinite cardinals $\kappa, (\kappa \times \kappa, &lt;_{cw}) \cong (\kappa, \in).$  Proof: (It has been show that it is true for $\kappa = \omega$) Assume there is a counterexample  $\kappa.$ Let $A= \{\lambda \in \kappa + 1| \lambda\geq \omega \ is \ a \ cardinal \ and \ (\lambda \times \lambda, &lt;_{cw}) \not\cong (\lambda, \in)\}.$ Then, $\kappa \in A.$ Let $\mu$ be least element of $A.$ Thus, $\mu &gt; \omega$ and for all $\lambda,$ if $\omega \leq \lambda &lt; \mu$ and $\lambda$ is a cardinal, then $(\lambda \times \lambda, &lt;_{cw}) \cong (\lambda, \in).$  By Comparability theorem, $(\mu, \in)$ is isomorphic to initial segment of $(\mu \times \mu, &lt;_{cw})$ since $|\mu \times \mu| \geq \mu$ and $\mu$ is cardinal. Let $(\alpha, \beta) \in \mu \times \mu$ such that $(\mu, \in)$ is isomorphic to initial segment of $(\mu \times \mu, &lt;_{cw})$ given by $(\alpha, \beta).$ Let $h$ be the isomorphism. Let $\eta= \max\{\alpha, \beta\}+ \omega.$ Then $\eta &lt; \kappa$ and $(\alpha,\beta)&lt;_{cw} (0, \eta).$ HENCE, $h: \mu \to \eta \times \eta$ is injective. how to write in TeX "computer zero" with slanted vertical line on it? In TeX, how is computing zero sign written with slanted vertical line on it? Compiling with g++ using multiple cores How can I scale all images in a folder to the same width? I want to scale all images in a given folder to the same width (but different appropriately scaled heights). How can I do this using  a GUI-based or command-line tool?  For bonus points, is it possible to restrict which images are scaled based on their initial width (that is, only scale images that have a width > x and/or a width &lt; y)? Irreducible element iff prime norm in Gaussian integers? I am trying to prove the following: Let $R=\mathbb{Z}[i]$, $a, b \in \mathbb{Z}, ab \neq 0$. Show that $a+bi$ is an irreducible element in $R$ if and only if $a^2 + b^2 ∈ \mathbb{Z}$ is prime. Since $R$ is a Euclidean domain, irreducible elements are prime. I think this is relevant, but am stuck on where to go from here. How to render a 30K image with cycles? I have to render an image of 27000 x 7000 for a 150dpi print. The scene is quite big, but cycles preview and a render in 2700x7000 works as expected.  If I hit render my memory raises up to 20gb, but my cpu usage is at 5%. Why cycles does not using the full cpu power during the render process?  Here are my rendersettings:  Pathtracing Samples:3000 Tilesize: 64x64 Bounces: Max 12 | Min 3 Diffuse: 4 Glossy: 4 Transmission: 12 Volume: 1   Is there a way to optimize things? Sequence of tenses for facts irrelevant of the moment of speech Let's consider two sentences:     (1) I suggested that the word zeitgeist was of German origin.   (2) The lecturer said the Pluto's orbital period is more than 200 years.   In both cases, the facts are always valid and  irrelevant of the moment of speech and context. I've heard sequence of tenses is not required in such cases. Are past and present tenses interchangeable in both of them? Would it be correct to say:     (1) I suggested that the word zeitgeist is of German origin.   (2) The lecturer said the Pluto's orbital period was more than 200 years. What happens if my shield breaks? "He added" vs. "Did he add" (inversion after negative adverb) Cycles Normal Bake does'nt bake indents that are not tapered How to use XMLHttpRequest to download an HTML page in the background and extract a text element from it? Can I change the color of the last selected face, so that it is the same as the other selected faces?  Here, I've selected the left face then the right face. Note the right face is some sort of checkered or dithered pattern, and just the outline has the nice orange 'selected' color.    Here I've selected the top face, note the right face has now the nice color.    And here I've deselected the top face. Now, both of the remaining selected faces have the nice color. This is the result I'd rather see instead of image 1. I received a mail today from Academia.edu (a site I wasn't previously aware of), asking me to confirm that I co-authored a paper with a colleague.  Having looked into it a little it sounds like it might be a useful site - the idea of a "social network for scientists" is one I've seen the need for in the past. However, partly due to bad experiences with the seemingly similar ResearchGate, I'm also skeptical.* Without signing up for an academia.edu account the site doesn't offer much information, so I would like the following information:   What specific features does academia.edu offer to its users? Is it genuinely useful for any of the following purposes (each of which seems genuinely needed)   as a platform for networking with academics for discovering relevant research as an effective system for post-publication peer review for organising references among a small team of people working on a project  Will it send out mails to my colleagues without my express and explicit permission? (I.e. are the mails I received today the result of a deliberate action by my colleague, who is aware that I will be emailed and wishes me to join the site; or are they essentially spam from a social networking site aggressively trying to expand its user base?) It's clear from its  that it's a private, venture-capital funded company. What is its business model?   In short, is this a site that has some genuine utility for academics, or should I just ignore it?  *I've never signed up for ResearchGate but I regularly receive spam from it purporting to be from my colleagues, who aren't aware that it's being sent on their behalf. I would be mortified if my senior colleagues received such mails claiming to be from me, so I won't touch it with a barge pole. Where are the outliner toggles in 2.8? The selection toggle arrows in the Outliner disappeared. Is there some preference in the settings that has to be turned on?