14 November 2007

Online Audio Books

I changed jobs recently. I am now working at Omniture, Inc. This has been a great move except for one thing…the commute. I know, I know, forty minutes to an hour is not that long of a commute by many peoples standards, but it takes me away from my family for an extra couple of hours a day. This is unacceptable to me so we are planning on moving to fix the problem. In the mean time, I have found something that at least makes the commute much more enjoyable: Audio books online.

There are quite a few different online audio book websites. I am just going to discuss my favorite. LibriVox provides over 1000 free audio books from the public domain. Volunteers record themselves reading books and make them available on the LibriVox website. All recordings are placed in the public domain.

There are several options for reading or listening to your chosen story. The full text is made available from the Gutenberg website. There are links available to Wikipedia telling you more about the author and the book you are looking at. The recordings are archived at the Internet archive website. The archive website makes the recordings available as mp3 files at either 64kbps or 128kbps as well as in the ogg vorbis format. You can also download the mp3 files as a zip file or listen to it as a streaming broadcast. LibriVox makes links available to quickly subscribe to the story as an iTunes Podcast. You can also join an email subscription to have the story sent to you one chapter a day. In other words, LibriVox has done all they can to please your listening preference.

I have listened to quite a few different stories now and have found most of the recordings to be of a good quality. They are certainly better than listening to repeatitive news casts or obnoxious DJ’s. In fact, I enjoy the books a lot. It has made my commute very enjoyable.

27 August 2007

Winger’s Original Buffalo Wings Sauce

I deep fried some wings tonight for dinner. I found a recipe on the web for Winger’s Original Buffalo Wings Sauce. The recipe I used was not correct though. It called for 2 1/2 cups of brown sugar. It was more like carameled wings then buffalo wings. Pretty bad really. I have put a corrected version below so I will not make that mistake again.

1 cup firmly packed brown sugar
3 tablespoons light corn syrup
1/3 cup Frank’s Red Hot pepper sauce
1 tablespoon apple cider vinegar
1/2 cup hot water

Place brown sugar and corn syrup in medium saucepan and melt over medium heat until boiling. Cook for 3 minutes, stirring constantly or it will burn. Add hot water, pepper sauce and vinegar. Stir all ingredients together well and continue cooking at a low boil, stirring often until mixture has reduced to a syrupy consistency (about 15 minutes). The sauce will thicken considerably as it cools. You can adjust the amounts of Frank’s Red Hot and water to get the right amount of spice for your taste. Some people like only Hot sauce and no water.

11 August 2007

2007 Backpacking highlight video

I created a short highlight movie of some of the backpacking trips I went on this summer with our boy scout troop. I created the movie with iPhoto and iMovie. It was surprisingly easy. After finishing I remembered one of the apple ads. “Better Results” is the personification of how easy it is to create a very nice movie. There is sample music, useful clip transitions, easy music adjustments, clip effects, and many more useful tools. The tools are available, but more than that, they are easy to use. It took only about an hour to build the movie, and upload it to YouTube. It was fun to waste the hour creating the movie.

paul

10 August 2007

I've started a book

So I have been working at FamilyLearn for over a year now. I am finally getting around to writing my own book. I got the idea when my son start talking about “three fingered Jack.” I had made up a ghost story on our vacation to the Oregon coast. The kids were restless and I saw a sign that read “three fingered Jack.” I don’t know what the sign was there for, but it gave me an idea for a story. So I started to make up a story about a man named “three fingered Jack”. It was silly and I didn’t think the children even listened…but now months later I hear my son talking about it. This experience made me think that I should record these stories. Hence the book.

The experience writing the story (from a technical point of view) has been very good. The system is working much better than it ever has before. It is actually fun to write there. I didn’t think I would like writing in a web browser, but it was really not too bad. I want to write a few more books and put together some gifts for people as well. But, one at a time is probably best.

My mother is writting a personal history about her father. It has been a lot of fun helping her edit the book and organize ideas and so forth. I can’t wait to see the finished book.

paul

03 August 2007

Closed in the Last 7 Days

I use trac for most of my project management purposes. One issue I had for quite some time was that I did not have a report showing me what tickets were closed in the last x amount of time. After studying the stock reports and digging through the database I found what I needed. The following query generates a report showing a list of closed tickets over the last 7 days (actually 604800 seconds).

SELECT id AS ticket, summary, component, version,
priority, t.type AS type, owner, resolution,
changetime AS _changetime, description AS _description,
reporter AS _reporter
FROM ticket t
LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority'
WHERE status = 'closed'
AND _changetime > (strftime('%s','now')-604800)
ORDER BY changetime DESC

I hope this report will help someone else. Enjoy!

01 August 2007

Flower in the crannied wall


Flower in the crannied wall,
I pluck you out of the crannies;—
Hold you here, root and all, in my hand,
Little flower—but if I could understand
What you are, root and all, and all in all,
I should know what God and man is.

Alfred, Lord Tennyson

29 July 2007

Mt. Timpanogos Hike

This weekend I spent 3 days backpacking around Mt. Timpanogos. It was a great trip. My neighbor and I took 5 boy scouts on the trip with us. We left from our homes on Thursday about 7:00am. We parked just above Aspen Grove and began our hike.

