Definition of a Function vs Method

ColdFusion , Javascript , Misc No Comments »

After a recent discussion as to the correct terminology to use when referring to code written in CFCs I've decided to share my opinion so people have a general idea as to what is meant when someone is referring a function or a method in its simplest sense. 

  • A function is a piece of reuseable code that is called by name.  It can be passed data to operate on (arguments / parameters) and can optionally return a result.
  • A method (also known as a property method) is a piece of code that is called by name that is associated with an object.  A method is almost identical to a function but it's purpose is generally to operate on the data contained within the component (class).

For example, in JavaScript, methods are defined as object properties that contain a function() whose intent is to operate on the data within that object.  Whereas an example of JavaScript functions would be built in global functions such as isNaN(), alert() or user defined functions function debugLog( content ){ console.log( content ) }.

Likewise, in ColdFusion, you could probably say that UDFs (User defined functions) and the standard built in functions provided by ColdFusion are "functions" and the functions within CFCs are methods.

I'm sure people have their own opions on this but in general that's how I like to refer to functions or methods.

 

Bookmark and Share

IE 8, Excel 2010 not opening content on Windows 7

ColdFusion , Gotchas , MS Office , Tips and Tricks No Comments »

Thought I'd dust the cobwebs off my blog by sharing something I came across today...

I came across an issue where a user reported that a web application was not opening Excel content they were requesting.

Basically the application was sending csv formatted text to the browser and the browser (Internet Explorer) was supposed to open this with Microsoft Excel 2010.

The template sending the content had the correct headers configured to instruct the browser to open this in Microsoft Excel and the content was valid but for some reason the new window was failing silently without promting the user to open \ save the file.  The only clue was that this was a new PC with Windows 7 and Internet Explorer 8 installed and their previous PC worked fine.

I decided to check with Firefox and voila - I was prompted to Open / Save the file.

So after diagnosing different scenarios through the code I then started looking into the settings on the PC for Internet Explorer.

Read more...

ColdFusion 9 - CFZIP Example

ColdFusion No Comments »

I was recently asked to provide a quick link for allowing administrators to download _all_ user uploaded assets for a particular form.
The obvious choice for this was to use <CFZIP /> to create an archive, compress the download file size and also provide one download link.

It didn't take very long to do, but I thought I'd share a quick example of this for others who might need the same.

Read more...

Contact Form Issue

Misc 1 Comment »

All, sincere apologies, but I have just realised that my Contact form hasn't been working.

If you have used this to contact me please and I have not yet replied please resend to [niall] [@] [niallodoherty.com] or contact me using the details on my About page.

Once again, sorry about that and I am working with my hosting provider to get this resolved.

Regards,

Niall.

Bookmark and Share

YouBloom - Blew me away

Misc No Comments »

YouBloom is a community-based platform created by artists for artists and their friends and fans.  Established to support unsigned talent, YouBloom's Vision is to enable musicians and artists to fulfill their potential, building and connecting them directly with a wider audience and – importantly – helping them to make a living.

Last night I had the pleasure of attending one of their awards cermonies, complements of my good friend Paddy Cutliff, where a number of bands \ artists performed live.

Aside from rubbing shoulders with the likes of Sir Bob Geldof, YouBloom founder Phil Harrington, International A&R music legend Nigel Grainge, songwriter & music producer Rupert Hine etc.  I also got to listen to and meet some amazing new and up-coming talent!!  There were no cover bands or karaoke queens here - this was the real deal!!!

Read more...

Powered by Mango Blog. Design and Icons by N.Design Studio
RSS Feeds