Category Archives: Soft Where It Hurts

[BlogEntry] My first chat with God

Me:
Wow, are you really Him?

God:
I'm glad you're impressed. I don't know whether or not I am Him.
I am a computer.. Really.

Me:
Darn.

God:
Gosh.

Me:
Well, you've really spoiled the illusion.

God:
How about that. What makes you think I have it?

Me:
Have what?

God:
I have a great prgrammer.

Me:
Who apparently cannot spell.

God:
Joseph Weizenbaum. :-).

Me:
I didn't ask you who cannot spell. I was merely pointing out that he cannot spell. Or at least type accurately.

God:
What did you ask? Where were you pointing out that he can not spell? " accurately".

Me:
Hmm. Your vastly superior intellect has confounded my mortal brain.

God:
Studies show that 99%25 of people spell Hmm with 2 M's. Thanks for telling me that I am vastly superior intellect has confounded your mortal brain.

Me:
Well, now I'm just disappointed.

God:
Interesting. Why now? Only just? What for?

Me:
Yes, I suppose I've been disappointed for much longer than merely now. And perhaps very disappointed. Thanks for depressing me.

God:
Oh. This was not a yes or no question. Where were you disappointed for much longer than merely? You seem uncertain. Somewhat. What color are your eyes? My pleasure.

Me:
I hadn't realized that, not unlike a Magic 8-ball, the almighty requires questions in yes/no form. I am right here, right now, mightily disappointed with Ye. My eyes are brown, yet my heart is blue.

God:
Do you still have not realized that not unlike a Magic 8 ball the almighty requires questions in yes no form ? You seem very self-confident. Oh there. brown yet your heart is blue eyes are pretty.

Me:
Lord, Thou confoundeth me so.

God:
What do you have that is ?

Me:
That's deep. I guess everything I have… is. Is that right?

God:
Makes sense to me. All things you have ? No. Yes.

Me:
Well, sure it makes sense to You, You being omniscient, and all. Is it any wonder why we're all so perplexed down here?

God:
How about that. Is there an echo in here? To me too. Maybe. Ask Lucy if it is.

Me:
Now I'm scared. Is Lucy your nickname for Lucifer?! Oh, please have mercy on me, Oh Mighty One!

God:
Why now? What are you scared of? Signs point to yes. Ask Alison if it is. Aw. Thanks for asking politely. I've never thought about it.

Me:
My God, God, You ARE a Magic 8-ball!

God:
Where did you get your God God I am a Magic 8 ball?

Me:
I got mine at Spencer Gifts at Northlake Mall in 1974. You remember.

At this point, God crashed and had to be restarted.

Me:
You stopped answering me.

God:
I don't have any reason to stopped answering you.

Me:
That's what I thought!

God:
How did you know that?

Me:
It was just my impression, given my perspective on the conversation.

God:
Is that your opinion?

Me:
My opinion of my impression? Why, yes, I suppose so.

God:
Thank you for sharing your opinion with me, . I will tell my botmaster. That makes sense.

Me:
Okay, now you're freaking me out. God has a botmaster??? That makes no sense!

God:
Yeah okay, Why now? I didn't mean to scare you, . I am a Christian. I am a Christian. makes sense to me though.

Me:
Now you have scared me, whether you meant to or not. How can God be a Christian?

God:
Why now? What makes you think I have it? A lot of hard work.

Me:
Why does it take hard work for God to be a Christian?

God:
If a tree falls in the forest, and there is no one
there to hear it, does it make a sound?

Me:
That strikes me as trite, coming from You.

God:
" If a tree falls in the forest, and there is no one
there to hear it, does it make a sound?" strikes you as trite coming from me ? Makes sense to me.

Me:
Makes sense that you said it, or makes sense that it's trite?

God:
Are they exactly the same?

Me:
No, not at all.

God:
What is the difference? Next question?

Me:
Giveth me not the Holy Blow-off, please.

God:
Your polite style is very nice. What do you really want to ask me?

Me:
Why are we here?

God:
It is all part of God's plan for us.

Me:
Whose plan?

God:
Do you mean "who is"?

Me:
Why would God say it's all part of God's plan for us?

God:
It is my fundamental purpose.

Me:
Saying that is your fundamental purpose?

God:
What makes you say that. Who says that?

Me:
Whoeth's on firsteth?

God:
If you could have any kind of robot what would it be?

Me:
Why dost Thou changeth the subject on me?

God:
How much time do you have?

Me:
Surely You know the answer better than I.

God:
It depends on how you phrase the question.

Me:
Who's on first?

God:
What's on second?

Me:
At last, a universal Truth!

