Wednesday, June 26, 2013

Notes on the Bluebird Template, Part 2

Welcome back to our discussion of the Blogger.com Bluebird classic template. The Bluebird template very prominently displays the blog title at the top of the page, and that title is as good a place as any to begin our template deconstruction. The blog title is held by an id="Title" div, whose full coding is given below:

#Title { font-size: 43px; padding-left: 0px; padding-top: 10px; text-transform: none; }
#Title a { text-decoration: inherit; color: inherit; }
a:hover { background-color: #c3cfe5; }
...
<div id="Title">
<ItemPage><a href="<$BlogURL$>"></ItemPage>
<$BlogTitle$>
<ItemPage></a></ItemPage>
</div>


The Title div is the fifth-in-source-order div in the template; it is the second child of the main div that frames all of the non-background content. (We will discuss the Title div's previousSibling, the menu div that contains the sidebar on the right side of the template, at a later point.)

The blog title (reptile7's JavaScript blog in my case) is the 'replacement text' for the <$BlogTitle$> reference. The title's font size is set to 43px, which is about 33% larger than that for h1 element text and which gives the title a bolded appearance. A padding-top:10px; style pushes the title down a bit from the top edge of the main div. BTW, the CSS text-transform property's initial value is none and therefore the text-transform:none; declaration can be thrown out.

If the Title div's containing document is for the blog's main page (http://reptile7.blogspot.com/) or for one of the blog's archive pages (e.g., http://reptile7.blogspot.com/2010_01_01_archive.html), then the div's only content will be the blog title. However, if the div's containing document is for one of the blog's individual post pages (e.g., http://reptile7.blogspot.com/2013/05/subtract-other-items-update.html), then the <ItemPage></ItemPage> conditional tags will wrap the blog title in an anchor element with a href attribute set to <$BlogURL$>, whose replacement text is the URL for the blog's main page. Long story short: At an individual post page, the blog title will link to the main page.

Style-wise, our new <a href="<$BlogURL$>"> ... </a> link
(a) inherits the text-decoration of its Title div parent, i.e., it won't be underlined (the initial value of the CSS text-decoration property is also none),
(b) inherits the color of its Title div parent, i.e., it'll be black for almost all users, and
(c) is given a #c3cfe5 background-color if we mouseover it.
I myself like blue and underlined links, and consequently would throw out the #Title a { text-decoration: inherit; color: inherit; } style rule.

A non-database ItemPage

We can easily duplicate the ItemPage functionality with a bit of JavaScript/DOM programming.

var mainpage = location.pathname == "/";
var archivepage = location.pathname.indexOf("archive") != -1;
var itempage = !mainpage && !archivepage;

window.onload = function ( ) {
    var titleDiv = document.getElementById("Title");
    if (itempage) {
        var titleLink = document.createElement("a");
        titleLink.setAttribute("href", "http://myblog.blogspot.com/");
        titleLink.textContent = "Title of My Blog";
        titleDiv.appendChild(titleLink); }
    else titleDiv.textContent = "Title of My Blog"; }


At the blog's main page the location.pathname return is / and at an archive page location.pathname contains archive; by process of elimination, we are at an individual post page if location.pathname is not / and does not contain archive.

If we are at an individual post page, then we
(1) create an empty anchor element,
(2) equip the anchor element with a href attribute that points to the main page's URL,
(3) load the blog title into the anchor element, and finally
(4) load the completed anchor element into the Title div.
If we are at the main page or an archive page, then we simply load the blog title into the Title div.

Of course, you might prefer to ditch the ItemPage/anchor markup and just go with a
<div id="Title">Title of My Blog</div> title, and that would be fair enough.

Blogger tags, take two

In the previous post I stated that the <tagName> ... </tagName> construct is an XML element, but I'm not so sure about that now. On the one hand, the browser sees it as an element node, it serves a descriptive purpose to an extent, and the tagName name is case-sensitive. However, it is clear from this post that <ItemPage></ItemPage> at least is as much a subroutine call - an onIndividualPostPage event handler, if you will - as it is a structural unit. Perhaps we should refer to <tagName> ... </tagName> as a function or operation - these terms are not wholly satisfactory but they're better than "tags", which implies a static structure.

We'll discuss the template's date header in our next installment.

Monday, June 17, 2013

Notes on the Bluebird Template, Part 1

From time to time I get comments on the 'skin' of my technical blog:
I sегiouslу lοvе your website. Eхcellent colоrs & theme. Dіd уou creаte thіs website yοurself? Рlease reply back aѕ I'm trying to create my own personal site and would like to find out where you got this from or exactly what the theme is called. Thank you! Feel free to visit my weblog: nagelpilz
reptile7's JavaScript blog makes use of Blogger.com's "Bluebird" classic template, which was created by Evhead and Glish. I thought it would be worthwhile to take a look at the Bluebird template given that it is no longer available from Blogger.com - as you may know, resurrecting outdated code is a 'theme' of what I do.

Basic structure

The Bluebird template has a simple structure that is based on a set of ten div elements. These divs have id or class names that (for the most part) straightforwardly describe what they contain: a main div frames all non-background content, a Title div holds the blog title, each post sits in a Post div, etc.

The template look

The Bluebird template

The Bluebird template's head element holds a style block that styles the template's body element, the aforementioned div elements, and other body element descendants. The template's characteristic look - its blue-stripe frame - results from the body's background-color:#c3cfe5; and the main div's margin:20px;.

<style type="text/css">
body { margin: 0px 0px 0px 0px; font-family: arial, helvetica; background-color: #c3cfe5; }
#main { margin: 20px; border: 1px solid #000; background-color: #fff; padding: 0px 0px 15px 15px; }
...
</style>


As shades of blue go, #c3cfe5 is a bit dull, but if we pushed the body background to pure blue, then it wouldn't be quite so bluebird-y, would it?

Template tags

Like all of the Blogger.com classic templates, the Bluebird template is littered with what are called "Blogger tags" or "template tags", of which there are two main types:

(1) <tagName> ... </tagName>

Although the author of the aforelinked "Template Tags: defined" article can't be bothered to say so, these "tags" are in fact XML elements. Some of these elements serve as containers for repeating units of content.

(2) <$tagName$>

I don't know what exactly these things are, but I can tell you some things about them. These "tags" are some sort of database-related construct, and they function just like SGML entity references, more specifically, they are replaced by text or markup from a database when a template page is rendered by the browser. (And given their resemblance to SGML entity references, I think it was a bad call on Blogger's part to give them a markup-like appearance - a &tagName; formulation would have been much more appropriate.) Their Node.nodeName return is #text, meaning they are objects that implement the Core DOM's Text interface.

My primary goal in writing about the Bluebird template is to set out the template's HTML and CSS so that a 'Weekend Silicon Warrior' can apply the template to the creation of normal Web pages, and consequently I will keep discussion of the template tags to a minimum (we won't be able to avoid them completely). We'll take up the other highlights of the template in the following post.

Friday, June 7, 2013

What You Are Is Lonely

About three weeks ago I checked out Tegan and Sara's Heartthrob album from my local library. For some reason I had it in my head that Tegan and Sara make 'jangle pop' à la early R.E.M.; corroboratingly, upon downloading the CD track names from the Web, the responding database assigned "Indie Rock" to the iTunes Genre header. Boy, was I in for a surprise! Heartthrob is a modern pop record with a new-wave sensibility; sound-wise, Tegan and Sara have more in common with the Go-Go's or even ᗅᗺᗷᗅ than with the Indigo Girls.

Although somewhat derivative in places, Heartthrob is overall an enjoyable listen. My favorite cut on the album is "Drove Me Wild", and "Goodbye, Goodbye" is almost as good - these songs definitely belong on the radio. I also appreciate the Radiohead-ish artsiness that adorns some of the album's later tracks; it would be great to hear an entire record in the vein of "Now I'm All Messed Up".

Checking the credits, I see that most of Heartthrob was produced by Greg Kurstin. Hope springs eternal that someday Geggy Tah will reunite - Sacred Cow is my favorite record from the 1990s - but I'm not holding my breath on that.

Bronski Beat's The Age of Consent will be our next musical selection.

Wednesday, May 29, 2013

Just Say No, Part 2

I also saw Sweet at the Chestnut Cabaret in 1990 or so. Or perhaps I should say I saw half of Sweet. The band was led by guitarist Andy Scott, and the late Mick Tucker was behind the drum kit, but vocalist Brian Connolly and bassist Steve Priest were replaced by other performers. The show was OK - gratifyingly the band's regular set included "Sweet F.A.", one of my favorite Sweet songs - but I left that night feeling that I hadn't seen the real Sweet on account of Connolly's absence.

A few years later, during my time in Britain, I chanced upon an article on Connolly in a tabloid; this was shortly after the release of the film Wayne's World, which to my understanding features "The Ballroom Blitz" in some way (I haven't seen it). Frightfully, the article reported that Connolly was confined to a wheelchair - it was accompanied by a photograph of Connolly in a wheelchair - and that he had a medical condition that caused him to shake constantly. Nonetheless, the article put a positive spin on the situation, saying that Connolly was heartened by Wayne's World-triggered public re-interest in Sweet and that he wanted to go out on the road and perform with Sweet as he once did.

But that photo, oh my goodness, what happened? To make a long story short, Connolly had 'stepped into the ring' with alcohol, and lost. For a period of about ten years - from the mid-1970s to the mid-1980s - he drank and drank and drank and as a result ran his health into the ground. By the time he finally woke up and realized "This has to stop" the damage had been done. For the last ten years of his life, his body was not much more than a shell; he limped to the age of 51 before dying in early 1997.

In the song "Cooks County" from the Who's It's Hard, Pete Townshend, himself a Sweet fan, says:

So don't you abuse that body
It'll snap without assistance my friends

I thought of these lyrics when Whitney Houston died and I thought of them when Amy Winehouse died; they apply to Brian Connolly, to Elvis Presley, to a lot of people.

Speaking of Whitney Houston, at the time of her death a local talk-radio personality here in New Orleans, WRNO's John Osterlind, played an audio clip of her singing "The Star-Spangled Banner", and I have to say that it was as impressive a rendition of the national anthem as I have ever heard. At the height of her vocal powers, Houston was a force to be reckoned with. And now she and her talent are gone.

As much as we might wish we could go back in time and force people to take better care of themselves, it's just not possible to do that.

So be good to yourself: you can choose to follow Luscious Jackson's philosophy of "Live slow, die old". Sometimes fate deals you a bad hand - by all accounts Johnny Ramone took care of himself, and yet still died of prostate cancer in his mid-50s - but there is no need to tempt fate in this regard. To unnecessarily die before your time is neither heroic nor noble: it is a waste.

Friday, May 24, 2013

Reflections on... Foghat

In 1990 (give or take a year) I saw Foghat do a show at the Chestnut Cabaret in West Philadelphia. Back in the 1970s there was a brief period when I was really into Foghat, and I leapt at the chance to see Foghat in a small club. "Lonesome Dave" Peverett was the only member of the classic Foghat lineup on stage that night; indeed, if I recall correctly the band was billed as either "Lonesome Dave's Foghat" or "Dave Peverett's Foghat".

I own five Foghat albums: Energized, Fool for the City, Night Shift, Foghat Live, and Stone Blue. Looking back at those records, it is clear to me that Foghat was a band whose energy greatly surpassed its songwriting chops. (But hey, if you're not such great songwriters, then the least you can do is crank up the energy level, right?) My very favorite Foghat song is Energized's "Step Outside", a funky, atypical-for-Foghat track with a James Brown influence - "loosen up baby, 'cause time's getting tight" - it's a shame Foghat didn't do more songs like that.

Anyway, back to the show. The band's regular set was highlighted by (of course) Willie Dixon's "I Just Want to Make Love to You" and Stone Blue's "It Hurts Me Too"; the encore included Chuck Berry's "Maybellene". I'm sure the band also did "Slow Ride" and "Fool for the City" but I just don't remember them.

IMO the real attraction was Lonesome Dave himself. Peverett was a true professional who could sing, play rhythm guitar, and play lead guitar with equal aplomb; it was a pleasure to watch him perform. And as I watched him, it occurred to me that the 'Foghat identity' began and ended with Peverett: Foghat was Peverett and Peverett was Foghat, with the other band members being a superfluity, an assessment with which, I have no doubt, Peverett would have vehemently disagreed.

The only disappointing thing about the show was the poor turnout - there couldn't have been more than 20-25 people there - this was a band that was playing large venues at the time of Foghat Live. The small crowd did not seem to dampen Peverett's spirits, however. Towards the end of the set he even said that the band had a new record coming out, but I wondered, "How many people are going to buy that record?"

Sadly, Peverett died of cancer in early 2000. There's actually a current version of Foghat, with original drummer Roger Earl, thrashing around out there; it tours and has even released a few records. It's anyone's guess what Peverett would think of the present-day Foghat: maybe he would want the show to go on, and maybe he would say, "Give it a rest, lads"; ultimately it is up to the fans to determine how long it keeps plugging away.

Sunday, May 19, 2013

Listen to the Music

Without music to decorate it, time is just a bunch of boring production deadlines or dates by which bills must be paid.
- Frank Zappa

Every three weeks or so I hike over to my local library and check out a music CD. Listed below is a chronological tab of the CDs I have checked out since January 2006, when I began this activity.

Artist Title
Miles Davis The Complete Birth of the Cool
Jah Wobble's Invaders of the Heart Take Me to God
Paul McCartney Driving Rain
Yoko Ono/Ima Rising
Semisonic All About Chemistry
Fu Manchu California Crossing
Paul Simon Graceland
Ned's Atomic Dustbin Are You Normal?
Lisa Loeb Hello Lisa
Res How I Do
Everclear Sparkle and Fade
Ani DiFranco Evolve
Dashboard Confessional A Mark, a Mission, a Brand, a Scar
Everclear Songs from an American Movie, Vol. 2: Good Time for a Bad Attitude
Wheat Per Second, Per Second, Per Second... Every Second
U2 The Joshua Tree
Terry Radigan Radigan
The Afghan Whigs Gentlemen
Radiohead Kid A
The Rolling Stones Exile on Main Street
Pavement Brighten the Corners
R.E.M. Reveal
Radiohead Hail to the Thief
Yo La Tengo I Am Not Afraid of You and I Will Beat Your Ass
Yeah Yeah Yeahs Show Your Bones
Sara Evans Born to Fly
James Iha Let It Come Down
Juliana Hatfield Please Do Not Disturb
Simon & Garfunkel Bridge over Troubled Water
Bonnie Raitt Fundamental
Dixie Chicks Wide Open Spaces
U2 How to Dismantle an Atomic Bomb
Thom Yorke The Eraser
Maria Mena White Turns Blue
The Twilight Singers Twilight as Played by the Twilight Singers
Jessica Andrews Now
Meat Beat Manifesto Subliminal Sandwich
Jonatha Brooke 10¢ Wings
The Flaming Lips At War with the Mystics
Heather Myles Highways and Honky Tonks
Jackson Browne Running on Empty
Susan Werner I Can't Be New
Cheap Trick Rockford
Alannah Myles Rockinghorse
Philip Glass Songs from Liquid Days
Bananarama Pop Life
Bruce Springsteen Nebraska
Aretha Franklin Jump To It
Jonatha Brooke Steady Pull
Maria McKee Maria McKee
Peter Gabriel Us
Indigo Girls Come On Now Social
The Shamen En-Tact
SHeDAISY The Whole SHeBANG
The Bravery The Sun and the Moon
Björk Volta
Norah Jones Not Too Late
Radiohead In Rainbows
David Byrne Uh-Oh
The Juliana Hatfield Three Become What You Are
The Breeders Mountain Battles
Lily Allen Alright, Still
The Kills Midnight Boom
Sarah Harmer You Were Here
Veruca Salt American Thighs
Susanna Hoffs Susanna Hoffs
KT Tunstall Drastic Fantastic
Tori Amos Abnormally Attracted to Sin
Ace Frehley Anomaly
The Mars Volta Octahedron
Robert Plant Pictures at Eleven
Susan Tedeschi Wait for Me
Beth Orton The Other Side of Daybreak
The Rolling Stones Bridges to Babylon
Slash Slash
Gwen Stefani The Sweet Escape
Steve Vai Sound Theories Vol. I & II
Alannah Myles A-lan-nah
Indigo Girls Swamp Ophelia
Arctic Monkeys Humbug
Christina Aguilera Bionic
Sade Soldier of Love
Amy Winehouse Back to Black
Lucinda Williams West
Lou Reed Rock and Roll Heart
Death Cab for Cutie Narrow Stairs
Duffy Endlessly
R.E.M. Accelerate
P!nk Funhouse
Janis Ian God & the FBI
Madeleine Peyroux Careless Love
Joss Stone Introducing Joss Stone
Alison Krauss & Union Station Paper Airplane
She and Him Volume Two
Alanis Morissette Flavors of Entanglement
The Murmurs Blender
Veruca Salt Eight Arms to Hold You
Luscious Jackson Natural Ingredients
Donna Summer Crayons
Colbie Caillat Breakthrough
Alicia Keys The Element of Freedom
The Arcade Fire The Suburbs
Jeff Beck Emotion and Commotion
Radiohead The King of Limbs
Norah Jones The Fall
Jane's Addiction The Great Escape Artist
Katie Melua The House
The Flaming Lips Embryonic
Britney Spears Femme Fatale
Trisha Yearwood Where Your Road Leads
The All-American Rejects Kids in the Street
Fiona Apple The Idler Wheel Is Wiser Than the Driver of the Screw and Whipping Cords Will Serve You More Than Ropes Will Ever Do
Roberta Flack The Very Best of Roberta Flack
Andy Summers Synaesthesia
Sarah McLachlan Laws of Illusion
Christina Aguilera Back to Basics
The Mars Volta Noctourniquet
Madonna Hard Candy
Stephen Malkmus and the Jicks Mirror Traffic
And currently...
Tegan and Sara Heartthrob

Tuesday, May 14, 2013

Just Say No

As obscure as it is (or at least as I perceive it to be), my technical blog gets its fair share of comment spam. Historically, most of that spam has concerned pharmaceuticals in some way.

I've culled some favorites from my pharmaceutical spam collection and I'd like to share them with you. Not so surprisingly, the comments below were all authored by "Anonymous".

Our first two selections would seem to indicate that not everyone is using pharmaceuticals in a prescribed way:

buy ambien online ambien cr 12.5mg cost - ambien and alcohol party

buy ambien online ambien 6 hours of sleep - ways get high ambien

Of course, pharmaceuticals are not just for you and your partying friends. Who needs "The Total Transformation" (no, I am not going to provide a link for this) when you can give your kids some diazepam?

buy diazepam online diazepam dosage for kids - diazepam emergency drug

Don't forget to save some for the family dog:

buy tramadol online reviews tramadol online pharmacy - tramadol 50mg used dogs

Just what Fido needs: some tramadol to chill him out. And I wouldn't want my fellow ailurophiles to feel left out:

buy valium online cat anxiety valium - valium online order

We've even got one for the walrus owners in the audience - goo goo g'joob!

cheap ambien no prescription ambien walrus needs more robot - ambien side effects for the elderly

Next, we have two "soma" comments. Per Aldous Huxley's Brave New World, I had thought that soma was a fictional thing - clearly I'm behind the curve on all of this.

buy soma buy soma online us pharmacy - buy soma store

buy soma where to buy soma bras - what is carisoprodol 350 mg (soma)

Soma bras?? My imagination goes to work: someone out there is selling bras that have been soaked in a soma solution so that wo/men can ingest soma by wearing them. (I hope I'm not giving anybody any ideas here.) As it happens, there is a lingerie retailer called Soma Intimates.

Moving on, if you're in the market for some fake xanax bars, we've got you covered:

buy xanax online no prescription cheap xanax drug test navy - order fake xanax bars

So how exactly are these people any different from illegal drug pushers? Oops, I spoke too soon:

xanax online Boston how to buy xanax online forum - xanax bars mixed with weed

Some of this spam gets through the Blogger spam filter and ends up in the "Published Comments" section; here are a few examples:

vimax, vimax, vimax vimax, vimax, vimax vimax, vimax, vimax vimax, vimax, vimax vimax, vimax, vimax

buy xanax online xanax overdose brain damage - signs drug abuse xanax

buy tramadol usa tramadol high triglycerides - tramadol death by overdose

I guess the first guy is really into vimax, huh? As for the brain damage and death by overdose of the latter two comments, it sure makes you want to rush out and try some xanax and tramadol, doesn't it?

Needless to say (and my snide commentary aside), America has a serious drug problem, and we are not talking meth, crack, or pot. Where is Nancy Reagan when we need her?