Sunday, September 30, 2007

Gulp!

Well, I just finished renewing my Green Card online. So after a $370 filing fee and 20 minutes of my life, plus several minutes' re-reading my application to make sure it is all accurate; I'm now on my way to being allowed to live here after February 2008.

So I had posted about whether I should stay in the USA or come home: renewing my Green Card is essentially option #3: make up my mind later. Actually, option #3 is a good one for an international family.

So long as I have a Green Card, I can leave the USA for a given amount of time without losing it (somewhere between 6 months and a year). So this way, we can cross the border and give Canada a try for a few months. After a few months there, my American wife and I can decide what to do next.

If Ames decides she can't stand Canada, then I will probably get a US citizenship. But by renewing my Green Card, I've given us a chance to spend a little more time on the decision.

Still, $370 is a pretty hefty filing fee.

Friday, September 28, 2007

Something fishy

Well, Alaskan wild-caught salmon was on sale this week in Charlotte, so we bought some. Of course, the only way to cook salmon is on the grill:



So I took the salmon, put some coarse salt, black pepper, a little garlic, and some dill mixture on it, then threw it on the grill.



I've heard people say they don't like to grill fish, because it sticks to the grill. Let me give you a hint: fish sticks to your grill because you're not getting the grill hot enough.

I cook on cast iron; both my grills have cast iron cooking surfaces, and I would have to seriously question buying a grill that has anything other than cast iron for its food grates. Porcelain's a fad, stainless is flashy, but real, serious grilling requires cast iron. If I can cook fish on cast iron without having it all stick, then we know for a fact that fish is not doomed to sticking, just because it's cooked on a grill.

So here's how you cook fish on the grill.

First, get the grill hot. I know, you're not cooking steak; and the very fact that you are planning on cooking the fish a little lower indicates you've learned something. But you need to understand this: regardless of how hot you intend to cook something on a grill, you almost always need to get the food grate really hot. So when I cook something like chicken or fish on the grill, I get the grates hot first, then I lower the grill temperature when I put the food on.

If you have fish with skin on it, put it on flesh-side down. I do this before I turn down the heat. The idea is to sear the flesh on one side while the grill is hot.

If you try to turn the fish before it's seared, it will stick, and you'll end up with a piece of torn-up fish and really messy grates. So don't turn it too soon. How can you tell when the fish is ready to turn? It lets go of the grates. Let me re-iterate that. When you first put fish on hot grates, it will stick. If you leave it a few minutes, it'll sear through and release the grates, at that point, it comes cleanly off the grates and you can turn it. If your fish sticks to the grill, it's because you tried to turn it too soon, or else you didn't get the grill hot enough before you put the fish on it. This is the same principle for steak. As Smoky Hale says "When a steak meets the proper grill, they seize each other with the intensity of a pair of newlyweds. At the proper time, they will turn loose."



Once the fish is ready to turn, you can gently flip it over, reduce the heat, and cook it slowly, skin-side-down. At this point, I put a little butter or margerine on it, just to keep it from drying out.

I should probably admit I like sashimi, so I may like my fish a little less well-done than a lot of people. But it's a mistake to over-cook your fish. It dries out faster than you'd think.

If you cook the fish flesh-side-down first, then you get nice grill marks on the flesh side of the fish.


Notice that dill mixture's still a little green. You're not trying to blacken salmon, just get some nice char marks on it. I obviously turned one piece a little too soon, and didn't get quite the char marks on all three pieces that I wanted.

I like to eat salmon with red wine, but ABC ("Anything But Chardonnay") is fine. Tonight I drank a nice Zinfandel with my fish.


One thing about salmon, we never have leftovers out our house.

Canadian Geography Lesson

Sunday, September 23, 2007

Anticipation

Well, we're getting more and more excited about the prospect of leaving Charlotte.

