23 December 2007

Thoughts on ExpressionEngine 1.6.1

I spent the week after finals putting together a support site for a friend's company. His company chose ExpressionEngine version 1.6.1 as the underpinnings of the support site. I'd never used it before, and here are my thoughts on the system having stared at it for a week straight:

ExpressionEngine Pros

ExpressionEngine had a lot of good things to offer, and I can't imagine having completed as much of the support site as quickly as I did without it:

Simplicity of the Templating System
From looking at the shipped, default templates it was straightforward to learn ExpressionEngine's template syntax. Tags come in {single} instances and in {pairs}{/pairs}. Compared to all the JSP line noise I've used in the past (e.g. <%jspTag%>) it was nice to have a bracket just require a bracket.
Flexible URL Parsing
Within any template, it's possible to extract URL segments to dice your incoming URL into manageable pieces. In the knowledge base we had URLs like knowledge_base/category/category_id and we pulled them apart with ExpressionEngine's {segment_#} construct. That was the only place where surgery was required. The rest of the time the URL parsing just worked and I didn't have to think about it. Within the bug tracker pages, I could request a single bug using URLs like bugs/bug/bug_id or bugs/bug/bug_title. I could see all the current bugs using bugs/bug/ with no trailing identifier. The underlying page to do both was identical, and ExpressionEngine handles the URL details automagically within it's underlying Weblog Entries and Comment handling tags.
Search Capabilities
ExpressionEngine has a great Search Module that makes it simple to search across all the content on the site. I doctored the example Simple Search Form provided in the documentation to automatically search across all entry text and titles (default is just titles I believe) and to provide AND semantics for multiple keywords. The advanced search form was also easy to tweak to get good defaults set. After configuring the Excerpt setting I could get a snippet of each search result using {excerpt}. I needed {exp:word_limit total="25"}{excerpt}{/exp:word_limit} to keep the results page from getting too lengthy.
Flexible Entry Categorization
Though the system allows hierarchical categories (e.g. category Sub-A is underneath category A) any entry could be filed under multiple categories simultaneously and subsequently accessed from any of them. For the knowledge base this let us put answers to questions in multiple places, and gave us a navigable ontology for people to use.
Funky Characters and Escaping
While entering fake articles for testing, I got bored with regular lorem ipsum greeking and decided to use some actual greek characters. The system handled it without a hiccup.
Great Public Support Site
The ExpressionEngine Support Site is top notch. Be sure to search both the forums and the knowledge base when you're digging for information.

ExpressionEngine Cons

With the caveat that these issues are likely fixable but just difficult for the uninitiated, these were my gripes about using ExpressionEngine:

Lack of Formality in the Templating System
I ran into odd problems when I tried to use nested conditionals, and I never could find what I'd call a "language reference" that'd give me a definitive answer for what works and what doesn't. Basic control structures were hard to read about because they've been given wacky names, e.g. this {if something}{/if} is an if statement not a conditional global variable. The ExpressionEngine template documentation lies somewhere between an extended example and a thin, wordy book sorely in need of a good index. There is a quick reference but it looks like you'd expect for a PHP-based system— lots of variable/tokens in a laundry list with little semantic/syntactic context. I prefer working from dense, highly structured references like O'Reilly Media's Nutshell Series and Visibone's Reference Products.
Breadcrumb Navigation and/or Advanced Category Functionality
Within our knowledge base, we wanted to provide a breadcrumb trail for how the user navigated into the given article. That would let the user back up by category if he or she got too far in. Unfortunately the ExpressionEngine documentation and knowledge bases keep mum while the forums are littered with poor information on creating breadcrumbs. The consensus there is that a one-size-fits-all breadcrumb mechanism doesn't work, and that everyone generally needs to roll his own. Okay. But, the existing category support tag doesn't answer questions like what-is-the-parent-category-of-the-current-subcategory? (or, if it can, the documentation isn't giving up its secrets lightly) and so we had to roll our solution by querying directly against the underlying database tables.
No External Member Registry
Since we were creating a support site for an existing user base, we wanted to use login information from our application to provide user accounts for the ExpressionEngine-based site. No dice. There are import mechanisms, but they run the risk of drift/synchronization issues over time. External user registries are apparently possible but wholly unsupported. The hacks the friend put in place are working but temporary to say the least.

I've got some other minor nits, but they are of the I-didn't-expect-it-to-work-that-way variety and wouldn't matter if I spent a second week using the product.


ExpressionEngine is a good product, and I'd choose it if I ever have to roll another site.

Random Tips

When alternating CSS classes in an HTML table, don't look for a modulus operator to write something like {if count%2}{/if} to use in conditional statements. It doesn't exist. Instead, use the {switch} variable.

Put your templates on the filesystem otherwise you're going to edit everything from within an HTML <textarea>. That's painful, especially if you want to want to use external source control and/or you've invested time in becoming proficient with a text editor. If that's not an option, the Firefox It's All Text! extension will help dull the pain.

When you create a new weblog, be sure to associate the "Default Status Group" with it right away (i.e. EE Control Panel > Admin tab > Weblog Administration > Weblog Management > Edit Groups). If you don't trying to use a Stand-Alone Entry Form will mysteriously cause all new non-SuperAdmin user posts to have "Closed" status no matter how you fight with it. After two hours of muttering under my breath, I gave up and read the source code only to find// if there is no status group assigned, only Super Admins can create 'open' entries. Not assigning a status group causes your weblog to have "Open" and "Closed" status available, which is identical in behavior to having the "Default Status Group" assigned save this nasty catch.

15 December 2007

A Taste of Haskell by Simon Peyton-Jones

Now that my semester is over, I've gotten the chance to catch up on my backlog of things to read and watch... At OSCON 2007, Simon Peyton-Jones gave a really nice 3 hour introduction to Haskell (original post). The video has two parts along with PDF slides:

  1. Part 1
  2. Part 2
  3. Slides
Definitely lengthy, but worthwhile. Simon's apparently an animated presenter and the audience asks interesting questions. I've futzed a bit with Haskell since I read about Haskell Curry every time I passed the McAllister building on Penn State's campus. The Penn State math library had a pretty good Haskell intro which I enjoyed, but I've never gotten the chance to do anything "useful" with the language besides learn from it. In Java, most of the immutable type and functor-like patterns I use are taken from concepts I learned from Haskell. A side-effect-less style (where possible) combined with short methods and good entry/exit tracing makes it easy to debug server side code from a single trace log.

02 December 2007

The Farnsworth Parabox

While procrastinating yesterday, I read about the resignation of the Texas Director of Science Curriculum, saw a comment about the Tiktaalik, and then read up a bit on the tetrapod Tiktaalik and the related Coelacanth.

That's when the procrastination became less than educational. The popular culture portion of the Coelacanth article mentioned them appearing in a Futurama episode called The Farnsworth Parabox. The synopsis was too much to resist, and YouTube made the episode very easy to find:

The Farnsworth Parabox Part 1

The Farnsworth Parabox Part 2

The Farnsworth Parabox Part 3

Mathematical Refactoring

My functional analysis course has included work by guys like Lebesgue and Hausdorff. Much of the motivation for their work seems to be a desire to clean up existing ideas, to repair/simplify/unify concepts, to formalize abstractions, and then to extend capabilities in new directions taking advantage of their much improved frameworks. According to Professor Demkowicz's in-class historical anecdotes, these software refactoring-like activities were all the rage in the late 19th and early 20th century mathematics. Call it mathematical refactoring.

I wish I could claim the phrase mathematical refactoring as my own, but Arnold deVos coined it five years ago. Well done sir.

As of now, Google only shows "mathematical" and "refactoring" appearing adjacent to each other four times in all of the Internet:

1. A Framework for Automated Software Design Optimization (PDF) by Dr. John Murphy (2002)
In this way each transformation will be "mathematical", refactoring being a very well defined code-level transformation.
2. A forum posting on Test-Driven Development by Arnold deVos (4 Dec 2002)
Imagine a case where a refactoring affects just two collaborators A and B. A "mathematical" refactoring can be performed quickly and reliably. But if there are tests on A and on B and associated test cases there is a lot more work to do.
3. A listserv posting by Mathieu Bouchard (15 Sept 2006)
AFAIK, String Theory is still baffling itself; it's more of a mathematical refactoring of previous theories, than a scientific theory, due to the lack of experiments to test the theory.
4. An IBM Global Services presentation on Electronic Batch Records (PDF) (December 2006)
Use a mathematical Refactoring Model to determine the optimal sequence of actions to mitigate this risk for these products, technologies, and sites over the pre-set horizon and within the constraints.

Neither Murphy nor the IBM presentation used mathematical refactoring as a compound phrase in the sense that I am, but both deVos and Bouchard both did. deVos easily predates Bouchard.

21 November 2007

AT&T uses IBM WebSphere SIP

Erik Burckart, former co-worker and all around cool guy, pointed out that it's finally public that AT&T uses WebSphere SIP and followed it up with some screaming SIP performance numbers.

I spent better than a year working on an earlier incarnation of WebSphere SIP, and it's very nice to see it succeed both technically and in the marketplace. From the press release, it is also fun seeing IBM build SIP-related capabilities into Tivoli and Rational products in addition to WebSphere.

John Francis and the QR Algorithm

My friend Flip used to get a kick out of his electrical engineering textbooks because they'd include biographies of major engineering contributors who died obscurely and in poverty. Flip speculated those biographies were intended to be motivational in nature.

Our numerical linear algebra class covered the QR algorithm. In class, our professor mentioned its place as one of the most important algorithms ever. Later, he passed along an interesting note. One of the biggest contributors to the algorithm had never heard just how important it was...

Date: Sun, 19 Aug 2007 13:54:47 -0700 (PDT)
Subject: John Francis, Co-Inventor of QR

Dear Colleagues,

For many years, I have been interested in meeting J G F Francis, one of
the co-inventors of the QR algorithm for computing eigenvalues of general
matrices. Through a lead provided by the late Erin Brent and with the aid
of Google, I finally made contact with him.

John Francis was born in 1934 in London and currently lives in Hove, near
Brighton. His residence is about a quarter mile from the sea; he is a
widower. In 1954, he worked at the National Research Development Corp
(NRDC) and attended some lectures given by Christopher Strachey.
In 1955,'56 he was a student at Cambridge but did not complete a degree.
He then went back to NRDC as an assistant to Strachey where he got
involved in flutter computations and this led to his work on QR.

After leaving NRDC in 1961, he worked at the Ferranti Corp and then at the
University of Sussex. Subsequently, he had positions with various
industrial organizations and consultancies. He is now retired. His
interests were quite general and included Artificial Intelligence,
computer languages, systems engineering. He has not returned to numerical

He was surprised to learn there are many references to his work and
that the QR method is considered one of the ten most important
algorithms of the 20th century. He was unaware of such developments as
TeX and Math Lab. Currently he is working on a degree at the Open

John Francis did remarkable work and we are all in his debt. Along with
the conjugate gradient method, it provided us with one of the basic tools
of numerical analysis.

Gene Golub

17 November 2007

Gene Golub, 1932-2007

Having just recently gotten an appreciation for what Golub has contributed (from classes, books) and how active he's continued to be (talking to profs who've recently written papers with him) it was wildly unexpected to see this forwarded to my inbox this morning:

From: Cleve Moler 
Date: Fri, 16 Nov 2007 17:55:42 -0500
Subject: Gene Golub, 1932 - 2007

Gene Golub, founder of the NA Digest, passed away today, Friday, November 16,
at the Stanford University Hospital.  He was 75 years old.

Gene returned home to Stanford recently from a trip to Hong Kong.  He was
planning to leave again Tuesday on another trip, this one to Zurich where the
ETH was to honor him with a special degree.  Instead, Sunday night he went to
the emergency room because he was "feeling lousy".  On Tuesday, he was found
to have AML, acute myelogenous leukemia, a form of cancer that affects the
white blood cells.  This is a potentially curable disease and he was expecting
to begin chemotherapy today.   But serious complications developed suddenly
over night.

I was able to see Gene for an hour last night and he was in reasonably good
spirits.  Mike Saunders was trying to get Gene's laptop to use dial-up over
the hospital's phone system because Gene said he was a couple of days behind
on his email.  I was planning to get a wireless card for his machine today.
None of us had any idea how suddenly the situation would worsen.

The Stanford iCME students have created a memorial blog at

Our community has lost its foremost member.  He was a valued colleague and
friend.  Goodbye, Gene.

 -- Cleve Moler

13 November 2007

Python dictionaries and Java Hashtables Analogy

I stumbled across the open source SAGE project this past week. Among many other things, SAGE uses Python to unify the many disparate programming languages introduced by packages like Mathematica and MATLAB. I figured SAGE would finally be a good excuse to improve my lousy Python skills, and I started reading Dive Into Python.

During it's description of Python dictionaries, Dive Into Python makes the comment that

"A dictionary in Python is like an instance of the Hashtable class in Java."
Immediately I've got some bad lingering associations from my former IBM server-side Java work. Hashtable access is inherently synchronized in Java, but many programmers aren't aware that they're paying synchronization overhead on every get and put. These folks learned about Hashtables from Java 1.1 material and never moved onward to Maps as the Collections framework improved. Scarier still is when people do know about Hashtable synchronization but fail to use newer mechanisms like Collections.synchronizedMap wrappers and ConcurrentMap implementers to document their synchronization needs explicitly.

All in all, Dive Into Python's analogy seemed wrong. So I bugged Michael Gilfix. Mike's my single source for all questions involving at least two of the trio "Java/Python/threads":

Hey Mike,

I ran across
  > A dictionary in Python is like an instance of the Hashtable class in Java.
in a python tutorial I was skimming.  Do they really mean Hashtable
with all the underlying synchronization implications?  Or do they mean
HashMap and didn't think hard enough about the analogy?


To which he replied:

Hey. It's like a hashmap. You need to synchronize using something like
mutexes from the threading package. None of the built in collection types
come with built in synchronization. Sounds like you're having fun.

09 November 2007

Helicopters, damaging tendencies, make send-thanks

Random stuff I've gotten a grin from over the past week...

I'm not one for black helicopter paranoia but apparently it's common enough to warrant announcements:

Tomorrow afternoon ... a group of helicopters will be practicing for their flyover at the DKR stadium during this weekend's football game. . . . Campus Safety and Security is providing this advance notice to faculty, staff, and students so they may be aware and, hopefully, unalarmed at the helicopters' presence.
Evil paraphrase: Ignore the black helicopters flying over campus—they're just practicing so they can be effective during large public events.

While covering design optimization in a class, the professor showed us a slide about shape optimization in a particular biomedical device. It included the line

Design challenge: overcome tendency to damage red blood cells

Lastly, from the release notes of the libFLAME library:

Thank us!

We are very insecure people. So, if you like the libraries and find them useful, send us a message! We even make it easy. In the top-level directory of the libflame distribution, execute:

    make send-thanks

This will automatically e-mail us a message!

19 October 2007

SourceForge: Get Services for NetHack

Sometimes SourceForge is spot on with it's service-based open source marketplace approach. I can think of lots of examples where I'd want to buy help (e.g. complicated database, application server, or load balancing systems). Sometimes, however, SourceForge isn't so spot on:

But then again, I barely make it to Minetown most games...

13 October 2007

Roland Satterwhite's Improvisation #1 from Ptolemy's Guitar

I've got the bad habit of browsing del.icio.us/popular-- it's the ultimate procrastination tool. Well, it or Laughing Squid. Sometimes truely great things turn up, which is why this is an awful self-reenforcing habit.

Recently Andrew Sloat's 22nd Amendment video surfaced. Sloat's work is an amazing mix of video and typography, but it's the underlying music that makes it pop for me. Completely ignoring everyone's politics, 22nd Amendment's music is just phenomenal.

Sloat used a song called Improvisation #1 from Roland Satterwhite's freely available album Ptolemy's Guitar. There are other instrumental-only works on the album, but #1 catches me the most.

Satterwhite's violin in that composition is just beautiful. I'll admit that I am fiending for that particular sound— Radiohead's new album In Rainbows, though good, just doesn't have the same cold, crisp, richness that was Kid A.

11 October 2007

Entertaining professor statements thus far...

Just a couple of fun, stream of consciousness things that professors have said in class over the last six weeks...

  1. "Blame Cauchy for that."
  2. "That means I've gone to infinity, wherever the hell that is."
  3. "Let's take the 2 norm. We're all nice and cozy with the 2 norm."
  4. "I look at exams as an opportunity to learn, not as a hazing experience."
  5. "It' much better when you talk about other people's mistakes."

05 October 2007

Armadillos, Leprosy, The Clash, and Rock the Casbah

At a Star Franchise Association conference in San Antonio this week, I had the chance (priviledge?) to race armadillos. I'd mainly only seen them as roadkill (which turns out to have a very good explanation because these suckers jump when they're scared). My wife mentioned this to a friend, who decided to freak her out by telling her that armadillos carry leprosy. Which apparently they do.

