A pedant that hangs out in the dark corner-cases of the web.

Tuesday, October 02, 2012

The Ideal Wiki

  • A complete, powerful, standard wiki dialect with full HTML5 elements support.
  • Easy to modify wiki-wide CSS.
  • Good media management for uploading/pasting images and other media content.
  • Good table support, including simple native embedded CSV/TSV/PSV/SKV/LOG data, full CALS Table Model support, and numeric/monetary column detection and alignment, leveraging something like accounting.js.
  • Support for article tags (keyword metadata), and dynamically-built lists of articles with a given tag.
  • Built-in icons or symbols, like Font Awesome.
  • Built-in syntax highlighting (like highlight.js).
  • Integration with javascript graphing libraries, or text-description-driven diagramming tools, like:
  • Modularity for additional extensions and libraries.
  • Support for context expiration alerts and requests for review/moderation.
  • Full export and a programmable interface to search/read/add/modify/delete articles.

Wednesday, September 26, 2012

PowerShell: Get the SSL expiration date from a server

C:\> $req = [Net.HttpWebRequest]::Create('https://www.example.net/')
C:\> $req.GetResponse() |Out-Null
C:\> $req.ServicePoint.Certificate.GetExpirationDateString()
2/20/2014 04:00:00
C:\> 'www.example.org','www.example.com','www.example.net' |
>> % {$req = [Net.HttpWebRequest]::Create("https://$_/")
>> try{$req.GetResponse() |Out-Null}catch{}
>> "$($req.Address.Host): $($req.ServicePoint.Certificate.GetExpirationDateString())"}
>> 
www.example.org: 2/20/2014 04:00:00
www.example.com: 1/15/2014 04:00:00
www.example.net: 2/15/2014 16:44:57

Tuesday, May 08, 2012

Updated: Office macro to paste and format TSV text

Outlook (Word) macro to paste TSV text, convert it to a table, then format it using a new style each time.

Sub PasteFormattedTable()
    Dim doc As Word.Document
    Dim sel As Word.Selection
    Dim start As Integer
    Set doc = Application.ActiveInspector.WordEditor
    Set sel = doc.Windows(1).Selection
    start = sel.start
    sel.PasteSpecial Link:=False, DataType:=wdPasteText
    sel.start = start
    sel.ConvertToTable DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:=wdAutoFitContent
    styles = Array(-162, -208, -250, -222, -236, -176, -194)
    sel.Style = styles(doc.Tables.Count Mod (UBound(styles) + 1))
End Sub

See Getting Started with VBA in Outlook 2010 to get started.

For more style codes, see Create list of built-in style names.

Monday, May 07, 2012

Office macro to paste and format TSV text

Outlook (Word) macro to paste TSV text, convert it to a table, then format it.
Sub PasteBlackTable()
    Dim doc As Word.Document
    Dim sel As Word.Selection
    Dim start As Integer
    Set doc = Application.ActiveInspector.WordEditor
    Set sel = doc.Windows(1).Selection
    start = sel.start
    sel.PasteSpecial Link:=False, DataType:=wdPasteText
    sel.start = start
    sel.ConvertToTable DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:=wdAutoFitContent
    sel.Style = wdStyleTableMediumShading1 ' medium shading 1 (black) = -162
    'sel.Style = wdStyleTableMediumShading1Accent1 ' medium shading 1 accent 1 (blue) = -176
    'sel.Style = -194 ' medium shading 1 accent 3 (red)
    'sel.Style = -208 ' medium shading 1 accent 3 (green)
    'sel.Style = -222 ' medium shading 1 accent 4 (purple)
    'sel.Style = -236 ' medium shading 1 accent 5 (teal)
    'sel.Style = -250 ' medium shading 1 accent 6 (orange)
End Sub
See Getting Started with VBA in Outlook 2010 to get started.
For more style codes, see Create list of built-in style names.

Monday, March 26, 2012

What's in your path? A PowerShell one-liner

See all the executable items in your path.

ls ($env:path -split ';' |
% {$d=[Environment]::ExpandEnvironmentVariables($_)
$env:pathext -split ';' |
% {[IO.Path]::Combine($d,"*$_")}}) |ogv

Tuesday, January 24, 2012

Ice Cream Sandwich on the Nexus S Update

  • Bluetooth eventually crashes in ICS, irredeemably. Only a full reboot will produce sound via Bluetooth after this happens. This makes ICS the ideal platform for spending five minutes trying to get three minutes' worth of content to play.
  • The bookmarks widget, which displays the browser bookmarks as a scrolling list of icons, its easily the best new widget, making access to frequently visited sites much faster.
  • Notifications rarely seem to notify!
    Google Voice and Messaging (the texting app), in particular, are terrible about indicating something has happened, but notifications in general don't seem consistent about providing notification sounds or activating the screen.
  • No more search provider narrowing!
    In previous Android versions, you could tap the icon to the left of the system search field, and choose which Searchable Items to use: just Applications or Browser or Music or Twitter or whatever, instead of all of them, which is slower and often too crowded to show the item you wanted. This has completely ruined the "command-line" aspect of search for me.
  • Picasa integration is still completely broken for uploads!
    No albums are listed and trying to upload displays a "Failed to retreive account information" error. There are indications in some forums that this is a result of Picasa trying to use the wrong authentication account, but no adequate fix yet. This also highlights another problem: Who do you call for a fix, or where do you go to even to report a problem like this?
  • No unhide UI for contact providers.
    When trying to delete contact entries automatically created by the Twitter app for everyone I follow, the app informs me that they will only be hidden. After realizing that I can just hide the contacts from that provider, there's no way to restore those "hidden" contacts short of deleting the app's data and starting over.
  • Much better browser, still no extensions though.
    The stock Android browser seems much better, even though it offers no extensions, and isn't really a full Chrome implementation.
  • Sharing UI in the Gallery app is better.
    In previous versions of Gallery, the sharing menu was difficult to use once too many apps registered as sharing targets. The new version handles long lists of sharing targets easily, and even offers a very good MRU interface.
  • System settings are available from the notification tray.
    This makes turning WiFi off and on, among other things, much easier to do.
  • The Market is available in the corner of the app tray.
    This makes getting to the market easier.
  • Widgets are available as a tab in the app tray.
    This allows you to preview what widgets look like before adding them.
  • Scrollable widgets are handy, though most that I tried tend to crash.

