Federal GSA Per Diem Calculator

In my spare time recently I’ve been working on a small programming project, which is now live at http://www.perdiemcalc.net/. It’s an extension of work I began many years ago when I was at Wytheville Community College (WCC).

History

As I describe on the About page, the issue I had at WCC was a constant back and forth with my business office as I struggled to get the travel documentation correct for the Per Diem allocation.

Finally I dug into the regulations and wrote a web page with a bunch of JavaScript to make the process easier for me and others at the institution. It turned out to be very useful to other state agencies in Virginia, so it has followed me into my current position and to various urls over time. Around October each year as the rates are due to change, I tend to start hearing from anyone from the Attorney-General’s office to the most obscure agency you can probably think of.

The genesis of this new version is that some institutions in Virginia have started to use the Federal GSA rates for travel reimbursement and wrote to me to ask for a version of the calculator that used these rates. There are a lot more localities in the GSA rates and the pop-up approach I’d used before just wasn’t going to work. It seemed like an opportunity to create something with a much wider audience and do some of the re-architecture that had bubbled in my head for many years. With the permission of my employer I embarked on this as an external project.

New Skills

Technically, in the very first version it was completely self-contained JavaScript. I’d been tinkering with JavaScript since it first was made available for Netscape, and this was a continuation of that work. My initial data structures were pretty naive and I had to include a lot of cross-browser hacks, but it worked. I modernized and simplified over the years, but the basic approach didn’t change.

This new version, however, is more or less a complete rewrite. I used it as an opportunity to refresh some skills and revisit the state of the art in some technologies.

agile programming - i'm glad it has a name

My first rewrite was on Google App Engine or more accurately as a Google Apps Script. I got it working pretty well, but ran into some limitations in terms of deployment. I couldn’t for example, deploy it to a custom url. I junked some of that work, but in the process became more familiar with json and how I wanted the design to work.

In the current version there’s some use of JQuery and a fair amount of json. I’ve also taken the raw data from the GSA and put it into a backend database. That part is a simple MySQL backend, with PHP for the dynamic requests. The code is also written in such a way that I can extend it to other data sets and much more easily update the data as new rates are issued each year.

Other technologies I’m tinkering with include Google Analytics (although I have a lot of experience with that already), and Google AdSense. I’m also tracking my work in Trello. I don’t have the code in version control, but I do have a test and production instance for my development work, and keep the code on Dropbox. I’ve become more familiar with my web host in the process too.

Looking Forward

Nothing is ever finished. I have a feature card in Trello prompting me to add Recent Searches as an option for people. At the same time, I’m always looking for something to subtract, to simplify, or to uncomplicate.

I’ve not entirely worked out a support model yet for questions, comments and feedback. For now, I’m happy with less being more. I welcome feedback, but this is a solid design that has worked well over the years. I’m curious to see if people will find this useful. If they do, that’s great, and even if they don’t I’m glad I had a reason to learn some new things.

Selling My Car: 1996 Honda Accord

1996 Honda Accord side viewI’m selling my car. It’s a silver (officially Heather Mist!) 1996 manual Honda Accord with 326,000 miles on it. It’s in pretty good shape. It was in an accident in the late 90s when someone pulled out in front of it, but otherwise it hasn’t had any accidents that I can recall. There are no significant dents. I’ve owned it since new. Maintenance has been regular. For the past five years or more, I’ve been using Auto Experts on Main Street (Blacksburg), so you can always ask there about it.

1996 Honda Accord front view

You don’t get to over 300,000 miles without some issues. Things have been replaced over the years, and I have most of the maintenance records. I honestly don’t recall what’s been done, but it’s the original engine. There are things that need work:

  • The radio mostly doesn’t work.
  • The A/C doesn’t work. Pretty sure this is a simple leak, but I’ve never got around to getting it fixed.
  • It burns (not leaks) a bit of oil, so you have to keep an eye on the oil.
  • Third gear sometimes requires double-clutching. This means it probably needs a new transmission fairly soon.
  • There is no rust, but the paint has faded in places.
  • The automatic door locking is flaky.
  • The engine light stays on, but it’s been on for the past five years!