We still need to finish painting the house. Actually, the house has been painted, but the woodshop and deck haven't. We need to slap some paint on there before we list the house. Of course, the brutally hot weather for the last several weeks has kept us from moving forward with painting. At these temperatures, paint just bubbles off the wood.

In the interim, I need to put down quarter-round on the baseboards of the wall. When we ripped up the carpet to expose the hardwood floors, we never put the quarter-round down to finish the job. So today I'll go off to Lowe's and get some of that. Hopefully we'll make some real progress on that today.

It is my sincere desire to move back to Canada by the end of 2008. The biggest obstacle is selling our house, and that is dependent on getting the painting, etc. done so we can list it. Hopefully we'll be listed in the next few weeks.

In my little fantasy world, we'll be leaving North Carolina immediately after Thanksgiving of 2008 (that's the end of November for all our Canadian friends). When we moved back to NC from Michigan, we arrived right around Christmas. It was a good time to be homeless: the end of the year is a good transition time for jobs, tax-wise; and the holidays are a good time to have some chaos. If there is a good time for chaos.

Well, I'm just fantasizing now.

I know some of my Canadian friends would wonder at my desire to come home: you want to come back here? Yeah. I came to the USA for what was supposed to be a two-year stint, and it's stretched to 13. The USA is a good place, but I never intended the move to be permanent. Maybe we'll spend 6 weeks in Canada and decide we can't stand another 6. Maybe not. But one way or another, I really want to head back and give it a try.

Tuesday, September 18, 2007

3.14 (Reprise)

Xingyi class last night was great, but the problem with a good kung fu class is, it leaves me sleepless. So I tossed and turned all night. Today I lost a whole day looking for a bug in Hibernate code I still haven't found. But after dinner, as I sat with my youngest on my lap and listened to the Moody Blues anthology Time Traveller, I realized it was a good time to have another go at pie.

Ames bought me a new pie plate, so I washed it out and started.

After some contemplation, I have decided my mistakes last time were two-fold:

  1. I made the pastry too dry. The Tenderflake Perfect Pastry recipe calls for one egg, 2 tsp. vinegar, and water to make it up to a Cup. But then the recipe says to use "only enough liquid to make dough cling together." Well, I learned my lesson last time, so now I realized "only enough liquid to make dough cling together" is code for "all of it."

  2. I used whole-wheat flour. That might actually be all right, but I thought I'd try again with the white stuff.



So this time I followed the recipe again, but used white flour and all the liquid. Oh, and I used lard too. I've only got 1/2 pound of lard left, so I'll have to join the Great Unwashed and use shortening next time. But today, I use lard.

After blending and mixing, I cut the pastry into six pieces. I kept two for the pie and put the rest in the freezer.


Last time I made apple pie. Tonight I made my second-favourite: cherry. Only rhubarb pie is better than cherry. I would have made rhubarb, but rhubarb is not indigenous to the South; and every person I know who's tried growing it here has met with unmitigated failure. So rather than pay more than $2.50 a pound for what every northerner knows is a weed, I cheated and opened two tins of cherry pie filling.

I rolled out the pastry, lined my new pie plate with it, and dumped the two tins of cherry pie filling into it:


Then I rolled out a lid and laid it gently atop my new pie


I've never figured out how to crimp the edges of the pie properly, so I just run around the perimeter with three fingers and make those little triangles in the pastry. Here's a close-up of my amateur attempts at crimpage:


Finally, I sliced a few slits into the lid to allow for venting and put it in the oven.


You know the drill: 15 minutes at 425F and then 30 at 350F.


Well, it certainly looks better than the last attempt, but it did bleed a little.


Haven't tasted it yet. I suppose tomorrow for breakfast is as good a time as any.

Sunday, September 16, 2007

LaTeX

Hah! I got MacTeX going on the new MacBook. I've missed being able to crank out decent-looking documents... It used to be that LaTeX of one form or another was the first thing I'd install on a computer. This time I've been slow on the draw. Still, the MacTeX installation is extremely complete, and I'm finding I have to do very little customization to make it work the way I want it.