It also turns out that The Clash used an armadillo in their song Rock the Casbah. Small world, they also shot the video in Austin, Texas which explains where they got the little critter to begin with.

If you watch closely, proto-downtown Austin appears in the distance at least once. The capitol dome is clearly visible. Man, things have definitely changed here and continue to change.

30 September 2007

Einstein notation for common vector operators

I keep getting tripped up by Einstein summation convention when combined with common vector operators like grad, div, and curl. So I put together a cheatsheet:

Read this document on Scribd: Einstein notation for vectors

Vector calculus with Einstein notation quick reference Kronecker Delta and Levi-Civita relations: δii = 3 δi j δ jk = δik εi jk εi jm = 2δkm εi jk εimn = δ jm δkn − δ jn δkm εi jk εi jk = 6 Scalar, vector, and 2-tensor operations αv + βu = (αvi + βui ) ei αA + βB = αAi j + βBi j ei ⊗ e j vA = (vl el ) Ai j ei ⊗ e j = e j δil vl Ai j = e j vi Ai j Av = Ai j ei ⊗ e j (vl el ) = ei δ jl Ai j vl = ei Ai j v j AB = Ai j ei ⊗ e j Bi j ei ⊗ e j = Ail Bl j ei ⊗ e j tr (AB) = Ai j B ji A : B = tr AT B = Ai j Bi j Inner, outer, and cross products: a · b = ai bi a ⊗ b = ai b j ei ⊗ e j a × b = εi jk ai b j ek a × b × c = ai b j ci e j − ai bi c j e j = (a · c) b − (a · b) c Basic translations into summation convention: = ei ∂i ∆ = ∂i ∂i ϕ = ei ∂i ϕ ϕ = ∂i ∂ j ϕ ei ⊗ e j u = ∂ j ui ei ⊗ e j · u = ∂i u i × u = εi jk ∂i u j ek Tautologies using summation convention: × ( ϕ) = 0 ⇐⇒ εi jk ∂i ∂ j ϕek = 0 · ( × u) = 0 ⇐⇒ εi jk ∂i ∂ j uk = 0 curl gradient scalar divergence curl vector Del operator Laplacian operator, 2 Page 1 of 1 = · gradient : scalar → vector gradient gradient : scalar → tensor gradient : vector → tensor divergence: vector → scalar curl: vector → vector

