Sunday, September 03, 2006

Dragnet & a lazy Sunday of movies

Dragnet was on the crappy movie channel we get this morning. What a classic movie.

My wife comes in... she's never seen it! What rock did she grow up under to have never seen this movie?

We had recorded Ladder 49, and started to watch it, but after 20 minutes, it was too boring, so we stopped it. Maybe we'll save it for a very late night when we can't sleep.

Instead we watched the 40 Year Old Virgin. Not as funny as a lot of people say it is, but there's a couple Napoleon Dynamite type lines in it that just are hi-larious. Like when they're in Beth's room and someone says "that girl's a freak" and Andy says "Ya think?" Greatness!

Ahh yes... College football is back!

It's like that old pair of gym shorts. Man does it feel good the have college football back! I'd taken to watching baseball, and that's just not good for a guy's brain.

Oh yea, and OU almost lost, which would have made my weekend that much better. They did suck though :)

I got out and played with a group of guys from FreeGolfInfo yesterday. It was like an SMT gathering as everyone had at least one SMT club. One guy even had on an SMT shirt and an SMT glove.

On the range, I was shanking everything... bad. I even told the guys that it was going to be bad. Well, I started birdie, par, double bogey, birdie (after missing a 6' eagle putt), bogey, par, bogey, bogey, bogey for a smooth 40 on the front. A whole bunch of bogeys and a couple pars on the back netted me a 43 for an 83. Not too bad, but I can tell you this course was much more open than my home course, so I'm sure I would have scored much worse at home. Also, the greens were all bumpy and very slow, so my 36 putts seemed ok to me.

Friday, September 01, 2006

FIX: VS.NET 2005 Reporting Services Report Designer bug

There's a nasty bug in VS.NET 2k5's Report Designer where if you use the report wizard, the UI will constantly bomb when you switch to preview mode. The solution is to strip all whitespace in the rdl file in the <rd:mdxquery></rd:MdxQuery> tags. This is very painful to do manually (especially on a report with lots of parameters).

Here's some quick code to do this for you (put this on a form with a textbox with the filename, you can use an open file dialog if you want):

if ( textBox1.Text == "" )
{
MessageBox.Show( "Please select a file." );
return;
}

using( StreamReader reader = new StreamReader(
textBox1.Text ) )
{
using ( StreamWriter writer =
new StreamWriter(
textBox1.Text + ".fix" ) )
{
string s = reader.ReadLine();
bool haveStarted = false;
while ( s != null )
{
if (s.IndexOf( "" ) > -1 )
haveStarted = true;

if ( haveStarted )
{
int i = s.IndexOf( "<" );
writer.Write(
s.Substring( i ) );
}
else
{
writer.WriteLine( s );
}
if ( s.IndexOf( "
" ) > -1 )
{
haveStarted = false;
writer.WriteLine();
}
s = reader.ReadLine();
}
writer.Close();
reader.Close();
}
}
FileInfo f = new FileInfo( textBox1.Text );
f.MoveTo( textBox1.Text + ".broke" );
f = new FileInfo( textBox1.Text + ".fix" );
f.MoveTo( textBox1.Text );