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.
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." foodmicrosoftgamegunstringerhumortechnical
2011 Sep 28, 10:22They've got maps from your favorite NES games as giant images. I'm using SMB3 1-1 as my desktop background. I've got a four monitor setup now and so its tough to find desktop backgrounds but Mario
levels easily cover my whole desktop.gamevideogamemapnintendones
2011 Sep 19, 12:53Counter intuitive argument for not making the larger fix: "Should we fix them all preemptively, meaning the next time they block us it will be through some more complex mechanism that's harder to
figure out? Or should we leave things as they are, knowing there will be more blocking events but also knowing that we can solve them easily?"torcensorshipgovernmentirantechnical
2011 Aug 6, 1:53Description of the inner workings of both of Window's TLS options, the Win32 APIs like TlsAlloc as well as __declspec(thread). I didn't know that the max number of TLS indices is now 1088.blogprogrammingdevelopmentwindowsdebugtlsthread-local-storage
2011 Jul 27, 10:33The write-progress command in powershell allows scripts to express their progress in terms of percent or time left and powershell displays this in a friendly manner at the top of my window.
Surprisingly, not hooked up to the Shell's TaskbarItemInfo's progress.technicalpowershellprogresscodingshell
2011 Jul 6, 7:28"Over this past Fourth Of July weekend, we neglected to note that it was the 15th anniversary of Roland Emmerich’s 1996 blockbuster Independence Day. New York comedian Sean Kleier remembered, and
decided to make his own tribute, going to various locations around New York City—Times Square, the Brooklyn Bridge, the subway, and inside a Victoria’s Secret—reciting Bill Pullman’s rousing speech
before the movie's final battle sequence, megaphone and all." humorvideobill-pullmanindependence-daynew-york
2011 Jul 1, 10:12" Historically, protocol designers and implementers distinguished
between "standard" and "non-standard" parameters by prefixing the
latter with the string "X-". On balance, this "X-" convention has
more costs than benefits, although it can be appropriate in certain
circumstances."prefixtechnicalstandradrfcuriurlx-
2011 Jun 21, 1:22"This document defines the concept of an "origin", which is often used
as the scope of authority or privilege by user agents. Typically,
user agents isolate content retrieved from different origins to
prevent malicious web site operators from interfering with the
operation of benign web sites. In addition to outlining the
principles that underly the origin concept, this document defines how
to determine the origin of a URI, how to serialize an origin into a
string, and an HTTP header, named "Origin", that indicates which
origins are associated with an HTTP request."ietfreferencetechnicalwebbrowseruser-agentwebbrowserorigin
2011 Jun 20, 2:25I knew it was a game but still felt bad war-dialing and otherwise messing around in there. What if I accidentally find a way out? "Telehack is the most interesting game I've played in the last
year... a game that most users won't realize is a game at all. It's a tour de force hack — an interactive pastiche of 1980s computer history, tying together public archives of Usenet newsgroups, BBS
textfiles, software archives, and historical computer networks into a multiplayer adventure game." Also, see all the accounts of people finding their teenage selves in the game.internettechnicaldevelopmenthacktelnetwardialgame
2011 Jun 5, 4:56"What's an engineer's worst nightmare? To realize that the supports he designed for a skyscraper like Citicorp Center are flawed---and hurricane season is approaching."articlehistorydesignbusinessengineering
2011 May 30, 3:13"We covered the Newstweek, a wall-wart sized box that injects fake news stories over public WiFi connections last February, but now there’s a great walk through and it seems our doubts about this
project were disproved."securityjournalismwifihacktechnical
I wanted to ensure that my switch statement in my implementation of IInternetSecurityManager::ProcessURLAction had a case for every possible documented URLACTION. I wrote the following short
command line sequence to see the list of all URLACTIONs in the SDK header file not found in my source file:
grep URLACTION urlmon.idl | sed 's/.*\(URLACTION[a-zA-Z0-9_]*\).*/\1/g;' | sort | uniq > allURLACTIONs.txt grep URLACTION MySecurityManager.cpp | sed 's/.*\(URLACTION[a-zA-Z0-9_]*\).*/\1/g;' | sort | uniq > myURLACTIONs.txt comm -23 allURLACTIONs.txt myURLACTIONs.txt
In
the PowerShell version I can skip the temporary files which is nice. 'diff' is mapped to 'compare-object' which seems similar to comm but with no parameters to filter out the different streams
(although this could be done more verbosely with the ?{ } filter syntax). In PowerShell uniq functionality is built into sort. The builtin -cmatch operator (c is for case sensitive) to do regexp is
nice plus the side effect of generating the $matches variable with the regexp results.
I'm trying to learn and use PowerShell more, but plenty of other folks I know don't use PowerShell. To allow them to use my scripts I use the following cmd.exe batch file to make it easy to call
PowerShell scripts. To use, just name the batch file name the same as the corresponding PowerShell script filename and put it in the same directory.
@echo off if "%1"=="/?" goto help if "%1"=="/h" goto help if "%1"=="-?" goto help if "%1"=="-h" goto help
%systemroot%\system32\windowspowershell\v1.0\powershell.exe -ExecutionPolicy RemoteSigned -Command . %~dpn0.ps1 %* goto end
:help %systemroot%\system32\windowspowershell\v1.0\powershell.exe -ExecutionPolicy RemoteSigned -Command help %~dpn0.ps1 -full goto end
:end
Additionally for PowerShell scripts that modify the current working directory I use the following batch file:
@echo off if "%1"=="/?" goto help if "%1"=="/h" goto help if "%1"=="-?" goto help if "%1"=="-h" goto help