Tuesday, February 08, 2005

In an earlier post, I mentioned that I wished HttpModules were more scriptable in ASP.NET.  You can easily create Controls, Pages, HttpHandlers, and web services all without having to compile anything, but as far as I know HttpModules have to be compiled and registered in the web.config in order to start working.

So, I created a ScriptableHttpModule.  You register it in the config the same as a regular module, but it allows you to create .asmodx files that are compiled and called just like regular modules and give you the same kind of dynamic compilation model as the other .asXx files.  I'm still tweaking it a bit, but it looks pretty promising.

posted on Tuesday, February 08, 2005 6:39:29 PM (Pacific Standard Time, UTC-08:00)  #    Comments [2]

marklio.com, as well as my dad's site bellcountyblogger.com, is now being served from a real server!  I just made the switch a little earlier today to a hosting company.  I've been really impressed with them so far.  The transition was absolutely seamless, although I am still hammering out some email details that were not available before.  I'm discontinuing the gallery in favor of hosting all my images on Flickr.  That way all those images won't take a bit out of my bandwidth (although I have plenty).  Hopefully that will provide a better experience for everyone, especially once they integrate photo printing.  My redirector will continue redirecting the old dnsalias addresses.  Hopefully those will all get cleaned up before my port 80 gets blocked. Up until now, I've been relying on the business class cable modem service provided by my employer, but they're discontinuing that soon and the standard package blocks port 80.

posted on Tuesday, February 08, 2005 6:30:30 PM (Pacific Standard Time, UTC-08:00)  #    Comments [0]
 Monday, February 07, 2005

my blogmap I just ran across BlogMap, a cool project that attempts to organize RSS information by location.  It lets you "geo-code" your blog so that it can be browsed and searched by location. It doesn't put the icon exactly where you live since it's by zip code rather than exact address, but it's pretty close.  My house is just under the little blob in the lower-right-hand corner (it's a park).

Anyway, once you've geo-coded your site, your feed is added and can be found through a somewhat clumsy (at this point) map, or by searching for a city.  The system needs some work to be really useful, but it's pretty dang cool!  Chandu has done some excellent work on it and I hope he continues to make this into an extremely useful tool.

It really adds alot of scope to content to know where it's coming from.


posted on Monday, February 07, 2005 9:50:16 AM (Pacific Standard Time, UTC-08:00)  #    Comments [0]
 Friday, February 04, 2005

After some banging of my head on a wall, I found what I believe to be a bug in Oracle's .NET data provider (or ODP).  Or, at the very least, it is some non-intuitive behavior.  We have a byte-based enum that is stored in the db for a reporting tool.  As we all know, bytes are unsigned, but somehow a bunch of my values were negative in the database.  Closer inspection indicated that my values had been treated as if byte was signed.  After a thorough review of my code, I fired up Reflector to dig through the ODP code.  After a little while, It became clear ODP was treating my byte as if it were signed.  Although the actual problem is in unmanaged world, here's a troubling method that's called during the binding process:

internal unsafe void SetPrmValCtx(byte b, int index)
{
*(((sbyte*) (this.m_pOpoPrmValCtx.pBltVal + index))) = b;
}

It was easy enough to work around, since our API is several layers removed from ODP itself.  But annoying nonetheless, especially since using an sbyte (signed byte) as a parameter value will throw an exception.  Just thought Google might be able to help someone else out in the future using this information.  in the meantime, I'll make sure Oracle knows about this little annoyance.

posted on Friday, February 04, 2005 1:47:10 PM (Pacific Standard Time, UTC-08:00)  #    Comments [0]

Even though it has some objectionable language, I thought this video was funny enough to link to. Evidently, a group of guys had been playing Halo 2 late into the night, when one of them fell asleep while playing.  To make matters worse, he begins snoring loudly into his headset.  So, his character is just standing there snoring.  One guy fires up the VCR and starts recording.  Then they all begin abusing the snoring guy.  Yelling at him to wake him up, pushing him off cliffs, and surrounding him with explosive fusion cores and setting them off which sends him into the stratosphere.  Again, it does has some objectionable language.

Although I haven't experienced this scenario, playing Halo 2 online is very interesting from a social standpoint.  To me, it's been alot more like playing a sport than a video game.  When you're playing online, there are no AI players.  Every character has a real human controlling it.  Being able to communicate with your teammates adds alot as well.  It's alot like playing paintball or lazertag in really elaborate arenas, only tons cheaper.  If you think about it that way, the XBox is very inexpensive compared to what you'd have to pay for that kind of entertainment.  It's a fantastically easy way for me to get together with my friends and do something without having to get them all in one place. (at least my friends who have XBoxes...hint...hint)  And it's also been an excuse to get to know people I wouldn't otherwise have much in common with.

 

