Garden Redux (Take Two)

As many of my 3 readers will know, we’ve had a vegetable garden on the south side of our house for a little over a year now. We got quite a bit out of it the last two years but I wasn’t completely happy with the production. Lots of things did well but things like peppers and cucumbers did not. I had the feeling that it was due to the soil. When we first built it, I used GumboBuster from Soil Building Systems. I had used it before for several flower beds with pretty good success.

However, growing Texas native flowers in something like that and growing vegetables are two completely different endeavors. For the flowers and trees, any improvement to the soil is a major step because our soil here in the Metroplex is so terrible. Veggies on the other hand require a bit more care put into the soil. Also, we had major rabbit issues this year with an in-ground bed and when I put up a rabbit fence, it kept me from weeding around the bed. The result was a bermuda jungle that caused me great grief in the fall.

So with that in mind, I undertook a rebuilding project of the veggie garden to make it into a raised bed or two that would have less square footage but better soil. This time around, I used the actual vegetable soil from SBS and right off, you can tell it’s a better soil. As usual, the project took 3 weeks instead of 1 but such is life I suppose. I only got collards and garlic planted before I ran out of plantable days but I’m excited with the results and hopefully, the spring garden will be considerably more lush.

Here’s the before picture with some of the ingredients (the four bales, 2 of alfalfa and 2 of hay) in the background. For the bed on the far end, I used a no-dig method documented here

Two cubic yards of dirt. About 20 wheelbarrows full. A lot.

The borders. I used 2x12s, 10 feet long to build a 20 foot bed, 5 feet across. I also built a 5×5 bed of the same depth.

The three quarter finished point. I forgot to take pictures of the beds before they got filled but I sunk 18 inch pieces of 4×4 6 inches into the ground. I attached the 2x12s to the top foot of these with heavy duty exterior screws.

The 5×5 bed with the garlic and collards.

And the final result that Scooter apparently approves of in the background.

Assuming this turns out to be a rousing success, I’m thinking about adding another 10×3 foot bed on the fence side of this one, probably terraced with stones.

Closures in Clojure and C#

So one of the ways I learn a new language is to take new things from the new language and port them back into the old, familiar one. Eventually, I’ll port an entire application (even though that app may be very small) from the old to the new. I find that I learn things much better this way. Tonight’s example is closures in Clojure and C#.

In Clojure, you can do this:

(defn make-greeter [greeting-prefix]
(fn [username] (str greeting-prefix ", " username)))

This basically creates a closure around greeting-prefix that can be used to create custom ways to greet people. For example

(defn hello-greeting (make-greeter "Hello"))

creates a closure than can be called with

(hello-greeting "Brett")

and get “Hello, Brett”

You can do the same thing in C# though it’s a little more work because it’s a statically typed language. In C#, a small console app looks like this:

namespace ClosureToy
{
    class Program
    {
        static void Main(string[] args)
        {
            //Class1 one = new Class1();
            Func hello = MakeGreeter("Hello");
            Func aloha = MakeGreeter("Aloha");

            Console.WriteLine(hello("brett"));
            Console.WriteLine(aloha("brett"));
            Console.Read();
        }

        static Func MakeGreeter(string greetingPrefix)
        {
            return (username) => String.Format("{0}{1}{2}", greetingPrefix, ", ", username); ;
        }
    }
}

The MakeGreeter function is a closure around greetingPrefix that allows you to create custom greeter functions on the fly. Essentially, it’s doing the same thing as the Clojure code as you can see from the main body of the console app where it creates two greeter functions on the fly, one that says hello and one that says aloha. Closures make it easier to abstract common pieces of code in your applications.

More Short Change

So for a guy who won the Presidential election based on a platform of change, Obama is starting to look less and less, well changey. He’s got an economic team made up of insiders and Clintonites, Hilary Clinton is Secretary of State and now we hear that he’s named Robert Gates as Secretary of Defense. Ahem. For those of you playing along at home, Robert Gates is CURRENTLY Secretary of Defense. Which means he was appointed by George Bush for that position.

I bet all those lefties who screamed for change and a return to the America the world used to love are starting to wonder if they can get their votes back. Unfortunately, votes for Obama have a strict no-refund policy.

As it turns out, in the history of the position, no Secretary of Defense has EVER been held over on a new elected president of a different party. Maybe that’s the change Obama was talking about.

China’s Deterioration

Unrest isn’t exactly reported with abandon in China given that the media is censored heavily but it’s starting to look like the domestic situation in China is deteriorating rather quickly. Today’s New York Times reports that China cut interest rates by more than a full percentage point overnight. Included in the article is this key info:

