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 Jun 12, 3:34
As it turns out the
WPAD Server Fiddler Extension I made
a while back actually has a non-malicious purpose. Apparently its useful for debugging HTTP on the WP7
phone (or so I'm told). Anyway I took some requests and I've fixed a few minor bugs (start button not updating correctly), changed the dialog to be a Fiddler tab so you can use it non-modally, and
the WPAD server is now always off when Fiddler starts.
extension fiddler technical update wpad 2011 May 22, 10:38One step closer to completely deprecating the original URI spec by pulling out the ftp URI scheme specification into its own new updated spec!
uri url ftp uri-scheme ietf rfc reference technical 2010 Sep 8, 2:16'Following a news update on the depopulation of honeybees across North America and much of the world, it suddenly dawned on local bank teller Keith Orlander Tuesday that he, personally, was
responsible for the dramatic and theretofore unexplained disappearance of the insects. "Boy, come to think of it, I guess I have been killing millions of bees lately,"'
bee bees humor onion 2010 May 14, 8:52It really is an actual quote from the Sacramento Credit Union's website: "The answers to your Security Questions are case sensitive and cannot contain special characters like an apostrophe, or the
words “insert,” “delete,” “drop,” “update,” “null,” or “select.”"
Out of context that seems hilarious, but if you read the doc the next Q/A twists it like a defense in depth rather than a 'there-I-fixed-it'.
technical security humor sql 2010 May 6, 5:48New IDN TLDs are up. Try out http://xn----rmckbbajlc6dj7bxne2c.xn--wgbh1c/ (aka http://وزارة-الأتصالات.مصر/) in your favorite IDN implementing browser.
idn tld dns icann technical web language 2010 Apr 21, 6:53"Lindsey Simon has got a powerful update to BrowserScope, the community-driven tool to test and profile browsers. The new feature is exciting as it truly delivers the “community-driven” piece at
scale: you can now add your own tests to the corpus, TestSwarm style."
web browser test google browser-scope internet technical 2010 Apr 21, 6:51Adds SHA 256 & 512 to HTTP instance digest: 'The IANA registry named "Hypertext Transfer Protocol (HTTP) Digest Algorithm Values" defines values for digest algorithms used by Instance Digests in
HTTP. Instance Digests in HTTP provide a digest, also known as a checksum or hash, of an entire representation of the current state of a resource. This document adds new values to the registry and
updates previous values.'
hash cryptography http instance-digest sha security technical ietf rfc standard 2010 Apr 4, 2:02
I've just updated Encode-O-Matic with a Guess Input Encoding feature. When you start Encode-O-Matic or when you use the 'Guess
Input Encoding' menu item from the 'Tools' menu, Encode-O-Matic will try out various combinations of encodings and guess at which set seem to apply to your input. For instance given the following
text, Encode-O-Matic will correctly guess that it is percent encoded, base64 encoded, deflate compressed text:
S%2BWqUEhLLMoFUulFpXnZQLogMa%2BkmCuPqxzILk%2FMyeHK4QIA
It should work fairly well for simple things but I did pick 'Guess' for the name of the feature to intentionally lower
expectations. It doesn't currently apply to character encodings but that may be something to consider in the future.
technical encodeomatic tool encoding 2010 Mar 21, 3:22Google Calendar Sync is an Outlook plugin that syncs your Google and Outlook calendars (you get to pick 1way and direction or 2way sync'ing). This almost looks like what I want but perhaps my feature
requests are too obscure for someone to have already implemented them:
Events marked personal added on my Outlook calendar should get full 2-way sync'ing with my Google calendar.
All other events added on my Outlook calendar should be assumed to have private company information and should get 1-way sync'ing with just the time and location - no attendees or subject or
desceiption.
All events added on my Google calendar should get full 2-way sync'ing with Outlook and there should be marked personal.
I doubt I'm going to find a pre-made app to do this so I guess I should get coding. Otoh, if they ever bring the updated Android OS that has Exchange support to my G1 maybe none of this would be
necessary...
google calendar outlook microsoft tool free technical 2010 Mar 11, 3:33"The headers and captions on http://diveintohtml5.org/ use an open source font called "Essays 1743." The creator of that font was looking for a tutorial on HTML5, came across my site, and was
pleasantly surprised to see his own work on prominent display. He now wants to update his font to include stylistically appropriate Unicode arrows, which I will then use with my captions.
The internet is awesome. It's so wonderfully intertwingled."
html html5 mark-pilgrim font technical 2010 Mar 9, 9:08
I've just put up an update for Encode-O-Matic with the following improvements:
- Hex editor: the output and input views can now be switched between a UTF8 textbox view and a hex editor view. This is built using the free Be.HexEditor.
- Compression: I've added the .NET GZip, deflate, and inflate streams to the list of supported encodings.
- Quick Show Output: There are now 'Show Output' radio buttons next to each encoding in the encoding stack. Clicking on them changes the output view to show the output from that encoding in the
stack. This lets you easily jump between different parts of your encoding process. Adding or removing an encoding to the stack resets the view.
- Minor visuals improvement: added app icon, changed buttons with one word symbols to command names.
technical encodeomatic project 2010 Jan 29, 3:54
Raymond Chen has some thought experiments useful for discovering various kinds of stupidity in software design:
Tim Berners-Lee's principles of Web design includes my favorite: Test of Independent Invention. This has a thought experiment containing the construction of the MMM (Multi-Media Mesh) with
MRIs (Media Resource Identifiers) and MMTP (Muli-Media Transport Protocol).
The Internet design principles (RFC 1958) includes the Robustness Principle: be strict when sending and tolerant when receiving. A good one, but applied too liberally can lead to interop issues. For instance, consider web browsers.
Imagine one browser becomes so popular that web devs create web pages and just test out their pages in this popular browser. They don't ensure their pages conform to standards and accidentally end
up depending on the manner in which this popular browser tolerantly accepts non-standard input. This non-standard behavior ends up as de facto standard and future updates to the standard
essentially has had decisions made for it.
technical design principles software development 2009 Nov 23, 12:38Update to SVG Web: "SVG Web is a JavaScript library which provides SVG support on many browsers, including Internet Explorer, Firefox, and Safari. Using the library plus native SVG support you can
instantly target close to 100% of the existing installed web base."
svg development web browser ie firefox safari javascript technical 2009 Jul 27, 5:29"A twice-daily updated collection of some of the best reading on Wikipedia."
wiki wikipedia daily reference blog via:ethan_t_hein 2009 Jul 19, 4:00
Inspired by one of Penn's (of Penn & Teller) articles in which he mentions he has his computer tell him
what he wrote in his journal that day the previous year, I've wanted to implement a similar thing with my blog. Now that, as I mentioned previously, I've updated my blog such that its much easier to implement search and such,
I've added date range filtering to my site's search. So now I can easily see what on Delicious and my blog I was doing last
year.
I've also otherwise updated search on this site. You can now quote terms to match an entire string, stick 'tag:' in front of a term to only match that term against tags as opposed to the title and
body of the entry as well, and you can stick '-' in front of a term to indicate that it must not be found in the entry.
blog search homepage 2009 Jul 19, 11:44
I've redone my blog's layout to remind myself how terrible CSS is -- err I mean to play
with the more advanced features of CSS 2.1 which are all now available in IE8. As part of the new layout I've included my Delicious links by default but at a smaller size and I've replaced the
navigation list options with Technical, Personal and Everything as I've heard from folks that that would actually be useful. Besides the layout I've also updated the back-end, switching from my
handmade PHP+XSLT+RSS/Atom monster to a slightly less horrible PHP+DB solution. As a result everything should be much much faster including search which, incidentally, is so much easier to
implement outside of XSLT.
blog database redisgn xslt mysql homepage 2009 May 27, 3:39A fancy tab completion script for Vim that does neat things for Java. Links to other Java+Vim tips as wel.
vim java script reference 2009 Apr 29, 12:34"In this presentation, recorded at QCon San Francisco 2008, HTTPbis WG chair Mark Nottingham gives an update on the current status of the HTTP protocol in the wild, and the ongoing work to clarify
the HTTP specification."
http httpbis protocol ietf reference video authentication cookie uri url tcp sctp mark-nottingham via:ericlaw