Saturday, July 31, 2010

Clean Code: Why it matters and how it's done

Heading in late after dealing with failover of db to B..

Variables

What's in a name?
  • Intention
  • No cryptic names
  • No abbreviations
  • Rather have something longer, but clearer/obvious
  • Be serious
  • Funny comments etc

//Not clear
for(i=1; i<=ArrayLen(myArr); i++)
{
temp=myArr[i];
temp.update();
}

//More clear
for ( thisForm=1; thisForm <= ArrayLen( forms ); thisForm++ )
{
forms[thisForm].setDefaultValues();
}

Much more readable.
Doesn't like the use of i or j, k as it can get confusing in nested loops and isn't clear

Another side-by-side

v1 = new RCVal();
isDumb = v1.idiotCheck();

validator = new RemoteConnectionValidator();
isConnectionActive = validator.checkConnection();

Logic and Algorithms If / Else
  • Minimize use
  • If possible, just don't use them
  • Simple conditions
  • Break it up
  • Avoid nesting
  • Don't assume a branch will run

If you can't look at a piece of code and tell what it can do in under 10 seconds, think about re-writing.
The following just gets too confusing. Try not to have so many conditions in one if statement, break it up.

if(currentUser.isActive()
&& Len(form.content)
&& isValid(form.email)
&& currentUser.isHappy()
)
{
//do something
}

Seperate out the code so you don't get lost in the if/else statments...


if (isMessageReady( form ) )
{
//20 lines of
// send email
//code
}
else if ( !isMessageReady ( form ) )
{
//20 more
//lines
//of code
}

Change to this..

if (isMessageReady( form ) )
{
sendMessage( form )
}
else if ( !isMessageReady ( form ) )
{
handleMessageError( form )
}


Switch / Case
  • Minimize Use
  • Breaking it up
  • Avoid Nesting
  • Don't assume a case will match

Looping
  • Break up logic
  • Avoid nesting

for ( thisPreference in preferences )
{
if ( !thisPreference.isDefaultPreference() )
{
updatePreference.preferences( preferences[this] );
}
else
{
updatePreference.preferences( preferences[this] );
}
}

for (thisPrefernce in preferences )
{
updatePreference.preferences( preferences[this] );
updatePreference.preferences( preferences[this] );
}

Basically, make the code you're writing more clear to read and handle extra stuff in their own methods..


Methods and Functions

Verb-oriented Names
  • updateRSSFeed()
  • validate()
  • trackShipment()
  • authenticate()
  • findRelatedProducts()

Methods - Smaller = better
  • More cohesive
  • Easier to test
  • Easier to override

Focus!
  • Sergeants and privates
  • One public function that gets called from the outside (to a CFC for example), but within that its a bunch of private methods that get called.
  • One level of abstraction

Try not to argue
  • Avoid many arguments
  • Best number is 0, then 1, then 2... After that it gets too many / too complicated
  • Avoid optional arguments
  • Add a class to encapsulate arguments

// 1+3^2 = 10 possible invocations
function loadContent ( url, isSSL=false, useCache=false, method='get' )

function loadContent ( LoaderSettings settings )

Where you're passing a cfc as an argument, if it makes things more clear of simple

Side Effects:
What just happened?

  • Avoid side effects
  • Return a value vs changing things
  • Throwing things into a method and having it updating things, return things back to make it more clear

Error Codes
  • Codes are evil
  • Codes can change
  • Exceptions are there for a reason!

Classes (and CFCs)

Noun-Oriented Names

  • Shipment
  • Attendee
  • Permission
  • UserGateway
  • RemoteContentService
  • InvoiceGenerator
Again, smaller wins
Rather have more smaller, cohesive cfcs vs really long ones
3-4 screens tall is really big..

Cohesive
  • Does one thing
  • Simpler
  • Easier to test

Guard that Wall!
  • Encapsulate by convention, reveal by need
  • Be paranoid up front, make all private and expose them as you need them..
  • Limit external dependencies
  • The more things something depends on, the more change a chance will occur and negatively affect things.

Comments

