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 );

Wednesday, August 23, 2006

Tee time collusion!

I joined a country club a couple months ago so I wouldn't have to scrounge for coupons, could walk on any time I want, could get a group of guys to play with, etc., etc.

Now, basically on the weekends, you have to call at 7am on Tuesdays and Wednesdays to get a tee time for Saturday and Sundays. I've called at exactly 7am and got "9:56 is open." What the hell? I called at 7 and already 10 people have gotten tee times?

I think next Monday afternoon, I'm going to go down there and look at the tee sheet for the next Saturday and see if any names are already down, because this is BS.

VS.NET 2k5 sucks.

That is all.



Well maybe not.

VS.NET 2k5 is obviously a half baked product that shouldn't have made it out the door.
  • It's really slow. Like it takes forever to open. Forever to open a project.
  • The Report Designer for reporting services 2k5 has a very heinous bug that requires you to hand edit the xml to remove whitespace or VS.NET crashes when you try and preview the report.
  • The new Web Projects are retarded!

I was really comfortable with VS.NET 2k3 (with Resharper of course) and when I started to use VS.NET 2k5, I really felt like it was a step back. There is *nothing* in the new interface that I really like or that I felt was value added. (this is not true for some of the language additions, but the IDE is really poor).

That is all -- for now.

Ajax to Web Services -- Why?

I get an email at least once a month that goes like this:

"I'm calling a web service from javascript and.."

Now, don't get me wrong. Web services are cool. Javascript is cool. AJAX is cool. A request to a SOAP web service using javascript? Probably not your best bet.

Why? SOAP. SOAP is great and all, but without some fancy javascript toolkit, you get to handle all the soap enveloping and namespaces in your javascript -- which isn't fun at all. Also, as most people have figured out, javascript xml methods are different in IE and Mozilla browsers, so you have to deal with that too.

What do I recommend to these other guys?

I always recommend that you make an asp.net (or php or whatever your language of choice is) page and have it do the heavy lifting for you. There's a buch of benefits in doing this:
  • better error handling
  • better debugging
  • better user experience (too much AJAX = slow browser -- see gmail and windows live mail)
  • no cross site scripting issues
  • better configuration (e.g. service urls)
  • easier maintenance
  • looser coupling between your UI and the service (good!)

So, what does the asp.net page return you?

Three (well four) options:

  • Plain text (e.g. "ERROR", "OK", "option1~option2~option3") -- clear out the default HTML on the page first of course
  • XML (change the response type to text/xml and pump out xml) -- again, clear out the default HTML on the page first
  • HTML -- this is especially useful for non-paging, non-sortable grids.
  • JSON (this is a fourth option that I really haven't used, but a colleague is and likes it)

In any case, by calling an intermediate asp.net/php/etc. page that's part of the current solution (or in an unmanaged path in SharePoint), you get a lot of benefit with a small performance hit (but really not as bad as it could be!).

So stop calling SOAP web services from javascript. It's a pain and there are better options out there.