Sunday, December 28, 2008

Merb and Rails merge

I have some mixed feelings about the integration of Merb and Rails because Merb is a small "micro kernel" type framework that seems just about perfect for projects like light weight web services and web portals.

On the good side of this merger: if Rails becomes more modular and the resulting Rails 3.0 can also be tailored down to 'just what is needed', then this merge should end up being good for developers.

I have just signed a publishing contract for a new Ruby book that has one part on publishing information for consumption by both humans and software agents. After waiting a few months, I will grab early Rails 3.0 builds and write to Rails 3.0. A bit funny because before my holiday break I was deciding whether to use Merb or Rails for this book example.

Sunday, December 14, 2008

I am very much enjoying learning Haskell

As I have mentioned, I am learning Haskell to fill a gap in my programming language tool kit: a concise, productive language with great run time performance (low memory use and efficient utilization of multi-core CPUs).

I am experiencing another benefit: a different way to analyze and solve problems. Learning Haskell reminds me of using Prolog. Obviously Prolog and Haskell are very different programming languages so the comparison is really in how different they are from the languages that I usually use in my work (Java, Lisp, and Ruby). It has been over two years since I used Prolog in a consulting job but I used to use Prolog a fair amount. For the near future I am happy learning Haskell for a few specific applications and for giving me a fresh programming perspective. I am also pleased to see the wide range of Haskell libraries and the Haskell community seems interesting. I have been using Planet Haskell as a launch point for reading.

How far can corporate oversight reform go? Fix our agriculture industry?

I saw a link to this video on an O'Reilly web blog - good stuff, but how many people are willing to watch a 30 minute video, even for important issues?

A summary of Michael Pollan's points that resonated with my own beliefs (with my opinions added): The real costs of eating unhealthy food that also stresses our environment in production are hidden by huge government subsidies and the politics of agriculture corporations bribing and influencing the US Congress, and more recently the executive branch. In a weak economy and energy crisis the best "green industry" to promote is small farms that grow food close to where people live and run by farmers who are very skilled in running farms in an ecologically intelligent way. Higher costs of locally grown healthy food that leads to a sustainable society look more reasonable when potentially lower health and energy costs are factored in. This could be highly beneficial to farmers but would reduce profits of the giant agriculture corporations.

In the video, John Battelle and Michael Pollan talked about ways that transparency in our food industry would self-correct consumer food choices. If supermarkets were required by law to post pictures or videos of industrial meat factories then many consumers would naturally switch to healthier food alternatives, even with small extra expenses. If consumers understood the health risks of highly government subsidized foods like low quality factory meat, soybean oils, and highly processed corn-based products then free market forces would shift production to more "society friendly" food products.

You can help yourself and society by trying to buy locally grown food.

Monday, December 08, 2008

Best chicken, ever

My wife and I are both great cooks so when she said that the chicken that I made for our Sunday dinner was the best she ever tasted I thought that it was worthwhile posting my recipe.

24 hours before cooking the chicken (a whole, locally raised and organic) I washed it in cold water, trimmed a small amount of the fatty skin, split it through the breast, folding it flat. Optional: at this point I partially de-boned the chicken by removing the backbone but leaving the skin behind the backbone intact.

I added 3 tablespoons of salt, 2 tablespoons of soy sauce, 3 tablespoons of maple syrup, one teaspoon of turmeric, some pepper, and half a finely diced fresh onion to a large deep glass mixing bowl. I added some water and mixed all the "brine" ingredients. I placed the whole (but slightly flattened) chicken in the bowl, and added just enough water to completely cover it. I covered the bowl and placed it in our refrigerator for 24 hours. Note: it is very important to not let the chicken get to room temperature: poultry should always be kept at 40 degrees (F) or cooler until right before it is cooked.

24 hours later: I pre-heated our oven to 500 degrees and started our barbecue (I used real hickory charcoal, but gas barbecues are OK). When the oven was at 500 degrees, I placed the chicken in a glass shallow baking pan, split side with ribs facing down, and cooked it at 500 degrees for 5 minutes, then turned the oven off. 7 or 8 minutes later when the coals were ready, I placed the partially cooked chicken on the grill, rib side down. Cooking time will vary: try to get the breast meat done without drying out the meat. I turned the chicken a few times while cooking it. Note: the chicken meat absorbs a lot of water during the 24 hour "brining" period so a lot of steam is released while cooking the bird.

If you don't want to barbecue, you can just leave the chicken in the oven to cook it. After 5 minutes in a 500 degree oven, turn the oven down to 325 and continue until the meat is done. Note: you always want to start chickens or turkeys in a very hot oven to drive moisture in the meat into the center, near the bones - this helps to keep the meat from drying out.

Sunday, December 07, 2008

Haskell it is

For my own research (not for consulting work, at least for now) I need to speed up machine learning runs and other experiments. I have "4 cores" to work with (and I hope that my next server purchase for my home office has many more than that) so I have been playing around with different programming languages that support concurrency without a lot of effort.

Haskell has impressive run time and memory performance; for example: comparing Haskell and Scala. I have been reading an online version of "Real World Haskell" and recently ordered a print-copy of the book.

I usually do most of my exploratory/research programming in Scheme or Common Lisp so using a different language is fun. Gambit-C Scheme does have the Termite package for concurrency but something more main-stream like Scala or Haskell seemed like a better idea. I invested some learning time in Erlang about a year ago but I think that Erlang is more optimized for concurrency over different computers on the same LAN rather than using many cores in a single server.

Wednesday, December 03, 2008

Good article on adding security to Semantic Web applications

This article on the Sun BabelFish blog provides good design and some implementation notes for using SSL and (possibly) self-signed certificates for authentication for software agents that have write access to the URI that they are associated with. Useful stuff.