What is LaTeX? It's a document preparation system based on Donald Knuth's legendary TeX. Rather than a word processor, it's a type-setting system. So it works a lot like HTML in a web page: you input plain text commands into a file, then run the LaTeX system against it. The system produces the document in an image-based format (I always generate PDF, but DVI or PS are common), which prints predictably on any decent printer (unlike, say Microsoft Office documents).

People who use TeX, LaTeX, or their ilk hold them in deeply religious awe. They are truly the ultimate in document preparation. Rather than using a word processor, which is designed to let you type out pages; you're using a type-setter, which is designed to produce books. So LaTeX documents have kerned, ligatured output.

I first learned LaTeX when I was unemployed and broke, but needed to generate some decent documents. I couldn't afford to buy a word processor, but I had plenty of time on my hands, so I downloaded LaTeX (which is free) and invested a lot of time learning it. It's not necessarily easy: there is a learning curve involved; but I had more time than money then, and I've never regretted the choice I made.

I still find all word processors primitive, inadequate, and kludgy. Pages is better than most, but even that's no LaTeX.

Anyhow, I've spent some time making sure all the fonts are in place, etc. and now I'm ready to get back to the world of nice documents...

Friday, September 14, 2007

OCaml, my love

I want to love OCaml, I really do. In fact, I want to love Haskell too, but OCaml seems just a little more pragmatic.

But in the end, there is something that keeps me from loving OCaml: I can't find a compelling use case. I can't see anything that's significantly easier to do in OCaml than in Lisp, for example. And while OCaml apparently make very fast executables, Lisp is certainly "fast enough."

OCaml doesn't seem to own anything I want to learn. Lisp owns AI, Erlang owns concurrency. I know, there are other options in both categories, but you get the point.

The most interesting feature I can see in OCaml from where I sit is the type system. No question, OCaml's typing is strong and static. From an outsider's point of view, it seems much like Haskell's; although I am sure devotees of either tongue would recoil in shock from such a suggestion. But the rigidity of the type system is a barrier to learning the language. You'd think there would be some sort of evangelism based on that; instead the OCaml-istas seem more interested in looking down on others for not having an adequate type system than giving examples of how such a system is a Good Thing.

I bought Practical OCaml, and I read it. More than once. But it fails to present me with interesting solutions to problems. Online tutorials have a similar problem "Look! You can add two numbers in OCaml!" Hardly worth learning another whole language, especially one with very different syntax from the ones I already know.

And when the language has a bondage-and-discipline type system, even adding two numbers seems inordinately difficult. I mean, in OCaml there is no auto-boxing that I can see... none! Even the arithmetic operators are different! "+." adds floats, "+" adds integers.

I suppose there is an opportunity here for me to learn OCaml and bring a decent book on it to market. Maybe I'm looking at this the wrong way.

So if OCaml isn't compelling, then why do I want to love it? I suppose because there are some interesting features in functional languages (like Haskell, OCaml, and Erlang) that intrigue me. One is the whole "clause" thing. Where a function in C might look something like this:

int add(int i, int j){
return i + j ;
}


And in Java it might look like:

public int add(int i, int j){
return i + j ;
}


That same function in OCaml looks like:

let add i j = i + j;;


But OCaml gets more interesting when you differentiate between inputs. So you could write some function that returns the sum of a list of numbers like:

let rec sum list = match list with
[] -> 0;
| head :: tail -> head + sum tail ;;


Actually, that's pretty cool: there are actually two definitions ("clauses") in the function. One is the definition of the sum of an empty list '[]'. That sum is zero. The other clause says if you get a list that has some data in it (i.e. a head and a tail), the function adds the head to the sum of the tail.

I suppose Lisp could do the same thing with DEFGENERIC, but I find the simpler recursive solution more intuitive:

