Archive for the 'ColdFusion' Category

12
May

Sybase SQL not same as Microsoft SQL

I’ve always heard that Sybase SQL Server was essentially the same as Microsoft SQL Server. I’ve even read about developers authoring applications against MSSQL and then deploying to Sybase SQL.

Well, this week I started on my first project with Sybase SQL Server and was amazed at how different they are. Sybase SQL doesn’t support “TOP” syntax and all SQL identifiers (table and field names) are case sensitive. So a query on “SELECT * FROM Documents” will fail if the table is name “DOCUMENTS”. That’s just what I ran into in the first few days.. I’m sure there will be more surprises to come.

So if there are others out there who assumed the two were compatible due to their common root and other community fodder, you are now forewarned.

26
Apr

New Microsoft Office Integration content in Advanced ColdFusion MX 7 Application Development

I just learned that Advanced ColdFusion MX 7 Application Development is shipping. The sites have not been updated yet, but it is shipping.

This update has a ton of great new content, including a whole chapter on MS Office integration which I was very pleased to contribute. This chapter provides more in depth information and new examples compared to what I’ve discussed in my previous presentations on the topic.

Everyone else is linking to the Amazon page, but it’s much cheaper on Overstock.com. Overstock stinks for research–little info and no reviews–but it’s good for the final purchase. You don’t need research for this book anyways, everyone knows it’s wonderful! :-)

22
Mar

New PrimalScript Release: CFMX7, CSS, and Double-Extensions and more!

Sapien put out a nice update to their IDE, PrimalScript with a few big additions.

  • ColdFusion MX 7. The PrimalSense files have been updated with all of the new CFMX7 syntax.
  • CSS. PrimalScript now gives PrimalSense on CSS files–it lists a drop-down of all valid CSS property names (use the toolbar button or CTRL-Space).
  • Double-Extensions. This is generic for all server-side code, but is really geared towards CF developers as it’s primarily a CF pratice. PrimalScript now recognizes files that have two extensions and treats the file based on the type of the first extension, not the last. So if you want to protect your css files via CF but still want PrimalScript help while editing them, you can use a name like “site.css.cfm” and PrimalScript will recognize the “.css.cfm” double-extension and treate the file as a CSS file. This is espeically useful for Fusebox developers who use double-extensions for their controller files such as “fusebox.xml.cfm” and “circuit.xml.cfm”.

If you haven’t checked out PrimalScript for CFML and AS development, we’d strongly suggest trying it out.

23
Feb

Where’s responsible security reporting?

While I totally agree that once a company fails to respond to a security problem reported privately the problem should be reported publically, it’s horrible when that report greatly compounds the problem. That hapenned recently with ThinkTank’s disclosure of PayMaxx’s major security problem.

PayMaxx developers unfortunately did a stupid thing–they didn’t check that a person viewing a W-2 or other payroll related record is accessing the record they are allowed to; they only check if the user is logged in. That certainly is a major problem and unfortunately is too common (I’ve found this problem myself in e-commerce sites I used and reported it to the site owners–who both fixed the problem within 24 hours in the instances where I found it).

The ThinkTank report went much further than disclosing the nature of the problem and reported specific login information for a test account which allowed anyone to log-in and exploit the problem. Before this, only customers could exploit the problem. After ThinkTank’s disclosure, anyone can exploit the problem. They made the problem significantly worse.

Shame on you ThinkTank. If you agree, tell them.

03
Jan

CustomTag: HiddenDiv toggles content visibility

Recently I had to display a lot of text in a page but didn’t want it all initially displayed–I wanted to toggle some of it based on user interaction. I wrapped the functionality in a custom tag for easy reuse.

This is toggled text content.

tag and provides a
separate

tag with a link to display the content. The link
can act as either a display once or a toggle. When the hidden
div is diplayed once the link text is hidden. When the hidden
div is a toggle, the link text is toggled between two alternate
values.

-> showText Text to display initially and when the content
is hidden. Default “(show)”.

-> hideText Text to display when the content is displayed
and toggle is set to yes. Default “(hide)”.

-> toggle True if the link toggles the content display
and false if it displays once and stays on.