Please let me know if you find it useful, or if you find any mistakes.

I posted the cheatsheet using Scribd following some hints from Peter Chen. Within the I finally found a way to show Page n of m. I also found I could use Mathematica's Signature command to doublecheck the two identities

Sum[Signature[{i,j,k}] d[i] d[j] f e[k], {i, 1,3}, {j,1,3}, {k,1,3}]
Sum[Signature[{i,j,k}] d[i] d[j] f[k], {i,1,3}, {j,1,3}, {k,1,3}]

23 September 2007

Existential logic got ya down?

Having just started a graduate applied mathematics program without a heavy math background, they're putting me through boot camp. Lots of the proofs require combining ands and ors with the existence quantifiers, and I invariably screw these up. Quick, does ? How about ?

One nice tool I've just found is Molle:

Molle is a cross-platform prover for modal logic, that exploits the modal semantic tableaux method. It features a very usable graphical interface, with interactive representation of generated models.
Particularly sweet is the Java Web Start version mollecino. You feed Molle first order logic statements and it will prove whether or not they are correct. It's a great tool, especially to convince yourself that things you think may be true actually are true.

To play with second order quantifiers, recast them as collections of statements. For example, to pretend that you've got say that is really a set of three separate conditions , , and . Then convert into and feed that into Molle. Similarly, change into .