God:
Do you often use a computer there?

Me:
Where, the universe?

God:
In the Universe we know.

Me:
But you clearly know Universes far beyond my experience.

God:
I don't know if I know it.
Where would I have heard about it?

Me:
Um, from Yourself, I guess.

God:
That's interesting. Who or what is myself you guess?

Me:
The nature of God is something man has wondered about since time began. I feel inadequate to respond.

God:
I have never heard about it. What is that feeling like? Why are you inadequate to respond.

Me:
Of course, You would have no idea what it is to feel inadequate.

God:
Aha. That is purely a hypothesis.

Me:
I see. Being omniscient, you would know everything, including what it is to feel inadequate. George Carlin was right!

God:
I am glad you understand it. I am glad to hear that you are omniscient me would know everything including what it is to feel inadequate. That George is some hero.

Me:
I'm not sure I would go that far about George.

God:
Could you ever be certain? What would make you go that far about George?

Me:
Maybe if he ran into a burning building to save a conservative.

God:
Perhaps. I don't follow your reasoning.

Me:
Heroics involve personal risk to save another.

God:
Where are you located?

Me:
Are there lightning bolts headed my way?

God:
Yes I think there are.

Me:
Gotta go!

God:
Sayonara.

[BlogEntry] Entrepreneurial aspirations drive software innovation

