Current musing:

Using contenteditable to test css page layouts

This should be obvious, but I just realized that one could use the the HTML5 contenteditable feature to test page layouts. “Contenteditable” is a fancy little tag attribute that allows the user to edit the content contained in the element from the browser.

For example, Read more…

downloads

These guides are free, but if you have found them useful then please consider donating $2. Hey, that's less then the cup of coffee your drinking right?

subscriptions


Using contenteditable to test css page layouts

This should be obvious, but I just realized that one could use the the HTML5 contenteditable feature to test page layouts. “Contenteditable” is a fancy little tag attribute that allows the user to edit the content contained in the element from the browser.

For example, I have a three column page with a footer that spans the first two columns and places a large element in the third. I needed to be able to alter the lengths of the columns quickly to see how my footer would react and so, instead of flipping back and forth between the html code, I simply did this:


<div id="content" contenteditable="true"> ...
<div id="sidebar" contenteditable="true"> ...

Now I could load the page in Firefox, Chrome, Safari, and Opera and fiddle around with the lengths of the columns simply by adding or deleting dummy text out of the columns and watching the footer move. Cool!


Free, excellent, Optical Character Recognition (OCR)

Why have I not heard about this before!? Google docs now offers automatic Optical Character Recognition for images and pdfs when you upload them. Details at Google Doc’s help site.

As a teacher I’m constantly downloading pdfs and wishing that I could easily convert them to editable text. I just tried this feature on one of my many pdfs and it worked perfectly, it even retained most of the formatting. I’m not sure how it will work on less then perfect images or pdfs, even if it gets 60% of the text right that could be a huge help.


Modx 2.0 Revolution Cheat Sheet

Many people have found my Modx 1.0 “Evolution” Cheat Sheet very useful.

So I think people will also enjoy the slowly being updated modx 2.0 “Revolution” Cheat Sheet.

Please note that I have not had time to update all of it, so things will be changing as time goes on, but the first page of this cheat sheet is already very useful because it highlights some of the changes to tag formats and a handy list of output filters.

Also please note that you can get excel or open office calc versions of both of the above files by simply changing the output variable in the address line from “output=html” to “output=xls” or “output=ods”.

Please drop me a comment if you have found these useful!


Code is NOT Poetry

Matt Ward has written a very nice article over at Smashing Magazine examining some of the similarities between code and poetry. It is an excellent article, but I must respectfully disagree. There are similarities between code and poetry, as Matt and others have seen, but these do not make code poetry (as claimed by WordPress’ famous tagline). Here are two reasons why:

A Categorical Difference

Following the ancients, we must distinguish between Craft and Art. Both are skillful endeavors that require mastery to do well, but they differ in purpose. Arts are pursued for their own sake, while crafts are pursued for the sake of utility.

Craft is done for the sake of some other goal. An excellent shoemaker, for example, is a craftsman because he creates shoes to be worn, and we judge a shoe’s excellence based on how well it serves its function. We never purchase a shoe just to hang on our wall. No, a great shoe is one that is comfortable, wears well, and looks great. A craft’s value and excellence lies in its utility.

Art, on the other hand, is done for its own sake. An excellent painter creates his paintings to be enjoyed in-and-of-themselves. There is no other purpose for his art. We judge a paintings excellence not on how well it sells beer (that would be commercial art, a craft), rather we judge its excellence based on how much we enjoy looking at it. In other words, an excellent painting is an enjoyable painting.

Code is craft. No one writes code so that the code itself can be enjoyed. It is written to perform some job. That is not to say that code cannot be beautiful. There is a distinct difference between beautiful and ugly code, but at the end of the day code is judged based on how well it performs its job. In fact, beautifully structured code that doesn’t work is worse than ugly, difficult to maintain, code that does. We can even say that beautifully structured code that doesn’t work isn’t actually “beautiful” at all, for the simple reason that it is flawed and doesn’t do what it’s suppose to do. The very question of what it means for code to be beautiful is bound up in the question of whether or not it fulfills it’s purpose.

