Tuesday, March 31, 2009

Computer Viruses and Malware

http://news.cnet.com/8301-1009_3-10207375-83.html?tag=mncol;posts

A quick way to tell if your computer is infected is to try to access the Web site of a major antivirus vendor, which the worm blocks.

Saturday, March 28, 2009

Comcast McAfee

comcast
srs32--@comcast.net, m---cc--

mcafee/comcast
srs32--@comcats.net 998d6As8
Serial Number: 7466381748335924001378100

Wednesday, March 4, 2009

Sunday, March 1, 2009

Interfaces for Collections

http://www.centrifugalbumblepuppy.com/posts/asp-net-collections-interfaces.aspx

For all public properties and method parameters, accept the least restrictive interface.

For all custom collections, implement the most restrictive interface possible.

This means that if a custom collection is in the slightest bit list-like, it should implement IList whenever possible. Conversely, all your methods should accept ICollections, even if this means re-implementing some functionality through static extension classes or decorators.

Interesting Collections

[SerializableAttribute]
[ComVisibleAttribute(false)]
public abstract class KeyedCollection<TKey, TItem> : Collection<TItem>
Use this collection class (since being a generic abstract class, your collection class is actually a concrete class derived from the constructed version of the generic type) if each collection item also contains the key.

Basically, the motivation to create and use your derived class comes from the fact that it will be making good use of inherited OOB functionality from base for free and also that you can add custom behaviors by overriding some protected members of base.

Sort of a hybrid between IList<T> and IDictionary<TKey,TValue>.

To use this collection class,
(a) First, create a constructed KeyedCollection (for example, KeyedCollection<int,OrderItem> where OrderItem class has a unique field called OrderNumber)
(b) Derive a collection class from the constructed type (for example, SimpleOrder : KeyedCollection<int,OrderItem>)
(c) Override the protected member GetKeyForItem.