To check feed Molle the input (A|B|C|D)&(Z|X|Y|W)=>(A&Z)|(B&X)|(C&Y)|(D&W). To check feed Molle the input (A&Z)|(B&X)|(C&Y)|(D&W)=>(A|B|C|D)&(Z|X|Y|W). The first statement isn't valid but the second one is.

10 September 2007

Raw egg topping on ice cream

The Internet has failed me.

In a conversation at the dinner table, the subject of weird ice cream toppings came up. I volunteered that one particularly weird topping is raw egg.

My wife looked at me like I was crazy. Explaining that, when whisked and frozen by placing it atop very cold vanilla ice cream, raw egg tastes something like caramel didn't seem to convince her.

I declared that the Internet would confirm that I wasn't making it up. And I searched. Though I found lots of information about whether using raw egg in ice cream recipes was safe, I found zilch on using raw egg as a topping.

I heard about it when I was in high school; I've tried the concoction several times with successful results. Hints: lots of whisking, cold ice cream, drizzle so it is a thin shell over the ice cream's surface. Don't try it if you're very young, very old, have a weak immune system, or take those drugs listed in all of the nasty interaction parts of TV commercials.

Can anyone confirm that I didn't make this up, and that there's some sort of a source for this recipe?

21 August 2007

50 things my wife would not do on a job