In general, I'd say the experience was negative, and I'd recommend avoiding this upgrade until some of the problems are addressed.

Friday, January 13, 2012

Ice Cream Sandwich on Nexus S so far

  • Notifications rarely seem to notify!
    Google Voice, in particular, is terrible about indicating something has happened, but notifications in general don't seem consistent about providing notification sounds or activating the screen.
  • No more search provider narrowing!
    In previous Android versions, you could tap the icon to the left of the system search field, and choose which Searchable Items to use: just Applications or Browser or Music or Twitter or whatever, instead of all of them, which is slower and often too crowded to show the item you wanted. This has completely ruined the "command-line" aspect of search for me.
  • Picasa integration is broken for uploads!
    No albums are listed and trying to upload displays a "Failed to retreive account information" error. There are indications in some forums that this is a result of Picasa trying to use the wrong authentication account, but no adequate fix yet. This also highlights another problem: Who do you call for a fix, or where do you go to even to report a problem like this?
  • No unhide UI for contact providers.
    When trying to delete contact entries automatically created by the Twitter app for everyone I follow, the app informs me that they will only be hidden. After realizing that I can just hide the contacts from that provider, there's no way to restore those "hidden" contacts short of deleting the app's data and starting over.
  • Much better browser, still no extensions though.
    The stock Android browser seems much better, even though it offers no extensions, and isn't really a full Chrome implementation.
  • Sharing UI in the Gallery app is better.
    In previous versions of Gallery, the sharing menu was difficult to use once too many apps registered as sharing targets. The new version handles long lists of sharing targets easily, and even offers a very good MRU interface.
  • System settings are available from the notification tray.
    This makes turning WiFi off and on, among other things, much easier to do.
  • The Market is available in the corner of the app tray.
    This makes getting to the market easier.
  • Widgets are available as a tab in the app tray.
    This allows you to preview what widgets look like before adding them.
  • Scrollable widgets are handy.

In general, I'd say the experience was negative, and I'd recommend avoiding this upgrade until some of the problems are addressed.

Friday, January 06, 2012

Some quick thoughts prompted by SOPA/PIPA

Neither side has agreed on the first principals, and both are trying to control the framing of the discussion.

For example, starting by dismissing those that do not agree there is a legitimate “intellectual property” (artificial scarcity) issue in the first place.

Personally, I don’t think there’s any possibility of compromise on the atomic issue of whether to regulate speech. Enforcing personal, not-for-profit copyright infringement will always conflict with freedom of speech. We’ve seen it in Russia silencing dissidents under the cover of piracy raids, and we’ve seen enemies and competitors trying to put each other on child porn filter lists for spite or market advantage in Scandinavia, and we’ve seen it with Universal vs. Megaupload here. Once the infrastructure is built, for whatever noble reasons, it will invariably be abused.

(I come from a time when copyright was a civil matter between companies, and comedians made fun of the FBI warnings at the beginning of video tapes.)

And, really, does a busker chasing down each and every sidewalk pedestrian make sense anyway? Artists will eventually adjust to the fact that they are buskers again. It seems to have worked for Cory Doctorow, Jonathan Coulton, and Louis CK.

Thursday, January 05, 2012

PowerShell Wait-DirectoryChange FileSystemWatcher function

Here's a handy way to watch for changes in a directory using the FileSystemWatcher in PowerShell.

function Wait-DirectoryChange
{
<#
.Synopsis
Listens to the file system change notifications and raises events when a directory, or file in a directory, changes.
.Parameter Directory
The directory to monitor, in standard or Universal Naming Convention (UNC) notation. Default is current directory.
.Parameter ChangeType
The type of change to watch for: Created, Deleted, Changed, Renamed, or All. Default is All.
.Parameter Include
The type of files to watch. For example, "*.txt" watches for changes to all text files. Default is all files.
.Parameter Timeout
The time to wait before timing out. Default is forever.
#>
[CmdletBinding()] Param
(
[string][ValidateScript({Test-Path $_ -PathType Container})] $Directory = $PWD.ProviderPath,
[IO.WatcherChangeTypes] $ChangeType = 'All',
[string] $Include,
[TimeSpan] $Timeout = 0
)
$watcher =
if($Include) { New-Object IO.FileSystemWatcher $Directory,$Include }
else { New-Object IO.FileSystemWatcher $Directory }
if($Timeout.TotalMilliseconds) { $watcher.WaitForChanged( $ChangeType, $Timeout.TotalMilliseconds ) }
else { $watcher.WaitForChanged( $ChangeType ) }
}
nal wdir Wait-DirectoryChange