Back from a weekend in Mammoth




Back from a weekend in Mammoth

Originally uploaded by kldodge

On my way home from a weekend in mammoth, and even coming up to april they still have a good amount of snow. Yesterday was windy, the peaks were getting 30-40 mph winds and it was a bit icy towards the top because of it. Last night a storm rolled in and we wound up riding 5″ of fresh powder today. The mountain is still in good shape, a few face runs are closed due to lack of snow but other than that its wide open. Well see if april brings more snow, but if you havent gone yet there still are at least a couple of weekends left!

HTC Touch and the must have upgrades for it!

I recently dropped my phone, and this time it didnt work when I turned it back on. So, picked up the HTC Touch - Sprint’s latest Windows Mobile phone. It’s an awesome phone out of the box, but tweaking it for the last month or so I’ve come across two awesome applications for it.

 

 

The first is SPB’s full-screen keyboard, a replacement for the standard windows mobile keyboard.
This works really well with the Touch when you turn the phone to the side to use it, I’ve found texts and emails super easy to knock out while waiting in the drive-thru. At $10, its a steal in my book and if you want to try it out they allow a 15 day trial on all of their products. Beware, I was so hooked on this keyboard that when my trial expired, I didn’t even want to send a message because the standard keyboards are just that crappy.

The other app I found was also from SPB, their Mobile Shell which changes the entire look and feel of Windows Mobile 6. It adds a grip of new screens, shortcut buttons, and transitions to make the phone just all around so much cooler. The price is a little steep at $30, but as I continue to use my trial I’ll debate if it’s worth the cost. Enjoy!

Ordering the output of a Coldfusion Structure

I recently came across a problem when trying to output a structure using a loop. Although I had ordered my SQL and my input into the structure, the output was in a completely different order. This is due to the hash mapping that structures use, and although it proves well for performance it suffers in ordering the output of your data. First, I created my structure and then looped through my query and incremented the counts in my list, based on the position:
<cfset objCustomers = StructNew()>
<cfloop query="customerQry">
<cfset cntList = "0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0">
<cfif custName NEQ "">
<cfset strCustomer = "#custName#">

<cfset custExists = StructFindKey(objCustomers, "#custName#")>
<cfif ArrayIsEmpty(custExists)>
<cfif customerQry.custStatusID EQ 1 AND customerQry.custProgramID EQ 8>
<cfset badCustomers = listGetAt(cntList, 2, "|")>
<cfset badCustomers = badCustomers + 1>
<cfset cntList = listSetAt(cntLIst, 2, badCustomers , "|")>
</cfif>
<cfset totalCustomers = listGetAt(cntList, 1, "|")>
<cfset totalCustomers = totalCustomers + 1>
<cfset countsList = listSetAt(countsList, 1, totalStudents, "|")>
<cfset objUniversities[strUniversity] = "#countsList#">
<cfelse>

<cfset cntList = objUniversities[strUniversity]>

<cfset totalCustomers = listGetAt(cntList, 1, "|")>
<cfset totalCustomers = totalCustomers + 1>
<cfset countsList = listSetAt(cntList, 1, totalCustomers , "|")>
<cfscript>
StructUpdate(objCustomers, "#custName#", cntList);
</cfscript>
</cfif>
</cfloop>

So, now that we have our structure built how do we output the data so it orders by customer name? If you loop through the structure, you cant; it will output in a very different order. What you first have to do is manually create a query and load this structure data into it:

<cfset custCountQry = queryNew("custName,totalCustomers, badCustomers")>
<cfloop collection="#objCustomers#" item="customer">
<cfoutput>

<cfset custCounts = "#StructFind(objCustomers, customer)#">

<cfset totalCustomers = listGetAt(custCounts, 1, "|")>
<cfset badCustomers = listGetAt(custCounts, 2, "|")>

<cfset queryAddRow(custCountQry)>
<cfset querySetCell(custCountQry,"totalCustomers", "#totalCustomers#")>
<cfset querySetCell(custCountQry,"badCustomers", "#badCustomers#")>
</cfoutput>

Now, you will have a query you can perform SQL on and order your results:
<cfquery name="getCustomerSummary" dbtype="query">
SELECT *
FROM custCountQry
ORDER BY [custName] ASC
</cfquery>

You can now use a cfoutput query to return your results in order!

I’m off to Canada!

I’m just packing up the last of my things before I leave for Whistler. The weather forecast is sunny with no wind for tomorrow, couldn’t be better conditions for heliskiing! It hasn’t snowed in the last couple of days, so I’m assuming avalanche danger is pretty low as well. I’ll be back next week with some awesome pictures! Have a great week guys!

2008 Resolution: Consistently backup my data

One of my many New Year’s Resolutions for 2008 is to consistently make backups of ALL of my data. I currently have a 160GB myBook external drive I throw all of my music/movies/photos on, but there are important items on my computer that I really don’t backup. Why? Well, laziness would be the best way to put it, but also because of the lack of space. I started to realize in the past couple months that if my laptop died I would lose some pretty important stuff. Especially with graduate school around the corner I definitely don’t want that happening. So, I came across a 500GB myBook drive for $100 yesterday with automated backup software and swooped on it.
Western Digital MyBook - 500GB It’s pretty amazing how quickly storage has dropped in the last two years or so. I bought my 160GB myBook for over $100, and now I’ve more than tripled that amount of space for the same price. So one resolution down and we’re only a week into the year. Plus, these drives should stack pretty nicely together (named because they are shaped like volumes for a bookshelf). Total storage now is 760GB, I think that should be good for awhile.

Next »