November 14, 2008

ERROR_NO_TOKEN = Don’t forget to call GdiplusStartup

Posted in programming at 9:41 am by picklemouse

If you forget to call GdiplusStartup, but attempt to create a bitmap:

Gdiplus::Bitmap * pBmp = Gdiplus::Bitmap::FromStream(pStream);

You get back a null pointer. GetLastError() returns 0x000003f0 (1008), or ERROR_NO_TOKEN.

September 9, 2008

MsgWaitForMultipleObjects: When 5 seconds becomes INFINITE

Posted in programming at 10:56 am by picklemouse

Recently I was working on a bug that had as its primary symptom an indefinite hang on exit. The exit code included the following:

MsgWaitForMultipleObjects(1, &Process, FALSE, 5000, QS_ALLINPUT);

The intent of the code was to wait a maximum of 5 seconds for the Process to exit, and to pump messages while waiting. However, in fact, the MsgWaitForMultipleObjects was never returning, even after 5 seconds had elapsed.

What was happening was that the application in question had a timer that fired on a very short interval (100ms). The timer events were always triggering the MsgWaitForMultipleObjects, and since there was always one or more timer notification, the wait was never satisfied by the timeout. The moral of the story: as long as there is input of an appropriate type, that input will satisfy the Wait, and the timeout will never be triggered, making it the same as if you used a timeout of INFINITE. You might guess this from the documentation, especially if you are familiar with the other Wait functions, but it’s not really obvious.

One way to resolve this is to not signal the wait on timer notifications. So replacing the original code with the following resolved the problem:

MsgWaitForMultipleObjects(1, &Process, FALSE, 5000,  
QS_INPUT|QS_POSTMESSAGE|QS_PAINT|QS_HOTKEY|QS_SENDMESSAGE);

This has the effect of filtering out the QS_TIMER input (WM_TIMER notifications).

IronGirl 5K Seattle 2008

Posted in running at 10:39 am by picklemouse

IronGirl 5K 9-7-08I ran my first race Sunday and it was great! My goal was to finish in less than 30 minutes and my final time was 26:28 - well within that goal. My pace was 8:33/mile. I was actually a little surprised at how well I performed – I definitely exceeded my expectations for myself!

I was also surprised at how exhilarating I found the race experience. M (in the orange) told me that it was a rush but I didn’t quite believe how exciting it would be to be at the starting line with thousands of other women, and to hear random bystanders cheering us on the whole way. It was also kind of cool that there were these couple of thousand women, all shapes and sizes and ages, and lining the route were all of our husbands and children and families and friends, encouraging us. Definitely an unexpectedly neat experience. M and I are already planning for a 10K next month. B was awesome and ran the 5K with us but I think she’s wise to our ways now and won’t be suckered into running again!

August 20, 2008

Kudos: finishline.com

Posted in kudos, running at 8:42 am by picklemouse

A couple of weeks ago I went to a local running store to replace my battered running shoes. I went to the same store at which I had purchased the shoes originally and told them I wanted another pair just like them. Unfortunately, they were out of stock and told me that it would take 2 weeks to get them in.

I went home and googled for the shoes. Ultimately I wound up ordering them at a slight discount off finishline.com. The price was great, ordering process was reasonably straightforward and – best of all – with the free standard shipping, the shoes were delivered to my front door less than 24 hours later. (Granted, I think they have warehouses in eastern Washington, so your mileage may vary if you’re outside of Seattle/Washington state).

I’ve been running in my new shoes for two weeks now, and the local running shop still hasn’t received the backordered shoes. I had a great experience with finishline.com and I highly recommend it!

August 13, 2008

Big Milestone!

Posted in running at 5:36 pm by picklemouse

Today I reached a big milestone – I’ve run 1,000 miles since I started running in February 2007.

1000

June 27, 2008

Oh. My. Gosh.

Posted in Life in Rainier Valley at 9:00 am by picklemouse

It’s so unbelievably beautiful out – like the kind of beautiful we haven’t seen in about, oh, 8 months – that I feel like I should call in sick today. Just in case the sun never comes out again, I don’t want to miss it! Unfortunately I have an overdeveloped sense of responsibility. It’s going to get me in trouble some day…

May 27, 2008

Congratulations, Geoffrey!

Posted in family at 4:22 pm by picklemouse

My baby brother graduated from Colby on Sunday. Nice work, bro!

May 20, 2008

You might be a Floridian if…

Posted in travel at 7:36 am by picklemouse

