Posted on Leave a comment

Bad Dad

I am trying to work. Evan comes downstairs carrying a game CD and a case for Mart Kart Wii because he likes playing Mart Kart Wii with me. Instead of acknowledging the cuteness and giving him the 4 minutes it takes for him to get bored with the game, I got frustrated with the distraction and angered that a CD/DVD was out of its case being handled by a three year old. Don’t ever forget, they just want your love and your attention! To give a child what they want often takes very little. Make the time.

Posted on 2 Comments

Today’s Coding Challenge

In one of my applications, I use jQuery’s UI Datepicker as part of the interface for easy date selection in adding and editing some data. I have two screens that show the current date. One screen is a report that says "Today’s date is…" and shows the current date. The other is the form for adding this data. The datepicker calendar is supposed to default to today’s date.

Problem 1: On the development server, the report and the form both default to today’s date. On the staging server, the report and the form both default to today’s date. On the production server, the report defaults to today’s date; the form defaults to December 31, 1998.Solved. In a special case, a null string was being passed when a date type was expected.

Problem 2: When editing, if the date is in the current monthmonths of March and November, the highlights for datepicker don’t work. The day still gets selected appropriately but the date itself is never highlighted making the user think they didn’t click the date. Click to see a working example of the problem. Update: This is partially fixed. In UI version 1.5.2, the highlight does not work in November or March. This is demonstrated at http://sidesigns.com/pub/datepicker/index152.php. I tested with the 1.6rc2 release candidate and November now works but March is still not highlighting correctly (the first week highlights but no others). This is demonstrated at http://sidesigns.com/pub/datepicker/index16rc2.php. I’ll be submitting a bug report to the jQuery UI team.

Posted on Leave a comment

Cutting Cedar Trees for Catapults – Need more

Today I’m helping cut down some cedar trees for the Boy Scouts. At next weekend’s camping trip, we will be building three catapults. Two kind people have each offered to let us harvest 6 trees from their respective groves. Each catapult requires six 15 foot long spars no bigger than four inches in diameter meaning we have materials for 2 out of 3 of the catapults.

If you are in Knoxville, and have a cedar tree or two or six that you wouldn’t mind us cutting down, please let me know. And thank you!

Update: To prepare for next weekend’s camping trip, our troop’s Scout leaders met from 7am-8:30am. One volunteered his truck but no one could volunteer additional labor so the tree harvesters were our Scout Master and me. By 10am we had the truck and were at the first cedar grove to pick up the trees that were felled Thursday late afternoon but had to be left since there was no truck to carry them. The property owner asked that the spars be hoofed out because of Friday’s rains. He didn’t want ruts left in his property. After a bit of friendly chatter, the spars were loaded and we were off to the ranch with the next cedar grove. The first property was younger trees and dense. The second property was older trees and more sparse. The owner offered to let us get enough trees to make 2 catapults but toward the end of the day we were wearing down and felt we had thinned the trees enough. We stopped short of what we thought we needed. Once back at the church, we unloaded the trees, returned the truck then came back to the church to size the spars. As it turns out, we harvested exactly the right amount of cedar trees to build three catapults. This wood should last several years and allow the scouts to build many catapults and monkey bridges. We wrapped up at 5:30pm. My thanks to these generous property owners!

Posted on Leave a comment

Today’s Programming Challenge

I am working on a PHP application that is mysteriously losing the value of a particular session variable. There is only one place in all the code that the variable is set. All comparisons have been confirmed as comparison operators == instead of assignment =. In debugging a vardump shows the variable as:
[“foo”]=> &string(2) “35”
and a second later it becomes
[“foo”]=> ∫(35).

Does the ∫ symbol mean undefined? And if so, why does it still show the value? echo “***”.$_SESSION[‘foo’].”***” shows ****** in the later instance and ***35*** in the previous.

Ah ha! It’s the integral symbol. I just didn’t expect to see that in debugging. Why is my string suddenly an integral?

Update: From the notes on vardump "Now ∫ translates into an integral sign, and since the browser may be inclined to overlook the missing semicolon, you may be seeing integrals where you were expecting &int"

Update: Solved. A locally scoped variable of the same name was being set to null. I’m still unclear on why the session variable would assume the value of the locally scoped variable.

Posted on 2 Comments

What you say and how you act will affect someone’s day

I woke this morning later than intended, 6am instead of 4am, but I did not let that bother me. Today is to be a good day! I wanted Amy to make her bus today so that I could begin programming 45 minutes earlier than days I have to drive her to school. She moved slowly and I drove her to school but I did not let that bother me. Today is to be a good day! After sending Amy off and having a cheery exchange with a friend working the carpool line, I started home. Today is to be a good day! I have more or less quit drinking coffee. Instead I drink hot tea or an occasional hot chocolate but today I brought my mug so I could stop by Weigel’s and have a Kona coffee. If I purchase coffee at the grocery, far cheaper, I drink too much. It is 75 cents I don’t need to be spending, but I did not let that bother me. Today is to be a good day! I waited in the line behind an employee who brought his sons in with him. I commented to myself how much they looked like him then I went onto thinking random thoughts of coding and cutting down trees. After handing my three quarters to my favorite, and familiar, cashier, I started to the door as she spoke, "Don’t look so disgusted. They’re moving as quick as they can." Today is to be a good day! But I did let that bother me. What?! I paused as I could not let this pass, "M, were you saying that to me?" She replied, "Yes, you rolled your eyes like they weren’t going fast enough. I’m only one person and moved them along as fast as I could." But that did bother me. Is today going to be a good day? "I didn’t roll my eyes. You know I’m never in a rush." I left with a darkness hanging over me. The coffee suddenly tasted bitter. But I did let that bother me. How could today be a good day? I replayed the encounter in my mind and realized that as I waited in line, I was trying to palm the three quarters. Since my slight of hand is beyond out of practice, I was probably concentrating too hard and it probably showed in my face. And that concentration was misinterpreted as impatience when I was merely playing. But still I am bothered. I am not sure today can be a good day.

Posted on 2 Comments

Election Night Drinking Games

Shouldn’t we be drinking tonight? Say, every time one of the news guys says that a state has gone to the other guy take a drink. Every time the news guys point out that they are making judgments on very low percentages of returns, take a drink. Every time a state flips, take a drink. Every time CNN puts up that "holograph," take a drink. (Actually its pretty cool in the way that Star Wars knocked our socks off in 1977 but makes us cry today). Every time Wolf Blitzer makes it evident that he wants McCain to win, take a drink.