Troy's Blog

Life, family, work, and my experiences with products, services, stores, and the people I encounter each and every day.

My Photo
Name: Troy Pullis
Location: Minneapolis, Minnesota, United States

Tuesday, January 30, 2007

JC's February show cancelled

I know there are 1000's of Johnny Clueless fans out there. Ok, maybe I'm exagerating a bit. But if you fall into the small minority who still love JC and want to see what few appearances they make, you'll have to wait until March. They cancelled Feb 10 at Dailey's Pub in Mound, and I got a confirmation email from the band and it was removed from their website. Soooooo, the next official show is March 24 at The Dugout Bar in Mahtomedi. Don't miss that one!

Friday, January 26, 2007

Bellagio Fountain Magic

I took this short video using our digital camera. The Bellagio Hotel-Casino water fountains show was incredible - better than I expected! A must see if you visit Las Vegas.

Thursday, January 25, 2007

Leap Year 2007 Calendar

I bought a new 2007 calendar at Walgreens a few weeks ago to hang in my office at work. Today I went to check on a date in Feburary, and sadly found no page for Feb. The next page was April. Flip it again, and you get May, flip again and another April, then another May. Somehow I got a bad calendar with no February or March, and two pages of April and May. So I went to the publisher's website, to find their contact info, hoping to call them and request a new one. Unfortunately, they don't list their phone number, so I had to do more digging. A quick google search found it. Leap Year Publishing is 978-688-9900. I called and they are kindly going to mail me a new calendar.

Tuesday, January 16, 2007

Secret to showing/hiding table rows

Today I learned about showing/hiding content on a page. All that is needed is wrap the content in a div tag, and use the following javascript to toggle its display.

document.getElementById('stufftohide').style.display = 'block' //shows it
document.getElementById('stufftohide').style.display = 'none' // hides it

<div id="stufftohide">
here is my content to show and hide
</div>


However, this technique doesn't work when trying to toggle table rows. I did some digging and found a few blogs that explained the secret. Wrap the rows you want to show/hide inside a <tbody> tag group, and use "table-row-group" in place of "block" to show the rows. Here is a code snippet that works.

<input type="Button" value="Show" onclick="javascript: document.getElementById('stufftohide').style.display = 'table-row-group';">
<input type="Button" value="Hide" onclick="javascript: document.getElementById('stufftohide').style.display = 'none';"><br />
<table border="1">
<tr>
<td>row 1, cell A</td>
<td>row 1, cell B</td>
</tr>
<tbody id="stufftohide">
<tr>
<td>row 2, cell C</td>
<td>row 2, cell D</td>
</tr>
<tr>
<td>row 3, cell E</td>
<td>row 3, cell F</td>
</tr>
</tbody>
</table>

Netflix announces Watch Now

Yesterday Netflix announced a new service for subscribers: PC movie streaming. There is no extra charge and you get as many hours as your monthly fee. So if you pay $17.99 for 3 out at a time, you get 18 hours of streaming each month. Check out this great Hackingnetflix blog entry that has a video preso explaining the new service and much more details. I think this is a great extra they are throwing in for customers, now I just need to wait for my "Watch Now" tab to get activated at the Netflix site.

Friday, January 12, 2007

Naming a ColdFusion variable beginning with a number

The naming rules for creating ColdFusion variables are found here in the LiveDocs. The first bullet point is

  • A variable name must begin with a letter, underscore, or Unicode currency symbol.
However, I am doing some integration with SalesForce.com, and they have custom variables that are named like "00N30000000dqFd". Now, if I want to name a form variable with that name, and do some validation before posting the form, I was running into problems. Here is some sample code and comments that outline my struggles. If you comment out the 3 spots (lines 3, 8, and 13-15) that throw errors, the code will run and you will get the 3 cfdumps.

<cfset field = "00N30000000dqFd"> <!--- here is a variable that we assign a value starting with a number --->

<cfset 00N30000000dqFd = "test"> <!--- variable starting with number throws error: "00N30000000dqFd," on line 3, column 8, is not a valid identifer name. --->
<cfparam name="form.#field#" default=""> <!--- paraming "00N30000000dqFd" in the form scope is ok --->
<cfdump var="#form#" label="after param">


<cfset "form.#field#" = "new value"> <!--- doing this cfset method throws an error: The string "form.00N30000000dqFd" is not a valid ColdFusion variable name. --->
<cfset form["#field#"] = "1st value"> <!--- doing the structure method sets the variable ok --->
<cfdump var="#form#" label="after assigning">


<cfif IsDefined("form.#field#")> <!--- doing this IsDefined() method of checking if the variable exists in the Form scope throws an error: Parameter 1 of function IsDefined, which is now "form.00N30000000dqFd", must be a syntactically valid variable name.--->
<cfset "form.#field#" = "2nd value">
</cfif>
<cfif StructKeyExists(form,field)> <!--- doing this structure key check method is ok --->
<cfset form["#field#"] = "2nd value">
</cfif>
<cfdump var="#form#" label="end of demo">

CFDump output
after param - struct
00N30000000DQFD [empty string]

after assigning - struct
00N30000000DQFD 1st value

end of demo - struct
00N30000000DQFD 2nd value

Monday, January 08, 2007

Selling Bali 2" window blinds

Last night I posted 2 sets of window blinds for sale. We had these in our family room windows, but when we remodeled in 2004, they didn't fit the new windows that were installed. If they'll work in your home, this is a good deal on some nice Bali brand vinyl blinds. Read the Craigslist post for full details.

Saturday, January 06, 2007

Join the Tax-cut coalition

Jason Lewis, talk radio host on 100.3 KTLK, has started a new tax-cut petition. If you want to tell your legislators that you are tired of the high income taxes in MN, or push to lower all the other taxes that gouge our pocket books, then please sign here.