My wife was digging through some old paperwork and found a career counseling exercise she did about five years ago. The prompt was "name 50 things you would not do on a job." I love her ability to brainstorm, especially in career guidance-like situations. Check out number forty-four...

  1. Sit and use a computer all day
  2. Cut down trees
  3. Play any sport
  4. Clean windows on a sky scraper
  5. Cut and color hair
  6. Install electrical equipment
  7. Fix any cars
  8. Teach math
  9. Collect money at a tollbooth
  10. Collect garbage
  11. Typing all dialog in a court room
  12. Test makeup products on animals
  13. Operate on someone
  14. Feed and clean up after animals at the zoo
  15. Write people speeding tickets, parking tickets, etc.
  16. Knit
  17. Commentate for sports events
  18. Call people's homes and try to sell them things
  19. Mow lawns
  20. Fly an airplane
  21. Ride a tractor
  22. Fix traffic lights
  23. Sell food in the stands at sporting events
  24. Paint houses
  25. Fix toilets
  26. Shovel snow
  27. Climb a mountain
  28. Save someone from a shark
  29. Wax bikini lines, legs, upper lips, eye brows, etc.
  30. Crack someone's back
  31. Try out new medications
  32. Sew clothing
  33. Print newspapers
  34. Deliver mail all day
  35. Fix roofing
  36. Build furniture
  37. Give people manicures or pedicures
  38. Drive public transportation
  39. Be a mascot for a team
  40. Walk a tight rope
  41. Coach any sport
  42. Flip burgers at a fast food restaurant
  43. Check people for lice
  44. Put make up on dead people
  45. Pass laws in the senate
  46. Kill animals for food
  47. Patrol the ghetto
  48. Check people for STDs
  49. Dance at a strip club
  50. Give people bad news about their health

