Wednesday, November 23, 2011

Vegan Pumpkin and Cranberry Muffins Recipe - Modified


My first attempt at Isa Chandra Moskowitz's Vegan Pumpkin Muffin didn't fare well. They were undercooked and dense. I was pretty sure the cranberries added too much moisture to the basic recipe.

A small adjustment (1/2 the soy milk) and an ingredient substitution (substitute 1/2 of the oil with apple sauce) gave better results. I think baking them longer helped too. 

Here's the modified recipe.

Vegan Pumpkin and Cranberry Muffin

Ingredients

1 3/4 cups King Arthur all-purpose flour
1 1/4 cups sugar
1 tablespoon baking powder
1/4 teaspoon salt
1 teaspoon ground cinnamon
1/2 teaspoon ground or freshly grated nutmeg
1/2 teaspoon ground ginger
1/4 teaspoon ground allspice
1/8 teaspoon ground cloves
1 cup pureed pumpkin (not pie mix)
1/4 cup soy milk (reduced from original recipe's 1/2 cup)
1/4 cup vegetable oil (
reduced from original recipe's 1/2 cup)
1/4 cup natural apple sauce (to reduce original recipe's vegetable oil)
1 cup whole fresh cranberries
2 tablespoons maple syrup (original recipe is molasses)

Directions

Preheat oven to 400°F. Use paper muffin liners or lightly grease a twelve-muffin tin.

Roughly chop the cranberries. I like larger chunks of cranberry in the muffin. 

Sift together flour, sugar, baking powder, salt, and spices. In a separate bowl, whisk together pumpkin, soy milk, oil, apple sauce, chopped cranberries, and maple syrup. Mix together the wet and dry ingredients.

Evenly fill the muffin cups. Mine ended up about three-fourths full. Bake for 25 to 28 minutes, until a toothpick or knife inserted in the center comes out clean.

Nutritional Information


Per Muffin
Calories 193.6
Total Fat 2.9 g
Saturated Fat 1.8 g
Polyunsaturated Fat 0.1 g
Monounsaturated Fat 0.1 g
Cholesterol 0.0 mg
Sodium 175.8 mg
Potassium 93.4 mg
Total Carbohydrate 41.2 g
Dietary Fiber 1.8 g
Sugars 24.2 g
Protein 2.4 g

Tuesday, November 22, 2011

iOS App Development with PhoneGap and Spine Mobile: Example App



Alex MacCaw, the creator of Spine and author of O'Reilly's JavaScript Web Applications, has a simple example of a mobile contact application. We'll set this application up, add a little functionality, and eventually wrap it in PhoneGap as a iOS app for the iPhone.

There's an explanation on spinejs.com you can follow for a thorough explanation of the application. 


Let's get it setup and running locally.
  1. Download the app from github.com. My copy is under ~/Documents/spine.mobile.contacts/.
  2. Open a terminal and change to the spine.mobile.contacts directory.
    $ cd ~/Documents/spine.mobile.contacts
  3. Install the local npm modules
    $ npm install .
  4. Start the hem server
    $ hem server
  5. Browse to the application at http://localhost:9294/
You should now see this...


Go ahead and add a few contacts. HTML5 local storage is used to persist the data.

Now, let's add a way to delete contacts. Open contacts.coffee located in the ~/Documents/spine.mobile.contacts/app/controllers/ directory with a text editor. We want to add a delete button to the ContactsShow class. ContactsShow is the controller for the panel that displays an individual contact when you click on a contact in the list view.

The changes are pretty simple.

class ContactsShow extends Panel
  className: 'contacts showView'

  constructor: ->
    super

    Contact.bind 'change', @render

    @active @change

    @addButton('Back', @back)
  
    # Delete button placed to the right with a callback 
    # to a delete function
    @addButton('Delete', @delete).addClass('right')

  render: =>
    return unless @item
    @html require('views/contacts/show')(@item)

  change: (params) ->
    @item = Contact.find(params.id)
    @render()

  # Delete callback function
  # Confirm the delete, then navigate back to the list view
  # If they change their mind, stay here
  delete: (params) ->
    if confirm('Are you sure?')
      @item.destroy() 
      @navigate('/contacts', trans: 'left')

  back: ->
    @navigate('/contacts', trans: 'left')

Save your changes. There's no need to restart the hem server. Just reload the site in the browser, hem dynamically picks up the changes with each request.

Click on a contact, the item view displays with the delete button on the top right.

Click the delete button. You should see a confirmation dialog...
Click cancel and you'll see the item view. Click ok, the contact is deleted and the list view is redisplayed.

In my next blog post I'll finish wrapping the app in PhoneGap.


Sunday, November 20, 2011

Vegan Pumpkin Muffins

Lydia has been quietly and occasionally requesting I make some vegan muffins. She had some at a marching band function a few months ago and just loved them.


She couldn't tell me what kind they were exactly - just that they were "white and cake-y". She said they were in a book called "Vegan Cupcakes Take Over the World" by Isa Chandra Moskowitz. I haven't picked up a copy of the book yet, and haven't found the white cake recipe anywhere online, but her Post Punk Kitchen website has a vegan pumpkin muffin recipe that sounded good.


You can find the recipe at http://www.theppk.com/2009/11/the-best-pumpkin-muffins/.


I tried making two batches. The first is the basic recipe. It turned out moist and looks pretty good. Sean had a hard time waiting for them to cool before devouring one. Lydia had more restraint, and thought they were a bit heavy but tasted good.



The second batch included chopped fresh cranberries. Unfortunately, I think I added too many. I should have also reduced the amount of soy milk to compensate for the added moisture. They are a bit dense and undercooked in the center. However, the added cranberries make them explode with flavor!



I love the cranberries in these so much I'm going to give it another go Wednesday while I'm waiting for my potato rolls to rise. I'll post a modified recipe when I get them right.



iOS App Development with PhoneGap and Spine Mobile: Setup

You need to setup your development environment. 


Since I'm targeting iOS I'm obviously using a Mac with OSX Lion and Xcode 4.2. You can find help with installing Xcode at developer.apple.com. Done? Good.



Here's a summary of the setup. The various web sites have more details.

Install Homebrew
If you're familiar with Linux's apt-get you'll love Homebrew. Simplifies installation and update of the Unix-y bits and bytes for OS X. Homebrew installs to the user's local space so sudo isn't required.

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"

Install node.js via brew

$ brew install node

Install npm
For some reason, npm has been removed from brew. Use curl to download and install it.

$ curl http://npmjs.org/install.sh | sh
Install Spine, Spine.app, and Hem via npm


$ npm install -g spine spine.app hem


iOS App Development with PhoneGap and Spine Mobile: Introduction

A friend of mine recently asked me if I knew how to write iOS applications. She has an idea for an app (don't we all). Well, iOS development is something I've wanted to do since I picked up an iPod Touch a couple of years ago, I just haven't made the time to do it. 

I recently started learning Node.js and the Spine MVC framework for HTML5 web application development. The last website I worked on was several years ago (ASP.Net 1.1) and I want to try something that's not in the Microsoft stack. I've done PHP in the past but didn't really want to try it again. Javascript is hot and CoffeeScript has a lot of bleeding-edge attention right now. Maybe I can get ahead of the curve.

Spine also has a mobile framework that supports HTML5 web sites targeting mobile devices. I finally got a on of the simple demo apps working this week. Pretty darn easy once the sample app and the current Spine framework were in sync. 

Once I got that working I noticed a doc describing integration between Spine and PhoneGap. PhoneGap wraps your HTML5/JavaScript app into a mobile device native application with access to the device API. You can also deploy the application to multiple platforms. It's also open source. Sounds winning to me.

In future posts I will describe how to develop an iOS native application using PhoneGap, Spine Mobile, and CoffeeScript. Since the frameworks are constantly changing, I intend to keep an up to date working copy.


Sunday, September 18, 2011

King Arthur Banana Bread


Finally used up our stash of over-ripe frozen bananas. We eat a log of bananas. Occasionally, we don't finish them off before they are too ripe so we toss them in the freezer whole - peel and all. When you need them, take them out of the freezer and thaw. Or you can peel them while frozen and nuke to defrost. They're also great for making a smoothie while still frozen (sans peel of course).


Used a recipe from King Arthur Flour and their white whole wheat flour. The crumb is nice and the texture even. It's slightly dry for my taste. Probably should substitute some of the butter with applesauce, use egg substitute, and perhaps use a 50/50 mix of whole wheat and white flour.

Ingredients:
1/2 cup unsalted butter, at cool room temperature
2/3 cup brown sugar, light or dark, firmly packed
1 teaspoon vanilla extract
1 teaspoon ground cinnamon
1/4 teaspoon ground nutmeg
1 teaspoon baking soda
1 teaspoon baking powder
1 teaspoon salt
1 1/2 cups mashed ripe bananas (about 3 medium or 2 large bananas)
3 tablespoons apricot jam or orange marmalade, optional but tasty
1/4 cup honey
2 large eggs
2 1/4 cups King Arthur Unbleached All-Purpose Flour
1/2 cup chopped walnuts, optional

Directions:
Preheat the oven to 325°F. Lightly grease a 9" x 5" loaf pan.

In a large bowl, combine the butter, sugar, vanilla, cinnamon, nutmeg, baking soda, baking powder, and salt, beating till smooth.

Add the mashed bananas, jam, honey, and eggs, again beating until smooth.

Add the flour, then the walnuts, stirring just until smooth.

Spoon the batter into the prepared loaf pan, smoothing the top. Let it rest at room temperature for 10 minutes.

Bake the bread for 45 minutes, then gently lay a piece of aluminum foil across the top, to prevent over-browning.

Bake for an additional 25 minutes. Remove the bread from the oven; a long toothpick or cake tester inserted into the center should come out clean, with at most a few wet crumbs clinging to it. The tester shouldn't show any sign of uncooked batter. If it does, bake the bread an additional 5 minutes, or until it tests done.

Allow the bread to cool for 10 minutes in the pan. Remove it from the pan, and cool it completely on a rack.


Nutritional Info:
Serving Size 1 slice (60g)
Servings Per Batch 18
Amount Per Serving
Calories 170
Calories from Fat 50
Total Fat 6g
Saturated Fat 3.5g
Trans Fat 0g
Cholesterol 35mg
Sodium 230mg
Total Carbohydrate 27g
Dietary Fiber 1g
Sugars 14g
Protein 3g

Ganbatte Kudasai!


Sensei taught me a phrase tonight that really struck me -- Ganbatte kudasai!
As with most things, I "Googled" it as soon as I got home. A common translation is "Please keep up your good work.", "Good luck!", or "Please do your best." The closest phrase I found near to Sensei's use of it was "Please do the best to reach your goal." Note the emphasis on "your."
Unfortunately, as with many translations, a lot of the cultural context is lost. The Google Oracle tells me Ganbatte kudasai is the polite form of Ganbare! Ganbare is more like a kick in the pants from your father. Ganbatte kudasai can be said to your seniors.
Sensei gave us a meaning that fit the context of the class tonight - "Please exhaust yourself." Often he points out that the place where you advance in karate (or really anything) is the point where you think you can do no more, and you push yourself to do whatever it is just one more time. Just one more pushup. Mou ichido!
I needed to hear this tonight. I "gave up" on Sanchin when I knew I could do more. Yes, my knee hurt, but did it really hurt that much? Perhaps I needed to hear Ganbare! Mou ichido!
Oshiete kurete arigatou gozaimashita!