Monday, October 15, 2007

I certainly don't want this to turn into a video blog of fish, but I got some more video of the fish in our stream, and it's so unbelievable to me as someone new to this area that I simply must post it.  I've also done some tweaks to my custom Silverlight player as well as used some different encoding techniques (I haven't decided whether I like them yet).

Again, enjoy me sounding like an idiot.

[UPDATE:] The way I have embedded the player this time seems to prevent it from showing in most RSS aggregators. click through to my blog to see the video.

posted on Monday, October 15, 2007 2:02:31 PM (Pacific Standard Time, UTC-08:00)  #    Comments [0]
 Saturday, September 22, 2007

So, the salmon are running in our stream.  They're really big.  I caught this video today of a smaller female (I think).  Hopefully I'll get some bigger ones on video soon.  This is also an experiment with Silverlight.

Oh, by the way.  I'm like giddy with the thought of salmon in my stream, so I sound like an idiot.

posted on Saturday, September 22, 2007 6:57:50 PM (Pacific Standard Time, UTC-08:00)  #    Comments [2]
 Tuesday, July 24, 2007

Today is our 8 year anniversary.  Eight years seems like a really long time!  This past year has been a crazy year for us.  We've moved across the country, away from all our friends and family.  And, through it all, Becky's put up with all my crazy shenanigans.

Thanks, Becky.

posted on Tuesday, July 24, 2007 3:44:48 PM (Pacific Standard Time, UTC-08:00)  #    Comments [1]
 Thursday, March 22, 2007

For some reason, when I'm typing (and especially when I'm coding) I often conciously attempt to capitalize numbers under certain conditions.  For some reason, my brain thinks that there's a difference.  For instance, if I was typing HttpV4Implementation, I would probably end up with HttpV$Implementation because if there had been a letter there instead of a number, I would have capitalized it.  Does anyone else have this problem?  It's really frustrating because I often retype it several times making the same mistake each time before finally realizing what the problem is.

I think this may be caused by my handwriting style, which seems to be typical of engineers, where all letters are in captial form, but differ in size to indicate capitalization.  I've seen this referred to as "smallcaps".  Oddly enough, I didn't pick this up in college as an engineer.  I decided to start writing that way in junior high after noticing how cool my granddad's handwriting was.

posted on Thursday, March 22, 2007 10:13:48 AM (Pacific Standard Time, UTC-08:00)  #    Comments [0]
 Tuesday, January 02, 2007

This year, we gave the gift that keeps on giving... the stomach flu. But, before I get to that, let me back up a bit...

If you recall, we got our power restored after over a week of outage with just a little more than 12 hours to prepare for our holiday travels.  However, we managed to get everything together and arrive at the airport the suggested 2 hours before the flight.  Out trip went through Phoenix instead of Denver, so I figured we'd be in the clear weather-wise since nothing ever happens in Phoenix.

Wouldn't you know it, we got to the airport to discover our flight had been delayed due to fog in Phoenix.  After a bout with a touchy airline representative (which I may eventually devote an entire entry to), we decided to go ahead to Phoenix since everything was delayed coming and going in hopes that our connecting flight would be delayed as well.

4.5 hours after our flight was to leave originally, we boarded the plane with still a slight chance of catching our connection.  After we landed in Phoenix, we discovered we'd missed the connection by a mere 19 minutes.  With no flights available to El Paso until Christmas, we really had only one acceptable option... rent a car and drive.  So, at about 9pm, we hopped in a car and drove the 6.5 hours from Phoenix to El Paso to Becky's parents house.  All in all, I felt a great sense of accomplishment in having executed such an old-school road trip with a 1-year-old.

Christmas with the Pattersons was great.  I got something I have wanted most of my life... a radio-controlled helicopter.  Thanks everyone.  The only issue was that things in our room were much colder than we were used to, which resulted in Jenna waking up every 30 minutes after midnight due to being cold, and she got all sniffly and such.

We went to Cattleman's (a world-famous steakhouse) for dinner Christmas eve, and I had a huge t-bone.  It was delicious.  Becky had been feeling ill earlier in the day, but we attributed it to lack of sleep.  After dinner, she took a turn for the worse.  I started feeling bad, but attributed it to eating too much.  Becky went to the doctor while I put Jenna to sleep.  By the time Becky got back, I was full on sick, but it was too late to see the doctor.  It was probably the worst night of my life.  Becky's dad helped us tremendously by tending to Jenna, who had also caught the bug.

The next morning, after an unpleasant episode in which I thought I was literally dying, I went to the doctor too.  We were scheduled to fly to Austin and drive to Belton this day, and were contemplating delaying the trip.  We ultimately decided that the pros of keeping our original schedule outweighed the benefits of staying longer.  So, somehow, we got on a plane to Austin and then drove the hour from Austin to Belton.  Unfortunately, the wake of our illness still spread to virtually all of Becky's family.  Some of them got sick on their flights home.

