cfug.be is opening it’s doors.
Author Archives: Joel
A quick note to all the wheels people
Watch out for the gotcha with 2 things.
1 – don’t use request scoped variables in the init of controllers. Wont work when you change the mode to testing. At All.
2 – if your using PascalNotation for your controllers, don’t forget to put hyphens in your views
Joel - Smarticles
Coldfusion on Wheels – our first journey together
Over the past few weeks, some of the guys at Smarticles have been building some CFWheels on Railo applications.
We have had a few points that we have had problems with, and others that have easy solutions.
Positives
Multiplatform without thinking
Getting the Railo environment ready on Mac, PC and Linux is a doddle. It makes multi-disciplinary teams possible, and easy. I set up the environment on my Mac, and sent the code to a PC guy, it just worked. I forgot to put transition time into the project plan – so it’s luck that there wasn’t any.
Really Quick to develop in
Once the initial day of head-scratching is over, Wheels is really really quick to develop in.
I love the convention over configuration approach. Its liberating to work with.
Form Handlers
For one of our applications we havent got a page design. But we have build lots of pages using the standard form handlers. We know that the html will be sensible, usable and rational. All we have to do is tweak the css into place.
Negatives
Only a couple:
Redirects
I still haven’t got the redirects to work. I don’t need them on the development environment. So its a backburner issue for me; not really a problem. Also some of the solutions look quite easy.
Contexts
The railo site talks about setting up contexts for each app. For the first app, this isn’t really required, and actually slows down the time to get a developer happy in the environment.
Other Thoughts
Documentation on slow connections
Some of the team work on very slow connections. This means that browsing a website for documentation sometimes slows them down. The API documentation wasn’t available as a download. We have it as a chm if anyone feels the need.
Partials
When we started development; we didn’t know about partials. If you want connect blocks in your code – partials are what you need.
Apple Slate pre-release picture
Great Green Question
My parents introduced me to global warming when I was 9 years old. For me it’s obvious, sensible and practical. As with all science; that could all be changed by one proof, one moment, or one idea that proves that it isn’t true. It’s easier to prove a negative.
Having said that. What are the upsides and downsides of going green without the global warming debate.
Upsides
Power of Positive Intention
People like positive things. By behaving in a sustainable way people will repect you for it and appreciate your passion.
Less Carbon Dioxide
For me this means less horrible fumes, smells and gases as I walk down the street. This also means people with asthma can breath more easily, and die less often.
People who drive stupid cars are perceived as stupid
When people drive a 5 litre V8 engine, in the modern world they should be embarrassed. Really Really embarrassed. Formula 1 cars go at 200 miles per hour, do 0-60 (0-100Kph) in 1.9 seconds, making your eyes pop out the back of your head. Formula 1 cars are 2.5 litre engined. 5 litre engines are *rightly* an embarrassment.
Less Consumption becomes a positive
I was born in the 80′s where the money-money-money culture fuelled a consumption culture. Now things are on there heads a little bit. Buying local, fuel efficient seasonal foods is being drilled into peoples heads. Where I got married this year, all the food came from within 50 miles. Proving your affinity with your locality is now positive. Although things cost more, you tend to buy less of them. Buying less, but quality things that last is one of the reasons the rich get richer.
Downsides
Price
Things that have the green label, “energy efficient” are given a premium. This could be marketing, or just technological. Green energy is more expensive.
Conclusion
What ever you think of the green debate I can’t see a downside, other than money, why we wouldn’t want to go lower-consumption even if Global Warming didn’t exist. As current evidence strongly suggests that it does, all the better.
What am I doing?
I dont drive for distances of less than 10 miles without a very good reason.
I travel by public transport everyday.
Smarticles a digital creative agency I founded with my friends, uses an environmentally aware datacentre.
I try to recycle as much as I can.
I know it’s not perfect, but hopefully, every little helps.
- Joel
Coldfusion with Wheels gains traction
Version 1.0 of coldfusion on wheels was released in late November.
I’ve been watching, and recommending this framework for a while. I recommend everyone taking a really good look at it.
There has been lots of speculation about it not gaining traction. In large organisations, or in large projects, people forget that frameworks can only be replaced when the existing application is redeveloped. In traditional risk-averse environments it can be many years between re-developments. Couple that with some really good frameworks like Coldbox, and Mach II and traction for Wheels could be pretty slow.That isn’t the frameworks fault, its just the way things happen. Sometimes a tipping point has to be reached before community projects explode into life.
All of this can only be aided by the release of the 1.0 release. Beta releases (except by Google) put people off, and hopefully this will mark a step change in peoples attitudes to wheels.
Joel – Smarticles
implicit getters and setters using CF
A few notes on implicit vs explicit getters and setters.
1) Coldfusion support in CF9 is enabled on the property tag as an attribute – not on by default
http://www.danvega.org/blog/index.cfm/2009/10/6/ColdFusion-9-Implicit-getters–setters-change
2) Coldfusion onMissingMethod
http://www.bennadel.com/index.cfm?dax=blog:868.view
Although Ben Nadel seems to dislike the thing ( it was a while back so maybe he changed his mind?) – and he’s being convinced in the comments. The performance affect was exceedingly marginal (<20ms).
An implementation of what I was talking about is here:
http://www.coldfusionjedi.com/index.cfm/2007/8/5/Warning-about-onMissingMethod – the warning relates to using the right arguments. Comments suggested changing find to comparing the first 3 characters to improve performance.
<cfcomponent name="entity_auto" extends="ColdFX.entity" output="false">
<cffunction name=”onMissingMethod” access=”public” returnType=”any” output=”false”>
<cfargument name=”missingMethodName” type=”string” required=”true”>
<cfargument name=”missingMethodArguments” type=”struct” required=”true”>
<cfset var key = “”>
<!— this includes arguments with set —>
<cfif left(arguments.missingMethodName,3) eq “set”>
<cfset key = replaceNoCase(arguments.missingMethodName,”get”,”")>
<cfif structKeyExists(variables, key)>
<cfreturn variables[key]>
</cfif>
</cfif>
<!— this includes arguments with get —>
<cfif left(arguments.missingMethodName,3) eq “get”>
<cfset key = replaceNoCase(arguments.missingMethodName,”set”,”")>
<cfif structKeyExists(arguments.missingMethodArguments, key)>
<cfset variables[key] = arguments.missingMethodArguments[key]>
</cfif>
</cfif>
<!— everything else still throws an error —>
</cffunction>
</cfcomponent>
If you want to turn on auto magic dynamic proxying all you do in your component is
<cfcomponent name="car" extends="ColdFX.entity_auto" output="false">
<cfproperty name="wheels">
<cfproperty name="engine">
<cffunction name=”init”>
<cfargument name=”wheels”>
<cfargument name=”engine”>
<cfset this.setWheels(arguments.wheels)/>
<cfset this.setEngine(arguments.engine)/>
</cffunction>
</cfcomponent>
HTML5 forms with jQuery links
I found some interesting blogs. One with an alternatives to the javascript forms library I linked to in my previous post. This one is written in jQuery, so if I’m building a jQuery app I know what to use.
jQuery plugin for html5forms, including browser support detection
http://www.newmediacampaigns.com/page/nmcformhelper
Styling post for html5forms
http://24ways.org/2009/have-a-field-day-with-html5-forms
If you find anything out there (prototype?) – let me know
Joel
Google Translated Search
I am in Belgium for my job, and sometimes searching the internet for stuff is annoying. If you search with English words, you are given a small fraction of the results that you would expect. I find myself translating, either in my head or on-line, the keywords into French and Dutch and then sorting through the results in the different languages until I find what I am looking for.
Therefore I was pretty happy when a new feature of Google search was announced. Google translated search was released this week, all you have to do is a normal search, click on Show Options and then choose Translated Search.
Search is then in multiple languages, interlaced by relevance.
I found it really useful, I wonder if I could use it as my default firefox search.
Joel
HTML5 Forms
This is a follow up on my previous post. It intends to go into greater detail about form fields in HTML 5.
Using HTML 5 Forms
Firstly webforms2 seems to have a javascript implementation so that you can use these in all modern web browsers. The library seems to be adapting itself, but should be pretty bombproof for html5 soon.
With this you can start using
<input type="email"/> <input type="date"/> <input type="url"/>
all immediately.
Required Fields
There are however some bonus options. I mentioned input required in my previous post – as my commenter points out – it should be:
<input required="required"/>
Bespoke Validation
There is also the neat pattern attributes which allows you to bespoke regular expression validation for a field
<input type="text" pattern="^([A-PR-UWYZ][A-HK-Y0-9][A-HJKS-UW0-9]?
[ABEHMNPRVWXY0-9]?{1,2} [0-9][ABD-HJLNP-UW-Z]{2})$" />
<!-- uk postal code -->
Placeholder
Placeholder is some text that provides a hint to the user about what to type. It isn’t the default value. I have seen this hacked in with Javascript several times before. Its a really good nice to have feature that can be implemented really cheaply.
Javascript and Handlers
For the form level. You can now call checkValidity() on the form to check the validity of the form.
When you submit a form using submit() with a scripted-submit tag present.
Finally if you want to do bespoke validations to a form and use the built in form validation. You can set a custom validity for the field using setCustomValidity(). An empty string indicates validity, anything else indicates an error.
Joel
