<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>The Barrettocracy</title>
    <link>http://blog.websitesbybarrett.com</link>
    <language>en</language>
    <webMaster>Barrett@WebsitesByBarrett.com (Barrett)</webMaster>
    <copyright>Copyright 2008</copyright>
    <ttl>60</ttl>
    <pubDate>Wed, 23 Jul 2008 07:13:57 GMT</pubDate>
    <description>Barrett's Writings and Stuffs</description>
    <item>
      <title>Jay Leno?!?</title>
      <link>http://blog.websitesbybarrett.com/past/2008/7/23/jay_leno/</link>
      <pubDate>Wed, 23 Jul 2008 07:08:00 GMT</pubDate>
      <guid>http://blog.websitesbybarrett.com/past/2008/7/23/jay_leno/</guid>
      <description>&lt;p&gt;I live under a rock.  I was just listening to a NYT Front Page podcast that told me that Jay Leno's last day is X and he went to an NBC press conference wearing a disguise to harass the executives at NBC.&lt;/p&gt;

&lt;p&gt;Wha???&lt;/p&gt;

&lt;p&gt;Conan O'Brien will take over the Tonight Show.&lt;/p&gt;

&lt;p&gt;I don't really know what's going on with Leno, but I am guessing that he's strong-arming NBC.  I don't really care, though, because I find him very unfunny.  Conan, on the other hand, is very not unfunny.&lt;/p&gt;

&lt;p&gt;And now I will return to my rock.&lt;/p&gt;</description>
      <category domain="http://blog.websitesbybarrett.com/past/tags/NonTech">NonTech</category>
    </item>
    <item>
      <title>Concert Fun</title>
      <link>http://blog.websitesbybarrett.com/past/2008/7/21/concert_fun/</link>
      <pubDate>Mon, 21 Jul 2008 03:03:00 GMT</pubDate>
      <guid>http://blog.websitesbybarrett.com/past/2008/7/21/concert_fun/</guid>
      <description>&lt;p&gt;We had a really good time seeing an old friend play at a local outdoor arena last Friday night.&lt;/p&gt;

&lt;p&gt;I am cross-posting with my &lt;a href="http://web.mac.com/barrett.allison/OurFamily/Blog/Entries/2008/7/19_Martina_McBride_%26_Jack_Ingram_concert.html"&gt;family blog&lt;/a&gt; for this entry.  Go check it out!&lt;/p&gt;</description>
      <category domain="http://blog.websitesbybarrett.com/past/tags/NonTech">NonTech</category>
    </item>
    <item>
      <title>iPhone Backorder Status</title>
      <link>http://blog.websitesbybarrett.com/past/2008/7/18/iphone_backorder_status/</link>
      <pubDate>Fri, 18 Jul 2008 04:08:00 GMT</pubDate>
      <guid>http://blog.websitesbybarrett.com/past/2008/7/18/iphone_backorder_status/</guid>
      <description>&lt;p&gt;Lots of people ordered iPhones at AT&amp;amp;T locations under the Direct Fulfillment method, and we are getting anxious.  They are shipping out, but in more of a trickle than a flood.  I found a forum of other people who are just as neurotic about it as I am, which makes me feel a little better.  This time last week was the Day Of The iPhone Launch, and I was like a kid on Christmas morning.  I could Not Sit Still.&lt;/p&gt;

&lt;p&gt;So now we wait.&lt;/p&gt;

&lt;p&gt;Someone on the forum whipped up a screen scraping script that would tell you how the orders for the store you placed your order is fairing.  We brought his server down.  He came up with another version of the page, which is &lt;a href="http://www.iphoneconvert.com/queue.php"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I also decided to whip up a quick and dirty ruby script that does the same thing.  I called it att.rb on my compy.&lt;/p&gt;

&lt;p&gt;UPDATE: fixed some formatting with the code vs blog markup and added the queue. UPDATE 2: redid code to be a little more ruby and a lot less perl.
UPDATE 3: Added better reporting on cancel status.&lt;/p&gt;&lt;pre name="code" class="ruby"&gt;
#!/usr/local/bin/ruby
require 'rubygems'
require 'open-uri'
require 'openssl'
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE

ORDER_NUMBER_LOWER_LIMIT = 15183
ORDER_NUMBER_UPPER_LIMIT = 15270
ZIPCODE = 12345
queue = 0

class OrderStatus
  attr_accessor :response

  def initialize(response)
    self.response = response
  end

  def nil?
    err = self.response.scan("We're sorry, but the information you entered was not").to_s
    err.empty? == true ? false : true
  end

  def canceled?
    cancel = self.response.scan("Canceled")[0].to_s
    cancel.empty? == true ? false : true
  end

  def name
    name = self.response.scan(/Customer:\s*\w*/).to_s
    name.gsub!(/Customer:\s*/, "")
  end

  def order
    order = self.response.scan(/Order Number:\s*\w*/).to_s
    order.gsub!(/Order Number:\s*/, "")
  end

  def date
    date = self.response.scan(/Date Ordered:.*/).to_s
    date.gsub!(/Date Ordered:\s*/, "")
    date.gsub!(/\s/, "")
  end

  def ship_date
    ship_date = self.response.scan(/\&amp;lt;td width="6%".*/)[5]
    ship_date.remove_p_tag
  end

  def shipped
    shipped = self.response.scan(/\&amp;lt;td width="5%".*/)[3].scan(/[01]/).to_s.to_i
  end

  def ship_info
    ship_info = self.response.scan(/\&amp;lt;td width="6%".*/)[7]
    ship_info.remove_p_tag
  end

  def display(q)
    "#{name.slice(0..20).ljust(20)} | #{order} | #{date} | #{shipped} | #{q.rjust(2)} | #{ship_date} #{ship_info}"    
  end
end

class String
  # add this to the String class to help clean up some cruft
  def remove_p_tag
    self.gsub!(/^.*\&amp;lt;p\&amp;gt;/, "")
    self.gsub!(/\&amp;lt;\/p\&amp;gt;.*$/, "")
  end
end

puts "Name                 | Order | Order Dt |Yn | Qu | Ship Info     "
for order_number in ORDER_NUMBER_LOWER_LIMIT..ORDER_NUMBER_UPPER_LIMIT
  @url = "https://www.wireless.att.com/order_status/order_status_results.jsp?fromwhere=order_status&amp;vMethod=ordernum&amp;vNumber=#{order_number}&amp;ZipCode=#{ZIPCODE}&amp;x=48&amp;y=6"

  # open-uri RDoc: http://stdlib.rubyonrails.org/libdoc/open-uri/rdoc/index.html
  open( @url,
        "User-Agent" =&gt; "Ruby/#{RUBY_VERSION}",
        "From" =&gt; "email@addr.com",
        "Referer" =&gt; "https://www.wireless.att.com/order_status") { |f|
      # Save the response body
      stat = OrderStatus.new(f.read)
      if stat.canceled?
        puts "#{order_number} canceled"
      elsif !stat.nil?
        # calculate the queue
        queue += 1 if stat.shipped == 0
        display_queue = stat.shipped == 0 ? queue.to_s : ""

        # display the info
        puts stat.display(display_queue)
      else
        puts "#{order_number} not found"
      end
  }
end
&lt;/pre&gt;

&lt;p&gt;It could be a lot prettier, but it works.  It will also hopefully take some of the load off the webserver since you can just run this on your local mac.  You've got ruby on it already, although it may not be in /usr/local/bin.  If it doesn't run, you can take out that shebang line and just run the script like this:&lt;/p&gt;

&lt;p&gt;ruby att.rb&lt;/p&gt;