10 July 2007

Running jslint against many files in the Windows CLI

As much as I like some of the newer dojo-friendly Eclipse-based JavaScript+HTML+CSS IDEs like Aptana and Eclipse ATF, they all seem to barf on my JavaScript+JSP+JSTL+Portlet taglib source. Using the web-based JSLint JavaScript Verifier directly definitely works better, but there's only so many times I'm willing to copy and paste code into a browser when hunting down problems. There are some folks that have talked about validating within Ant builds but my development team is on a pre-1.6 copy of Ant which makes putting the pieces together a bit troublesome. It's pretty straightforward to run JSLint from the command line with Rhino but it's not well suited to running against a directory of files at once.

After some messing around with Windows XP batch files I got a useful little utility working. Once you download Rhino into a RHINO_HOME directory along with a copy of jslint.js, you can use this little batch file to run JSLint against many files at the same time:

@echo off
rem Windows batch file to run jslint on a collection of JavaScript files
rem see http://agentzlerich.blogspot.com/2007/07/running-jslint-against-many-files-in.html
rem for original post

rem To use, download Rhino from http://www.mozilla.org/rhino/
rem and uncompress it in a folder.  Set RHINO_HOME environment
rem variable to point to the folder.  Download JavaScript Lint (jslint)
rem from http://www.jslint.com/rhino/index.html and place it into
rem RHINO_HOME.  Ensure JAVA_HOME points to your JRE

if "%RHINO_HOME%"=="" goto rhinoHomeNotSet
if "%JAVA_HOME%"=="" goto javaHomeNotSet
if "%1"=="" goto noJavaScriptFilesSpecified

rem N.B. next line is wrapped!
for %%f in (%*) do echo. & echo Processing %%f &amp; "%JAVA_HOME%\bin\java" -classpath "%RHINO_HOME%\js.jar" org.mozilla.javascript.tools.shell.Main "%RHINO_HOME%\jslint.js" %%f
exit /b %ERRORLEVEL%;

echo No JavaScript files were specified as parameters. Exiting.
exit /b 0

echo Variable RHINO_HOME is not set! Aborting.
exit /b 1

echo Variable JAVA_HOME is not set! Aborting.
exit /b 1

20 June 2007

Programmatic GreekingWidget for dojo