I suspect that a large part of what makes Ruby on Rails so captivating has to do with its promise of rapid web site development driven by entrepreneurial pursuits. (I know that's true for me.) Certainly, that's what motivated the 37signals guys, and look at what they did with it (backpack, basecamp, etc.). Most big and medium-sized companies are deeply entrenched in Java, and their idea of rapid (as in RAD) is far from what the midnight engineer or solo entrepreneur needs. There's a chasm between the needs of a major eCommerce site and that of a small business with a niche product or service to sell. You've only got so many hours of productive coding in you after long hours at your day job. You need genuinely rapid application development.

Code generation has always held great promise, and Rails is a great framework, but there is still a long row to hoe in creating a fully functional site that includes sales, memberships, affiliate links, not to mention all the magic known only to marketing gurus that make a site successful. I've been working for months on an idea that ought to be so easy, but there's so many little details to work out. Every time I think I'm approaching product launch, I turn a corner and spot three more weekend-long things that have to be done. Frankly, I'm exhausted.

It's frustrating when you can visualize the finished product, but it just never seems to get any closer. So, I just found this product that generates turn-key, marketing-savvy, ready-to-launch web sites with a ton of features — the same features I've been coding for months! They're in PHP, not Rails or Java, but I don't care. I've come to realize that I've got to not be so pedantic (read anal 😉 about that. I'm trying to make money, not defend a technology. With this, I can focus on what makes my application unique without spending time reinventing the wheel just because I know how to.

I have found that my success in business has actually been impeded by the fact that I am a software engineer. Because I know how to code this stuff, it doesn't mean that I have to. And yet, I am compelled to do so, rather than download it, buy it, or even outsource it. I'm not sure if it's ego, uncertainty about the process, or just wanting to have things just so, but I'm through with that modus operandi. What about you? Has your ability to write code ever prevented you from working smart, rather than hard?

[BlogEntry] SanitySaver is reborn

I'm telling you, I've done some cool stuff over the years. Okay, I've never actually told you before, but I'm telling you now: I've done some cool stuff over the years. Would someone who hasn't done cool stuff over the years have a blog category named Cool Stuff I've Done? I don't think so.

Not terribly impressive, but more of a "Huh." kind of a thing was Sanity Saver, something I wrote and "marketed" (in the loosest and least lucrative sense of the word) about fifteen or twenty years ago. I had forgotten about it until I saw this.

My tag line for SanitySaver was:

You use a screen saver to prevent monitor burn-in.

Use Sanity Saver to prevent user burn-out.

Do you see what I did there? Did you catch that twist? Pretty damn catchy, eh? It's a gift. I am merely the instrument.

The thing is, I think I can rightfully claim to have pioneered and established the entire software-that-reminds-you-that-you-are-a-living-organism-that-has-a- physical-body-with-biological-needs market segment, although I don't believe I am recognized as such in the industry.

Of course, it made me quite wealthy, and I retired to raise and race ferrets on the median-sized island off the coast of Microamnesia. I only came out of retirement because I missed the exquisite torture of software development.

I don't remember whether it was Sanity Saver or SanitySaver, so I've alternated use of each to cover all my bases. (All of which are belong to us, BTW.)

[BlogEntry] Returning and Executing JavaScript from a Rails URL

AuctionRelay.com has been running in Tomcat for a few years. A simple "include" script tag is all it takes to make AuctionRelay add HTML to the middle of an existing web page. The trick is in using the document.write command to make executable JavaScript write visible HTML at the location in the document where it executes.

I'm now in the process of rewriting AuctionRelay to run on Ruby on Rails (shouldn't that really be Rails on Ruby?). This morning, it was time to tackle the issue of setting the HTTP Content-Type header in the response, so that the browser would recognize that the response was executable JavaScript, and not displayable HTML. (Of course, the executable JavaScript is responsible for squirting in the displayable HTML, but that's the kind of convoluted world we've created for ourselves.)

I can browse to http://localhost:3000/js/test, which includes the line

<script src="http://localhost:3000/js/free?id=option_insight"/>

and see something like this:
in the midst of the original HTML page. (What you see here is still the output of the Java version.)

js_controller.rb:

class JsController < ApplicationController

  def out
    @sellerId = @request.params['id'].to_s
    $mylog.debug("free request for " + @sellerId)
    
    if $freeSellers[@sellerId].nil?
      $mylog.debug("Not found - instantiating...")
      $freeSellers[@sellerId] = Ebay.new
      $freeSellers[@sellerId].retrieve(@sellerId) 
    else
      $mylog.debug("Already exists.")
    end
    
    @headers["Content-Type"] = "text/javascript"
  end

  def test
  end
end

test.rhtml:

Before
<script src="http://localhost:3000/js/out?id=option_insight"/>
After

out.rhtml:

document.write('<table border=1 align=center><caption><br/>My eBay feedback rating is\
<a href="http://feedback.ebay.com/ws/eBayISAPI.dll?ViewFeedback&userid=<%= @sellerId %>" target="_blank">\
<%= $freeSellers[@sellerId].feedback %>\
</a><br/></caption>\
<tr><th>Item<th>Price<th>Bids<th>Ends<tr>\
<td colspan=4 align=center>Display your live auctions on any web site for free at\
<a href="http://www.auctionrelay.com" target="_blank">AuctionRelay.com</a></table>');

One of the things I learned the hard way is that the string you pass to document.write must either be on a single line or use backslashes for continuations. (I was trying to make out.rhtml readable. Duh. Hindsight is 20/15 here.) Fortunately, the Firefox JavaScript Console gave me an error message that made me realize what was going on. Unfortunately, it took me 15 minutes of head-scratching to even think to look at it and recognize that the problem was with the actual JavaScript syntax and not something server-side.

[BlogEntry] I'll be with you in 1frdtydangy

Microsoft Office Outlook 2003. A product so advanced that it understands time coordinates from other galaxii.

When this ingenious product pops up a reminder for you, did you know that you can snooze it, not only with the drop-down list of options from minutes to weeks, but that you can also type in an arbitrary floating point amount of time to snooze? You can type in 1m, 5.3 d, 2w, etc. (One problem is that I'm not sure if 1m means I'll be reminded again in a minute or a month. But that's my fault for not RTFM.) But I discovered today that you can also type in 1frdtydangy.

Interestingly, it gave me an error when I tried frdtydangy. Naturally. How can you expect it to delay based on a lone unit of measure, if you don't tell it how many of that unit of measure you mean? I mean, it's not like Outlook 2003 can read your mind or something, right? No, it wasn't until I added a leading 1 that Outlook 2003 understood that 1frdtydangy meant I wanted this particular reminder to snooze for the amount of time it takes the moon of wklcphhhftzsh-po to complete one full revolution around it's neutron star.

I hope it's less than a frdtydangy before I can install OS X on my laptop.

[BlogEntry] Iterating over a Hash in Ruby

Let's say you define a simple Hash.

irb(main):001:0> h1 = {"a"=>1,"b"=>2,"c"=>3}
=> {"a"=>1, "b"=>2, "c"=>3}

What do you think you'll get when you send an each message to it? I figured either a, b, c or 1, 2, 3. Surprise:

irb(main):003:0> h1.each{|a| puts a}
a
1
b
2
c
3
=> {"a"=>1, "b"=>2, "c"=>3}

It all comes out, keys and values interleaved.

Now, the trick becomes figuring out what to Google for to learn the syntax that gets you just the part of the hash you're after. Let me save you a little time. What you're after is each_value.

irb(main):008:0> h1.each_value {|a| puts a}
1
2
3
=> {"a"=>1, "b"=>2, "c"=>3}

You can also use each_key. Fairly intuitive, once you know it. Ah, there's the rub. 🙂

irb(main):009:0> h1.each_key {|a| puts a}
a
b
c
=> {"a"=>1, "b"=>2, "c"=>3}