&lt;p&gt;There you have it.  Good luck to all of us.&lt;/p&gt;</description>
      <category domain="http://blog.websitesbybarrett.com/past/tags/Ruby">Ruby</category>
      <category domain="http://blog.websitesbybarrett.com/past/tags/TechStuff">TechStuff</category>
    </item>
    <item>
      <title>iPhone, Come To Me</title>
      <link>http://blog.websitesbybarrett.com/past/2008/7/14/iphone_come_to_me/</link>
      <pubDate>Mon, 14 Jul 2008 15:15:00 GMT</pubDate>
      <guid>http://blog.websitesbybarrett.com/past/2008/7/14/iphone_come_to_me/</guid>
      <description>&lt;p&gt;I was like a kid on Christmas morning this past Friday.  I took off early and my wife and I met up with another couple for a date.  At the Apple store.  The line in the afternoon was at least 2 hours in the hot sun, though.  Bummer.  I was thinking the line would have died down by then.  Lines the next day were still multi-hour waits, though.&lt;/p&gt;

&lt;p&gt;Dang!&lt;/p&gt;

&lt;p&gt;So we went to the AT&amp;amp;T store Friday night to place our orders.  They are on backorder as I type this.  Apple wasn't expecting the sales they had this weekend.&lt;/p&gt;

&lt;p&gt;My friends went back to the Apple store Friday night and were able to get their phones already.  Yes, I am jealous.&lt;/p&gt;

&lt;p&gt;I want my iPhone!!!&lt;/p&gt;</description>
      <category domain="http://blog.websitesbybarrett.com/past/tags/NonTech">NonTech</category>
    </item>
    <item>
      <title>Marshal Ruby Objects With YAML</title>
      <link>http://blog.websitesbybarrett.com/past/2008/7/10/marshaling_ruby_objects_with_yaml/</link>
      <pubDate>Thu, 10 Jul 2008 05:00:00 GMT</pubDate>
      <guid>http://blog.websitesbybarrett.com/past/2008/7/10/marshaling_ruby_objects_with_yaml/</guid>
      <description>&lt;p&gt;I found a lot of documentation that told me how to put an object into a YAML file.  In my particular case I am reading through a file that needs to create or update a lot of things.  I show the user what's about to happen and give them 1 last chance to back out.&lt;/p&gt;

&lt;p&gt;I store each set of changes/additions in an object, and it works great.  You have something that is nice and legible, too.&lt;/p&gt;

&lt;p&gt;The problem is that retrieving the info from the YAML file was proving difficult for me.&lt;/p&gt;

&lt;p&gt;I did what &lt;a href="http://yaml4r.sourceforge.net/doc/page/loading_yaml_documents.htm"&gt;this documentation&lt;/a&gt; told me to do, and I got an error.  After much googling and cursing, I found &lt;a href="http://www.buzzwordcompliant.net/index.php/2007/11/17/ruby-yaml-vs-xml/"&gt;this post&lt;/a&gt; that said they also had trouble and gave up because XML is easier.&lt;/p&gt;

&lt;p&gt;F that.&lt;/p&gt;

&lt;p&gt;So I got it to work, and here's what I did...&lt;/p&gt;&lt;p&gt;I started simple:&lt;/p&gt;

&lt;pre name="code" class="ruby"&gt;
#!/usr/local/bin/ruby
require 'yaml'
class Bling
  attr_accessor :aaa, :bbb
  def initialize(a, b)
    self.aaa = a
    self.bbb = b
  end
end

fling = Bling.new("a", "b")
floo = Bling.new(1, 2)

# write (marshal) the object(s) to a file
File.open("object.yml", "w") do |f|
  f.puts fling.to_yaml
  f.puts floo.to_yaml
end

# read the object(s) back
File.open( 'object.yml' ) do |yf|
  YAML.load_documents( yf ) do |ydoc|
    ## ydoc contains the single object from the YAML document
    puts "#{ydoc.aaa} #{ydoc.bbb}"
  end
end
&lt;/pre&gt;

&lt;p&gt;Bam!&lt;/p&gt;

&lt;p&gt;Turns out the key for me was making the attributes accessible (attr_accessor).  When you read the object back from the file it recreates them (Object.new anyone)?&lt;/p&gt;

