?

Log in

entries friends calendar profile Previous Previous
CFMX
cherdt
cfmx
cherdt
One of our developers created a room reservation system for our intranet. The developer came from a Java background, and his code was (relatively) object-oriented.

The main screen shows room availability throughout the day, and instantiates 20 room or "room-day" objects, each of which contains a "reservations" objects.

It was running a little slower than we wanted it too, so as a test I wrote a simple page that produces more-or-less the same output from a query, rather than instantiating all the objects. It runs in one-tenth of the time.

I imagine the object-oriented approach is going to be more flexible and easier to maintain in the long run, but I wonder how much overhead is involved in instantiating all the CFCs. I know I haven't provided a ton of details, but has anyone here had a similar (or dissimilar) experience, or opinions on occasions when the object-oriented approach is too inefficient?
5 comments or Leave a comment
cherdt
cfmx
cherdt
One of my co-workers just asked me how to format a date-time string using the current time. Naturally, I pointed him to dateFormat() and timeFormat().

However, he said he was concerned that, in rare cases right around midnight, the dateFormat(now()) would show the previous day, while timeFormat(now()) would show 12:00 A.M.—24 hours off. (This is something at I never would have considered myself, or if I had I would have chalked it up as trivial, since it is a rather unlikely case, and there should be no need for separate date and time fields in the database.)

I couldn't find anything built-in CF functions, so I advised him to create his own dateTimeFormat() function, or to save now() to a variable and then use the variable as the dateFormat/timeFormat input. Any other suggestions?
4 comments or Leave a comment
cherdt
cfmx
cherdt
I'm trying to display data from an Excel spreadsheet on a web site. (The department that updates the data is already using the Excel spreadsheet for other purposes, and they don't want to do double data-entry—and who can blame them?—hence, trying to read data from an Excel file.)

I found several sites that have directions on how to set this up, such as:The basic procedure appears to be:
  1. Set up a system DSN for the Excel file on the web server.
  2. Add the new data source to the ColdFusion administrator.
  3. Query away!
The problem I'm running into, which may or may not have anything to do with CFMX 7, is that the new DSN doesn't appear as an option in the DSN menu on the Data & Services > Datasources > ODBC Socket screen on the ColdFusion administrator.

Anyone here have any ideas as to why data source isn't showing up? It's a Windows 2003 server running CFMX 7.

Edit: I eventually used a function I found on How do I return a query from an Excel file?, which avoided the DSN issue entirely.
3 comments or Leave a comment
cherdt
cfmx
cherdt
In some local documentation I found at work, I ran across this note from a previous developer:
Prefer structKeyExists() to isDefined(). isDefined() is slow and will present problems in certain cases.

I found a couple web sites, particularly isDefined() vs structKeyExists(), where people explain that structKeyExists() should be faster than isDefined(), because it only checks a specific scope (e.g. form, session, url), whereas isDefined() checks all possible scopes.

Personally, I think isDefined() is much more readable and think the readability might be worth a microsecond or 3. I'm wondering if the developers here have an opinion on the matter. Is isDefined() really so slow and inefficient that it will cause problems?
5 comments or Leave a comment
livenolies
cfmx
livenolies
I've got a contractor that's trying to set up SQL Express 2005 and ColdFusion 7 on her dev box, so she can do some work for me. We keep getting errors when trying to set up the DataSource in CF Admin. I think we're building the SQL logins improperly. Either that, or something is wrong w/ the options we're picking for the ODBC Data Source.

Does anyone have a good set of instructions to follow for setting up a "default, nothing fancy" ODBC datasource, SQL login, and CF DataSource on MX 7?

Thanks.
1 comment or Leave a comment
deinemuse
cfmx
deinemuse
Maybe someone can help me out on here. I am trying to pull one of my LJ into a website through an rss feed, but I want a little control via the categories so I only get the stuff I want. I basically want to filter out notices and blank category entries. I tried an if statement around the output, but that just failed. Any help?

Here is the code I am working with...Collapse )
5 comments or Leave a comment
dyogenez
cfmx
dyogenez
2006-07-02 CF United 003 Hey hey, anyone go to CF United this year? This was my first time going to it and it was a lot of fun. Definitely going to have to give ColdSpring a try as it looked very impressive. I posted my few pictures up there along with everyone elses photos. Anyone go and have any topics that stood out?
Leave a comment
ibjhb
cfmx
ibjhb

I can't get this to work anymore.  I've used it hundreds of times, but it doesn't work anymore.  I think one of the Windows patches might have broke this:

<cftry>
 <cfobject
  action="CONNECT"
  class="Excel.Application"
  name="objExcel"
  type="COM">
<cfcatch>
 <cfobject
  action="CREATE"
  class="Excel.Application"
  name="objExcel"
  type="COM">
</cfcatch>
</cftry>

I keep getting the error:

AutomationException: 0x80080005 - Server execution failed. Note that Windows 95 does not support automatic launch of a server, it must be running already.

Apparently ColdFusion can’t launch Excel anymore as a com object.  Any ideas?

2 comments or Leave a comment
khyron
cfmx
khyron
Hey CF peeps, does anyone know of an up to date one-stop-shopping list of all CMS solutions which currently run on a CF platform?

I've looked around a bit and found several on my own, and of course there's the wonderfully comprehensive but woefully incomplete and out-of-date CMS matrix, and various articles with lists from years ago...

...but does a complete list of just the currently available, currently maintained, mature systems out there exist anyplace?

I just figured I'd ask you folks as I keep looking.
Leave a comment
cherdt
cfmx
cherdt
I'm troubleshooting an application right now that has a couple consecutive INSERT statements wrapped in a cftransaction tag. However, it seems that although the first INSERT fails, the second INSERT is processed and is committed to the database. Basically, the cftransaction tag isn't working.

Looking at the code, I see that there are some cftry...cfcatch tags within the transaction that catch database errors and create a custom error message for the user. I'm wondering if the cfcatch tags are interfering with the normal function of the cftransaction tag, and if I just need to add another cftransaction tag with an explicit rollback action?

Has anyone else run into this before?
3 comments or Leave a comment