os page 24 - Dave's Blog

Search
My timeline on Mastodon

V__42F4

2011 Nov 9, 4:13

PermalinkCommentsflickrmanager windowsphone7

V__E809

2011 Nov 9, 4:13

PermalinkCommentsflickrmanager windowsphone7

V__6A20

2011 Nov 9, 4:13

PermalinkCommentsflickrmanager windowsphone7

Alex Smile

2011 Nov 9, 4:08

PermalinkCommentsflickrmanager windowsphone7

My favourite comment ever posted on Reddit

2011 Oct 26, 8:04
"Knowledge is Power; France is bacon"
PermalinkCommentstechnical

iPod Godfather Tony Fadell Finally Reveals His New Product: A Thermostat. No, Really. | TechCrunch

2011 Oct 25, 5:37
An original iPod guy has a new company that makes... wait for it... thermostats. Weird. Well they look cool anyway.
PermalinkCommentstechnical

Bug Spotting: Smart pointers and parameter evaluation order

2011 Oct 19, 5:58
The following code works fine. I have a ccomptr named resolvedUri and I want to update its hostname so I do the following:
        CreateIUriBuilder(resolvedUri, 0, 0, &builder);
builder->SetHost(host);
builder->CreateUri(0xFFFFFFFF, 0, 0, &resolvedUri);


But the following similar looking code has a bug:
    ResolveHost(resolvedUri, &resolvedUri);


The issue is that doing &resolvedUri gets the address of the pointer but also clears out the pointer due to the definition of my smart pointer class:
    operator T**()  
{
T *ptrValue = mPtrValue;
mPtrValue->Release();
mPtrValue = NULL;
return &ptrValue;
}


In C++ there’s no guarantee about the order in which parameters for a function or method are evaluated. In the case above, &resolvedUri clears out the ccomptr before evaluating resolvedUri.Get() and so ResolveHostAlias gets a nullptr.

An interesting and related thread on stack overflow on undefined behavior in C++.
PermalinkCommentsc++ technical bug programming smart-pointer cpp

Haven't Been Posting Much

2011 Oct 18, 4:52
I haven't been updating my blog recently. But I have three excellent reasons:
PermalinkComments

Portal 2's Turret Lullaby comic sheds light and lasers on the singing turrets

2011 Oct 2, 4:30
PermalinkCommentscomics mac microsoft pc playstation portal-2 ps3 singing-turrets valve xbox technical

The three terrifying minutes that created The Gunstringer

2011 Sep 29, 8:35This story is funny and also reminds me to go eat at Matador... "Twisted Pixel chief creative officer Josh Bear had responded with abounding confidence, if only to mask the truth. Because the fact of the matter, the fact that he and CEO Mike Wilford were all too aware of, as they sat in Redmond, WA Tex-Mex restaurant The Matador, was this: The idea wasn't "awesome." It was nonexistent."
PermalinkCommentsfood microsoft game gunstringer humor technical

Baby onesies office redocorate

2011 Sep 24, 12:43

PermalinkCommentsflickrmanager windowsphone7

John Hodgman's presentation at Maker Faire New York (Video)

2011 Sep 23, 10:13PermalinkCommentsPost technical

The Most Anticipated Shoe of All Time: Q+A With Someone Who Won A Pair of Marty McFly's Futuristic Kicks | Motherboard

2011 Sep 20, 9:27Interview with someone who bought the limited edition Back to the Future shoes: "[Interviewer] Have you watched the Back to the Future movies? [Respondent] Yeah, some of em. The hoverboards and shit. That was cool." ARGH! Not worthy!PermalinkCommentshumor bttf nike shoes

[html5] Web Workers: Race-Condition setting onmessage handler?

2011 Sep 20, 7:17There's no race between posting to a web worker and the web worker setting up its message handler as long as the web worker sets its message handler in the first sync. block of code that runs in the web worker: "Basically, once the initial worker script returns, the worker's port is enabled and the normal message port event delivery mechanism kicks in (including dropping unhandled messages on the floor)."PermalinkCommentstechnical web-worker webbrowser programming postMessage

Family Photo #2

2011 Sep 18, 7:02

PermalinkCommentsfamily me alex sarah

Sarah kisses Alex

2011 Sep 18, 7:01

PermalinkCommentsfamily alex sarah

Alex in Basket

2011 Sep 18, 6:58

PermalinkCommentsfamily alex basket

Alex in monkey blanket

2011 Sep 18, 6:56

PermalinkCommentsfamily alex

Alex in monkey blanket

2011 Sep 18, 6:55

PermalinkCommentsfamily alex

Alex in Bunny Swing-A-Majig

2011 Sep 10, 10:36

sequelguy posted a photo:

Alex in Bunny Swing-A-Majig

PermalinkCommentsvideo
Older EntriesNewer Entries Creative Commons License Some rights reserved.