Simple sleep timer with AppleScript

As you may already be aware, I have a hard time falling asleep at night. My parents suggested that I get a TV for my bedroom and use that to put me to sleep. That would probably work, but I don’t feel like buying another TV right now. I already have a laptop stand and a laptop, so I’m going to be trying that tonight. Maybe I’ll find something on Hulu or YouTube or a cable channel’s site, or perhaps I’ll just watch whatever Leo is rerunning on TWiT Live. The only problem is that my computer is lacking a simple feature that is on most TVs: a sleep timer. Yes, I could go into my settings and set the sleep time to any period of time, but I don’t want to have to keep remembering to reset it back to its normal value the next morning. I’m sure there are freeware utilities which can accomplish this, but I was feeling a little geeky on WWDC Eve and decided to do some development myself.

It has been years since I’ve done anything with AppleScript, but a few minutes of Google searches and a couple of guesses had me create this:

tell application "Finder"
display dialog "Sleep time:" default answer "1"
delay (text returned of the result) * 3600
sleep
end tell

The script (or compiled application as I eventually saved it) asks the user how many hours to wait until putting the computer to sleep, and then sleeps the computer after that amount of time. The user input is multiplied by 3600 since it takes input in seconds. The script is very simple and doesn’t do any error checking, but it does what I want and it took longer to write this blog post than to write the script.

Google squared

Google Squared is now available in Google Labs.

With Google Squared, you can choose a category of things you’d like to compare (like Colorado ski resorts), and then choose which attributes you want to look at for each item. It will automatically populate a few rows and columns for you, but it’s most useful if you really make it your own, and remove rows and columns you don’t want to see, and add rows and columns that you do want.

For example, right now for [Colorado ski resorts] I get columns labeled “Image,” “Description,” “Location,” “Snowmaking,” and “Telephone.” Out of these, I really just want location, so I can hit the “X” on all of the other columns. But I noticed that one of my favorite destinations, Telluride, isn’t in the list. So, in the lower-left of the Square where it says “Add items,” I type in “Telluride” and then click “Add.”

Now that I have a good list of resorts, I want to get an idea of how much skiing I can get done there. So, in the upper-right of the Square, I add columns for “Longest Run,” “Skiable Area,” “Base Elevation,” and “Summit Elevation.”

Here’s a video of me running through the above steps:

From here, I can edit any Square manually. This is automatically generated, so sometimes you need to clean things up a bit or just want to make your own notes. You can also just start with an empty Square and add items and attributes individually if you’re not getting the results you want with a search or want a more specific starting point.

Let me know in the comments of any particularly good (or hilariously bad) Squares you find. And when you’re done playing around with Google Squared, check out this great post about GoogleLookup by Beah. It has like a billion page views.

Behind the scenes!

This will be about Google, but please remember this is my personal blog so nothing here is the official word of my employer. It’s all mine.

Today we released a fun video on the Webmaster Central YouTube channel that shows what goes into producing a video for the channel:

Going a bit beyond what’s covered in the video, here’s the basic process:

  1. Matt is lured into the room using the scent of Pinkberry yogurt.
  2. We record the video.
  3. I transfer the video to a Macintosh Quadra 840AV and edit.
  4. After editing is complete, I copy the final video file to a set of floppy disks. That’s right, disks. Plural. Since we shoot in HD, the files are so large that a single video often spans multiple 1.44 MB double-density disks.
  5. The disks are uploaded to the YouTube office in San Bruno via data packets. One is pictured below:

inter-office envelope addressed to YouTube

Just kidding. 😉

The message I wanted to convey when Matt put me on video was that our setup isn’t really something that’s limited to a large company with a big media budget and staff. We’re using mostly “prosumer” level stuff, and you could get similar results by purchasing equipment today at even lower prices. Any standard video camera should be fine to get you started, and even a camera built in to your computer can work, depending on what the content of your video is. HD is a bonus, and well under the “thousand dollar range” I guessed in the video. But the most important thing isn’t which camera you buy, it’s how you use it. So rather than getting into the specifics of the equipment, I’m going to go over a few things you can do to set your video apart from the other 20 hours of video uploaded each minute to YouTube.

Get decent audio. I’m putting this first because it’s often overlooked by the producer, and is incredibly annoying to the audience if it’s bad. If you can get a microphone, that’s great. If you have to use the camera’s built-in mic, make sure the room is free of background noise (air conditioners, refrigerators, crowds, etc.), and have the talent speak loudly and clearly as if presenting to a large group. If your camera has a headphone jack, plug in some headphones and listen to the sound as you record.

Use a tripod, and don’t zoom. If you need to get a closeup of something, try cutting to a closeup instead of making the user watch a zoom. It’s much easier to get a nice image when the frame doesn’t move. If you’re unsure about how to compose your shots, start by looking up the “rule of thirds.”

Make sure the subject is well-lit. We actually don’t have any video lights in our rig at this point, and conference rooms tend to have pretty ugly lighting when it comes to video. So whenever possible, I try to pick a room that gets natural sunlight, or even go outside (just watch your audio!). Sunlight looks a lot better than fluorescent. If you’re especially lucky, you can find a room with windows on two walls. Then, you can have one window light your subject, and use the other as a background without your subject turning into a silhouette. Whatever you do, make sure your video isn’t too dark. Video cameras do not do well in low light, and after compression the image may be even harder to see. If you do need extra artificial light but don’t have a pro rig, you can get any bright light and then diffuse it by bouncing it off of a white wall or ceiling. I did this with a workshop light from Home Depot in the reconsideration video and also in my cooking shows.