(defun sum (LIST)
(if (null LIST)
0
(+ (first LIST) (sum (rest LIST)))))


So I suppose the OCaml version is shorter than the Lisp version.

Anyhow, I'm just rambling now. Programming is only interesting when you're learning something new. Right at the moment, my Java job is getting a little mundane. I had hoped OCaml would provide an interesting diversion, but it appears I was barking up the wrong tree.

Saturday, September 8, 2007

3.14159

Well, today being a Saturday, and we having too many apples, I made some apple pies today. They might be the ugliest pies I've ever made, but they're pies. Apple pies.



Actually, they were a bit of a team effort. I made the pastry too dry (and I used whole-wheat flour), so I broke it several times trying to roll it out. Eventually Ames stepped in and got me some pie shells from the mess I made.

I finally fixed my pastry, but not until it was pretty much too late. Ames takes credit for the nicer of the two pies.



How did I make the pastry? you ask. Well, I used the Tenderflake Perfect Pastry recipe. It's the only one I can get to turn out for me at all. And yes, I used lard. I live in the South. I actually would have used shortening, but I ran across some lard in a cupboard, so I thought "why not?".

It turns out we're missing a pie plate again. Apparently there's a gremlin in our house that steals pie plates: it seems we're having to buy pie plates very frequently. At any rate, we used the one pie plate we have, and I got Ames to roll out the other shell and put it into a glass casserole dish. In the end, I re-worked the pastry scraps into a new "batch" and was able to get it to roll. So I took that pastry, rolled it out, and put it in a cast-iron skillet. Ugy, but it works. I then used the shell Ames made me for a lid. That was a flop, and resulted in the mess in the photos.

Now, there's been some whining about my not including recipes in my blog. Let me set the record straight: there are at least three reasons I don't include recipes:

  1. I personally hate reading recipes. I find technique more interesting than recipes; and when I read something with a recipe in it, I simply skip over the recipe(s) and keep reading.

  2. I'm unsure the legality of posting a recipe I didn't invent. I post my own (when I keep track of them), but hesitate to post someone else's

  3. I almost never use recipes. If there is something specific I want to make, I do so. But the vast majority of my cooking is done on-the-fly. I may refer to a recipe, but I rarely follow one.


So for those who are criticizing my lack of recipes, please understand I usually don't have one to post.

But I'll gladly share how I made the pies.

First, I read the recipe in A Century of Canadian Cooking. Their recipe calls for the following:

  • 5 apples

  • 1 Tbsp. lemon juice

  • 1 tsp. cinnamon

  • 3/4 C. granulated sugar

  • 1 Tbsp. butter


You're supposed to peel and core the apples, then combine everything but the butter. After than, you dump it in a pie shell and dot with butter, then you bake for 15 minutes at 425F, then reduce heat to 350F and bake 35--40 more minutes.

Fine.

I thought brown sugar sounded better than granulated sugar, so I put brown sugar in a bowl. I ran 5 granny smith apples through my apple slicer; then I realized it wasn't enough and I was out of granny smith, so I ran a couple small red apples through too.

I thought 1 tsp. cinnamon sounded stingy, so I dumped enough in to cover the sugar.

I couldn't find any lemon juice, and Ames assured me we had none; so I thought "Well, rum's pretty close to lemon juice." I measured 1 Tbsp of rum over the sugar and cinnamon. Then I realized I was intending to make two pies, so I put another Tbsp of rum in there.



I was going to put another 3/4 C of sugar into the mix, when I realized I had snapped my 1/4 C measure with the first 3/4, so I grabbed a 1 C measuring spoon, got it 3/4 or so full of brown sugar, and dumped it in. Then I added more cinnamon and whisked it all together.

It looked a little dry, so I poured in some more rum.