In the latest sign of the intermittent labor unrest in export-dependent southeastern China, one of Hong Kong’s best-known toy companies, the Kader Group, announced on Tuesday that workers had damaged computers on Monday at its factory in nearby Dongguan and taken a small amount of cash after their employment contracts expired and were not renewed.

The Guangzhou Daily newspaper reported on Tuesday that 500 workers laid off from a toy factory had rushed into its administrative offices on Monday night, smashing windows and breaking computers. Three men and two women were injured and five police vehicles were damaged before the protesters were dispersed, the newspaper said, publishing a photo that showed a police van that had been turned completely upside down and had its doors torn off.

In a possible hint that the incident might have been even larger, the newspaper said that another 2,000 people were “watching” the protest. All newspapers in China are subject to censorship, but Guangzhou newspapers have been more willing than most to test the limits of what they are allowed to report.

I wrote the previously that China is on a precipice not unlike what America faced in 1929 and that the Communist party relies on economic growth to stay in power. With America cutting back drastically on consumption, growth in China will also shrink unless they can find a way to increase domestic demand. If workers don’t have jobs, that demand won’t materialize. And if hundreds of thousands of Chinese workers don’t have jobs, the situation inside China is liable to get a great deal worse. I just don’t know how much we’ll hear about it.

Bailout FAIL

So let me get this straight. Given how well the past 5 or 6 bailouts have worked, our government has come up with a new one that will “bolster consumer financing“. The theory (horrible though it is) is that by giving lots of money to banks, they will make financing and credit available to consumers so that they can borrow more money (even though the average consumer is up his testicles in debt) to spend while the bank then charges an exorbitant interest rate in the meantime. I have 5 words to sum this theory up.

YOU’RE FUCKING DOING IT WRONG!

Understand, the money that our government would give to the banks that can’t keep their balance sheets clean is OUR MONEY TO BEGIN WITH! It’s taxpayer money. We gave (and I use the term “gave” rather pejoratively) that money to the government and now they want to give it to Citibank so that they can loan our own damn money back to us at 16% interest. How can the US consumer and citizen not see through this? Why aren’t we rioting at the gates? Have we become so immune to this kind of horrible representation that we just don’t care anymore?

God, this crap is starting to infuriate me. I try to be measured and reasonable but seriously, when my own government tries to loan me my own money through an intermediary who charges me loan shark type interest, I lose all sense of measure and reason. Fucking assholes. Give me my money back directly and dispense with the bailout crap. WTF. Idiots. We are being governed by idiots who are taking pails of shit from the financial pig pen, throwing it at the wall and trying to see what sticks while interpreting the Shit Rorschach to determine what pail to try next. Idiots.

The More Things Change…

I wonder if all those people who voted for Obama and his policies of change are starting to feel shortchanged. Bloomberg writes:

President-elect Barack Obama said overhauling the federal budget is “imperative” and vowed to eliminate unnecessary spending programs in areas from health care to agricultural subsidies.

He’s starting to sound downright conservative in his policies. Wonder how the angry left feels about that.

More Clojure On Windows

I’m slowly working my way through Stuart Holloway’s Programming Clojure book (and using slowly in that phrase does a terrible disservice to the word) and so far, I’m enjoying it. I had a run at Common Lisp a couple of years ago and ran into a brick wall for the most part (I think football season started). I’m mostly playing with Clojure to get a different perspective on programming apart from my usual day job as a .Net developer.

All that intro aside, I wrote about both starting and stopping the REPL here. In working through the book, you need to have the clojure install directory, the clojure-contrib directory and the code from the book on your CLASSPATH. Instead of modifying that in the environment variables on Windows, it’s a great deal easier (and smarter according to IBM to just modify the CLASSPATH at startup using the command line. This is extra easy if you created the clojure.bat file I wrote about in my previous entry linked above. You can just change the one line in it to “java -cp path_to_clojure\clojure.jar;path_to_clojurecontrib\clojure-contrib.jar;path_to_book_code clojure.lang.Repl”. Once you’ve done that, you’re up and running with the book samples.

Being both a Java dummy and a Clojure dummy, I’ll try to keep posting tips from my foray here.

Is The Bush Administration Going After Mark Cuban?

You may have heard the reports that the SEC has charged Mark Cuban with insider trading. There seems to be some evidence, anecdotal and otherwise, that this may be in retaliation for a couple of things. While it certainly sounds like conspiracy theory, remember, just because you’re paranoid that people are out to get you doesn’t mean they aren’t. I wouldn’t put it past the Administration or any other do do exactly what is laid out in the link above. Of course, they picked on a guy who likes to fight his own fights and has the money to do it. This could get quite interesting.