Browse > Home / Archive by category 'Technology / ColdFusion'

| Subcribe via RSS

mod_speling Breaks Flash Forms in ColdFusion

February 12th, 2009 | No Comments | Posted in ColdFusion, Linux, Technology, Work

We were setting up a new server for our ecommerce site, and we knew that the code was primarily used in Windows environments. Having wrestled with apps built by developers who think “case sensitve” means not buying animal skin luggage, we decided to be preemptive and configure mod_speling to make Apache case-insensitive on Linux.

The ColdFusion 8 installer creates an alias on Linux systems from cfide to CFIDE so that either will work. Flash forms need to call the scripts folder in CFIDE in order to load their various components. On this server, Flash 10 on Safari would show the “Initializing” message and fill the loading bar, then stop. No error, nothing. Firefox on OS X would show the loading window, then throw an error “RSL Load Failed” and stop at 40%. Googling this problem led us to believe that it couldn’t find the .swf or even the scripts folder.

I suspected mod_speling fairly early on, and disabled it. No luck. Reinstall CF, build a completely new server, lots of time wasted. I never could get the debug version of Flash Player 10 on OS X to work and dump a trace, and there aren’t any instructions for this specific version that I found. None of the log files were any help, no error messages, nothing. The best we could do was look at the network activity on the client and see what the page was trying to load. It looked like it was finding all of the files.

Finally, I checked the SSL config that was included in the Apache config on the server. Spellcheck was turned on there as well, and we had missed it. Turned it off, and suddently Flash forms work again. We still don’t know exactly why they failed, but it obviously has something to do with redirects and aliases for the CFIDE and/or scripts folder.

ADDENDUM: Turns out the CheckSpelling directive works in .htaccess files. So we have case sensitivity and flash forms coexisting, for now. This fellow found a rather unique solution too, but I haven’t tested it.

 

Loading a byte-length delimited text file in MySQL and CF

May 10th, 2008 | No Comments | Posted in ColdFusion, MySQL, Technology

I’ve had a few projects that require loading large text files with byte-length fields into MySQL. That means that there are no delimiters for the fields, they’re just always a certain number of characters. As far as I can tell, the MySQL tools need field delimiters in order to use load_data_infile or the import tool. Therefore my current solution was to read each line, parse it, insert it, and repeat. In each case I also had to do some transformations on the data before it was final, like converting ISBN from short to long formats.
I’ve always know this was slow, particularly with 500,000 records in a file to parse. I’m thinking of two alternatives, and I’m going to test to see which is faster. One would be mysqlimport the file into a temp table where each line is a single field. Then I would wither use CF or SQL to parse the longer fields one at a time. I’m not sure that this removes the multiple insert bottleneck, I expect it wouldn’t be much better. The second would be to read and parse each line and then write it back to a text file with proper delimiters and all the data converted. Then I’d mysqlimport the text file. The question here is which is faster – multiple inserts or appending lines to a large text file?
Update – I figured loading the file would be faster than all those queries, but the difference was pretty stark. I thought the benefit of the bulk import might be offset by writing so many lines to a text file. Seems not so much. The old way took over 90 seconds on 66,000 lines. The append-bulk import method took about 9 seconds. Now I get to rewrite a few import routines.

  Last modified: June 6, 2008 @ 6:40 am

Not Learning a Framework

September 15th, 2007 | No Comments | Posted in ColdFusion, Technology, Work

Yeah, so after some digging and trying and working and reading I decided that I’m not going down the framework route in CF. I want to learn more Python, maybe go back to the Objective C stuff I was doing in XCode. There have been a couple of recent posts on CF blogs about the over-complication of a language that was designed to remove complexity for the purpose of building web applications. I have to agree. So I’m focusing on the principles, reuse, encapsulation, readability and not on someone else’s specific pattern and methodology.

  Last modified: November 5, 2007 @ 9:35 am

Learning a Framework

August 28th, 2007 | No Comments | Posted in ColdFusion, Technology, Work

I’ve been wantig to explore a Coldfusion framework for several years, but never managed to motivate myself. Now that I have a little time between projects, and am somewhat horrified by some of the things I had to do to the new online Computer Store code, I think I’ll learn Model-Glue. It uses the coldspring IOC system, but I’m not going to implement any scaffolding or ORM yet. Baby steps.

The problem I’ve always had (and many others have) is the overhead involved in learning the framework. Wrapping your head around someone else’s methodology in addition to the problem at hand seems like extra work. Anecdotal evidence suggests that MG will appeal to my method of working though, so we’ll see.

 

The Bulletin

August 9th, 2007 | No Comments | Posted in ColdFusion, Linux, Technology, Work

The new Penn State web bulletin is going live any day now. There are still a few tasks on the list to complete before final hand-off, but it’s functional and the response has been very positive. It’s built on ColdFusion 8, MySQL 5 and Red Hat Enterprise 4 (5 came out too late to switch).

The content is all managed via a web interface, though I’m not completely happy with it. I will probably continue to tinker with it for a few weeks. We’ve also discussed some features for the second round of updates, like exposing the data via RSS and/or custom XML, allowing construction of “booklets” of PDF pages, and other fun things. I’ve already built some code for that and we’ll be talking to the ANGEL folks soon about piloting some features.

These kinds of web-legacy integration projects are picking up steam. I wouldn’t be surprised to see more of this type come along, especially as more of the mainframes are exposed via Java or other modern network interfaces.