version page 2 - Dave's Blog

Search
My timeline on Mastodon

Blackmail DRM - Stolen Thoughts

2012 Feb 13, 4:00

Most existing DRM attempts to only allow the user to access the DRM'ed content with particular applications or with particular credentials so that if the file is shared it won't be useful to others. A better solution is to encode any of the user's horrible secrets into unique versions of the DRM'ed content so that the user won't want to share it. Entangle the users and the content provider's secrets together in one document and accordingly their interests. I call this Blackmail DRM. For an implementation it is important to point out that the user's horrible secret doesn't need to be verified as accurate, but merely verified as believable.

Apparently I need to get these blog posts written faster because only recently I read about Social DRM which is a light weight version of my idea but with a misleading name. Instead of horrible secrets, they say they'll use personal information like the user's name in the DRM'ed content. More of my thoughts stolen and before I even had a chance to think of it first!

PermalinkCommentsdrm blackmail blackmail-drm technical humor social-drm

JavaScript Array methods in the latest browsers

2011 Dec 3, 6:46

Cool and (relatively) new methods on the JavaScript Array object are here in the most recent versions of your favorite browser! More about them on ECMAScript5, MSDN, the IE blog, or Mozilla's documentation. Here's the list that's got me excited:

some & every
Does your callback function return true for any (some) or all (every) of the array's elements?
filter
Filters out elements for which your callback function returns false (in a new copy of the Array).
map
Each element is replaced with the result of it run through your callback function (in a new copy of the Array).
reduce & reduceRight
Your callback is called on each element in the array in sequence (from start to finish in reduce and from finish to start in reduceRight) with the result of the previous callback call passed to the next. Reduce your array to a single value aggregated in any manner you like via your callback function.
forEach
Simply calls your callback passing in each element of your array in turn. I have vague performance concerns as compared to using a normal for loop.
indexOf & lastIndexOf
Finds the first or last (respectively) element in the array that matches the provided value via strict equality operator and returns the index of that element or -1 if there is no such element. Surprisingly, no custom comparison callback method mechanism is provided.
PermalinkCommentsjavascript array technical programming

Bug Spotting: Ctors with default parameters

2011 Dec 1, 4:59

The following code compiled just fine but did not at all act in the manner I expected:

