(2 replies, posted in Shoot the Breeze)

I hope I can get my project out by the end of the work for preliminary testing. The ESV API saved me weeks (I think) of work. I just finished loading up the Sunday Lectionary DB. Now I can go to any Sunday in the cycle and get the text. The actual cool bit of code - well, the bit I like - is where you enter any date and you get back the next Sunday's correct readings.


(2 replies, posted in Shoot the Breeze)

I have been working on a site that would display lectionary readings and allow users to post comments about the assigned readings (and some other stuff). I finally decided I wanted to use the ESV translation so I started looking into getting copyright permission. It turns out Crossways has a very slick API. I pass it the verses I want - e.g. "Mark 16:1-8" - and it passes back a headerless bit of html that I embed in my page. It even includes a button to listen to the text. Slick!

Truthfully, I don't know if other publishers have similar API's, but if you need to embed scripture in your web site, etc., take a look at www.esvapi.org

I have also been working hard at keeping content, presentation, and behavior separate. It makes my head hurt sometimes, but seems to be worth it in the end. What would I do without Rails and jQuery? Not this project, that's for sure!

Resolved. sigh.
Rails 2 has forgery protection built in and when I uncommented ...
  protect_from_forgery  :secret => 'xxxxxxxxxxxxxxxxxxxxxx'
in the application.rb, apparently every time the form submission hit, the form_authenticity_token got reset. I removed the above, protect_from_forgery? continues to show true, the  form_authenticity_token doesn't mysteriously change, and the whole thing works.

For those who were offering up prayers - I thank you - as do the remaining hairs on my head.

That's pretty much what I did (dropped in jRails) - and MOSTLY everything works fine. And I am pretty sure it's my inexperience somewhere that is causing the problem. What I have since discovered - and haven't been able to figure out why yet - is the form_authenticity_token is being changed somewhere/how on the server side. When I dig it out, I'll let the faithful know<G>.

I have come to the point in my coding life where I am adding Jquery to my RoR code. After a few days of feeling like I wanted to sell my laptop I finally started to get the hang of it. Now I am trying to use the Jquery form plug in to submit comments. At first, it would throw an InvalidAuthenticityToken error. I found out how fix that, but then, it only worked the first time. More clearly...
* reload page
* submit comment (success)
* submit comment (InvalidAuthenticityToken error)

Anybody run across this or have a suggestion?
Thanks for your help


(1 replies, posted in Shoot the Breeze)

I have had several stoopid days in a row. Sigh. Which has caused me to reflect...

Rule #1 in software development: Spelling counts. I hate that. No body checks my spelling when I preach, but the rackafratzinpackalubber interpreter (RoR) checks every time I load a page.

Rule #1 in Christianity: Worship right. When you "worship right" mission and evangelism flow correctly out of worship. I'm not saying there is a single correct "form" of worship (disclaimer: my own preference is Anglican), but that what ever form it should be pleasing to God, Trinitarian, and recognizing the glory of God revealed in the coming of His Son and the redemption of His creation.

Rule #1 in life: God is good, even if annoying. That's not to say God is inherently annoying, just that because of my own fallenness I find myself being annoyed and need a constant reminded the He is good. (BTW: Rule #2 in life is: You can't have fun if you have to pee. I wish rule #2 were more profound, but it isn't. It's just true.)


(2 replies, posted in Theology Discussion)

I know Thanksgiving (USA) is a bit behind us, even so, I had one of those BGO's while preparing a Thanksgiving sermon. The text was the Lilies of Field passage from Matthew which ends up (more or less) with Jesus saying, "Seek ye first the Kingdom of God and all these things will be added unto you." The traditional Thanksgiving sermon goes ...

   Consider the lilies of the field and how much more you have.
   God has provided it all to you, therefore be thankful.

No doubt you have heard that sermon, and I have probably given it<G>. So, I am studying the text and I see for the first time, that's not what the text is saying! What the text is saying is ...

   The top priority is seeking the Kingdom of God and if you do that, well, God knows what you need and will supply it.