In order to avoid getting sick when we arrived in Belton, my parents just waved to us as we went to the apartment behind the house where they work.  They had gone to alot of trouble to quarantine us away, which was great because we had alot of room for Jenna and we had complete control over the temperature.  For the next few days, we followed a protocol of constant hand washing and such to prevent the spread of the plague.  We even avoided seeing my brother's family completely to avoid any complications for their new son who was less than a few weeks old.  This seemed to be working until my Dad got sick, followed by my mother that night.  My aunt also got sick on her flight home.  We ended up canceling several rendezvous we had planned with friends in the area.  In the end, we finally had a very short visit with my brother's family on his back porch.

Even though we had to be up at the crack of dawn on the 1st to get to the airport, we thankfully had an uneventful and undelayed flight home, and we just sat on our couch in disbelief of the events that had transpired during the previous few weeks.  Now, we just have to shift Jenna 2 hours back to Pacific time.

So, to everyone we had hoped to visit while we were in Texas, we're sorry things had to go down like that.

posted on Tuesday, January 02, 2007 4:26:53 PM (Pacific Standard Time, UTC-08:00)  #    Comments [1]
 Wednesday, December 20, 2006

So, we still don't have power, but things are looking up.  Let me give you the rough timetable so far.

  • Thursday, Dec 14th ~8pm: Wind starts picking up. Lights begin to dip occasionally.
  • ~10:30: Power goes out.  Ticked because I was in the middle of a Halo match.
  • ~11:30: By this time, the wind is really blowing.  The sound of branches breaking off can be heard occasionally throughout the surrounding woods.
  • Friday, Dec 15th ~12:30am: The wind is blowing like crazy.  The gusts are bending the trees to an alarming degree.  We decide we should move downstairs in case one decides to fall.  This wakes Jenna up and she decides we are playing some kind of game.  She spends the next several hours honking our noses.
  • ~2:00am:  I am VERY concerned about falling trees.  With each gust, the sounds of breaking trees can be heard.
  • ~4:00am:  Jenna is finally asleep.  The wind seems to have subsided.  We go back upstairs to be comfortable.
  • ~morning: Damage is surveryed.  Nothing major.  Check around the neighborhood.  Nothing terrible.  Patiently wait for power to be restored.
  • ~noon: It's getting cold.  I look for some firewood.  All I find is soaked through.
  • ~3pm: still no warmth.  We decide to bail.  We call the Flints and head to Bellingham.
  • ~7pm: We arrive in Bellingham, warm up, and stay the night.
  • Saturday, Dec 16th: Head back to our house to check on the cats.  The daylight reveals the devestation of the infrastructure.  Trees are down everywhere.  Powerlines are a tangled mess.  The power's going to take a while.  We make sure the cats are OK, and head back to Bellingham.
  • Sunday, Dec 17th: Attend Jeff's church and locate a generator that meets our criteria.  Big enough to run the furnace, small enough to fit in the trunk.  Head back to the house and fire it up.  Becky took Jenna to a friend's house while the house warmed up.
  • 8pm: the house reaches 60 degrees, our criteria for staying the night, so Becky brings Jenna back and we put her to bed.
  • 10pm: the house reaches normal temperature.
  • Monday, Dec 18th 12:30am: The furnace stops working and the house begins cooling fast (the structure itself has not yet heated up to normal)
  • 1:00am: We head to Becky's friends house and spend the rest of the night.
  • Daytime: Jenna and Becky hang out at her friends house, and I go into work to see about arranging furnace repairs and do other errands in addition to keeping work from falling too far behind.
  • Evening: return to Becky's friends house, and have a nice evening playing with Jenna and xbox. Becky and friend go check on cats, which are freaking out, but otherwise doing fine.
  • Tuesday, Dec 19th: Some work.  The furnace guys show up and confirm my diagnosis of a faulty flame sensor.  Furnace working again.
  • Evening: Head to another one of Becky's friends for some nice dinner.
  • 8:00pm: I get a call from my realtor, who just got power and offers his huge generator.
  • ~9:30pm: Big generator hooked up and running.  Now we can run some lights and other stuff. Additionally, it runs all night on a tank of gas, rather than having to fill every 5 hours.  Also discover cable service is out.  No xbox.
  • Wednesday, Dec 20th morning: wake up from a very pleasant and successful night. Fill tank on the generator and go out to get more gas.  Then head into work.
  • 1pm: Becky and Jenna join me at work for some lunch.

In somewhat unrelated news, I saw what I believe to be a couple of river otters swimming in the creek yesterday evening.  The reason I think they were otters was they looked like otters, and the tracks I found in the snow look like otter tracks. I'll have to keep my eyes open for them and maybe get some pictures.

posted on Wednesday, December 20, 2006 2:46:57 PM (Pacific Standard Time, UTC-08:00)  #    Comments [5]
 Monday, December 18, 2006

I've gotten lots of inquiries lately where, for now, the answer is simply, "we're alive".  If you weren't aware, the Seattle area was pounded last Thursday by an incredibly fierce windstorm.  Over two thirds of the houses in the area lost power, which equates to over a million customers (houses/businesses). We live in one of the areas hardest hit by the storm.

Luckily, we, our cats, our home, our cars, and everything else all escaped unharmed.  However, we have been without electricity since Thursday night.  We decided the best course of action with a one-year-old was to get the heck out of there.  We stayed with the Flints Friday and Saturday night.  After a brief period of warmth on Sunday brought by a generator, we are now staying at a friends house in nearby Kirkland who regained power on Sunday.

