I recently came across code in an application that does the equivalent of this:  var source = new List&lt;string&gt;(); source.AddRange(getSomeListData());  var index = source.Count &gt; 10 ? source.Count - 10 : 0; var target = new TargetObject {     Line1 = source.Count &gt; index ? source[index++] : string.Empty,     Line2 = source.Count &gt; index ? source[index++] : string.Empty,     Line3 = source.Count &gt; index ? source[index++] : string.Empty,     Line4 = source.Count &gt; index ? source[index++] : string.Empty,     .     .     . }   The goal here is to include the last 10 items from the source data in the output object (in our case, the last line is crucial). But we don't know how many lines of data will be present -- it could be as few as 1.  This code works, at the moment, because VS2013 is running the member initializers in source-code order, so the side-effect of each index++ happens in the correct order. However, I read through the C# 5 specification and I cannot find any guarantee that this will always be true. Is the order in which these members are initialized deterministic, or is the above code subject to breaking in some future version of VS and/or other C# compilers?  (I have an opportunity to change it now, if there's a risk, but I don't want to change the code just for the sake of change.)
Does the order in which I set properties using the object initializer syntax get executed in the exact same order?  For instance if I do this:  var s = new Person { FirstName = "Micah",                      LastName = "Martin",                      IsLoaded = true                    }   will each property get set in the same order?
extract the 4th column from a csv file using unix command I have a csv file formatted as below.  "col1","col2","col3","col4" "1","text1","&lt;p&gt;big       html      text&lt;/p&gt; ","4th column" "2","text2","&lt;p&gt;big2       html2      text2&lt;/p&gt; ","4th column2"   I want to extract the 4th column using.  I think that awk is the best tool for this ( let me know if I am wrong). I tried this   awk -F, '{print $4}' myFile.csv    but it fails.  I think because the 3rd column is multiline one.  How can I use awk or any other unix command to extract the 4th column.  I am looking for an efficient solution since my real file is big (> 2GB) Does anyone know if there are any video formats (besides the HUGE uncompressed avis) that you can render in that maintain the alpha channel? (i.e. for after FX etc.)   I used to use quicktime, but that's no longer an option.  I know you can render in png. or other image formats, but video is significantly smaller, and I often work on machines with less space &amp; resources. How to read one filesystem from a whole disk image file? I ran these commands:  VBoxManage clonehd d6b9f0a5-98df-48ca-83c8-91a0809ec349 --format RAW Debian.raw sudo dd if=~/.VirtualBox/HardDisks/Debian.raw of=/dev/sda5   When I try to mount the partition, I get this complaint:  EXT4-fs (sda5): VFS: Can't find ext4 filesystem   Now I know that the VM had an ext4 partition. What did I do wrong? I would like to show that the function $\frac{1}{x}$ is not uniformly continuous on $(0,1)$ using two approaches.   First Approach:   We have the fact that if a function $f$ is uniformly continuous on an open interval $(a,b)$, then the function $f$ is bounded on $(a,b)$. By using its contrapositive, since $\frac{1}{x}$ is not bounded on $(0,1)$, it is not uniformly continuous.  Second Approach:  Proof by definition. Note that the definition of non-uniform continuity is:  There exists an $\epsilon_0&gt;0$ such that for all $\delta&gt;0$, there exists $x,y \in (0,1)$ such that $|x-y|&lt;\delta$ but $|\frac{1}{x} - \frac{1}{y}| \geq \epsilon_0$.  Assume that $\delta &lt; 1$. Let $x = y + \frac{\delta}{2} \in (0,1), y &lt; \frac{\delta}{2} \in (0,1), \epsilon_0 = 1$. Then we have   $$|\frac{1}{x} - \frac{1}{y}| = |\frac{1}{y + \frac{\delta}{2}} - \frac{1}{y}| = \frac{\frac{\delta}{2}}{|y(y + \frac{\delta}{2})|} &gt; \frac{\frac{\delta}{2}}{(\frac{\delta}{2})(\delta)} = \frac{1}{\delta} &gt; 1 = \epsilon_0 $$  If $\delta \geq 1$, then let $\delta^{\prime} = \frac{1}{\delta}$ so that $\delta^{\prime} \leq 1$. The rest proceeds the same as above.   Question: Are my two approaches correct? Parsing XML, JSON, and newer data file formats in UNIX using command line utilities The Unix environment has some excellent tools for parsing text in various forms. However, of late, the data is not in the traditional (historical) formats (CSV, TSV, record-based or some other delimiter-based) it used to be before. Data these days is exchanged in structured formats like XML/JSON.  I know there are some good tools like sed, awk and Perl which can chew down nearly any form of data out there. However, to work with this sort of structured data, often one has to write a complete program, and, given the little time available to extract information, one has to sit down and figure out the whole logic of what one wants to query and put it down programmatically. Sometimes this is not OK – basically because the information extracted from those files acts as inputs for further work; also because of the time it takes to search for the appropriate solution and code it up. A command line tool is needed with sufficient switches to find, query and dump data.  I'm looking for tools that take a XML/JSON or other forms of structured data and dump it into other formats like csv, etc., so that from there one could use other commands to get any information out of it.  Are there any command line utilities you know of which do this kind of a job? Are there already awk/Perl scripts available to this? Proper way to exit iPhone application? I am programming an iPhone app, and I need to force it to exit due to certain user actions.  After cleaning up memory the app allocated, what's the appropriate method to call to terminate the application? Can non-magical persons see the Hogwarts Express during its journey to and from Hogwarts? Construct ideals in $\mathbb Z[x]$ with a given least number of generators Where does the "apply bonuses and penalties in the most beneficial order" rule come from, if it exists? I have seen quoted several places on the internet a rule that one can apply bonuses and penalties in the most beneficial order.  An example I come across frequently (as a druid) is the combination of Natural Bond and . Natural Bond increases your effective druid level for determining the stats of animal companions but cannot increase it beyond your character level. Choosing an alternative animal companion lowers your effective druid level for determining the same stats. The "most beneficial order" rule is used to justify applying the level penalty before the natural bond bonus in order to get around the character level cap on natural bond.  Does this rule actually exist? If so, where does this rule originate? I would like to be able to cite a reliable source for my GM. How come Dropbox gets an icon in Finder sidebar? How come Dropbox gets a non-generic icon in Finder's sidebar, when other directories like Google Drive and Sites (native in OS X before Lion) all have the same generic one?    How can I customise the icons used by the folders in the sidebar? OS X used to show individual icons of all folders there — not any longer. $$\lim_{n\to \infty}\frac1{2n}\log\left({2n \choose n}\right)$$  Now, $\log(n!) = \Theta (n\log(n))$ so I think we could write,   $$\lim_{n\to\infty}\frac{1}{2n}\left(\log\left(2n!\right) - \log\left(n!^2\right)\right) = \frac{1}{2n}\left(\log\left(2n!\right) - 2\log\left(n!\right)\right) $$  $$\lim_{n\to\infty}\frac{1}{2n}\left(2n\log\left(2n\right) - 2n\log\left(n\right)\right) $$  $$\log\left(2n\right) - \log\left(n\right) = \log(2)$$  Is this legitimate? I feel this might be wrong since, the $\Theta$ notation conceals a constant factor. How can I send email attachment without using an additional library in Perl? I have noticed after deleting an original page in WordPress with lets say a permalink of your_domain.com/contact/ and then trying to recreate the same page with the same name/slug, my WP is generating a "-2" at the end of the link, like: your_domain.com/contact-2/.  I don't understand why, since the original page was deleted. Why is WordPress treating new pages as if the original still exists? How to I clean WP caches, if such a thing even exists?Thank you ahead of time for clearing this up for me. Why is the installer not showing any partitions? I'm having a problem installing Ubuntu, and Kali as well. I downloaded the iso from the official site &amp; tried installing using USB. I also tried desktop installation, but the problem is same.  It shows a single drive i.e. my total Hard Disk and if I select it, it asks me to create a new partition &amp; shows total space as FREE.  It's with all Ubuntu I downloaded, 11.10 Server, 12.10 and 13.04. I also tried to install BackTrack's new version Kali Linux but again I got the same problem.  I hope I meet thier system requirements. Here's my system details for your ease:   OS: Windows 7 Ultimate Processor: Intel P4 2.80 GHz RAM: 3GB Hard Disk: 320GB No of Local Drives: 4 (1 Primary, 3 Logical) Free Space: 195GB (about) Motherboard: G31 Cache: 1MB Help me, please. I am having a problem with Windows 7. When I boot up, the CPU jumps to 100% execution for about 10-15 minutes. During this time, it is really slow, and if I play any music, the songs play slowly and sound distorted.  I tried to scan my computer with different antivirus programs, I used Spybot, HijackThis, and CCleaner, but I didn’t find anything of note.  I watched the process list in Task Manager and saw that there are two processes that are to blame. There are two copies of svchost.exe, one using ~48% CPU, the second (under the Network Service account) using ~37%. For the first 15 minutes, the CPU runs at about 70-80%, then eventually drops to 30-40%.  I don’t know what to do. I could not find a way to stop the services, and if I try to kill them, sometimes the system crashes. Footnote citations in biblatex ignore spacing before the citation command; how can I have the same behavior for all footnotes in a document?  Here's a MWE demonstrating the issue:  \documentclass{article} \usepackage[style=verbose-trad2]{biblatex} \addbibresource{biblatex-examples.bib} \begin{document} Spacing is fine before citations     \autocite{kant:kpv}  but not before footnotes    \footnote{A footnote \autocite{kant:ku}}. \end{document} How to burn a Windows .iso to a USB device? I want to burn a Windows ISO to a USB device in Ubuntu. How do I do this?   I know how to burn a Ubuntu ISO into a USB device, but with a Windows ISO it's not the same. Why does the definition of limits of a function have strict inequality? Definition (As written in Michael Spivak's Calculus)     The function $f$ approaches a limit $l$ near $a$ means: for every $\epsilon &gt;0$ there is some $\delta &gt; 0$ such that, for all $x$, if $0&lt;|x-a|&lt;\delta$, then $|f(x)-l|&lt;\epsilon$.   my question is: why can't it be: $$0&lt;|x-a|\leq \delta,|f(x)-l|\leq \epsilon$$ After looking at limits of functions for a long time just to grasp it's meaning and using the definition quite a lot solving homework I realized I keep writing the same inequality without really understanding why.  The only explanation given in Spivak's book for this part of the definition goes over it without explaining the inequality. I tried looking for an explanation myself but wasn't really able to find anything wrong with it. Is it also possible to write the definition like that or is there a problem with that?   (first non-homework related question :p) Let $P(X)$ denote the power set of $X$ (the set of all subsets of $X$) with a partial order given by inclusion.  If $F: P(X) \to  P(X)$ is monotone (order preserving), then $F$ has a fixed point.  How are we going to prove that without using the term (complete lattice)?! What measures can/should I take to make sure that security around my SSH server is absolutely impermeable?  This will be community wiki from the start, so lets see what people do to secure their servers.