Archive for February, 2006

Golf begins at 50 (degrees)

Today was the first Saturday with temperatures at 50 degrees. It’s hard to live on a golf course and not let go a little bit. By sunset there was enough grass just off the patio to knock a few across the pond with the 6 iron.


(See the video clip)

You’ll just have to wonder what the diminishing snowman was saying about it all.

Comment on this article

DHTML Menu: Friendly to No-Script Browsers

Earlier I described in my design objectives for a new website, http://www.whitebarncondo.com. This article describes the menu system used for that site.

My objective was to use a DHTML mouse-over menu to aid navigation and site layout, but to preserve good functionality for browsers which do not support Javascript or have Javascript turned off.

Here’s the demo:

If you view this demo with Javascript disabled, your experience will be much different, but very appropriate.

The demo above is also available here: http://www.duanemcguire.com/blog/menudemo/

The Javascript library I used for this implementation is from BrainJar. I made one modification the the brainjar.js library they present in their demo3 . The modification I made allows for the use of <UL> instead of <DIV> for menu containers.
Discussion
The menu is implemented using CSS, Javascript (when detected), and ColdFusion. Though ColdFusion is used in these examples, any server-side technology could be used. And in fact no server-side technology is required, but as you will see, the server-side coding creates attractive code, which leads to easy maintenance.

The core code is contained in menu.cfm:

<cfparam name="url.area" default="home">
<cfscript>
	// Server side function modifies the
	// class name of the current tab.
	// In this demo, modification is based on url of request.
	function activeTab(vArea){
		// this logic is for demo only
		// should be changed to suit the site architecture.
		if (url.area eq vArea){
			return "Current";
		}else{
			return "";
		}
	}
</cfscript>
<!--- Main Menu Bar --->
<cfoutput>
<!---
	The class of each "a tag" below is modified by the
	value of the function activeTab(area) below.
	The activeTab function returns either 'Current' or ''.
	Thus the "a tag" class is either menuButton or menuButtonCurrent
--->
<div class="menuBar" >
	<a class="menuButton#activetab('home')#"
    href="index.cfm"
>Home</a
><a class="menuButton#activetab('document')#"
    href="noscriptMenu.cfm?menu=documentMenu&area=document"
    onclick="return buttonClick(event, 'documentMenu');"
    onmouseover="buttonMouseover(event, 'documentMenu');"
>Documents</a
><a class="menuButton#activetab('community')#"
    href="noscriptMenu.cfm?menu=communityMenu&area=community"
    onclick="return buttonClick(event, 'communityMenu');"
    onmouseover="buttonMouseover(event, 'communityMenu');"
>Community</a
><a class="menuButton#activetab('contact')#"
    href="index.cfm?page=contactUs/contactUs.cfm&area=contact"
>Contact&nbsp;Us</a
></div>
</cfoutput>
<!---
Rather than putting out the dhtml menu directly, write it out with
client side script.  In that way, alternate browsers which may have
JS disabled will not see the divs at all.  We have also decluttered the
screens of these browsers if they also do not recognize CSS. We could
do this without coldfusion processing, but by stripping out CR and
TAB and escaping JS code, the menus:  documentMenu.cfm,
communityMenu.cfm, etc. are highly readable.
--->
<cfsavecontent variable="dhtmlMenu">
	<cfinclude template="documentMenu.cfm">
	<cfinclude template="communityMenu.cfm">
	<cfinclude template="communityMenuNewsletters.cfm">
</cfsavecontent>
<cfset dhtmlMenu = replace(dhtmlMenu,chr(10),"","all")>
<cfset dhtmlMenu = replace(dhtmlMenu,chr(13),"","all")>
<cfset dhtmlMenu = replace(dhtmlMenu,chr(9),"","all")>

<script language="Javascript">
	document.write('<cfoutput>#jsstringformat(dhtmlMenu)#</cfoutput>');
</script>

