<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"> <channel><title>Marcos Placona Blog</title> <link>http://www.placona.co.uk</link> <description>ColdFusion, Ruby and General Technology</description> <lastBuildDate>Sat, 05 Nov 2011 23:19:44 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=</generator> <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/MarcosPlacona" /><feedburner:info uri="marcosplacona" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:browserFriendly></feedburner:browserFriendly><item><title>Mobile and Tablet development – My Saga I</title><link>http://www.placona.co.uk/702/mobile-development/mobile-tablet-development-my-saga-1/</link> <comments>http://www.placona.co.uk/702/mobile-development/mobile-tablet-development-my-saga-1/#comments</comments> <pubDate>Thu, 27 Oct 2011 07:27:00 +0000</pubDate> <dc:creator>Marcos Placona</dc:creator> <category><![CDATA[Mobile Development]]></category> <guid isPermaLink="false">http://www.placona.co.uk/?p=702</guid> <description><![CDATA[Reading time: 4 &#8211; 6 minutes So I believe by my last posts here you may have guessed I&#8217;ve been doing lots of mobile development in the last few months. It&#8217;s got nothing too do with work, as I do all of my mobile development on my spare time at home. So what brought me [...]]]></description> <content:encoded><![CDATA[<p>Reading time: 4 &#8211; 6 minutes</p><div
id="attachment_712" class="wp-caption alignleft" style="width: 310px"><a
href="http://www.flickr.com/photos/thegameway/5512101841/"><img
class="size-medium wp-image-712" title="Playbook" src="http://www.placona.co.uk/wp-content/uploads/2011/10/playbook1-300x228.jpg" alt="" width="300" height="228" /></a><p
class="wp-caption-text">Image by The GameWay</p></div><p>So I believe by my last posts here you may have guessed I&#8217;ve been doing lots of mobile development in the last few months.</p><p>It&#8217;s got nothing too do with work, as I do all of my mobile development on my spare time at home.</p><p>So what brought me to it?</p><p>I always felt like I was missing a big &#8220;piece of the cake&#8221; (which isn&#8217;t a lie btw) when seeing some of the people I relate to on a daily basis, talking about how cool mobile application development was.</p><p>Some things you can avoid, others you can only delay, and I know the latter was true in this case, but I was fighting really hard to let the laziness win.</p><p>Then came the Playbook, and RIM was offering to give one for each developer who successfully built and published an application for it before the launch of the device.</p><p>There was no way out this time. I love free stuff more than anything else, I&#8217;m one of those people who change their route when they know that if they pass through a certain place at a certain hour, there will be freebies being given. I queue for free bits of cheese at the supermarket *blush*.</p><p>So there I was, sitting in front of my computer with a trial copy of flash builder, and trying to make something I thought people would enjoy.</p><p>Then came the idea of building a Magic 8 Ball type thing (which later would have to be renamed and rebranded due to patent implications I wasn&#8217;t even aware of. But I&#8217;ll talk about this one on my next post).</p><p>In about 5 days and having no previous flex knowledge at all, but just some ActionScript, I had an application running on my simulator.</p><p>It was the coolest thing ever, it felt like the olden days of hacking through other people&#8217;s source code to <span
style="text-decoration: line-through;">steal</span> get JavaScript ideas.</p><p>I then went to the pretty <span
style="text-decoration: line-through;"> complicated</span> challenging process of getting my app signed and approved.</p><p>Rim, the company behind the Playbook (and blackberry) was completely overflowed with approval requests, and it took them good 20+ days to actually get my application approved. I made the cut first time though, which made me quite proud, since it was my first appearance on the &#8220;mobile scene&#8221;.</p><p>Because it got me so excited about the whole thing, I had my second app (<a
href="https://appworld.blackberry.com/webstore/content/36687?lang=en">Time Traveller</a>) approved even before the deadline before the launch was over. I built this very app several years ago in C, and used it a lot when I was travelling to help me get through the differences in timezones on the several countries in Europe I was going to. Except that this time, I built this one entirely using Rim&#8217;s Playbook Tablet SDK, which is optimized for the Playbook.</p><p>I then received my Playbook about 15 days after the US release, which meant I had it before it had been mentioned here in the UK. What a chick magnet that was <img
src='http://www.placona.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /></p><p>Getting the Playbook only gave me more stamina to build my third app, so I started with <a
href="https://appworld.blackberry.com/webstore/content/48676">Bonjour</a>, which is a French learning application that teaches you by pronouncing the words, and encouraging you to repeat then. Pretty cool stuff IMO.</p><p>It might be just me, but you can&#8217;t build an app that teaches people French, without also building one that teaches people Italian. It&#8217;s just wrong! So I couldn&#8217;t help but building <a
href="https://appworld.blackberry.com/webstore/content/50729?lang=en">Ciao</a>, which had exactly the same premise as Bonjour, but for the Italian language.</p><p>I put several hours in making sure the applications were useful and functional, and would attend the needs of all. For that reason, I made them available in 6 languages, so even if you can&#8217;t speak English, it&#8217;s very likely you will be able to speak either <strong>Spanish</strong>, <strong>Dutch</strong>, <strong>German</strong>, <strong>Portuguese</strong>, <strong>French</strong> or <strong>Italian</strong>.</p><p>You guessed right, I was very enthusiastic about the whole thing, and surely my mobile saga wouldn&#8217;t simply end here.</p><p>BUT I feel like I&#8217;ve already dragged this blog post for too long, so will continue my story on the next post, where I&#8217;ll be telling you what happened next, what patent problems I had with my Magic 8 Ball app, and what new apps I have released.</p><p>I will also talk about other markets, and what new applications I&#8217;m working on right now.</p><p>So stay tuned.</p> ]]></content:encoded> <wfw:commentRss>http://www.placona.co.uk/702/mobile-development/mobile-tablet-development-my-saga-1/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>E4X and XML with namespaces</title><link>http://www.placona.co.uk/692/flex/e4x-and-xml-with-namespaces/</link> <comments>http://www.placona.co.uk/692/flex/e4x-and-xml-with-namespaces/#comments</comments> <pubDate>Sun, 04 Sep 2011 21:05:36 +0000</pubDate> <dc:creator>Marcos Placona</dc:creator> <category><![CDATA[Adobe AIR]]></category> <category><![CDATA[Android]]></category> <category><![CDATA[Flex]]></category> <guid isPermaLink="false">http://www.placona.co.uk/?p=692</guid> <description><![CDATA[Reading time: 2 &#8211; 3 minutes Here&#8217;s is something that got me scratching my head for a little while today while working on my new mobile application. In my new application, I&#8217;ll be reading XML off various different providers, so I have an interface that gets implemented in various classes to make sure they all [...]]]></description> <content:encoded><![CDATA[<p>Reading time: 2 &#8211; 3 minutes</p><p>Here&#8217;s is something that got me scratching my head for a little while today while working on my new mobile application.</p><p>In my new application, I&#8217;ll be reading XML off various different providers, so I have an interface that gets implemented in various classes to make sure they all obey a certain contract, and I don&#8217;t need worry about what type they are (more on that later&#8230;)</p><p>With that in mind, I ended up implementing different logic on different classes since the XML returned will vary from provider to provider. I am using <a
title="ECMA Script for XML" href="http://en.wikipedia.org/wiki/ECMAScript_for_XML" target="_blank">E4X</a> to get the various information I need from the XML returned, and one of them would not work at all when selected.</p><p>I will put two XML examples here, and let you spot the difference:</p><pre class="brush: as3; title: ; notranslate">
var basket:XML =
	&lt;foods&gt;
	  &lt;fruit&gt;
		&lt;name&gt;Apples&lt;/name&gt;
		&lt;name&gt;Bananas&lt;/name&gt;
	  &lt;/fruit&gt;
	&lt;/foods&gt;;