Flipped around the other way and in the context of the Thanksgiving holiday what is said is ...

   Give thanks that God gives us all the stuff we have SO THAT
   we can pursue the Kingdom of God ahead of anything else and without worry.

Our Lord creates the environment enabling us to pursue His Kingdom ahead of all else. Doh! Almost 57 and still haven't learned it. Well, here's to reckless and imprudent pursuit of the Kingdom of God.
Grace and peace


(4 replies, posted in Shoot the Breeze)

Upgraded my 12" G4 powerbook the other day to a 15" macbook pro. LOve it! I was surprised by how much I like the multi-finger gestures. When I first read about this feature I said to myself, "Gimmick!" But now having used it for a couple of hours, I might even give up using a mouse. The ability to scroll up and down/left and right w/o taking my hand from the track pad... well, I'm stoked! The all trackpad button is stiffer than the button on the 12" and my thumb automatically reaches for the button that's not there. Oh, and I love this... a two fingered "click" = ctrl-click. Oooooo.

The keyboard spacing is wider than on the 12" (duh) and took a little getting used to, but I have huge hands and after a few minutes, I was back to full touch typing and with a little more comfort - to my surprise. Backlit keys? You bet! Mmmm (even though I touch type).

Apple offered to xfer all the data for me for free if I would just leave both systems with them for 2 days (!?!). I don't think so! Then they suggested I buy a $40 firewire800 cable to do the migration - ACK! They eventually fessed up that an ether net cable would do the trick (getting it home I discovered wifi would work too), but would take 6 to 8 hours. I went with the $0 option figuring, hey, I sleep sometimes. It did take just about 6 hours for about 70Gb of data and software. Every thing I have tried worked straight away (including ruby, rails, erlang, textmate), only neooffice didn't (which has 2 different distributions).

So, I am a happy boy!

grace and peace


(46 replies, posted in Shoot the Breeze)



(3 replies, posted in Ruby on Rails)

I JUST learned that as of Ruby 1.9 hash order will be preserved. Prior to 1.9, no guarantees.


(4 replies, posted in Theology Discussion)

Is it the curse of evangelicals to always crave confirmation? Shouldn't Jesus' promise be adequate? I have, for a long time, considered "casting a fleece before the Lord" as symptomatic of a certain lack faith (that's how I read the text).

Anyway, I ask this in the context of considering planting a church.

Any thoughts? Prayers?

God give you joy!

First: Here's why there is no perfect software - as soon as we build a fool proof system, nature will evolve a more perfect fool. I know, I know, this opens me to all sorts of comments about Creation vs. evolution, but you know this bit of evolution is true. You've tried to build fool proof systems always to be confronted by a more perfect fool<GGG>.

Second: (a little more serious) I think knowing all things and being made perfect with regard to the resurrection (going to heaven) - must be understood in some limited sort of way. If we knew all things and were perfect, we would then be God. Or part of God. And I think there must be some sort of differentiation. Sure, Paul talks about being made perfect, but I think he refers to no longer having to deal with our dual nature - not that we become perfect in the abstract sense. I tend to think along the lines of now seeing through a glass darkly - and in our ultimate future seeing clearly.

God give you joy


(3 replies, posted in Ruby on Rails)

AMEN!!! to getting the stuff out of the DB in the right order! Even so, since the original post I have learned that couchDB does not guarantee order of fields or elements in hashes. And I had a duh-BGO - the ROR interface to couchDB I am using is not ActiveRecord thus most of the callbacks are not predefined - so, of course, my sort didn't fire when I expected it to (duh**2).

Having said all that, I like fooling around with couchDB. I like the way it handles text. But it's probably not quite ready for prime time - at least at my skill level.

grace and peace


(3 replies, posted in Ruby on Rails)

I think I am missing something fundamental here. I am fooling around with couchDB and I ask it for a chapter of Scripture - e.g. Acts_1. Examining the raw record, the verses are stored as a hash (.e.g. {"1" => "In my former book, ...", etc.}) and the key is a string (and there are reasons for that, don't ask<G>). Anyway, when I get the record the hash (scripture.verses) appears in random order. OK, maybe it really is in random order and the couchDB utility program sorts the hash, but I doubt it, so lets say the verses are in correct order in the DB.

First question: Why does the hash appear in random order in the RoR code? Where is it getting randomized?

I suppose I should'ought'a not presume an order when I pull a record from the DB - who knows who has been doing what in there - right? So when I display the verses I do this (using haml) ...
    - @scripture.verses.sort_by {|k,v| k.to_i}.each do |key,verse|
      %span{:style => "vertical-align: super; font-size: small;"} # I'll get around to putting it in the style sheet
        = key
      = verse
And it works just fine. But shouldn't I be doing the sort in the model? I redefined "find" in the model so it calls it's super class to get the record, then I sort and pass the record on thusly...
  def find( current_db, id)
    scripture = Scripture.super.find( current_db, id)
    scripture.verses = scripture.verses.sort_by {|k,v| k.to_i}
Which doesn't fail, but when I get to the view - the cockamamie hash is back in random order! Arrrrggggg!

Second question: What am I missing here?

thanks for your help
grace and peace

Putting my pastor's hat on vis a vis money & meetings...
Rules of Thumb...
1) All meetings are open to all (with the exception of the rare "executive session" where people are discussed, e.g. hiring, firing, nominations to church board, etc.)
2) All information about individuals or families is confidential
1) There are two people who get to know what individuals/families give: the financial secretary (who may or may not be the treasurer) & the head pastor. If not, something's wrong.
2) If the budget, financial committee meetings, and funding decisions are not open to all, something is wrong. The only possible exception to this might be the giving of money to individuals/families. This should be done by the head pastor (or designated minister) from a particular find that is open to audit - not wo got the money, but what the money was intended for.