The miles are mostly highway miles. State inspection was done January, 2014.

I will only sell it in person, to someone local, in cash for $2,000 (or thereabouts). I will not provide the VIN online, but will provide it in person if you stop by.

540-200-8630 or david@carter-tod.com

Soccer in Blacksburg

If you search for soccer (football/calcio/futbal/fútbol/Fußball) in Blacksburg, you will probably quickly see that the high school has a great tradition of success for both girls and boys. If you look at Virginia Tech, the women’s team is excellent, the games are free, parking is good, and they are excellent to watch. The men’s soccer team isn’t quite so good at the moment.

If you want to play soccer as an adult, what are your options?

If you are a student at Virginia Tech, I guess you can play intramural sports, which for internationals who might not be familiar with the term, is recreational sports (“within the walls” I suppose). I never did when I was at VT, but that was probably more out of ignorance than anything. I have no idea what those games are like.

If you reside in the New River Valley, then the other options are a pick-up game, or playing in the New River United Adult Recreational League (NRU) – see below for more details. NRU do not, in my opinion, do a great job of advertising its existence. Their web site also leaves some things to be desired in terms of linking. Hence this post.

New River United also runs most of the kids recreational soccer in the NRV (there’s a Christiansburg setup too), and they have competitive teams for kids as well. I’ve coached and been involved with the kids recreational soccer and enjoyed it. It’s very popular and the fields around town are filled on a Saturday morning.

Pick-up games

I have never really cottoned on to where the pick-up games tend to be, but two locations that I know of where people gather include Nellie’s Cave Park, and the field behind the Food Lion on North Main (park behind the Food Lion and walk up), which is also known as Shenandoah Field. Nellie’s Cave Park tends not to have scheduled games, so it’s often available. Note that all the goals in town should be locked when not in use, because they mostly belong to NRU and they have to lock them for insurance purposes. It’s very frustrating as a casual player, but you just have to live with it.

Adult Recreational League

I play in the Adult Rec League, and have done for many years, perhaps a decade or more now. I played in high school in England where I was pretty good, but not great. The league is usually split into Sport and Competitive. At a very broad brush, Competitive (or the A league) tends to be under-30, skillful and athletic-kids who played in high school or maybe even college. Sport (the B league in which I play) tends to be older, less skillful and less athletic (or at least two out of three of those).

If I look at the team I currently manage/captain (The Goats), we have 8 in their mid-20s, 4 in their 30s, 3 in their 40s and one 60-year old(!). That’s a bit skewed for us historically. I’d say we have more 30 and 40-year olds usually. Our players are locals, graduate students, some undergrads, and faculty. We often have some international students on our teams. Not a ton of women play, but some certainly do. The focus is on having a fun, safe game.

We typically play an 8 game regular season in both Fall and Spring with a tournament at the end. We usually play one game a week, skipping when there is a break at VT. We tend to play on the weekends and weeknights because a lot of us have jobs, and the fields we usually use are owned and used by the local school system. NRU is building its own field near the airport which everyone hopes will be open soon. The fields we use are not great, but not terrible. There’s no budget for improvements really. The ground around here tends to be quite full of clay so the fields can get quite hard when they are dry. See the recent update posted here-we now primarily play on VT’s artificial turf!

One thing I wondered when I first signed up was why it seemed so expensive to me for so relatively few games. Part of the answer is that we play full games with three qualified referees. They generally are very good, and having them makes for good games. In terms of the rules, it is pretty standard, except that substitutions are unlimited, and we play with no slide tackling allowed. You can sign up as an individual and get assigned to a team if you are not aiming for a specific team.

Other options nearby

Roanoke has a number of good options. My understanding is that there is a women’s recreational league and a recreational league. I have heard there is a league for older players too, but I’m not sure where to find the details on that. I believe serious players involve themselves with the Roanoke Star Club, but there’s Valley AFC for kids too.

