Thursday, August 19, 2010

Whoa, Whey Bread!

After making yogurt (or cheese) you're going to have a bunch of a golden liquid called whey.  I'm a big fan of homemade bread so when I heard that you could use whey to enhance bread I decided I needed to try it the next time I made yogurt.

The benefits of using whey for making bread are a better rising time, better crusts and flavor, and a firmer texture.

I made my first batch earlier in the week and we ate it so quickly that I didn't get a chance to take pictures.  I'll try to make some more later on and post pictures this time.

I found that the crust and texture of this bread was excellent and it rose very nicely in a fairly short period of time.

Here's the recipe I'm trying this time:


French Press Coffee Recipe

I figured I'd just post this as a reminder to myself.

Today I tried this french press recipe and I thought it turned out pretty well.

Ratio of coffee to water: 1/16

So that's:

  • 64 grams coffee to 32 oz water
  • 2 oz coffee to 32 oz water
  • 1/2 oz coffee to 8oz water

And then it's a very simple procedure:

  1. Boil water.
  2. Grind beans.
  3. Throw beans in french press
  4. Steadily pour in hot water (you're looking for a temp between 195F and 205F)
  5. Allow to steep 3-4 minutes


Monday, August 16, 2010

Homemade Yogurt

I love yogurt. In an effort to prove my devotion to the creamy and tangy Greek yogurt that I adore I've started to make my own.

Aside from some time and attention, yogurt is not that difficult to make and the homemade stuff is quite delicious and the leftover whey is very useful in bread making as I'll try to show later on.

First here's what you need:

Yogurt making stuff!

Friday, August 13, 2010

Posting with Apache Bench

Because it took me a disproportionate amount of time to figure this out the second time I'm writing it down:

ab -n 1000 -c 25 -p sessionkey2.post -T "application/x-www-form-urlencoded" "https:/
/127.0.0.1:8443/SessionKey"

The trick is specifying -p <postfile> and -T <content-type for post file data>.

The postfile above looks like:

key1=value&key2=another+value

All as one long url encoded line.

Encoding the post data is really quite easy to do in python:


import urllib
pv = {"key1":"value",
      "key2":"another value"}
print urllib.urlencode(pv)



Monday, August 9, 2010

Asynchronous Access to My Desktop Pictures

I've been working a lot with Twisted lately so I thought people might appreciate
a fun example of how one could download a bunch of files quickly using
asynchronous IO.

Anyway, this script currently grabs a ton of nice hi resolution
National Geographic photos. Enjoy! (Download the python file directly)


Tutorial Correction: File IO

8 years ago, thinking I knew a lot about Python, I wrote up this Python tutorial and presented it to some folks at my school in an effort to learn Python better and evangelize my favorite programming language.

After all this time I think I've learned a lot more about Python but the more I learn the more I realize how unprepared I was to write this tutorial.  Basically, what I'm saying is that I made some mistakes.

Since making mistakes is the way software gets done I suppose it isn't the end of the world but I digress...

Today I'm correcting a mistake in the Python tutorial about buffered / non-buffered IO.

Basically, 2002-me made the mistake of assuming that all file operations were unbuffered because the heavily customized gentoo environment he was writing all the tutorial stuff on at the time was defaulting to unbuffered IO.  This is a pretty big oversight that makes some tutorial examples non-functional for folks out there with an operating system that buffers IO by default (Mac OS X, probably other BSDs, I'm sure some flavors of Linux, etc).

Anyway, I've updated the tutorial page here with better info about why that example works the way it does, the way to make it work if your platform defaults to buffered IO, and the right way (hint: with keyword) to write your program so that it doesn't rely on the corner case my linux platform example relies on.