“Down South” means Key West
“Panhandling” means going to Pensacola.
You think no-one over 70 should be allowed to drive.
Flip-flops are everyday wear.
Shoes are for business meetings and church.
No, wait, flip flops are good for church too, unless it’s Easter or
Christmas.
Sweet tea can be served at any meal.
An alligator once walked through your neighborhood.
You smirk when a game show’s “Grand Prize” is a trip or cruise to Florida.
You measure distance in minutes.
You have a drawer full of bathing suits, and one sweatshirt.
You get annoyed at the tourists who feed seagulls.
All the local festivals are named after a fruit.
A mountain is any hill 100 feet above sea level.
You think everyone from a bigger city has a northern accent.
You know the four seasons really are: almost summer, summer,
not summer but really hot, and Christmas.
It’s not soda, cola, or pop…it’s coke, regardless of brand or flavor, “What kinda coke you want?”
Anything under 95 is just warm.
You’ve hosted a hurricane party.
You go to a theme park for an afternoon, and know when to get on the best rides.
You pass on the right and honk at the elderly.
You understand the futility of exterminating cockroaches.
You can pronounce Okeechobee, Kissimmee and Withlacoochee.
You understand why it’s better to have a friend with a boat, than have a boat yourself.
Bumperstickers on the pickup in front of you include: various fish, NRA, and a confederate flag.
You were 8 before you realized they made houses without pools.
You were 12 when you first met someone who couldn’t swim.
You get angry when people say “Florida isn’t really part of the SOUTH”
You’ve worn shorts and used the A/C on Christmas.
You know what the “stingray shuffle” is, and why it’s important!
You recognize Miami-Dade as ” Northern Cuba”

April 19, 2008

That. Exactly.

Posted in Christianity at 7:19 am by picklemouse

http://www.internetmonk.com/archive/the-divine-protection-racket-a-fixer-god

April 18, 2008

Google Maps vs. MS Clearflow: Traffic information

Posted in technology at 8:51 am by picklemouse

This morning I checked out the traffic information now available from Google (http://googlesystem.blogspot.com/2008/04/google-maps-predicts-traffic-conditions.html) and Microsoft (http://maps.live.com/).

As usual, the Google interface was pretty and easy to use. The text and map were crystal clear and sharp, and the color-coded traffic indicators were clean and easy to interpret. The traffic prediction controls were simple and intuitive.

The problem? I don’t believe the data for Seattle. At 8 am on a Friday, 520 was showing “green” (>50 mph) all the way across. No matter how I played with the predictor, I could not get the 520 to show up as anything but green. And anyone who’s tried to head to/from Redmond during commuter hours will tell you that’s just impossible. Also, there weren’t any traffic incidents in the city – I guess it’s possible, but seems improbable. Finally, on the annoying front, I wanted to refresh the traffic information, so I hit the refresh button – and the map recentered from Seattle to Washington, DC. Ok, that’s just irritating.

On the other hand, the Live Search Maps don’t give nearly as good an initial impression as the Google Maps. At a comfortable zoom level (adjusted so that I can see I-5 on the left edge and I-405 on the right, SR-520 at the top and I-90 at the bottom), the text and map lines are slightly fuzzy. The traffic indicators look sloppy, as if they were drawn by a kid with a magic marker. The key for interpreting the traffic indicators is barely visible in the lower right-hand portion of the screen; same for the scale. Also, the key just tells me relative slowness; it doesn’t give me any information about what “black” or “green” mean in concrete terms.

However – at least I believe the information that Live is giving me! At 8 AM, 520 eastbound shows up solid black (the slowest indicator) all the way across the Evergreen Point bridge. Now that sounds more like it.

Unlike Google Maps, there doesn’t seem to be a way to predict traffic with Clearflow. I did try using the directions feature of Clearflow, which is supposed to route you around traffic situations if you ask it to, but it didn’t appear to have any effect for the destinations I chose. Too bad, since that seems like it could be a really useful feature.

Also, in general, I prefer Google Maps’ mapping and directions functionalities over Live Search Maps for three reasons. First, Google Maps is a lot less picky about addresses and consequently requires less input from me. Second, after getting directions with Google Maps, I can edit the origin/destination without having to click a link or go back to the original web page. And third, with Google Maps, I can drag the route to customize it to use or avoid certain roads.

Bottom line? I wish I had a way to combine Google’s useability with Clearflow’s accuracy. As it stands, I currently wouldn’t use the Google app at all (what use is it, if the information is not reliable?). I might consult Clearflow in a pinch, just for traffic information, but I would still use Google Maps for mapping and directions.

Previous page · Next page

Follow

Get every new post delivered to your Inbox.