angel's landing

Our first day of hiking in Zion National Park was great! Here is our goal for the day:

IMG_7451.JPG


From the bus stop known as “The Grotto” we hiked 2 miles and 1,800 feet up to the top of Angel’s Landing. The hike to the saddle point in the middle of the picture was a fairly easy hike on nice wide switchbacks. The rest of the hike was more exciting. The park service has helpfully installed chain handrails to help you climb over any rough spots or to help pull yourself up the steep bits.

Here’s a picture of the Miller’s at the saddle point:
IMG_3676.JPG


Here you can see an example of what the last part of Angel’s landing hike looks like:
IMG_3659.JPG



Here’s a picture of Kaia and I at the top
IMG_7524.JPG

phoenix to springdale

Long day of traveling today. Left Minneapolis at 9:05 this morning and just got into our room in Springdale UT at 11:00 Mountain time, or midnight back home. Actually we checked in a while ago but went straight to the Bit and Spur to have some dinner since our last meal was at Schlotzky’s in Phoenix.

The GPS said it would be a 7 hour drive. it turned out to be longer than that because we took a side trip to the Desert View overlook in the Grand Canyon. Here is a view from the Desert View of the Colorado River. We’ll be rafting down that river and into the canyon in just a few days. We will be able to see the watchtower from the river on our way into the canyon!

IMG_7394.JPG


It was still quite a drive from the Grand Canyon to Springdale UT. Along the way we crossed the colorado river just south of where we will get on the raft.

IMG_7426.jpg


We drove through Zion National Park in the dark. We are all looking forward to a great day of hiking in Zion tomorrow.

mit uses python instead of scheme for intro cs

I’ve seen several interesting blog posts related to MIT switching from Scheme to Python for their intro course. This is really interesting to me since SICP is one of my favorite CS books of all time. Nevertheless I’m glad to see leading institutions change to my favorite language.

Paraphrase of Gerald Sussman’s remarks

Dan Weinreb’s blog

vpython version 5

The other day I discovered that the folks working on VPython have been very busy over the last couple of years. I had given up on VPython because the Mac distribution was so difficult to use. It required the X windows server and one point and lots of other extra junk at other times. But now things are easy! There is a great installer package and it just works.

For those of you who have not heard of VPython before it is a 3D graphics module called visual built on top of Python and OpenGL. You can do a lot of nice 3D graphics very simply with VPython. Its great for education in math and physics and introductory computer science.

So as an experiment I built a turtle graphics module on top of VPython. I use turtle graphics a lot in teaching but the TKinter turtles all suffer from some event loop problems when you use them with IDLE. VPython does not suffer from this problem plus gives you a lot of other cool benefits. One of the benefits is that the window resizes automatically for you based on the units you use in your application. Want to draw a picture at the atomic level of detail? No problem, want to draw planets circling each other? Again no problem.

Here’s a screen capture of a fractal tree created in 3-D using my new turtle.

Picture 2.png


Here’s the VPython turtle code:


def tree(t,trunkLength):
if trunkLength < 5:
return
else:
turnDz = random.randint(20,40)
turnDx = random.randint(20,40)
trunkShort = random.randint(10,20)
t.width(trunkLength/10.0)
if trunkLength < 25:
t.color(color.green)
else:
t.color((174/255.0,145/255.0,0))
t.forward(trunkLength)
# right trunk
t.right(turnDz,ZAXIS)
tree(t,trunkLength-trunkShort)
# left trunk
t.left(2turnDz,ZAXIS)
tree(t,trunkLength-trunkShort)
# front trunk
t.right(turnDz,ZAXIS)
t.right(turnDx,XAXIS)
tree(t,trunkLength-trunkShort)
# back trunk
t.left(2
turnDx,XAXIS)
tree(t,trunkLength-trunkShort)
# restore
t.right(turnDx,XAXIS)
t.backward(trunkLength)



If you want to check out the turtle module and play with it, you are welcome to do so: hg clone bitbucket.org/bnmnetp/v… Or send me mail.

book plug

Here’s a little plug for our book from our Colleague Mark Guzdial at Georgia Tech. This was written last September right after the book was published but I didn’t find out about it until this morning. Thanks Mark!

In addition, David and I have started a new blog to post corrections and updates to Python Programming in Context Over here If you are already using the book please check it out.

remember the milk

In the past year, I've been a passionate supporter of three task management apps. OmniFocus, Things, and Remember The Milk (RTM). I've switched back and forth between them trying to decide which one works best for me. I think I'm finally ready to commit to RTM as my long term solution and here's why.