&lt;p&gt;I was struggling because I could see the attributes when I inspected the object as I read through the file.  I could also get to them when I did Object.ivars['attribute'], but this didn't work on the production host.  It worked great on my box, which made me crazy.&lt;/p&gt;

&lt;p&gt;The other gotcha for me was that I needed to require the class file in the method that was recreating the objects.&lt;/p&gt;

&lt;p&gt;Now my app is happy.&lt;/p&gt;</description>
      <category domain="http://blog.websitesbybarrett.com/past/tags/Rails">Rails</category>
      <category domain="http://blog.websitesbybarrett.com/past/tags/TechStuff">TechStuff</category>
    </item>
    <item>
      <title>Conferences</title>
      <link>http://blog.websitesbybarrett.com/past/2008/7/9/conferences/</link>
      <pubDate>Wed, 09 Jul 2008 06:13:00 GMT</pubDate>
      <guid>http://blog.websitesbybarrett.com/past/2008/7/9/conferences/</guid>
      <description>&lt;p&gt;I work for a market research company that is also a part of AOL (which is also a part of Time Warner).  Our stock price is not awesome right now, either.&lt;/p&gt;

&lt;p&gt;So I went to an industry "technology" conference in NYC a week or two ago.  It was really just an excuse for the industry organization to bilk some cash out of our companies.  The content was really light, and I was disappointed to see that the ratio of legit "tech" people to "brass" people was terribly skewed in the executives' favor.&lt;/p&gt;

&lt;p&gt;That conference either needs to be redone to actually cover technology, or it needs to go away and be rolled back into the main organization conference.  That's just my opinion.&lt;/p&gt;

&lt;p&gt;To balance the scales I am now going to the Lone Star Ruby Conference in Austin.  It's wicked cheap, and filled to the brim with content.  The creator of ruby is also speaking.  How freaking cool is that?!?&lt;/p&gt;

&lt;p&gt;I'm totally pumped.&lt;/p&gt;</description>
      <category domain="http://blog.websitesbybarrett.com/past/tags/Rails">Rails</category>
      <category domain="http://blog.websitesbybarrett.com/past/tags/TechStuff">TechStuff</category>
    </item>
    <item>
      <title>Cover Songs!</title>
      <link>http://blog.websitesbybarrett.com/past/2008/6/30/cover_songs/</link>
      <pubDate>Mon, 30 Jun 2008 18:31:00 GMT</pubDate>
      <guid>http://blog.websitesbybarrett.com/past/2008/6/30/cover_songs/</guid>
      <description>&lt;p&gt;So there is this other blog that I frequent a lot (redundant much?).  One of the topics that comes up sometimes is the "Great Debate" - top 3 songs from a given artist.  Discuss amongst yourselves sort of thing.&lt;/p&gt;

&lt;p&gt;Pair that with the old High Fidelity (the movie, which is awesome) mixtape motif, and you have this blog entry.&lt;/p&gt;

&lt;p&gt;Top 3 cover songs that were better than the original.  Go.&lt;/p&gt;&lt;p&gt;My top 3 are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Voodoo Chile (originally done by Jimi Hendrix, redone by Stevie Ray Vaughan)&lt;/li&gt;
&lt;li&gt;&lt;a href="http://youtube.com/watch?v=o7WtavVdBCk"&gt;In Your Eyes&lt;/a&gt; (originally done by Peter Gabriel, redone by Jeffrey Gaines)&lt;/li&gt;
&lt;li&gt;Turn the Page (originally done by Bob Seger, redone by Metallica)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Honorable mention goes to &lt;a href="http://youtube.com/watch?v=FY6ziVcfRvM"&gt;Praying For Time&lt;/a&gt; (originally done by George Michael, sung by Carrie Underwood at the American Idol charity convert).  To my knowledge this has not been released on an album.  It's really good, though.&lt;/p&gt;</description>
      <category domain="http://blog.websitesbybarrett.com/past/tags/NonTech">NonTech</category>
    </item>
    <item>
      <title>Popover Falls Flat</title>
      <link>http://blog.websitesbybarrett.com/past/2008/6/22/popover_falls_flat/</link>
      <pubDate>Sun, 22 Jun 2008 08:21:00 GMT</pubDate>
      <guid>http://blog.websitesbybarrett.com/past/2008/6/22/popover_falls_flat/</guid>
      <description>&lt;p&gt;Alton Brown did a Good Eats recently on Popovers.  He claimed it to be the most versatile or useful recipe ever.  Or something like that.&lt;/p&gt;