Don't Comment

  • All comments are failures
  • Code is not simple enough or the language is not useful enough to allow for you to be clear.
  • Ask yourself WHY you think you need a comment
  • Try to make the code simpler and more readable before using comments.

If you HAVE to, make it count
  • Don't restate HOW the code works
  • /* Loop over users query, then set firstName from db record */
  • Explain WAHT the code is supposed to do

Don't Comment Out Code
  • Comments should not be version control
  • Nobody ever deletes it and will forget why its there for still..
  • All it offers is confusion

Joined at the Hip
  • Stale comments are far worse than no comments
  • Obligated to freshness
  • If you put a comment, you're obligated to keep that block of comment fresh and relevant.
  • Again, try to make the code more useful first.

Format and Layout

How do you lay the code out physically?

Adopt a Standard

Vertical Spacing
  • Make it easy to scan through
  • Seperate methods
  • Separate appropriate chunks of logic
  • Litmus test for complexity

Put some spaces here and there to visually break things up..

Indentation
  • Again, easy to read
  • Easy to identify conditionals, loops etc
  • Litmus test for complexity
  • If it goes too far over, you'll start to know it may be getting too complex

You Are Your Code

Conclusion

Clean Code Matters


  • Clean code is easier to read
  • Clean code is easier to maintain
  • Clean code encourages thoughtful design

Some reading:

Clean Code: A Handbook of Agile Software Craftsmanship
The Pragmatic Programmer

Friday, July 30, 2010

Adding real-time data visualization to your application or website

Using a Google map to detect users who hit his blog site..

Load last hour feature has a time-based load in. That twinkles all the logins over like 30 seconds.. oooh neeto!
http://userglobe.com/heatmap/

Sounds pretty cool, but not too sure if we'll use this much. Maybe Graeme got more out of this one.

http://gregsramblings.com/cfunited2010/

Lunch and after

Lunch was pretty uneventful. Jay and I talked about the media player a bit and about the algorithm talk I went to (optimizing code etc... See my last post)

I just installed Railo, which took all of 5 seconds and now I'm grabbing EHCACHE and going to attempt to install it and test it under Railo..

Mac Customizations and Dev Tricks

Terminal Document Reference List:
http://ss64.com/osx/

Remove the giant header in VMWare:
Terminal Command defaults write com.vmware.fusion fluxCapacitor -boolean

Spell Check in Every App:

Terminal Command defaults write -g WebContinuousSpellCheckingEnabled -boolean


Macs Developer Bundle:
http://developer.apple.com/mac/


http://www.iotashan.com/


Sercert Server Like App for MacOSX
http://agilewebsolutions.com/products/1Password


Allocate more ram to VMare to increase fusion unity

Designing creative & scalable algorithms

New ways to looking at and solving problems.

Categorizing algorithms
•Theoretical
Big-O notation
•Practical

Disk Accesses
•disk is extremely slow
Slowest part of app is probably the disk.

Be practical
How much work does it do.

Structkeyexists fast
CreateUUID super slow
Randrange not too bad with smaller ranges

Structs typically better than arrays
Queries great for many reasons

Sorting
Handled by SQL
Trust the API, it's faster

Arraysort not too useful
Structsort very fast
Querysort very powerful, slightly slower (sort on multiple fields)


Lists are not your friend
Never use lists use arrays or structs

Query of queries super fast

Merging

SQL handles

Other objects?
Array
Query
Struct

CF9 much faster than CF8

Look into read-only locks

Look at Transfer ORM

Hibernate XML
xmlSearch use it

Don't bother transforming XML

Caching
Trades memory for speed
Try to make better algorithms before leaning on caching

Cache hot spots
Cache frequented paths
Cache most expensive things

Development on a Mac

This is a whole series of things that we all probably know about, but just in case:


http://www.webapper.com/blog

Don't forget about Unix apps.

Use the GO menu (note "go folder" - kinda like terminal autocomplete)
Explore Keyboard Shortcuts (in prefs)
Secrets: (mmmm) http://secrets.blacktree.com/
More: http://www.macosxhints.com/
Use Spotlight (Or Quicksilver)
Use quickview (spacebar)

Terminal Commands:
http://ss64.com/osx/

