then (1,072)


Paging a collection with LINQ

Paging a collection with LINQ

How do you page through a collection in LINQ given that you have a startIndex and a count ?…


c# - How do you sort a dictionary by value?

I often have to sort a dictionary, consisting of keys & values, by value. For example, I have a hash of words and respective frequencies, that I want to order by frequency. There is a SortedList which…


language agnostic - Should a function have only one return statement?

Are there good reasons why it's a better practice to have only one return statement in a function? Or is it okay to return from a function as soon as it is logically correct to do so, meaning there m…


c# - Checking if a list is empty with LINQ

What's the "best"(taking both speed and readability into account) way to determine if a list is empty? Even if the list is of type IEnumerable<T> and doesn't have a Count property. Right now I'm toss…


ruby - How can I sort by multiple conditions with different orders?

I'd really like to handle this without monkey-patching but I haven't been able to find another option yet. I have an array(in Ruby) that I need to sort by multiple conditions. I know how to use the…


Iterating through all the cells in Excel VBA or VSTO 2005

I need to simply go through all the cells in a Excel Spreadsheet and check the values in the cells. The cells may contain text, numbers or be blank. I am not very familiar/comfortable working with…


xml - How do you switch on a string in XQuery?

I have an external variable coming in as a string and I would like to do a switch/case on it. How do I do that in xquery?…


unit testing - What are some popular naming conventions for Unit Tests?

General Follow the same standards for all tests. Be clear about what each test state is. Be specific about the expected behavior. Examples 1) MethodName_StateUnderTest_ExpectedBehavior Public void S…


How can I do the equivalent of “SHOW TABLES” in T-SQL?

I would like to do a lookup of tables in my SQL Server 2005 Express database based on table name. In MySQL I would use SHOW TABLES LIKE "Datasheet%", but in T-SQL this throws an error(it tries to lo…



Renaming Objects in PowerPoint

Probably a very stupid question but I can't figure how to rename an object in PowerPoint.. For example, all my Graphs are called by default "Graph 1" etc. Could someone help me on that? Thanks!…




not promise value javascript how and multiple example return function