Wednesday, April 25, 2007
I've come across several forums regarding how to create static pages in Blogger. Using my own domain name and Google as my hosting provider, I have come up with yet another solution. Check out my article on how to Create Static Pages in Blogger.
Saturday, April 14, 2007
Nested Quotes causing Bug in HTML Reply Signatures for Gmail
In the Gmail HTML Reply Signatures script, the code you are instructed to modify looks like this:
var htmlsig = '<br><p><img src="http://mydomain.com/image.jpg"></p><br>';
Now, consider this line of code, which will not work properly due to errors:
var htmlsig = "<br><p><img src="http://mydomain.com/image.jpg"></p><br>";
Think about the last book you read where the main character quoted another character:
Mark said to Tammy, "What did John tell you?". Tammy replied, "Mark, John said: 'The only dumb question is the one that is never asked!', and I think he really means it.". Mark raised an eyebrow...
Notice how the storyline is told outside of quotes, quotes are used to indicate a character speaking, and apostrophes are nested within quotes to indicate a person speaking about a person speaking. Could this pattern be nested deeper, such as a person speaking about a person speaking about a person speaking? It could, but we only have two delimiting characters: Quotes and apostrophes. We'll come back to this problem later.
Now, what would the reader think of this:
Mark said to Tammy, "Tammy, my writing career is in the toilet, what is this story about?". Tammy looked puzzled. Finally she said, "John said, "This quote is confusing because it is a quote within a quote.", and not to worry about our careers".
Notice the inner quotation uses the same type of quote. Instead of an inner quote, the text would actually represent the narration and not any type of quote.
Now here comes the really interesting part. You can use quotes in whatever order you want. Consider this:
var htmlsig = "<br><p><img src='http://mydomain.com/image.jpg'></p><br>";
Notice that I reversed the (') and the ("). The quotation mark is now the outer string wrapper and the apostrophe now represents the inner string wrapper. Be prepared to see differences, as unlike publishing a novel, there is no rule determining whether an apostrophe is used first or a quote is used first. As long as one type is used for the outer string and the other type is used for the inner string, your result will be the same.
Quote within a Quote within a Quote within a ...
UPDATE: The article, Nested-Nested Quotes, describes the concept of nested quotes even deeper using real code and provides the solution to this problem!
Friday, April 13, 2007
Today, I have friends who sell their CDs to pawn shops or other resellers whenever they are tight on cash. Although I have a CD collection, I sometimes wonder why. Even though CDs are but a fraction of the size of a 33" vinyl record, they still are something I have to constantly sidestep in my tiny apartment.
It is strange. Audrey is right. People are attracted to the idea of holding onto what is physical and tangible, even when its digital equivalent is also a functional equivalent. Maybe one day I'll get tired of sidestepping my CD's, and they will end up sitting in the local pawn shop. That is, unless I see a nice cedar chest specifically designed for compact discs.