On pencil shavings

May 29, 2008 under technical

I like using wooden pencils. I like way they feel in my hand. I like the scratchy feel of lead on paper; it’s dusty and imprecise. It’s real.
When I nibble on the end, the wood dents and dimples.
I distrust the soulless mechanical monsters that spit out a thin stream of polished lead, click by click. I’m left unsatisfied by their thin, fine, precise lines.
The pencils feel heavy in my hand, the leads are fragile and snap under a firm hand.
Give me thick; give me chunky; give me a line that has some width and feeling.

I like sharpening wooden pencils. There’s satisfaction in the long, unbroken shaving; in the needle point, primed and ready for action.

When I think of a perfectionist, I think of a pencil that is always sharp.

This is wrong.

The problem with perfectionism (or being meticulous, as we like to call it) is that it suffers from tunnel vision.
We start to obsess about things that are unimportant; we optimize to the wrong set of metrics.

What’s a good pencil metric? Having a perpetually needle-point pencil feels good and it feels perfect and right, but the point is just going to snap and dull very quickly.
Whenever you sharpen a pencil, you lose lead: part of the shavings come from the graphite core. If you wear your pencil down to a stub before sharpening, you’re not losing this lead to the garbage, you’re using it on paper.
A ‘perfect’ pencil might be dull; optimizing for maximum usage might be the right way to use a pencil perfectly. Line width may be a secondary consideration.

Sometimes perfection is doing a job as quickly as possible. Sometimes it’s hitting the sweet spot of “done just well enough to not cause problems later”.

You have to be perfect along the right guidelines.

comments: 0 » tags: ,

The Book of Gnost

May 27, 2008 under curios, theology, tongueincheek

“See, if you don’t do it like this, you’re going straight to hell. It says it right here in Gnost 4:13!”

“Book of Gnost? There’s no Book of Gnost in the Bible!”

“Well, probably not in your Bible!”

comments: 0 » tags:

Community is hard

May 25, 2008 under Uncategorized

It’s quite possibly the hardest thing I’ve ever encountered.

Even when you’re right, you can be wrong. It’s confusing, it’s… humbling.

Simple things become complicated. Easy things are difficult; straightforward tasks require sacrifice.

comments: 0 »

Detroit vs. Pittsburg

May 25, 2008 under curios

Ok, it doesn’t mean much. They hold this thing every year and it has no real relevance.

That being said, this is going to be a heck of a series and I have to get my prediction in…

They’re rolling the starting lineups for Game 1 now, so I should be quick…

Detroit in 6.

You heard it here first.

comments: 0 » tags: , ,

A word I don’t hear often.

May 23, 2008 under theology

This story hits me in a funny way. It recounts the targeted death of an innocent man.

This is politics; there’s a certain grim cynicism which says, “This is expected; this is the world.”
Politically speaking, there’s nothing especially remarkable about the story. We’re used to it; it makes sense.
Zimbabwe is by no means the first (or the worst) case of political thuggery to mar our planet, although it is the one chosen for our headlines.

However, this is also wickedness; and as wickedness it is difficult to accept.
It’s intuitive that wickedness seeks out the righteous as a target, but it doesn’t stop there. The wicked don’t care about the innocent or the bystanders; they don’t even care about the wicked.
To be a target for evil, it only requires that you be in its path.

Wickedness isn’t a word I hear often; I can probably count the times I have heard someone accuse someone else of being wicked, “X is a wicked man.”
And yet, if it is such a great part of our world, why does it play such a small part in our thinking?

We’re not supposed to dwell on it; adopting a life that is reactive to evil rather than driven by God is a trap.
We have to call it what it is, however; we have to know where it comes from.

comments: 0 » tags: ,

I’m the best

May 22, 2008 under tongueincheek

Just a quick word to my devoted fans, letting them know that I’m the imperial victor and deserved champion of the World Blog Heritage Classic Challenge.

I’d have posted sooner, but I’ve had my hands full, being borne on the giddy crest of the majestic tide of revelry which followed my epic struggle and glorious triumph. Like a true champion, I rose to the occasion and took no prisoners in my steely determination to defy the odds.

I’ll put up a badge on my site as soon as I can photoshop one up.

comments: 0 » tags:

Biking and the big bad roads

May 21, 2008 under theology

I respect people who cycle along city streets. It’s a genuinely difficult activity.

The challenge of city cycling is not primarily a physical challenge. It’s a challenge of character. Cyclists must keep a fine balance between humility and dignity.

On the one hand, a cyclist has to be humble and willing to surrender his right of way should the need arise. It’s nice to be right, but it’s nicer to be alive.

On the other hand, a cyclist cannot surrender his right of way too cheaply. It’s at best gross irresponsibility if he undermines himself and all his fellows by failing to claim that which is his due. Training motorists to disrespect cyclists is a Bad Thing.

Complicating his dilemma are the facts that

  1. Some motorists are ignorant
  2. Some motorists don’t care (or can’t care)
  3. Some motorists are jerks
  4. It’s nearly impossible to distinguish which motorists are which

The same tension occurs most everywhere in life; it’s a general problem. How hard can you push to keep the jerks at bay while avoiding becoming one? For a cyclist, understanding the value of humility is not so difficult; it’s directly tied to his health. In other areas, the consequences of pushing too hard are not as apparent.

Things you can do; things you have the right to do; things you should do: not always the same.

comments: 1 » tags: ,

What’s in a game?

May 20, 2008 under curios, technical

Ever heard of the card game, ‘War’?

