Thanks to those in the community from whom I’ve learned – level 000

I have to take some time and formally thank those in the .Net community who
have helped me achieve MCSD either by direct learning or by their webcasts,
articles, or blog posts.

  • Noah Coad (MS) – The release manager for VSTS
    Dev & Test tools.  Noah and I went to college together at Texas A&M University and have been good
    friend since.  He has done some amazing stuff in his life with software, and
    I’ve learned a great deal from him.  He is excited about software, and it’s
    contagious.
  • Mike Hnatt – Mike is a good
    friend, and an old professor of mine from Texas A&M.  He makes a living by
    selling custom software to manage fairs and consulting.  He’s an inspiration as
    well.
  • Mark Dunn, Carl Franklin, Rory Blyth (.Net Rocks) – My education
    in .Net really began in January of 2003.  I had poked around with it when it
    first came out, but in January, I really got serious with it.  The trouble came
    when in Feb 2003, I was deployed with my Army Reserve unit to Iraq.  I purchased
    a Dell laptop over there, and I began reading blogs, articles, and anything .Net
    I could get my hands on.  This included .Net Rocks, which debuted while I was
    over there.  I synchronized as much content as possible while connected to the
    Net, and I digested it all offline.  I have learned a ton from .Net Rocks.  I
    even had an opportunity to call in to the show from Kuwait.  Thanks guys.
  • Steve Hickman – Hired me for my first programming job.  I programmed web
    apps for him using IDC/HTX.  This is where it all got started.
  • Scott Mitchell – So many
    articles.  I’ve learned a great deal from them.  I especially enjoyed the series
    on Data
    Structures
    that came out while I was overseas.
  • Scott Bellware (C# MVP) –
    Scott is a part of the local Austin, TX .Net User
    Group
    and is big into TDD.  I’m just getting started in TDD, and he’s been a
    great help here.
  • Rockford Lhotka – Rocky doesn’t
    know me too well, but his articles on SOA and OO are awesome.  He spoke at our
    user group once, and it blew my mind.  If you ever get to hear Rocky speak, take
    advantage of it.  Also, it’s not very often that I run across another developer
    bigger than me (I’m 6’3″, 275lbs) (Rocky is a rock!)
  • Jeffrey
    Richter
    – The first .Net book I ever read was Mr. Richter’s Applied
    Microsoft .Net Framework Programming book.  It was like drinking from a fire
    hose.  I’m better off for it, though.  The detail about garbage collection has
    enabled me to debug memory problems in my code.  I had the pleasure of meeting
    Mr. Richter and the whole Wintellect crew when they came to Austin
    last month.
  • Paul Wilson – Specifically,
    his master pages controls taught me a lot about the ASP.NET control hierarchies
    and the page life cycle.  I dove in and extended his controls and have published
    my own set here.
  • Brad Abrams (MS) – I’m sure we’ve
    all learned from him in some form, but I thoroughly enjoyed his MSDN TV and .Net
    Show appearances.  Brad recently visited our User Group, and I had the opportunity to converse
    with him over BBQ!

Thank you all for sharing your knowledge.

I became an MCSD.Net today! And 70-300 turned out to be not so bad – level 000

I passed 70-300 today.  I had left that test till last because I had gotten the
impression that it was the hardest one.  It turned out not to be.  70-229 (SQL
Server) was the hardest for me.  Indexes, etc!  I’m an MCSD.Net now.  I went the
track of doing MCAD.Net and now MCSD.  I’m excited.  Today I join the 12,829
people world-wide to hold this certification.  I guess now the number is 12,830.

XP SP2 makes it a snap to disable the Shockwave add-in – level 000

If you are like me, you are annoyed when a flash advertisement on a website steals the entire screen and won’t give it back until I click a small “close” button, but I have to make sure my mouse is on the exact right spot or I’ll be forwarded to a site asking me to buy something.


I have found no value in flash as it is currently used on the Net.  I know it can create some great UI stuff, but all it does for me is annoy me.  With SP2 for XP, a button is added in IE to Internet Options called “Manage Add-ins” under the Programs tab.  Here I was able to easily disable the shockwave add-in, and now I can’t be happier.  Those annoying adds don’t show up anymore, and if I need to use a site that depends on Flash, it’s just a few clicks away.  In fact, if a site tries to load Flash while it’s disabled, a quick click in the IE status bar will enable it for me.


 

My newly renovated desk at work – 3 displays – level 000

Honestly, my CRT was starting to give me eye strain.  I’m a hardcore developer, and I decline meetings whenever possible.  I routinely type code at my computer 7-8 hours per day.  I have two LCD monitors now, and my screens are SO much clearer.  No refresh rate, just crystal clear pixels.


Here’s my desk.  I run off of a Lattitude D600 laptop (P-m 1.8/1GB RAM) with Windows Server 2003.  I have VS.Net 2003 and 2005 Beta 1 (they work great together).  And once you can run your app on one screen, debug it on another, and keep NUnit/Outlook on the other, you’ll never go back.  I’m already thinking of how I can work in a 4th display.  For laptops, it’s difficult because you actually need another video adapter.  I ordered the VTBook.


 

Managing work running in the Threadpool – level 350

I recently solved a problem that the community might run into, so I think I’ll share my solution.  I had a process (in my case a Windows service, but this concept applies to Console or WinForms apps as well) that dispatched work to the threadpool.  There are different types of work, and each type should not have to wait for all of another type to finish, so I use the threadpool for concurrent execution (I have to wait for a database, so I actually do see performance gains), but if there is 3 hours worth of type A work to do, type B should not have to wait that 3 hours to begin.  The situation worked fine until I needed to stop my service.  When you stop a process, it stops.  It doesn’t wait for catch and finally blocks to execute, either.  If there was work in progress, that work was left in a corrupted state.  That possibility is not acceptable for a production application.  I need to be able to stop or wait for the work before I allow the service to complete stopping.  My solution was that for each new work item that was started in the threadpool, I added that thread to an ArrayList, and when the work was finished, I removed it.  When I needed to stop, I walked through each thread and called Abort() and Join().  This threw a ThreadAbortException down that thread allowing my normal cleanup code to execute, and Join() waited a specified period of time for that thread to finish and exit, then control returned to the main thread.  After all the threads were finished, I would finish stopping.  In this way, I could maintain control over work being done in the threadpool.


Here is a sample class that dispatches work (it makes the work run in its own AppDomain too).



    public class Controller


    {


        public ArrayList threads = new ArrayList();


 


        public Controller(){


            // Just so we can see the activity.


            Trace.Listeners.Add(new TextWriterTraceListener(Console.Out));


        }


        public void DoWork(){


            try{


                // Three might be running at the same time.


                for(int i = 0; i < 3; i++){


                    ThreadPool.QueueUserWorkItem(new WaitCallback(Execute));


                }


                Thread.Sleep(20000);


                Trace.WriteLine(threads.Count, this.ToString());


            }finally{


                foreach(Thread t in threads){


                    t.Abort();


                    t.Join();


                }


            }


        }


        private void Execute(object state){


            AppDomainSetup setup = null;


            AppDomain domain = null;


 


            try{


                threads.Add(Thread.CurrentThread);


                setup = new AppDomainSetup();


                setup.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory;


 


                domain = AppDomain.CreateDomain(“Processor”, null, setup);


 


                Processor proc = (Processor)domain.CreateInstanceAndUnwrap(Assembly.GetExecutingAssembly().FullName, typeof(Processor).FullName);


                proc.Process();


            }finally{


                threads.Remove(Thread.CurrentThread);


                if(domain != null)


                    AppDomain.Unload(domain);


            }


        }


    }


And here is my sample Processor class:



    [Serializable()]


    public class Processor


    {


        public void Process(){


            try{


                Trace.WriteLine(“Beginning Processing”, this.ToString());


                // Simulate a long-running process.


                System.Threading.Thread.Sleep(20000);


            }finally{


                Trace.WriteLine(“Finished”, this.ToString());


                // Close out database record an other cleanup.


            }


        }


    }


This has solved my problem, and now when I sent work to the threadpool it’s not just a foreign country with no phones.  I stay in control of those threads.  The above code is a sample of the same concept I’m using.  Feel free to use the sample. but it’s been simplified to protect the innocent, so make sure to fully test whatever you put into practice.