My first ever “mileage run” completed

Yesterday I did something that I would have never thought I would do. I rode around in various airplanes just for the sake of riding in airplanes—I took a “mileage run”. Mileage runs are tickets purchased for the express purpose of gaining frequent flyer miles or segments.

In my case, I needed segments. Six to be precise. I was six segments shy of making Premier Executive on United Airlines (their middle tier of frequent flyer elite membership). My wife and girls were scheduled to be out of town, so I booked a 6-segment round trip that covered 5 states in 24 hours. I left at 8:30am Saturday morning and touched down at 8:23am Sunday morning. The route that I took is below:

  • Nashville to Denver
  • Denver to Los Angeles
  • Los Angeles to San Francisco
  • San Francisco to Seattle
  • Seattle to Chicago O’Hare
  • Chicago to Nashville

That 5-state, 24-hour flight put me at 60 segments on United and their partners for the year. I have to go back out to San Francisco on Friday this week for a weekend full of company meetings. Having made Premier Executive will allow me to earn double miles on that trip. Between the mileage run and the weekend trip, I’ll earn over 18,000 miles in the space of a week.

I booked the mileage run through CheapTickets.com for less than $310. Based on how many miles I earned on the trip (30% bonus because I was a current Premier level), that came out to 4.7 cents per mile. You can’t buy them outright that cheaply.

As another plus, I got to catch up on some reading and finished two 500-750 page novels that I’d been wanted to read before I got home.

It was an interesting experience. I don’t know that I would do that specific routing again, but I like flying enough that I would definitely consider another run to keep my status.

External monitor solution for your laptop

One of the things that I’ve missed greatly since moving to using a laptop as my primary machine just over 3 years ago is the ability to run multiple monitors. My old tower machine had a pretty hefty video card (for the time) in it that had both DVI and VGA connectors built in. At the time, I ran twin Dell 17″ LCDs off that card and loved the advantages that having twice the screen space gave me.

That all changed when I bought a Dell 17″ laptop and started using that as my primary machine. While you can leave the laptop open and use the internal LCD screen with an external monitor attached to the monitor connector, that configuration has never suited me well. I have this “condition” that things I deal with on a regular basis need to be symetrical (my wife thinks I should be in therapy for it, I think it’s just a matter of wanting things to look “right”), so having a laptop open next to an external monitor just never appealed to me.

Read More

Interesting gotcha with nested loops in ColdFusion MX7

I am working on a project for a client that is running ColdFusion MX7 on their servers and ran into a situation today where a search feature that worked perfectly in my local development environment (which, admittedly is running CF 8) produced some very inconsistent results when run on the testing server.

This particular search has to combine results from not only two different databases, but two different database systems (MySQL and Oracle). In making this work, I had written queries to extract the required information from each database separately, then created a query-driven loop based on one of the queries that was nested inside a second query-driven loop based on the other.

The code I originally wrote was similar to what is below (the client-spefic parts of the original code have been removed).

1
2
3
4
5
6
7
8
9
10
<cfloop query="queryA">
   <cfloop query="queryB">
      <cfif queryA.someField EQ queryB.someField>
         <cfset foo = queryA.someOtherField>
         <cfset bar = queryB.someOtherField2>
         ...do some more stuff...
         <cfbreak>
      </cfif>
   </cfloop>
</cfloop>

This led to getting the correct number of rows generated on the “view” page, however all the rows displayed the same information (as if I had 175 rows of the exact same data) which was obviously wrong. After reading the last comment on this page on Adobe Livedocs, I updated the code to what is below and resolved the problem.

1
2
3
4
5
6
7
8
9
10
11
<cfloop query="queryA">
   <cfloop query="queryB">
      <cfif queryA.someField[queryA.currentRow] EQ 
             queryB.someField[queryB.currentRow]>
         <cfset foo = queryA.someOtherField[queryA.currentRow]>
         <cfset bar = queryB.someOtherField2[queryB.currentRow]>
         ...do some more stuff...
         <cfbreak>
      </cfif>
   </cfloop>
</cfloop>

It seems that in a nested loop configuration such as that, ColdFusion MX7 sometimes “forgets” where it is in each respective loop and that implicitly specifying the currentRow attribute of the query forces it back to its correct spot.

It took a while to nail down just what was causing the problem, but thankfully it was a pretty easy fix.