kris

Recursion

Blog

I made some comment to Kris recently about how I wish I had more formal computer science training. I took all of two programming classes in college, and learned the rest on my own. I believe I do okay, since programming is essentially solving one big logic problem, but every so often I solve a problem with brute force instead of creating an elegant solution.

Kris offered to help me out with the formal computer science education, and suggested we go through his Algorithms book. I agreed, figuring it would happen not before next year, given all of my copious free time.

When I was at Hackday yesterday, Kris pinged me and asked if PHP could handle recursion, which cracked me up (the answer being, uh, yes, of course). When I said yes, he asked me if I could write a recursive function that printed out a series of numbers, from one to the single function argument N. The two keys to this problem were recursion and single parameter.

Counting down from N to 1 was easy. I figure both are easy, but counting down is clearly the easier:

function kris($n = 1) {
  print "$n ";
  if ($n > 1) {
    kris($n - 1);
  }
}

Oddly enough, counting up was harder for me. I told Kris he couldn't offer any hints, and eventually I figured out a convoluted solution using a static variable. My solution clearly showed me my lack of CS education. Kris' solution was much simpler:

function kitt($n=1) { 
  if ($n>1) { 
    kitt($n-1);
  }
  print "$n ";
}

As Kris commented, people forget you can do the recursion first, and the action second, when writing recursive functions.

A candidate at Kris' work was unable to solve the problem, and he wanted to see if I could, especially since I was commenting on the CS education I didn't have. I did solve it, but not correctly.

Next time, I'll have the trick. This time? I felt like an idiot.

8:37 to job

Blog

On Wednesday, Kris had a job interview. Two days in a row he had to get up in the morning too early for the two of us with natural sleep-until-noon tendencies. Good thing I convinced him to get up early the day before, to practice.

Always pragmatic, Kris timed the drive into to interview. He was leaving early enough to catch the carpool lane, and the office would be closer than previous work places, so he was hopeful for an easier commute. He also planned to time the drive back, to compare the two.

After the interview, which he felt went pretty well, Kris started the timer on his watch, and started his drive home. He received a phone call as soon as he started drivingand immediately thought, "What the? Does Kitt have a webcam in my car?"

Oh, the suggestions that man makes to me... Time to find a mobile webcam system...

The call was, indeed, not from me. Instead, the company he just interviewed at was calling to let him know they wanted give him a job offer.

Surprised, he looked at his watch.

8 minutes, 37 seconds to job.

Top that.

I convinced him

Blog

I finally convinced Kris to go to a dermatologist to have various spots on his body checked out. by convincing, I mean, I made a doctor appointment for him, reminded him about it, woke him up in the morning, and went to the appointment with him. He had a couple spot on his chest and one on his back that I was a bit concerned about, so I went to point them out to the doctor. Doyle and Mike suggested I circle the suspious spots in permanent marker, add a note, and send Kris to the doctor by himself, so that I could save time. I ignored them.

We arrived at 9:05 am, five minutes late for his appointment, only to discover that his appointment was at 9:30 am. D'oh. "I could have slept another thirty minutes, Kris complained. Yeah, yeah.

The doctor looked all over Kris, at his various moles and freckles, from his hair to his feet, before she asked which spots I was concerned about. I pointed them out, one at a time: one she said was scar tissue, one was a cyst, and one was just a large freckle-mole with hairs growing out of it. She expressed concern about a particular mole on his thigh, but it was one that was there for as long as I've been seeing Kris naked, so she wasn't concerned much.

When she left, I commented to Kris that I really didn't believe her, that I wanted to take pictures of the spots for later comparison, and maybe have them removed, just in case. He was a little surprised and asked why I didn't believe her. "Because the dermatologist who originally looked at mine told me it was just a skin tag."

Just a skin tag.

I went in to have the spot next to my eye, which was growing slowly, and annoyed me. She told me it was just a skin tag, and that I would probably have to pay for its removal out of pocket. She said the removal would include a biopsy, and my insurance company probably wouldn't pay for that either, was I really sure I wanted to have it removed?

I'm a huge fan of fixing things that bother me. I paid for orthodontia when I was 29, to have braces for the second time in my life, because one tooth was out of place.

One tooth.

No one could see the out-of-place tooth, but I could feel it and it bothered me. So, I had it fixed. Same thing with this skin tag. It bothered me. It hurt when I pressed on it. I thought it was a wart next to my eye, caused by rubbing my eyes after dealing with a wart on my foot years ago. Reasonable thinking? Probably not. But the supposed skin tag annoyed me, and I wanted it gone.

Two weeks later, I was receiving voice mail messages from my doctor, would I please call her back. I called her back, sat down, and found out I had skin cancer. A small localized tumour, but because of the location, I needed surgery to have it removed.

Insurance ended up covering the removal of that "skin tag," and I became suspicious of every bump on my body. And Kris'.

Given the initial mis-diagnosis of my growth (I need to give it a name so that I can refer to it more easily, suggestions?), I was suspicious of Kris' glowing diagnosis. Part of me wants to accept the scar tissue as just scar tissue from some internal injury that has surfaced. It's the same part of me that thought my eye bump was a wart.

The other part of me screams HE HAS NEVER HAD AN INJURY IN THAT SPOT, much less an open, scar causing injury THAT KEEPS GROWING. That's the part that says, I don't care about the $700 cost, cut it off now.

I know that I'm more paranoid than I should be. I know that Kris isn't paranoid at all. Somehow, between the two of us, we'll find a middle we can both live with.

Kris and his new humidifer

Blog

Bought the last two in the store, but only because they were two for

one. House mold, here we come.

I've been trying

Blog

Ever since Kris was laid off, I've been trying very hard not to spend money. Mostly not to spend money on superfluous things. Things like a chest freezer to store extra boxes of Girl Scout cookies and the chocolate chip cookies I made last week and the extra slice of the Great Wall of Chocolate from P.F. Changs that I couldn't finish. Or maybe the electrolysis to remove those annoying little hairs that are growing from places they're really not supposed to be growing. You know, the important things. Screw food, water and shelter, who needs that?

Unfortunately, consumer habits die hard, and I've really enjoyed using my new Sidekick. This thing cracks me up! When I showed Heather, hey look, I can log into IM from this thing, isn't that neat, she replied, "Great! Now you can always be connected." When I answered, "I know! Isn't that awesome?" her response was, "You know, that's not a good thing for most people."

Yeah, well, me and my toys. Certainly wasn't always that way.

When Kris and I first started dating, he ordered DSL for his Intarweb connection. I couldn't understand why he needed this faster, always on connection.

Until I used it.

For our first Christmas, Kris bought each of us cell phones. When I opened my box, my response was something like, "Wow! Thanks! Cell phones? Who needs a cell phone?"

Ah, but he was just setting the stage.

I recall thinking Bharat was way an early adopter with his Tivo (oooo!) and his tiny cellphones. Oddly, people think of me that way now.

People are crazy.

Besides, I'm trying not to spend money at this point.

Try as I might, I'm not having much luck at it.

Our refridgerator died last week. Mike saved us the $500 repair by offering us the use of his old one (yay, Mike!). Then, the DSL died, resulting in potentially another couple hundred dollars worth of repairs. Worlds tickets (admittedly a vacation we're choosing to go on, and not one that's absolutely required) are coming up, as well as housing and such. A favorite picture fell shattering the glass, requiring another $40 framing job.

Mike said, when it rains, it pours. He's right. I just wish our clients would pay us, and make this downpour of expenses a little easier to take.

Pages