All three apps have an iPhone component and a desktop component. Although the primary RTM interface on the desktop is through the browser there are plenty of Widgets and other desktop friendly ways to access RTM on the desktop. What I really like about RTM for the desktop is its openness. In terms of the ability to dump stuff into RTM its cloud computing model really works.

With both OmniFocus and Things I have to be on the same subnet as my laptop in order for the wifi syncing between my Ipod Touch and the desktop to work. Unfortunately outside of my house this is rarely the case. With RTM I can be anywhere. That means I'm free to roam anywhere in the world with my iPod Touch and I know that when I dump a task or note into RTM it will be there on my desktop or the web interface when I come back to it. If I forget my iPod Touch (a very unlikely event) I can still dump tasks into RTM from any browser.

The second thing I really like about RTM is its openness. As you can see from my posts below I have developed my own desktop interface to RTM using the Python bindings and LaunchBar. The three things that I want to do most often, with as little fuss as possible are:


  • Add a task

  • Mark a task as complete

  • display tasks

With my LaunchBar integration I don't ever have to take my fingers off the keyboard to do any of those tasks.

When I'm using my iPod Touch, I think that the RTM client is the best and most fully featured of the bunch. Since RTM has been around as a service for longer than either Things or OmniFocus they have had more time to work on polishing their iApp. It already supports tagging and searching. Things that are coming in the other apps but are already here for RTM on the iPod today.

Because RTM has an open API there are lots of other nice interfaces for you to use that make it easy to dump tasks and notes into your inbox. Do you Twitter? Send a direct message to your RTM inbox. Do you Text? Send using the Twitter RTM gateway you can text directly to your inbox. Email? yes. You can even email a whole list of stuff to RTM as a way to quickly import a long list of tasks or packing items you have copied from somewhere else. Jott, yes. The possibilities are endless and expanding all the time.

python + growl + remember the milk = launchbar task management

Intro


Once I could add tasks to my RTM account through LaunchBar I wanted a way to quickly pull up a view of what tasks were due today through LaunchBar. The Growl library provides a nice way of doing this.

The overview is as follows: Activate LaunchBar and type due. This due is installed as a search shortcut and you can search for today, tomorrow, or all (abbreviations are also easy). The search shortcut runs the python script that searches your tasks on Remember the Milk. For each task it finds it puts up a sticky Growl notification so you get a nice list of tasks on your screen. You could easily customize the script to put all the tasks in a single notification but I like them separate.

Since the Growl module registers this script as an application you can also use the Growl Preference Pane to customize the look and feel or even the location of your notifications. You can also customize whether you want the notifications to be sticky or not.

The Code


Here is the code for doing all of this. It makes use of the filter parameter on getList.


#!/usr/bin/env python

from rtm import *
import sys
import Growl

def sendNotify(ts):
if type(ts.task) == list:
for j in range(len(ts.task)):
notifier.notify("today","Task Due: "+ts.task[j].due[:10],ts.name,sticky=True)
else:
notifier.notify("today","Task Due: "+ts.task.due[:10],ts.name,sticky=True)

if len(sys.argv) == 2:
command = sys.argv[1]
else:
command = "today"

apiKey = "get your own"
secret = "this too"
token = "You will create this"

name = "RTMDue"
notifications = ["today","tomorrow"]
notifier = Growl.GrowlNotifier(name,notifications)
notifier.register()

if command[:3] == "tod" or command == '':
cutoff = 'today'
elif command[:3] == "tom":
cutoff = 'tomorrow'
else:
cutoff = None

rtm = createRTM(apiKey, secret, token)

if cutoff:
filterString = 'status:incomplete and (due:%s or dueBefore:%s)'%(cutoff,cutoff)
else:
filterString = 'status:incomplete'

theTasks = rtm.tasks.getList(filter=filterString)

if type(theTasks.tasks.list) == list:
for i in range(len(theTasks.tasks.list)):
if type(theTasks.tasks.list[i].taskseries) == list:
for j in range(len(theTasks.tasks.list[i].taskseries)):
ts = theTasks.tasks.list[i].taskseries[j]
sendNotify(ts)
else:
ts = theTasks.tasks.list[i].taskseries
sendNotify(ts)
else:
if type(theTasks.tasks.list.taskseries) == list:
for i in range(len(theTasks.tasks.list.taskseries)):
ts = theTasks.tasks.list.taskseries[i]
sendNotify(ts)
else:
ts = theTasks.tasks.list.taskseries
sendNotify(ts)



