Windows 7

I've been interested in Microsoft Windows 7 and will probally will either buy a new laptop or purchase the upgrade ahead of time. Today I've run into some more concrete dates, so I thought I'd pass them along.

According to cnet news, Microsoft plans to start selling Windows 7 on October 22, although pre-sales of the product as well as a free upgrade program for new PC buyers are expected to both kick off on Friday.

Nebraska's ColdFusion Users Group Tour

Come hear Kevin Hoyt speak about the next versions of Flex and ColdFusion (Centaur) and the new ColdFusion Builder (Bolt) on June 16th.

Kevin is a member of the Adobe Platform Evangelism team. He's worked with ColdFusion from the earliest Allaire versions.

The Nebraska ColdFusion Users Group will be giving away $50 gift cards to places such as BestBuy and Borders - my favorite part of course!

If you are new to the scene or an experienced developer, this is a must-attend event.

It's free, there's food, and there drinks.

Check out NECFUG.com for details, and please contact them to know you're coming.

It will be hosted at CF Webtools near 114th & Dodge in Omaha.

Project Natal - Milo

As a total "geek", many people assume that I sit at home after work and play X-Box or Playstation all night. But the truth is, those game consoles are just to complicated for my taste. In fact, rarely do I play video games.

What I do enjoy in the arena however, is my Nintendo Wii. I enjoy the simple, yet interactive and challenging games such as the Wii Fit, Disney Trivia, Tetris, Wii Sports, Mario and others. However - I do wish the graphics where a little more modernized and the AI pieces just quite aren't there.

[More]

Generating Excel Column Names

When using the Apache POI to generate Excel formulas, you need to gain access to the corosponding column name associated with the column id, such as "A" for column 0.

I ran accross a simple solution, however this will only generate up to "Z".


visualColIDAsc = Asc("A");
visualColIDAsc = visualColIDAsc + currentColumnCount ;
visualColID = Chr(visualColIDAsc);

Unfortunatly I have more than 26 columns, so I had to come up with another solution. Here is a UDF. Just pass it the current column (remember to start with 0) and it will return the corosponding column name. This took me a good while to think this through, though it's a fairly simple concept.


<cffunction name="generateExcelColumnName" access="public" output="no" returntype="string" hint="Returns the Excel column character equivalant to the column number.">
<cfargument name="colCount" required="yes" type="numeric">

<cfscript>
var c = "";
var i = "";
var currCharAsc = "";
var incrementNextChar = true;
var lastCurrCharAsc = "";
var lastChar = "A";
var newChar = "A";
var newCharAsc = "";
var newCurrCharAsc = "";

if (arguments.colCount gt 0) {

for (c=0; c lte arguments.colCount - 1; c=c+1) {

newChar = '';
incrementNextChar = true;

for (i=1; i lte len(lastChar); i=i+1) {

// set last used character ASCII code if defined
currCharAsc = Asc(Right(lastChar, i));

// incrememnt character ASCII code if flagged to do so
if (incrementNextChar)
newCurrCharAsc = currCharAsc + 1;
else
newCurrCharAsc = currCharAsc;

// handle out of character range
if (newCurrCharAsc gt Asc("Z")) {
newCurrCharAsc = Asc("A");
incrementNextChar = true;
}
else
incrementNextChar = false;

// append character to final result
newChar = Chr(newCurrCharAsc) & newChar;
}

if (incrementNextChar)
newChar = "A" & newChar; // append character to final result

lastChar = newChar;

}

}

return newChar;

</cfscript>

</cffunction>

alt, class, and style attributes for CFImage Output

I am currently working on a project to add alternate text attributes to displayed images on a website. Normally this is just a pain, and you have to be creative with your wording. However this case is a little different.

The current code resizes a given image and writes the result to the browser. However CFImage does not currently have the ability to add an alt attribute to the output. What to do?

Luckily after a little research, Ben Nadel has given me an easy way out. He has created a UDF to modify what is outputed to the browser, thus enabling the alt attribute. Another one saved!

