Tuesday, February 25, 2014

This is Truth!

In 2001 I had a Palm Pilot. I don't remember much about it, a year later it got wet and never dried out. But I was cool before cool was cool, because  I used my Palm Pilot for my Bible at Breakaway at Texas A&M. Now, you can't go to church without seeing people using their iPhones for their Bibles. Back in my day, we used our Bibles. Except for me, I was cool. I used my Palm Pilot.

On Tuesday mornings I attend a men's breakfast at my church. We have breakfast followed by a devotion. This past Tuesday, the gentleman leading the devotion was using his iPhone for his bible. During a dramatic point in his devotion he said "This is Truth!" I looked  and he was holding his iPhone up like a Southern Baptist preacher waving the Bible around.

Thursday, February 13, 2014

What Have I Become?

I stopped at Starbucks today.

When asked what I would like, I said without hesitation "A tall blonde, to the top. Everything bagel, toasted, with creme cheese." I actually sounded legit.

I am so ashamed.

Saturday, February 8, 2014

There's a hole in my jacket

A buddy of mine use to work at a outdoor gear shop. He called me one day and said he could get me a great deal on a Mountain Hardwear rain jacket. I had been needing a new rain jacket, so I took him up on the offer. It came in a size too big, but I liked it.

Shortly after I got the rain jacket, I was in Rocky Mountain National Park. I had driven Trail Ridge Road and stop at the Alpine Visitor Center. It was raining and cool, so I had my new rain jacket on. At the visitor center is the Trail Ridge Cafe, where I picked up a sandwich and coke. Walking out, I passed a museum. Loving museums, I decided to walk in. Noting the "no food, no drinks" sign on the door to the museum, I put the sandwich and coke in a pocket on the inside of my jacket.

The museum was OK, I wouldn't drive Trail Ridge just to see it. Heading back to my car, I remembered my lunch in my pocket. I reached in my jacket, no lunch. I reached into the pocket and put my hand all the way to the bottom, but my hand kept going. My hand kept going until it went out the bottom of the pocket. Turns out it isn't a pocket, but just a random sleeve.

I just went without lunch that day. I tried to put myself in the shoes of the people around me. If I saw someone walking and food started falling out of their jacket, while I wished someone would have told me, I'm pretty sure I would have told the park rangers instead.

I'm not a crook, just a dummy.

Saturday, February 1, 2014

Oh Snap! Hello, World!

In programming, the first program that many people write in a new language is Hello, World! A simple program that displays "Hello, World!" on the screen.

I think we should change from Hello, World! to Oh, Snap!

The Oh, Snap! program is based on the Oh, Snap! flowchat.


Here is Oh, Snap! in three languages, Python, C++, and Prolog.

Python

#ohSnap.py
#Clinton Woods
#Python 3, ver: 3.3.2
#Wing IDE 101, 5.0.1-1 (rev 30370)
#Program determines if an "Oh, snap!" is appropriately warranted.

def ohSnap():
    YES = ["YES", "Y"]
    NO = ["NO", "N"]
    YNOPTIONS = YES + NO

 
    while True:
        toldCheck = input("Did someone get told? ")
        if toldCheck.upper() in YNOPTIONS:
            if toldCheck.upper() in YES:
                print("Oh, snap!\n")
                break
            else:
                print("Tell them.\n")
     
        else:
            print("Invalid input. You got told.")
         
#__main__
if __name__ == "__main__":
    ohSnap()


C++

//ohSnap.cpp
//Clinton Woods
//C++
//Microsoft Visual C++ 2010 Express Ver. 10.0.30319.1
//Determines if Oh, Snap! is warranted.

#include <iostream>
#include <string>
#include <sstream>

using namespace std;

void ohSnap (){
string told;
string yes = "yes";
string no = "no";

cout << "Was someone told? ";
getline (cin, told);
if(told == yes){
cout << "Oh snap!" << endl;
}
else if(told == no){
cout << "Tell them." << endl;
}
else{
cout << "Invalid input. You got told." << endl;
}
return;

}

int main(){
ohSnap();
return 0;
}


Prolog

%ohSnap.pl
%
%Clinton Woods
%Created: February 1, 2014
%
%Written in Microsoft Windows Notepad
%Developed for and tested using SWI-Prolog version 7.1.5
%
%This program runs on query.
%
%This program query's the user to determine if the use of Oh Snap is warranted.

ohSnap(oh_snap) :-
told(yes),
        !.

ohSnap(tell_them) :-
told(no),
        !.

ohSnap(invalid_input_you_got_told) :-
        told(C).

getTold :-
write('Did someone get told?: '),
read(A),
nl,
assert(told(A)).

query :-
retractall(told(A)),
getTold,
ohSnap(B),
write(B),
nl.