Sunday, November 9, 2008

Course next week

Next week I'll be taking part 2 of my classical course as a preparation for my MCTS: Core Data Acces with Microsoft Visual Studio 2005.

I'll be going back to InfoSupport for 3 days.

Can't wait for the traffic jams ;-)

Cheers

Chapter 4, Lesson 4

Hi there

Being in the middle of moving into my appartement notwithstanding, I found some time to continue with the course.

Today I completed lesson 4 of chapter 4, which was all about Specialized Collections.
BitArray and BitVector32 are very usefull for working with Booleans and manipulating bits.I was not aware of the existance of BitVector32, which is in fact a structure rather then a class, and although I find the syntax of it to be a bit sloppy, I convinced of the usefullness of it.

Bit Packing seems a smart way to reduce storage space in memory. BitVector32 allows you to use this technique of storing several smaller numbers into one large number in real life.

StringCollection and StringDictionary class are simply strong-typed equivalents of ArrayList and HashTable. When you work with strings, and only with strings, usethese ones to rid yourself of the overhead of casting objects to strings.

CollectionUtils is your basic shortcut to a series of helper tools that allow you to quickly create Case-insensitive Hashtables and SortedLists.

Next lesson will be all about Generic Collections.

Be seeing ya.

Chapter 4, Lesson 2 and 3

I'm grouping together some of the lessons here as they all shared the same subject: Collections, lists and dictionaries.

Lesson 2 covered the sequantial lists: Stack and Queue. Very easy, very simple.

A Queue is a FIFO type of collection where items get put into the queue and pulled out again.A Stack is LIFO type of collectioins where items get pushed onto the stack and popping them of again.

A memory tip: Queue is a line at a bank while Stack is a Stack of cards.

Lesson 3 was a bit more complicated as it covered Dictionaries. The Hashtable is the most important dictionary.

Really interessting was the part where they explained how equality and default ordering is implemented by the Hashtable.

What I remember from it was that Hashtable doesn't allow duplicate keys in the collection, but these keys are in fact the hashes (GetHashValue method) of those items.Take control over equality by implementing a IEqualityComparer interface.

See you soon.

Chapter 4, Lesson 1

Today I started the chapter on Collections and Generics, which is bound to be a very interresting chapter for these are the things a developer comes into contact every day.

The first lesson covered the basics about collections. Adding and Removing items was a breeze, not much new there.

I learned that there are 3 different ways to iterate through a collection:
- using the numeric indexer: coll(1)
- using the foreach statement: foreach item as string in coll
- using the GetNumerator method

This last one was new to me. I never used this before. This method returns a IEnumerator object that allowed you to move through the items of the collection, forward only, using the MoveNext and Current methods. Very cool, but redundant because the foreach language construct does exactly the same, and is much easier to implement.

Sorting items of a collection is both very easy and exiting. The default implementation of Sort uses a Comparer class, but an overloaded construct of Sort also allows you to specify another comparer class, even your own custom class, as long as it implement the IComparer interface.
Cool stuff.... ;-)

The lab was easy and I got all the review questions right. :D

Next lesson I'll be working with Sequential Lists. Can't wait ;-)

Cheers

Chapter 3, Lesson 2

Quite the breather after the Regular Expression this lesson was, Encoding and DEcoding text.
Although the Framework does this for you, so in practice you'll rarely come in contact with this, it's good to knowthe basics about encoding standards.

In .NET, the default enconding type is UTF-16, but you can force your apps to read/write in other types like UTF7, UTF8, UTF32,even old ASCII or ANSI/ISO types.

According to the book, notepad is not able to read UTF-7 or UTF-32 encoded file, but my Vista machine had no problemreading UTF-7 encoded files. Upgrade since XP maybe ?

Anyway, this was an easy, but very interresting lesson. On a more personal note, I tackled this lesson while travellingfrom Diest to Aalst (where my girlfriend lives) ;-)
See ya