One of the menu <UL>’s, documentMenu.cfm, is shown here:

<!--- Document Menu --->
<ul id="documentMenu" class="menu"
     onmouseover="menuMouseover(event)">

	<li><a class="menuItem" href="index.cfm?page=content/documents/white_barn_PRUD_CCRs.pdf&area=document">Covenants and Restrictions</a></li>
	<li><a class="menuItem" href="index.cfm?page=content/documents/white_barn_PRUD_bylaws.pdf&area=document">By Laws</a></li>
	<li><a class="menuItem" href="index.cfm?page=documents/communityRules.cfm&area=document">Community Rules</a></li>
	<li><a class="menuItem" href="index.cfm?page=documents/petRules.cfm&area=document">Pet Rules</a></li>

</ul>

Complete source code for this demo is available here:
http://www.duanemcguire.com/blog/menudemo/menudemo.zip

And finally, by the way, the pages look fine when viewed on the simplest of browsers, lynx:
A view of the Documents Menu rendered by lynx

Comment on this article

Joy of performance

When I got back to the piano a few months ago, after a 15+ year absence, I didn’t know what would happen. Ooo boy! A lot has happened. I have practiced with abandon, found a great teacher — Rebecca Wren of Ford Piano Studio — and things really are happening! The joy of it is that I find I can perform at a level which was not a part of me 15 years ago. What a fine feeling.

For the past two months I’ve been working on learning a piece recorded by Marian McPartland many years ago. The piece is her interpretation of “If You Could See Me Now”. I am working from the transcriptions of Don Sickler and John Oddo: “The Artistry Marian McPartland” (c 1985) I purchased my copy of this book on eBay. Amazon also lists it..

When first approached two months ago, I thought the first measure of page 48 was going to be out of reach. Today, well … I’m just so happy with it!
1st measure of page 48

Here’s an mp3 clip of my playing earlier this evening For me, it’s pure magic!

You can also hear Marian McPartland’s performance of this piece on Rhapsody (free).

Comment on this article

Tidy Web Design

Recently I had the chance (volunteer work) to do some web development from the ground up. That’s not part of my everyday work, where I do mostly maintenance on existing web applications. I approached this project with several objectives:

  1. HTML/CSS standards compliant
  2. No Table layout
  3. Attractive, functional layout for screen sizes 800×600 and higher
  4. Javascript DHTML menus which support a good experience in a No Script environment
  5. Support the visually impaired by using resizeable fonts
  6. Provide a good print layout through use of CSS @media selector
  7. Strong use of CSS

Its still a work in progress! I’m not quite there with 1 and 2 above. I need to continue my quest in those areas. However, I’m quite pleased with other aspects of the objectives above. More later. Here’s a view of my work: http://www.whitebarncondo.com

Comment on this article

Piano Performance Anxiety

Oh darn. I have Piano Performance Anxiety, and no, I’m not going to see a shrink. I’m investing in piano lessons instead. My Christmas present to myself was a 6′2″ grand built by the Charles Stieff Company of Baltimore in 1911.

Since Christmas, which technically ocurred just before Halloween, I’ve discovered a great deal about myself and my keyboard skills.

  • After several months of dedicated practice, I find that I’m just as good as I was 20 years ago
  • Actually, better!
  • I’m really lousy when anyone is listening!

This performance anxiety is, in a way, perplexing. I really didn’t anticipate it, since I’ve been performing publicly with my quartet(s) for more that 20 years now! Anxiety at those performances is nil.

So that gives me something to work on, besides notes! Today I did some interesting reading on the subject, and found two very different, and very interesting articles:
This article presents some thoughts from the perspective of an accomplished performer, with good advice to the amateur. Included in the thoughts is an interesting practice perspective on the MOTION TO THE OCEAN. The second article, a very personal view on performance anxiety, discloses an obvious truth: Playing the piano is so much fun, why worry about it?

Comment on this article