trace(basket..fruit.name[0])
</pre><p>And that should return &#8220;Apples&#8221;.</p><p>Nothing new here, now for the second example:</p><pre class="brush: as3; title: ; notranslate">
var basket:XML =
	&lt;foods xmlns=&quot;http://www.w3.org/TR/html4/&quot;&gt;
	  &lt;fruit&gt;
		&lt;name&gt;Apples&lt;/name&gt;
		&lt;name&gt;Bananas&lt;/name&gt;
	  &lt;/fruit&gt;
	&lt;/foods&gt;;
trace(basket..fruit.name[0])
</pre><p>At a first glance, I have to admit I was expecting apples as well, but to my surprise, I got&#8230; nothing&#8230;</p><p>It took me a while to to go look on the XML again, and then it hit me. This provider would give me XML with a <a
title="XML Namespace" href="http://en.wikipedia.org/wiki/Namespace_(computer_science)#XML_namespace" target="_blank">namespace</a>, and in order to read that with E4X, I would need to declare that namespace. There is absolutely nothing wrong with the code above, but it simply won&#8217;t find anything since you&#8217;re not declaring what the namespace is, and the compiler gets completely lost.</p><p>What you need to do is declare the namespace on the top of my code like so:</p><pre class="brush: as3; title: ; notranslate">namespace items = &quot;http://ns.imageshack.us/imginfo/7/&quot;;
use namespace items;
trace(basket..fruit)</pre><p>How you name it doesn&#8217;t matter, but it&#8217;s important that it&#8217;s unique, so in case you&#8217;re reading from multiple XML files on the same class, you should be using different names, otherwise you will get compiling errors.</p> ]]></content:encoded> <wfw:commentRss>http://www.placona.co.uk/692/flex/e4x-and-xml-with-namespaces/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Background colour in a label control in AS3</title><link>http://www.placona.co.uk/676/adobe/background-colour-in-a-label-control-in-as3/</link> <comments>http://www.placona.co.uk/676/adobe/background-colour-in-a-label-control-in-as3/#comments</comments> <pubDate>Mon, 27 Jun 2011 21:33:52 +0000</pubDate> <dc:creator>Marcos Placona</dc:creator> <category><![CDATA[Adobe]]></category> <category><![CDATA[Adobe AIR]]></category> <category><![CDATA[actionscript 3]]></category> <category><![CDATA[as3]]></category> <category><![CDATA[playbook]]></category> <guid isPermaLink="false">http://www.placona.co.uk/?p=676</guid> <description><![CDATA[Reading time: 1 &#8211; 2 minutes This is just a quick example of how to add a background colour to a label control in AS3. Most people don&#8217;t know, but the label component has a TextField inside of it. What that means is that you can basically use all of the available methods within the [...]]]></description> <content:encoded><![CDATA[<p>Reading time: 1 &#8211; 2 minutes</p><p>This is just a quick example of how to add a background colour to a label control in AS3.</p><p>Most people don&#8217;t know, but the <a
title="AS3 Label Component" href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/fl/controls/Label.html">label component</a> has a <a
title="AS3 TextField component" href="http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/text/TextField.html">TextField</a> inside of it. What that means is that you can basically use all of the available methods within the TextField in a label. Here&#8217;s an example of how to add a background colour to a label.</p><pre class="brush: as3; title: ; notranslate">import fl.controls.Label;
// If you were doing Playbook development
// import qnx.ui.text.Label;
 