All other attributes are passed along to the content div. The
text div has a class of “hiddenDivText” which can be used
for styling.

Only tested in IE6 and Firefox based browsers. Should work
in other standards compliant browsers. If it doesn’t work
in your target browser, modify the getElement function.
—>

var hiddenDivShowText = new Array();
var hiddenDivHideText = new Array();

function toggleHiddenDiv(index) {

var textDiv = getElement(’hiddenDivLabelDiv_’ + index);
var contentDiv = getElement(’hiddenDivContent_’ + index);
var textSpan = getElement(’hiddenDivLabelSpan_’ + index);

var display = (contentDiv.style.display != ‘block’);

textSpan.firstChild.nodeValue = (display ?
hiddenDivHideText :
hiddenDivShowText
)[index];

textDiv.style.display = ‘none’;

contentDiv.style.display = display ? ‘block’ : ‘none’;

return false;
}

function getElement(id) {
return document.getElementById(id);
}

#js#

hiddenDivShowText.push(’#jsStringFormat(attributes.showText)#’);
hiddenDivHideText.push(’#jsStringFormat(attributes.hideText)#’);

#js#

05
Nov

Look Ma, No Computer!

I had a great time at my first MAX presentation. About fifteen minutes before I was to present my video card fried. As a Macromedia technician worked on my computer to see if it was something easily remedied, I frantically looked for other options. Another presenter loaned me his laptop and my tack manager had a copy of the presentation, so we loaded up the laptop and I was good to go. When I turned the laptop on back at the session, I was presented with a very unwelcome sight–the login screen. I didn’t have the password.

So, I gave my first presentation with no slides, no examples, and no demonstrations. I was very surprised that only a handfull of people left the room, and noticed very confused looks on the people that came in late. Luckily the topic is more more conceptual than hands-on and based on questions from the attendees it seemed that the presentation went about as well as can be expected.

Near the end my track manager and some Macromedia techs came in with another backup computer and we set it up to help highlight the things that needed visuals for explanation and to show the URL where the presentation can be downloaded.

Integrating ColdFusion with Microsoft Office: Breezo and examples.

For the second session I was able to get a loaner computer from Macromedia far enough in advance to set it up and make sure all required software was installed and the examples ran through correctly.

01
Nov

Transactions can improve database performance

This seemed counter-intuitive to us when we stumbled upon it, but apparently wrapping update statements inside a transaction can improve the performance of the statement.

We were working on an import script that imports a large set of new data and also updates related records in existing data. The process runs asynchronously so we weren’t concerned too much with performance–it’s a long running process updating 7,000,000+ existing records with related data from 100,000 new ones.

However, we were surprised to notice that the same queries took over 1,000 seconds to run through our application whereas they ran in about 150 seconds in SQL+. After a lot of trial an error we wrapped the application queries in a transaction and the performance improved to be the same as running the statements in SQL+.

Because of the nature of the data load we don’t really need autonomous commits and thus weren’t using transactions to start with. We were very surprised to notice the speed increase after applying transactions.

28
Oct

Get free tech support at MAX

Macromedia has a very neat program at MAX that I’m not sure everyone is aware of. They have a support lab where attendees can come with their problems and get free tech support.

I’ll be helping out in the lab a bit, along with several other Team Macromedia volunteers, so be sure to drop by with your questions.

14
Sep

Dump a Java class’s inheritance hierarchy

Recently I had the need to introspect a Java class for it’s inheritance hierarchy and didn’t have access to JavaDocs for the class. I used this simple ColdFusion code to loop through the hierarchy using getSuperClass method. Perhaps others will find this helpful.

#cls.getName()#

06
Jul

Speaking at MAX! Integrating with Microsoft Office

I’ve been accepted to speak at MAX again this year. I’ll be giving an updated version of the presentation I gave last year and at CFUN-04, Integrating with Microsoft Office.

I’m accepting questions or comments on what changes should be made–are there whole topics that should be discussed that weren’t? Were there things that should be dropped?

Right now it looks like I’ll be dropping the Authomation slides and am hoping to add an example using Jakarta POI and also of client-side communication between Flash and Excel.

You can view a Breezo of last year’s presentation and download the slides and examples here.