Wednesday, February 18, 2009

Git tab completion from Cygwin

I have been a fan of Git since starting to use it regularly and am going to give a talk on it at a tech lunch for my company in April. For the last two weeks, I have been using Git as an SVN front-end (my company has a backed-up SVN repo that I am using for SCM) while developing for a Windows target platform application. So far the experience with Git from cygwin has been a bit mixed. Another developer I am working with ran into problems with Git from cygwin (as opposed to msysgit) that I was unable to reproduce. His problem prevented him from being able to do simple commits on staged files. Bummer.

The little tidbit I wanted to document here is related to getting tab-completion of git commands working from the Cygwin bash shell. There are plenty of posts that already document how to do this, but cygwin kept complaining about having extra tokens in the shell scripts I was sourcing from my .bash_profile. After a little bit of forensic googling, I saw a post explaining that Windows line feed characters inserted by the text editor I was using on my shell scripts was causing my problem and that I should run the scripts through the d2u utility. Problem solved!

So for Windows folks running git from cygwin, here's how you get the awesomeness of tab-completion for git:

  1. Download the source for the version of git you have installed from http://www.kernel.org/pub/software/scm/git/
  2. Copy the git-completion.bash file from the contrib/ directory and paste it into your home dir -- (I renamed my file .git-completion.bash).
  3. Run that file through dlu: $:> d2u .git-completion.bash
  4. Source the file from your .bash_profile (in your cygwin home directory):
    if [ -e "${HOME}/.git-completion.bash" ] ; then
    source "${HOME}"/.git-completion.bash
    fi
  5. Restart your cygwin shell and you should be have git tab completion working. I can't say enough about how helpful tab completion is for git (or how smart the shell script is - truly is teh awesome)

Saturday, January 10, 2009

Learning Ruby

I began learning the Ruby programming language by using a problem I had already solved one way and rewriting the solution in Ruby. Taking a domain that I had great experience in and fitting Ruby into it made the process of exploring the syntax and rules of the language a comfortable one. To use a sports metaphor, it gave me home field advantage.

I blogged about it. In fact, the blog entry was another Ruby learning opportunity for me. The pretty syntax highlighting for the Ruby source code I included in my blog was colored by a Ruby library (gem) called syntax. I found it helpful to create a Ruby script to take the source code I had written and generate syntax-highlighted HTML (yet another learning experience).

At some point early on, I got a great reference book and dove into it as needed. Other books followed, as well as adding *many* blogs to my blogroll. As I learned, my appreciation of the language grew and I spent time working on things that would help me write Ruby.

Over time, I wrote more Ruby code as well as more about Ruby and sought opportunities to learn Ruby by teaching it. I have also been fortunate to have a patient and knowledgeable mentor to ask questions to and learn from.

The learning stage changes eventually in to the doing stage. Much like a fusion chef, I discovered ways of mixing expertise I had in other areas with Ruby. An ingenious Ruby & Swing library (or is it a framework... you decide) called Monkeybars reignited my passion for rich-client user interfaces. I dug-in and started contributing to the project and later recorded a screencast demonstrating how to use it.

