I've got a golden ticket...

I had to laugh when I read this post over on Slugworth's, er... I mean Vince Bonfanti's blog.

"It would appear that the tables have turned somewhat. The major "new" features of CFMX 8, certainly the first ones announced by Adobe--CFIMAGE, .NET integration, CFTHREAD--are playing catch-up to BlueDragon. Has BlueDragon 7.0 caught and surpassed CFMX? I think the evidence is clear that it has."

I guess it's easy to think you're some sort of genius when your product is a knock-off of someone else's hard work. All New Atlanta needs to do is outsource their coding to China and they'll be set.

I've always wondered how New Atlanta is able to sell their product, I'm sure there's a loophole somewhere that has allowed for this.

Of course, New Atlanta is about to have another epiphany of new ideas when ColdFusion 8 is released this year.

This was just posted and it cracks me up even more!

"...the company that pioneered CFML innovations such as standard J2EE WAR/EAR deployment, image manipulation (CFIMAGE), .NET integration, and multi-threaded programming (CFTHREAD) offers their vision of the future."

Pioneered!?! Wow, the delusions just keep getting bigger. Vince you just made me shoot my Diet Coke out my nose. You can bet I'll be in the audience at CFUnited for that one.

And for those of you working hard at Adobe, keep up the good work.

Think I'm wrong? Let me know. I assure you, that unlike New Atlanta, I won't ban you or delete your comments.

Worst ASP Code I've seen...

I don't know what it is lately, but I've just been running into a lot of code that reminds me of the County Land Fill. And that's saying almost being a little too hard on the Land Fill. Let me tell you, that place smells pretty bad. This time, it's a little ASP and some serious abuse of the case statement.

Select Case strApplicant_industry
               Case "1"
                     strApplicant_industry_1 = "SELECTED"
               Case "2"
                     strApplicant_industry_2 = "SELECTED"
               Case "3"
                     strApplicant_industry_3 = "SELECTED"
               Case "4"
                     strApplicant_industry_4 = "SELECTED"
               Case "5"
                     strApplicant_industry_5 = "SELECTED"
               Case "6"
                     strApplicant_industry_6 = "SELECTED"
               Case "7"
                     strApplicant_industry_7 = "SELECTED"
               Case "8"
                     strApplicant_industry_8 = "SELECTED"
               Case "9"
                     strApplicant_industry_9 = "SELECTED"
               Case "10"
                     strApplicant_industry_10 = "SELECTED"
               Case "11"
                     strApplicant_industry_11 = "SELECTED"
               Case "12"
                     strApplicant_industry_12 = "SELECTED"
               Case "13"
                     strApplicant_industry_13 = "SELECTED"
               Case "14"
                     strApplicant_industry_14 = "SELECTED"
               Case "15"
                     strApplicant_industry_15 = "SELECTED"
               Case "16"
                     strApplicant_industry_16 = "SELECTED"
            End Select

I know, it's painful to look at that. So why do I do it? So you know you're not alone in dealing with code that would make a shit sandwich look appetizing. Unfortunately many of us are unable to just scrap this crap and are stuck working with the code. My advice, order this by the case. Anyone want in on a group order?

I'm teaching my girlfriend ColdFusion...

This has been a goal of mine for a while now. She's always been fascinated by what I do. Why? Because she's a Geek too, only her little Geekdom consists of genetics and science.

She's reading the CFWACK book by Ben Forta right now and has lots of good questions, which I'm always more than happy to answer.

It's kind of odd though to look over and see reading that monster of a ColdFusion book.

So, wish me luck, not that I'm gonna need it. (She's a smart one!)

Seeing Double, Detecting Duplicate Logins with Flex and ColdFusion...

I'm working with Kevin Kazmierczak on a Flex and ColdFusion project with Universal Mind and the need arose for us to be able to detect duplicate logins. Specifically, if a user logs in a second time without logging out of their initial session, we need to know. If the user does login twice, their ColdFusion session needs to be killed and they need to be logged out of the Flex application.

I'm going to detail the ColdFusion/Flex Data Services side of things and Kevin has written about the Flex portion on his blog.

The ColdFusion portion ended up being very simple, yet, very effective. We created an application variable called usersLoggedIn and made it a structure. This is done in the onApplicationStart method of Application.cfc.

