Search Results

I’m running for LLS – Help us save lives

It’s way too late to back out now. I’ve already sent the first fundraising email (some of you may have received it, and some may even have already donated – thanks!) and I’m fully committed. Committed to what? To running my first half-marathon – the Avenue of the Giants on May 6 – as part [...]

It’s way too late to back out now. I’ve already sent the first fundraising email (some of you may have received it, and some may even have already donated – thanks!) and I’m fully committed.

Committed to what? To running my first half-marathon – the Avenue of the Giants on May 6 – as part of Leukemia & Lymphoma Society’s Team in Training program. Team in Training helps me train for my race and in return I am fundraising for LLS.

I hope to have as many of you as possible virtually cheering me on, and I’m asking you to help by making a donation to my fundraising campaign.

Please visit my Team in Training page to donate online quickly and securely plus learn more about my progress. You will receive a confirmation of your donation by email and I will be notified as soon as you make your donation. You can also see my progress in the handy widget on the right side of this page.

Each donation helps accelerate finding a cure for leukemia, lymphoma and myeloma. Nearly 958,000 Americans are battling these blood cancers. I am hoping that my participation in Team In Training will help bring them hope and support.

On behalf of The Leukemia & Lymphoma Society, thank you very much for your support. I greatly appreciate your generosity.

I’ll post updates here as my training and fundraising progress and as I get closer to the actual race. And of course, I’ll post race-day photos.

Thanks again.

Leave a Comment

GoSmalla: Just something I’m starting to think about

