Posts

Massive bug in DataRow in .NET Framework

Image
If the actual value of the timestamp column is 7080, notice how the datarow value gets flipped the other way when it is read into a DataSet! Wow! Massive bug in the .NET Framework.

How do I create access control rules from code for an azure cloud service?

Nobody had a solution, so I did it myself: http://stackoverflow.com/questions/40727003/how-do-i-create-access-control-rules-from-code-for-an-azure-cloud-service

How to reinstall all nuget packages if there are issues after moving folders

Update-Package –reinstall Querying the table storage by a timstamp column filter: Timestamp ge datetime'2008-07-10T00:00:00Z' - The month and the date have to contain two digits.

Migrating to Azure redis cache?

They are deprecating the inrole cache starting 2.9 SDK. It was trouble migrating it. I recommend you first install the session state provider for the redis cache and then use the strong named redis dll which comes with it for all other assemblies. If you first install the regular dll via nuget and then install the session state provider, it gets messed up.

Binary Search Algorithm in C# (min, max, middle position)

class BinarySearch     {         public static int Find(List<int> list, int searched)         {             // First sort input             BucketSort.Execute(list, ShellSort.Execute);             // Find min position             int min = 0 ;             // Find max position             int max = list.Count - 1 ;             int loops = 0;             do             {                 // Find middle position                 int middle = (min + max) / 2 ;                 if ( searched < list[middle] )       ...

Shell Sort Algorithm in C# (Insertion with middle position split)

class ShellSort     {         public static List<int> Execute(List<int> list)         {             // Start position is at the middle of the list.             var position = list.Count / 2 ;             // Iterate as long as we don't reach the "bottom"             while ( position > 0 )             {                 // Go through the entire list                 for (int i=0;i<list.Count;i++)                 {                     // Get current index                     var index = i;                 ...

Insertion Sort Algorithm in C# (Simple)

class InsertionSort     {         public static List<int> Execute(List<int> list)         {             // Iterate through entire list starting from 1             for (int i=1 ;i<list.Count;i++)             {                 var index = i ;                 // Get current item from list.                 var current = list[i] ;                 // While previous is greater than current                 while ( index > 0 && list[index - 1] > current )                 {                     // Swap        ...