Indoor soccer

If you want to play indoor soccer (futsal) there are two basic options locally. There’s a winter league at the Blacksburg Community Center (Blacksburg Indoor Soccer League – BISL), and during the same time period there is an indoor league at the Tech Sportsplex near the mall area in Christiansburg. As an old geezer, I tend not to play because it’s a bit harder on my knees and can be quite fast, but the quality can be very good.

Flying with a red feather

So I just got back from Las Vegas last week, and no, I didn’t get the red feather there. It did not drift away from a showgirl’s boa.

I flew from Roanoke to Chicago and from there to Vegas. As I got to my seat on the flight from Chicago I noticed that there was a young African-american girl sitting in the window seat. There was no-one in the middle seat and I had the aisle. She was young, in sixth grade as I found out later which would make her around eleven or twelve. In my experience kids in the States don’t have ages, they have grades.

She looked at me. “Can I sit there?” She gestured at my seat.

I laughed. “I need it so I can stretch my legs.”

“What about that one?” She pointed at the middle seat.

“I guess. Why?”

“I’m scared of heights.”

I debated a bit with myself. A middle-aged white guy. A scared black girl. She reminded me very much of my own daughters. “Sure.”

We talked. We talked a lot. She talked a lot. She was scared of heights, but not exactly of flying. She was flying by herself from Akron to Las Vegas to live with her dad for a year, after living with her mom for a year. Her aunt was in the hospital having a baby (or babies) as we flew. Her dad worked with planes and had his own (really?). Another aunt had lost a leg in a plane accident. She was so nervous and anxious that she had puked in the bathrooms after her flight from Akron. She was being monitored by the flight attendants and I presume being met in Vegas. They checked on her with a second glance at me. “That’s your seat at the window, honey.”

“She’s scared” I replied before stopping to think through what they were really asking.

She wrapped her arm around mine as we took off and tightened it ferociously.

She fell asleep.

I never knew her name. The flight attendant mangled it when checking on her.

I told her about my daughters. My youngest who loves basketball. The eldest who loves singing.

We talked about the plane. I told her all about how they couldn’t just fall out of the sky, how they work with only one engine, and how air could be bumpy. That wasn’t nearly as effective at distracting her as my being exaggeratedly grossed out by her tales while we were landing.

She told me about her dad.

Near the end she showed me a cut on her foot where she’d stepped on some glass her mother had broken in the kitchen. It looked like it needed some care.

“You didn’t see a doctor?”

“No.”

She’d not been good in school, she told me with a bit of a shameful grin, as if I shouldn’t really like her, nor enjoy her company.

She showed me some beautiful paper flowers she’d made, and I met her imaginary friend.

My mind filled in too many blanks.

When the time came, we parted with few words. I left her on the plane. She looked in her bag of random things and quietly gave me the red feather as a keepsake.

I put it in a safe place.

Reverend Sam Franklin

This is the Reverend Sam Franklin. This guest book doesn’t have long left, and while the messages are heartfelt, there’s not a lot there. He went by “Uncle Tom” apparently.

I met him once last year, just before he passed away.

I’ve been meaning to write this post for a while and have had the crumbs of it sitting in a draft since I met him. Last year I was at the mall in Christiansburg, VA with my kids. I had left them to their own ends for a while, grabbed a coffee and had sat down in a mildly comfortable chair in the middle of the mall. The seating made a small square with a couple of chairs on each side.

On one side an old man sat in a wheelchair. Opposite me another man sat. After a minute or two the old man spoke up, “If I was to ask one of these people here how old they thought I am, what do you think they would say?”

So, a couple of thoughts went through my head if I’m being entirely honest. Firstly, that I might be in for a crazy old man diatribe that I’d need to gently extricate myself from, and secondly that there was no way I was going to give a straight answer.