Now I had a nice rum-sugar-cinnamon mixture, so I put in all the apples (I think I had six or seven at this point). I got it all mixed up, and realized I had made a sort of redneck Rumtopf. I put as much of that as looked reasonable in the first pie shell (which was almost all of it), and had one of the kids put some butter here and there on the apples. It was supposed to be 1 Tbsp. of butter dabbed on the apples, but my daughter was a little over-zealous, and it ended up being quite a bit more than that.

I rolled out a lid, and covered it. The lid broke terribly, so I just sort of jammed it all together and had one of the kids jab some holes in it.

By now, the second pie needed doing. I didn't have enough apples left, so I peeled and cored 3 or 5 more, and threw them into the remaining rum juice. I put some more cinnamon in there, and a dab more rum, then I threw in a handful or so of raisins and mixed it all up.

I put that mixture into the pie shell Ames had put in the casserole dish. At that point, I fixed the pastry, rolled out what was supposed to be a lid, realized it would be a good shell, and put it into the skillet. Then I up-ended the casserole dish over the new shell, and used the pastry from the casserole dish as a lid for the pie. Oh, and I remembered to put some butter over the apples before putting on the lid.



So I can't post my recipe, because I have no idea what is actually in those pies.

Oops.

Thursday, September 6, 2007

Holly and Ivy

Every year I look for a CD of Christmas music that will become the Christmas CD that year. Actually, I generally allow two such CDs per year. Since I listen to "Christmas music" all year (primarily of the hymn sort: "Hark the Herald Angels Sing" and so forth), I get a much wider window of opportunity to find that CD.

Over the last couple years, the title "Christmas CD of the year" has been bestowed upon several worthy albums, including:

  • Wintersong by Sarah McLachlan

  • Happy Holidays by Jo Stafford

  • Christmas with the Academy by The Academy of St. Martin-in-the-Field

  • Noel by King's College Choir

  • In the Moon of Winter by Northern Variations

  • December by the Moody Blues



So my tastes range somewhat. I like tacky Christmas music in December, but I really prefer more classic sounding stuff.

Well, last night I found one of the CDs for this year: A Traditional Christmas Carol Collection from The Sixteen, by Harry Christopers and The Sixteen. I've had trouble finding it at places like Amazon, so I just bought it from iTunes.

Now this will sound a little bold, but I put this CD slightly above Noel and Christmas with the Academy. The repertoire is very similar, and performance is about equal. But the difference is recording quality. Where the other two albums consist of tracks recorded as much as 40 years ago, this CD is all new. That is, the sound is much more three-dimensional; the high notes soar, the low ones surround.

I was honestly shivering at the beauty of the sound.

What songs does it have? There are the standby carols: "The Holly and the Ivy," "O Little Town of Bethlehem," etc. But there are the better ones that make a CD worth purchasing: "See Amid the Winter's Snow" and "The Sussex Carol."

That's one task off the Ber Month checklist.

Note: After posting the above, I found the CD at Amazon: A Traditional Christmas Carol Collection. Why couldn't I find it last night?

Tuesday, September 4, 2007

Four fried chickens and a coke

A few weeks ago, I wrote about deep frying in the South. Today we got to test some of my theories.

Yesterday was Labour Day, so we had some friends over. As my friend was cooking a dozoen potatoes in the deep fryer, he mentioned frying whole chickens. I was manning the grill while he took the fryer, but my thoughts went to a couple chooks waiting patiently in my refrigerator. So today when Ames called me at work and asked what I wanted for dinner, I said "We're going to fry those chickens!"

And we did.

Ames started out by battering the whole chooks. She used a "recipe" based on her mother's chicken batter: "A little salt, a little pepper, some flour." Ames' batter consisted of several spices, including paprika, which gave it an orange tinge:


While Ames was making sure the chickens were completely covered in their batter, I was starting the turkey fryer. I mentioned it in the other post: it's a 34-quart fryer. I took some pictures:


Yeah, that's the trash can in the background.

The oil in the fryer is still relatively new. We basically only fry potatoes, so it takes a while for the oil to darken. I only change the oil every 12 or 18 months: of course, cooking chicken in the oil will require a change in the next week or so. I think we'll try and get in a fish fry in there.