&lt;p&gt;So I whipped out my "Baking with Julia Child" cookbook this morning and made some.  The recipe is really easy - flour, milk, eggs, butter, salt.  You mix it up in a blender.  You can bake them in muffin tins.&lt;/p&gt;

&lt;p&gt;You'll note the absence of sugar.  They are like a roll with giant air bubbles purposefully baked into them.  You can add butter, honey, molasses, or whatever you want in the middle.&lt;/p&gt;

&lt;p&gt;In the end our verdict was "what's so great about these?"  Bland savory dough with very little substance.  Meh.&lt;/p&gt;</description>
      <category domain="http://blog.websitesbybarrett.com/past/tags/Food">Food</category>
      <category domain="http://blog.websitesbybarrett.com/past/tags/NonTech">NonTech</category>
    </item>
    <item>
      <title>Sweet Cooking Site</title>
      <link>http://blog.websitesbybarrett.com/past/2008/6/19/sweet_cooking_site/</link>
      <pubDate>Thu, 19 Jun 2008 07:33:00 GMT</pubDate>
      <guid>http://blog.websitesbybarrett.com/past/2008/6/19/sweet_cooking_site/</guid>
      <description>&lt;p&gt;I like to cook.  Mostly I like to bake, but time in the kitchen where you can create something that is good is always rewarding.  I just spent my lunch hour going through a handful of blogs that I like to read.  One is the 37Signals &lt;a href="http://37signals.com/svn/"&gt;"Signal vs. Noise" blog&lt;/a&gt;.  They had a link to a cool cooking site: &lt;a href="http://www.cookingforengineers.com/"&gt;http://www.cookingforengineers.com/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Their recipes aren't lists and paragraphs.  It's a chart of sorts.  You'll have to go check it out and see what I'm talking about.&lt;/p&gt;</description>
      <category domain="http://blog.websitesbybarrett.com/past/tags/Food">Food</category>
      <category domain="http://blog.websitesbybarrett.com/past/tags/NonTech">NonTech</category>
      <category domain="http://blog.websitesbybarrett.com/past/tags/TechStuff">TechStuff</category>
    </item>
    <item>
      <title>Religious Wanderings Yield Religious Wonderings</title>
      <link>http://blog.websitesbybarrett.com/past/2008/6/8/religious_wanderings_yield_religious_wonderings/</link>
      <pubDate>Sun, 08 Jun 2008 17:27:00 GMT</pubDate>
      <guid>http://blog.websitesbybarrett.com/past/2008/6/8/religious_wanderings_yield_religious_wonderings/</guid>
      <description>&lt;p&gt;A (new) friend is returning from a tour of the Holy Land.  She has been posting regular updates to her &lt;a href="http://www.ihategreenbeans.com"&gt;blog&lt;/a&gt; about the adventure.&lt;/p&gt;

&lt;p&gt;Her posts got me thinking back on some of the thoughts I've had over the years.  There are a couple of people and a couple of books that have really affected me.&lt;/p&gt;

