Sunday, March 4, 2012

Dr. StrangeCoder or: How I Learned to Stop Worrying and Love C++

posted by Kurtis at
Warning! This blog entry is about programming. Really. It's about C++. To all my non-programming friends: You won't care. Stop reading.

A good friend of mine at work (who is probably one of the best coders I've ever met, and a really nice guy to boot) posted the following over at his blog:

http://blog.grumpycoder.net/index.php/post/2012/03/02/Why-C-is-a-good-language-or-why-you-re-wrong-thinking-C-is-better

We've exchanged email about it a bit already, but I wanted to find out if the things I was saying actually made sense, so I took his challenge (he got it from http://usuckatcoding.com/):
Given a string of random characters, return the index of the first nonrepeated character. If all characters repeat, return -1. For example, given the string "abcab", 'c' is the first nonrepeated character and the result would be 2.

BONUS: There are time/space tradeoffs to be considered. The best solution will address any optimal time solution as well as any optimal space solution.
He did a solution in C to prove his point. He describes it thusly:
It uses ~1800 bytes on the stack. It's in O(n), and starts with a memset of 258 bytes. It supports strings up to 2^31 bytes.
The thing is, that's a very C way of looking at coding.

So I sat down to do this in C++. This took about two minutes to write (I'm omitting testing code) and it uses the identical algorithm to my friend's C solution:

int challenge1(const char *str)  {
    std::list<int>  results;
    std::map<char,std::list<int>::iterator>  seen_map;
    
    char c;
    int ret;
    for(ret = 0; (c = str[ret]); ++ret)  {
        std::map<char,std::list<int>::iterator>::iterator it = seen_map.find(c);
        if(seen_map.end() == it)  {
            // if we haven't seen it before, record it and it's position
            results.push_front(ret);
            seen_map.insert(std::pair<char,std::list<int>::iterator>(c,results.begin()));
        } else  {
            if(results.end() != it->second)  {
                // this is the duplicated character, remove it from the results
                results.erase(it->second);
                it->second = results.end();
            }
        }
    }
    results.push_front(-1);

    return results.back();
}

It's a very C++-ish solution. It does suffer in performance from its extensive heap usage (as my friend asserts) and it's even not O(n) because std::map is an ordered map (and therefore, likely, a tree). However, it is shorter, and the use of the insert/erase function names gives the sense of exactly what it's doing. (Also many of you who already hate C++ syntax are cringing at the iterator declaration inside the for-loop, and I won't disagree, though C++11's auto keyword and a better insert() prototype would fix that.)

Now, we can do better, but I don't think an average C++ programmer would have a lot of difficulty coming to this average solution fairly quickly. Possibly even quicker than the C guy.

So why do I think C++ is a better language? Because it lets you write suboptimal code faster? People who make that argument are (rightly) missing my friend's point. If your desire is to trade performance for ease of coding then use something even easier than C++ for goodness sakes!

I think C++ is a better language than C because it also doesn't hold back the performance. Let's look at iterating on this from a strictly C++ methodology. What do we see? Well, it's very specific to this problem. Let's genericize it (Sharon's gonna kill me for making up words.) We're going to explicitly overdo it to make a point:

template <class Traits>
int challenge2(const typename Traits::Container &container)  {
    typedef typename Traits::List                               ListType;
    typedef typename ListType::iterator                         ListIterator;
    typedef typename Traits::Map                                MapType;
    typedef typename Traits::MapNode                            MapNodeType;
    typedef typename MapType::iterator                          MapIterator;
    typedef typename Traits::Container                          ContainerType;
    typedef typename ContainerType::const_iterator              ContainerConstIterator;
    typedef typename Traits::Value                              ValueType;

    ListType    results;
    MapType     seen_map;

    int ret = 0;
    for(ContainerConstIterator cit = container.begin();
        cit != container.end(); ++cit, ++ret)  {
        const ValueType &v = *cit;
        MapIterator mit = seen_map.find(v);
        if(seen_map.end() == mit)  {
            results.push_front(ret);
            seen_map.insert(MapNodeType(v,results.begin()));
        } else  {
            if(results.end() != mit->second)  {
                results.erase(mit->second);
                mit->second = results.end();
            }
        }
    }
    results.push_front(-1);

    return results.back();
}

struct ChallengeTraits 
{
    typedef std::list<int>                  List;
    typedef char                            Value;
    typedef std::vector<Value>              Container;
    typedef std::map<Value,List::iterator>  Map;
    typedef std::pair<Value,List::iterator> MapNode;
};

Now here's where the real beauty of C++ kicks in. This version is generic enough that the space/time tradeoff can be done ENTIRELY in the Traits class (and fix that whole ordered_map thing at the same time). I could, for instance, define my ChallengeTraits class to use stack-based fixed size implementations like the C solution and use exactly the same space. I leave the code as an exercise to the reader (though it's not hard) and postulate that the C++ STL SHOULD PROVIDE those classes. Since it doesn't (and in general the STL doesn't provide enough flexibility with resource allocation with it's broken allocator model) I would expect that any C++ coder who cares about performance would write them exactly once in their career and then just use them over and over. The code (outside of Traits) hasn't grown appreciably longer.

But that's not all! Act now, and get a generic search in your generic random access container for the first non-duplicated value. In fact, if you change the function to return an iterator you don't even need the random access part.

Also, if you know things about your value set, you can get even better solutions. For instance, maybe the string only contains printable characters and you could code up your Map class to map your range of (32-126) to (0-94) and use less space than the current C solution. All the complexity is hidden away in your Traits, which you customize to your problem.

Let's review. C++ lets us use it's type and template system to specify an object with the exact minimum behavior we need for our algorithm to run correctly, which then lets you deal with the complexity to run optimally elsewhere and in a reusable way. It's the win-win scenario (though not the win-win-win your Michael Scotts might want.)

Class dismissed.

Thursday, December 22, 2011

A Flyleaf Christmas

posted by Kurtis at
"I've been looking in your window.
I've been dressing in your clothes.
I've been walking dead, watching you, long enough to I can't go on."
- Flyleaf, "This Close"


It's that time of year again. Stores are crammed with shoppers, whole radio stations appear on the internet playing versions of just two songs, and the McCathern family listens to entirely too much "A Charlie Brown Christmas" and "The Messiah" (yes, we have others, but that's what we tend to get stuck on around here.) Usually right after Thanksgiving I'm chomping at the bit to post something on the blog about what I'm thinking about regarding Christmas, as if everybody in our lives who really want more Micah and Asher pictures want to hear me dwell on whatever tangent my brain is taking this year. (Just nod and smile... nod and smile.)

This year has been different. California isn't working out the way I'd hoped. It's not bad exactly, just not great. Maybe my expectations were too high, or maybe the kids are getting old enough that the move was too hard for them. Maybe Sharon expressed it best in my new favorite-line-to-quote-out-of-context: "Traffic is the other shoe." But for whatever reason, this time of reflecting on the awesome wonder of the Incarnation has just not been all it has been in the past. I find myself shocked Christmas is less than a week away. I start to wonder if Lucy is right, and it's run by some big eastern syndicate.

All of which makes me feel disconnected from my favorite time of year.

This week has been extra bad, and today has been the crowning touch of bad on top of that (I won't get in to details because they get in to work that I don't want to talk about publicly.) So I've been feeling pretty down most of the day. And when I'm down, I listen to Flyleaf.

If you haven't heard of Flyleaf, bear with me for a bit. They are, as our friend Trilisa likes to call the genre, "angry boy music." I don't expect you to read this and go buy their music (unlike Out of the Grey, which you should do right now) because it's not everybody's thing. But today God used Flyleaf to teach me about myself, and all of us, and Christmas.

The song I excerpted at the beginning is called "This Close". It's about someone recognizing the God-shaped hole in their life:

I had a dream that we were dead, but we pretended that we still lived.
With no regrets we never bled, and we took everything live could give and came up broken empty-handed in the end.


I don't know who I am anymore.
Not once in life have I been real, but I've never been this close before.
I've been looking in your window.
I've been dressing in your clothes.
I've been walking dead, watching you, long enough to know I can't go on.


I finally was able to put words to the way I've been feeling about this move after hearing this song earlier today: I feel lost. I'm not lost (at least, not in the Baptist sense...) I know Christ. I know why I'm on this earth. I don't know why I'm here in Southern California, but I don't think it's always ours to understand all the motivations of the divine. This is not about knowing: it's about feeling. I feel like I don't know who I am: here I am doing the thing I've been telling myself I wanted to do since I was a little kid, and... it's not who I am. I feel separated. Disconnected. Lonely. Apart. Forsaken.

Obviously that's overstating things: I love my family, and they have been great here. Part of the reason I feel this way is because I feel detached from them with the commute and the hours and so on. But the reason I was having trouble connecting to Christmas is because I feel lost.

And Christmas, in addition to all of the other things I've said before, is about being found.
"I will put my laws in their minds, and I will write them on their hearts. I will be their God, and they will be my people. And they will not need to teach their neighbors, nor will they need to teach their relatives, saying, ‘You should know the Lord.’ For everyone, from the least to the greatest, will know me already. And I will forgive their wickedness, and I will never again remember their sins."
-- Hebrews 8:10-12
Ultimately being human in this world means being lost. Not once in our lives have we been real, and in the dissonance we experience with the world around us we come to know that. But sometimes we get close to real. So achingly close. We peer over the sill of the store window at the long hoped for present, longing for someone to know our secret desire and get it for us. We sit on our hands as we await the arrival of our loved one driving in to meet our family. We feel too tiny arms try to wrap around our inexorably expanding waistlines.

We follow these events around like hungry sparrows or the rats in the piper's tale. We try them on: outward trappings of a life of being known that should have been but never was. Looking in windows. Dressing in clothes. Walking dead, watching life.

Our God did not leave us like this. He did not abandon us after our rebellion, watching us with contempt for our attempts. Instead, in his compassion, He knew us: looked in our window. He dressed himself in our clothes. Walking dead (in the marked-for sense) He came to find us.

And there we were: an impossibly young mother unsure of how to care for this wriggling tangle of limbs. A grown man nervous about a son not fully his. We were sweaty and smelled of sheep. We were humbled by events we didn't understand despite our great learning. We were thankful our time had past, as we were old and tired. We told others how our half-mad ramblings had finally come to fruition in this child. We marveled at His early understanding (with authority) of spiritual matters. Broken, blind, full of hate, mocking, swearing, lying, stealing, killing, savage beings groping for everything life could give. And at the end we were broken and empty-handed.

So He gave us our secret desire. He showed us He knew us by becoming one of us. He became real for us, so that we might become truly real.
"Suddenly, the angel was joined by a vast host of others — the armies of heaven — praising God and saying:

'Glory to God in highest heaven, and peace on earth to those with whom God is pleased.'"
-- Luke 2:13-14
Let’s see this thing that has happened, which the Lord has told us about.

Sunday, November 27, 2011

Miracles and Creation

posted by Kurtis at
"When I consider your heavens,
the work of your fingers,
the moon and the stars,
which you have set in place,
what is man that you are mindful of him,
the son of man that you care for him?"
-- Psalm 8:3-4


Advent is upon us, and I want to write something about that, but recent events have reminded me that I'm in the minority of Evangelicals (at least, the vocal ones) since I'm a theistic evolutionist. With the mind blowing miracle of the Incarnation upon us (though it really is always before us) I thought I'd share one of my favorite passages from Augustine (thank you, Reverend Doctor Jim Smith, for introducing this to me some time ago):
The miracle indeed of our Lord Jesus Christ, whereby He made the water into wine, is not marvellous to those who know that it was God’s doing. For He who made wine on that day at the marriage feast, in those six water-pots, which He commanded to be filled with water, the self-same does this every year in vines. For even as that which the servants put into the water-pots was turned into wine by the doing of the Lord, so in like manner also is what the clouds pour forth changed into wine by the doing of the same Lord. But we do not wonder at the latter, because it happens every year: it has lost its marvellousness by its constant recurrence. And yet it suggests a greater consideration than that which was done in the water-pots. For who is there that considers the works of God, whereby this whole world is governed and regulated, who is not amazed and overwhelmed with miracles?

If he considers the vigorous power of a single grain of any seed whatever, it is a mighty thing, it inspires him with awe. But since men, intent on a different matter, have lost the consideration of the works of God, by which they should daily praise Him as the Creator, God has, as it were, reserved to Himself the doing of certain extraordinary actions, that, by striking them with wonder, He might rouse men as from sleep to worship Him. A dead man has risen again; men marvel: so many are born daily, and none marvels. If we reflect more considerately, it is a matter of greater wonder for one to be who was not before, than for one who was to come to life again. Yet the same God, the Father of our Lord Jesus Christ, doeth by His word all these things; and it is He who created that governs also. The former miracles He did by His Word, God with Himself; the latter miracles He did by the same Word incarnate, and for us made man.

As we wonder at the things which were done by the man Jesus, so let us wonder at the things which where done by Jesus God. By Jesus God were made heaven, and earth, and the sea, all the garniture of heaven, the abounding riches of the earth, and the fruitfulness of the sea;—all these things which lie within the reach of our eyes were made by Jesus God. And we look at these things, and if His own spirit is in us they in such manner please us, that we praise Him that contrived them.

Thursday, September 8, 2011

Waiting

posted by Kurtis at
"Inigo Montoya: I do not suppose you could-a speed things up?
Man in Black: If you're in such a hurry you could lower a rope or a tree branch or find something useful to do.
Inigo Montoya: I could do that. I have some rope up here, but I do not think you would accept my help, since I am only waiting around to kill you.
Man in Black: That does put a damper on our relationship.
Inigo Montoya: But, I promise I will not kill you until you reach the top.
Man in Black: That's VERY comforting, but I'm afraid you'll just have to wait.
Inigo Montoya: I hate waiting."
    -- The Princess Bride


Me too. Today I found out that I've fallen through a crack in the Blizzard HR system. It might even be my fault. But the short version of the story is that I don't start work next Monday. I start the Monday after.

Yes, I know. #richpeopleproblems. I was reminded recently of the number of people in Grove City who have lost jobs or recently had to find new work, and Sharon and my most recent big decision was keep the two jobs we had that were really good or transplant ourselves across country to two other jobs waiting for us. I shouldn't complain.

But waiting is hard:

Saul remained at Gilgal, and all the troops with him were quaking with fear. He waited seven days, the time set by Samuel; but Samuel did not come to Gilgal, and Saul’s men began to scatter. So he said, “Bring me the burnt offering and the fellowship offerings.” And Saul offered up the burnt offering. Just as he finished making the offering, Samuel arrived, and Saul went out to greet him.

“What have you done?” asked Samuel.
    -- 1 Samuel 13:7b-11a


Trusting God is hard, not easy. Trusting God is harder when the ways you see God work aren't the things He does this time. Then to be asked to just hold off and wait? Don't start next week - just start the week after.

It should be easy enough. I'm sure I'll wish I had a week off in a month or two. A whole week to unpack things still in boxes, or straighten rooms still disorganized, or to write down that hymn arrangment Shelly keeps pestering me for (in her defense, she's bothered me less than once every five years, so it's not exactly pestering.)

But it's just another break in pattern. More time to worry if this was the right decision. More time to worry on all the stresses it is adding to our family life. More time to worry on the friends I miss in Grove City. More time to worry.

"Therefore I tell you, do not worry about your life, what you will eat or drink; or about your body, what you will wear. Is not life more than food, and the body more than clothes? Look at the birds of the air; they do not sow or reap or store away in barns, and yet your heavenly Father feeds them. Are you not much more valuable than they? Can any one of you by worrying [make their new job start one hour sooner]?"
    -- Jesus in Matthew 6:25-27, with a slight change from me


So it's a reflection of my mood and spiritual confusion right now that even this blessing seems annoying. Boy do I need help.

Sunday, August 14, 2011

Churches

posted by Kurtis at
"All I need is an arm around my shoulder on my way.
Did you say that the love of God can hold my heart,
Can wash my fears away?"
    Satellite Soul "Wash"


I alluded in a previous blog post about one event that really sticks in my mind that led us to Fellowship Community Church in Grove City three years ago. I promised in that entry to blog about it, but I can't seem to find the followup, so I'm telling the story again.

At one point after we'd been going there about a year (maybe around new members' class for us) Pastor David asked me what I thought was the best thing (or maybe most distinctive, but positive) thing about the church. It took me about 200 milliseconds to answer:

Carol Frey.

We were brand new to the area. We had been married a while by then, and had a three year old, but in a lot of ways we'd never settled down (a long PhD program will do that to you.) We'd been in town less than a few weeks (I want to say less than two, but I'm not sure) and been to one church -- FCC. But Carol Frey (who would later become a dear friend of ours) not only took the time to meet us -- these new, strange out-of-towners -- but she went out of her way to do two other things. First, she invited Asher over to play with Jake (her one month younger than Asher youngest of four), which was a God thing. We'd had been worried and praying that Asher would have playmates, because he'd had only a handful of friends in Chicago and most of them had been from families like ours: in transition and in urban living. We were (probably pretty stupidly) worried about him making friends in a rural environment where all the kids grew up together and already knew each other.

But, to add to that, on that first play date she found out from Sharon that I played guitar and drums, had been leading worship at our church in Chicago, and was worried about finding a church in Grove City where I could minister on the worship team. So she contacted Debbie Throckmorton and set up a "dinner" where they both brought their kids, we brought Asher and my guitar, and Warren (my best friend in Grove City, who I first met that night), Michael (Carol's husband, and another close brother in the faith), and I sat out back and played guitar.

We visited other churches after that, but I'll tell you what I've long since told all of them: my heart wasn't in it. I felt like FCC was the place God wanted us.

Lots of stuff happened in the intervening three years. The church recently went through a nasty turn of events, and has had several people leave. But I'll never forget the kindness Carol showed us in opening up their already very crowded lives to make room.

This makes me think of another story I usually tell in combination with this one, but one I didn't understand until this occured. When I was first driving in high school my dad badgered me into coming to a visitation night with him because there was a couple who had brought their freshman boy to church, and dad suggested that rather than a visit from a staff member, he thought they'd be better served by a visit from the church youth. So, I went, and took a buddy or two with me. We went several times after that, because we noticed that whenever we visited the family almost always landed at our church -- usually becoming good friends. We joked about visitation being the opportunity to add to our social circle.

Of course now, I understand completely. Dad was savvy and shrewd. I can say if Asher had been 13 and Andy Frey and a couple of buddies had visited him that first week after we visited FCC we wouldn't even have bothered visiting anywhere else: even for show. I think you all probably know why.

Anyway, so here it is three years later, and we find ourselves in the same looking boat, but this time there is no Carol Frey. God will use something/someone to show us his way, I know. Pray I keep my eyes open.

Asher, awed by the fact that First EvFree Fullerton sends their kids outside to play on a playground on campus during their kids' time, has stated that's where he wants to go. It's a little big for Sharon and I, but who knows?

Anyway, keep praying for us. Things are falling in to place. God is good.

Tuesday, August 2, 2011

A Death, A Move, and Three Requests

posted by Kurtis at
"Blind these eyes who never tried to lose temptation.
I'm so scared. Where's the hesitation?
You so easily proved that You could save a man:
well I am that man."
    Jennifer Knapp, "Way I Am"


"To ask that God’s love should be content with us as we are is to ask that God should cease to be God: because He is what He is, His love must, in the nature of things, be impeded and repelled by certain stains in our present character, and because He already loves us He must labour to make us lovable."
    C.S. Lewis, The Problem of Pain


A saint of God in our church passed away last week: Kathy Hinton. Sadly, I barely knew her. She was already in poor health when Sharon and I joined the church, and though her husband Bill was faithfully at church almost every Sunday we've lived here, I never took the time to get to know Kathy.

Many in our church considered her a dear friend, though, and our church (recently rocked with conflict) is now in an odd position, as some of the people to whom she was dear are now being called to celebrate her life at a funeral to be held at the very church they have left.

There are so many conflicting emotions in my heart about moving to Los Angeles, and in middle of it I find the words of praise given in honor of this woman I never knew to be extremely comforting. She was faithful to her God. She relied on Him in her darkest moments. Her family knows the weight of glory.

With our leaving, many people have taken the time to say very nice things to me about our ministry here. I am thankful God has used me in their lives. But inside I know that just as we see our Christ as through a mirror darkly when we experience manifestations of love on earth I also know that the worry and concern I dwell on in this move are dim reflections of a deeper reality in my heart: the lack of faith still present. I am glad others have seen in me the work of God; for now I can't seem to get past the work left to do.

And thus with two different endings happening simultaneously (one leading to a glorious new beginning in the breath of God after a struggle with the body, and one leading to a hopefully good ministry and healthier life in sunny California after a struggle with weather), I find myself contemplating the incongruity of the complete power of God at work in his incomplete children. I didn't know Kathy, but I suspect that her times of doubt were real, her struggles honest. Yet, she was faithful, as I can hope to become.

Here is where those of you who share my faith will find beauty and those of you who don't will scorn: I believe all of the nice words said about Sharon and my character are true, just as I am sure that all of the words said about Kathy Hinton are true. And knowing the traitor inside me, I can only believe they are true because of the limitless power of my Heavenly Father to make them so, despite the rot in my own soul.

Why would He do this? Because it is simply His desire to do so.

"and provide for those who grieve in Zion—
to bestow on them a crown of beauty instead of ashes,
the oil of joy instead of mourning,
and a garment of praise instead of a spirit of despair.
They will be called oaks of righteousness,
a planting of the LORD for the display of his splendor."
Isaiah 61:3


So pray for the Hintons, and pray for us: to see Him more clearly, to love Him more dearly, and to follow Him more clearly in the days left to us, wherever they may be.

Sunday, July 24, 2011

Take Our Stuff!

posted by Kurtis at
So, thank you to those who have already bought something of ours. Attached are some pictures to try to entice you to take more.

old style desk and hutch (now FREE!)

train table:

If it's not crossed out from the previous post it is still available, but these items in particular we really don't want to move (the train table is a possible exception) so... make an offer. Don't be shy. :-)

Wednesday, July 13, 2011

Big Changes

posted by Kurtis at

As you've all probably heard by now, we are moving to southern California. Despite the fact that we've only lived here for 3 years, we've accumulated too much stuff to move. Here is a list of stuff we'd like to try to get rid of before we move. Some stuff the prices are more firm than others (unless noted, assume we'll take the best offer we get when we start getting close to move out date), and keep checking back as we'll update this list as stuff is sold or if we need to add things.

  • Old Style Desk (free) - 3.5 ft. x 29 in., wood, 3 side drawers and 1 lap drawer - scratches on top and chipped trim on left side
  • Desk Hutch (free) - about the same size as above desk but doesn't match - bowed shelf
  • Big Office-Style Desk ($60) - 6 ft. x 30 in. with no drawers but small back shelf
  • Train Table ($15) - kids size with reversible top and storage on ends
  • Mattress, Box Spring, Frame ($35) - we have queen and double; you can have whichever you'd rather take (keep in mind these are pretty old mattresses, thus the cheap price)
  • 88-key Keyboard with weighted keys and soft case ($80) - there's a dent in the top that makes it rattle whenever you strike a key, but it otherwise works
  • 61-key Keyboard Yamaha SY-77 ($50) - a really nice synth back in the late 80's - quite dated but still works, includes hard shell flight case
  • Rotel home stereo power amplifier and 2 Acoustic Research 216 PS bookshelf speakers ($30)
  • 1 12" wheel base Dora the Explorer Bike with training wheels ($20) - (yes, it was Asher's - don't tease him he really liked Dora at the time)
  • 7.2 Ft^3 Chest Freezer ($200 mostly firm)
  • Tacoma M1 Mandolin ($115) - includes hard shell case
  • Game Table ($10) - small, wood, round
  • Futon ($35) - black frame and mattress with 2-sided cover (maroon and black)
  • Craftsman 22" snowblower ($150) - two years old with single drive train (drives both the auger and the forward movement)
  • old lawn mower ($15) - should work but we haven't used it
  • 20" Dell LCD Computer Monitor ($30) - has composite, s-video, VGA, and DVI inputs
  • red sandbox (free) - in the shape of a crab with a few dents
  • GrillMaster small grill ($35) with propane tank (with some propane in it)
  • Drum Set ($150) - two set toms, one floor tom, bass and hi-hat with pedals, crash, ride, and splash cymbals, wood snare, stool, all hardware
  • 37" Westinghouse LCD TV ($40) - this would be really good, except that I did a dumb experiment involving a Nintendo Wii and candles and got the screen too hot - as a result the TV suffers from burn-in easily, which unplugging for several hours seems to help
  • Fish tank (free) - 5(?) gal. tank, gravel, pump, etc., plus 2 male guppies and some fish food and extra filters

Wednesday, September 8, 2010

Epic

posted by Kurtis at
"perfect in power
matchless in glory
nothing is greater, Brilliant Creator
friend of mine"
-Kristian Stanfill, "Beautiful Jesus"


Asher started singing a different song when I put this one on the stereo a while ago. He sang a couple of lines then announced that the title of this other song was "The Cries of the Squid in the Sea". He then sang another couple of lines and stopped to announce "this song is pretty long." I said, "it's only 3 minutes" thinking he was talking about the Kristian Stanfill song and he said, "No... it's 3 HOURS!" And proceeded to keep singing.

Now, if I was a better parent I would've run and gotten the recorder sooner, but at least after 45 minutes of constant improvisation I realized he was serious about this being a THREE HOUR EPIC operetta involving sharks and the poor squid in the sea. I'm uncertain as to the plot - for a while it sounded like the squid was in a video game trying to beat the sharks, but now it sounds like the squid is being prevented from attending school by the sharks (or maybe something else... we haven't heard from the sharks in a while.)

Of course, my son isn't bound by such pedestrian concepts as plot or theme. This is a THREE HOUR EPIC after all, covering great swaths of love and loss - the trials and tribulations of our entire race as projected onto a poor, lonely, crying squid. Weep, weep, my brothers and sisters. Face your mortality in a sobbing calamari!

Recording coming later. Sorry Asher - maybe I'll take it down off our blog when you reach adolescence (said the liar).

Tuesday, September 7, 2010

Technology

posted by Kurtis at
"I beta tested every operating system.
Gave props to some, and others? I dissed 'em.
While your computer's crashin', mine's multitaskin'.
It does all my work without me even askin'."
-Weird Al Yankovich, "All About the Pentiums"


Being on leave has taught me that while I love our kids a lot, really I want to mess with technology for at least a few hours a week. 40+ is an awful lot, so work sometimes still feels like burning out, but being completely without is reasonably rough.

Sharon and I got new iPhones a few weeks ago when our contract with Verizon expired. It's the kind of gadget-y extravagance I feel bad about, but not enough to not do it. We also have an HDHomeRun, so it seemed reasonable to try to figure out how to use VLC to transcode the video from the HDHomeRun in real time, enabling us to watch TV on our iPhones. That part was easy. Then I wrote a script to automatically tune the HDHomeRun based on HTTP GET requests as well as restart the VLC transcoding. Then I made a simple webpage listing all the ClearQAM channels we can tune with the HDHomeRun, with links to this script to start the streaming.

Now Sharon and I can watch Live TV from anywhere in our house on our iPhones, and it took about two hours. It was actually so simple to do I am surprised that there's not already "an app for that." We're one step closer to one of my technological fantasies: being able to display the Super Bowl on every TV, handled device, and computer at the same time on Super Bowl Sunday during our annual Super Bowl party. Everybody needs a dream, right?

It's the little things that make me smile. Only two more weeks of leave left, though.