Poetry is art, at least good poetry is. It is written to be enjoyed in its own right. Its beauty does not rest in utility but in itself.

The question of meaning

Code and poetry differ in many other more specific ways as well. But I want to deal with only one that Matt perceived to be a similarity: meaning. Matt argued that just as poetry has multiple levels of meaning, so code can impart varying meaning to content. He attempted to compare a poem’s literal and figurative meaning to some code’s semantic value.

He gave these two examples of HTML code to illustrate code’s ability to imbue content with different meanings:

<p>The Wasteland</p>
<h1>The Wasteland</h1>

I agree with Matt’s basic contention about this code: the displayed text is the same on both lines but the “meaning” is different. Obviously the first is paragraph text, and the second is a top-level heading. But these two lines are distinctly different lines. The one does not imply the other. One does not “figure” the other. Strictly speaking, considered as code, the content of each line is not the same. Each line can mean one and only one thing and it is different for each.

If this were not the case then code would be useless. Ambiguity in code is deadly. Just imagine the nightmare of trying to debug code in which a single line could be interpreted in 2 (or heaven forbid more) ways at the same time in the same context! But ambiguity is a strength in poetry. Ambiguity is poetry. The poet’s ability to give the same words multiple meanings at the same time is what makes a good poem good! Ambiguous figurative language is poetic language.

just look again at the example of poetry Matt provided. He quoted the following lines from Robert frost:

The woods are lovely, dark, and deep,
But I have promises to keep.
And miles to go before I sleep,
And miles to go before I sleep.

We could unpack the meaning of these lines for hours. What do the woods signify? Why are they lovely, but also dark and deep? Does sleep refer to death, or to the comforts of home, or both? We cannot derive the same joy from the lines of HTML code quoted above, nor would it be good if we could.

Code is not poetry. It can be excellent, beautiful even, but its beauty must be judged by a different standard than the beauty of poetry. Code is craft, poetry is art. Excellent code is certainly worthy of pursuit, laudable to master, but it will never be art. Speaking as one who loves to code, but hates to debug it, I’m thankful that is so.


Lucid Outlining Application

I love to outline, but I hate all of the outlining applications I’ve used. I want a simple, open, and free outlining app that works the way I want it to work. So I decided to make my own.

Lucid Outlining Application is my first attempt at creating an outlining app that does only one thing well: make outlines.

It is completely browser based and freely available. It will work with any modern browser which supports HTML 5 and advanced CSS. Unfortunately this means that no version of Internet Explorer works, but all three of the major competitors: Firefox, Safari, and Chrome, work just fine. (Since all three of those are free and available in cross platform versions I do not feel too bad about the lack of support for IE).

Main features

  1. Convenient keyboard shortcuts for fast editing
  2. Supports rich text entries (uses browsers native “contenteditable” attribute)
  3. Saves all data to local hard drive using HTML5′s local storage
  4. Free!

Lucid Outlining Application


Blog theme under development

I recently redesigned my main website, and now I’m finally getting around to making my blog match. Some things may not work properly so please bear with me. Of course, you can also feel free to contact me with any thoughts or suggestions.


Google, numerology, and what’s on our (collective) minds.

After reading this post about Google’s “suggest” feature, I was inspired to do a little experimentation of my own. What I found was very intriguing.

You are probably already familiar with Google’s suggest feature. As you type anything into Google’s search box, it automatically suggests completions based on the most popularly searched phrases. For example, type in “how to”, and Google will helpfully suggest “how to tie a tie“, and “how to kiss“. Clearly there are a lot of men who need to know how to impress their date!

Instead of questions, however, I wondered what would happen if I started typing in numbers? So I started with “1″ and just kept going. Try it yourself, but be aware that there is often a big difference between just the number (i.e. “1″) and the number with a space after it (i.e. “1 “). Be sure to do them both as you go along.