A deck of cards is evenly split between two players. The players compare the top cards from their respective piles. Comparison is performed by rank alone; suit is irrelevant. The player with the higher ranking card collects both cards and places them at the bottom of their pile. In the event that both cards have equal rank (a “War” situation), both players set aside three cards from their piles, and compare the new top card of their piles. The winner of this second comparison collects the other card, as well as all the cards laid aside, and the cards from the orignal comparison. Should the cards in the second comparison be equal, an additional three cards from each player’s pile are set aside, and another comparison is made, etc. etc.

In the event that a comparison causes one player’s pile to run out of cards, they lose the game.

According to some house rules, if a player has insufficient cards to lay aside for a “War” and its ensuing secondary comparison, they take the required cards from the other player’s pile.

It’s kind of a stupid game. Arguably it’s not a game at all. The winner and loser are determined entirely by the deal of the cards. No decision-making takes place; players cannot alter the outcome of the game in any fashion. Play amounts to a revelation of who was dealt the winning pile; nothing more. My (admittedly verbose) implementation comes in at a little under 100 lines of code and there’s one special case it doesn’t handle.

War has always fascinated me. Since players’ actions don’t affect the outcome, it’s not really a game as we understand games. But the social experience of it is very much a game; ask any kid and he’ll tell you.

Version 1

class WarGame
  attr_accessor :log_file 

  def initialize(deck_size = 52, suit_count = 4)
    @deck_size = deck_size
    @suit_count = suit_count
    @rank = @deck_size / @suit_count
    @deck = nil
    @p1_deck = nil
    @p2_deck = nil
    @compare_count = 0
    @log_file = File.new("logfile.txt","w")
  end 

  #expects an even deck size
  def shuffle_up_and_deal
    @deck = (1..@deck_size).to_a.sort_by {rand}
    @p1_deck = @deck[0,@deck_size/2]
    @p2_deck = @deck[@deck_size/2,@deck_size/2]
    @compare_count = 0
  end 

  def play_the_game
    game_over = false
    while(!game_over)
      #cards currently at stake are broken off into stacks
      #usually this is just the single card being matched
      #but this could conceivably be a large stack in the case of many 'wars'
      p1_stack = Array.new
      p2_stack = Array.new
      p1_stack << @p1_deck.slice!(0)
      p2_stack << @p2_deck.slice!(0)
      #start the (possibly) recursive comparison for this turn
      compare_stacks(p1_stack,p2_stack)
      @compare_count += 1
      if(@p1_deck.length == 0)
        puts "Player 2 wins"
        puts @compare_count
        game_over = true
      end
      if(@p2_deck.length == 0)
        puts "Player 1 wins"
        game_over = true
        puts @compare_count
      end
    end
  end 

  #not truly functional, depends on the (class) globals @p1_deck,@p2_deck
  def compare_stacks(p1_stack,p2_stack)
    @log_file.puts "Stack1 length: " + p1_stack.length.to_s
    @log_file.puts "Stack2 length: " + p2_stack.length.to_s
    p1_rank = p1_stack.last % @rank
    p2_rank = p2_stack.last % @rank
    if(p1_rank > p2_rank)
      @p1_deck.concat(p2_stack)
      @p1_deck.concat(p1_stack)
    elsif(p2_rank > p1_rank)
      @p2_deck.concat(p1_stack)
      @p2_deck.concat(p2_stack)
    else
      #WAR!
      @log_file.puts "WAR"
      if(@p1_deck.length < 4)
        @log_file.puts "P1 stealing from P2"
        to_steal = 4 - @p1_deck.length
        @p1_deck.concat(@p2_deck.slice!(0,to_steal))
      end
      if(@p2_deck.length < 4)
        @log_file.puts "P2 stealing from P1"
        to_steal = 4 - @p2_deck.length
        @p2_deck.concat(@p1_deck.slice!(0,to_steal))
      end
      p1_stack.concat(@p1_deck.slice!(0,4))
      p2_stack.concat(@p2_deck.slice!(0,4))
      compare_stacks(p1_stack,p2_stack)
    end
  end 

end 

wg = WarGame.new
wg.shuffle_up_and_deal
wg.play_the_game
wg.log_file.close

Version 2

result = rand(2)
puts "Player 1 wins" if(result == 0)
puts "Player 2 wins" if(result == 1)

To a computer, the only difference between the two is that the first one takes longer ;-)

comments: 0 » tags:

Soul Clearance

May 17, 2008 under Uncategorized

THIS WEEKEND ONLY!!!

The Music Shack is dramatically overstocked on 2007 troubles, pain and soul!

We need to make room for our  2008 Hardship and Lovin’, and so we’ve slashed our prices on all Soul, Gospel and Blues!

We’ve got so much misery, we can’t sell it all, so our prices are as rock bottom as our bleedin’ hearts!

EVERYTHING MUST GO, NOW!!!  HEEEEEYYY HEEEYY!

I love James Brown.

comments: 0 » tags:

A scary moment

May 16, 2008 under technical

…happened the other day in a meeting… scary for me, at least. I foolishly volunteered my USB stick for a file transfer.
The meeting was well staffed with important people, and it wasn’t until I handed over my stick that I realized the file transfer would involve opening a window and revealing its contents… to the entire room, on the projector screen.

Let’s just say my heart stopped dead and my mind started thrashing. What did I have on the drive? Did I remember? Please let it be respectable…

As it turned out, I had nothing sensitive on the drive – only the collection of technical reference material expected of an industrious and self motivated goal driven achiever.

What’s interesting is that I was scared. My data is… personal. Unfortunately, my USB stick is somewhat public.

comments: 0 » tags: ,