I'll update more when I have more time.  For now, I'm working on getting the furnace fixed.  Either running it continuously for about 8 hours damaged part of the ignition system, or running it from a generator screwed something up.

Hopefully, everything will be cleared up in time for us to make a Saturday flight to Texas for the holidays, but they're saying it may be Friday or Saturday before our power gets turned back on.

posted on Monday, December 18, 2006 3:39:53 PM (Pacific Standard Time, UTC-08:00)  #    Comments [0]
 Wednesday, November 29, 2006

Lots of snow - Blue skyMaking snow ice cream!It hasn't snowed any more. In fact, yesterday was a clear, beautiful day.  You can check out the photos I uploaded yesterday for all the snowy goodness, as well as some overdue photos since Halloween.  But, the temperature hasn't gone up, so all the snow is still here.  I even went outside, got some snow, and made some snow ice cream, which I haven't had in ages. (It doesn't snow enough in Central Texas to get clean snow)

the road this morning My smart card reader is broken, so I don't have remote access, which makes it hard to work from home.  I decided to go into work today to try to get another one.  It's supposed to snow more tonight, so I wanted to be ready, and not feel like I need to go in.  The way into work was interesting.  There were still lots of cars in ditches or stuck going up hills, etc.  But, I can't find a card reader, so I'll probably head home soon.  I don't want to risk getting stuck on the way home.  So, I'm going to queue up some work for the rest of the day and head out.

posted on Wednesday, November 29, 2006 10:12:20 AM (Pacific Standard Time, UTC-08:00)  #    Comments [0]
 Monday, November 27, 2006

It snowed yesterday morning, and evening, resulting in quite the winter wonderland.  We didn't get as much as Jeff did up in Bellingham, but any snow to us is alot.

Also, last night while we were feeding Jenna, we heard what sounded like firecrackers going off.  Seconds later, the whole house shook with a huge thud.  It took me a few seconds to realize what had happened.  Several large branches had broken off one of the trees on the northeast side of the house, and one of them had hit the roof on the way down.  I believe the only damage was to the gutters, but I'll have to see.  There is still a large piece of the branch on the roof.

The branches don't look very big when they are way up in the tree, but when they get to the ground, they are small trees themselves by our Central Texas standards.

posted on Monday, November 27, 2006 10:15:14 AM (Pacific Standard Time, UTC-08:00)  #    Comments [1]
 Wednesday, August 16, 2006

Well, almost.  By the time you read this I probably will be.  The truck arrived on schedule this morning, but the moving company forgot to send out the loaders (which was odd because the packers were here yesterday).  That was fine because the driver had a chance to go around and tag all the furniture.

Anyway, things are eerie around here.  Nothing but lots of little pieces of garbage everywhere.

I'll get some pics up on Flickr later.  I'm working with relatively limited internet access through my phone.

I've got a hotel room lined up for us tonight, then it's off to the airport late in the morning!  Crazy

posted on Wednesday, August 16, 2006 11:29:56 AM (Pacific Standard Time, UTC-08:00)  #    Comments [1]
 Tuesday, August 15, 2006

The packers came early this morning and packed all our stuff.  I was completely amazed at how many boxes it took to pack up the kitchen.  It pretty much took 1 person dedicated to the kitchen, while 3 others did the rest of the house.  From what they said, it's typical.  The kitchen has to be packed with more padding, so it takes up more room and takes longer.

Anyway, the loaders come tomorrow and load up everything.  That will be even crazier.  The house will pretty much be empty.  Then, we fly out on Thursday about noonish.

I simply don't have room to take my camera on the plane, so it's packed.  I'll try to snap some pictures with one of the lesser cameras though.

posted on Tuesday, August 15, 2006 12:03:20 PM (Pacific Standard Time, UTC-08:00)  #    Comments [1]
 Monday, August 14, 2006

I'm getting ready to shut down my PC for the last time here in Austin.  The packers are coming tomorrow morning.  I hope they're not really mad at how unprepared we are.  Anyway, things are getting pretty stressful here at the end.  There's still so much to do and only a couple of days left to do it.  We said goodbye to my brother and his wife this evening, which was pretty sad.  I've never lived more than about an hour from my family my whole life.  Things will be very different with them being that far away.

We did finally find out where we will be living for the next couple of months while we look for a permanent place. Here's a bird's eye view.

We've got a ton of possible houses to look at when we get there.

posted on Monday, August 14, 2006 8:03:57 PM (Pacific Standard Time, UTC-08:00)  #    Comments [1]
 Friday, August 04, 2006

I was watching Jenna this afternoon, and she was crawling around and generally having fun.  She crawled over to a little book (Goodnight Gorilla, to be exact), openned it up, and began making noises.  This was nothing new.  She does this often, and we think she is pretending to read it.  What I was most amazed by was that she began making sounds like E-I-E-I.  This of course is familiar.  So, I grabbed her Old MacDonald book, which was nearby, and began reading it.  Lo and behold, Everytime I read, "Old MacDonald had a farm...", she would respond with E-I-E-I-E-I.  I was completely amazed.