The man across from me smiled, but didn’t say much, umm-ing and ah-ing in a jokey kind of way. The old man insisted, “Go on, guess.” I hazarded a silly guess, “Fifty-five?” We bantered a bit more. I guessed a little closer, “Seventies?” I smiled, “You know, I’m not going to even try to get it right. It’s not very polite, is it?”

“I’m one hundred and four.”

Crikey…definitely crazy old man territory. There’s no way a man this articulate and seemingly healthy is that old, despite the wheelchair. We chatted some more and I don’t really remember why, but I moved over to sit next to him. I do remember that his fingers were thick, swollen and mottled with the years.

An hour and a half later, his middle-aged granddaughter and her husband (from Maryland?) came back to pick him up, and I was wiser. “You wouldn’t believe he’s one hundred and four, would you?!” they said. “Oh, I would” I replied.

I’ll admit to not understanding everything he told me. A Southwest Virginia accent, old age, and my own transatlantic origins made some things hard to grasp, but I still remember some of the stories he told me. I wish I remembered more, and I wish I’d written this last year when I intended, but I also hope that maybe one day someone will find this and he’ll be remembered. I’m sure I’ll get some of this wrong too.

In July 1916, the New River flooded. He would have been ten years old then. His family was living in Carroll County at the time, as best I can tell, right down by the river on the flood plain. It came at night. They barely had time to get him and his siblings out of bed, and to let the animals loose before the house was filled. The waters came well up to the second floor.

I wish I remember more, but I’m thinking that they found a friendly farmer and slept in a barn for a while after that.

The next year (1917), the river froze (here too), and the ice dammed up the river destroying bridges.

Some time after that they moved to Radford, VA, and I’d guess around then he started at the Radford pipe works which was owned by the Lynchburg Foundry (his obituary implies he worked in Lynchburg, but I don’t think he did). He worked in Radford for thirty-six years. At some point, perhaps during the war, he went to Tennessee to train to make aircraft parts, which should have enabled him to make a bit more money.

He took himself and his training to Atlanta after that, where I think he had some kind of supervisory role. He told me some tales of a crazy ex-con who he took a chance on. That was a bet that didn’t work out.

During all this time, he was a minister at various places, including a church in Ellett Valley, and they had ten kids. When we spoke his younger brother was still alive and living by himself. He had buried his son recently. I didn’t want to ask about his wife.

He did tell the tale of the time he saw one man shoot another six times. It was connected to his church, and he was the one who ended up taking the gun off the man who did the shooting. There was a court case of course. I seem to recall though that there was a sense that the shooting may have been justified and as a result the Reverend may have been careful with the truth when the time came.

…and that’s it. One hundred and four years. One and a half hours last year. It really cannot have been long before he passed away. It was a great conversation that meandered a fair bit, and was hard work sometimes, but so worth it. I couldn’t quite convey it to my kids when they came to find me, nor to my friends and colleagues.

He seemed a decent man who lived a decent life.

It was a pleasure to meet Sam. I’m glad I had that time to sit and listen to him. I’m glad he persisted in talking to me and shared some of his life with me. When my race is run, I hope someone takes the time to tell a tale or two about me. I hope there are some good tales to tell.

Batch Move Users to Organizations in Google Apps

Just a quick note. I write our own integration code for Google Apps in part because of our scale, and in part because I started integrating our systems before GADS (Google Apps Directory Sync) existed. The code mostly just works, so I don’t look at it very often, and I’m not a strong python coder.

Recently I need to move a fairly large number of users into an organization, but there’s no way to do this in the GUI as a batch job, so I needed to code it. I found the docs, but mostly I have to go through a lot of trial and error. Here’s the ultimate shape of the code I came up with, and an explanation. I’m just writing a quick utility script here so it’s nothing fancy:


#!/usr/bin/python

import gdata.apps.organization.client

# get a client and log in as an integration user
ouclient = gdata.apps.organization.client.OrganizationUnitProvisioningClient(domain='yourdomain.com')
ouclient.ClientLogin(email='adminuser@yourdomain.com', password='adminuserpassword', source ='apps')

