MBC Computer Solutions Ltd.

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Wednesday, 28 May 2008

Follow-up: Monitor Disappointment: Dell 2208WFP 22" Wide Screen LCD

Posted on 12:55 by Unknown

I previously wrote about how displeased I was with a pair of Dell 2208WFP 22" Wide Screen LCD's and I just thought I'd provide a quick follow-up on what happened and what I settled with.

MBC is a Dell VAR; we order hardware from Dell non-stop, and lots of it, so I was really surprised and disappointed in the experience we had trying to return these, especially when my rep told me that we were one of his bigger accounts.  Apparently Dell does not like to return peripherals because they end up loosing money on them in shipping alone.  Not that I really care - after all, how they ship their product isn't my problem, and I was even willing to pay a restocking fee (which, by the way, we didn't end up paying).  After more then I would have expected back and forth between myself and our Dell rep, Dell finally agreed to return the monitors.  But after about a week of "you will receive the return instructions via email shortly," I began to get even more annoyed, thinking the return would never actually happen.  Finally, the issue was escalated to my reps manager and we did actually receive the return instructions, and off the monitors went.

I decided to settle on a pair of Dell 2009W 20" Wide Screen LCD's that should be arriving any day now.  I certainly hope these are as good, if not better then my current Dell 2007WFP's (also 20").

I will be sure to write about them once I start using them, but I did want to provide a quick overview of my return headaches.  Dell "lesson of the day": be persistent and they'll eventually give in.

Read More
Posted in | No comments

How to determine if the clients browser accepts GZIP compression

Posted on 12:43 by Unknown

A quick way to determine if the clients web browser accepts GZIP compression:

string AcceptEncoding = Request.Headers["Accept-Encoding"];




bool gZipSupported = (!string.IsNullOrEmpty(AcceptEncoding) && 
AcceptEncoding.IndexOf("gzip", StringComparison.InvariantCultureIgnoreCase) > -1);








Thats it!

Read More
Posted in | No comments

Wednesday, 14 May 2008

Setting Default Values on Automatic Properties

Posted on 19:09 by Unknown
  • Download source - 4 Kb

Introduction

C# 3.0 introduces a great new feature called Automatic Properties, and if you haven’t already read about them, I would encourage you to read Scott Guthrie's introductory post.

As great as they are and as much time as they save, Automatic Properties have a serious drawback – you can’t set the default value of the property. Instead, the compiler will initialize value properties to 0, reference properties to null, and enum’s to the first member, and while this might work for some applications, it wasn’t working for mine.

Background

When I thought about the implementation, two options became apparent. One, I could create a base object class and have all of my classes inherit from this base class. This however isn’t a great solution because a number of my classes inherit from other classes outside of my control, and since .NET does not support multiple inheritances, it was clear this wasn’t going to work. To my rescue was the also new C# 3.0 feature, Extension Methods. If you haven’t already heard about Extension Methods I’d recommend reading another one of Scott Guthrie's blog posts about them.

Using the Code

Using the code requires that you decorate your properties with an attribute already available in the System.ComponentModel namespace – if you haven’t already guessed it, it’s the aptly named DefaultValueAttribute attribute. As well, it requires a quick call to the InitDefaults() extension method from the constructor which I will discuss a bit later.

The attached code supplies a demo implementation of the TestObject and TestObjectInherited classes:

public class TestObject
{
public TestObject()
{
this.InitDefaults();
}

[DefaultValue(-45)]
public int DefaultInt
{
get;
set;
}

[DefaultValue(10.23)]
public double DefaultDouble
{
get;
set;
}

[DefaultValue(true)]
public bool DefaultBool
{
get;
set;
}

[DefaultValue(TestEnum.Value2)]
public TestEnum DefaultEnum
{
get;
set;
}

[DefaultValue("DefaultString!")]
public string DefaultString
{
get;
set;
}

public string StringWithoutDefault
{
get;
set;
}

public string ValueOfPrivateProperty
{
get
{
return PrivateProperty;
}
}

[DefaultValue("This is a private property!")]
protected string PrivateProperty
{
get;
set;
}
}


The magical InitDefaults() method is implemented as an extension method which uses reflection to set the value of the properties to the default value:



public static void InitDefaults(this object o)
{
PropertyInfo[] props = o.GetType().GetProperties(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static);

for (int i = 0; i < props.Length; i++)
{
PropertyInfo prop = props[i];

if (prop.GetCustomAttributes(true).Length > 0)
{
object[] defaultValueAttribute = prop.GetCustomAttributes(typeof(DefaultValueAttribute), true);

if (defaultValueAttribute != null)
{
DefaultValueAttribute dva = defaultValueAttribute[0] as DefaultValueAttribute;

if(dva != null)
prop.SetValue(o, dva.Value, null);
}
}
}
}


Points of Interest



I decided to support initializing the default value of properties in inherited classes, but if you don’t want this behaviour you can simply pass false to GetCustomAttributes()