&lt;h2&gt;First, the books&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.amazon.com/Three-Cups-Tea-Mission-Promote/dp/0143038257/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1212669781&amp;amp;sr=1-1"&gt;Three Cups of Tea&lt;/a&gt; - The true story of a Western mountain climber who decides to build a school for a remote village in Pakistan.  He ends up creating a foundation to build schools for remote villages.  Muslim villages.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.amazon.com/Early-Christian-Writings-Apostolic-Classics/dp/0140444750"&gt;Early Christian Writings&lt;/a&gt; - We did a book study at my church a few years ago, and this was the book.  It goes through some of the major writings of the first century Christians.  These were the people who actually knew the apostles.  Deep dive stuff, but interesting to see where our modern traditions come from.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.amazon.com/Bible-True-Debates-Discoveries-Scriptures/dp/006067542X/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1212982477&amp;amp;sr=1-1"&gt;Is The Bible True&lt;/a&gt; - This was written by an editor at Newsweek.  It challenges some of the conventions you've thought were true but probably aren't.  It has a happy ending, though.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.amazon.com/Return-Prodigal-Son-Story-Homecoming/dp/0385473079/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1212982562&amp;amp;sr=1-1"&gt;The Return of the Prodigal Son&lt;/a&gt; - Like Whoa.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Now The People&lt;/h2&gt;

&lt;p&gt;A little disclosure: I grew up Methodist.  You don't get much more laid back than that.  This was before the Methodist church got all modern with the Contemporary Services.  I married my wife in the Episcopal church she grew up in.  I decided to become an Episcopalian, and it was one of the best decisions I made.  I was a little concerned about the pomp and circumstance of all the ritual, but our church doesn't get really hung up on those details.  You can do it or not - whatever.  The rector (head priest) at our church at the time was a wonderful man, and he touched our lives immensely.  He retired a few years ago, and I still miss him dearly.&lt;/p&gt;

&lt;p&gt;We also had a husband-wife combination in the church who would give classes regularly.  He is an Old Testament scholar at a local Methodist university, and she is now an ordained priest.  They gave great classes, and taught us all kinds of great stuff.&lt;/p&gt;

&lt;p&gt;This is the thing with us Episcopalians - we like to look at the historical context to figure out what's going on in a given passage.  They were always really good about drawing from related scriptures as well as historical knowledge of the time.&lt;/p&gt;

&lt;h2&gt;Some Thoughts&lt;/h2&gt;

&lt;p&gt;So with that backdrop, I have a few thoughts to challenge you.&lt;/p&gt;

&lt;p&gt;The Three Cups Of Tea book was a good launching point for this conversation because there is a lot that happens with the machine of Islam.  There are lots of things done in the name of Islam that don't have anything to do with Islam at all.  The same holds true for Christianity.  We get wrapped up in the trappings and ritual of Christianity and lose site of the meaning of Christianity itself.&lt;/p&gt;

&lt;p&gt;Let's take music as an example.  The Disciples of Christ do not have instrumental music in their services because there is no mention of it in the New Testament.  You have the great cathedrals with the magnificent organs on the other end of the spectrum.  You also have the Contemporary services with their obligatory bands let by the 20-something Music Minister.&lt;/p&gt;

&lt;p&gt;Alcohol.  Fundamentalists are typically completely against the stuff.  We take communion every week with real wine.  We have a kid's service at our church, and when we celebrate The Eucharist (communion) even the kids take the blood.  They usually dip the cracker into the wine, but it's still real wine.&lt;/p&gt;

&lt;p&gt;Women.  Some of the more conservative factions don't believe women should be ordained.  Some of the most influential people in my life have been female priests.&lt;/p&gt;

&lt;p&gt;So I say be careful to get lost in the trappings and rituals of Christianity and lose sight of the meaning.  Asking questions is healthy.  Explore your faith and challenge it.  Are you doing what you do because it means something to you or because it looks good to the people around you?&lt;/p&gt;

&lt;p&gt;The priest whom I miss dearly always pushed us to challenge ourselves.  If you weren't a little bit uncomfortable then you weren't trying hard enough.  He would remind us that this is hard stuff, and you have to work at it.&lt;/p&gt;

&lt;p&gt;I also want to apologize for running roughshod over the core premises of the Episcopal church, and in fact the greater church in general.&lt;/p&gt;</description>
      <category domain="http://blog.websitesbybarrett.com/past/tags/NonTech">NonTech</category>
    </item>
  </channel>
</rss>
