I want to sort the collection before processing. I used to use this method:  foreach (var item in Items.OrderBy(i =&gt; i.property1)) {  ... }   Now i need to sort it by property2, if property values is equals between two items. Is there any method to do that logic via LINQ expression?
I have two tables, movies and categories, and I get an ordered list by categoryID first and then by Name.  The movie table has three columns ID, Name and CategoryID. The category table has two columns ID and Name.  I tried something like the following, but it didn't work.  var movies = _db.Movies.OrderBy( m =&gt; { m.CategoryID, m.Name })
How to use inotifywait to watch a directory for creation of files of a specific extension I have seen .      You should consider using inotifywait, as an example:  inotifywait -m /path -e create -e moved_to |     while read path action file; do         echo "The file '$file' appeared in directory '$path' via '$action'"         # do something with the file     done    My question is that, the above script watches a directory for creation of files of any type, but how do I modify the inotifywait command to report only when a file of certain type/extension is created (or moved into the directory) - e.g. it should report when any .xml file is created.  WHAT I TRIED:  I have run the inotifywait --help command, and have read the command line options. It has --exclude &lt;pattern&gt; and --excludei &lt;pattern&gt; commands to EXCLUDE files of certain types (by using regEx), but I need a way to INCLUDE just the files of a certain type/extension. Do adjustable length lightsabers exist in Star Wars universe? I always see blades of lightsabers have more or less the same length (dual blades are double). Why is that?  Can't a longer or shorter length be advantage in some case?    I am NOT expecting infinite length lightsabers (due to energy issues), but have we seen adjustable length blades in the Canon? Using "align" instead of "array" in an array of equations A person has a computer with no HDD but 16GB RAM and USB3 port.  Also has 16GB USB3 pendrive with Ubuntu Live on it, (Non persistent).  The computer is then started with the pendrive using toram.  The pendrive is then removed and reinserted while the O/S is running.  Is the O/S that is running in RAM able to do a "Full" install to the pendrive?  This was asked in:     However for some reason this unique question was marked as "Duplicate". Is there a way to bypass resistance/immunity to fire damage? I want to use fire-based spells for thematic reasons and a lot of things have immunity to it.   Is there a feat or class feature I could use to bypass/reduce those? For example, is there something that ignores fire resistance and reduces fire immunity to just resistance?   I know the easy way around it is just to pick another damage type spell but I really want to roleplay a pyromancer/firebender-type character. #!/bin/bash  SUBJECT="WARNING CPU USAGE HIGH" TO=gmail id MESSAGE=/tmp/messages echo "#######################" &gt; $MESSAGE echo "CPU statistics as follows.." &gt;&gt; $MESSAGE mpstat &gt;&gt; $MESSAGE echo "#######################" &gt;&gt; $MESSAGE CPU_USAGE=$(top -b -n1 | awk '/^Cpu/ {print $2}' | cut -d. -f1) [ $CPU_USAGE -gt 85 ] &amp;&amp; mail -s "$SUBJECT" "$TO" &lt; $MESSAGE`   ./cpu.sh: line 11: [: -gt: unary operator expected What might be the reason What is the difference between a field and a property? In C#, what makes a field different from a property, and when should a field be used instead of a property? Can't get armature to move mesh! When to use reinterpret_cast? I am little confused with the applicability of reinterpret_cast vs static_cast. From what I have read the general rules are to use static cast when the types can be interpreted at compile time hence the word static. This is the cast the C++ compiler uses internally for implicit casts also.  reinterpret_casts are applicable in two scenarios:   convert integer types to pointer types and vice versa  convert one pointer type to another. The general idea I get is this is unportable and should be avoided.     Where I am a little confused is one usage which I need, I am calling C++ from C and the C code needs to hold on to the C++ object so basically it holds a void*. What cast should be used to convert between the void * and the Class type?  I have seen usage of both static_cast and reinterpret_cast? Though from what I have been reading it appears static is better as the cast can happen at compile time? Though it says to use reinterpret_cast to convert from one pointer type to another? Noticed in :         is 320, shown 322. Also locked in 2013.  And then :         has a score of 179, shown 180.  has a score of 123, shown 122.  Neither of these posts got any votes recently. Uniform Circular Motion Why does the object not go inward, into the circle if the acceleration is inward? I think its because the velocity to outward? So they sort of cancel each other out? But if the speed is kept constant and the acceleration is inward, won't the object eventially move inward?   Also, what keeps the direction of acceleration always point inward? $[K(\zeta_n):K]=\phi(n)$? Is it true that $[K(\zeta_n):K]=\phi(n)$ where $\zeta_n$ be primitive root of unity and K be field of char zero?  I think it should be equal to the degree of cyclotomic polynomial which has degree $\phi(n)$.  Can someone please elaborate that what is the procedure for finite fields OSX Server: should I use Open Directory? How to correctly enable Desktop Cube in Unity 3D? Is there a comma needed before quotation? Prove the following $A \setminus (B\setminus C) = (A\setminus B)\cap (A \cup C)$ I want to prove the following so I decide to rewrite the RHS  $$A \setminus (B\setminus C) = (A\setminus B)\cap (A \cup C)$$ $$ A\setminus(B\setminus C) = A\setminus (B \cap C^c) = A\cap (B\cap C^c)^c = A\cap(B^c\cup C) = (A\cap B^c)\cup(A\cap C) $$ there is way that $(A\cap B^c)\cup(A\cap C)\rightarrow (A\setminus B)\cup(A\cap C) = (A\setminus B)\cap (A \cup C)$?  thanks. EDIT  LHS: $$x\in A \vee x\in A\cap C \rightarrow x\in A \wedge x\in C$$ RHS: $$x\in A \wedge x\in A\cup C \rightarrow x\in A \vee x\in C$$  how it can help me? How can I have an SPF record longer than 255 characters? Is there a BNF grammar of the TeX language? I'm looking for a BNF grammar of the TeX language, does it exist?  EDIT  For those of us who are not computer scientists, a BNF grammar is one kind of formal description of a CFG: .  For those who don't know their Chomsky, a CFG is a , which means (very roughly) that substitutions can be made independently of their use context. Best practices for making a WordPress site "movable"? I'm planning to buy a domain and install a WordPress site on it at a web-hosting company.  But first I'll need to iron-out some bugs...  I got a working LAMP-stack at my home-computer, so I'm thinking about first installing my site locally - off the Internet.  I'll be mostly tweaking and making "test-posts" to check that everything works, but I'll probably also make some posts I'd like to keep when I move the site and take it online.  When I'm done chasing bugs; I guess I'll just package the public_html|www directory-tree and upload it to the web-hosting company, and also export the database from my home-computer to the web-hosting.    What I'm wondering if there are some "best practices", some do-s and don't-s, some major pits to take note of?    For example, how can ensure the smooth transition of domain-name in posts and links as such, from localhost to whatever-i-end-up-buying.com (I know from previous attempt of running WordPress at my home computer, that this didn't always work quite well...). How to set the monitor to its native resolution which is not listed in the resolutions list? After installing Ubuntu 10.04 with my Samsung SyncMaster B2030, native resolution (1600X900) is not found in the list of resolutions.