# grab the customerId of the integration account - this is new
clientid = ouclient.RetrieveCustomerId()
customer_id = clientid.customer_id

# you need the customer id to do anything, I think. Read the provisioning docs.
# Objects that are camelCase in the XML, change to underscore in python
# I have never found that documented anywhere so I figure it is something you just know!

ouclient.move_users_to_org_unit(customer_id=customer_id, org_unit_path='nameorpathofOU', users_to_move=['username@yourdomain.com'])

#users_to_move is a list, up to 25 email addresses. See the docs on move_users_to_org_unit.

Virginia Tech Hokies Women’s Soccer

I tweeted about this the other day but I’d like to expand a little.

Last year I attended a game or two, but this year, I’ve been to several Hokie soccer games: at least one of the men’s team and several of the women’s. It has been a lot of fun. There’s a smallish crowd, which is enough to make it fun, but not the insane size of the football games. It’s free to get in and parking is easy.

I’m going to give the men’s team another chance since they didn’t really impress in the game I saw, but I am really enjoying watching the Women’s Soccer team. They are extremely skillful and have many of the qualities of a great team, but they are not quite converting their dominance into goals as much as I think they should.

I thought they were unlucky in North Carolina (let’s just say that I didn’t entirely agree with the refereeing) and that they dominated Boston College for much of the game. They do seem to be a bit vulnerable on set pieces.

Their ball movement, patience, discipline, possession, and general talent are all fantastic. They play a little like Swansea in that they’ll typically move the ball out from defense on the ground with calm, precise and well-controlled passing. Several times, I’ve seen their central defensive players turn the opposition inside out before making a simple release pass. They are very good at relieving pressure in that regard.

The team seems to be setting up in a 4-1-3-2 formation and their midfielders are impressive. The one caveat is that they feel unimaginative on offense in the final third. What I have seen to this point are through balls, long balls, and runs that tend to be vertical (straight up and down) with few overlaps from midfield and less diagonal movement. Several times I’ve seen midfielders creating space in advanced positions by fantastic passing and then it fizzles out, either in a wayward shot or a tackle.

I’m not sure of the underlying reason. It could be intentional positional discipline, but the last game I saw there was at least one occasion for a clear overlapping run by an outside midfielder and the player just stayed in place. The other part of the equation is the offensive players themselves who seem a little static or “one note”. If you aren’t faster than the defense and being quick is your thing, then your options close down. If being tall is your thing, then you need service from the wings.

My understanding of an attacker’s role (and I say this both as a fan, and primarily a defensive player myself), is that it is at least in part to make defenses constantly worry about where you are, to get on their blind side, to get into positions where they can’t see both you and the ball, and to make runs off and away from the ball to draw the defense into bad positions. That off-the-ball mischievousness and creativity is what I think I’m not seeing. I’m not sure of the solution from a tactical point of view, but the team feels only a fraction shy of being a truly great team. They could easily have beaten North Carolina and Boston in my opinion.

Either way, they play again this Sunday, and I’m planning on enjoying the game, whatever the result.

Ah, !@$# it!

I’m quite a fan of ufyh (warning: language NSFW), but less for the 20-10’s or the concerted effort to fix bits and pieces. I definitely see the utility of those and do something along those lines occasionally (those baking soda and vinegar volcanoes really work), but really I think it’s as much about a state of mind that says, “^@#% it! This thing isn’t as big a deal as my stupid brain is making it. Do it now!”

