how to sort strings with C# I have a class like   public class KeyNamePair {  public string Key {get;set;}   public string Name{get;set;} }   My code  List&lt;KeyNamePair&gt; list =new List&lt;KeyNamePair&gt;();      list.Add("1", "Day 1");     list.Add("2", "Day 11");     list.Add("4", "Day 5");     list.Add("6", "Day 13");   How can i sort the list to display  &gt;  "Day1", "Day5", "Day 11", "Day 13"   in order?  i tried   var SortedList = source.OrderBy(x =&gt; x.Name).ToList();             return SortedList;   this does not do any sort
Natural Sort Order in C# Anyone have a good resource or provide a sample of a natural order sort in C# for an FileInfo array?  I am implementing the IComparer interface in my sorts.
I have a series of ranges with start dates and end dates. I want to check to see if a date is within that range.  Date.before() and Date.after() seem to be a little awkward to use. What I really need is something like this pseudocode:  boolean isWithinRange(Date testDate) {     return testDate &gt;= startDate &amp;&amp; testDate &lt;= endDate; }   Not sure if it's relevant, but the dates I'm pulling from the database have timestamps. Is it possible to search every field of every table for a particular value in Oracle?  There are hundreds of tables with thousands of rows in some tables so I know this could take a very long time to query. But the only thing I know is that a value for the field I would like to query against is 1/22/2008P09RR8. &lt;  I've tried using this statement below to find an appropriate column based on what I think it should be named but it returned no results.  SELECT * from dba_objects  WHERE object_name like '%DTN%'   There is absolutely no documentation on this database and I have no idea where this field is being pulled from.  Any thoughts? How to use EntityFieldQuery with dates? I need to select entities with specific dates.   How should the following be formatted. Do I need to parse 15-May-2010  Also how I get the error page.   function events2() {  $query = new EntityFieldQuery(); $query   -&gt;entityCondition('entity_type', 'node', '=')   -&gt;propertyCondition('status', 1, '=')   -&gt;propertyCondition('type', 'event')     -&gt;propertyCondition('field_event_date', '15-May-2010', '=');  $result = $query-&gt;execute();   return $result;  } I have already seen a proof of this statement here on stackexchange but I would like someone to verify whether "my proof" is correct and also if you could point out issues with the writing style. thanks in advance!  Statement. $\mathbb{Z}_{p}$ is an integral domain $\Leftrightarrow$ $p$ is prime.  Proof.$(\Rightarrow)$ Suppose $\mathbb{Z}_{p}$ is an integral domain. Assume (by way of contradiction) that $n$ is not prime. Then $n=ab$ for some $a,b\in \mathbb{Z}$ where $1&lt;a$ and $b&lt;n$, meaning $ab\equiv 0\pmod n$. This is a contradiction since $\mathbb{Z}_{p}$ is assumed to be an integral domain and therefore does not contain any zero divisors. Therefore $p$ must be prime.  $(\Leftarrow)$ Assume $p$ is prime. Then $a$ does not divide $n$ for any $1&lt;a&lt;n$ where $a\in \mathbb{Z}_{p}$. Thus $\mathbb{Z}_{p}$ does not contain any zero divisors and is therefore an integral domain. better Curve/Text to Mesh generation? The triangulation process of Text to Mesh or Curve to Mesh generates some nasty topology.   I get why, but maybe it could be done a bit nicer? Since text is flat, have ngons instead of hundreds of triangles you'll need to modify anyway?  Another issue is when you then want to use the text as a Volume for particles, which for some reason behave weird when you have unusual topology even though they should be using the volume, not vertex or face positions. Does there exist a laser that is tunable over the whole visible spectrum? Does there exist a laser that is tunable over the whole visible spectrum? If so does there exist one that is solid state? This is to settle a score with my dumb workmates. Should I always use the perfect present, when the sentence uses "never"? In my English classes, I was taught that never should not be used with past forms, only with present perfect forms; this is also what I read in a grammar book I bought some years ago. (I bought the book in the USA; I guess the book is about American English grammar, but I don't have any reason to believe there is any difference between American, and British English in this case.)  Is it correct to use never with the past tense?     I never said that.        I have never said that. Does Find My Mac work if the disk gets erased? How to make text aligned left/center/right in the same line? Wrong Java resource bundle loaded Windows 10 non-persistent installation (live ISO) We've got a Windows 10 installation running in an environment where it can occasionally lose power and restart. However, this sometimes leads to corruption of files.  I've had a look at Windows "To-Go" but this seems to be persistent. And I've also checked out virtualisation, but that would require us to run a non-persistent Windows 10, in another Windows 10 environment.  Is it possible to install Windows 10 as a "non-persistent live CD"? So that a user will have a seemingly fresh Windows 10, but doesn't require to re-install it at each startup? How do I know what symbols/characters are available in a font package? I usually use xelatex, but I'm exploring pdflatex now. When loading specific fonts in xelatex, I can always know what characters the font has available, since I can inspect the font file in any font viewing program, or I can find out the hard way by just entering the unicode and see if the character is displayed in the output. But how does this work with a font package?  Say, for instance, that I would like to use phonetic symbols in the  font. How do I know whether the font has phonetic symbols (I assume it does), and how do I know what command I need to type in order to make them appear? My only resource is , but this only tells me what characters/commands there are available in LaTeX2e by default (depending on the font encoding), and what symbols I can find in specific packages. Phonetic symbols, for instance, are said to be in the tipa package. Does that mean I am locked to tipa if I want to use phonetic symbols with pdflatex?  Here's a pointless MWE:  \documentclass{article} \usepackage{gentium} \begin{document} Please give me some phonetic symbols here? \end{document} Why won't this command work? /summon Villager ~ ~2 ~ {Offers:{Recipes:[{buy:{id:371,Count:15},sell:{id:264,Count:4}}   I'm using this as a recycler villager, and I can't get the first trade to work. What's going on? How can I see flags I cast from all sites? This morning I flagged something on one of the sites where I have fairly low rep. Now I can't remember which site it was. I've checked my flag history on about half of them, even editing the URL for the site where I have no helpful flags, and I can't find this flag. I've been to my network profile and looked at the Activity tab, but it only shows public things like asking, answering, commenting, editing, and reviewing.  Is there a way to see my flagging history across sites? Can we have such a feature, if it's not possible? Implement MicroController Power Switch and re-use the button for other features This is similar to other questions, but I feel it is different because of the reuse of the "power" button.   I want a "latching" Momentary Power button.  Behavior:   User Pushes momentary button, holds down as long as necessary and the device powers up. Between Power On and Off the same button will be re-used for other functions  When it is held down for 5 +/- seconds the MicroController will turn itself off.    Design Constraints:   Battery provides between 3.7V to 2.9V during it's usable life The Voltage regulator requires Vin +/- 0.3V on the Enable Pin, 3.1V output. MicroController operates at 3.1V MicroController Output Pin High state is 2.7V Max   Debouncing: In this case I'm not concerned about debouncing the switch, if the user doesn't hold it down long enough for the MicroController to set it's Digital Output pin  High the device doesn't power on.  I've worked up the following schematic, which kind of works.    It assumes 3.7V from the battery. Uses an Analog Input for the Power button, which then uses the variation in voltage to determine if the button has been pressed. In the current design the difference is 0.12 V (from 3.4 to 3.52), but the MicroController has a 12 bit ADC so that shouldn't be a problem, in addition I can adjust the sensitivity range of the ADC.   Questions:  What is the difference between reality and the simulator?  Is there a better way?  How can I get a greater voltage difference on the button input? I've tried many different combinations but they increase the voltage range above the 3.6V Input High Maximum specified in the datasheet.  I'm not excited about the "Leakage current" when the uC Controlled Power Pin is Low, any suggestions?   Thank you for any ideas/suggestions/answers. is there any diffrence to use nonlinear or liner activation function in single hidden layer network Is it "I" or "me" in "Keep Tom and I/me updated"? In this case what is correct?        Keep Tom and I updated.      or         Keep Tom and me updated.      I understand that me is an object pronoun. And therefore I feel the second option is correct.  Especially, because I would say "Keep him updated" and also "Keep me updated". Instead of "Keep he updated" or "Keep I updated". But something about saying "Keep him and me updated" feels wrong.  However I am not sure, because several people have told me that in this case I is the correct option because it is being used in conjunction with a name (Tom) and not a pronoun. Is that correct? Shell script zips a folder, but exclude parameters not working IF its run from cron.daily Scoping in assigning a derivative Is it possible to accept the alternative hypothesis? I'm aware of several related questions here (e.g., , ) but I don't know the definitive answer for my question below.  Suppose a hypothesis test where we want to test whether a coin is fair or not. We have two hypotheses:  $H_0: p(head)=0.5$  $H_1: p(head)\neq0.5$  Suppose we use 5% significance level, there are two possible cases:   When we obtain the data and find that the p-value is less than 0.05, we say "With significance level 5%, we reject $H_0$."  p-value is greater than 0.05, then we say "With 5% significance level, we cannot reject $H_0$."   My question is:      In case 1, is it correct to say "we accept $H_1$"?   Intuitively, and from what I have learned in the past, I feel that "accepting" anything as a result of hypothesis testing is always incorrect. On the other hand, in this case, since the union on $H_0$ of $H_1$ covers the whole "space", "reject $H_0$" and "accepting $H_1$" look exactly the same to me. On another thought, I can also think of the following idea, which says it is incorrect to say "we accept $H_1$":     We have an evidence strong enough to believe that $H_0$ is not true, but we may not have an evidence strong enough to believe that $H_1$ is true. Therefore, "rejecting $H_0$" does not automatically imply "accepting $H_1$"   So, what is the right answer?