I took me a while to realize that I ought to be videoing it.  By the time I started rolling, she was less interested, but I did get it a few times. If I get a chance this evening, I'll get it encoded and get a clip up here.

posted on Friday, August 04, 2006 12:51:12 PM (Pacific Standard Time, UTC-08:00)  #    Comments [0]
 Tuesday, August 01, 2006

Well, today I am officially unemployed.  I just made my last commute home from Freescale Semiconductor.  I'll really miss my old team and the fun times we've had.

Now that I'm unemployed, Becky and I are free to follow our dream of moving to Washington state in hopes of finding the elusive sasquatch or "wood ape".  That's right, I'm not going to work for Microsoft after all.

My plan is to drive through the forest roads at high speed, hoping to catch the beast unawares and hit it with my huge, 80's style station wagon.  Thinking it dead, I'll strap it to the roof and drive home, only to have it wake up and scare us.  In my panic, I'll brake abruptly, sending the hairy bigfoot flying through the air.

After some misadventures, my family and I will grow to love the gentle giant, and seek to return him to his home, lest he be poached by his arch-nemesis, Jacques LaFleur.  In doing so, we'll realize that if we lived more like these gentle sasquatches, in harmony with nature, that we'd all be better off.

posted on Tuesday, August 01, 2006 2:40:33 PM (Pacific Standard Time, UTC-08:00)  #    Comments [2]
 Friday, July 14, 2006

Things have been uber-crazy around here the last month or so. The quality and quantity of my posts had been seriously lacking, and there have been tons of things to post about.  Jenna's crawling everywhere, standing up and walking while holding stuff, and starring in a broadway musical (OK 2 out of 3 isn't bad).

Anyway, I've neglected my readers, and I apologize for that. Hopefully that will change soon. I thought I would come up for air for a moment to announce that I have accepted a position at Microsoft.  Becky, Jenna and I will be relocating to Redmond, WA (near Seattle) sometime in August (wow, that's soon isn't it).

I will really miss my current team, our local friends, and church; but Becky and I are super-excited about this new opportunity.  I'll post some more details when I get a chance (and after I learn for sure what I'm allowed to talk about), but for now I can tell you I'll be working on the Common Language Runtime team.

posted on Friday, July 14, 2006 8:13:26 PM (Pacific Standard Time, UTC-08:00)  #    Comments [5]
 Saturday, May 27, 2006

My XBox360... is dead.  It started locking up in the last few days, and now is completely dead.  I spent some time on the phone with support to no avail.  They are sending me a coffin to put it in so they can try to resurrect it.  I suppose it's fairly good timing.  I had planned to get alot of work done around the house this holiday weekend, and I'm sure the 360 would have been a distraction.

posted on Saturday, May 27, 2006 6:30:12 AM (Pacific Standard Time, UTC-08:00)  #    Comments [1]
 Tuesday, May 23, 2006

I thought some others might find this useful.

I have been baffled for a few days why certain actions in an experimental Rails app would work fine in dev mode, and then give me mysterious HTTP 500 errors when deployed.  The Rails logs would tell me everything was just fine and there was no problem. But, there they were in Fiddler... status 500.  I haven't figured out how to get ahold of the Apache logs from my host yet, so they couldn't help me.

I finally set up Apache with FastCGI myself so I could attempt to duplicate the problem.  It was immediately apparent.  The Apache log was complaining about invalid headers in the FastCGI communication.  I was using "puts" to write out to the console when running in dev mode in order to quickly debug what was going on.  This works fine when using the Webrick standalone server, but FastCGI on Apache evidently uses stdout to do the communication between it and the fastcgi processes, and writing to stdout screws up that communication and Apache reports HTTP 500, even though Rails thinks everything's A-OK.

The lovely thing about Ruby is that I was able to fix it by redefining puts to do nothing.  Ideally, you ought to use the logging mechanisms, and I will.  But that made a great short-term fix.

posted on Tuesday, May 23, 2006 11:59:36 AM (Pacific Standard Time, UTC-08:00)  #    Comments [0]
 Tuesday, May 09, 2006

I've updated my blog's tagline (at least temporarily) to celebrate.  Halo 3 was just officially announced.  Hop over to bungie.net and check out the trailer, or download it from the XBox Live marketplace.

I simply can't wait.  I'm going to pour all my energy into building a time machine so I can travel ahead to 2007.

posted on Tuesday, May 09, 2006 1:31:41 PM (Pacific Standard Time, UTC-08:00)  #    Comments [1]
 Wednesday, May 03, 2006

I figured out how to draw historical track log data from my tracking app onto the Virtual Earth control.  It's a pretty early implementation, but it works really well.  I'm generating transparent PNG images on the fly and using them as the content of a well-placed pushpin. Here's a screenshot:

Don't be confused.  If you've played with the VE API, you may think I'm creating a pushpin for each datapoint.  I'm not. I'm creating one image and overlaying it on the map.

Once you figure out how to take the latitude/longitude to pixel translation to the server-side, it's fairly straightforward.  The hardest part about it is geting transparent PNG images to render properly in IE.  Hilariously, my workaround currently breaks the functionality in anything other than IE.  Just stupid.

