Tuesday, April 1, 2008

Whither form posts, Safari?

Now, in the "code" department...

I'm writing this for the benefit of the web-at-large, as nobody else appears to have commented on this behavior in my Googling.

Say you have an ASP.NET form with a FileUpload (<input type="file">) element in it. You leave the element blank and submit the form.

Internet Explorer and Firefox both send all of the form elements to the server, with no file.

Safari, on the other hand, sends an empty form post.

That makes ASP.NET sad, as none of the hidden ViewState fields are sent. Which means that your Button_OnClick bindings won't work, because they rely on the ViewState to know what just happened.

Here's my solution: for Safari, remove any blank file elements before the form is submitted.

The problem exists on both Safari 2.0.3 for OS X and Safari 3.1 for Windows.

This solution should work, but is not tested as written (I changed it to an anonymous function for this blog post). It requires Prototype.js.


Page.RegisterOnSubmitStatement(
"fixSafariSubmits",
@"(function() {
if (Prototype.Browser.WebKit) {
var pageForm = document.getElementsByTagName('form')[0];
var inps = Form.Methods.getInputs(pageForm, 'file');
inps.each(function(inp) {
if (inp.value == '') Element.remove(inp);
});
}
return true;
})()");

Sunday, March 16, 2008

Pain à l'Ancienne

All kinds of news from out here.

We just had an offer accepted on a house! So if you thought I didn't post very often before, now it's going to be even less for a while!

Second, I may have some sort of allergy. Possibly to wheat. So who knows how long this blog will last.

But third, my wife bought me a copy of The Bread Baker's Apprentice for my birthday. And in it is a recipe for Pain à l'Ancienne.

And it is goooood.

I feel that it would be doing the author a disservice to post the recipe for this one. Besides, you really have to get into the first few chapters to understand the theory behind it. But basically, it's completely different from every other bread I've made.

For one, there's no kneading. For another, you use ice cold water -- as in refrigerated for several hours, then with ice added to it. You use less than a teaspoon of instant (quick-rise) yeast. You mix the basic ingredients together (flour, water, yeast salt), then stick it into the fridge immediately to keep the yeast from being too active. The dough is so wet you couldn't possibly do any kneading. And the oven is preheated to 500 degrees, then turned down to 475 only after you've given the bread three steam baths, one every 30 seconds.

But it's eye-opening. The flavor and texture are fantastic -- a cut above anything I've ever baked. We went through almost an entire baguette last night at midnight, after it had cooled enough to eat. I think I'm going to break into another one in a minute.

Yum!

Thursday, February 28, 2008

A new era awaits

So I've finally reached a point of frustration with my bread. I can make tasty flavors, but textures? They're all kinda... sandwichy. You know -- even crumbles throughout, with now real elasticity and certainly none of the great air bubbles you get in artisan breads. So I decided to Ask Metafilter what I could do to improve things, and received some excellent responses.

The missus used that info to get me a terrific present for my birthday: The Bread Baker's Apprentice. I'm hoping this takes my bread baking skills to the next level. Will update you on my progress sometime in my next post, which at my current posting rate will probably be in mid-2010.

Friday, January 25, 2008

Redfin Walkability, Challah

Sorry for the delay and lack of bread. I've actually become the master of Challah over the past few weeks. Here's a generic Challah template:
1 c water
1 egg
1/4 c honey
1/4 c canola oil
1 scant tbsp yeast
2 tsp salt

1 more egg, beaten with a tbsp of water
Sesame seeds

Mix all the above together. Add in flour slowly until the dough is kneadable. Knead for 5-10 minutes. Let it sit for an hour until doubled in bulk. Punch down and braid. Let it rise another 45 minutes. Brush with the egg/water mixture, then sprinkle sesame seeds on top.
Pop it into a 350 degree oven for 20 minutes. After 20, be vigilant -- the sugar and egg conspire to make this burn quickly and without warning!

We're in the market for a home, and using RedFin to find properties. Our knowledge of neighborhoods is still not great, but we know wherever we end up we want to be able to walk to the grocery store, a coffee shop, and other things. Here's a little GreaseMonkey script that adds a "Get WalkScore" link below a property's address on RedFin. It just links over to WalkScore.com with the current property. Handy!

Monday, July 23, 2007

On Harry Potter

Two days later I'm still depressed that it's all over. I explained to Mrs. Rouftop over lunch:

Imagine you just got the last bag of potato chips in the world. And you have to eat it as fast as you can because there's a hole in the bag that will cause the chips to "spoil" (ha ha). Then when you've finished it, there are no more chips. Anywhere. Ever again.

And you still crave just one more damn chip.

That's how I feel.

Sunday, July 22, 2007

Bread Alert: Poppy Almost Wheat

I needed to bake. It had been too long. We actually BOUGHT a loaf of bread last week. How wrong is that? So I finally set up a sponge in the evening, knowing that my hatred of wasting food would overcome my growing slothness. (Slothiness? Slothliness? Slothistry?).

