Take a look at this.
http://blogs.msdn.com/b/peterlau/archive/2012/04/25/top-7-concerns-of-migrating-an-asp-net-application-to-windows-azure.aspx
Friday, June 29, 2012
Windows Azure + Knockout.js + SignalR
Learn about Windows Azure + Knockout.js + SignalR
Enjoy!
http://developusing.net/2012/06/08/DevelopingSinglePageRealTimeWebsitesOnWindowsAzure.aspx
Enjoy!
http://developusing.net/2012/06/08/DevelopingSinglePageRealTimeWebsitesOnWindowsAzure.aspx
Microsoft Surface Keynote
Microsoft Surface Keynote.
I wish I had screen as big as the one used on this keynote!
I wish I had screen as big as the one used on this keynote!
Thursday, June 28, 2012
C# 16 - Insertion Sort
Implementing a sort using insertion sort algorithm.
1. Create a new console project.
2. Edit the Program.cs inside static void Main(string[] args) file as shown below.
static void Main(string[] args)
{
int[] array = { 2, 3, 1, 9, 4, 7 };
Console.Write("Before sort: ");
PrintArray(array);
Console.WriteLine();
InsertionSort(array);
Console.Write("After sort: ");
PrintArray(array);
Console.ReadLine();
}
private static void InsertionSort(int[] array)
{
/*
for i = 2:n,
for (k = i; k > 1 and a[k] < a[k-1]; k--)
swap a[k,k-1]
→ invariant: a[1..i] is sorted
end
*/
for (int i = 0; i < array.Length; i++)
{
for (int x = i; x < 0; x--)
{
if (array[x] < array[x - 1])
{
int temp = array[x - 1];
array[x - 1] = array[x];
array[x] = temp;
}
}
}
}
private static void PrintArray(int[] array)
{
for (int i = 0; i < array.Length; i++)
{
Console.Write(array[i] + " ");
}
}
3. Press F5 to run and see the results.
4. Thank you.
References:
http://en.wikipedia.org/wiki/Insertion_sort
http://www.sorting-algorithms.com/insertion-sort
1. Create a new console project.
2. Edit the Program.cs inside static void Main(string[] args) file as shown below.
static void Main(string[] args)
{
int[] array = { 2, 3, 1, 9, 4, 7 };
Console.Write("Before sort: ");
PrintArray(array);
Console.WriteLine();
InsertionSort(array);
Console.Write("After sort: ");
PrintArray(array);
Console.ReadLine();
}
private static void InsertionSort(int[] array)
{
/*
for i = 2:n,
for (k = i; k > 1 and a[k] < a[k-1]; k--)
swap a[k,k-1]
→ invariant: a[1..i] is sorted
end
*/
for (int i = 0; i < array.Length; i++)
{
for (int x = i; x < 0; x--)
{
if (array[x] < array[x - 1])
{
int temp = array[x - 1];
array[x - 1] = array[x];
array[x] = temp;
}
}
}
}
private static void PrintArray(int[] array)
{
for (int i = 0; i < array.Length; i++)
{
Console.Write(array[i] + " ");
}
}
3. Press F5 to run and see the results.
4. Thank you.
References:
http://en.wikipedia.org/wiki/Insertion_sort
http://www.sorting-algorithms.com/insertion-sort
C# 15 - Selection sort
Implementing a sort using selection sort algorithm.
1. Create a new console project.
2. Edit the Program.cs inside static void Main(string[] args) file as shown below.
3. Press F5 to run and see the results.
4. Thank you.
Reference(s):
http://en.wikipedia.org/wiki/Selection_sort
http://www.sorting-algorithms.com/selection-sort
1. Create a new console project.
2. Edit the Program.cs inside static void Main(string[] args) file as shown below.
static void Main(string[] args)
{
int[] array = { 3, 2, 1, 4, 8 };
Console.Write("Before sort: ");
PrintArray(array);
Console.WriteLine();
SelectionSort(array);
Console.Write("After sort : ");
PrintArray(array);
Console.WriteLine();
Console.ReadLine();
}
private static void SelectionSort(int[] sortArray)
{
int smallest = 0;
int smallestIndex = 0;
/* advance the position through the entire array */
/* (could do i < n-1 because single element is also min element) */
for (int i = 0; i < sortArray.Length; i++)
{
smallest = sortArray[i];//the smallest value is at index 0
smallestIndex = i;//store the index of the smallest value
//find the index of the smallest value
for (int x = i + 1; x < sortArray.Length; x++)
{
if (sortArray[x] < sortArray[i])
smallestIndex = x;
}
//swap/exchange the smallest value found with last index
sortArray[i] = sortArray[smallestIndex];
sortArray[smallestIndex] = smallest;
}
}
private static void PrintArray(int[] array)
{
for (int i = 0; i < array.Length; i++)
{
Console.Write(array[i] + " ");
}
}
3. Press F5 to run and see the results.
4. Thank you.
Reference(s):
http://en.wikipedia.org/wiki/Selection_sort
http://www.sorting-algorithms.com/selection-sort
C# 14 - Find the largest value in an array
1. Create a new console project.
2. Edit the Program.cs inside static void Main(string[] args) file as shown below.
static void Main(string[] args)
{
int[] array = { 3, 2, 1, 4, 8 };
PrintArray(array);
Console.WriteLine("Largest Value: " + GetLargestValue(array));
Console.ReadLine();
}
private static int GetLargestValue(int[] array)
{
int largest = array[0];
for (int i = 0; i < array.Length; i++)
{
if (array[i] > largest)
largest = array[i];
}
return largest;
}
private static void PrintArray(int[] array)
{
for (int i = 0; i < array.Length; i++)
{
Console.Write(array[i] + " ");
}
Console.WriteLine();
}
3. Press F5 to run and see the results.
4. Thank you.
Using jQuery UI Autocomplete With ASP.NET Web API | TechBrij
Another way to implement autocomplete using jQuery and ASP.NET Web API
Using jQuery UI Autocomplete With ASP.NET Web API | TechBrij
Using jQuery UI Autocomplete With ASP.NET Web API | TechBrij
Wednesday, June 27, 2012
C# 13 - Find the smallest value in an array
1. Create a new console project.
2. Edit the Program.cs inside static void Main(string[] args) file as shown below.
static void Main(string[] args)
{
int[] array = { 3, 2, 1, 4, 8 };
PrintArray(array);
Console.WriteLine("Smallest Value: " + GetSmallestValue(array));
Console.ReadLine();
}
private static int GetSmallestValue(int[] array)
{
int smallest = array[0];
for (int i = 0; i < array.Length; i++)
{
if (array[i] < smallest)
smallest = array[i];
}
return smallest;
}
private static void PrintArray(int[] array)
{
for (int i = 0; i < array.Length; i++)
{
Console.Write(array[i] + " ");
}
Console.WriteLine();
}
3. Press F5 to run and see the results.
4. Thank you.
Labels:
.Net,
Arrays,
C#,
C# statements,
C# Tutorial,
Console,
Free Tutorials,
Tutorial
Apr 20, 2012 LIDNUG Patrick Dussud Q&A
Get down and deep into the .Net CLR and get to know the Father of CLR Patrick Dussud.
Enjoy!
Enjoy!
Wednesday, June 20, 2012
Thursday, June 14, 2012
LIDNUG The Art of Debugging
Debug your apps like a boss!
Another awesome session with LIDNUG. Enjoy!
Another awesome session with LIDNUG. Enjoy!
Subscribe to:
Posts (Atom)