Critter’s Code

This is a picture of a bridge and a city. I like bridges and cities. They make me smile.

Archive for December, 2009

Dec-16-2009

Case sensitive keys in ColdFusion structures

I know this is old news, but this one bit me last night.

I needed to loop over a structure and return the keys and values in a case-sensitive xml format. Creating my structure like this:

1
2
3
4
5
<cfscript>
qHolder = structNew();
qHolder.userName = "Critter";
qHolder.firstName = "Critter";
</cfscript>

was returning the keys in all caps. (USERNAME, FIRSTNAME)

I had forgotten that if you need to preserve the case of the keys you need to create them like this:

1
2
3
4
5
<cfscript>
qHolder = structNew();
qHolder["userName"] = "Critter";
qHolder["firstName"] = "Critter";
</cfscript>

That will result in (userName, firstName). You can reference them with dot notation and the case will be preserved, so long as they are created using the [""] format.

As you were.

VN:F [1.7.5_995]
Rating: 0.0/10 (0 votes cast)
VN:F [1.7.5_995]
Rating: 0 (from 0 votes)
Posted under ColdFusion, Samples
Dec-5-2009

Carbonite won’t go away (OSX)

I had Carbonite installed as an online backup solution for a little bit, but ended up uninstalling the trial (via the preference panel) due to a lack of extra funding to throw their way.

I noticed this morning that the cpu kept jumping on my mac, so I popped open the Console and saw this:

1
2
3
12/5/09 5:33:04 AM    com.apple.launchd.peruser.501[288]    (com.carbonite.carbonitestatus) Throttling respawn: Will start in 10 seconds
12/5/09 5:33:14 AM    com.apple.launchd.peruser.501[288]    (com.carbonite.carbonitestatus[10584]) posix_spawn("/Library/Application Support/Carbonite/<a class="linkification-ext" title="Linkification: http://CarboniteStatus.app/Contents/MacOS/CarboniteStatus" href="http://CarboniteStatus.app/Contents/MacOS/CarboniteStatus">CarboniteStatus.app/Contents/MacOS/CarboniteStatus</a>", ...): No such file or directory
12/5/09 5:33:14 AM    com.apple.launchd.peruser.501[288]    (com.carbonite.carbonitestatus[10584]) Exited with exit code: 1

I searched around online, but couldn’t really find anything that helped. I searched around to see where things were launched from, and found that /Library/LaunchAgents/ had these two plist files in it:

1
2
com.carbonite.launchd.carbonitestatus.plist
com.carbonite.launchd.carbonitealerts.plist

I do know that you need to unload a plist that has been launched, so I typed the following into Terminal

1
2
launchctl unload /Library/LaunchAgents/com.carbonite.launchd.carbonitestatus.plist [enter]
launchctl unload /Library/LaunchAgents/com.carbonite.launchd.carbonitealerts.plist [enter]

You will have to authenticate after each command. After doing that I was able to delete the files and all was well.

I do want to throw in that I much prefer Carbonite over Mozy. Mozy after a bit of time always seemed to just stop working for me. I’d have to re-install and then it would be good for a bit, etc, repeat. The only reason I uninstalled Carbonite was the inability to dish out the extra cash (side effect of the unemployment movement)  meh.

VN:F [1.7.5_995]
Rating: 0.0/10 (0 votes cast)
VN:F [1.7.5_995]
Rating: 0 (from 0 votes)
Posted under Stuff, mac, osx