nobot.stories

Archive for December, 2008

Vegetarianism

Such a lame blog title I know.  ”Great, another self-absorbed hippie with a blog”.  Well, maybe.  Anyhow, this is the story.

Anyone who knows me well knows that I am motivated by my dreams (ref: Marina, etc) — or at least I talk about being motivated by them more than most people I know.  About a year ago, I had a dream about killing an animal.

rabbitexThe dream opened at a tense moment.  I was across a table or countertop from a furry animal like a cat or a rabbit.  I had a knife in one hand.  My mission was to kill the animal — that’s all I was to do.

I tried a bunch of times to get it with the knife, mostly missing it completely, but I struck it a couple of times.  One time I caught its front foot, which I sliced off.  At this point, things started to get horrifying to me.  It was clearly in pain and now struggling with the situation.  I had very intense feelings of sadness for this creature, but I was still driven to kill it — now partly out of pity since at this point there was really no going back.

I made a final lunge at it with the knife and pierced its chest area.  Clear liquid (not blood, hmm…) poured out.  It was staring me dead in the eye.  I could feel the life draining from it and it upset me very much.

At that moment, I woke up with my heart racing.  I was sweating, breathing heavily, and really bothered inside.

That was really the turning point.  We had been eating veg maybe one or two nights a week, but that dream marked when I got more serious about not eating meat.

There are lots of good reasons not to eat meat, not the least of which is avoiding causing pain and anguish in another animal.  Environmental reasons, health reasons, kitchen-hygene reasons all point to going veg.  On the other hand, lots of folks enjoy the taste of meat in their food — fair enough.

I definitely found it hard to give up eating certain things — not having sausage in lasagna or pizza was a biggie.  The longer I stay away from meat though, the less I crave it.  I’m actually kind of grossed out by chicken now — I’ve had it here and there and can really taste the chicken coop in it.

I’ll make an occasional exception though.  If I’m at someone’s house and they don’t know I’m veg, I’ll usually not say anything because I’m not a veg-zealot and I’m not *so* grossed out as to make a scene.  An infrequent trip to a Ramen house or Vietnamese Pho restaurant is also a time where I’ll de-cloak from vegetarianism.

Anyhow, that’s the story.  Hopefully we’ll now get back to more interesting posts…

Comments (4)

The Bucket Analogy for Photo Exposures

There are three primary aspects to a photographic exposure:

  1. How sensitive is the recording material?
  2. How bright is the light contacting the recording material?
  3. How long is the recording material exposed to the light?

I’ve found it useful to map the task of getting the “right” exposure to the act of filling a bucket (the film or digital sensor) with water (light) through a hose (the camera and lens).

  1. The sensitivity of the recording material (measured in ISO) is akin to the size of the bucket.  A smaller bucket is analogous to a more sensitive recording material (higher ISO).
  2. The lens’s aperture (f/number) maps to the flow rate of the hose.  A bigger aperture (smaller f/number) is like using a fatter hose to fill the bucket.
  3. The shutter speed (exposure time) is the duration the hose is turned on.

Your job as photographer is to fill the bucket perfectly.

If you make a try filling the bucket and it is not quite full, this is analogous to an underexposure, or dark exposure.  To do it better, you need more water.  So either you need a higher flow rate hose (wider aperture) or you need to keep the hose running longer (longer shutter speed).  

If the bucket overflows, you either need to constrict the hose you are using (smaller aperture) or turn off the hose sooner (shorter shutter speed).

Makes sense?

Here are some additional explanations of the three axes of an exposure:

ISO (Sensitivity)

Film or digital sensor sensitivity is measured in ISO units.  The higher the ISO number, the more sensitive the recording material is.  So ISO 200 is twice as sensitive as ISO 100, and thus requires half the light to get an equivalent exposure.

Aperture

A lens’s job is to collect and focus light.  A larger diameter lens is able to collect more light than a smaller diameter lens.  Therefore, a larger diameter lens can project a brighter picture onto the recording material.  It’s not always desirable to have the lens gathering as much light as it possibly can, so most camera lenses have an adjustable diaphragm inside to restrict the amount of light that passes through the lens.  It’s very similar to having a really big window in a room with shades over it that you can close.  Sometimes it’s great to let the light stream in, but not always.

Aperture is expressed as f/number which is the focal length of the lens divided by the diameter of the lens opening.  So a 100mm lens that had a 25mm opening would have an aperture of f/4 (100 / 25 = 4).  The same lens with a 50mm opening would have an aperture of f/2 (100 / 50 = 2).

Doubling the area, not the diameter, of the lens opening doubles the amount of light striking the recording material.  So in the example above, if we look at circle areas, the f/4 aperture has an area of 490 mm^2 ((( 25mm / 2 ) ^ 2 ) * pi) while the f/2 aperture has an area of 1960mm^2.  The f/2 aperture lets in four times the light as the f/4 aperture.

Shutter Speed

This is the duration the recording material is exposed to light.  It it typically represented as a number like “1000″ or “60″.  In these cases, this is the reciprocal of the actual duration of exposure.  When a camera shows an exposure of “1000″ it really is 1/1000th of a second.

An exposure of 1/30 second lets in twice as much light as 1/60 second.

Now get out there and shoot, shoot, shoot.

Comments (3)

One-Line Javascript Templates

I came up with this today.  Maybe it’s not original, but I think it’s pretty cool.

The overall concept is that there is a DOM node that holds an output template.  A template is defined as some HTML that contains some strings to be replaced.  In this case, the “to be replaced” strings look like @this@.

The template processing function takes a key:value map and a handle to the template element as arguments.  The keys in the map are matched with the string between the @at-signs@.  The whole @mess@ is replaced with the value from the map.  The processing function returns a string representing the replaced innerHTML of the template element.

In this example, I’m using jQuery constructs, though the compactness of this solution is not reliant on the lovely terseness of jQuery.

Here is an example template:

<div class="template" id="field_tpl">
  <div class="field_container">
    <div class="field_name">@id@</div>
    <div class="field">
      <input class="@classname@" id="@id@" value="@val@"/>
    </div>
    <div class="field_help">@desc@</div>
  </div>
</div>

 Be sure you define a CSS rule to hide the display of the templates!

<style>
  .template { display:none; }
</style>

 Here is the magical one-line Javascript template processor:

function processTemplate(map, tpl_elem)
{
  return tpl_elem.html().replace(/@([^@]+)@/g, function(m,s1) {
      return (typeof(map[s1]) != 'undefined' ? map[s1] : '');
    });
} 

Feed the template processor a key:val substitution map and a handle to the template element, and get back a string:

var map = {
  id:'my_id',
  classname:'required',
  desc:'My Description.'
};
alert( processTemplate( map, $('#field_tpl') ) ); 

The real strength of this solution lies in problems where the same template will be used a bunch of times on a page.  No HTML repitition is necessary and data is separated from presentataion, so it makes experimenting with different layouts or constructs easier.

Here is  a full working example of all the pieces stitched together.

Comments (2)

Mobile Post

Trying out the WordPress iPhone app.

Comments (2)