31 December 2008
30 December 2008
The slabs are done!
21 December 2008
Home improvement project under way
18 December 2008
Giant ball o' bags
17 December 2008
Hey, who is that guy?
15 December 2008
Shopping with BabyBoy
30 November 2008
Finally playing with my new MacBook Pro!
I spoiled myself with a new early Christmas present: a new MacBook Pro. I decided it was time to upgrade since my old laptop is about 3 or 4 years old and is having a hard time keeping up. I want to do more with the videos I have been recording of BabyBoy, and want to learn iMovie. And now that I have an Intel Mac, I can also use VMWare Fusion and run Windows. I got it on Friday (yes on Black Friday...doing my part for the economy!) but I am just now this evening playing with it and getting things set up and installed the way I like it.
27 November 2008
25 November 2008
24 November 2008
Banana Bread
The last few days have been plenty busy here. And we are just starting to gear up for the Thanksgiving holidays. I got the cooking bug this weekend, and one of the things I tried out was this banana bread recipe. I had bought a bunch of bananas a week ago, and then got a stomach bug (daycare is good at providing me with various germs), so I couldn't eat them all. They were getting very ripe, so I had to do something to salvage them. This recipe was so simple that I simply cannot ever waste bananas again! Maybe next time I will add nuts or orange juice like one of the commenters suggested. Sorry I don't have any photos of it. We've already eaten some of it, so I didn't think to take a picture.
20 November 2008
Book Review: E is for Evidence
Okay, I'm definitely behind in my book reviews here. I think I finished E is for Evidence when I was on vacation. It was, like, eh, compared to the others, especially since I read it after "G" and "H", which I loved. This is a story where Kinsey is being framed for being in on an industrial arson case's insurance claim. Her second ex-husband shows up in this book to add more to the drama. Kinsey is her typical wise-cracking self, but I felt the resolution of the story was rather bland. Usually, Kinsey is the one to figure it all out. But in the end of this book, Kinsey is told by the villain how it was all laid out, which disappointed me. I rate this book a 7 out of 10. It wasn't bad, but it wasn't my favorite of the series.
17 November 2008
13 November 2008
The Saxidentals on MySpace (will you be our friend?)
It's nothing too fancy yet, but I started a MySpace page for The Saxidentals. I uploaded some recordings from our November 2 gig at the Congregational Church of Austin. (Thanks Andy for recording us!) Hope you like them. And if you are a member of MySpace, send an add request and we can be friends!
12 November 2008
Book review: H is for Homicide
The next Kinsey Millhone book I read on vacation was "H" is for Homicide. I know I said before that "G" was my favorite. Well, now "H" is my favorite. In this installment Kinsey does some undercover work in a L.A. gang to help break up an auto insurance fraud ring. For much of the book, Kinsey is actually held captive by the gang leader. We also meet a friend from Kinsey's school days who has since become a crooked cop. This was a real page turner for me. I rate this book 9 out of 10.
11 November 2008
New Orleans 2008
On our way home from Mississippi, we took a quick detour to the French Quarter in New Orleans. I just had to have beignets and cafe au lait from Cafe Du Monde, and D indulged my whim. (BabyBoy had a much healthier snack of spaghetti with meat sauce.)
10 November 2008
Book Review: "G" is for Gumshoe
This is book number 7 in the Kinsey Millhone series by Sue Grafton. So far, having read A - D, and F, I liked "G" is for Gumshoe best. (I just got "E" in the mail, so that is now in the queue, after I finish "H" is for Homicide.) This story was a bit different in that, even though Kinsey has a missing persons case to work on, she is also the target of a hit man. So, she has to hire her own P.I./bodyguard. There is a lot of hide and seek, with a little bit of romance thrown in. It is not until about two-thirds of the way into the book that I thought, hooray, we are finally going to the library to do research! Sue Grafton keeps the novel exciting, and keeps Kinsey as wise cracking an investigator as always. I give this book an 8.5 out of 10.
09 November 2008
08 November 2008
I love my iPod shuffle
07 November 2008
Saxidentals dress rehearsal
06 November 2008
05 November 2008
Halloween/pajama party at daycare
At BabyBoy's daycare, they had a pajama party instead of a costume party. Of course lots of people dressed in costume anyways. And yes, BabyBoy started the day at school with his pajamas, but must have had a messy lunch, and was changed into his second set of clothes by the time I came to pick him up.
04 November 2008
Mr. Woodrum - The Truck Man
Guest blog by D:
We met Mr. Woodrum at the Sun Harvest Market when we stopped there on our way home to pick up something for dinner. We had never met him before and suddenly he was in front of us caught by BabyBoy's gaze. He took off his engineers hat and showed BabyBoy his lack of hair. He said he was 83 years old and his birthday is January 28 (or 20? I am pretty sure he said 28th). He is a great-grandfather. Right off the bat he asked if BabyBoy was a "Truck Man". BabyBoy was totally in awe. He just stared and stared, not quite knowing what to make of all of the to-do over him. I told him that BabyBoy was 9 months old and had not really discovered cars and trucks yet. But, this was about to change. Mr. Woodrum said that he made wooden toy trucks for kids. He said that he could not remember what it was he came to the store looking for, but that he had a truck in the car for BabyBoy - it was blue and he would be right back. While we filled our cart with baby food jars. In just a minute or two he came back bearing an awesome, hand made wooden dump truck with a hinged bucket and real rolling wheels - painted blue. He gave it to BabyBoy and he did not want to let go of it. Just as Mr. Woodrum had predicted. What a kind hearted man. He would only accept our thanks and then he headed off with a big grin as BabyBoy started to cry when we tried to get him to let go of it.
We met Mr. Woodrum at the Sun Harvest Market when we stopped there on our way home to pick up something for dinner. We had never met him before and suddenly he was in front of us caught by BabyBoy's gaze. He took off his engineers hat and showed BabyBoy his lack of hair. He said he was 83 years old and his birthday is January 28 (or 20? I am pretty sure he said 28th). He is a great-grandfather. Right off the bat he asked if BabyBoy was a "Truck Man". BabyBoy was totally in awe. He just stared and stared, not quite knowing what to make of all of the to-do over him. I told him that BabyBoy was 9 months old and had not really discovered cars and trucks yet. But, this was about to change. Mr. Woodrum said that he made wooden toy trucks for kids. He said that he could not remember what it was he came to the store looking for, but that he had a truck in the car for BabyBoy - it was blue and he would be right back. While we filled our cart with baby food jars. In just a minute or two he came back bearing an awesome, hand made wooden dump truck with a hinged bucket and real rolling wheels - painted blue. He gave it to BabyBoy and he did not want to let go of it. Just as Mr. Woodrum had predicted. What a kind hearted man. He would only accept our thanks and then he headed off with a big grin as BabyBoy started to cry when we tried to get him to let go of it.
03 November 2008
02 November 2008
We are okay!
I took a pause from blogging as both BabyBoy and I have been recovering from various respiratory ailments. But I have a lot of blog postings forthcoming this week. We will actually be on vacation, but through the magic of Blogger, there will be posts during the week. And if I can, I'll mobile blog from the road. Have a great week!
25 October 2008
BabyBoy as Dragon...or not!
I've had this costume for BabyBoy for quite a few weeks now, but we thought we should try it out this afternoon, since Halloween is next weekend. Here J and D are getting started, and BabyBoy is not too sure what he is getting into.
Now he has the costume on, but not happy about it.
Definitely not happy!
Now he has the costume on, but not happy about it.
Definitely not happy!
23 October 2008
21 October 2008
19 October 2008
BabyBoy's new teeth
17 October 2008
Crochet your own Obama and McCain finger puppets!
Free patterns for these are available at the Lion Brand Yarn website. Stage your own debate! Make them thumb wrestle! Have fun!
16 October 2008
My new technical blog: Geeky Thought Bubbles
I just started another blog focused on my more technical, geekier interests. Actually, I've just copied over the tech stuff from this blog over to the new one. But all new geeky posts will go there. Check out Geeky Thought Bubbles.
15 October 2008
12 October 2008
A beautiful October weekend
This was a beautiful weekend here in Austin, TX. The weather has been great. Finally a little bit of relief from the Texas summer heat. My weekend actually started early on Friday. As it turned out, BabyBoy had his flu shot on Wednesday. At 5 p.m. on Thursday, the day care called and said that he had a fever, and needed to be fever-free for 24 hours before he could come back to school. When I picked him up, he was sleeping, and slept for about hour more when we got home. Then after he awoke, I took his temperature three times just to be certain, but he had no fever. Anyways, we had our own day together on Friday. We went on a 5 mile walk (well, BabyBoy slept in the jogging stroller as I walked), we went to eat lunch with D, and then did a little bit of shopping. Saturday and Sunday were also beautiful days, with beautiful weather. We caught up a little bit with house chores. BabyBoy had a great time at the grocery store today. He was all giggles. Then he got to play with grandparents this afternoon, and had a great time. The photo above was taken today, just before grandparents drove back to San Antonio.
09 October 2008
Some thoughts on designing a test framework with Ruby
Here are some of my thoughts after actively working on a test framework in Ruby and scripting and running test scripts for the last couple of months.
Start writing tests first, and then grow your framework. I tried to design a framework before I had a solid idea of what the testing needs were. I had just joined the company, and didn't really understand the use cases and test procedures very well. So, I just made assumptions of what I thought would be good common code and what should be in a "good" test framework. These assumptions came from other test frameworks I had used or designed in the past. I felt like my experience would make up for my lack of product knowledge. In a lot of cases that was true, but I could have delved more into the testing side, instead of just the framework. Sometimes to test something, you just need a very simple script, and a sophisticated framework can just get in the way.
Don't overdesign features before you really need them. For example, I'm thinking of ripping out the logging stuff I implemented, because now it is annoying me. I had designed the test framework so that when you include the test harness class in the test class, a log will be made for any test run. Well, I found out I wasn't really reading the logs too much, I was just relying on the output from Ruby's Test::Unit class. And I hadn't implemented a cleanup mechanism to clear the logs after a certain age was reached. So, I'm constantly typing "rm -f *.log". I think it is wiser to not force the logging in a test class, and have the test developer decide what logging is necessary and the mechanism to do that.
The DRY (Don't Repeat Yourself) concept is great, but don't get too fancy, though, with code reuse and that magical metaprogramming (if you are using a dynamic language like Ruby, as I am). It probably doesn't matter much when you need to quickly crank out tests, since this is just testware, not shippable code. In most cases, I think repeating yourself a couple of times is okay, especially when you are trying to automate as much of your tests by the end of a sprint. But once you get to the magical number of 3, then you should think about your modularity and move your repeated code to a common library.
Don't get hung up about trying to implement tests in only one language. This is probably a good reason to not spend too much time working on a framework, because, you might need a different language or tool to perform a subset of your tests. For example, there are some things that Java is better at than Ruby and vice versa. When it comes to manipulating large amounts of XML, performance-wise, Java would be my choice over Ruby.
Start writing tests first, and then grow your framework. I tried to design a framework before I had a solid idea of what the testing needs were. I had just joined the company, and didn't really understand the use cases and test procedures very well. So, I just made assumptions of what I thought would be good common code and what should be in a "good" test framework. These assumptions came from other test frameworks I had used or designed in the past. I felt like my experience would make up for my lack of product knowledge. In a lot of cases that was true, but I could have delved more into the testing side, instead of just the framework. Sometimes to test something, you just need a very simple script, and a sophisticated framework can just get in the way.
Don't overdesign features before you really need them. For example, I'm thinking of ripping out the logging stuff I implemented, because now it is annoying me. I had designed the test framework so that when you include the test harness class in the test class, a log will be made for any test run. Well, I found out I wasn't really reading the logs too much, I was just relying on the output from Ruby's Test::Unit class. And I hadn't implemented a cleanup mechanism to clear the logs after a certain age was reached. So, I'm constantly typing "rm -f *.log". I think it is wiser to not force the logging in a test class, and have the test developer decide what logging is necessary and the mechanism to do that.
The DRY (Don't Repeat Yourself) concept is great, but don't get too fancy, though, with code reuse and that magical metaprogramming (if you are using a dynamic language like Ruby, as I am). It probably doesn't matter much when you need to quickly crank out tests, since this is just testware, not shippable code. In most cases, I think repeating yourself a couple of times is okay, especially when you are trying to automate as much of your tests by the end of a sprint. But once you get to the magical number of 3, then you should think about your modularity and move your repeated code to a common library.
Don't get hung up about trying to implement tests in only one language. This is probably a good reason to not spend too much time working on a framework, because, you might need a different language or tool to perform a subset of your tests. For example, there are some things that Java is better at than Ruby and vice versa. When it comes to manipulating large amounts of XML, performance-wise, Java would be my choice over Ruby.
08 October 2008
07 October 2008
Using Ruby and ERB to dynamically create XML files from templates
Here is a simple way to dynamically create XML files from templates. Actually, it could be any type of file. I chose XML format, because I work with plenty of XML at work. And I use this technique in a test setup.
For our example template, here is a very basic XML file, called ERB_example.xml.
As you can see, it has the basic elements of an email message, I have tags surrounded by
Just to make things easier for this example, I am using global variables for most of these tokens. I also have an expression Time.now which will substitute the date and time. Now to our Ruby script, ERB_example.rb.
Note that in our third argument to ERB.new, we are telling ERB two things. First, the
So, our final output when we run this little script is as follows:
You can find out more about ERB at the Ruby Standard Library Documentation.
For our example template, here is a very basic XML file, called ERB_example.xml.
<email>
<to><%= $name %></to>
<from><%= $me %></from>
<date><%= Time.now %></date>
<subject><%= $hello %></subject>
On your way home, please pick up the following from the store:
% $list.each do |thing|
* <%= thing %>
% end
<%= $signoff %>
</email>
As you can see, it has the basic elements of an email message, I have tags surrounded by
<%=
and %>
. Anything inside these tags are treated like a Ruby expression and are evaluated. I also have two occurrences of just %
. These are treated as the other tags if they are at the start of the line. (Note that I did not indent those lines!) This is useful for us because we cannot nest the <%=
and %>
tags. (Try it!)Just to make things easier for this example, I am using global variables for most of these tokens. I also have an expression Time.now which will substitute the date and time. Now to our Ruby script, ERB_example.rb.
require 'rubygems'
require 'erb'
# set up some variables that we want to replace in the template
$hello = "Hola"
$me = "Tu mama"
$name = "Mi'jito"
$list = [ "milk", "eggs", "bread"]
$signoff = "Te quiero mucho."
# method update_tokens takes template_file, expecting globals
# to be set, and will return an updated string with tokens replaced.
# you can either save to a new file, or output to the user some
# other way.
def update_tokens(template_file)
template = ""
open(template_file) {|f|
template = f.to_a.join
}
updated = ERB.new(template, 0, "%<>").result
return updated
end
new_xml=update_tokens(Dir.getwd+"/ERB_example.xml")
puts new_xml
Note that in our third argument to ERB.new, we are telling ERB two things. First, the
%
says to process any %
at the beginning of a line. Second, the <>
says to omit any newline for lines beginning with <%
and ending with %>
.So, our final output when we run this little script is as follows:
<email>
<to>Mi'jito</to>
<from>Tu mama</from>
<date>Tue Oct 07 14:22:10 -0500 2008</date>
<subject>Hola</subject>
On your way home, please pick up the following from the store:
* milk
* eggs
* bread
Te quiero mucho.
</email>
You can find out more about ERB at the Ruby Standard Library Documentation.
06 October 2008
How to compile and install Ruby on RHEL 4
This is one of those posts where I'm mostly writing this so I can remember how to do it in the future. But maybe it will help someone else, too. I'm not a Unix sysadmin, by any means, but here is what I did to get, compile, and install Ruby on a RHEL 4 system at work. I realized later that I could have found and installed an RPM, but after I started down this path, I wanted to finish it.
First of all, this may seem backwards, but I set these environment variables first. This is because I messed up the first time I tried to install Ruby, so these were left hanging around.
Next I downloaded the Ruby source code:
I unarchived it:
I made a symbolic link which will match the paths in the RUBYLIB and PATH environment variables I set up previously. Also, it's just a lot easier to type /opt/ruby instead of /opt/ruby-1.8.6-p287:
Now, we build and install:
I next installed RubyGems. First we download the archive and unpack:
Then we run the setup:
And that is it!
First of all, this may seem backwards, but I set these environment variables first. This is because I messed up the first time I tried to install Ruby, so these were left hanging around.
export RUBYLIB=/opt/ruby/lib:/usr/lib/site_ruby
export PATH=$PATH:/opt/ruby:/opt/ruby/bin
Next I downloaded the Ruby source code:
wget ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.6.tar.gz
I unarchived it:
tar -zxvf ruby-1.8.6.tar.gz
I made a symbolic link which will match the paths in the RUBYLIB and PATH environment variables I set up previously. Also, it's just a lot easier to type /opt/ruby instead of /opt/ruby-1.8.6-p287:
ln -s ruby-1.8.6-p287 ruby
Now, we build and install:
cd ruby
./configure
make
make install
I next installed RubyGems. First we download the archive and unpack:
wget http://rubyforge.org/frs/download.php/43985/rubygems-1.3.0.tgz
tar -zxvf rubygems-1.3.0.tgz
Then we run the setup:
cd rubygems-1.3.0
ruby setup.rb
And that is it!
05 October 2008
A fun Sunday at home
04 October 2008
Cinnamon rolls
03 October 2008
01 October 2008
How to print to PDF on Windows for free
One of the nice things that Mac OS X has out of the box is support for PDF. You can easily print to PDF without any other software. Unfortunately, with Windows, that is not the case. There are commercial products available that allow you to print to PDF. But there is another way, a free way to do it. I set this up on my computer at work using the following tutorial: Creating a free PDFWriter using Ghostscript. The only thing that I did differently was to download and use HP's Universal Print Driver.
30 September 2008
28 September 2008
27 September 2008
25 September 2008
More about MS Office 2007 files
Just a while back, I blogged about how to open MS Office 2007 files on a Windows machine even if you don't have MS Office installed. I've just stumbled upon a website that will convert the files for you. I haven't tried it out, but it appears that Zamzar converts MS Office 2007 files as well as does many other types of conversions. This might be useful to keep in mind if you are on a different operating system, like Mac OS X.
24 September 2008
23 September 2008
Subscribe to:
Posts (Atom)