Thursday, April 10, 2008

I was checking out the ads for the local office supply and electronics stores during my lunch hour and I saw that Office Depot was selling the ViewSonic VX2235wm for $259-- the same price as I paid for the hunk of junk Samsung. I plugged it in to my laptop and IT JUST WORKED! Everything is crisp, clear, perfect!

The installation experience went like this: I plugged in the monitor to power and my laptop. Vista asked me if I wanted the display on the left or right of my primary display (right) and then I was in business. This is NOT what happened this weekend with the Samsung.

So far, I've adjusted nothing on the monitor. I'm so HAPPY that this thing works. ViewSonic is just a better monitor manufacturer.

One other thing-- my 1st grader, Angie, introduced me to Pivot. Here's a nose picking, butt scratching stick figure that I created tonight to get a laugh out of the kids.

4/10/2008 6:28 PM Central Daylight Time  #    Disclaimer  |  Comments [0]  | 

This last weekend, my wife bought a 21.6" Samsung SyncMaster 223BW monitor for me for my birthday (happy 36th to me!) so that I could bask in dual monitor goodness when working on projects at home. I attached the monitor to my PC over the analog hookup (because I don't have an digital port available on my laptop). I know this port to be very good for other projectors. I used this laptop to teach at a number of locations over the past few years and have never had a problem when connecting to a fancy overhead projector. It worked great on several projectors at Microsoft when I worked there, it worked fine when I taught for Wintellect last year, so I know this wasn't the issue (though I did think 'hmm-- could the port be goofy?').

The images I got from the monitor were crap. I tried every adjustment, got the latest drivers for the monitor, etc. I just couldn't get the monitor to generate clear, crisp text. For someone who processes lots of code when sitting at a machine, this was an absolute deal breaker. If you do get one of these monitors and plan to use an analog (D-SUB 15) connector, then just pick something else. Right now, you can pick these things up at Sam's Club for about $260. Mine goes back today.

I think I'm going to go with a ViewSonic-- I've always been happy with their stuff though I never like the fact that I have to pay extra. Hopefully, I'll have a good experience to post about for that one tomorrow.

4/10/2008 9:59 AM Central Daylight Time  #    Disclaimer  |  Comments [0]  | 
 Monday, April 07, 2008

Florin Lazar has an interesting post on using C# 3.0 to make writing transaction blocks a little 'pithier'. In 'A Simpler TransactionScope', he suggests using a delegate and a lambda expression to accomplish his goals.

transacted(()=>
{
   using (SqlConnection connection = new SqlConnection(connectionString))
   {
      connection.Open();

      SqlCommand command1 = new SqlCommand(commandString1, connection);
      command1.ExecuteNonQuery();

      SqlCommand command2 = new SqlCommand(commandString2, connection);
      command2.ExecuteNonQuery();
   }
});

delegate void TransactedCodeDelegate();
void transacted(TransactedCodeDelegate txCode)
{
   using (TransactionScope ts = new TransactionScope())
   {
      txCode();
      ts.Complete();
   }
}

The thing that bothered me about this is, can't I approach this using C# 2.0? And, yes, I can!

transacted(delegate()
{
   using (SqlConnection connection = new SqlConnection(connectionString))
   {
      connection.Open();

      SqlCommand command1 = new SqlCommand(commandString1, connection);
      command1.ExecuteNonQuery();

      SqlCommand command2 = new SqlCommand(commandString2, connection);
      command2.ExecuteNonQuery();
   }
});

In case you are missing the change, Florin suggests using ()=> (4 characters) and I suggest using delegate() (10 characters). Otherwise, these are identical. They both use an anonymous delegate to get the job done.

I'm not suggesting that Florin's method is flawed. I'm just suggesting that folks who still use VS 2005 in their day to day job can pick up this trick without an upgrade.


4/7/2008 9:24 AM Central Daylight Time  #    Disclaimer  |  Comments [0]  | 
 Sunday, March 16, 2008

I just want to test the Windows Live Writer.

Some code:

   1:          static void ListEm<T>(IEnumerable<T> vals) 
   2:          {
   3:              new List<T>(vals).ForEach(a => Console.Write(a.ToString() + ","));
   4:              Console.WriteLine();
   5:          }
3/16/2008 2:50 PM Central Daylight Time  #    Disclaimer  |  Comments [0]  | 
 Thursday, March 13, 2008

Scott Hanselman put up a post showing some nifty LINQ code. I've been dabbling with it a little here and there, trying to see what it gave me. I like the new way of declaring member variables:

int _age;

public int Age

{

get { return _age; }

set { _age = value; }

}

 

is fairly verbose, and it doesn't add any real value for readability. So, I'm a huge fan of this:

public int Age { get; set; }

 

which is identical in the eyes of the compiler, but way better for doing a code review.

I also like the vanishing need to add properties and appropriate constructors. I like being able to write

new Person(){Age = 11, Gender=Gender.Male, Name="Vince"}

without needing to write something like this:

public Person(int age, Gender gender, string name)

I also like the simpler lambdas and other expressions. So, tonight I finally put together all the different basic features and had this running:

using System;

using System.Collections.Generic;

using System.Linq;

using System.Collections;

 

namespace LinqStuff