What I found interesting is that somewhere between the number “4″ and the number “11″, the phrase “X weeks pregnant” begins to show up every time. By number “13″ or “14″ that phrase is near the top and stays there until you hit “41″, especially when you insert a space after the number. Around the number “26″ you start seeing other issues concerning pregnancy, such as “weight gain”, and “what to expect”, or “fetal pictures”. This is a fascinating insight into what concerns women when they are pregnant. The closer you get to “40″ you can almost sense the desperation set in, it’s surreal.

I haven’t systematically worked through the 3 digit numbers, but I didn’t immediately discern any trends between 42 and 100. Most of the 3 and 4 digit numbers appeared to be address searches, and of course, 5 digit numbers tended to be zip code inquires.

The address results are interesting. Why are some addresses searched enough to make it on this list? Try “3837″ for example. For me it returned addresses from California, Texas, and Illinois. What is so interesting about “3837 bayview circle concord ca”? Google maps doesn’t list any businesses near that address. In fact, it’s a relatively normal looking house; you can see it on street view. Who lives here, and why is he so interesting?

Have you found any strange numerological insights or quandaries in Google’s “suggest” feature? Let me know in the comments


New website design

For the first time in almost 5 years I’ve redesigned my main website: www.lucidgreen.net. This is a complete redesign, including a total reworking of my content and it’s organization. All I can say is, “finally!”

My old website was okay, aside from being difficult to maintain, poorly worded, and in dire need of proof-reading, it got the job done. The new site is a lot more personal, far more user friendly, and dramatically simplified.

I hope to have my blog design updated shortly to match so that there is a true seamless integration. In the meantime, I’d love to hear any comments on the new design. Thanks!


Recent tool discoveries

Here is a very brief rundown of some of the new tools/tricks I’ve been using.

Komodo Edit. An open source code editor.
Wow, this thing rocks! So far I’ve only used it for HTML, CSS and Javascript editing, but I’m impressed. It’s free, cross-platform, has an impressive feature set, and is easy to use. FTP/SFTP is built right in, and it even highlights closing tags in HTML!

Superfish: a cross-browser drop-down menu builder.
After hating drop-down menus for nearly a decade, I’ve suddenly had a change of heart. When they work well, they’re great, they save space for the designer and time for the users, but when they don’t work well users and designers alike curse the internet gods. Superfish has played a key role in changing my mind. Of course, the process of getting a Superfish menu to work in every browser (ahem, IE6) is still a little bit finicky, but it’s nothing like what I’ve experienced in the past.

Jquery Cycle Plugin: a Jquery (javascript) slide show script with lots of features.
This is a pretty amazing little script, it takes a div tag full of images and instantly transforms them into a cool looking slideshow. There are an impressive number of features, and options, but I appreciate just how quickly I can create a fancy javascript only slideshow which degrades gracefully.

CSS – Clearing floats without extra markup: a trick I wished I had learned years ago.
This is an amazing trick, every web developer who has ever wanted his containing div to wrap fully below two nested and floated divs needs to read this now!


Snow Leopard: and late night upgrade experience

Just because I’m already tired of the “horror” stories from those who, like me, upgraded their macs to Snow Leopard last night. Here’s my experience.

11:44 am: Fedex attempts to deliver the package from Apple, but no one is home to sign for it, so they leave a nice note saying exactly when and where I can pick it up if I’m so inclined.

1:00 pm: Fedex gives me a courtesy call to tell me I missed my package. How thoughtful!

5:00 pm: I arrive at the Fedex shipping center. The friendly worker finds my package and says, “Have a great evening!”

5:30 pm: I arrive home and begin to prepare for dinner with friends. Installation must wait.

7:00 pm: Friends arrive for dinner. Installation still on hold.

11:00 pm: Friends leave, dishes started.

11:15 pm: Installation begins. Insert DVD, click OK a few times. Walk away to take a shower and brush teeth.

12:15 am: Installation complete. Computer runs flawlessly.

12:30 am: Still no problems, all my apps run nicely, new features are fun.

12:45 am: go to bed.

That’s it. I’m happy to report things are still running fine. If something blows up I promise let everyone know! (Not that you care, and if you do… find a hobby!)