I can’t bear the webOS Gowalla app anymore. It’s big, bloated, slow and kills the Pre battery. And Gowalla has now said (on their support forums) that they’ve abandoned the webOS platform. I like Gowalla and I would like to continue using it, so I’m working on my first webOS app: a Gowalla client (using [...]

I can’t bear the webOS Gowalla app anymore. It’s big, bloated, slow and kills the Pre battery. And Gowalla has now said (on their support forums) that they’ve abandoned the webOS platform. I like Gowalla and I would like to continue using it, so I’m working on my first webOS app: a Gowalla client (using their public API) stripped down to its essentials. You’ll be able to log in, get a list of nearby spots and check in. That’s it. Oh, and I plan to add one feature that even the official app doesn’t support: saved or delayed checkins, for when you have GPS but no EVDO.

I’m calling my app GoSmalla. You may groan now.

This is not a true formal UML diagram; it’s really just the sketch of what I have in my head. Various lines don’t connect, but if you look at it as a rough flowchart you’ll see where I’m going with this.

GoSmalla: A conceptual sketch

GoSmalla: A conceptual sketch (click to embiggen)

Comments off

Please donate via your California state tax return to help endangered sea otters

We've donated $50 to the sea otter fund each year since it was added to the California state tax return. Please consider making a donation, however small. Everything helps. From the Monterey Bay Aquarium… > March 9, 2010>> Sea otters are remarkable animals but their struggling population > needs our help.>> Won't you please join [...]

We've donated $50 to the sea otter fund each year since it was added
to the California state tax return. Please consider making a donation,
however small. Everything helps.

From the Monterey Bay Aquarium…

> March 9, 2010
>
> Sea otters are remarkable animals but their struggling population
> needs our help.
>
> Won't you please join me in making a contribution to help sea otters
> when you file your California state income tax form this year?
>
> You need only watch Kit, our three-month old pup and newest addition
> to our sea otter exhibit, to feel inspired to protect the oceans and
> ocean wildlife.
>
> We will never know how Kit became separated from her mother, but we
> do know that females of prime breeding age are dying in record
> numbers. That's why the California Sea Otter Fund is so important–
> it supports critical research needed to help these animals survive.
>
> Your contribution is urgently needed. Last year, the fund fell
> $13,000 short of the $250,000 minimum target. We must meet the
> minimum this year to keep it on the tax form.
>
> Please take action for sea otters when you file your income taxes
> this year.
>
> In 25 years of helping sick and stranded sea otters, we've learned a
> lot but there is much more to do. Please also consider making a tax-
> deductible donation to the Aquarium to support our work on behalf of
> California's sea otters and advance our mission to inspire
> conservation of the oceans.
>
> Thank you,
>
> Julie Packard
> Executive Director
> Monterey Bay Aquarium
>
>
> *****************************************************************
>
> Did You Know?
> Four years ago, a young boy visiting our sea otter exhibit learned
> about the threats facing sea otters and felt compelled to do
> something. He enlisted help from his dad, who happened to be
> California Assembly member Dave Jones. Jones co-authored a bill that
> allowed people to make a voluntary contribution to sea otter
> research when they file their state income taxes, and the California
> Sea Otter Fund was created.
>
> *****************************************************************
>
> The Monterey Bay Aquarium is a non-profit institution. Our mission
> is to inspire conservation of the oceans.
>
> View our Privacy Policy:
> http://www.montereybayaquarium.org/sg/sg_policies.asp
>
> We welcome your thoughts and comments.
> (Send your e-mail to: aquarium@mbayaq.org.)
>
>
>
> Monterey Bay Aquarium | 886 Cannery Row | Monterey, CA 93940 | US

Comments (1)

Block comments on SFGate.com

The “comments” section under every SFGate.com article is a cesspool (I’m not the first person to say this but I can’t immediately find where it was said first) filled with hate, bigotry, trolling and various evil. Sure, you don’t -have- to click through to the comments but SFGate helpfully shows the three highest-rated comments below [...]

The “comments” section under every SFGate.com article is a cesspool (I’m not the first person to say this but I can’t immediately find where it was said first) filled with hate, bigotry, trolling and various evil. Sure, you don’t -have- to click through to the comments but SFGate helpfully shows the three highest-rated comments below each article–and the worst, and most prolific, commenters have hacking scripts that artificially inflate their comments’ ratings. Here’s another view on SFGate’s comment section: link.

Feeling that “out of sight, out of mind” is a good policy, my first UserScript hides several DIVs associated with comments on SFGate article pages. Here’s the source:

// ==UserScript==// @name SFGate-NoComments// @namespace http://www.userscripts.org// @description Hide comments on SFGate.com articles// @version 0.2// @include http://www.sfgate.com/*// @copyright 2010+, Andrew Rich (http://www.project-insomnia.com)// @license (CC) Attribution Non-Commercial Share Alike; http://creativecommons.org/licenses/by-nc-sa/3.0/// ==/UserScript==

var commentsDiv = document.getElementById('commentspage');commentsDiv.style.display = 'none';var commentslinksSpan = document.getElementById('commentslinks');commentslinksSpan.style.display = 'none';var commentBoxWrapperDiv = document.getElementById('articlePageCommentBoxWrapper');commentBoxWrapperDiv.style.display = 'none';var recCommentsDiv = document.getElementById('sfgate_recommended_comments');recCommentsDiv.style.display = 'none';var commentsListDiv = document.getElementById('commentslist');commentsListDiv.style.display = 'none';var commentsContainerDivAttrs = document.getElementById('Comments_Container_viewall').attributes;commentsContainerDivAttrs.getNamedItem('class').value = '';var commentsContainerDiv = document.getElementById('Comments_Container_viewall');commentsContainerDiv.style.visibility = 'hidden';

I hope this is useful to you and thank you for reading. You can install it easily from the UserScripts.org link above. Tested in Safari 4.0.4 (5531.21.10) with GreaseKit 1.7 on Mac OS X 10.5.8 Build 9L30. Should work in other UserScript-supporting browsers (Firefox, Opera, Chrome “Dev Channel”) without issue.

Comments off

Windows shell extension to easily add any folder to the PATH

How many times has this happened to you? You’ve downloaded a new Windows command-line tool and want to be able to use it from wherever your current directory happens to be, but the only way to add a folder to Windows’ system PATH is via an unwieldy and hard-to-find modal dialog in the System Properties’ [...]

How many times has this happened to you? You’ve downloaded a new Windows command-line tool and want to be able to use it from wherever your current directory happens to be, but the only way to add a folder to Windows’ system PATH is via an unwieldy and hard-to-find modal dialog in the System Properties’ Advanced tab. Well, I had just this problem last week when I was configuring some new machines and wanted to add some of my favorite command-line tools (mostly ports of Linux/Unix tools like which and less). I was about to go through System Properties to add their directory but figured there had to be a better way.

After a few minutes of Googling, I found this post by “/\/\o\/\/” which demonstrated a way of using Windows PowerShell (the next generation advanced command-line environment for Windows) to add a shell extension, used by right-clicking on any Explorer folder, which adds the selected folder to the system PATH.

Unfortunately, the code shown in the post didn’t quite work as-is and besides I’m not too comfortable yet in PowerShell. So I decided to fix the code and build a script that does the same thing but from CMD (or by double-clicking). It’s very simple to use; just execute the script from a CMD session or double-click it in Explorer. To uninstall, just run it again; it automatically backs out its changes when run a second time.

License and acknowledgement: The original (though non-working) code sample is by “/\/\o\/\/” and linked above; I claim no credit for it. However, I made it work and packaged it into a user-friendly script and so claim copyright over that portion under the GPL.

With that out of the way, here’s the code:


::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: AddToPath.cmd ::
:: Written by Andrew Rich (andrew.rich@project-insomnia.com) ::
:: Copyright (c) Andrew Rich under GPL (http://gnu.org/licenses/gpl.html) ::
:: Based on code by "/\/\o\/\/" at http://bit.ly/58hYYh ::
:: ::
:: This command script adds an Explorer shell extension which, when ::
:: selected on right-clicking a folder, will add it to the system PATH. The ::
:: change takes effect immediately for new CMD or PowerShell instances ::
:: started after adding the folder to the PATH. CMD or PowerShell instances ::
:: started adding the folder will continue to use the PATH in effect at the ::
:: time they were started. ::
:: ::
:: Usage: ::
:: Double-click AddToPath.cmd or execute AddToPath.cmd from a CMD session. ::
:: The only command-line parameter available is /? which shows this text. ::
:: ::
:: Requirements: ::
:: - Windows XP SP3 or later. Not tested on Vista or Windows 7 BUT should ::
:: work unaltered. Please send feedback if you run AddToPath on Vista or ::
:: Windows 7. ::
:: - The user executing the command script must be a local Administrator. ::
:: However, the PATH update will affect all users. ::
:: - reg.exe must be on the system PATH. This should be the case for any ::
:: properly functioning Windows machine. ::
:: - Microsoft PowerShell must be properly installed. This should be the ::
:: case for any Windows machine which is current on Windows updates. The ::
:: command script will verify that PowerShell is installed. If the script ::
:: reports that PowerShell is not installed, download and install it from ::
:: http://bit.ly/mYzg4. ::
:: ::
:: Uninstall/remove: ::
:: Just run AddToPath.cmd again. If the "Add To Path" shell extension ::
:: installed by AddToPath.cmd exists, running the command script a second ::
:: time will cause the shell extension to be removed. ::
:: ::
:: Manual uninstall: ::
:: From a CMD session, type: ::
:: ::
:: reg delete HKCR\Folder\Shell\Add_To_Path ::
:: ::
:: Note that uninstalling only removes the Explorer shell extension, and ::
:: does not affect any system PATH entries which may have been added. ::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::ENDHEADERCOMMENT

@Echo Off
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION

:: setup
SET ShellExtKey=HKCR\Folder\Shell\Add_To_Path
SET ShellExtKeyText="Add to Path"
SET PSPathKey=HKLM\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell

:: check command params
IF [%1]==[] GOTO CmdParamsDone
IF /I %1 EQU --help GOTO ShowHelp
IF /I %1 EQU /? GOTO ShowHelp
IF /I %1 EQU -? GOTO ShowHelp
GOTO ErrBadParam

:ShowHelp
ECHO.
FOR /F "delims=" %%A IN (%~fs0) DO (
IF /I %%A EQU ::ENDHEADERCOMMENT GOTO :EOF
ECHO %%A
)
PAUSE
GOTO :EOF

:ErrBadParam
ECHO.
ECHO "%1" is not a recognized command-line parameter for %0.
ECHO Type %0 /? for help.
ECHO.
PAUSE
GOTO :EOF

:CmdParamsDone
:: check overall prerequisite: reg.exe must be on the system PATH
reg 2>>NUL 1>>&2
IF NOT [%ERRORLEVEL%]==[0] GOTO ErrNoRegExe

:: is the Add_To_Path shell extension already installed?
:: if the reg query fails (errorlevel=1) then it's not installed
reg query %ShellExtKey% 2>>NUL 1>>&2
IF [%ERRORLEVEL%]==[1] GOTO Install
GOTO UnInstall

:Install
:: check install prerequisite: PowerShell must be installed
:: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell should contain the full path to powershell.exe
:: e.g. C:\WINNT\system32\WindowsPowerShell\v1.0\powershell.exe
FOR /F "usebackq tokens=3" %%a IN (`reg query %PSPathKey% /v Path ^| FIND "powershell.exe"`) DO SET PSPATH=%%a
IF NOT DEFINED PSPATH GOTO :ErrNoPowerShell
IF [%PSPATH%] EQU [] GOTO :ErrNoPowerShell

:: build the shell extension's command line
:: does powershell.exe's full path include spaces? if so, add quotes
FOR /F "tokens=2" %%a IN ("%PSPATH%") DO SET s=%%a
IF DEFINED s (
SET AddToPathCmd="%PSPATH%"
) ELSE (
SET AddToPathCmd=%PSPATH%
)
SET AddToPathCmd=%AddToPathCmd% -NonInteractive -NoProfile -Command [system.environment]::setEnvironmentVariable('path',$env:path + ';%%1','machine')

:: create the shell extension's base key under Folder\Shell />reg add %ShellExtKey% /ve /d %ShellExtKeyText% /f 2>>NUL 1>>&2
IF NOT [%ERRORLEVEL%] EQU [0] GOTO ErrRegAdd1

:: add the command line
reg add %ShellExtKey%\Command /ve /d "%AddToPathCmd%" /f 2>>NUL 1>>&2
IF NOT [%ERRORLEVEL%] EQU [0] GOTO ErrRegAdd2

ECHO Installed. Right-click on a folder in Explorer to add it to the system PATH.
PAUSE
GOTO :EOF

:UnInstall
reg delete %ShellExtKey% /f 2>>NUL 1>>&2
IF NOT [%ERRORLEVEL%] EQU [0] GOTO ErrRegDel
ECHO UnInstalled.
PAUSE
GOTO :EOF

:ErrNoRegExe
ECHO Error: reg.exe was not found on the system PATH.
PAUSE
GOTO :EOF

:ErrNoPowerShell
ECHO Error: Windows PowerShell is not installed (or is not installed correctly).
ECHO Go to http://bit.ly/mYzg4 to download and install Windows PowerShell.
PAUSE
GOTO :EOF

:ErrRegAdd1
ECHO Error creating the shell extension's base key.
ECHO Run %0 again to back out any changes.
PAUSE
GOTO :EOF

:ErrRegAdd2
ECHO Error adding the shell extension's command line.
ECHO Run %0 again to back out any changes.
PAUSE
GOTO :EOF

:ErrRegDel
ECHO Error removing the shell extension's registry entry.
ECHO To remove manually, type the following at the CMD prompt:
ECHO reg delete HKCR\Folder\Shell\Add_To_Path
PAUSE
GOTO :EOF

You can copy, paste and save that as AddToPath.cmd, or just download it (I recommend downloading it because line wrapping doesn’t show properly here). AddToPath.cmd.zip

I hope this is useful. Please send me feedback if you use it!

Comments off