posted on Friday, February 04, 2005 11:20:51 AM (Pacific Standard Time, UTC-08:00)  #    Comments [0]
 Thursday, February 03, 2005

Sorry to hear that my friend Jeff is sick.  I'm also under the weather today.  As usual for me, it is the sore throat that is the most bothersome.  One time back in college I had a really bad sore throat and my long-time family doctor asked, "Who removed your tonsils?"  I responded that I had not had them taken out. He remarked, "Oh...I was going to say they had not done a good job."  Although I wasn't exactly sure how to take that, it was clear that my tonsils are not in the best condition.

Hope you get feeling better, Jeff.

posted on Thursday, February 03, 2005 3:57:15 PM (Pacific Standard Time, UTC-08:00)  #    Comments [2]
 Tuesday, February 01, 2005

I use a dynamic DNS service to host my DNS entries.  Back when I started hosting my blog, I was using marklio.dnsalias.com instead of www.marklio.com.  Since I still have that name pointed at this server, some search engines still have not let go of that old dns name.  In a few months, I'm going to have to move this to a hosted environment (it's currently just running on a server at my house), at which point the two names will point to different places.  I've been strategizing the move for a while now, and I've just implemented step 1, which is to ween http traffic from the old alias.

I've done that by implementing a permanent redirect for any request to the old name.  I created a little IHttpModule that hooks into the BeginRequest event, and looks for the old dns name.  If found, it returns the status 301 (permanent redirect), and dynamically builds the appropriate request to www.marklio.com.  It seems to work well.  Hopefully the search engines will handle this appropriately.

For any interested, here's the relevant code:

public class RedirectModule : IHttpModule
{
#region IHttpModule Members
public void Dispose()
{
//do nothing
}

public void Init(HttpApplication context)
{
context.BeginRequest += new EventHandler(context_BeginRequest);
}
#endregion

void context_BeginRequest(object sender, EventArgs e)
{
HttpApplication application = (HttpApplication)sender;
HttpContext context = application.Context;
Uri url = context.Request.Url;
if (url.Host == "marklio.dnsalias.com")
{
context.Response.AddHeader("Location",
url.ToString().Replace("marklio.dnsalias.com", "www.marklio.com"));
context.Response.StatusCode = 301;
context.Response.End();
}
}

The whole pluggable nature of ASP.net is really sweet, although this really got me wishing there was a way to "script" this class rather than have to build it and add it to the web.config.

posted on Tuesday, February 01, 2005 6:29:04 PM (Pacific Standard Time, UTC-08:00)  #    Comments [2]

I very often bring my lunch to work and supplement it with some items from the vending machine depending on my mood.  Typically, this is just a can of Diet Dr. Pepper (the only diet drink I can stand), for which I pay the outlandish price of $.65.  Sometimes, when I am a bit more hungry, I will get a bag of delicious Harvest Cheddar Sun Chips, or yummy Baked Doritos (or any of the other baked chips that taste better than the originals...even Fritos).  Anyway, the chips used to be $.75.  Today, much to my surprise, I discovered the chips are now $.90.  And no way am I paying $1.50 for some fruit juice.

I've always been frustrated by the price of things "within the walls" here, but this is ridiculous.  I feel like I'm at Disney World or something.  Ideally, I don't think anyone should make money off of selling things like food to employees at their place of work, but that can be impractical for a business to provide such services "at cost". But, under no circumstances should I have to pay more for something here than I would within a reasonable distance from here. 

posted on Tuesday, February 01, 2005 9:47:24 AM (Pacific Standard Time, UTC-08:00)  #    Comments [1]
 Monday, January 31, 2005

I've been pretty lucky so far on the comment spam here until yesterday when the floodgates opened.  To combat it, I've enabled the Captcha feature that requires you to type a confirmation number to be able to post a comment.  It is fairly self-explanatory and should work fine.  Let me know if there are any problems with leaving comments.

P.S. This will most likely prevent using third-party tools to leave comments (like RSSBandit, etc).

[UPDATE] Jen and Dave are having a similar war on comment spam with WordPress.  Her blog software of choice.

posted on Monday, January 31, 2005 7:24:31 AM (Pacific Standard Time, UTC-08:00)  #    Comments [5]
 Sunday, January 30, 2005
As promised, I've added a nice picture of B-Dub to his birthday entry.  Hosted on Flickr.
posted on Sunday, January 30, 2005 2:23:08 PM (Pacific Standard Time, UTC-08:00)  #    Comments [2]