if (prop.GetCustomAttributes(false).Length > 0)
{
object[] defaultValueAttribute = prop.GetCustomAttributes(typeof(DefaultValueAttribute), false);

if (defaultValueAttribute != null)
{
DefaultValueAttribute dva = defaultValueAttribute[0] as DefaultValueAttribute;

if(dva != null)
prop.SetValue(o, dva.Value, null);
}
}
Read More
Posted in | No comments

Wednesday, 7 May 2008

Monitor Disappointment: Dell 2208WFP 22" Wide Screen LCD

Posted on 10:20 by Unknown

I've owned a number of Dell LCD monitors over the years, and with every new monitor I've used, my satisfaction with them increased, that is until yesterday when I received two new Dell 2208WFP's.

The short of it is that they are back in the box, being returned to Dell for another set of 2008WFP's to replace my home monitors (17").

I've read that the 22" LCD's are the "odd panels out" in that 22" is between 20" and 24" where the resolutions increase.  Still, I didn't think they'd be a downgrade from my current 20" panels.

First impression was BRIGHT - man were they bright - I was nearly blinded.  Usually some simple adjustments to brightness, contrast and sometimes gamma will resolve these types of issue, but to my disappointment, once I got the brightness to a reasonable level, all of the colors appeared washed out. I also noticed a red tint to the panel, and gray text appeared blurry.  No matter how I tried, I just couldn't get the color to look good at any reasonable brightness level.  It was either too bright, or washed out.

I'd love to get a pair or 24" wide screen monitors but the truth is that I don't think I have room on my desk for them - the 22" monitors were pushing it already.

So there you have it - stay away from the Dell 2208WFP.  I should add that the rest of Dell's monitor line up is spectacular so definitely don't let this discourage you from buying them!

Read More
Posted in | No comments
Newer Posts Older Posts Home
Subscribe to: Comments (Atom)

Popular Posts

  • How to change the temperature scale on a Honeywell T6575 Thermostat
    [The complete documentation can be found at http://customer.honeywell.ca/techlit/pdf/95c-00000s/95c-10897.pdf ]   This was bugging me fo...
  • C# – Converting IP’s to Numbers and Numbers to IP’s in 2 lines of code
    I don’t know why everywhere I searched had such complex implementation of this, but converting from a dotted IP to a number (integer) and ba...
  • Why does iTunes setup need to close Outlook?!
    Everytime I update iTunes I remember why I left it so long - the install process is quite annoying! Can someone please explain to me why it...
  • Mac OSX 10.5.2 Freezing Intermittently
    I've been having an issue with my MacBook (you know, that computer I hide under my desk most of the time) where intermittently, the UI w...
  • ScottGu’s Color Scheme for Visual Studio 2010
    ScottGu was nice enough to provide the world with his awesome Visual Studio 2008 color scheme.  I’ve been using this for many years now an...
  • Don’t forget about the defer attribute for non-essential external scripts
    I was recently reviewing a customers eCommerce site and I noticed that the “Please Wait” page that occurs after completing an order but befo...
  • Windows Search 4.0 Released .....and searching finally works!
    I've been dealing with Outlook 2007's search problems since installing it way back then.  Most frequently, I'd search a keyword;...
  • Recursively finding controls - where to start?
    I love hearing about bugs and problems in components I have authored.  Most people hate hearing about bugs (I assume because they like to th...
  • Dell PowerEdge & Broadcom Issues
    For some time now we've been experiencing a problem across the board with Dell PowerEdge 2900/2950 servers equipped with Broadcom Gigabi...
  • Popup Window Manager
    I was just reading a post by Rick Strahl about managing popup windows in the browser.  I actually authored a mini popup window manager a wh...

Blog Archive

  • ►  2012 (1)
    • ►  February (1)
  • ►  2010 (1)
    • ►  April (1)
  • ►  2009 (7)
    • ►  December (1)
    • ►  November (1)
    • ►  October (1)
    • ►  July (1)
    • ►  April (2)
    • ►  February (1)
  • ▼  2008 (36)
    • ►  November (3)
    • ►  October (2)
    • ►  September (1)
    • ►  August (1)
    • ►  July (2)
    • ►  June (6)
    • ▼  May (4)
      • Follow-up: Monitor Disappointment: Dell 2208WFP 22...
      • How to determine if the clients browser accepts GZ...
      • Setting Default Values on Automatic Properties
      • Monitor Disappointment: Dell 2208WFP 22" Wide Scre...
    • ►  April (1)
    • ►  March (4)
    • ►  February (7)
    • ►  January (5)
  • ►  2007 (35)
    • ►  December (1)
    • ►  November (9)
    • ►  October (3)
    • ►  September (6)
    • ►  August (7)
    • ►  July (9)
  • ►  2006 (3)
    • ►  May (3)
Powered by Blogger.

About Me

Unknown
View my complete profile