2011 Oct 26, 8:04
"Knowledge is Power; France is bacon"
technical 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.
technical 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++.
c++ technical bug programming smart-pointer cpp 2011 Oct 18, 4:52
I haven't been updating my blog recently. But I have three excellent reasons:
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."
food microsoft game gunstringer humor technical 2011 Sep 23, 10:13Post technical 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!
humor bttf nike shoes 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)."
technical web-worker webbrowser programming postMessage 2011 Sep 10, 10:36video