Cases in point:

  1. I’ve had a chip in my windshield (windscreen?) for month or so now. Every time I see it, it niggles me. I really need to do something about that. In a very stupid way, it was chipping away at my self-esteem every time I saw it. It was my car telling me that I’m too incompetent, too lazy to get around to fixing a stupid chip in a stupid screen, which could be a REALLY BIG DEAL if and when the windshield broke because I hadn’t got it fixed. It’s nuts. Brain’s are stupid that way. Today, I finally got to that point, and in a five minute phone call arranged for my insurance to get it fixed for free tomorrow in my driveway!
  2. Daughter #2 never puts her laundry away. She’s allergic to it, I think. As a last resort, I put her on a timer last week. It took her 3 minutes…well, 6 minutes to get it into her room and in the drawers. 6 stupid minutes. Staring at that %@#%ing pile of laundry had been eating away at me for weeks.
  3. I had a caulking gun sitting in my bathroom for a month or two. I needed to fix the caulk around the bathtub. Two bloody months reminding me of what I hadn’t done. When I finally was willing to say “@%#$ it! Let’s do it now!” it took me less than five minutes to lay a bead where it needed to go. You may well (and correctly) claim that I probably did a half-ass job, but it’s done, which is a heck of a lot better than “not done and mocking me.”

The thing is that this kind of thing happens all the damn time, but a slight shift in perspective can really help move things along. There’s a really annoying story about starfish stranded on a sea-shore. You know the one. I don’t think in those terms, but doing something, anything, begins to move things in the right direction. I pick up a couple of dust-bunnies from the floor. It’s nothing, but you know, there are now two fewer dust-bunnies. I put away the dishes. It’s nothing. It takes two, maybe three minutes, and makes hardly a lick of difference, but now I can actually do the dirty dishes and fill the dishwasher. These things seem like they count for nothing, but they actually move things forward, even if it’s only an inch at a time. It’s still an inch in the right direction and pretty soon you realize that you’ve cleared space both mentally and physically.

I’m not so damn special that it has to be right, and I have to look perfect. I should forgive myself and be willing to get it wrong, to screw up, to apologize, to fix, to move forward. The thing done is better than the thing not done. The email sent. The phone call made.

I’m not going to do the exact exercise that I should, but any exercise is better than no exercise. I’m not going to eat in the healthiest way possible, but I’ll add something to the mix, and that’s better than not.

So anyway, this post is a reminder to myself that sometimes you have to be willing to ignore that over-analytical brain and say “@#%& it! Do it now!”

Oh…and make your bed!

Triathlon

sotto voce: one of a series of long unfinished posts that I’m just throwing out there.

So, I completed my first (sprint) triathlon in June. A Roanoke Times news report is available for some while.

There are some pictures online, but I’m not going to link to them, mostly to spare you the sight of my astonishingly blanched farmer’s tan. I do have a picture of me in the bike-to-run transition, which is, I’m told, not bad.

Bearing in mind that this was immediately after falling and grazing my elbow quite badly, I’m doing okay.


It’s many months later, and post Lyme’s disease and appendicitis, I’m sure I’ve forgotten many of the little lessons I could have taken away from the experience. Let me think…

  1. have flip-flops to walk around in after dropping off your gear in the transition area, and a small bag for glasses(?) or other stuff that you can leave by the pool and pick up later after the race.
  2. the bike section is the longest section in terms of time, and as a result where there is room for the biggest improvement, i.e. a 10% improvement in a swim time would be less than a minute and would require a lot of training, 10% in the run about 3 minutes, but 10% bike improvement would be about 5 minutes.
  3. I don’t have my own fancy bike and if I want to keep doing this I’ll need to buy one 🙁
  4. The camber on the run was quite tough. I don’t know whether I suffered more due to the tick bite on my ankle (and swelling), or perhaps somewhat newish shoes, or just the length of the race, but my feet hurt for a while afterwards.
  5. I was in pretty reasonable shape at the end
  6. I think I’m in better shape now than I was then. My achilles is a bit sore these days, but fewer other things ache or hurt…well, except my knees sometimes.
  7. loosen both your pedal cages before getting to the end
  8. getting up early was a bit of a struggle
  9. those gel packs do seem to make a difference

Nothing else springs to mind, but it was fun, and I’m glad I did it. In general terms, doing multiple sports does seem to lessen the risk of injury and develop more balanced fitness. I’m still biking, running and swimming, although I’ve no concrete plans for another race, and I’ve added a little bit more strength work recently through some body weight exercise. I think that’s helping. I’m trying out tracking with Fitocracy too.