Fool that I am for the fun I have writing Ruby, I wrote a Rails website to host the screencast (as well as another I recorded for yet another Ruby/Swing library). All this is to say that learning something (like Ruby) can be a rewarding and enjoyable journey. Though I have travelled a fair distance, there are still so many new directions to go. As I write this, I stand at the beginning of a new trail. At my side I have the project I will re-write, a trusty reference book on the delivery truck and a patient mentor (who doesn't blog -- looking at you, Dave Giovannini) to hold my hand when I need it. And what do you know (I think I have seen this picture before...) there is even a fusion restaurant that makes stuff I have a feeling I will like.

<broad-grin/>

Saturday, December 27, 2008

Noche Buena 2008

Christmas Eve has always been the most special day of the year for me. Memories from my childhood include Noche Buena dinner parties full of family and friends dressed very nicely and a house permeated with the smells of a Cuban kitchen. Sometimes ham, sometimes pork, always black beans and rice, yuca, some vegetables, desserts, and lots of booze. A joyous occasion that usually ended with bodies laid out on the floor in front of the tree or by the fire, watching snowflakes fall and telling stories of adventures past.

Since becoming a father, it has been a priority for me to try my best to recreate the memorable experience for my kids that was my own warm memory of Christmas Eve.


Noche Buena 2008 from Mario Aquino on Vimeo.

Epilogue

We had prepared for a dinner party to seat 11 adults and 2 kids. The pig was so late in being ready to eat that the Noche Buena dinner was effectively ruined. All our guests had gone home with little more than hors d'oeuvres and some wine in their bellies. Despite all our efforts, there is no rushing a pig in a Caja China in December in St. Louis. At times I felt like Icarus... at times, like Captain Ahab. The regret was palpable and the expense of the day, substantial.

My opinion of the Caja China is that it is an extremely inefficient apparatus for roasting pigs. As you can see from the video, the heat source is above the meat, which lies in a metal-lined plywood box. This guarantees that the meat will be cooked slowly. However, the documentation for the Caja China says that a pig should take between 3 & 4 hours to cook, but our experience was that it took over 10 hours to cook the pig. Perhaps in Miami, where the temperature usually stays above 65 °F, the cook-time for a pig stays within the 3 - 4 hour window. Sadly, that was not our experience.

Tuesday, December 23, 2008

Habemus Porcus

Battling rotten weather this afternoon, we travelled out to Kenricks Meat Market to pick up our Noche Buena pig. My Dad brought the biggest cooler he had for taking the pig from the market back to my house. Once back home, the Yak Shaving commenced. We had to clean the pig, find a big enough plastic container to marinate it in, wash a bunch of things to mix the brine with the mojo we had prepared earlier, transfer the pig down to the kitchen, move a bunch of things around, keep the dog in the office, etc.

Two hours after getting it back to our house, the pig was finally juiced-up and bagged neatly for overnight marinading. It's out on our enclosed porch and the forecast calls for an overnight low of just above freezing. My Dad was concerned that wild creatures might break-in to our porch in the night and start to munch on our pig once the divine scent of the mojo gets carried into the backyard. I am not concerned.

Monday, December 22, 2008

Caja China Chicken Test

In preparation for the most important dinner of the year (the Noche Buena pig roast), I decided to test the cooking performance of the Caja China that we bought recently. I used self-starting coals to get the grill hot, though didn't use enough coals to cover the top of the box (mistake #1). After the coals were white-hot, I added Kingsford charcoals using roughly the same amount I had started with, and once again waited for them to be hot enough to spread and get more coverage of the top of the box.

By 5:15, I was ready to add the roaster chicken I had purchased for the test. This chicked was still quite cold for having sat in the trunk of my car in 15 °F weather for most of the day. The Caja China instructions advise adding meat that has been warmed to room temperature, but I decided to go for it anyway (mistake #2).

At the end of the first hour of cooking, we flipped the chicken. I could hear that the skin on the bottom of the bird (which had been facing the heat from above) was crispy as we flipped it over. I thought this was a good sign and that the chicken would soon be done and ready to eat. After flipping it, I recovered the tray of coals on top of the box and added a nominal amount of charcoals to the tray (mistake #3). The instructions say to add roughly 1/2 bag (8 lbs.) of charcoal after flipping the bird, but I didn't added that much.

Forty-five minutes later, I peaked into the box to see if I could read the meat thermometer we had added to the bird. The top was not as brown and crispy looking as I had expected it would. I realize now that I should have followed the charcoal amount recommendations to the letter. This will definitely happen when we cook on the afternoon of Noche Buena.

As you can see from the video, the chicken is a good shade of brown near the neck of the bird, but much less so near the bottom. The ambient temperature for the entire cooking episode was roughly 20 °F and the forecast for the day of Noche Buena calls for similar weather. I expect to post more details after we get the pig and start the prep. This is the first time I have ever roasted a whole pig and am really excited about it!

Saturday, December 20, 2008

Caja China - Pig Box

My Dad and I have split the cost of a Caja China so we can do a tradition Cuban extravaganza for Noche Buena (Christmas Eve), the most special night of the year for Cubans. Here is what the box looks like setup in my garage.

We have the pig on order from a butcher in Arnold, MO., for pickup on 12/23. If you are looking for a friendly place to eat surrounded by happy people eating the most delicious pork north of Miami, please come by
:-)

Thursday, December 11, 2008

Sublimewire...

Since August, I have been working with the highly-talented development team that supports LimeWire, a P2P file-sharing application that leverages the Gnutella network for passing bits around to other clients. While LimeWire has been around since 2000, it has been our efforts in this latest release (which just became publicly available yesterday, albeit as an alpha build) that has finally given it a clean, stylish, modern look. I have been working in Swing application development for more years than I'd like to admit and I have to say that 6 months ago I wouldn't have believed what we have created was possible with the venerable toolkit. 

The team I have been working with is made up of a mix of designers and developers who each brought focus to different aspects of the application. The designers have sweated over the look of the UI, obsessing on clean lines, separating areas of visual focus, colors and whitespace. It has been an iterative effort, following their design mock-ups for implementing the UI of new features, kicking the implementation back to them to evaluate and then revisiting the layout with new ideas for improvement. It has reminded me of the often heard quote about Michelangelo recognizing that great works of art were already present in blocks of marble and that all he needed to do was brush away the right bits from the stone so you could view them.

My own focus has been on implementing aspects of the UI, while the heavy lifting on the back-end was shouldered by other folks on the team. This has been a pleasant shift of focus for me because it has provided the opportunity to dive deeper into some of the murkier corners of Swing and the SwingX library, which (most unfortunately) recently had its funding cut-off by Sun.

My favorite new features in this release are private sharing lists and chat. I can't count the number of times I have wanted to send something to someone (maybe some software I was working on or pictures or whatever) that was just too big to fit as an email attachment. That problem is solved for me by being able to share whatever I want with only who I specify via the private share lists.

LimeWire_Alpha Uploaded with plasq's Skitch!

Give the tires a kick and keep your eyes peeled for the beta, which should be out shortly.