Use manual focus, especially if your autofocus is fidgety. A quick way to handle this on cameras without a focus ring is to zoom in on the subject’s eyes, let it auto-focus, and then switch to manual mode so it’s set on that focal length. When you zoom out, your subject will remain perfectly focused.

Upload using the correct aspect ratio. Don’t stretch or squash your videos from their native dimensions. If it looks funky after you upload, try one of the tags listed in this YouTube blog post.

If you’re using Final Cut and are mixing in images, leave everything in its native format in the timeline, then export directly from the timeline to your final file. Your screenshots will be super-crisp if you don’t export them to a movie file (in a format like DV or HDV) first before compressing. If you do any kind of scaling of the images and your sequence is set to an interlaced video format, set the field dominance to “none” in the sequence settings.

COPS

Bad: Getting arrested.
Worse: Getting arrested on an episode of COPS.
Even worse: Having your clip chosen for the theme song sequence shown before every episode.

Maker Faire

I attended my first Maker Faire today. If you want to see some of the fun stuff I experienced, check out my photos and videos.

Some of my favorites:

Ever see two large Tesla coils in action? It’s pretty fun, and they’re my second favorite thing named after Nikola Tesla:

Monkey Lectric was letting people draw on bike wheels using LEDs. I drew this:

From Maker Faire 2009

After my design was scanned, it appeared on a spinning bike wheel:

From Maker Faire 2009

EepyBird was there too. They’re famous as the “Diet Coke and Mentos Guys.” They explained why they use that specific combination, since putting just about anything bumpy (like your finger) in a carbonated liquid will cause some amount of bubbles to appear in a process called nucleation. You can read more about it, but the basic takeaways are that mint-flavored Mentos are blasted with over 40 layers of sugar, and therefore especially bumpy. Diet soda is used for the performers’ sake, because it is sugarless and therefore healthier not sticky. Here’s a shot of them in action:

From Maker Faire 2009

And one of their more recent experiments, which has been seen by the inventor of Post-it notes:

I didn’t buy any crafts to bring home, but there was one that I wanted to:

From Maker Faire 2009

I’ll have to bring more cash next time.

Special thanks to Tiffany and Mohit for giving me a ride back to my (non-electric) car.

Remotes

The next time I have some extra cash, instead of upgrading to a larger TV, I think I’ll just put all the money towards extra remote controls. I can then scatter them throughout my apartment, so I’ll never again have to experience that moment where after getting settled on the couch, I realize that the remote is sitting on the kitchen table.

Up

I went to a midnight screening of Up tonight in 3D. Don’t worry, I won’t post any (major) spoilers; I should probably be getting to bed anyway. A few quick thoughts:

  • It’s a good movie, and this was expected. Pixar doesn’t make bad films. It has a good story and Pixar-level humor.
  • Yes, there’s a new short before the feature, and it got a lot of laughs.
  • I honestly could have done without the 3D. Some fast-motion segments just seemed blurry, and the perspective often felt a bit off. Fortunately there weren’t many gratuitous 3D show-off shots, so it will look fine on any screen. I look forward to seeing it again in full 2D clarity.
  • Yep, John Ratzenberger has a part. A quote from Cars: “They’re just using the same actor for every movie! What kind of cut-rate production is this?”
  • I need to find a snooty theater around here so I don’t have to listen to stupid comments about how every preview is lame.
  • Garrett Popcorn is good. (Thanks, Ai!) And it looks like their webmaster heard that bold text is the secret key to number one rankings for any key phrase.
  • Favorite quote from Ai: “Did you tweet?”

Zing!

I was totally burned by Matt today in a meeting.

We started the day with an 8 AM meeting together (video conference with Europe), and I thought I was going to get through the day with the upper hand when Matt went to the wrong room (he blamed the early time), using state-of-the-art technology to connect two Mountain View rooms that were only separated by the floor/ceiling as his room was directly below mine. Man, he must have felt pretty silly for those 30 seconds before he came upstairs.

As the meeting went on, my phone started beeping loudly on I believe three different occasions, even prompting Matthew to send me snarky trans-Atlantic comments about the disturbances via IM. Each time it started beeping I scrambled to turn it off, but wasn’t able to silence it quickly since I’m still not an Android ninja (I haven’t switched back to my iPhone). So there I was, spending most of the hour looking like a bumbling technologically illiterate fool who doesn’t know how to put his phone on vibrate at work.

What had happened was that since I use my phone as my alarm clock, and I’m usually not at work (and often not out of bed) during the hour of the meeting, my alarms were going off, which logically isn’t subject to the restrictions of “silent mode.” And it wasn’t just a single disturbance because I’m so not a morning person that I have five alarms set on my phone: 5:00, 6:00, 7:00, 8:30, and 9:00. I think we heard the 8:30 and 9:00 alarms, and I may have accidentally snoozed one making it go off twice. Why starting at 5 AM? Because as much as I’m not a morning person, I want to get into work early. It hardly ever happens.

Anyway, in a later meeting, Matt was the last to arrive. I thought it would be hilarious to bring back an old team tradition where the last arrival had to tell a joke. Just as I called him out, someone else’s phone rang. Without missing a beat, Matt asked, “Wysz, is that your phone?” The rest of the group looked at him, confused. He simply said, “That’s my joke,” and sat down.