<cfset application.usersLoggedIn = StructNew() />

Every time a user logs in, we store the user value object in the usersLoggedIn structure with their username as the structure key. We also added a unique session id to the user value object. We are using a UUID for this unique id.

<cflock scope="application" timeout="5" type="exclusive">
<cfset application.usersLoggedIn[ arguments.userName ] = userVO />
</cflock>

Now, we need to be able to tell the Flex application when we detect a duplicate login. This is where we leveraged Flex Data Services. We're using the Flex Message Gateway (NOTE: ColdFusion Enterprise is required to leverage the Flex Message Gateway) to send a message to Flex clients when we detect a duplicate login.

<cfif StructKeyExists(application.usersLoggedIn, arguments.userName)>
<cfset msg = StructNew() />
<cfset msg.body = "Double Login Detected" />
<cfset msg.headers = StructNew() />
<cfset msg.headers.SESSIONID = application.usersLoggedIn[ arguments.userName ].sessionId />
                     
<cfset msg.headers.COMMAND = "logout" />
<cfset msg.destination = "ColdFusionGateway" />
<cfset SendGatewayMessage("Flex2CF",msg)/>
</cfif>

When a user logs in, we are checking to see if they are already in the usersLoggedIn structure. If they are, we construct a message to send to the Flex clients with the users unique session id.

If you need help setting up the Flex Message Gateway, check out the Adobe docs. No need for me to reinvent the wheel.

That's all from the ColdFusion side of things, if you want to see what happens in the Flex application, head on over to Kevin's blog.

Anyone remember this...

I'm extremely busy with Flex and ColdFusion work, in fact I'd probably have a hard time telling you what day it is. I've seen both oceans in the past week and don't remember what my own bed looks like.

It should slow down in another week or so. But in the mean time, here's a little trip down memory lane.

Anybody remember that logo?

By the way, if you are waiting for my 360Flex preso and code, it will be up this weekend, I promise.

A few more conferences...

I've been really busy lately, but here's a few more upcoming conferences that I'll be speaking at.

At cf.objective() I'll be speaking about ColdFusion and Flex integration. This will be my second time speaking there and I'm looking forward to visiting Minneapolis again. This is a great conference, period. It's definitely worth the trip.

At CFUnited I'll be speaking about ColdFusion and SMS message integration. This is my first time speaking at CFUnited and I'm very excited. From what I've heard this is just an awesome conference!


Hope to see you at one of those conferences!

The worst ColdFusion code...ever

Everyone has run across bad code. The world of web development is full of it.

I've seen a lot of ColdFusion code that would make developers cringe, but nothing I've seen rivals the code I found while I was working on a project a while back.

Feast your eyes on this beauty:

<cfset b = 0>
<cfloop query="problemlist">
<cfset b = b + 1>
<cfif b eq 1 or b eq 5 or b eq 9 or b eq 13 or b eq 17 or b eq 21 or b eq 25 or b eq 29 or b eq 33 or b eq 37 or b eq 41 or b eq 45 or b eq 49 or b eq 53 or b eq 57 or b eq 61 or b eq 65 or b eq 69 or b eq 73 or b eq 77 or b eq 81 or b eq 85>
      <tr>
<cfelse>
</cfif>

<td><strong>#name#</strong>
<cfif #ListQualify(opencase.tech_diagnosis,",")# contains #id#>
   <input type="Checkbox" name="diagnosis_problem#i#" value="#id#" checked>
<cfelse>
<input type="Checkbox" name="diagnosis_problem#i#" value="#id#">
</cfif>
</td>

<cfif b eq 4 or b eq 8 or b eq 12 or b eq 16 or b eq 20 or b eq 24 or b eq 28 or b eq 32 or b eq 36 or b eq 40 or b eq 44 or b eq 48 or b eq 52 or b eq 56 or b eq 60 or b eq 64 or b eq 68 or b eq 72 or b eq 76 or b eq 80 or b eq 84>
   </tr>
<cfelse>
</cfif>
</cfloop>

Isn't that beautiful!

Ok, so who has got something better? Anyone?

Questions or comments? Feel free to email me at kevin.schmidt[at]flexinabox.com