CFEclipse/Ganymede Line Number Problem

My tray line numbers weren’t showing up in CFEclipse since upgrading to the Ganymede version of eclipse. My preferences were set correctly. I did a bit of googling but I didn’t actually find the solution until a few links down, so I thought I’d share the link love!

http://blog.critical-web.com/blog/index.cfm/2008/8/3/Enabling-Line-Numbers-In-CFEclipse-1316-On-Eclipse-Ganymede-34

1. In directory
[workspace]/.metadata/.plugins/.org.eclipse.core.runtime/.settings/

2. Edit (or create) a text file called
.org.cfeclipse.cfml.pref

3. Add the following line:
lineNumberRuler=true

4. Restart Eclipse

How to Recover a Deleted File in Eclipse

I don’t know how (yet) and I can’t recreate it, but I swear that Eclipse ate two of my files while in the CFEclipse perspective. Neither of which I had placed under version-control yet. (DOH!) I was able to recover one of them from a nightly back-up.

When trying to figure out exactly what the heck happened, I took a peek at the local history for my back-up file and Eclipse still had the record of my changes up to the moment I lost the file!

Sooooo I re-created my lost file, right-clicked “Compare With” and “Local History” and I was able to re-cover the latest version of my file!

Phew!

Target Practice

Half-Life is the game of choice at work, and sadly I’m terrible at it. I thought I’d try to write a little game using gosu to try and help me improve my accuracy. I just reached a good stopping point and I thought I’d share.

It’s really simple, the idea is to shoot little 20 x 20 “targets” (I’m artistically challenged) before they expire. Missing or letting 10 targets expire will end the game. Next version will include sound, improved visuals and maybe even a couple other fun features if your lucky.

The code is a bit over-engineered but I plan on incorporating parts into some “core extensions” that I’m working on that will hopefully make it a lot easier for me to bang stuff like this out. Finally, as I doubt anyone will ever download this, I didn’t bother to pack it up so you’ll have to have Ruby and gosu installed in order to enjoy it.

Download the code!

PS: I’ve been a Photoshop user for many years, but I used GIMP to make these images and I didn’t even hate it!

JavaScript Deck of Cards

I wrote up a basic model for a 52 card deck of playing cards in JavaScript (using beloved Prototype. I plan on using it to make some very simple card games in the near future. I thought it’d be interesting to post this before I actually used it anywhere so I could take a look at how much it changed after I actually implemented it.

There’s not much to see at the moment. You can just shuffle and get a card dump:


    
        JavaScript Deck of Cards
        
        
    
    
        
    

Download the code!
JavaScript Deck of Cards V1
Current Version

Thoughts on Bolt

As anyone subscribing to MXNA has heard en masse today, the big news ’round the CF Circuit is the announcement of a ColdFusion “development tool” affectionately titled Bolt. (Although Adobe does has a habit of changing titles on us)

Here’s what I’m on about.

1. Will it run on Linux?
This is a requirement for me. Since it’s an “Eclipse based development tool” I assume it will, but I’d like to see it asserted. I don’t mind paying a reasonable sum, but not if I have to wine or vm it.

2. Is it a plug-in or an IDE?
I hope by “development tool”, they mean plug-in. At the time of this writing there are 1101 plug-ins listed on eclipseplugincentral.com and I’d like to be able to use any and all of them if I so choose. If I want to run Spket instead of JSEclipse, I don’t want any grief about it. Also, I like having an agnostic editor. I want one IDE to rule them all. Chances are that if I have to keep eclipse around for my other languages then I’ll probably going to just stick with it.

3. Bloat-i-ness?
I’m a little worried about Bolt being tacked onto eclipse along with a laundry list of exciting! new! features! that I won’t use past the first week, but making for great upper-management selling points. I’m drowning in features as it is. This wouldn’t be such a big deal except that I’ve noticed eclipse can be a memory hog. I know it’s not an accurate measurement but it irritates me when I pop open the task manager on my windows box and see eclipse running well into the hundreds of megs, especially when e does most of what I want with a fraction of the memory and cpu usage.

All I really need out of an IDE is multi language and OS support, code-highlighting, snippets, RDS, auto-tabbing and intellisense. I signed up for the beta; if you can do this better than Eclipse, Adobe, I’m all yours.

Chase Paymentech / CFHTTP Problem

I was working on implementing a ColdFusion payment processor for Chase Paymentech, but I kept running into the same error (which I’ve formatted so nicely using my ruby clipboard format utility!)

<?xml version='1.0' encoding='UTF-8'?>
<Response>
    <QuickResp>
        <ProcStatus>05</ProcStatus>
        <StatusMsg>PTI43,TEXT/XML; CHARSET=UTF-8 is not supported</StatusMsg>
    </QuickResp>
</Response>

I knew that PTI43 was part of the MIME Header Content-Type I was passing, so I did a little bit of poking around in the docs and came upon this. Apparently setting a cfhttpparam type of “xml” “identifies the request as having a content-type of text/xml.”.

In order to send a valid message to chase you have to specify a particular MIME header setting “Content-Type”, which ColdFusion was garbling. Thankfully all I had to do to fix it was switch the cfhttpparam type attribute to “body” in order to fix it.

<cffunction name="Authorize" output="no">
    <cfargument name="vars" required="yes"/>

    <cfset var cfhttp = ""/>
    <cfset var i = ""/>

    <cfheader name="POST /AUTHORIZE HTTP/1.1">
    <cfhttp url="#GetURL()#" port="#GetPort()#" method="POST">
        <cfloop collection="#arguments.vars#" item="i">
            <!--- header variables --->
            <cfif i NEQ "XML">
                <cfhttpparam
                    type="header"
                    name="#i#"
                    value="#arguments.vars[i]#"
                />
            </cfif>
        </cfloop>

        <!--- set the type to "body" NOT "xml"!!! --->
        <cfhttpparam
            type="body"
            value="#arguments.vars["XML"]#"
        />
    </cfhttp>

    <cfreturn cfhttp/>
</cffunction>

I hadn’t run into this problem before, so I thought I’d share!