Next Steps


It would be great if I can figure out a way to have the Growl notification box call a script to mark the task as done. Feel free to leave comments or suggestions or improvements in the comments.

a mid-winter cycling treat

Although the weather back home may have been below zero, in Northern california he sun was out and it was 68 degrees. Perfect weather for a bikeride. So after talking to the nice folks at the Palo Alto Bike Shop Wes and I rented a couple of nice demo road bikes from Calmar bikes in Santa Clara. Calmar is right by our hotel and the staff there was super friendly and helpful in getting us set up for a ride. Incidentally Calmar has no relation to Calmar IA. I road a nice Spanish BH RoadROM and Wes road a hot pink Trek Pilot 5.2. Even though the bike was pink we felt pretty good passing all the californians on the way up Old La Honda Road.

Rather than head out from the hotel on the busy city streets I decided to take Novian’s advice and head into the foothills west of Palo Alto. You can see the ride we took on the map below. This is from a cool website called mapmyride.com that I will use in the future for keeping track of my rides.



The ride was just beautiful even though we had to climb 2500 feet to get to the view. On the way up we road through some big redwood trees.

Redwoods on Old La Honda Road


Once you get on Skyline drive you can see the ocean on one side and the Valley on the other. Here’s me, I look more tired in the picture than I actually felt! Really, Honest!

Brad -- Looks tired after the long climb

The rest of the ride is a long coast down Page Mill Road and then some flat riding past the Stanford Dish and the Stanford Golf course. It would have been fun to stop and play 18 holes but I didn’t have my clubs with me.

creating a group twitter repository

For the trip to Silicon Valley I wanted to have everyone be able to twitter about the experience using their own twitter account, but I also want to have a central place for everyone following the trip as a whole to see all of our tweets. How to do that? Python and the Twitter API to the rescue. You can see the results of this by checking out @lutherlive on twitter


import twitter

USER = “Your group account”
PASS = “your group password”
TAG = “tag contained in each message”

api = twitter.Api(username=USER,password=PASS)

# figure out when my last post was
statuses = api.GetUserTimeline(user=USER)
last_post = statuses[0].GetCreatedAt()

# Get the timelines for all friends since my last_post
tl = api.GetFriendsTimeline(user=USER,since=last_post)
for post in tl:
# since my posts may show up in friends timelines avoid reposting loop
if post.user.screen_name != USER and TAG in post.text:
api.PostUpdate(post.user.screen_name + “: " + post.text)


This little script logs in using the twitter account you create for the group. Importantly, this account must follow all of the group members that you want to be able to re-tweet. When one of the group members wants a tweet to show up on the group account they must use the TAG, in our case @lutherlive, somewhere in their post.

After logging in, the script grabs the timeline for all of the members of the group. This timeline is restricted to the posts since the last a post was made by the group user. This is important to do otherwise you would end up with duplicate re-tweets every time the script is run.

Next the script simply loops over all of the posts and checks for the tag. If the tag is in the post the post is updated along with the screen name of the original group member that made the post.

I put the script into a cron-job on the computer science server at Luther to run every 15 minutes, so while the @lutherlive user isn’t a real time reflection of its group members tweets, its pretty darn close.

A Long Long Day

A Long Long Day

Not much to report today. We got up and rode the shuttle to the airport, we checked in, our flight was on time, we sat on the plane for 8 hours. Now we are sitting in the O’hare terminal hoping that everything will continue to be on-time for today.

We told the kids this morning that they were essentially getting up at midnight back in Iowa. So by the time we get hope tonight (hopefully by 7pm) they will have been up 19 hours. Josh of course immediately volunteered to stay up until midnight just so he could say he had stayed up 24 hours.

Summary Report:

Favorite City of the Trip:

Zermatt and the Matterhorn - Dad Venice - Mom Rome - Josh Rome - Kaia

Favorite Meal

Casa Masi -- Dad The Pici pasta really did it for me. breakfasts and fruit in Paris -- Kaia Pesto Ravioli at Grampis -- Kaia Barbeque night in Zermatt -- Josh

Worst Meal

The venice meal with Ulrings -- Dad

Souveniers Purchased:
Josh:
  • Totti Shirt
  • Roma baseball hat
  • Italia Sweatshirt
  • Swiss army knife
Kaia:
  • Swatch
  • Mirror
  • New dress
  • Ciao Bella shirt
  • Shirt
  • purse
  • necklace
Mom:
  • purse
  • necklace
  • swatch
Dad:
  • Italia warmup suit
  • Capri pants