Wednesday, December 15, 2010

An old idea slowly becoming reality

Sunglasses that blot out just the sun:

"... each lens is an LCD that creates a dark box over the sun, blotting out the biggest source of glare and allowing the rest of the glasses to remain rather less tinted. ..."

I had a similar idea nearly 20 years ago for a car windshield/windows that would do the same thing, and prevent overly-bright oncoming headlights from blinding you. My imaginary version had a dial on the dashboard, so you could adjust the tint level, and it even had a lock-out feature so that law enforcement could disable it when approaching a stopped vehicle.

I knew this kind of device would eventually exist in some form, but never became involved in any way as a part of making it happen.

Ideas are worthless. Execution is everything.

Tuesday, December 14, 2010

Zend Framework Local Deployment Script

Here is a deployment script I wrote to install Zend Framework on my local development computer. I use Gnu/Linux, so converting this for use on Windows is, at least for the time being, left as an exercise to the reader. Use it, improve it, throw it away, ignore it. Whatever you do with it, enjoy!

#! /bin/sh
# deploy latest ZF to LOCAL development machine
# run using sudo (make executable with chmod u+x deploy-zf-latest-to-local.sh)

# TARFILE_LOCATION is where the ZF tarball you downloaded resides
# TARGET_LOCATION is where ZF is to be deployed (and is my PHP include_path)
# PHP_BIN_DIR is where zf command line tool is to be deployed
# A symlink in ~/bin like this is useful: zf -> /usr/local/bin/zf.sh
# See http://framework.zend.com/manual/en/zend.tool.framework.clitool.html

ZF_BASENAME=ZendFramework-1.11.1
TARFILE_LOCATION=/home/clark/deploy/archives
TARGET_LOCATION=/usr/share/php
PHP_BIN_DIR=/usr/local/bin

if test `whoami` != root
then
    echo Please run using \"sudo\".
    exit
fi

# extract ZF from tarball
cd ${TARFILE_LOCATION}
tar -xzf ${ZF_BASENAME}.tar.gz

# remove prior version of ZF from the system; put the current version in place
cd ${TARGET_LOCATION}
rm -rf Zend
cp -r ${TARFILE_LOCATION}/${ZF_BASENAME}/library/Zend .
cp ${TARFILE_LOCATION}/${ZF_BASENAME}/bin/zf.sh ${TARFILE_LOCATION}/${ZF_BASENAME}/bin/zf.php ${PHP_BIN_DIR}/

# autoloading is always used, so remove require_once statements for performance
find ${TARGET_LOCATION}/Zend -name '*.php' -not -name 'Application.php' -not -wholename '*/Loader/Autoloader.php' -print0 | xargs -0 sed --regexp-extended --in-place 's/(require_once)/\/\/ \1/g'

# set up autoloading for zf.php command line tool
sed --regexp-extended --in-place "s/^(if \(!getenv\('ZF_NO_MAIN)/require_once 'Zend\/Loader\/Autoloader\.php'\; Zend_Loader_Autoloader::getInstance\(\)\;\n\1/g" ${PHP_BIN_DIR}/zf.php

# set file permissions, clean up extraction area, indicate what version we're running
chown -R root:root ${TARGET_LOCATION}/Zend/
rm -rf ${TARFILE_LOCATION}/${ZF_BASENAME}
# next line should reference PHP_BIN_DIR instead of hardcoding the directory
php -r 'include "/usr/share/php/Zend/Version.php"; echo "Running Version " . Zend_Version::VERSION . "\n";'

Sunday, December 12, 2010

IndieConf, and an OOTNO

Almost a month ago, an eternity on the Intertubes, I attended IndieConf, the conference for independent web professionals, held in Raleigh, NC, organized by my friend Michael Kimsal, web developer, publisher, and "web radio dude" based in NC.  He pulled together a cast of experienced individuals, credible speakers from a broad range of disciplines, to speak on a variety of topics of vital importance to the independent/freelance software developer.

He provided a great experience to everyone, speakers and attendees alike, from the speakers' dinner on Friday evening, to the conference sessions, to the afterparty Saturday evening.  Wanting to give everyone a great experience, providing value through practical sessions - that's what makes him an OOTNO, One Of The Nice Ones*.

Whether you're already an independent web provider, or thinking about embracing the freelance "workstyle", don't be a NOOTNO (Not One Of The Nice Ones), and skip IndieConf next year.  Check it out.  Make some connections.  Learn some stuff.  Have some fun.


Guess its about time I filled out the conference survey form, and give him some happy feedback data...

*From an article in a 70's science fiction magazine, the name of which escapes me, else I'd give full credit to the author.

Saturday, December 11, 2010

Sometimes I Just Wanna READ

Instead of talking about PHP or software development, I'm going to rant about the prevalence of video for just a bit.  Video is great, except when I don't want video.  I was reading about the Google CR-48 Chrome OS Notebook, and followed a link to a description of Chrome features.

This is the Overview page, which briefly discusses Chrome's cloud-based, always-connected, instant web nature.  Great.  I click on the Speed link to read about that.

Oh. A video. Pressed for time, I'd rather quickly read a description than sit through a video, so I click on the Sync link to see what that's about.

Hmm. Another video. Connectivity? Video. Security? Video. Updates, Apps, Guided Tour? Argh - all videos.  No text.

I kind of expect to see video - or at least screenshots - on a page titled "Guided Tour," but what's wrong with good, old-fashioned text and images for the others, with a link to a video if I want to see one?  Surely the vids were scripted, so why can't I simply read some content drawn from those scripts?

I don't mind videos, really, especially when they communicate information more easily demonstrated than described.

The use of video over text content on the web seems to be increasing.  I guess videos are supposed to give us an "experience" intended to hold our interest longer than mere dull, dry words.  And we certainly are bombarded with text.  I see every day in my email inbox the misunderstandings resulting from people's skimming, rather than reading, that flood of written communication.

Is a viewer's comprehension and retention greater than a reader's? I don't know.

I appreciate the efforts people and organizations go through to produce high-quality videos.  I'd just like the option to choose whether to read or watch.

Hmm.  Blew my first blog post on a rant.  Oh, well: nowhere to go but up?