Anyway, now I have to resolve a few little issues as well as "tile" my overlays much like the virtual earth image tiles.  That should fix some of my performance problems.

[UPDATE] OOPS! Something I changed last night broke the tracker position.  Not sure where the problem is, but rest assured that I AM at work today, and not still at home.

posted on Wednesday, May 03, 2006 8:05:29 PM (Pacific Standard Time, UTC-08:00)  #    Comments [2]
 Monday, May 01, 2006

I've been loving my new phone.  In an effort to fully exploit and justify my unlimited data plan, I've been dreaming up applications for it.  My latest one is something I've always wanted to do.

I hooked up a bluetooth GPS and capture my position.  Every 10 seconds or so, I send the logged data to a server.  I then have a spiffy Rails app set up to display my current location on a Virtual Earth map.  The page uses AJAX to poll the server every 10 seconds or so to update my position on the map.

I've got lots of ideas for how to mine and visualize the data, as well as provide nifty tools for my friends and family to track my location, as well as hooking the data up to my Flickr uploader (rewritten now in just about 20 lines of Ruby code) to automatically geo-tag my photos when I upload them.  I've got lots of cool things I plan to do with it while we're on vacation this summer.

I'll have live demos for the public available soon.  Some of my friends have been playing with it already as I debug it. For everyone else, here's a shot:

If you're a friend of mine and want to play with the live version, lemme know and I'll shoot you the temporary link.  Most of the time, it's pretty boring because I'm at work, but hold on to you hat when I start going somewhere.

posted on Monday, May 01, 2006 11:51:45 AM (Pacific Standard Time, UTC-08:00)  #    Comments [4]
 Friday, April 14, 2006

I was on the way back to work from lunch, and I saw a truck with a trailer full of large boxes.  I could not tell what the contents were, but on each box was the company's slogan in big letters....

If anyone deserves it, you do

I think that is a hilarious slogan.  What's in those boxes?  Every possibility made me chuckle.  Rat poison, suppositories, hand grenades, spoiled food, etc.  Is it a sarcastic, humorous slogan, or are they simply playing to people's vanity?

After some Googling, I determined it was furniture from Berkline furniture, which was kind of disappointing.

posted on Friday, April 14, 2006 10:10:54 AM (Pacific Standard Time, UTC-08:00)  #    Comments [0]
 Saturday, December 03, 2005

For those itching for pictures, but not patient enough to wait for me to upload mine, they can check out my dad's blog.

We're doing OK.  We're pretty tired.  We plan on taking advantage of the nursery tonight so we can be rested for when we go home and don't have a fully-staffed nursery.

posted on Saturday, December 03, 2005 12:27:58 PM (Pacific Standard Time, UTC-08:00)  #    Comments [2]
 Friday, December 02, 2005

This morning, at 7:37am CST, Jenna Evelyn Miller was born, one day early, by c-section. She had turned since our last ultrasound earlier in the week and was breach (breech? beached?).

Everything is fine and Becky and Jenna are both resting.

Evidently, this is the time of year when all the cool software developers have their babies.

Pictures are coming, I'm blogging from the delivery room

[UPDATE: 11:30am]  I forgot to include the stats.  7 lbs 15 oz, 20 inches.  Will get pictures up this afternoon.  Lots to do!

posted on Friday, December 02, 2005 7:37:02 AM (Pacific Standard Time, UTC-08:00)  #    Comments [12]
 Tuesday, November 01, 2005

Another geeky post.

We built our own query system several years ago.  It used the concept of "query by example" with templates that were interpreted into SQL.  You could generate the equivalent of an "IN" clause by assigning something that implemented System.Collections.ICollection to a template property.  Recently, with the introduction of generics and the generic collections, we decided to relax that contract to IEnumerable since that's really the least common denominator of all collections.  This produced some hilarious results.  As you can imagine, anywhere where we were using strings to specify template values, they were being interpreted as collections of characters.  This manifested itself mostly by having queries return nothing, since our system properly handled Chars and treated them as strings.

But, this reminded me of a similar incident a few years ago that involved a framework that rendered objects as comma-separated values. So, instead of:

Mark, Miller

You'd get:

M, a, r, k, M, i, l, l, e, r

I thought since I had been bitten twice, I would write it down.  I usually don't forget stuff I take the time to write down.

So, the moral of the story: Remember that even though System.String implements System.Collections.IEnumerable (and now System.Collections.Generic.IEnumerable<System.Char>), you usually don't want to treat it as a collection.  You may need to special-case it.

Anyone else think of another type like this?

posted on Tuesday, November 01, 2005 12:23:02 PM (Pacific Standard Time, UTC-08:00)  #    Comments [0]
 Tuesday, October 25, 2005

I ran into a nasty performance problem recently.  It involved some AJAXy type dynamic requests.  The problem was that two requests always seemed to be occuring serially rather than taking advantage of the wonders of a multithreaded server and running in parallel.  After much spelunking and debugging, it suddenly occurred to me that the handlers were marked with IRequiresSessionsState to pull a trivial piece of information out of the session.

You may not be aware, but accessing the session usually results in an exclusive lock.  Normally, this isn't a problem since users very seldomly open multiple windows or send simulataneous requests, and sessions usually represent unique users.  But fire off two simultaneous requests, and they will be processed serially.