No photos, and I'm blogging from memory this time as the loaves are a couple days old. Worse, I didn't even measure some of the ingredients. Just threw 'em in willy-nilly.

Sponge:
  • 1 packet yeast
  • 1 c all-purpose flour
  • 1 c whole wheat Flour
  • 1 c Water
  • 1 tbsp maple syrup

Mix:
  • 1/2 cup slivered almonds
  • 1/8 cup poppy seeds (?)
  • 1 cup water
  • 1 tbsp olive oil
  • 1 tbsp salt (see Notes)
  • 2 tbsp wheat germ
  • 2 cups whole wheat flour
  • 1-2 cups bread flour

Glaze:
  • 1 egg
  • 1 tbsp water
  • poppy seeds

Combine the sponge ingredients and let sit in a warm spot overnight.

Toast the almonds in the toaster oven to bring out the flavor, watching closely to make sure they don't burn. Remove and let cool until they are no longer too hot to touch. Add nuts and poppy seeds to the sponge and stir. Add salt and wheat germ, then water and olive oil and mix to form a batter. Slowly add whole wheat flour until the dough is kneadable, then transfer onto a floured work surface. Knead for 10 minutes, using the bread flour as needed to control the stickiness.

Oil a bowl, plop the kneaded dough in and give it a twirl. Cover with plastic wrap and let rise until doubled, 1 hour.

Oil a pair of loaf pans. Punch down the bread and shape into two loaves. Press into the prepared pans. Cover and let rise until doubled again, 45 minutes.

20 minutes before baking, preheat the oven to 350.

Beat an egg with one tablespoon of water. Using a basting brush, lightly coat the top of the loaves. Sprinkle with poppy seeds. Place in the oven and bake for 30 minutes or until the loaves sound hollow when tapped on the bottom.

Notes:
  • I FORGOT THE SALT! This led to the bread rising quite quickly. Desperate, and willing to experiment, I took our salt shaker and shook some onto the dough after the first rising, then kneaded it in. In all I probably only added 1/2-1 tsp of salt. This was not enough, hence the recommendation to add 1 tbsp at the correct time.
  • Maybe due to the humid, rainy weather (or the lack of salt?), this loaf started to show signs of mold after only two days on the counter. I cut off the suspect bits and threw the loaves in the fridge. Not my favorite solution but we don't have any better at the moment.
  • This loaf deserves a second try. We actually have been shaking salt onto the bread before adding other ingredients, as it's a bit bland. But the flavors/textures of the poppy seeds and almonds are quite good.

Sunday, July 8, 2007

Bread Alert: Super Wheaty Rye

My mother was in town this weekend, and she's on a strict diet which allows for no white flours. I invented this loaf for her.

Sponge:
  • 1 cup whole wheat flour
  • 1 cup rye flour
  • 1 packet yeast
  • 1 tsp molasses
  • 1 cup water

Sift together flours and yeast. Add molasses and water and stir to form a heavy batter. Cover with plastic wrap and let sit overnight.

Mix:
  • 1 tbsp wheat germ
  • 1 tbsp carraway seed
  • 1 tsp dill
  • 1 1/4 cup hot water
  • 1 tbsp safflower oil (whatever flavorless oil you have is fine)
  • 1 cup rye flour
  • 3 cups whole wheat flour, approx

Sprinkle the wheat germ, carraway, and dill on top of the sponge. Add the hot water and stir to form a nice wet batter. Add the rye flour and stir well. Slowly add in the whole wheat flour until the dough is kneadable. Flour a work surface with more whole wheat, and knead for 10 minutes, adding whole wheat flour as necessary to control the stickiness.

Oil a mixing bowl. Place the dough in the bowl and give it a spin, then flip it so all surfaces get a little oil on them. Cover with plastic wrap and set in a warm place to rise, one hour.

Punch down the dough and divide in two. Oil two loaf pans, shape the ball into oblongs and press into the pans. Cover and let rise until doubled in bulk. (WARNING: I let this rise for too long. See my notes below. I recommend 45 minutes for the second rising.)

20 minutes before baking, preheat the oven to 350. Bake for 30 minutes or until it sounds hollow when tapped. Allow to cool completely before cutting and serving.

Notes:
  • Because of the lack of bread flour, this dough doesn't quite have the elasticity of the others I've made.
  • Oh noez! The bread rose beautifully, but collapsed in the oven. Latest theory -- I allowed it to rise too much before baking. I gave it one hour for the second rising in a very warm room, when 45 minutes would have been enough.
  • The flavor is very rich with this bread. The sheer quantity of whole wheat provides a contrasting flavor to the rye; even though it's technically a rye bread it really tastes more like a brown bread. It would have benefited from an even lengthier sponge.
Photos:
The sponge. Didn't have as pungent a smell as before, but that didn't affect the rising.

After the first rise. You can see that there's nothing wrong with the yeast!

I wish I had a photo before they went into the oven, so you could see how much they had risen. Yet after baking, they fell back to their pre-rising height.
Website Counter