{

enum Gender

{

Male,

Female

}

 

class Person

{

public int Age { get; set; }

public Gender Gender { get; set; }

public string Name { get; set; }

 

public override string ToString()

{

return string.Format("{0}: {1}: {2}", Name, Age, Gender.ToString());

}

}

 

class Program

{

static void Main(string[] args)

{

var people = new List<Person>(new Person[] {

new Person(){Age = 11, Gender=Gender.Male, Name="Vince"},

new Person(){Age = 6, Gender=Gender.Female, Name="Angeline"},

new Person(){Age = 5, Gender=Gender.Male, Name="Phillip"}

});

var boys = from a in people where a.Gender == Gender.Male orderby a.Name select a;

people.Add(new Person() { Age = 37, Gender = Gender.Female, Name = "Jean" });

 

ListEm<Person>(boys);

 

people.Add(new Person() { Age = 35, Gender = Gender.Male, Name = "Scott" });

ListEm<Person>(boys);

}

 

static void ListEm<T>(IEnumerable<T> vals)

{

new List<T>(vals).ForEach(a => Console.Write(a.ToString() + ","));

Console.WriteLine();

}

}

}

 

The coolest thing here? My wife is learning C#. She took one look at the code and was able to instantly see that boys would automatically update as the people collection changed. The syntax passes the 'is it instantly grokkable' test for my sample audience of 1. I do like the fact that this syntax does focus more on what I want done instead of having to prescribe how to do it.

3/13/2008 9:43 PM Central Daylight Time  #    Disclaimer  |  Comments [0]  | 
 Wednesday, February 27, 2008
Did you know that you could run a simple, effective home with your Web surfing, telephone calling, TV watching, machine backups, book writing, code editing, music listening, game playing life, all on Microsoft products and all for a reasonable price? Over the next several posts, I want to cover how my family is using Microsoft technology to make our lives better. Today, I want to give a brief description of the home network.
2/27/2008 9:08 PM Central Standard Time  #    Disclaimer  |  Comments [0]  | 
 Friday, February 15, 2008
Just some random thoughts while reading the news over lunch. Nielsen Rating apparently released their numbers for websites for January 2008. According to the numbers reported at http://blog.seattlepi.nwsource.com/venture/archives/131937.asp, Google got the most eyeballs in January. What I find interesting is that the numbers for time spent on the web site implies a different ranking. I whipped out Excel for some simple analysis. The results? The top 4 companies in terms of eyeball hours are in the exact wrong order. Companies are presented in order of unique audience #s, measured in thousands (000). I added the 'Person Hours/1000 people' and 'Rank on Person Hours' columns.
2/15/2008 12:33 PM Central Standard Time  #    Disclaimer  |  Comments [0]  | 
 Tuesday, February 05, 2008

Usually, FSB is entertaining. Today, the guy running the FSB blog is hilarious. The post isn't much until the last line. I won't spoil this for you but, if you have 30 seconds, go here now and read. Hilarious!

2/5/2008 8:11 AM Central Standard Time  #    Disclaimer  |  Comments [0]  | 
 Monday, February 04, 2008
I don't think that buying Yahoo is a good thing for Microsoft. Instead, they should continue to out innovate their competition. One thing that has been a weakness for Microsoft recruiting has always been that they can't get many great developers. Really, really good developers can work wherever they like. If they prefer to live near family over Redmond, they typically tell Microsoft 'no' when asked to join the firm. Others, like me, say yes and then eventually decide to leave because one can't develop Microsoft product outside of their core development centers (Shanghai, China; Bangalore, India; Cambridge, England; Fargo, ND, USA; Silicon Valley; and Redmond, WA, USA). They avoid the many big cities that have first rate developers. My short list for new development centers in the USA is as follows:
2/4/2008 9:39 PM Central Standard Time  #    Disclaimer  |  Comments [0]  | 
 Wednesday, January 30, 2008
I have had the pleasure of spending the last few days improving application performance. Specifically, my job is to improve the 'speed' dimension of the application. In doing this, I've been getting reacquainted with some well used tools: SQL Query Analyzer and dotTrace Profiler. (For those of you familiar with when SQL Query Analyzer was last available under that name, I'm working with a completely functional, happy, SQL Server 2000 installation.) It's been quite a few months since I last did this. Given that not many people get a chance to do performance analysis and improvement on a regular basis, I think that now might be a good time to rehash some common mistakes and the way to fix those mistakes.
.NET | Performance | SQL
1/30/2008 7:15 PM Central Standard Time  #    Disclaimer  |  Comments [0]  | 
 Sunday, January 20, 2008
I have a sickness. My illness causes me to skip sleep, to skip meals, and to allocate no time to play video games. Occasionally, enablers have given me money to encourage me to indulge in this illness. I have no interest in getting ‘help’. I am an author and I write about technology topics. ...
1/20/2008 9:45 PM Central Standard Time  #    Disclaimer  |  Comments [0]  | 
 Monday, January 14, 2008
Tony Baer has an interesting post at http://www.onstrategies.com/blog/?p=251, 'SOA in a Recession?'. The question here is 'what will SOA investments look like during a recession?' Having been a part of the big client server moves of the mid to late 1990s, web deployments of 1997 to the present, and someone who has done training on SOA across the country for Wintellect, I have to say that SOA feels different from the previous two items. For client server, we had to start thinking about our applications differently. Bits of the application lived in different processes on different machines. Here, we had to rearchitect applications to deal with a new security model and to deal with the greater latencies involved in method and database calls.
SOA
1/14/2008 6:07 AM Central Standard Time  #    Disclaimer  |  Comments [0]  | 
 Saturday, January 12, 2008

My blog is back up and running. Expect lots of stuff on WCF, .NET, and other things that interest me.

1/12/2008 7:55 AM Central Standard Time  #    Disclaimer  |  Comments [0]  |