BOOL CheckForThing(__in CObj *pObj, __in IFigMgr* pFigMgr, __in_opt LPCWSTR url)
{
BOOL fCheck = FALSE;
if (SubCheck(pObj))
{
...
I’m calling SubCheck which looks like:
bool SubCheck(const CObj& obj);

Did you spot the bug? As you can see I should be passing in *pObj not pObj since the method takes a const CObj& not a CObj*. But then why does it compile?

It works because CObj has a constructor with all but one param with default values and CObj is derived from IUnknown:

CObj(__in_opt IUnknown * pUnkOuter, __in_opt LPCWSTR pszUrl = NULL);
Accordingly C++ uses this constructor as an implicit conversion operator. So instead of passing in my CObj, I end up creating a new CObj on the stack passing in the CObj I wanted as the outer object which has a number of issues.

The lesson is unless you really want this behavior, don't make constructors with all but 1 or 0 default parameters. If you need to do that consider using the 'explicit' keyword on the constructor.

More info about forcing single argument constructors to be explicit is available on stack overflow.

PermalinkCommentsc++ technical bug programming

“The Big Head by San Francisco artist Dan Rosenfeld is an...

2011 Nov 15, 11:54


The Big Head by San Francisco artist Dan Rosenfeld is an oversize video conferencing helmet that displays an enlarged version of the wearer’s face on a 24″ monitor at the front of the helmet. Rosenfeld debuted the helmet at this year’s Halloween” (via The Big Head, A Giant Videoconferencing Helmet by Dan Rosenfeld)

PermalinkCommentshumor halloween big-head video

The Canonical Link Relation

2011 Jul 1, 10:15"This specification defines the canonical link relation -- an element which designates the preferred version of content/URI from a set of duplicate or near duplicate pages."PermalinkCommentslink uri url html rel technical standard rfc canonical

Three arguments against the singularity - Charlie's Diary

2011 Jul 1, 10:09"I periodically get email from folks who, having read "Accelerando", assume I am some kind of fire-breathing extropian zealot who believes in the imminence of the singularity, the uploading of the libertarians, and the rapture of the nerds. I find this mildly distressing, and so I think it's time to set the record straight and say what I really think. Short version: Santa Claus doesn't exist."PermalinkCommentsscifi singularity charles-stross future fiction

Command line for finding missing URLACTIONs

2011 May 28, 11:00

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
I'm not a sed expert so I had to read the sed documentation, and I heard about comm from Kris Kowal's blog which happilly was in the Win32 GNU tools pack I already run.

But in my effort to learn and use PowerShell I found the following similar command line:

diff 
(more urlmon.idl | %{ if ($_ -cmatch "URLACTION[a-zA-Z0-9_]*") { $matches[0] } } | sort -uniq)
(more MySecurityManager.cpp | %{ if ($_ -cmatch "URLACTION[a-zA-Z0-9_]*") { $matches[0] } } | sort -uniq)
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.
PermalinkCommentspowershell tool cli technical command line

HTTP framework for time-based access to resource states -- Memento

2011 Apr 30, 4:33"The HTTP-based Memento framework bridges the present and past Web by interlinking current resources with resources that encapsulate their past. It facilitates obtaining representations of prior states of a resource, available from archival resources in Web archives or version resources in content management systems, by leveraging the resource's URI and a preferred datetime. To this end, the framework introduces datetime negotiation (a variation on content negotiation), and new Relation Types for the HTTP Link header aimed at interlinking resources with their archival/version resources. It also introduces various discovery mechanisms that further support briding the present and past Web."PermalinkCommentstechnical rfc reference http header time memento archive

ILSpy - SharpDevelop Wiki

2011 Mar 28, 4:06"ILSpy is the open-source .NET assembly browser and decompiler. Development started after Red Gate announced that the free version of .NET Reflector would cease to exist by end of February 2011."PermalinkComments.net tools reflector c# development csharp dotnet technical tool

Favimon (beta version)

2010 Dec 16, 3:33Fight favicons pokemon style.PermalinkCommentshumor game web favicon pokemon technical via:waxy

YouTube Deal Turns Copyright Videos Into Revenue - NYTimes.com

2010 Sep 4, 7:40"In the past, Lions Gate, which owns the rights to the “Mad Men” clip, might have requested that TomR35’s version be taken down. But it has decided to leave clips like this up, and in return, YouTube runs ads with the video and splits the revenue with Lions Gate."PermalinkCommentsad advertising copyright economics google internet tv video youtube article

Millions of routers vulnerable to new version of old attack

2010 Jul 20, 6:45Hack based on DNS rebinding plus home router's web front end.PermalinkCommentssecurity technical web router dns dns-rebinding hack

Members Of The Supreme Court As Human Beings

2010 May 14, 9:37New York Times article from May 15th 1910 titled "MEMBERS OF THE SUPREME COURT AS HUMAN BEINGS: When Not on the Bench They Are Pretty Much Like Other People — Characteristic Stores About Them". This is the NYT 1910's version of US Weekly's current "Celebrities Are Just Like Us!" feature.PermalinkCommentshumor history article supreme-court

Ajaxian » Getting Users to Upgrade Their Browsers

2010 Apr 11, 3:53Has graphs of browser usage by version over time to show upgrade speed for Chrome, IE, and Firefox. Chrome has a lovely graph.
PermalinkCommentsgraph statistics infographics web browser chrome ie firefox version upgrade technical.

Palimpsest by Charles Stross

2010 Apr 6, 5:06"Palimpsest by Charles Stross, 2009. This version made available for 2010 Hugo Award voters by kind permission of the publishers."PermalinkCommentscharles-stross palimpset fiction scifi todo time-travel hugo-award

People's Republic of Interactive Fiction

2010 Apr 1, 2:42Its like a better version of what I was doing with my Web Frotz Interpreter. Its all client side javascript, HTML, & CSS to play Z-machine based interactive fiction games. They even do the saved game in a URL piece.PermalinkCommentsif interactive-fiction game web browser webapp

Everything you need to know about HTML5 video and audio - Opera Developer Community

2010 Mar 11, 3:39How to do audio & video in the latest version of OperaPermalinkCommentshtml5 html video audio opera web browser technical development reference

Leaving the IE Team for Windows

2010 Feb 26, 8:40

I'm making a switch from the IE team to the Windows team where I'll be working on the next version of Windows. As a going away surprise Jen and Nick added me to my gallery of Bill Gates (discussed previously). Here's a close up of the photoshopped cover.

Before:
Diveristy in Numbers
After:
Diversity Inc Photoshopped Covers

PermalinkCommentsmicrosoft bill gates photoshop windows

Wired Magazine Goes Digital - Video - Wired

2010 Feb 22, 4:25Wired's concept for a digital version of their magazine to run on tablets. Looks pretty but of course its running on Flash or somesuch Adobe product.PermalinkCommentsvideo wired web adobe magazine

We Love xkcd, Real Live Version of Animated Version of xkcd Loves the Discovery Channel

2010 Feb 21, 2:54Internet folk sing about their love of various nerdy things ala xkcd comic of similar namePermalinkCommentscory-doctorow wil-wheaton video xkcd humor music song internet meme
Older EntriesNewer Entries Creative Commons License Some rights reserved.