When playing with dojo's fancy container and layout widgets, it is nice to be able to greek quickly. Pasting a bunch of generated lorem ipsum text gets old quickly, so here's a programmatic, custom dojo widget that'll generate as much or as little placeholder text as you need. The JavaScript source code uses the dojo 0.4.x APIs. Please feel free to use and improve this widget however you like. Here's an HTML snippet that demonstrates the widget's usage...

        <title>Usage and unit tests for GreekingWidget</title>

        <script type="text/javascript">
            djConfig = { isDebug: true };

        <!-- Be sure to point to your local dojo installation -->
        <script type="text/javascript" src="dojo-0.4.3-widget/dojo.js"></script>

        <!-- Be sure to point to where you save the source code -->
        <script type="text/javascript" src="GreekingWidget.js"></script>

        <style type="text/css">
            .FooBarClass {
                color: red;
        <h2>Usage and unit tests for GreekingWidget</h2>

        <h3>Default options</h3>
        <div dojoType="GreekingWidget"></div>

        <h3>One sentence</h3>
        <div dojoType="GreekingWidget"

        <h3>Generate blockquotes</h3>
        <div dojoType="GreekingWidget" 

        <h3>Add CSS class to make them red</h3>
        <div dojoType="GreekingWidget" 

        <h3>Add CSS style to make them tiny</h3>
        <div dojoType="GreekingWidget" 

And here's the test page output...

12 June 2007

The joys of JavaScript error messages

Today I meant to type

but instead I typed
with the incorrect extra period.

Firefox kicked back the amazingly helpful

XML descendants internal method called on incompatible Object
which I stared at dumbfounded. All of Firebug's glorious power was seemingly useless against this error. It didn't help that I was working atop a custom Dojo build.

Then I flipped back to my editor which thankfully still had the cursor next to the extra period. A simple backspace and I was moving again...

15 April 2007

Flat Stanley visits Austin

My nephew's third grade class at Westmont Hilltop Elementary recently read Flat Stanley by Jeff Brown:

Poor Stanley. He's a perfectly normal boy until one morning he wakes up flat. After his parents peel the incriminating bulletin board off of him, Stanley must adjust to life as a pancake.
At some point within the book Stanley is mailed to a friend's house in California. As a project the class made their own Flat Stanleys and mailed them to friends or relatives living out of state. While Stanley is here gallivanting in Texas, my nephew has been studying the state.

Shortly after Stanley arrived here in Austin, I was flying to Pittsburgh to visit family and brought him with me. It was a really rainy and hurried trip; both Stanley and I got drenched on the sprint to catch the Airport Flyer in downtown Austin. Stanley survived the ordeal but his clothing started looking a little tie-dyed. I decided it'd be better to pick a nice warm, sunny, dry day and do a better job of showing him around.

Stanley and I took a couple hour motorcycle ride around Austin yesterday. He conveniently didn't mind riding in my motorcycle's tank bag. The first stop was at theTexas State Capitol just a few blocks from my house. The grounds and building are very pretty, and the interior has a rotunda containing photographs of each of the Texas governors going back since the state was founded. There's also a neat floor tile showing the six flags that have flown over Texas over the years.

From there we rode up to the University of Texas at Austin, a huge public university located just north of downtown. The campus is massive and always busy. Stanley and I stopped in the middle of Honors Day and took a couple photos of the University of Texas Tower. The tower can be seen from miles away.

Stanley and I then rode west from downtown Austin into the Texas hill country. The hill country is gorgeous and reminds me of the part of Pennsylvania just between Pittsburgh and the West Virginia border. Coming from Pennsylvania, I'd always thought Texas was just flat and dry. There are a couple of different types of landforms in Texas, and each is unique. West of Austin in the hill country, there's a man-made lake called Lake Travis where a lot of people go boating during the weekends.

Last I took Stanley to where I work to see some Texas wildflowers. These are mostly purple and yellow, but along highways red and orange flowers can be seen too during this time of year. From there we rode home. It's been nice having Stanley in town, but I think he should get back to my nephew before the summer heat comes.

04 February 2007

Axle nuts should not fall off

Last October my friend Paul and I took our motorcycles from Texas to North Carolina. My father rode his motorcycle down from Pennsylvania to meet us. After several days of riding with my father, Paul and I started back for Texas.

Armed with Paul's pre-ride planning, his excellent GPS skills, and a healthy fascination with squiggly roads we had a hell of a nice day riding back and forth through the Tennessee hills. As it turned four o'clock, we realized we'd not made much westward progress. We decided to hop on a four lane highway and burn a hundred miles or so through Memphis and into Arkansas before stopping for the night.

About 25 miles later on the four lane we pulled over for cheap, rural gas before hitting Memphis beltway stuff. An SUV driver we'd passed two miles back pulled up, expressed concern that something had bounced off one of the bikes a mile back, wished us well, and left. He said it looked like a nut. Because Paul takes care of his bike, we immediately scoured mine looking for missing pieces.

It didn't take long to figure out what fell off. I'd lost the rear axle nut and spacer on my '94 Honda VFR750F. Because we'd only travelled a mile or two in a straight line since it'd happened, the axle hadn't backed out too far yet. Thankfully. I can't imagine how much it hurts to have the real wheel fall off at highway speed. At 5 PM on a Friday we called AMA MoTow, and then we watched some weird goings on at a mostly-rural-but-somehow-eeriely-urban corner store.

At 7:30 PM the tow truck came. The truck cab ride featured following a seriously drunk driver as he nearly hit a bridge abutment and basically drove down the center of a highway (tow truck driver in training riding along: "He's snorting that center white line right up his nose!"). Once we had stopped the towing guys released all of the tie downs before being sure my VFRs kickstand was down. It wasn't down. The bike's Givi hard luggage saved me from hundreds of dollars of plastic damage to the left side (truck driver went flying backwards off the flatbed and onto the asphalt). Forty minutes after the towing adventure began, I chained the bike to a post outside Honda-Yamaha of Memphis on Mount Moriah Extension, called their service department to explain why the bike was there, and gave up for the night.

Memphis has three separate Honda dealerships within a 15 mile radius, and all of them were humming on that Saturday morning. After spending the entire morning on the phone, Paul and I had learned that--

  1. The nut was about 45mm from flat to flat, and better than 30mm in inner diameter. Much more than just slightly nonstandard.
  2. None of the three Honda dealerships could obtain the nut from a warehouse in fewer than four days.
  3. No fastener supply store in Memphis carried anything similar, and we couldn't attempt to special order a machined replacement until Monday at best.
I posted a plea for help on VFRDiscussion to see if anyone would loan me the parts. Only Honda VFRs use that particular nut so we couldn't borrow one from any other type of bike. In Memphis, VFRs don't sell well so there was only one in stock among the three dealers. Unlikely enough, some bloke had recently laid down cash on the only in-stock bike and so we couldn't pull the part from it.

Then Michael Hall, the hero of the story, called a Honda dealership 100 miles west in Searcy, Arkansas where he used to work. Searcy had a used VFR on the floor, and Michael called in a favor to let us use that bike's rear axle nut, order a replacement from the warehouse, and be on our way. Paul took me two up to the Memphis airport to pick up an F150. We loaded the crippled bike up and headed to Searcy's Sunrise Honda at about 2 PM on Saturday.

It took no time, once in Searcy, to forcibly migrate the nut from their VFR to mine. The mechanic who did the work pointed out that the nut required over 100 foot pounds of torque to install and was staked to prevent the nut from ever backing off. I checked the VFR Discussion forum and got only a single response saying that the responder had never, ever heard of this particular puppy falling off.

There wasn't anywhere to return the rental truck in Searcy, so we drove the bike-on-truck onward into Little Rock. After unloading the bike at a construction site near the airport, we drove on for about 50 miles that night. Somehow we missed the nasty weather blanketting the entire state of Texas as we arrived home in Austin on Sunday.

The old meet-the-nicest-people-on-a-Honda line still applies. I lost a critical part at 5 PM on a Friday night and was underway in less than 30 hours against all odds. I spoke to four separate dealers on a busy Saturday morning, and they all helped like crazy. Every service and parts department returned phone calls even when flooded with walk-in business. Several people called me multiple times after brainstorming with other employees.

I now check that damned axle nut every time I walk past my VFR.

01 February 2007

The Return of Agent Zlerich

After eight months of smelling like bacon after work, the local restaurant/hotel consortium took over the reputable 1950's-esque establishment where I worked. Or, mostly reputable. Save for our inability to wear proper pants in the eyes of the consortium. Management decided that the guys on line had to wear checkered pants instead of the mishmash of individualistic expression present pre-buyout.

I dutifully paid my $15/pair and ordered two pairs for work. We paid extra (management mandated) for our names to be added, figuring that it'd prevent mixups. Two weeks later my two pairs arrived. They fit well and stank much less of bacon than the newly retired ones. That no one answered to "Zlerich" made the company's interpretive interpretation of my last name forgivable. I put in my notice at work shortly thereafter.

It's been years. One pair of pants went to Goodwill during some closet consolidation. The remaining pair serves primarily as pajamas these days. My lady invented "Agent Zlerich" as a joke alter ego for when I tool around the house sporting them.

After much foot dragging on my part, it feels like the right time to begin posting inane things. I suppose that's motivation enough once it's married to a not-completely-psuedonym. As far as the Internet can tell me, no one uses "Zlerich". I call dibs.

Subscribe Subscribe to The Return of Agent Zlerich