There are always exceptions, but if you find more exceptions than not, well, something is wrong.

grace and peace


(0 replies, posted in Shoot the Breeze)

I'm not sure this question belongs but...
I have been fooling around with the RSS feeds on my sites and wondered what the wisdom of putting html into the description field.
Any thoughts?

grace and peace

Hey James!
We spent our first night in Minehead at Montrose Guest House on Tregonwell Road. We walked about town after we got off the train - wonderful train station! - and had supper at the Queens Arms (I think). And you're right - it is God's own country! Beautiful!. In spite of getting rained on a bit(!!) we had the time of our lives. Walking down the cobble stones into Clovelly in a downpour was exciting<g>. We hope we can pick it up again next summer at Clovelly, but I have to make a trip to Tanzania in July that might put the kibosh on a walking holiday next year.

Hi James!
I have seen that sort of msg from other web sites too. The email client in question is MS Outlook. Maybe there isn't another way. Sigh.
BTW - where in Somerset do you live? My wife and I walked the SWCP from Minehead to Clovelly last summer. Wonderful time! We got all excited about moving to Porlock when we saw the vicar was retiring<G>.

I finally got my personal project web site going (www.extremeseminary.com) and, of course, ran into some birthing pains. To add content to the site you have to register, when you do, you get a confirmation email with a link that when clicked should'ought'a take you back to the site and close the confirmation loop. Sigh. Some email programs do not allow the user to click on a link, opening a browser window, taking the user to the site in the link.

The only thing I could think to do was add something like, "If clicking on the above link doesn't work, paste the link into your browser." to the confirmation email. It seems like there should'ought'a be a better way.

Any thoughts?
grace and peace


(0 replies, posted in Shoot the Breeze)

I wondered if anyone has been using couchDB? How has it been going? What did you use it for? etc. I am thinking of using it for a collaborative documentation project.

Yet Another Blazing Glimpse of the Obvious (in case your were wondering).

I’m standing in the shower the other morning, kavetching to myself about church work – and just why is it anyway that one person, ONE PERSON, can put me so out of sorts about it – and I say to myself, “This would be so much easier if I were a perfect pastor.

