kowal - Dave's Blog

Search
My timeline on Mastodon

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

CommonJS, I Promise by Kris Kowal - JSConf.eu ☠ 2010

2010 Dec 14, 3:06"Join Kris for a pointed presentation on the state of CommonJS: what's done, what's being debated, and what needs to be done."PermalinkCommentsjavascript video commonjs technical kris-kowal

Distributed Extensibility - Dive Into HTML5

2010 May 4, 10:52On HTML5's extensibility: how does microdata work in HTML5?PermalinkCommentsvia:kris.kowal html5 html microformats semanticweb todo technical

Code Standards | Isobar

2010 May 2, 3:14"This document contains normative guidelines for web applications built by the Interface Development practice of Isobar North America (previously Molecular)." Glad to see coding styles and best practices for HTML, CSS, JS, associated HTTP headers etc etc etcPermalinkCommentscode css html html5 javascript web browser programming development technical via:kris.kowal

YouTube - The Lazy Programmer's Guide to Secure Computing

2010 Mar 23, 9:10Laziness is a virtue in programming esp. wrt. security. Marc Stiegler gives a talk at Google on the topic.PermalinkCommentsvia:kris.kowal programming security video google lazy

Revised Font Stack | A Way Back

2010 Feb 5, 8:00Font stats on Mac and PC respectively.PermalinkCommentsfont statistics html css web design typography via:kris.kowal

Making browsers faster: Resource Packages · Alexander Limi

2009 Nov 17, 6:52"What if there was a backwards compatible way to transfer all of the resources that are used on every single page in your site — CSS, JS, images, anything else — in a single HTTP request at the start of the first visit to the page? This is what Resource Package support in browsers will let you do." Another resource packaging implementation but this suggests they'll actually implement this in FireFox. One issue with all of these is you can't use the resources from the package in any context that didn't ask to use the package for fear of security issues which means you can't stick the packaged resources in your HTTP cache. The package itself could go in the cache which would mean multiple packages per page or all your page's resources in one package. Of course the same security issues are a concern for all of the packaging proposals if a site has any way to inject into the source the request for the package. It'd be a similar vector to the UTF7 XSS issues but much worse attack.PermalinkCommentssecurity web browser http zip firefox resource technical via:kris.kowal

The Answer Factory: Fast, Disposable, and Profitable as Hell | Magazine

2009 Oct 22, 12:33"When asked for the most valuable topic in Demand’s arsenal, he replies instantly: “‘Where can I donate a car in Dallas?’"PermalinkCommentsvia:kris.kowal wired internet video howto automation business media marketing economics advertising

Reduce Your Chances of Dying in a Plane Crash | Information Is Beautiful

2009 Sep 14, 4:52PermalinkCommentsvia:kris.kowal information visualization plane airplane flight statistics death travel humor

Timefire: On Reducing the Size of Compressed Javascript (by up to 20%)

2009 Sep 1, 4:39"...what effect does the large-scale structure of the JS output code have on the DEFLATE algorithm of GZIP which is used to serve up compressed script?" Another instance of using knowledge of the specific file type to get gains in compression. Is there a web proxy running all this at which I can point my phone?PermalinkCommentsvia:kris.kowal performance javascript gzip deflate compression web technical

CSS minifier and alphabetiser – Barryvan

2009 Sep 1, 4:36"I’ve written a small Java application that will read in a CSS file and output its contents to stdout or another file in a format that’s optimised for gzipping." Cool!PermalinkCommentsvia:kris.kowal technical compression css web performance gzip java

Holiday Havoc: THE VENTURE BROS. - Quick Stop Entertainment

2008 Dec 29, 2:28"Today, we've got an exclusive track featuring THE VENTURE BROS.' own Henchmen 21 & 24 singing a holiday classic..."PermalinkCommentshumor audio tv the-venture-bros christmas song via:kris.kowal

Wallace & Gromit - Forum - Latest News - A Matter of Loaf and Death Comes to BBC One This Christmas

2008 Nov 20, 11:01Woo! "I love making films for the cinema but the production of Chicken Run and Curse of the Were-Rabbit were virtually back to back and each film took five years to complete. A Matter of Loaf and Death will be so much quicker to make. I'm delighted to be back into production and back with BBC One with Wallace and Gromit. Over the years the BBC has been incredibly supportive of Wallace and Gromit, this film feels like their homecoming."PermalinkCommentswallace gromit wallace-grommit bbc animation clay claymation via:kris.kowal humor

Sonja Eddings Brown is Rather Unpleasant - The Rehabilitated Student

2008 Nov 16, 10:13"Imagine my mild surprise when I discovered that the woman who terrorized me in my final days in high school is the face of Proposition 8. Sonja Eddings Brown is everything you would expect a Proposition 8 supporter to be: someone with misplaced values and a knack for being a big bully. Yes, a middle-aged mother of three went out of her way to threaten to kick a high school senior out of her valedictory speaking position simply because the student refused to have (strange) words placed her mouth and to be used as a propagandistic advertising vehicle."PermalinkCommentspolitics education california sonja-eddings-brown high-school via:kris.kowal

[0810.5056] P is not equal to NP

2008 Oct 29, 10:22If this is true Charles Stross is going to have to rewrite a story or two.PermalinkCommentsvia:kris.kowal algorithm csc

Presidential Election 2008 FAQ

2008 Oct 13, 10:53"This is an FAQ (Frequently Asked Questions list) for the 2008 United States Presidential Election. I need to disclose up front that I am an Obama supporter. However, with the exception of the very last question, this FAQ is designed as a collection of factual information (such as the latest poll results) and of analysis that is as objective as possible."PermalinkCommentsvia:kris.kowal politics election obama mccain

Patenting reincarnation - Knowledge Jolt with Jack

2008 Aug 28, 10:58"The patent is really bad, which is all part of the fun: Abstract: The invention consists of the process of reincarnation or rebirth resulting in immortality. Description: [0001] This invention resulted from my combining Einstein's Theory of Relativity and Newton's Second Law of Physics. [0002] Reincarnation is defined in Webster's Third New Inernational Dictionary as "rebith". Thus my invention is a process of rebirth or in other words immortality."PermalinkCommentshumor patent via:kris.kowal reincarnation

Red/Brian - redemption!

2008 Aug 12, 11:02Prerinsing dishes for the dish washer is bad! "Remember when your mom would make you wash dishes before putting them in the dish washer? Remember how backwards that sounded, remember how you just didn't see the logic, but she made you do it anyway? We were right!"PermalinkCommentsvia:kris.kowal ecology water dishwasher dishes awesome

YouTube - Stars & Stripes FOREVER! (Muppets Variation)

2008 Jul 9, 10:11"I, Sam the Eagle, present a musical salute to America." Seems appropriate for Colbert Report.PermalinkCommentsvia:kris.kowal humor muppets video youtube parody

Links - MD5 Collisions, Visualised

2008 May 30, 10:48"I thought it would be interesting to visualise MD5's internal state for these two blocks."PermalinkCommentsvia:kris.kowal md5 security visualization blog
Older Entries Creative Commons License Some rights reserved.