May 22nd, 2008 Rusty
..try, try again? Nah! Try once. However, after a few tries, walk away. Go to the park. Spend time with your kid(s). Ironically, when yo get back, it just might work!
I slammed my head against the wall trying to figure out what, exactly, needed to implement IConvertable. I was executing a SubSonic query that was pretty straight forward. It used a guid as the key. Nothing special. But it wouldn’t work. Debugging was killing me because my sitemap is a little slow to gen now. So I spent a few hours trying to multi-thread my sitemap gen only to realize that I use it in global.asax so I need it completely ready on start-up. Crap! I dumped that plan and then copies the db locally. After the 2 gig zip, ftp and restore, I was back to debugging the error. I finally went for a bike ride.
I returned to fire up vs.net and continue where I left off and its fixed. That’s a pisser…
The alternative title for this post is: how many ADD kids does it take to debug an interface exception? I don’t know, wanna ride bikes?
Posted in Blogging | 1 Comment »
May 16th, 2008 Rusty
I really didn’t find anyone else reporting this issue. I created a custom SiteMapProvider and it magically provided a breadcrumb for me. Sweet! Then I was demo’ing and no breadcrumb…
I discovered that deleting the trailing slash brought the breadcrumb back.
I may have added my SiteMapNode urls incompatibly with the SiteMapProvider expectations. But my urls are perfectly valid and "/my-specialurl" is the same as "/my-special-url/". In my code, I’m stripping trailing slashes before comparison. Shouldn’t the SiteMapProvider do the same? Who knows?
Code change was easy:
(note: I edited this from the original post as I discovered that I overrode the less ideal signiture of this method, this covers both )
public override SiteMapNode FindSiteMapNode(string rawUrl)
{
// base method doesn’t handle trailing slash very well
SiteMapNode match = base.FindSiteMapNode( rawUrl );
// base method worked!
if( match != null ) return match;
// try without trailing slash
if( rawUrl.EndsWith( "/" ) ) match = base.FindSiteMapNode( rawUrl.Substring( 0, rawUrl.Length - 1 ) );
return match;
}
Posted in Asp.Net, Programming | No Comments »
May 9th, 2008 Rusty
Technorati Tags:
SubSonic
Simply put, with the update of SubSonic 2.1 (Beta), use of Find( delegate ) no longer works. The inheritance chain was changed to Collection<T> from List<T> for data binding objectives. No worries, the underlying collection is there for you! You can get List functionality from Ling extensions.
Code that was broken by the update:
Store.Image imageMoved = imageCollection.Find(delegate(Store.Image image) {
return image.ImageId == imageId;
});
Error 5 Cannot convert anonymous method to type ‘object’ because it is not a delegate type C:\…\Source\Web\admin\controls\product\images.ascx.cs 226 59 Web
The Find method is now replaced and we need to change the above to the following.
using System.Linq;
...
Store.Image imageMoved = imageCollection.ToList<Store.Image>().Find(delegate(Store.Image image) {
return image.ImageId == imageId;
});
Posted in Programming | 1 Comment »
May 6th, 2008 Rusty
I think I was asked to enter my username and password, my name, then choose the nearest city for time zone and select my keyboard layout. I installed it in VMWare fusion. It launched immediately, and told me there are updates to install. OK.
Out of the box, it includes Open Office with Draw (a visio alt), Firefox, CD Burning, Gimp image editing, A CD extractor, pidgin messaging, a soft phone. Seriously, its pretty sick.
Anyone interested in learning Linux definitely owes it to theyself to fire up a virtual instance and kick the tires.
I’m planning to head to Ruby Hoedown in AL this summer. I’m too old to be cool but perhaps I can get some props for knowing how to use Bash.
Dan Morris would probably like to smack me upside the head for all the trouble I gave him. Who knew how easy Linux was?
Posted in Linux | 2 Comments »