One of my favorite Jewish writers - Rabbi Joseph Telushkin (Jewish Wisdom & Jewish Literacy among others) - said this about Jesus: There were two things about Jesus that his contemporaries had against him. First, he claimed to be God (so even Telushkin recognizes that the NT and early (1st cen) church literature bear witness that Jesus made the claim for himself). Secondly (and this one blew me away) Jesus was way too conservative. Telushkin goes on to explain that the essence of Judiasm is to LIVE an ethical life. Jesus' demand was that one BE ethical through and through. Which, of course, is impossible - see the camel through the eye of a needle story. The question then is, how does anyone get to heaven? And Jesus response was, for man this is impossible, but for God anything is possible (or words to that effect). I guess the point here is, you can read what ever writer/thinker you want and presume that that writer has a better insight into who Jesus said he is than Jesus' contemporaries and you can believe what ever you like about the developmental process of the NT documents (which, by the way are, with out a doubt, the most reliable of ALL ancient documents of any kind), but it comes down to this, do you work your way into God's Kingdom or do you give up and allow God to bring you in (usually kicking and screaming, in my experience)?

As a pastor and head web-wacko for a couple of missionary groups, here goes with my thoughts (sorry I am late to the discussion)
+ first off, every pastor I know is a control freak - self included. And they fall into two types a) those who know it and are ready to acknowledge and confess it and b) those who have such a need to be in control they won't let anyone know they are control freaks. Uh... that's supposed to be semi-humorous, but it's still true.
+ in my former life, I was a genuine, made a living from it, hacker - back in the days when hardware was expensive and programmers weren't. I even coded in Forth (among others)! Any way, every coder I ever met was/is a control freak too! And I think for pretty good reasons - after all, the work of coding is the work of putting down our thought processes for all the world to see. When people don't like what we do or think there is a different way to do it, it can be (and often is) seen as an assault on our thought processes.
+ Pastor meets coder equals the perfect storm<G>. In a perfect world, we learn from those who know more than we do and except for real good reasons, defer to the more knowledgeable. Ever meet a perfect pastor? Perfect coder?
+ so when working with the missionaries, I do what I think is best. Sooner or later they say, "I want it this other (truly ugly) way." And I say, "Well, we could do it that way, but it would be a bad idea for these reasons..." It's the same thing with weddings. A couple says, "We want to do thus and so in the ceremony." Frequently, I say something like, "Here's why that's a bad idea...". In the end, what I say to all couples - and to the missionaries for that matter - is, "I will do anything you want short of a goat sacrifice, but I always get to tell you what I think and why." So, sometimes I do things in weddings I would rather not, but it's not heretical.
+ In the end with the missionaries I had to do something similar. They wanted to use an image I thought was going to be flat out offensive to some people. We had quite a discussion about. I wound up saying, "Look, if you are absolutely set on using that image, you are going to have to find someone else to work on your site, because I won't put that image on a site I work on. Before we part ways though, please run your idea past some other people you trust, perhaps your board, and see what they think." In the end they came back to me and said, "You were right."
+ now, as a pastor, I always reserve the right to veto anything (!!!) that goes out in the name of the church. And that's 'cause the buck stops on my desk. And sometimes (many times?) I am wrong. But there are a bunch of people around willing to tell exactly how I blew it. Ah, well. Even so, I still have to make the final call.
+ and having said that, my long suffering wife delights to remind me, "Be careful how you treat the volunteers."

So, there you go...
God give you joy!


(3 replies, posted in Ruby on Rails)

That's it!
With the bonus of never having to know the name of the view.
Thank you!
One more step up the learning curve.


(3 replies, posted in Ruby on Rails)

OK. I am pretty new to ROR (few months) and I am working on a site for a mission group. In creating a user account, I want to use the same partial to create and edit the account information. But in editing, I don't want to display the captcha part of the form. So, I am saying...
<% if !current_page?(:action => 'edit') %>
<%= show_simple_captcha %>
(leaving some details out for clarity)
I don't know, it seems kind of kludgy to me. When I get it right in ROR I get an "Yeah, that's it!" feeling and this isn't it.
Any thoughts?

grace and peace