Wednesday, May 28, 2008

Public Google Forms and Spreadsheets for Dummies

Here's step-by-step instructions on how to create and publish a Google spreadsheet, together with a web-based form that makes entries into it.

You could use this for everything from arranging rides to scheduling a party.
  • Go to https://docs.google.com
  • Click on New and choose spreadsheet.
  • Click on the title, "Unnamed Spreadsheet", and enter a title.
  • Enter column headings into row 1, across the top.
  • Click on the "Share" tab.
  • Under "Invite people:" choose "to fill out a form."
  • Click on "Start editing your form..."
You'll now see a form with the title you gave the spreadsheet, and a slot for each column.
  • Fill in the box below the title, which says "You can include any text or info that will help people fill this out."
  • Press "Next, choose recipients."
If you want email the form, fill in the To: list. Otherwise, just go on.

Now to embed the form in a web page,
  • Click on "Embed", in the upper-right-hand corner.
  • Copy the link location to that web page, as instructed.
Next, we publish the spreadsheet, which will change as folks fill out the form:
  • Go back to the spreadsheet and click the "Publish" tab.
  • Press "Publish now".
It will give you a URL where folks can see the spreadsheet, but that's not what you want yet.
  • Click the bottom link, "More publishing options."
A window will pop up called "More published formats."
  • Click "Generate URL."
  • Copy the link location and paste it into whatever web page you want to display the spreadsheet on.
You now have one web page with a form folks can enter data into, and another that's the spreadsheet to display the data.

Ta-da.

What are That Spreadsheet and Form About?

A couple of posts back, I have a spreadsheet and a form, with no explanation.

Here's why I posted them, and a how-to:

Last weekend, I went to a music festival put on by the New Mexico Folk Music and Dance Society (FolkMADs), in Socorro, NM. The weekend before, I went to a local festival, the Colorado Planters' Moon Festival, in Gold Hill, CO.

I had to arrange airport transportation for both. Last weekend, I had to get between Albuquerque to Socorro. The weekend before, I helped out-of-town folks get from DIA to Gold Hill and back. My arrangements for the MoonFest were ad hoc, but Lisa Bertelli published a spreadsheet with ride arrangements for New Mexico: one sheet with riders, one sheet with folks offering rides.

Lisa's scheme seemed much better.

I wanted to see how easy it would be to set up something like hers with a Google spreadsheet, because doing so would make it possible to embed the spreadsheet right in the website for a festival, where folks could fill in their needs or offers themselves.

It was dead easy, and the posts are a demo. The next post is a step-by-step.

Thursday, May 15, 2008

Working Under Test-Driven Development

We're trying to submit some u-boot patches at work. The maintainer, Wolfgang Denk, has given us several useful suggestions about formatting.

First-cut, I wrote a utility that, I thought, would reformat code correctly. Not enough.

Yesterday, Jim Black, who's making the fixes, told me that instead of a pretty-printer, he wanted something that would just tell him when there were problems. I can do that.

"Also, there's a lot more rules," he said, showing me his growing list.

This time, I decided to create the screening tool using test-driven development:
I'd write a test case and a test, then write the code. I'm not done yet, but I have a growing suite of tests that test a tool of growing capability.

And, as we learn new rules, I'll just add tests as I add the capabilities.

This morning, in the shower, I thought of a fundamental design change I want to make to the overall tool. When I do it, I'll just run it through the test suite, to make sure it works.

Stay tuned.

Wednesday, May 14, 2008

Interesting Blog Spam

I got two interesting pieces of blog spam today, on an older blog. Both looked like email from a real person, but with links to ads. Either someone's typing these in, or there's a marvelous piece of code out there.

Both were comments on google-calendar-related posts. The first reads only

italian property has left a new comment on your post "Google Embeddable Calendar Helper":

I use this and must say it is a great resouce.

The second is
Helen Siff has left a new comment on your post "Calendaria":

I use an electronic calender with reminders today it beeped to tell me of my doctors appointment and again about one and half hours later that I need to buy my home base furniture, I could not live without my calender it is so useful.
They're really different from one another -- one only has a link in the commenter's name, the other right in the comment. The second message also has much more content.

Both are calendar-related. Both have spelling mistakes. Still, they're pretty interesting pieces of work.

Tuesday, May 13, 2008

Git Stash Lets You Snapshot All Your Stuff

I keep the home directory on my laptop under git.

Last night, I read a trick in a good article, Git from the bottom up, by John Wiegley, that I tried out this morning.

git stash stashes away the current state of your world (the index), and replaces it with the HEAD. git stash apply restores the stash. The pair snapshots your work, but leaves it unchanged.

I now run this command as an hourly cron job:
#!/bin/bash
# snapshot the current repository

git stash
git stash apply
Here's the crontab entry:
# | hour (0-23)
# | | day of the month (1-31)
# | | | month of the year (jan-dec)
# | | | | day of the week (sun-mon, with 0=sun)
# | | | | | command
# | | | | | |
#

01 * * * * ~/bin/snapshot &> /dev/null
The snapshots, however, are all accessible through the reflogs, which means that my states are stashed, hourly, invisibly to me, but I can get them back pretty easily.

If there have been no changes, git stash notices, and does nothing, so the hourly job doesn't fill my logs with irrelevant entries.

Very nice.