var lblName:Label = new Label();
lblName.textField.background = true;
lblName.textField.backgroundColor = 0xFFFFFF;
addChild(lblName);</pre><p>And that&#8217;s it. You now have a label with a white background. Seems pretty simple, but what is cool here, is the fact that your label can have pretty much the same behaviour as a text field, and you can modify it as you would in a text field.</p> ]]></content:encoded> <wfw:commentRss>http://www.placona.co.uk/676/adobe/background-colour-in-a-label-control-in-as3/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>SQLite databases and mobile applications – A caveat</title><link>http://www.placona.co.uk/665/flex/sqlite-databases-and-mobile-applications-a-caveat/</link> <comments>http://www.placona.co.uk/665/flex/sqlite-databases-and-mobile-applications-a-caveat/#comments</comments> <pubDate>Mon, 06 Jun 2011 13:18:41 +0000</pubDate> <dc:creator>Marcos Placona</dc:creator> <category><![CDATA[Adobe]]></category> <category><![CDATA[Adobe AIR]]></category> <category><![CDATA[Flex]]></category> <guid isPermaLink="false">http://www.placona.co.uk/?p=665</guid> <description><![CDATA[As some of you might have noticed, I have been building some mobile applications lately on my spare time specifically for the Blackberry Playbook. They are mainly built in Adobe Air using Actionscript 3 and Blackberry's Tablet SDK.
On my latest application, I have found the need for a database, as it needs to store lots of user input data. The first option that comes to mind is SQLite, as it's very simple to integrate, and has native support.
I will show here an integration example, and focus on a caveat I found while trying to use it on a real device.]]></description> <content:encoded><![CDATA[<p>Reading time: 2 &#8211; 4 minutes</p><p>As some of you might have noticed, I have been building <a
title="Magic Ball for Blackberry Playbook" href="http://appworld.blackberry.com/webstore/content/34957?lang=en" target="_blank">some</a> <a
title="Time Traveller for Blackberry playbook" href="http://appworld.blackberry.com/webstore/content/36687?lang=en" target="_blank">mobile applications</a> lately on my spare time specifically for the <a
title="Blackberry Playbook" href="http://www.amazon.co.uk/gp/product/B004UL34EY/ref=as_li_tf_tl?ie=UTF8&amp;tag=marplasblo-21&amp;linkCode=as2&amp;camp=1634&amp;creative=6738&amp;creativeASIN=B004UL34EY" target="_blank">Blackberry Playbook</a>. They are mainly built in Adobe Air using Actionscript 3 and Blackberry&#8217;s <a
title="Blackberry Tablet SDK" href="http://us.blackberry.com/developers/tablet/adobe.jsp" target="_blank">Tablet SDK</a>.</p><p>On my latest application, I have found the need for a database, as it needs to store lots of user input data. The first option that comes to mind is <a
title="SQLite" href="http://www.sqlite.org/" target="_blank">SQLite</a>, as it&#8217;s very simple to integrate, and has native support.</p><p>I will show here an integration example, and focus on a caveat I found while trying to use it on a real device.</p><p>For starters, here are the classes you need to import on your main class:</p><pre class="brush: as3; title: ; notranslate">import flash.data.SQLConnection;
import flash.data.SQLStatement;
import flash.filesystem.File;</pre><p>I then create a method to initialize my database connection:</p><pre class="brush: as3; title: ; notranslate">
private var dbConnection:SQLConnection = new SQLConnection;
private function initDB():void{
	var embededSessionDB:File = File.applicationDirectory.resolvePath(&quot;assets/db.sqlite&quot;);
	var writeSessionDB:File = File.applicationStorageDirectory.resolvePath(&quot;assets/db.sqlite&quot;);
	// If a writable DB doesn't exist, we then copy it into the app folder so it's writteable
	if (!writeSessionDB.exists) {
		embededSessionDB.copyTo(writeSessionDB);
	}
	var dbFile:File = writeSessionDB;
	dbConnection.open(dbFile);
}
</pre><p>What is important to mention here, is that most people (myself being one of them) will be completely tempted to skip the bit where it copies the local file (coming from the application itself) into the local storage. Funnily enough, if you skip this step, when you test it locally, it will all work wonderfully, but when you deploy it into a real device (or even a simulator) nothing happens at all.</p><p>After some research, I found out that you need to be using the database from the local storage, and just like this is that you will have read and write permissions.</p><p>After getting that small &#8220;detour&#8221; out of the way, I can go on and write my first query against that database.</p><pre class="brush: as3; title: ; notranslate">
private function getWords(intTabID:int):Array{
	var stmt:SQLStatement = new SQLStatement();
	stmt.sqlConnection = dbConnection;
	stmt.text = &quot;SELECT key, word FROM WORDS WHERE category_id = (:wordID)&quot;;
	stmt.parameters[':wordID'] = intTabID;
	stmt.execute();
	var result:Array = stmt.getResult().data;
	return result;
}
</pre><p>And this will return a nice array with all my data from the SQLite database.</p> ]]></content:encoded> <wfw:commentRss>http://www.placona.co.uk/665/flex/sqlite-databases-and-mobile-applications-a-caveat/feed/</wfw:commentRss> <slash:comments>8</slash:comments> </item> <item><title>Quick tip on Flash Builder and application internationalization</title><link>http://www.placona.co.uk/655/flex/quick-tip-on-flash-builder-and-application-internationalization/</link> <comments>http://www.placona.co.uk/655/flex/quick-tip-on-flash-builder-and-application-internationalization/#comments</comments> <pubDate>Wed, 01 Jun 2011 21:58:10 +0000</pubDate> <dc:creator>Marcos Placona</dc:creator> <category><![CDATA[Adobe]]></category> <category><![CDATA[Adobe AIR]]></category> <category><![CDATA[Flex]]></category> <category><![CDATA[Mobile Apps]]></category> <guid isPermaLink="false">http://www.placona.co.uk/?p=655</guid> <description><![CDATA[Reading time: 1 &#8211; 2 minutes I&#8217;m building a new Blackberry Playbook app, and when starting to work with internationalization, I got stuck with a bug that wouldn&#8217;t go away. I&#8217;m pretty sure this won&#8217;t just affect just this kind of application, but anything that is built using Flash Builder and requires resource bundle files. [...]]]></description> <content:encoded><![CDATA[<p>Reading time: 1 &#8211; 2 minutes</p><p>I&#8217;m building a new <a
title="Blackberry Playbook" href="http://www.amazon.co.uk/gp/product/B004UL34EY/ref=as_li_tf_tl?ie=UTF8&amp;tag=marplasblo-21&amp;linkCode=as2&amp;camp=1634&amp;creative=6738&amp;creativeASIN=B004UL34EY" target="_blank">Blackberry Playbook</a> app, and when starting to work with internationalization, I got stuck with a bug that wouldn&#8217;t go away. I&#8217;m pretty sure this won&#8217;t just affect just this kind of application, but anything that is built using Flash Builder and requires resource bundle files.</p><p>It&#8217;s a pretty common standard to name resource bundle files as *.properties, but it turns out Flash Builder ignores *.properties files when packaging, and you end up with an error like:</p><pre><span style="color: #ff0000;">Error: Error #3003: File or directory does not exist.</span></pre><p>It actually took me quite a long time to figure that one out, since I was pretty sure the files were in the correct location. Changing the file extension to .prop did the trick, and now Flash Builder will package them successfully.</p><p>I believe there must be another way in Flash builder settings to make it not ignore *.properties files, but for the time being, simply renaming its extension will do.</p><p>Hope that helps someone in the future searching for this error.</p> ]]></content:encoded> <wfw:commentRss>http://www.placona.co.uk/655/flex/quick-tip-on-flash-builder-and-application-internationalization/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Adobe Flash Player 10.2 beta</title><link>http://www.placona.co.uk/633/adobe/adobe-flash-player-10-2-beta/</link> <comments>http://www.placona.co.uk/633/adobe/adobe-flash-player-10-2-beta/#comments</comments> <pubDate>Fri, 03 Dec 2010 12:39:02 +0000</pubDate> <dc:creator>Marcos Placona</dc:creator> <category><![CDATA[Adobe]]></category> <guid isPermaLink="false">http://www.placona.co.uk/?p=633</guid> <description><![CDATA[Reading time: 1 &#8211; 2 minutes Ok, I know I&#8217;m late on this, but I just thought I&#8217;d register here that Adobe Flash Player 10.2 has just been released on the Adobe Labs this week. A few of it&#8217;s key features are: Stage Video hardware acceleration Internet Explorer 9 hardware accelerated rendering support Native custom [...]]]></description> <content:encoded><![CDATA[<p>Reading time: 1 &#8211; 2 minutes</p><p>Ok, I know I&#8217;m late on this, but I just thought I&#8217;d register here that Adobe Flash Player 10.2 has just been released on the <a
title="Adobe Labs" href="http://labs.adobe.com/technologies/flashplayer10/" target="_blank">Adobe Labs</a> this week.</p><p>A few of it&#8217;s key features are:</p><ul><li>Stage Video hardware acceleration</li><li>Internet Explorer 9 hardware accelerated rendering support</li><li>Native custom mouse cursors</li><li>Support for full screen mode with multiple monitors</li></ul><p><span
id="more-633"></span></p><p>Here&#8217;s a video preview from Adobe Max 2010:</p><p><object
width="640" height="390"><param
name="movie" value="http://www.youtube.com/v/geK7geL3I40&#038;rel=0&#038;hl=en_US&#038;feature=player_embedded&#038;version=3"></param><param
name="allowFullScreen" value="true"></param><param
name="allowScriptAccess" value="always"></param><embed
src="http://www.youtube.com/v/geK7geL3I40&#038;rel=0&#038;hl=en_US&#038;feature=player_embedded&#038;version=3" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="640" height="390"></embed></object></p><p><a
title="Download Flash Player 10.2 beta" href="http://labs.adobe.com/downloads/flashplayer10.html" target="_blank">Download the Flash Player 10.2 beta</a></p> ]]></content:encoded> <wfw:commentRss>http://www.placona.co.uk/633/adobe/adobe-flash-player-10-2-beta/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>Object-Oriented Programming in ColdFusion</title><link>http://www.placona.co.uk/625/coldfusion/object-oriented-programming-in-coldfusion/</link> <comments>http://www.placona.co.uk/625/coldfusion/object-oriented-programming-in-coldfusion/#comments</comments> <pubDate>Sun, 28 Nov 2010 22:09:31 +0000</pubDate> <dc:creator>Marcos Placona</dc:creator> <category><![CDATA[Adobe]]></category> <category><![CDATA[Book Reviews]]></category> <category><![CDATA[Books]]></category> <category><![CDATA[CFML - 101]]></category> <category><![CDATA[coldfusion]]></category> <guid isPermaLink="false">http://www.placona.co.uk/?p=625</guid> <description><![CDATA[Reading time: 1 &#8211; 2 minutes I know it must be pretty old news by now that Matt Gifford has written a book called Object-Oriented Programming in ColdFusion. I&#8217;ve been approached by the folks at Packt last week and asked to read it and write a review about the book. I&#8217;m still waiting for it [...]]]></description> <content:encoded><![CDATA[<p>Reading time: 1 &#8211; 2 minutes</p><p><iframe
src="http://rcm-uk.amazon.co.uk/e/cm?lt1=_blank&#038;bc1=000000&#038;IS2=1&#038;bg1=FFFFFF&#038;fc1=000000&#038;lc1=0000FF&#038;t=marplasblo-21&#038;o=2&#038;p=8&#038;l=as1&#038;m=amazon&#038;f=ifr&#038;md=0M5A6TN3AXP2JHJBWT02&#038;asins=1847196322" style="width:120px;height:240px;float: left; margin-right: 10px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe></p><p>I know it must be pretty old news by now that Matt Gifford has written a book called <a
title="Object-Oriented Programming in ColdFusion" href="https://www.packtpub.com/object-oriented-programming-in-coldfusion/book" target="_blank" class="broken_link">Object-Oriented Programming in ColdFusion</a>.</p><p>I&#8217;ve been approached by the folks at Packt last week and asked to read it and write a review about the book.</p><p>I&#8217;m still waiting for it to be delivered, but will be writing the review as soon as I&#8217;m done with the book. In the meantime, you can have a sneak peek of the <a
href="https://www.packtpub.com/sites/default/files/6323-chapter-1-introducing-coldfusion-components.pdf">sample chapter</a> or <a
title="Buy the book" href="http://www.amazon.co.uk/gp/product/1847196322?ie=UTF8&amp;tag=marplasblo-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=1847196322">buy the book</a> directly.</p> ]]></content:encoded> <wfw:commentRss>http://www.placona.co.uk/625/coldfusion/object-oriented-programming-in-coldfusion/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>Nifty jQuery tricks – Ajax Events</title><link>http://www.placona.co.uk/611/jquery/nifty-jquery-tricks-ajax-events/</link> <comments>http://www.placona.co.uk/611/jquery/nifty-jquery-tricks-ajax-events/#comments</comments> <pubDate>Mon, 04 Oct 2010 10:00:37 +0000</pubDate> <dc:creator>Marcos Placona</dc:creator> <category><![CDATA[JQuery]]></category> <guid isPermaLink="false">http://www.placona.co.uk/?p=611</guid> <description><![CDATA[Reading time: 2 &#8211; 4 minutes As previously mentioned on my other post, I&#8217;m working on improving usability and user experience within one of our applications. This application has a somehow complex authentication system managed by Fusebox. In one of our screens, we&#8217;ve replaced most of the page refreshes with ajax calls, so on the [...]]]></description> <content:encoded><![CDATA[<p>Reading time: 2 &#8211; 4 minutes</p><p>As previously mentioned on my <a
title="Placona - Nifty jQuery tricks – Avoid Cache" href="http://www.placona.co.uk/606/jquery/nifty-jquery-tricks-avoid-cache/">other post</a>, I&#8217;m working on improving usability and user experience within one of our applications.</p><p>This application has a somehow complex authentication system managed by <a
title="Fusebox" href="http://www.fusebox.org/" target="_blank">Fusebox</a>.</p><p>In one of our screens, we&#8217;ve replaced most of the page refreshes with ajax calls, so on the table of contents, the user can modify anything, and it gets saved automatically upon confirmation without the need for clicking buttons or reloading the page.</p><p>Our QA soon noticed that if during the process of browsing the page and updating something you got yourself logged out, the authentication system would kick off (as it runs per request), and the whole page would get a bit screwed.</p><p>An example of this would be:</p><p><img
class="alignnone" title="Ajax Driven Page" src="http://files.placona.co.uk/nifty_jquery_tricks_ajax_events/mockup_small.png" alt="Ajax Driven Page" width="300" height="202" /></p><p>When clicking on each of the tabs, they would trigger an Ajax call to a dynamic page that would return some HTML. this HTML would fill up the internal div and display the contents without refreshing.</p><p>Now, if while clients were viewing this page they decided to go for a cup of tea and clicked on a tab when they came back after 15 minutes, the following would occur:</p><p><img
class="alignnone" title="Ajax Driven page screwing things up" src="http://files.placona.co.uk/nifty_jquery_tricks_ajax_events/mockup2_small.png" alt="Ajax Driven page screwing things up" width="300" height="185" /></p><p>That isn&#8217;t the right behaviour, as the browser is supposed to redirect the user to a login page, and not display this page inside the tabs. in this situation, no matter what the client do, clicking the tabs will always take them to the same screen, which could confuse them.</p><p>To get around this, I need to have some kind of hook that will check if the user is logged in before any Ajax requests are made.</p><p>Come jQuery to the rescue!</p><p>When using any of the Ajax capabilities available through jQuery, you can register a handler to be called when the  request begins.</p><p>This can be accomplished with <a
title="jQuery - ajaxStart()" href="http://api.jquery.com/ajaxStart/" target="_blank">ajaxStart()</a>. it will kick off whenever you make an Ajax request, and in this case, it works a treat, as it will go through my authentication system, and redirect the page to the login screen should the user have been logged in.</p><p>A simple code sample for this would be:</p><pre class="brush: jscript; title: ; notranslate">
$(this).ajaxStart(function() {
     $.ajax({
           url: 'index.cfm?fuseaction=c_common.islogged',
           success: function(data, event) {
             //check the results of the authentication page here
           }
     });
});
</pre><p>You can also use <a
title="ajaxStop - jQuery" href="http://api.jquery.com/ajaxStop/" target="_blank">ajaxStop()</a> for the exact same effect, but only getting triggered when the Ajax call is finished.</p> ]]></content:encoded> <wfw:commentRss>http://www.placona.co.uk/611/jquery/nifty-jquery-tricks-ajax-events/feed/</wfw:commentRss> <slash:comments>8</slash:comments> </item> <item><title>ColdFusion 9 Developer Tutorial – Book Review</title><link>http://www.placona.co.uk/594/coldfusion/coldfusion-9-developer-tutorial-book-review/</link> <comments>http://www.placona.co.uk/594/coldfusion/coldfusion-9-developer-tutorial-book-review/#comments</comments> <pubDate>Sun, 03 Oct 2010 18:00:55 +0000</pubDate> <dc:creator>Marcos Placona</dc:creator> <category><![CDATA[Adobe]]></category> <category><![CDATA[Book Reviews]]></category> <category><![CDATA[Books]]></category> <category><![CDATA[coldfusion]]></category> <guid isPermaLink="false">http://www.placona.co.uk/?p=594</guid> <description><![CDATA[Reading time: 8 &#8211; 12 minutes Book reviewer Marcos Placona &#124; Publisher: Packt &#124; Author: John Farrar The book starts with a very brief introduction to ColdFusion, and what the basic language capabilities are. On chapter 1 &#8211; Web Pages &#8211; Static to Dynamic The author begins by explaining what variables are for, and then [...]]]></description> <content:encoded><![CDATA[<p>Reading time: 8 &#8211; 12 minutes</p><p><em>Book reviewer Marcos Placona | Publisher: Packt | Author: John Farrar</em></p><p><iframe
src="http://rcm-uk.amazon.co.uk/e/cm?t=marplasblo-21&#038;o=2&#038;p=8&#038;l=as1&#038;asins=1849690243&#038;fc1=000000&#038;IS2=1&#038;lt1=_blank&#038;m=amazon&#038;lc1=0000FF&#038;bc1=000000&#038;bg1=FFFFFF&#038;f=ifr" style="width:120px;height:240px;float: left; margin-right: 10px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe></p><p>The book starts with a very brief introduction to ColdFusion, and what the basic language capabilities are.</p><p><strong><span
style="text-decoration: underline;">On chapter 1 &#8211; Web Pages &#8211; Static to Dynamic</span></strong></p><p>The author begins by explaining what variables are for, and then moves into strings and scopes. He then moves into structures, loops, arrays , conditional processing through if&#8217;s and case statements, and explains some of the wonders on exception handling. This chapter is merely a run through around the CFML language, and will help programmers familiar with the technology to understand the conventions used by the book through the code samples.</p><p><strong><span
style="text-decoration: underline;">Chapter 2 &#8211; Basic CFCs and Database Interaction</span></strong></p><p>Things start to get a bit more exciting on chapter two, where the topic moves into CFC creation, some objects (beans), and a little bit of database interaction. I like how basic terminologies are described here, and pretty much every example is showed through tags and scripting.</p><p>The book uses a very simple product management system as example, and the examples show what a bean object is, and what it can be used for. I could see the author did not focus too much on explaining what object oriented programming is, but the concept is shown through the whole book.</p><p>In this chapter, some simple database interaction is demonstrated, and at around page 60, you are already writing full blown objects, which are database reliant, and give you the ability to encapsulate most of the logic.</p><p><span
id="more-594"></span></p><p><strong><span
style="text-decoration: underline;">Chapter 3 &#8211; Power CFCs and Web Forms</span></strong></p><p>Things start to get a lot more interesting now, and the book starts to explain why restricting access to methods is so important. All of the four access types (public, private, package and remote) are described, and the author briefly exemplifies when which of them should be used.</p><p>Some more database examples are given here, and what was only a set of screen dumps with database objects on chapter two, starts to take some form, and the examples already show how to properly create, update and delete data from the database through in-line SQL. At this point, I reckon anyone who&#8217;s never seen ColdFusion, would be able to get a pretty good idea of its capabilities.</p><p><strong><span
style="text-decoration: underline;">Chapter 4 &#8211; ORM Database Interaction</span></strong></p><p>This is <a
title="ORM Database Interaction" href="https://www.packtpub.com/sites/default/files/0249-chapter-4-ORM-Database-Interaction.pdf">the chapter</a> everyone has been waiting for. The CFML language has used in-line SQL (or stored procedure calls) all along its 15 years, and a new way of interacting with databases was long overdue. Chapter 4 starts by taking you through the necessary steps to &#8220;ORM enable&#8221; your application and CFCs. In all honesty I was expecting to be put off by this chapter, as ORM in itself is a pretty big a complex subject. The author exposes the topic in a very nice way, and I felt really comfortable reading and coding through the examples.</p><p>ORM really seems magical, and will do wonders for small to medium projects, where high performance is not  the major concern.</p><p>The code samples are really fun to do, but I felt there was a lack of explanation on when and why people should be using ORM as opposed to the good old inline SQL or stored procedure calls.</p><p><strong><span
style="text-decoration: underline;"> Chapter 5 &#8211; Application, Session, and Request Scope</span></strong></p><p>After a very exciting chapter 4, the author touches back again on scopes, and starts to talk about the application.cfc, and what the life span for each of the scopes is. It&#8217;s not nearly as exciting or elegant as ORM, but as the request and session scopes are widely used across ColdFusion applications, it&#8217;s important to know what can, and what can&#8217;t be done with them, as well as settings you can apply to the through simple directives on the application.cfc</p><p>Again the author gives some examples on how these directives can be used in real life, and also shows some of the new cool things added to ColdFusion 9, such as the ability to create universal data sources, or setting custom tag paths per application.</p><p><strong><span
style="text-decoration: underline;">Chapter 6 &#8211; Authentication and Permissions</span></strong></p><p>This chapter describes the built-in authentication framework and methods that can be found inside ColdFusion. The example given here is a simple user login, where each group consists of a set of roles. This is particularly useful on CMSs, where only users within a specific group can interact with xyz system modules.</p><p>I specifically like how the author employs the cflayout tag to create the screens here.</p><p><strong><span
style="text-decoration: underline;">Chapter 7 &#8211; CFScript</span></strong></p><p>Every CFML developer has been waiting for this day to come, and it finally did on ColdFusion 9. ColdFusion is now fully &#8220;script-able&#8221;, and developers no longer need to write code through tags. Until ColdFusion 9, you were only able to use a limited set of functionalities with cfscript.</p><p>In this chapter, the author describes what each operator is, and exemplifies the most common functionalities through script. there aren&#8217;t too many things to be said here, and the examples pretty much show what needs to be shown.</p><p><strong><span
style="text-decoration: underline;">Chapter 8 &#8211; CF AJAX User Interface</span></strong></p><p>Everybody loves ajax, and ColdFusion has helper tags that will help you get up and running with it, even if you are not a JavaScript wizard. most of the examples given on this chapter are related to presentation and user interaction. a simple pod system is demonstrated, and after only a handful of lines, the example turns into a very interactive interface.</p><p>Things get a bit more colour once the author starts to describe the cfmap tag usage. this in my opinion is one of the most impressive new tags in ColdFusion 9. It allows you to interact with Google maps, and display live data on your website.</p><p>As every every back-end technology that generates JavaScript, the code becomes really obtrusive, and most very specific setting will need to be set through JavaScript.</p><p><strong><span
style="text-decoration: underline;">Chapter 9 &#8211; CF AJAX Forms</span></strong></p><p>This is pretty much an extension of chapter 8, but the author focuses a lot more on forms. ColdFusion has a nice set of built-in UI capabilities, and the examples here really demonstrate them in full colours. The first example  shows a product data-grid with pagination functionality. It also allows you to delete and update products &#8220;in-screen&#8221;, without the need for refresh.</p><p>Some other examples demonstrated here are:</p><p>Auto-complete field, date-picker, related drop-downs, wysiwyg editors, directory trees, message boxes and progress bars. All of them can mostly be accomplished in less than 10 lines of code, and look really slick.</p><p><strong><span
style="text-decoration: underline;">Chapter 10 &#8211; CF AJAX Programming</span></strong></p><p>I have to admit a got a bit bored of Ajax t this stage, and another chapter on Ajax seems a bit overkill. In fact, Ajax is a pretty extensive topic, and there&#8217;s entire books covering the topic from front to back.</p><p>In this chapter, the author demonstrates how to bind HTML objects, JavaScript, URLs and events to CFC&#8217;s. It also briefly touches debugging both on client and server side, as well as describes the functionality of each variable available through the ColdFusion JavaScript API.</p><p><strong><span
style="text-decoration: underline;">Chapter 11 &#8211; Introduction to Custom Tags</span></strong></p><p>Custom tags are mainly created for code reuse, and have been widely used for a long time. In this chapter, the author explains the differences between them and CFCs or includes.</p><p>The book exemplifies the usage of custom tags by building a dynamic page layout where common things such as the header and footer and invoked via custom tags.</p><p>At the end f the chapter, the author describes how the same results can be accomplished through  tag libraries or cfmodule.</p><p><strong><span
style="text-decoration: underline;">Chapter 12 &#8211; ColdFusion Powered Views</span></strong></p><p>This chapter shows how to manipulate the presentation layer with ColdFusion, and gives some very nice examples on how to manipulate the DOM with ColdFusion code. Basically, from ColdFusion you could for example modify the entire page style with the click of a button.</p><p><strong><span
style="text-decoration: underline;">Chapter 13 &#8211; Control Logic Processing</span></strong></p><p>It&#8217;s now time to put everything we learned in practice, and the book briefly explains MVC (model, view, controller). this is a very complete chapter, where the author has put a lot of effort to try and use most of what&#8217;s been explained in the previous chapters, but in a more organized way (through MVC)</p><p><strong><span
style="text-decoration: underline;">Chapter 14 &#8211; Guide to Unit Testing</span></strong></p><p>Unit testing is one of my favourite topics, hence, this is my favourite chapter. Most software developers don&#8217;t really know when, where or why a system needs to be tested. the most popular ColdFusion testing framework is called MXUnit, and is freely available for download.</p><p>In this chapter, the author exemplifies how and when to use unit tests as well as some simple assertions. He also shows what the different views for unit tests results can be used, and briefly touches built-in assertions.</p><p><strong><span
style="text-decoration: underline;">My personal notes</span></strong></p><p>It&#8217;s been a pleasure reading this book, and although I cold not really learn a lot from it, as it&#8217;s mostly targeted to new developers, I was able to update myself on many of the new functionalities included on ColdFusion 9. I don&#8217;t necessarily agree with all the code samples used on the book, and would not use some of the same approaches described by the author. That said, I think this is an amazing book for any ColdFusion developer at any level. It&#8217;s not the kind of book you will want to keep on your desk as reference, but surely is an excellent complement for any level of knowledge.</p><p>I&#8217;d like to leave here my special thanks to the fine guys at <a
href="http://www.packtpub.com/" target="_blank">Packt</a> who sent me this book for evaluation and technical review.</p> ]]></content:encoded> <wfw:commentRss>http://www.placona.co.uk/594/coldfusion/coldfusion-9-developer-tutorial-book-review/feed/</wfw:commentRss> <slash:comments>9</slash:comments> </item> <item><title>Nifty jQuery tricks – Avoid Cache</title><link>http://www.placona.co.uk/606/jquery/nifty-jquery-tricks-avoid-cache/</link> <comments>http://www.placona.co.uk/606/jquery/nifty-jquery-tricks-avoid-cache/#comments</comments> <pubDate>Sat, 02 Oct 2010 22:19:19 +0000</pubDate> <dc:creator>Marcos Placona</dc:creator> <category><![CDATA[JQuery]]></category> <guid isPermaLink="false">http://www.placona.co.uk/?p=606</guid> <description><![CDATA[Reading time: 2 &#8211; 2 minutes I found this two function yesterday while working on one of our applications. We are turning a very boring page into a full blown jQuery powered page. It&#8217;s got loads of functionalities being turned into Ajax calls to give the user a better experience. We are really taking usability [...]]]></description> <content:encoded><![CDATA[<p>Reading time: 2 &#8211; 2 minutes</p><p>I found this two function yesterday while working on one of our applications.</p><p>We are turning a very boring page into a full blown jQuery powered page. It&#8217;s got loads of functionalities being turned into Ajax calls to give the user a better experience. We are really taking usability into account, and minimizing things like page refresh or reloads is essential.</p><p>One thing that got to us, was the fact that IE8 insists in caching some Ajax contents when loading things too quickly (i.e. if a link is clicked, and a tab is clicked subsequently).</p><p>This is easily fixable by adding a timestamp to the request, so whenever a link is clicked, the request would be doing something like:</p><pre class="brush: jscript; title: ; notranslate">
var tS=new Date().getTime();
$.ajax({
    url: searcher,
    data: {timestamp:tS},
    type: 'GET',
    dataType: 'json',
    success: function(data) {
        //something here
}});
</pre><p>The code above will do the job, but you have to remember to always use the timestamp, and pass it on.<br
/> Another better way of doing it, is by using the <a
title="jQuery - Ajax Setup" href="http://api.jquery.com/jQuery.ajaxSetup/" target="_blank">ajaxSetup</a> function.</p><p>According to the documentation, ajaxSetup sets default values for future Ajax requests. So in other words, every Ajax request made after ajaxSetup will obey the directives defined by it.</p><p>One of this directives happens to be called &#8220;cache&#8221;, and if set to &#8220;false&#8221;, will make sure every Ajax request has the current timestamp appended to the URL. You can simply add it to your code as such:</p><pre class="brush: jscript; title: ; notranslate">
$(document).ready(function() {
   $.ajaxSetup({ cache: false });
   // put all your jQuery goodness in here.
 });</pre><p>Now all of your requests will look like this:</p><p>http://my_server.com?123456789</p><p>There are also other settings that can be added inside ajaxSetup. They can be found on the <a
title="jquery.ajax() - Documentation" href="http://api.jquery.com/jQuery.ajax/">jQuery.ajax()</a> documentation, and all the settings listed in there will also work with ajaxSetup.<br
/> Hope this tip is useful to someone.</p> ]]></content:encoded> <wfw:commentRss>http://www.placona.co.uk/606/jquery/nifty-jquery-tricks-avoid-cache/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> </channel> </rss>