Unix Apps:
Use macports.org
More stuff:

http://www.iotashan.com/index.php/wwsu/


Web stuff:

XAMPP
MAMP (combines Apache, mysql, PHP)
NAVICAT


Local stuff;
Menumeters







Developing Web Applications for Mobile Devices

Dan Vega
http://www.danvega.org

The presentation is here on his blog:
http://www.danvega.org/blog/



Basically Apple vs Android..

Anytime/Anywhere
Competitive advantage

click!=tap
Larger tap radius on mobile devices
Need to accomodate that.

Define your audience
Google Analytics

AdMob - one of largest ad people for mobile.

Native vs Web

Making Money
Advertising
Freemium
Niche Markets
Developing application for others

HTML / Javascript / CSS

WebKit
SQL Light
CSS transitions/Animations

Sencha touch

Enhanced touch events
Built with standards
Data integration

Battery is low.. WIll follow up with more info after talk..

Thursday Night


Adobe Pool Party.
Pretty fun! One takeaway was meeting the Adobe Usergroup manager - Aaron Houston. He suggested we join OCCFUG and also said he'd be able to hook us up with CF Builder and possibly a CF9 license.

Clean Code


Nothing epic in this one - except the bit about commenting!



http://www.briankotek.com/blog/



Variables:

Intention

No Cryptic Names

No Internal Abbreviations

Be Serious



Question- does a word length affect processing time?




Don't use i

Don't use temp

Don't use Arr



For loops - use "thisSomething" - makes things clearer inside big loops


If/Else and Switch/Case


Minimize use

Simple conditions - try to avoid (if and ( OR) And NoT )

Break it up.

Avoid nesting

Don't assume something will run. Try to add a else catchall




Loops - avoid nesting.

Put nested loops in their own functions:




Naming.


Method/Function Names:

Use Verb orientated names

updateFeed()


Methods;

Smaller==better

More cohesive

Easier to test

Easier to override



Functions/Methods - return the result and act on it, don't do stuff inside and return a true/false



Error Codes (I do this badly)

Use Exceptions.



Classes/CFCs

Noun Oriented Names



DON'T COMMENT CODE!

A comment is a failure :-)

Make the code the comment.

If you absolutely have to, explain WHAT now HOW



DON'T COMMENT OUT CODE.

Comments are not version control!

All it offers is confusion.


Comments are obliged to be updated, so you'll always need to update them.














Thursday, July 29, 2010

Railo


Supports scripting.
Caching (honestly, the theme of this entire conference seems to be caching)
Different types of caching (easily built into cache tags to allow EH,MEM,Railo,etc)
The admin control of the cache is insane. Caches are replicated across server farms.


CF Powered iPhone Apps



Looks like they're talking about pointabout style webkit apps.

