I love ingredients. I certainly like the ingredients themselves more than any meal I can produce using them, probably more than the most exquisite dish prepared by a professional chef. I like handling them, choosing them, prepping them and I like talking about them. When I empty my camera's memory there is almost always pictures of onions or squash, mushrooms or cabbage. But there are some ingredients that I like more than others. One of those is okra. I like okra and I'm not even southern.
My local grocery store carries okras all year; sad, shriveled and discolored specimens in a basket at the back of the gourmet section. Not really worth cooking with. After despairing for months, I recently noticed that they also carry frozen, sliced okra which look much more appetizing. But what do you do with frozen okra? Soup!
Here is my latest attempt which I think worked quite well. The recipe makes roughly two servings and should be taken with a (figurative) grain of salt since I don't measure when I cook so all the numbers are guesses.
Ingredients:
Melt the butter in a heavy sauce pan. Saute the chicken until it just starts to brown. Add the garlic and continue sauteing for one or two minutes until it is fragrant. Add the stock, the wine and the tamarind (or lemon) to the pan. let simmer for 5-10 minutes then add the okra (no need to thaw it in advance). Let the soup return to simmering and continue for another 3-5 minutes then serve with toothy (such a good word) bread.
The soup is fast and very simple. If you want to try variations the wine and the acidic ingredient (tamarind or lemon) are good places to start since they control the major flavor of the dish. Tamarind will make it sweeter and fruitier, lemon will make it tarter. Other vegetables or meats might work. Sliced yellow potatoes added with the stock would probably turn out well. Replacing the chicken with beef would probably also work, though you might want to increase cooking times.
I recently ran into an irritating problem with Java's autoboxing. A lot of confusing autoboxing problems are well documented by irate and bemused programmers alike but I haven't seen anyone dealing with this particular variant before so I figure it's worth mentioning. Take this artificial but harmless looking example:
class Test {
public static void main(String[] args) {
Integer test = null;
System.out.println( false ? -1 : test);
}
}
What does it do? It prints out either the value of test or -1 depending on how the ternary operator evaluates. In this case the ternary operator's test is always false so it prints out the value of test which is always null so you would expect to see "null" on the console, just like if you had passed any variable containing null to System.out.println(). But no. This code throws a null pointer exception. Why? You can see the answer by looking at the decompiled version of the same code (decompiled using JODE):
class Test
{
public static void main(String[] strings) {
Integer integer = null;
System.out.println(integer.intValue());
}
}
What happened here? I'm no compiler expert, but I assume it's trying to assure that both side of the ternary operator return values of the same type. I would bet that there was an earlier stage in the compilation where the code looked like this:
class Test
{
public static void main(String[] strings) {
Integer integer = null;
System.out.println(false ? -1 : test.intValue());
}
}
And that the ternary operator got stripped away by the optimizer because it was guaranteed to always have the same result at runtime. I wonder why the compiler didn't catch this error rather than turn my perfectly reasonable code into guaranteed failure. Fortunately, it's easy to fix. You can avoid conditionals like this entirely, which is probably good for your code's readability, or you can explicitly do the type conversions yourself in a way that you guarantee is null safe.
I don't normally do much with video, but I recently found myself wanting to turn a bunch of png frames into an mpeg video so I set out looking for tools. A few minutes searching didn't turn up much, which I found kind of surprising since I'd expect this to be a common task. Eventually I found three possibilities. Two were the usual suspects but one was new (to me):
I'd never seen ffmpeg before, though its been around for a while and is associated with the pervasive Mplayer. Once I got it installed I was up and running right away. There are a lot of options, but basic usage is very simple:
ffmpeg -i frames/frame_%06d.png movie.mpg
The only tricky part is the '-i' option. It tells ffmpeg where to look for the source file(s). In this case a directory full of still images. It uses the '%06d' pattern to stand in for frame numbers padded with zeros out to six digits. So I might have a frame named “frame_000004.png" and that would end up being the fourth frame of the movie. It runs for a few seconds then spits out a file called 'move.mpg.' Great.
The only trouble I had with it came from the fact that I was generating my own pngs (using Matt Gushee's GD4O) and I wasn't being careful about shutting things down so my last frame was often corrupted which caused ffmpeg to segfault. But that's my fault for asking an encoder to read my sloppy files.
And if you're curious the movie I was making is here (10mb). It's a two dimensional version of one of Wolfram's example one dimensional cellular automata. Cells can have any value from 0 to 1 and the value of a cell is decided by taking the average value of its eight neighbors on the previous generation, multiplying by 3/2 and keeping the fractional part.
Of all the vague projects I drift in and out of, this may be one of the most ambitions and, paradoxically, most likely to succeed. Myself and some of my friends are building one of these. Or, rather, something similar.
What is it? It's a 3D printer. A machine for manufacturing plastic parts from computer models. Ours will use a heated extruder (think hot glue gun) to build up its models. It's pretty exciting and I will definitely be posting more details as things progress.