But, if you mark your page as being "ReadOnly" (or disabled) via the EnableSessionState attribute of the @Page directive (or IReadOnlySessionState for IHttpHandlers), you'll help yourself out.  ReadOnly will get a reader lock on the state, allowing multiple readers access, while disabled (via "false") will not lock at all.  In addition, if you're running your session state out-of-process, disabled will keep you from incuring a hit from the db or other store access.

Just an interesting bit of information that thought would be useful.

posted on Tuesday, October 25, 2005 12:28:11 PM (Pacific Standard Time, UTC-08:00)  #    Comments [0]
 Wednesday, October 12, 2005

Here's the logic response to Peter's experimenting:

Hitler Coulter.jpg[UPDATE] Since I've gotten some favorable response to this post, both in the comments and in email, I thought I would give some special, behind-the-scenes information

When I saw Peter's pictures, I immediately thought of the series (1,2) of photoshop trickery I did a while back. Look familiar?

Now, if you'll notice, in Peter's original, he is looking straight at the camera.  So, I had to fix the eyes and distort the nose so he's looking over at Jenkies, who is also obviously added to the scene.

posted on Wednesday, October 12, 2005 5:54:22 PM (Pacific Standard Time, UTC-08:00)  #    Comments [2]
 Monday, October 10, 2005

What a geeky post title.  Well, I guess it's a geeky post.

Based on the number of people actually in the bathroom at work when I'm in there, I would think that two people entering/exiting the bathroom at the same time would be a rare event.  Yet, I've come to expect the door to magically open in front of me as my hand nears the handle, or swing violently at my face as I exit.

I always find it amazing the number of things in real life that have dualities in software.  In software, we'd solve the problem of collisions in the doorway by taking a lock on it (although locking on a public object is not always a good idea).  This becomes a problem in the real world because of visibility.  The bathroom door has no window (which is probably good), so you can't see when someone is right on the other side.  You seldom have a collision when the door has a window because you can see who else is going to try to use the door before you can get there.  There are tons of "shared resources" in the world where we've created synchronization mechanisms of various authority.  I think we could learn a thing or two by observing them.

For instance, when roads intersect, we have several different ways of dealing with collisions (we sometimes call them that in the software world as well.):

  • Raw intersection - No traffic signs or anything. Typically found on dirt roads where traffic is scarce and the probability of collision is low.
  • Yield - One street is a lower priority and "yields" the intersection to the other road.
  • Stop signs - you see where I'm going
  • Flashing Lights
  • Traffic Lights
  • Traffic circle - This one always amuses me.  It is actually a very efficient means of managing an intersection IF the drivers are familiar with navigating it.  If they are not, hilarity ensues.
  • Overpass

And there are tons of "in-between" flavors.  Hopefully you see what I'm getting at.  The granularity of synchronization in software can be just as complex.  Simple locks, Mutexes, Reader/Writer locks, etc.

Where am I going with this? I don't know.  I just thought it was interesting how many real-world examples of synchronization there are, and how we avoid them in different scenarios, sometimes delegating that responsibility, sometimes taking a more strict position. Prioritizing etc.

That is all.

posted on Monday, October 10, 2005 12:36:45 PM (Pacific Standard Time, UTC-08:00)  #    Comments [1]
 Tuesday, October 04, 2005
I've had previous problems with obfuscating code with Dotfuscator.  I seem to be cursed...I've found another one.    Is no one else using this product to obfuscate CLR 2.0 code?  This one is quite wicked.  I spend several hours digging through before and after IL. (which is difficult when the purpose for obfuscation is to make it difficult to read) Here's the recipe for disaster:
  • A generic method with the following characteristics:
    • More than one type parameter.
    • A return type composed of one or more of the method's type parameters other than the first one.

Some C# example signatures (Not useful or practical, just simple examples that show the problem):

static IEnumerable<TValues> FindDictionaryValues<TKey, TValue>(IDictionary<TKey, TValue> dictionary)

static TValue FindAValueInADictionary<TKey, TValue>(IDictionary<TKey, TValue> dictionary)
 
After obfuscation with dotfuscator (even with all obfuscation options disabled), those two signatures will look like:

static IEnumerable<TKey> FindDictionaryValues<TKey, TValue>(IDictionary<TKey, TValue> dictionary)

static TKey FindAValueInADictionary<TKey, TValue>(IDictionary<TKey, TValue> dictionary)
 
What happens is fairly simple.  Any reference to the method's type parameters in the return type becomes a reference to the first type parameter (usually !!0 in the IL).  What's more, this corruption also happens at the call site, which I didn't discover until I had written a regular expression to find and repair the corrupt signatures.
 
It is quite as if generics support was cobbled on as a hurried afterthought/sellingpoint rather than being properly integrated into their codebase.  Their support for 2.0 is poor, even for "beta" status.  However, Preemptive seems interested in fixing the issues.  I'll update when I know more.
 