The Coldbox stuff seemed like massive overkill to serve up REST data, but the process seemed interesting and very flexible and expandable. (We don't need coldbox as a framework)

The best part of the talk was a live iphone app build. He wrote one almost from scratch.

Full talk here soon.

http://joshhighland.com/

CFML Security


Pete Freitag

http://www.petefreitag.com/

http://foundeo.com/security/ --- might think about getting this - will stop the SQLInjection attempts



Use CFQUERYPARAM - more secure, more performance.

~~~~~~~~~~~~
Path Traversal -

avoid/protect referencing pages
site.com/go.cfm?page=hello.cfm
Can becomre
site.com/go.cfm?page=../../some/file.txt


~~~~~~~~~~
CRLF Inection
CRLF=\r\n %0d%0A

You can insert a header into a page by adjusting things pushed into a content type.

NOTE: This can drop into CFMAIL by adding a content-type in a form -- WE SHOULD CHECK FOR THIS.

Solution is like this:

cfset form.subject=ReReplace(form.subject,"[\r\n]","","ALL")
~~~~~
Insecure File Upload

You can upload files that are actually CFM. Not just check content type, check filename and upload outside the webroot.

--- GREAT COMMAND: ab
Apache Benchmark - useful for doing quick/dirty load test and performance.


~~~
Use whitelists over blacklists
ALLOW jpg,pdf,png
instead of
BLOCK cfm cfc jsp



~~~~~

SQL INJECTION

Allows sql commands into the URL ?id=1234;SOME SQL HERE
Demos of how they work.


uSe CFQUERYPARAM

(yeah we know, but the demos were pretty cool!)

One place to check is SELECT TOP n

Change to:

SELECT TOP #int(Val(n))#

Val() returns 0 when it can't recognize a number (this could be useful in the degree symbol problem)

~~~~~

XSS Hacking

You can put a script snippet in a URL

page.cfm?name=bob <script>replace a div</script>

Make sure you escape characters (use XMLFormat ) or OWASP (ESAPI)

http://www.owasp.org/index.php/Main_Page

This provides a Valid/Safe HTML validator: AntiSamy

http://blog.pengoworks.com/index.cfm/2008/1/3/Using-AntiSamy-to-protect-your-CFM-pages-from-XSS-hacks

Which we could use for the forecasters.

~~~~~~~

SESSION HACKING
use addtoken=false in cflocation
use UUID fro CFToekn
Use HTTPOnly session cookies
Use Secure cookies for SSL
Use SSL
Cookie path attribute.


CROSS SITE REQUEST FORGERY
Hard to explain.
Solution, use POST for submits.
CHeck that referers of forms are your own site.
Compare hidden form variable with session variable


SUMMARY:
Validate Everything
Become a regexpert
Check ALL inputs
Be paranoid
Keep Learning











Extending Java With ColdFusion


http://www.rupeshk.org/blog/


Coldfusion IS java



JEE APP SERVER - JAVAAPP
CF APP
JAVA APP2
CF APP2 etc


ALl the objects in CF are in Java and vv (eg strings, querys, arrays, numbers)


WHY?
CF use Java? - take advantage of libraries. Features not available in CF, eg EHCACHE, Hibernate. iText, Webchart

WHY
Java use CF? (*** THIS COULD BE A WAY TO MIGRATE BW TO CF SLOWLY)
Easy, Rapid development, readymade services


CF use Java
Java CFX Tags. (write in java, serve in CF)
JSP/Servlets/tag libraries.


We are Talking about Direct invocation:

createObject("java",className) CFCFOBJECT type="java" class="classname" name="variable">

invoke using:

obj.foo(arg1,artg2)


eg

cfobject type="java class="java.lang.StringBuffer" name="bigg"
cfset buf.init("CfUnited")
cfset buff.append(" 2010")

(I cant type fast enough - hope its available after)

Basically he's going through demos of how to call java from CF and vice-versa
















Lunch Thursday


Lunch with Ben Nadel, and Yaron (from shoesforcrews.com) and a guy from an Insurance Company (don't remember his name)

We spoke at length about the problems we face with slowdowns, bottlenecks and so on. the universal response is "get Fusion Reactor" - you're not hunting blind.

The other refrain was "index your tables' which we know about, but it's probably worth running the query analyzer for a long time, during a quiet period on the site, and seeing what it comes up with. Running the QA during firefighting is not giving us enough insight.

Other things we discussed:
Adding a "block" feature to our cache code (Shea can expand on this) but basically having a double level of caching that only ever lets ONE person make new cache content.

Something else really cool that I don't remember... (it'll come to me)


New Caching Features in ColdFusion 9

Here we go...

http://aaronwest.net

All code will be available in a zip download from his Blog 15 minutes after presentation...

Blog link with more info from the presentation..
http://www.aaronwest.net/blog/index.cfm/2010/7/29/My-CFUnited-2010-Session-Content-New-Caching-Features-in-ColdFusion-9

CF Community Keynote

Places to find help
#coldfusion Twitter
htp://www.tweetpml.org/colfusion-bologgers/
http://www.listorious.com/aqlong/coldfusion/
http://www.CF411.com
http://groups.adobe.com/pages/usergroups
http://occfug.groups.adobe.com/

Conferences, mailing lists, books, CF Web App contraction book, etc.

Done. No more shameless self promotion...

Making Bad Code Good

Given by Dan Wilson - DataCurl

Very broad overview of reasons we write bad code. Generally , every reason we are rushing day in and out to push our code for the build. Kind of seemed like a principle yelling at us for running in the halls.

Some very broad ideas:
- Change Boolean evaluations into functions
- Try never to nest conditionals even thou they may be easier to develop at first, someone else doesnt need to go through the same process you did just to make a small change
- Its not always about writing less lines of code, sometimes its better to write larger functions then smaller ifelse so others can read the true function of the conditional or loop easier
- Put evaluations at the top in silents and configurations so someone can easily modify setups.

Broad elementary discussions on the advantages of commenting

Since we are using SVN, why would we comment out large blocks of code, use small comments with revsions stated to make files easily readable by others

Save money on kb being sent:
- Use upper level styles and less lower level duplication of styles
- Put those styles stored externally and loaded into the browser only once on the site
Example: use the over with classes for header areas

Stop Code:
put conditionals that stop the rest of the page from processing at the top to save kbs and time for others reading

Elementary overview of why descriptive naming is import and why common naming is bad

Strong final emphasis on using var scoping to prevent var leaking.

Making bad code good...

OK,

Had to do it..
Left that other one... Wow, horrible.

Be explicit

Example:

<cfset aThing = false>
<cfloop query="blah">
<cfif something IS true>
<cfset aThing = true>
</cfif>

<cfif NOT aThing>
sfsdf
</cfif>

Use this instead..

<cfif aThing IS true>
asdsas
</cfif>

Inline classes with lots of code, like
<td class="rowBody">

Should be set in CSS to avoid extra bandwidth usage..

More text means more noise..

Rule 1: Be clear, or be clearer..
So, if something is shorter doesn't mean its better.

Start with things that get you out of the file vs all the positive statements..
If you don't meet the conditions, get out of the file..

Look at <cfontent type="text/plain" reset="yes"> to control whitespace...
Example was outputting xml content inline without worry about including whitespace at top of file...

Mixing in <cfscript> just to "feel" more programmy, stop doing it... Harder to debug and more lines of code overall..

Stop naming variables like objX, give them names that people can follow if they need to go through code later (including yourself)

Similarly name queries with meaningful names, so it makes it easier to debug.

CF and the Open Source Landscape

"Once upon a time, if you wanted to develop applications in ColdFusion, you had to pay for any third party tools you needed - and you rarely got the source code. Things have changed! These days there are free and open source options right across the board to help you get your job done faster, cheaper and with more confidence. Find out how the burgeoning open source community can help you - and, perhaps, how you can help the open source community in return!"

~~~
Open Source can be better quality than Proprietary - Apache, Linux, because they have so many eyes on the code.

~~~
Key is the copyright license.
~~~
So far this is a talk more about the concepts of Open Source... he's just starting into CF specifics.
~~~
CF Exchange - mostly paid.
Why is CF so small? - Historically
PHP/Linux were OS from the start - have that mindset.
- CF was originally Windows and Proprietary, that continued.
Now?
Frameworks changed that - Fusebox, ModelGlue etc.
RIAForge - is almost all CF (720)

Applications in CF?
BlogCFC
Mango Blog
Only forum: Galleon
Mura /FarCry- CMS
Tools:
CFEclipse http://www.carehart.org/cf411/#tools


CFML Engines:
Smith Project (CF6)
Open Blue Dragon (Cf7 - but moving up)
Railo (Cf9+extensions)


4CFF: For ColdFusion Foundation - http://4cff.org - just started... rolling out soon.


Social Coding:
SVN
GIT
codesion
unfuddle
assembla
github : This apparently is the best of the lot.



Accessible Javascript

I'm alive... We'll see how this goes from there...

Section 508.. Wow, serious?

ADA?? http://www.ada.gov/adastd94.pdf

(Who is this person?)

Accessibility:
Development of Information Systems flexible enough to Accommodate the needs of the broadest range of users, regardless of age or disability...

God, this is so boring so far...

Accessibilty constraints in Javascript...

Worthless to us...

Wednesday Night



Leesberg has rednecks! In the Downtown Saloon you can smoke, strip, and play any kind of music: Country OR western!




Wednesday, July 28, 2010

ColdFusion and jQuery: Two Great Tastes that Go Great Together

More of an introduction, but we'll see if there are any useful nuggets..

<cfmap> example to start off...

CF9 - New tag cfmediaplayer

CF8 - cfwindow

ColdFusion uses extjs behind the scenes.

<cfajaximport tags="cfmediaplayer">

href="javascript:ColdFusion.Window.show('my_window')">link</a>

Then use
<cfwindow name="my_window"
otherAttributes>

OR

href="javascript:ColdFusion.Mediaplayer.stopPlay("companyVideo");">Video</a>


Guy talks really fast. Interesting, but I think I may wait on any other stuff until after the conference when more detailed info is available on this talk.

Make Your Model Promiscuous



Hmmm...,
This was an odd presentation on how using a MVC (Model View Controller) approach makes translating, moving and maintaining code simple.

Sadly - not one of the demos worked!


Look at www.boyzoid.com for working demos later this week.


How to read a stack trace

Longer stacks are generally longer running..

Use multiple stack traces to view "motion" over time.

(Native Method)
When java hands things off to C and allowing native system to handle things..
Example: java.net.SocietInputStream.socketRead0 (Native Method)
May say "runnable" but JVM doesn't really know, because its handed things off to the system to handle..

jrpp

Threads that start with this are all jrun worker threads.
EX: "jrpp-1234"

When jrun talks to the web server it uses jrpp.
Ex: jrun.servlet.jrpp.JRunProxyService.createRunnable or jrun.servlet.jrpp.JRunProxyService.accept (missed that part)


CfmServlet.service is the ColdFusion service

_factor indicates a decision point (like cfif, cfcase etc..)

macromedia.jdbc.base.BaseStatement = SQL Server JDBC driver

TDSRequest - Way to communicate with db. (Wire protocol for SQL Server)

99% of time when its the SQL Server, its because there's not a good index on the table, and a full table scan needs to be performed.

If we see a lot of coldfusion.runtime near the top of the stack, its probably that the CPU is busy, vs there being an I/O issue.

SeeFusion Demo:
http://demo.seefusion.net:8999/

You can look at sample stack traces from there..


Recognizing Stack Elements

Look for "runnable" threads to find busy processes..

Jrun.* - Jrun
Ignore: jrun.servliet.jrpp.ProxyEndpoint.readyFully
Suspect: jrun.servliet.jrpp.JrppOutputStream$SpillStream.write

Coldfusion.*
Functions: coldfusion.runtime.CfJspPage.*
Tags: coldfusion.sql.tagText.sql.QueryTag

Probably Innocent Java
java.util.*
java.lang.*

Suspicious Java
java.net.*
java.io.*

Your Code!
cfApplication2ecfm726408707.runPage(D:\Websites\blah.cfm\Application.cfm:577)


If the error contains 'bin' its very possible that its the JVM that's taken a dump.

More info will be posted tonight on http://www.darylb.net/

Cache Me If You Can

Great presentation on the concepts and practicalities of caching, (not really on specific code)

Download full thing here:

http://tinyurl.com/cacheme


Some key points.

Caching is Important. Very Important:














We might want to look at SQUID or VARNISH caching (httpd caching in front of servers)
Consider lighttpd for image serving. Remove the load from CF boxes

Consider the "Small Increment graph" - this is key. By even putting caching at levels of seconds or minutes, you can achieve dramatic decreases in server strain.
















Try Cheating!

Put all local info in cookie or similar, and serve that to the user to give the impression of instantaneous updates, but only do the work later when you have resources available.



Lunch etc..

Rather good lunch of Chinese food and great desserts..

Chatted with a few people and exchanged some business cards.

We spotted Charlie Aerhart before his ColdFusion Builder presentation and introduced ourselves (or at least wanted to let him know we were from Surfline and thanks for the help he gave us before.)

Nothing really specifically relevant being talked about during this time, so we're kind of taking a break, checking emails etc..
Although ColdFusion builder does look pretty cool. Basically an eclipse style IDE for ColdFusion. Charlie says it works with Linux and under CF8.

Before lunch we caught up with the Fusion Analytics "booth" and saw some stuff on that. Basically, it's an analytics program that works hand in hand with Fusion Reactor to analyze all the data that comes back. They claim Fusion Reactor takes up no more than 1% of the processor to run and it does look pretty amazing, when joined with Fusion Analytics. Its a per-instance license, but we may want to seriously consider it. There's a 10-day free trial. We should get everything lined up time-wise and try it out, so we can get the most out of the demo.

The upcoming 2:45-3:45 time slot has two presentations that I want to go to "Cache me if you can", given by the same presenter that introduced the ehcache stuff earlier at the keynote as well as "Advanced T-SQL", which I'd like to go to because I'm kind of the de facto DB guy, and should probably be up to speed on things like that... I may end up going to the cache one, though... Decisions, decisions..

-Shea

RAILO



Can't afford CF9? (7k PER SERVER) - Railo is free.


I just spoke to the Railo guys. It seems like this thing will do exactly what we want, (and more) with absolutely (they promise) no migration problems at all.

In addition there are some additional tags in RailoCF - notably an expanded and more capable caching system (kinda like our idea a while back) of having a switchable file/db/mem/cloud destination for cached information.

I think it's worth trying it on one server and see what happens. Apparently the installer will guide you through a migration from CF8/9 to Railo and requires no changes at all to the site codebase. They also suggest that for a fraction of the cash we save on a license, we spend it on their consulting services to get us up to speed fast and efficiently.

More info:



CF and HTML 5 - Shea

HMTL5: The cool, the really cool, and the "huh?"

Supported in major browsers.
IE 9 pledges support for HTML5 features.

New nodes in doc outline, to allow use of <h1><h2> etc tags in the doc outline in unique nodes.

<header> elemeent - can be used at page top OR at the head of a block of content <article> for example.
Similar with <footer> element.
<hgroup>

Sectioning elements
<section> - generic section of thematically consistent content, may not make sense on its own.

<article> - Represents an assembly of content that can be self-contained and reusable - makes sense on its own.

<nav>

<aside>

<time> - ISO Format 
attributes:
datetime, pubdate
Ex: <time datetime="1776-07-04">July 04, 1776</time>


HTML 5 Shiv (Shim)
Avail on Google docs

Be sure to use css to style elements as block (display:block) for support by other browsers.

<figure> - illustrative piece of content, images or even code snippets..

<script> no need for type or language spec, just use <script>

FORMS

placeholder attribute of <input> types.  Like value, but in newer browsers, it will erase as you click on it.

Other attributes..
type=""
search
tel
url
email
date
month
week
time
datetime-local
iPhone keyboard will be sensitive to the type of input you're using.. tel shows a number pad, url shows more URL specific keypad, etc..

Modernizr
http://modernizr.com

CSS3 Properties
HTML5 Properties
Adds support for HTML5 elements


<video>
IE 9 has announced support

<video src="myvideo.ogv" width="320" height="240" autobuffer>

</video>
autobuffer, or autoplay etc..

Can use a <source> element, which can be multiple options for different browser supports.

<video src="myvideo.ogv" width="320" height="240" autobuffer>
<source src="pr6.mp4" type="video/mp4">
<source src="pr6.webm" type="video/webm">
<source src="pr6.ogv" type="video/ogg">
</video>

Need server to specify correct mime types for this to work ok..

In html5 video is part of the DOM.  Can be styled and manipulated.  Has its own javascript API.

http://videojs.com/


<mark> - Do nothing more than mark up a piece of content that wasn't originally intended to be marked up.
Makes things a bit more symantically relevant, vs using some irrelevant span tag..

GeoLocation (navigator.geolocation)
All browsers must ask for permission first.

Coldfusion One Liners


"So a CF programmer walks into a bar...."





















http://www.samfarmer.com/

UNDOCUMENTED: LOOPING OVER FILES:

cfloop file="somefile.txt" index="theline"
cfoutput #theline# /cfoutput
/cfloop



CF9: Cfdocument can convert MS doc <- > PDF

Build Structures in a line:

<cfset variables.mystructure="{AL="Alabama",DC="District of Columbia"}>


QUICK WAY TO DO MODULUS: (this will change alternate lines for example)
<cfif currentrow % 2>class="alt"</cfif>