cftopper.com

My Work: NMCI

NMCII've spent the last 2 weeks working on the website for the new National Maritime College of Ireland (NMCI). It was a bit of a struggle to meet a tight deadline for their launch but we did it.

The website itself ain't bad but the CMS behind it is another evolution of our custom built InfinityCMS content management system and is pretty sweet (if I do say so myself).

One neat feature is this ability for the user to type [include:subnav] in the WYSIWYG and the website will automagically spit out an in-page navigation. Other options are [include:date], [include:datetime] etc.

Also an editor can choose up to 5 image and write [include:image1] in their text to get a nicely rounded captioned image on the page. The rounded edges are done using the nifty corners flash I showed here last week.

Then theres the right hand side items - editors can create and assign right hand side items for any page and the images are automatically scaled and rounded for them.

Oh and the site also uses the useful script I wrote to extract URL variables from the pathe path so the site is more search engine friendly with URLs like http://www.nmci.ie/index.cfm/page/undergraduatecourses as opposed to http://www.nmci.ie/index.cfm?page=undergraduatecourses

All in all, I think I did well to add all these features and still get the job done on-time.
Check out the site and hit me back, comments appreciated (Keith, this time round, please try to say something positive before you unleash hell's fury).

Battlefield 2142

Last week EA announced Battlefield 2142 and oh my good God it looks bloody amazing!

The year is 2142, and the dawn of a new Ice age has thrown the world into a panic. The math is simple and brutal: The soil not covered by ice can only feed a fraction of the Earth’s population. Some will live, most will die. In Battlefield 2142, players will choose to fight for one of two military superpowers in an epic battle for survival, the European Union or the newly formed Pan Asian Coalition.

Armed with a devastating arsenal of hi-tech assault rifles, cloaking devices and sentry guns, players will also do battle using some of the most imposing vehicles known to man. Massive battle Mechs wage fierce combat on the ground, while futuristic aircraft rule the skies. When facing one of these new behemoths, players will need to use their wits and an arsenal of new countermeasures like EMP grenades to level the playing field.

"Battlefield has long been synonymous with innovative, best-of-breed online multiplayer action," said Sean Decker, Executive Producer, DICE. "By stepping into the future with Battlefield 2142, the team at DICE has reinvented the rules of engagement for the next century.”

Team play features allow up to 64 players to enter the action on the front lines as part of a formal squad, or work behind the scenes in Commander Mode to direct the strategic assaults of their teammates. With in-game success, players increase their rank and unlock awards, including new weapons, medals and more, delivering the most comprehensive and flexible persistence in the Battlefield universe to date.

There is a video available from fileplanet that shows it off fairly well. The giant mechs are kick-ass and I can't wait to take one of those babys for a spin.

I think its due out this November.

 

 

Tags: Gaming

Support: JImage Resizing Woes

Frank contacted me because my image component  CFX_JImage takes ages to resize large files. Here was my reply after some testing:
Hi Frank,
 
I just did some tests and here is the low-down.
--------------------------------------------------------------------------------------
1. ColdFusion seems to not like allocating large amounts of memory for CFX tags
and this seems to be what is causing the problem. On may laptop, resizing and image that
is 2000px in width is no problem. 3000 just hangs for me.
 
2. However JImage can be executed as an command line process - calling it this way from
ColdFusion with the 3000px image does work perfectly but takes 5 seconds with a JPEG file
and 3 seconds with a BMP file.
 
3. I revised the code and can tell you that the reason it takes so long is that for high quality
output I am actually doing a RESAMPLE and not just a resize.
The means that the output is of a much much higher quality than a simple pixel resize
but takes longer to do.
 
4. I have added an extra attribute, quickResize to do a quick resize for you!
With quickresize="yes" turned on, resizing a 3000px BMP file now takes less than
300 milliseconds to do the pixel resize!!!
 
5. However even with the new quickresize turned on, the resize of a 3000px JPEG file still takes ages; this is because JPEGs need more memory to be read and ColdFusion is imposing an upper limit on the allowed Java Heap Space.
When jimage is called from the command line, jimage executes the resize on the 3000px JPEG file in 1 second with the quickresize option turned on.
--------------------------------------------------------------------------------------
SUMMARY:
In summary, I have made resizes very fast by adding the quickresize="yes" option.
However with large JPEGs, ColdFusion still takes ages to resize these files due to in-memory restraints. However executing JImage externally to ColdFusion works ok even with large JPEGS.
--------------------------------------------------------------------------------------
THE SOLUTION:
 
1. Extract the attached file JImageQuickStart.zip to your desktop.
 
To get the resizequick option in cfx_jimage:
 
1. Look for the new jimage.jar file in the extracted folder - its in dcCom\components\jimage\.
2. Stop coldfusion and then copy the new jimage.jar file over the existing jimage.jar file
3. Start coldfusion again.
 
However loading large JPEG files will still upset ColdFusion due to the maximum memory heap.
The best solution is to execute jimage as an command line program.
Fortunately I made a wrapper to make this easy:
 
1. Copy the dcCom folder into the root of your application
(i.e.
where your application.cfm file is).
2. Copy the "dcCom.cfm" to whereever you are calling cfx_jimage.
3. Change the syntax of the way you call JImage from
<cfx_jimage ...>
to
<cf_dccom component="jimage" ... ></cf_dccom>
 
So instead of:
<cfx_jimage file="#loc#z6.jpg" outfile="#loc#z_out.bmp"
action="resize" width="175" timeout="6" quickresize="yes">
use:
<cf_dccom component="JImage" file="#loc#z6.jpg" outfile="#loc#z_out.bmp"
action="resize" width="175" timeout="6" quickresize="yes"></cf_dccom>
Don't forget the quicksize. You are still limited to a size of about 2600px width for JPEG image. Other file formats seem ok.
You could attempt to resize this, it if fails after the 6 second timeout.
 
I've been at this all morning - I want you to be a happy customer. Must get back to work now.
 
Best Regards,
Peter

Incredible Fishing Video

Google videos now allow site owners to easily videos on thier sites. Works well don'tcha think? What the hell is wrong with these fish - :)

Flash - Nifty Corners

I just spent the last 40 minutes or so writing a reusable flash component for putting rounded edges on any image dynamically.

You just pass in the image you want the flash to load, the size you want the corners and a list of which corners you want a corner on. Something like:

flashVars="img=example.jpg&size=20&corners=1,1,1,1"

One of those days

I'm really having "one of those days" today. First my laptop is acting the maggot. At any given time one of ColdFusion/IIS/Internet Explorer is screwed. Then I find out that because of the recent upgrade to CFMX7 from CFMX6 on a client's server, a CFX tag called CFX_WordTextExtractor that I wrote for an important application doesn't work anymore.

I have since spent the day trying in vain to get the tag to work on MX7. At the moment, the bloody thing won't compile. I screwed something. So I need to get the latest files from http://www.textmining.org/ again. Lo and behold, to complete my day, when I go there I am greeted with:

Hacked Fotolog ? ITALY owned .org ? HACKED BY ITALY

 

Update

After posting this I switched off my brain and went home. When I came in the next day, I poked around and found that the Lucene project had the TextMining files I needed in it's codebase. The CFX_WordTextExtractor component is now working perfectly.

And I Accidentally found that it was Dell's Quickset task bar program that was screwing my laptop up.

Sometimes, the most productive thing you can do is take a break. :p

PS. looks like the www.textmining.org site is still screwed.

I'm an arrogant ass

Hi John,
 
I just logged in. As a professional Internet application developer I
have to say that Group Worker is one of the worst web based programs
I have even seen.
 
Its smells of incompetence - for example the page titles are
"Untitled Document" and there is no style sheet. I would guess that
whomever wrote this doesn't have much HTML or JSP experience.
 
It seems apparent that O2 has completely useless developers working for them
and that their managers are blind enough to not see that. Is it not plain to see
how bad the "Group Worker" program is? I can't understand how this could pass
any quality control tests. Ye probably spent more on the Group Worker brochures
that the application development.
 
Complete Incompetence.
O2 should be ashamed. Somebody should be fired.
 
Regards,
Peter

(I'm an arrogant ass - but they deserve it)

Tags: Musings

My Wireless Router Sucks

Just found out what the shitty wireless router we have at our house has become absolutely useless. It seems there is a mixed-network issue - i.e. the more physical lines we plug in, the more the wireless performance degrades.

Just shows, I want against my own rule of using CNet reviews when buying new technology when I ran out to get that piece of s**t.

Tags: Musings

A Better Way

Just bored here in AREA51 doing my usual Friday night stint, browsing the web, considering doing some work. Was just filling out a form...

On just about every HTML sign-up form, when you make a mistake or something like your desired username is taken, you have to re-enter your desired password and password confirmation because writing out the users password in the HTML is a breech of security.

There is a better way.

Developers should ask the user if they want to use the password they already provided or supply another one i.e. the server should remember that the user put in the first time.

Grant it most of us just are too busy for that added effort. Guess I'm just a lazy idealist.

 

Tags: Musings | WebDev

Code: Friendly URLs

Ever notice the way some sites would write a URl like:

index.cfm?page=somepage&x=1

as something a little more URL friendly like:

index.cfm/page/somepage/x/1

To get this, simply include the following code in your application.cfm file!:

<cfif ListLast(CGI.PATH_INFO,".") NEQ "cfm">
  <cfif Find(".cfm",CGI.PATH_INFO)>
      <cfset lenRHSofDotCFM = Len(CGI.PATH_INFO) - (Find(".cfm",CGI.PATH_INFO)+4)>
  <cfelse>
      <cfset lenRHSofDotCFM = Len(CGI.PATH_INFO)>
  </cfif>
  <cfif lenRHSofDotCFM GT 0>
      <cfset RHSofDotCFM = Right( CGI.PATH_INFO, lenRHSofDotCFM )>
      <cfset numURLItems = listLen(RHSofDotCFM,'/')>
      <cfset numURLItems = numURLItems - (numURLItems mod 2)>
      <cfloop from="1" to="#numURLItems#" index="i" step="2">
          <cfset URL[ GetToken(RHSofDotCFM,i,'/') ] = GetToken(RHSofDotCFM,i+1,'/')>
      </cfloop>
  </cfif>
</cfif>

PS. I made this site wider since I figure that anybody reading this site must be working with at least a 1024x768 resolution and the text is easier to read this way, don'tcha think.  If the site looks a little odd, try deleting your browser cache - the flash headers on the blog posts are caching big time. I've deleted Internet Explorers cache a few times now and its still cached. Looks fine in Firefox though so I guess it'll sort itself out.

Tags: ColdFusion | Tips | WebDev

Tool: Regular Expression Tester

Here is a good tool I made eons ago that from time to time I find invaluable.Topper's Regular Expression Test Tool

Next time your knocking out a regular expression for ColdFusion, load up this, paste in some sample code and keep tweaking your expression until you get it right.

Tags: ColdFusion | Tools

A simple programming tip

Here is a simple tip I thought I'd share. Forgive me if you think this too obvious.

When in the middle of programming a file and you decide you want to copy a word, line or snippet code from some other part of the document... after copying the text, hit control-z, then shift-control-z to get back to exactly where you left off.

Your simply undoing then redoing the last bit of typing you did and the cursor should be back exactly where it was. This saves me precious seconds every day.

I know its a little thing but by accumulating as many tips and tricks as you can, you'll end up a much more efficient programmer.

This works in my editor of choice HomeSite+ (aside: I'm not willing to switch to cfeclipse until they get drap-drop of images into the CFHML/HTML working).

Tags: Tips

Comments are go!

I finally got around to adding the comments engine to this blog. It took a little longer than it should have but then I was getting familiar with prototype.js at the same time. I must say prototype.js makes Ajax a piece of cake.

I love that way Foo has those sexy country flags on the comments section of his site so I'll be adding flag icons as soon as I find a good library of icons that match that ISO country codes I have in the database; if you know of any please let me know.

So go on, leave a comment or two!!

PS. Stay tuned, I'll be posting up the first of a series of ColdFusion tools soon.

Tags: cfTopper.com

if(AngleGrinder != music) vol++

This is bullshit - there is an angle-grinder wailing outside my office here at Digital Crew  (DCHQ) at the moment making it very hard to concentrate on anything.

For the last 4 years the City of Cork has been undergoing a transformation resulting in an endless barrage of noise from angle-grinders, pneumatic drills, trucks, diggers and dump trucks. I guess it'll be worth it in the end - time to crank up the music!

Tags: Musings

Developer Services Batch Files

If like me, you don't want to wait ages for all the developer services such as IIS, ColdFusion, MySQL and MS SQL to start up when you simply want to check your email/browse the web; then you might appreciate these 2 simple batch files I keep handy  to start these services if and when I want them (assumes ColdFusion 7 on windows):

Note: I appended ".txt" to these file names to allow them to download; batch files are blocked by IIS6. Just rename them and remove the ".txt" bit.

Armed with these you can set all the following services to manual in the services control so that they only start when you run the Start Developer Services batch file.

  • w3svc (IIS Web Server)
  • ColdFusion 7
    • ColdFusion MX 7 Application Server
      ColdFusion MX 7 ODBC Agent
      ColdFusion MX 7 ODBC Server
  • MySQL
  • MSSQLSERVER

PS. Didn't have a chance to work on the comments for this site over the weekend - coming soon I promise.

Tags: ColdFusion | Tips

cfTopper not Keith-Compliant

Got an email from my good buddy Keith pointing out all the defects of this site. From the top of my head it includes:

  • Your feed looks a bit mangled.
  • Where are the comments?
  • What aren't the tags links?
  • Where's the archive?
  • The header should be reformatted:
    • Currently using an old style
    • Shouldn't have a keywords in the header
    • Should include a <link rel="stylesheet"...> tag in the header
  • etc.

Damn it man, It's a work in progress!

:p I did mention in post #1 that there a list of things I'll gradually be adding to the site. Unfortunately post#1 can no longer be seen because I have no archive - lol!

It's a pretty big email, one I haven't fully read yet but Keith I appreciate your taking the time to slap me into getting things ship-shape on this site. In fairness, Keith also sent me an updated header for this site, which I've put in place now.

I joked in my reply that I'll try and get things Keith-Compliant over the next few days. At the moment, real work must take a priority. Stay tuned.

Tags: cfTopper.com

Prototype.js Vs AjaxRequest.js

I am considering dropping AjaxRequest (which is excellent) and switching over to prototype.js for the comments part of this site (I will be loading both the comments and comment posts via Ajax).

Shit. I search and searched and can't see if prototype.js supports easy submitting of form data via Ajax like AjaxRequest does. You see I'm a lazy developer and like my frameworks to do this sort of form serialisation grudge-work for me. Hmmm... to use AjaxRequest which has easy form submission via Ajax or to oppose and suffer the slings and arrows of prototype.js making me do it for myself. I could use both but AjaxRequest is 9K and prototype.js is 46K and I'd rather stick with one. Decisions, decisions.

Update

Ok ok, I thoroughly examined prototype.js Ajax abilities and actually posting form data is absolutely simple. And so the winner is... prototype.js.

Tags: Javascript

About Topper on ColdFusion

Peter Coppinger aka Topper is a neurotic web monster who spends most of his chaotic life developing ColdFusion web applications when not drinking himself into a stupor and scheming his plans for world dominance.

Peter founded Digital Crew way back in 1999. Digital Crew run CFTagStore.com and have also produced lots of powerful ColdFusion tools like ProFlashUpload and CFMyAdmin.

I made this site to share my thoughts, tips and tools with fellow ColdFusion developers.

If your a ColdFusion developer, go ahead and subscribe to this site and in exchange i'll try to provide quality content to make it worth your while.
RSS Feed for Topper on ColdFusion

I'm speaking at CF-United Europe!

CFDevCon I'm going to be speaking at CFDevCon08! It's my second time speaking in front of more than 10 people so please lend your support.

The topic is:
Introducting TeamworkCMS and Site Engine - Building better websites in half the time or something like that..

Digging

My Work - Just Finished

  • modules.cit.ie
    Web-=based modules/programmes designer tool and database system for Cork institute of technology.
  • Teamwork Project Manager
    The top secret project is finally released. The project management app will rock your world - give it a go.
  • PMG
    New website for Project Management Group website.
  • Digital Warehouse Wholesale
    Added wholesale products to existing client website.
  • New Digital Crew documentation website
    New version of documentation.digital-crew.com using new InfinityCMS site engine. It's done now. Just add content.
  • PFH Company Webite
    New website/CMS/Newsletter System for prestigious Irish IT company.
  • Module Manager for CIT
    CIT is switching to module based courses. We are making an application for managing/submitting these modules. Gettig there.
  • Bons Secours Cork Hospital Intranet
    New Intranet for Bons Secours hospital in Cork. Considering turning this Intranet system into stand-alone product.
  • Revamping InfinityCMS
    I'm making major improvements to our content management solution, InfinityCMS. Making it faster, more powerful and easier to check into/out-of source control. Done but it's always going to be evolving.
  • BPC Update
    Minor functionality update for internal Pfizer Best Process Chemistry project.