The first part of the trail is actually paved. Some time ago there was a one foot wide trail of blacktop laid. It turns out that this is not very nice on sore knees. Shortly after the pavement ends you come to a nice waterfall. This is a great place to refill you water (make sure you filter any water you plan to drink).

We hiked about five miles up the canyon to a hidden valley. The valley is just off the trail. It is a beautiful place to stay. It must be a favorite spot for the mountain goats too. They frequented our campsite. Many of them walked right through our camp.

Hidden lake is at the back of the valley. The second day we were there we spent an hour or so swimming in the lake. The lake was about 100 yards by 20 yards and only 1 yard deep. A little deep after you sink into the 6 inches of mud that forms the bottom of the lake. The water is run off from a glacier which sits at the South end of the lake. A truly breath taking experience.

About a mile up the trail from our campsite is Emerald Lake. Emerald Lake sits in a valley overshadowed by the Timpanogos summit.

From here you can see the shack that sits on top of the mountain. A small shelter was built at the lake about 50 years ago. About a 1/2 mile past the lake you get your first view of the American Fork canyon. As you climb over a small hill the canyon opens up before you.

The trail then lead over a large rock slide. This is a fairly rough trail. There is no flat spot to walk on. You only have rocks. At the far side of the rock slide is a steep trail covered in shale rocks. This is perhaps the hardest part of the climb. A series of tight switchbacks follows this to the top of the saddle. Following the saddle and then maneuvering up the side of the mountain brings you to the Timpanogos summit. I was dizzy for most of the final climb. You are literally standing on the edge of the mountain. The peak is only a few feet wide and very steep on both sides. The clouds were coming up from the valley floor by the time we reached the summit limiting our view some. But it was a beautiful site.

You can view a slide show of the hike if you would like.

23 July 2007

Timeout a ruby system call

I was rather disappointed that I could not set a timeout on a system call. This is especially a problem because of the very poor threading model that ruby currently has. But, at least there is a way to get the job done. The following is a method I wrote to make a system call and then kill it if the timeout is reached.

require 'timeout'
class System
def self.system_with_timeout(timeout, *args)
if ( (pid = fork) == nil )
#child process
@@logger.debug(args.join(' '))
exec(*args)
else
success = false
#parent process
begin
#TODO if the process fails return false
success = Timeout::timeout(timeout){ Process.waitpid(pid) }
rescue Timeout::Error
@@logger.error "***** Timeout error"
Process.kill("HUP", pid)
Process.detach(pid)
end
success
end
end
end

04 April 2007

ActionMalier and GMail

This post has been in my queue to write about for over a month now. I just wanted to give thanks to Stephen Chu for posting about how to use ActionMailer with gmail. At FamilyLearn we use Google Apps for all of our collaboration services. It has been great to hook our application into the same system. This helps so I do not have to maintain a mail server. Here is the link to his excellent article.

http://www.stephenchu.com/2006/06/how-to-use-gmail-smtp-server-to-send.html

31 January 2007

RMagic and Fedora Core 6

So it turns out that installing the rmagic gem requires you to install the Microsoft True Type fonts. This seems like a very odd requirement to me. Maybe there is a flag that says install the gem without the fonts, but I could not find it. Fedora Core 6 does not come with an rpm to install the corefonts. You need to visit corefonts.sourceforge.net. Daniel Resare has put together all of the resources that you need to build your own rpm. You may want to visit Mauriat Miranda’s site for lots of good fc6 information including corefont stuff.

The rpm I built installed the fonts in the wrong place. I had to move them from the /usr/share/fonts/msttcorefonts directory to the /usr/share/fonts/default/TrueType directory. After this, ‘gem install rmagick’ worked like a charm.

11 January 2007

Integration Testing Rails

After reading Jamis’s excellent blog about integration testing a ruby on rails app, I decided to take the plunge and write my first integration test. I have never cared much for testing, but with the wonderful testing architecture set up in rails, I have started to actually enjoy it. I now write many tests before I finish coding anything else. I have found it to be very useful and I suspect it has saved me a lot of debugging time. I was kind of forced into this recently because there was no way to test my most recent code with a browser for our iMemoryBook product. The only way I could actually see if what I was writing worked at all was to write a series of functional tests. Today, though, I found I needed to test how two controllers worked together. Hence my need for learning about integration tests.

Duane had written one integration test already so I had a good example to go by, but there was one thing that I did not know how to do. This is why I am writing now, to share what I learned.

05 January 2007

Setting the Accept header

Our site is running on edge rails and we are using the new REST interface. The site also uses a lot of Ajax to make requests that only accept XML as a response. Setting the accept header turned out to be very easy…Just add the header information to the third parameter of the request, which is a hash of HTTP headers.

put "/bookshelf/1/sections/5",
{ :lp => 0,
:pvW => 300,
"section[title]" => "New title",
"section[body]" => "new very short body" },
{ "Accept" => "text/xml" }

In this example I invoke the sections_controller’s update method because of the put call and I will receive my response in XML because I set the Accept header to “text/xml”. Now that I understand this, I can write integration tests for the rest of the application.