Then we dropped both chickens in the oil.

It got to be difficult to maintain the temperature between 325F and 350F. I ended up cutting the gas almost entirely, and the temperature still stayed too high.


After 20 minutes, we took out the chooks and cut one open.
It was still a little soft inside, so we put them back in for another 5 minutes:


Well, the chickens were done after the additional 5 minutes, so we took them out. And cut them up.




Add a little potato salad, and you have a winner. The potato salad had a slight orange hue, due to the paprika and red-skinned potatoes. I guess it was the day for orange tint.

The verdict? Excellent.

Lisp moment

So I had one of those "Aha!" moments this weekend. I was working on an HTML parser in Common Lisp. The "why?" isn't terribly important: I have a lot of data in HTML I want transformed into PDF. Rather than do it by hand, I figured it would be a good opportunity to try it in Lisp.

I've written a Lisp HTML parser before, but I was never quite satisfied with it; so I decided to start again from scratch.

Well, I was working on a recursive function that walks through an HTML string and turns it into valid Lisp, so this:

<html>
<head>
<title>Some Title</title>
</head>
<body>
<h1>Some header</h1>
<p>Some paragraph containing <a href='#'>some link</a></p>
</body>
</html>


Should get converted to:

(html
(head (title "Some Title"))
(body (p "Some paragraph containing" (a "some link"))))


Not exactly rocket science, but it has the advantage of generating valid Lisp as an output format. That way, I ought to be able to define functions "html", "head", "title", etc. that know how to render their arguments, and I have used HTML to generate a Lisp program that generates a PDF. Slightly circuitous, but a good pet project to learn some Lisp nuances while I get a tedious task done.

Notice too my example dropped the attributes for the <a> tag. That's because I haven't decided how to handle tag attributes yet.

Well, I was working on that piece of code (so far just under 100 lines and generates the Lisp: I need to write the compiler next) when I had a sudden flash of insight.

Functional programming is essentially applying a series of transformations to data.

OK, that is oversimplifying a little, but consider this example. Suppose we want to write a function in Lisp that doubles each element of a list. With no error handling, type-checking, etc. one might write something like this:

(defun double-list (some-list &optional accumulator)
"Double every element in a list."
(if (null some-list)
(nreverse accumulator)
(double-list (rest some-list)
(push (* 2 (first some-list))
accumulator))))


OK, OK, it would be easier to just do something like this:

(defun double-list (some-list)
"Double every element in a list."
(mapcar #'(lambda (x) (* 2 x)) some-list))

But that wouldn't make my point so clearly!

But in the end, I finally saw something I hadn't seen before: the work is done entirely in the call to the next function. That is, successive calls to the function only transform the data, then call the function again. So essentially the only work done in the function is to decide what arguments to use when it calls them again.

OK, that's rather simplistic. I mean, that's not really worthy of writing a book or anything, but it helped me understand a little better why functional gurus keep going on about applying successive transformations.

I guess it all comes back to what I said to a buddy a year or so ago: "Recursion is just iteration that keeps its state on the call stack."

Saturday, September 1, 2007

The Ber Months

Well, today is September 1, the official start of the Ber months. These four months: September, October, November, December are my favourite months of the year. In actuality, I enjoy January too, but it's not quite a Ber month.

In the end, I like the Ber months because my favourite seasons are winter and autumn (in that order). Here in North Carolina, that doesn't mean much: the weather is always relatively warm and balmy, even in winter. But it's a respite, however slight, from the blazing heat of the sun, which is almost a constant in the South. Sure, it would be better if the Ber months were also the Brrrrr months; but here in the South that's a bit much to ask.

This summer has been brutal. We've broken a couple records: the heat went up past 100F any number of times in the last 6 weeks, we're on water restriction, and the grass is all dead.

Let the Ber months begin!