[UPDATE 10/06/2005] I wanted to let everyone know that PreEmptive is being very responsive to this issue.  They've delivered a patch and I am currently evaluating it.  So far, it appears to fix my issues, but we're working through a few other issues.  Will update when I have more info.
posted on Tuesday, October 04, 2005 2:08:26 PM (Pacific Standard Time, UTC-08:00)  #    Comments [0]
 Saturday, September 03, 2005

Doesn't that sounds like an awesome band name?  Someone here just said that and I had to write it down.  This seemed like as good a place as any.

posted on Saturday, September 03, 2005 1:50:13 PM (Pacific Standard Time, UTC-08:00)  #    Comments [3]
 Thursday, September 01, 2005

Most of my day today was tracking down a problem with our app when we obfuscated it.  We were getting a System.EntryPointNotFoundException in the obfuscated version, while the normal one worked fine. The stack trace contained the following on the top of the stack trace:

at System.Collections.Generic.IEnumerable`1.GetEnumerator() +0

No concrete class, and an assembly code offset of 0. Weird, eh? After tweaking with lots of settings and digging through the IL of several iterations of differing obfuscation techniques, I finally determined the problem.

I had three overloads of a method that each took a different parametrization of IEnumerable<T>.  For the sake of example, we'll say IEnumerable<A>, IEnumerable<B>, and IEnumerable<C>.  In the obfuscation process, calls to any of the three were being changed to the IEnumerable<A> overload.  Sure enough, PEVerify was giving errors about the wrong type being on the stack. (I was going to show the IL before and after, but I just realized that I deleted the non-working one after fixing it. I'll post it if I can find it again)  It seems that Dotfuscator was not distinguishing properly between overloads if they only differ by parameterization types. I have not verified it, but this may have been aggravated by iterator methods.

We're working up some sample code to send to Preemptive so they can address the problem, but debugging it was frustrating enough to post a synopsis of the account for Google to find.

posted on Thursday, September 01, 2005 12:13:07 PM (Pacific Standard Time, UTC-08:00)  #    Comments [1]
 Sunday, August 14, 2005

I've talked about church bulletin humor before. Today, I experienced it first hand. Our church publishes the Wednesday night meal menu in the bulletin. I suppose this is so families can plan around it. I don't think anyone is going to have the church dinner this Wednesday. It read:

Menu: Poopyseed Chicken over rice, vegetable, rolls & dessert.

It was all I could do to keep from falling out of the pew laughing.

posted on Sunday, August 14, 2005 3:50:05 PM (Pacific Standard Time, UTC-08:00)  #    Comments [2]
 Thursday, August 11, 2005

We're migrating an app to 2.0, and I've come across a rather bizarre behavior.  Basically, after running for a while, the app will begin taking up 100% of one CPU.  Perf counters would indicate that the process is in GC (% Time in GC is very high).

Now, some background.  This is an ASP.net app. We've got very aggresive caching such that the static memory footprint is about 600MB. When things first get going, everyting behaves wonderfully.  Then, at some point, the GC gets hungry or something and starts chewing up cycles.  The heaps never go down.  No allocations are being made.  Nothing tangible seems to be going on.

When requests comes in, they are handled normally, and the GC seems to "get out of the way".  (DB wait time is accompanied by 0% CPU) But after the request is completed, it's back up to 100%.

This app worked fine under 1.1.  And I guess there's an argument that says it still does.  It just doesn't play nice with anything else on the system.  I'm just kind of writing this to get this problem out there in case anyone else is seeing it and is searching for a solution.  I'll probably also ping a few folks at MS to see what they have to say.

[UPDATE] Check out this update.

posted on Thursday, August 11, 2005 10:46:20 AM (Pacific Standard Time, UTC-08:00)  #    Comments [1]
 Friday, July 08, 2005

Heath and CourtneyWow, I can't believe it's been 5 days and I haven't made an entry about the 4th of July fun.  We spent the weekend in Belton with my family.  On Sunday, we hooked up with Heath and Courtney Robinson and their two sons, Gage and Soren. Ski-ball!It was quite fun to catch up with them and see how big their kids are getting. We took them to the mall and into the arcade that I think used to be Eckerds.  Watching them play ski-ball and air hockey,  with Soren barely able to see over the edge of the table was a blast. Here's the photo set of our meeting.

Bean Bag TossOn Monday, the 4th, it was time for the annual Miller 4th of July Olympics!  Usually, my mom comes up with a bunch of crazy games, and we play them and declare winners and such.  This year, Andrew wanted to be in charge of the games.  He did a pretty good job.  We started with the bean bag toss, where you try to knock wooden blocks with animal pictures on them off a saw horse from across the yard. CastingThen, we set up the casting competition, where we used a standard fishing pole equipped with a foam ball and tried to cast it into a pool.  This was quite challenging.  I got some pretty good shots of the moment when the ball hit the water.  After that, we attempted to drop quarters into various sizes containers which were submerged in water.  We all seemed to have drastically different theories about what would work, and oddly enough, most of them worked pretty well.  Most involved harnessing the rotational inertia of the quarter to prevent it from fluttering as it sank. CRW_3328Then, it was on to one hole of tennis ball golf, where you had to navigate a course with a tennis ball and 9 iron, which was also quite entertaining.  That was all for the outdoor games.  Next, we stacked Jenga blocks end to end to see who could get the highest.  For some reason, the girls were much better at that game.  After that there was a heated game of what we call "ball game", which is simply throwing ping pong balls in a trash can, in order to break a 3-way tie for second.  Once 4 place was settled, it ended in a sudden death round of "ball game" for second place.  The prizes were "winners choice" between:

The Winners
  • Some foam balls
  • A pocket knife
  • A vanilla scented candle
  • A small stuffed monkey
  • A velcro paddle and ball set

It was great fun. Check out the whole set for the games of the 3rd Julympiad.

Patriotic CakeAndrew made his patented secret recipe trail mix, which is alot like a bowl of candy.  His wife Sara made a delicious cake.  And we had lots of other goodies.  We didn't get to shoot any fireworks this year, which was unfortunate, but that just means we'll have to make up for it next year.  I hope everyone else had as much fun as we did.

 

posted on Friday, July 08, 2005 9:00:36 PM (Pacific Standard Time, UTC-08:00)  #    Comments [3]
 Friday, July 01, 2005

CRW_3186My boss and I spent Wednesday and Thursday in Phoenix, Arizona on a business trip.  We were evangelizing some internal tools we've created over the last several years.  We left early Wednesday morning on Southwest Airlines and had a stop in El Paso, where I changed seats into the best coach seat I've ever sat in.  It was just behind the emergency exit row, and the seats were arranged such that there was no seat in front of me.

CRW_3211Let me just say something about Phoenix.  It is HOT!  We came up with a slogan for Phoenix:

Hell is cold in Phoenix

Anyway, the trip went well.  And our tools were well received.  For the first time, I made sure that my GPS was turned on as much as possible to enable me to geo-code my photos.  I used the WWMX Location Stamper from Microsoft Research to put the GPS track data into the photos.  I was hoping to integrate them into Google Earth, but they are no longer taking orders for the plus version which allows GPS track data to be integrated.

CRW_3218CRW_3226Also, in a bizarre coincidence, my friend Jeff Flint, who lives in the Seattle area, was in Phoenix on a sort of baseball tour.  So, Wednesday night, I ditched my boss and headed to the ballpark.  I was worried about the sun and the heat, but on the way there, I noticed that the smoke from the fires in California was making it much less intense.  Then, when I got there, an even better surprise.  The roof was closed and the park was air-conditioned, making it very pleasant.  Jeff and I watched the game, chatted, and generally caught up, which was great.  He managed to catch two balls during batting practice.

 

posted on Friday, July 01, 2005 5:53:07 PM (Pacific Standard Time, UTC-08:00)  #    Comments [1]
 Friday, June 10, 2005

Back last year, I outlined a problem I had with calling Response.End from a thread other than the thread that handled the request.  It stemmed from a progress mechanism we had implemented that had the ability to cancel long-running tasks when the user hit stop or closed the browser.  As it turns out, that wasn't the whole story.

We recently added a few reports where, the majority of the time, gathering the data takes over a couple of minutes.  While doing memory and performance optimizations, we noticed our worker process was recycling with the following message in the System event log:

A process serving application pool 'XXXXXXXXXX' terminated unexpectedly. The process id was '####'. The process exit code was '0xff'.

Googling for this error doesn't do you much good since it could be caused by a variety of reasons.  Most of the advice I came across wasn't well thought out and made quite a few bad assumptions.  So we added some more debug logging and determined that this was happening when our canceling mechanism kicked in when a user decided they didn't really want to wait 5 minutes for the report.  I was greatly puzzled by this since this feature had been tested thoroughly and had been running in production for some time.  Looking back through the server logs, it was evident that it had been happening all along, just not very often. We had just gotten the performance on the vast majority of pages to be very good and it wasn't an issue.  The problem only came to the surface when we added the report that always takes a while.

Here's the problem.  If the handling thread is aborted, it causes a condition that IIS considers to be bad and that forces the worker process to recycle. (presumably, there is some communication that doesn't occur) This doesn't happen when Response.End() is called because it passes a special exception as the exception state to Thread.Abort.  The HttpApplication catches ThreadAbortException and checks the ExceptionState.  If it is an HttpApplication.CancelModuleException, it knows there was either a timeout, or Response.End() was called, and it cancels the Thread.Abort by calling ResetAbort which allows the thread to continue running at that point.  I thought that was pretty slick.

When I was aborting the handling thread, I was on a different thread, so I had to call Thread.Abort manually, so CancelModuleException was not being used, so the thread was ending completely and causing the recycle.  Since HttpApplication.CancelModuleException is internal (and rightly so) I could not simply use that mechanism.

The good news is that the Unload event always happens (for all practical purposes), even when the thread is being aborted.  So I added my own PageIsCancelling property to our base class Page and check it, along with the current ThreadState in Unload, and cancel any pending abort if the page is canceling.  So, the abort is contained within the callstack of the page, and the thread stays alive and all is well.  No more crazy recycling.

As an aside, it seems this is aggravated by multiple processors, which might explain how it passed testing on the dev's machine.  Although I don't have any proof of this.

posted on Friday, June 10, 2005 10:50:44 AM (Pacific Standard Time, UTC-08:00)  #    Comments [0]
 Monday, April 25, 2005