Check it out at http://www.bennadel.com/blog/846-Styling-The-ColdFusion-8-WriteToBrowser-CFImage-Output.htm.

Using ODBC to import CSV files in ColdFusion

I'm currently looking for an alternative solution to cfx_Text2Query, as I'm having issues with that for some reason. It appears that it doesn't like to process non-strict files; such as having extra line returns and such.

I've seen some examples in place using a generic text driver via ODBC, but I haven't been able to find really anything that would help me put it into place. This will allow you to basically query the text file and return the results in a CFQUERY tag. Here's the steps I've found.

For this example, I'm using a Windows 2000 Server with ColdFusion 8.

1. Add a new Windows ODBC Data Source using Microsoft Text Driver (*.txt,*.csv). I called it GenericText.

2. Be sure that the ColdFusion ODBC Server is set to Automatic Start and it is started. Otherwise you will get a source not found error.

3. Next go to your ColdFusion Administrator and Add a new data source using the ODBC Socket driver. I also called that GenericText. The Windows ODBC should be listed in the ODBC DSN. Select that one. The rest of the defaults should be fine.

4. Create your query using cfquery in your code.

The query syntax is fairly full functional. It can be as simple as:


<cfquery name="qryTest1" datasource="GenericText">
SELECT *
FROM C:\data\test.csv
</cfquery>

OR more complex such as:


<cfquery name="qryTest1" datasource="GenericText">
SELECT COL1, COL2
FROM C:\data\test.csv
WHERE COL1 IS NOT NULL
</cfquery>

Do you need to strip out the first line, such as a header? Here's what I've come up with:


<!--- Read in uploaded file --->
<cffile action="read" file="#importedFile#" variable="ImportedRead">

<!--- Remove first line --->
<cfset importedRead = ReplaceNoCase(importedRead, "Sample Header#chr(13)##chr(10)#", "")>

<!--- Write out file --->
<cffile action="write" file="#importedFile#" output="#importedRead#">

<!--- Run SQL code from above here --->

JavaScript Framework Survey

Lately I've been labeled the JavaScript guru around the office. I find that JavaScript Frameworks can make a website user's experience much better, and not too many people would disagree with that. I also tend to use Flex for the same reason. As of current, I extensively use ExtJS (which can replace many features of Flex). Before this, I used to use YUI and JQuery.

Recently Kyle Hayes posted a survey on his blog about JavaScript Frameworks and received over 600 responses. I thought that I would take the time to mention this as it provides some great insight into what other developers think. I hope you find this interesting:

http://www.kylehayes.info/blog/index.cfm/2009/03/29/Survey-Results-JavaScript-Frameworks/

Microsoft SuperPreview: Testing Multiple Browser Versions

It's been either hard or expensive to test websites in different versions of Internet Explorer, espically if using host file entries for development.

Today Microsoft announced Microsoft Expression Web SuperPreview, which will allow developers to compare different IE, Firefox, and Safari versions using cloud computing. Additional features include side-by-side comparisons, browser size reviews, alignment checks, DOM checks, and an almighty overlay review and more.

For now, you can download the Microsoft Expression Web SuperPreview for Windows Internet Explorer for free from Microsoft. This is a pre-release of the free version and tests IE 6 and 7, plus 8 if you have it installed. (Note: take the usual beta software precautions).

I've also run into others such as DebugBar's IETester.

Presentation on Ext using ColdFusion at NECFUG

I put on a presentation at the last Nebraska ColdFusion Users Group meeting. My presentation was recorded and is about an hour-and-half. The quality isn't all that great, so you can view the PowerPoint file here.

Video clips at Ustream

CSS Frameworks

Lately I have been experimenting with the YUI Library CSS Tools and Blueprint. Both are an open source CSS framework, which as Blueprint so gracefully puts it "gives you a solid CSS foundation to build your project on top of, with an easy-to-use grid and sensible typography...".

After experimenting with both, I have continued to lean towards YUI's framework. It seems to be a little more matured and well-known, so I will focus on YUI.

[More]

More Entries

BlogCFC was created by Raymond Camden. This blog is running version 5.9.1. Contact Blog Owner