Posts

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        ...

MergeSort Algorithm in C# (middle)

class MergeSort     {         public static List<int> Execute(List<int> list)         {             if ( list.Count <= 1 ) { return list; }             // Find the middle point             int middle = list.Count / 2 ;             var left = new List<int>();             var right = new List<int>();             // Divide the list from the middle             for (int i=0;i<middle;i++)             {                 left.Add(list[i]);             }             for (int i=middle;i<list.Count;i++)             {     ...

QuickSort Algorithm in C# (Pivot)

This is an interesting and relatively easy sort algorithm which is built around the creative use of recursion and a pivot point.     //A kind of exchange sort.     public class QuickSort     {         public static List<int> Execute(List<int> list)         {             // Return if nothing to sort             if ( list.Count <= 1 ) { return list ; }             // Find a random pivot point             var random = new Random();             var pivotIndex = random.Next(list.Count);             // Take out the pivot             var pivot = list[pivotIndex];             list.RemoveAt(pivotIndex);             // Lesser - ...