May 11, 2009  5:21 PM
foo

foo

Posted by DrFooMod2 at 5:21 PM | Comments (0)
What Is The Right Foreground For a Given Background

I am working on a SQL Server 2005 Reporting Services (SSRS) report that has differing row colors based on a value in each data row.  The color value is defined in the database.  When I initially created the report, each row had a variable background color but the foreground color was black.  The first time I ran the report, my dark blue background didn't contrast well with my black foreground.  I quickly realized that I needed a way to vary the foreground color programmatically based on the background color.  After first discussing things over with Nate, here is the expression I came up with for the Color property of the table row:


=IIF(
((
((CInt(Fields!Status_Color.Value) And &HFF) * 299) +
((CInt(Fields!Status_Color.Value) >> 8 And &HFF) * 587) +
((CInt(Fields!Status_Color.Value) >> 16) * 114)
) / 1000) < 125,
"White",
"Black"
)


Let me explain where this all comes from.  First off, the color that is stored in the database is used by a VB6 program.  VB6 stores colors as BGR and .NET stores colors as RGB (well, technically aRGB).  The first step is to break down the value from the database to its constituent parts (red, green, and blue) using bitshift operations I learned from Keith Peters and then apply the contrast formula I found from Colin Lieberman's website. I then determine that if the blackground is a dark color, then we use white and for a light background, black.  This appears to working like a charm.

Posted by DrFooMod2 at 5:18 PM | Comments (0)
February 28, 2009 11:09 PM
Request Tracker RT_SiteConfig.pm

Don't forget when you update the RT_SiteConfig.pm file, you need to restart httpd. I was banging my head against the wall of this one until I had a moment of clarity.

Posted by DrFooMod2 at 11:09 PM | Comments (0)
March 10, 2008  6:35 PM
Eliot Spitzer and His Prostitute

Do you think she was a Spitzer or a Swallower?

Posted by DrFooMod2 at 6:35 PM | Comments (0)
March  2, 2008  9:23 PM
No Really, Apple TV Doesn't Suck

Last night we purchase an Apple TV (as well as a Mac Mini, 20" Cinema Display Monitor, wired keyboard, and wireless mouse). Today I had the unfortunate happenstance of making this little gem of a unit find, and talk to iTunes running on my Mac Pro. I'll save you the gory details buy my switch is a Linksys SRW224G4P and in the end, I had to disable IGMP Snooping. Otherwise the multicast traffic wasn't flowing around correctly. This fix came as "well, let's just see if we turn the helper off". Well sure as shit, it worked. Yippee for me!

Posted by DrFooMod2 at 9:23 PM | Comments (0)
May 2009
Sun Mon Tue Wed Thu Fri Sat
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
Search


Archives
May 2009
February 2009
March 2008
February 2008
January 2008
Recent Entries
foo
What Is The Right Foreground For a Given Background
Request Tracker RT_SiteConfig.pm
Eliot Spitzer and His Prostitute
No Really, Apple TV Doesn't Suck
Apple Mac Time Machine and iSCSI
Avistar / FastTrack Airport Parking Sucks
The well educated surfer
HOWTO Resolve a 7B Stop Error in a Restored Vista x64 Complete PC Restore Image in VMWare Fusion
Add/Remove Windows Feature Error
Recent Commentators
Aaron
m3Rlin
DrFooMod2
Yeah Right
Frank
DrFooMod2
Rings
<< ? MT blog # >>
<<  ? BlogxPhiles #  >>
<<  ? NJ Bloggers #  >>
<<  ? MT #  >>
<<  ? GeekLog #  >>

Contact
DrFooMod2
Syndicate this site (XML)
Powered by
Movable Type 3.38
Webcam
Featured Links
Meg Bitton Photography
Supreme Security Systems, Inc.
www.whybasecampsux.org
Stop The Bear Hunt in New Jersey
Microsoft Windows XP - Command-line reference A-Z
Angry Driver Bumper Stickers
Black History Minute
Forgot that connectionstring?   You will find it right here!  
Funny Microsoft Q Articles
XtraVerticalGrid Suite

Blogroll
Blogroll Me!

Miscellany
Green Web Hosting! This site hosted by DreamHost.
No Monkey Business. Just Good Code.
Prices Down.  Servers Up.
PC Weenies
Lockergnome
Proud to be a member of BlogSnob!
deviantART dot com; where ART meets application!


blogchalk: Dave/Male/26-30. Lives in United States/West New York/New Jersey and speaks English. Spends 80% of daytime online. Uses a Faster (1M+) connection.