NavMenu

Friday, September 10, 2010

Windows Live Writer & Code Snippet Plug-In

After writing such a long article (in my past post), I realized that I needed a better way to post, format, and show my code snippets.  I’ve decided on Windows Live Writer as my blogging tool and WLW Code Snippet plug-in for displaying my code.

WLW Code Snippet plug-in:  You can get the plug-in at Leo Vildosola's Blog or at CodePlex

kick it on DotNetKicks.com

Shout it

Thursday, September 9, 2010

PASSING PARAMETERS BY VALUE & BY REFERENCE

I misunderstood passing a reference type to a method by reference and wrote it as ref param.  I found this error in understanding when I asked a question about memory footprint of a reference type variable.  The forum folks pointed out that I did not need to pass my object via ref and gave me some great links to help me wrap my brain around my misunderstanding.

I spent time researching and then testing code to make sure I got it.  But what I realized after reading the articles referenced at the end of this article, although each is well-written, they were not targeted to the beginner.  So this blog post takes a crack at explaining this concept in more basic, beginner terms.

kick it on DotNetKicks.com

Shout it

Saturday, September 4, 2010

Sudoku Solver Progress Update

Today I finally completed the SolverEngine for handling Easy to Medium level boards.  It solves each within 54 msecs.  Of course that execution time could be improved, but I'm not concerned about that right now.

kick it on DotNetKicks.com

Shout it

Working With ArrayList: What is the best Iterator choice?

When you first look at which statement to use to iterate through an ArrayList collection, the foreach statement stands out.  It's syntax is concise and readable as well as no extra lines of code are needed to extract the element you want to work with.  But...[pause for effect]...if the collection is changed (e.g. adding, modifying, or deleting elements and even copying to it), you'll get a runtime error that the "Collection was modified."

kick it on DotNetKicks.com

Shout it

Monday, August 30, 2010

Working with Arrays: Array.IndexOf

In my Sudoku project, I'm working a lot with arrays and ArrayLists.  Searching an array for things like a value (e.g. a matching digit of 1-9) or an open spot (e.g. open tile in column) can be cumbersome.  At first I was for statements often.

But then I discovered Array.IndexOf.  The syntax is straightforward Array.IndexOf(arrayName, objectValueToSearchFor). It searches one-dimensional array, starting with the first element (i.e. 0, remember arrays are zero-based) and ending with the last element..  Each element is compared to the specified objectValueToSearchFor. If it finds it, it returns the first element location. 

kick it on DotNetKicks.com

Shout it

Saturday, August 28, 2010

First C# Project - Sudoku

I finished studying the C# basics up to Collections and thought it was time to test what I've learned so far.  What better way to test myself than to build a project from scratch.  I love playing Sudoku and have an assortment of the magazine books.  I chose to build a project that did the following:

  1. User loads in a beginning board (just like the game books), as a starting point.
  2. Then the SolverEngine runs through a series algorithms to solve each row, column, quad, and then finally the entire board.

kick it on DotNetKicks.com

Shout it

Starting my blog

This is my first blog post...ever.  Hum, where to start?  Let's start with what the blog is about.

kick it on DotNetKicks.com

Shout it

About

My photo
Welcome to my blog! This blog is about my journey to become a Master .NET coder and teacher.

Followers