<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	>

<channel>
	<title>Andrew Odri &#187; miscellaneous</title>
	<atom:link href="http://blog.affirmix.com/category/miscellaneous/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.affirmix.com</link>
	<description>Flash Platform and Dreamweaver Stuff</description>
	<lastBuildDate>Thu, 17 Sep 2009 22:39:53 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How To Lock Your Workstation In Mac OS X</title>
		<link>http://blog.affirmix.com/2009/04/08/how-to-lock-your-workstation-in-mac-os-x/</link>
		<comments>http://blog.affirmix.com/2009/04/08/how-to-lock-your-workstation-in-mac-os-x/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 20:40:57 +0000</pubDate>
		<dc:creator>Andrew Odri</dc:creator>
				<category><![CDATA[miscellaneous]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[keychain]]></category>
		<category><![CDATA[lock]]></category>
		<category><![CDATA[mac os x]]></category>
		<category><![CDATA[screen]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[workstation]]></category>

		<guid isPermaLink="false">http://blog.affirmix.com/?p=228</guid>
		<description><![CDATA[
This is just a little tip for anyone who has recently switched from Windows to Mac OS X and was wondering where the &#8220;Lock Workstation&#8221; shortcut went. This shows you how to set up a timeout using the screen saver as well.

Go to the &#xF8FF; (Apple) menu, and select the System Preferences&#8230; menu item.
Click on [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://api.photoshop.com/home_ef38c0dde81745679f534f6507a6abff/adobe-px-assets/9f4ce92d54a64fe5be9241ca9560f63a" alt="Padlock Workstation" /></p>
<p>This is just a little tip for anyone who has recently switched from Windows to Mac OS X and was wondering where the &#8220;<a href="http://www.microsoft.com/windowsxp/using/security/learnmore/tips/schnoll1.mspx" target="_blank">Lock Workstation</a>&#8221; shortcut went. This shows you how to set up a timeout using the screen saver as well.</p>
<ol>
<li>Go to the &#xF8FF; (Apple) menu, and select the System Preferences&#8230; menu item.</li>
<li>Click on the Desktop &#038; Screen Saver item, and select a screen saver. <em>This is required if you would like to lock the screen after a timeout.</em></li>
<li>Open Finder, and navigate to Applications » Utilities, and open Keychain Access.</li>
<li>Go to the Keychain Access menu, and select the Preferences&#8230; menu item.</li>
<li>Ensure that Show Status in Menu Bar is checked.</li>
</ol>
<p>You should now see a little padlock in menu bar close to the clock. When you click this, and menu will drop down, and the first menu item Lock Screen will allow you to do just that.</p>
<p>Now if you would like to lock the screen on a time out, follow these instructions:</p>
<ol>
<li>Go to the &#xF380; (Padlock) menu, and select the Open Security Preferences&#8230; menu item.</li>
<li>Ensure that Require password to wake this computer from sleep or screen saver is checked.</li>
</ol>
<p>Unfortunately there is no keyboard shortcut for locking a workstation, and there is no way &#8211; at this time at least &#8211; to set up a shortcut to perform this particular function.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.affirmix.com/2009/04/08/how-to-lock-your-workstation-in-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>IE6, IE7 And IE8 On Mac OS X Step By Step</title>
		<link>http://blog.affirmix.com/2009/04/01/ie6-ie7-and-ie8-on-mac-os-x-step-by-step/</link>
		<comments>http://blog.affirmix.com/2009/04/01/ie6-ie7-and-ie8-on-mac-os-x-step-by-step/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 21:25:36 +0000</pubDate>
		<dc:creator>Andrew Odri</dc:creator>
				<category><![CDATA[miscellaneous]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[compatibility]]></category>
		<category><![CDATA[compliance]]></category>
		<category><![CDATA[ie6]]></category>
		<category><![CDATA[ie7]]></category>
		<category><![CDATA[ie8]]></category>
		<category><![CDATA[internet explorer]]></category>
		<category><![CDATA[mac os x]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[sun]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[vdi]]></category>
		<category><![CDATA[vhd]]></category>
		<category><![CDATA[virtualbox]]></category>
		<category><![CDATA[w3c]]></category>
		<category><![CDATA[web standards]]></category>

		<guid isPermaLink="false">http://blog.affirmix.com/?p=191</guid>
		<description><![CDATA[
UPDATE: Adobe recently released BrowserLab &#8230; If you want a fast method of previewing your sites on different versions of IE running on different OSes, you might want to check it out  
After recently weening myself off Windows and on to Mac OS X &#8211; and deleting my Windows partition &#8211; it became pretty [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://api.photoshop.com/home_ef38c0dde81745679f534f6507a6abff/adobe-px-assets/41c31b1e484b43a79344c1145b81a188" alt="Sun xVM VirtualBox" /></p>
<p>UPDATE: Adobe <a href="http://labs.adobe.com/technologies/browserlab/">recently released BrowserLab </a>&#8230; If you want a fast method of previewing your sites on different versions of IE running on different OSes, you might want to <a href="https://browserlab.adobe.com/">check it out</a> <img src='http://blog.affirmix.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>After recently weening myself off Windows and on to Mac OS X &#8211; and deleting my Windows partition &#8211; it became pretty clear that if I would need some method of running Internet Explorer on my Mac if I wanted to continue doing web development with any kind of success. After a bit of Googling, a bit of testing, and healthy dose of &#8220;issues&#8221;, I have come up with a fast, stable &#8211; and best of all free &#8211; method of running IE6, IE7 and IE8 simultaneously on my Intel Mac legally. <span id="more-191"></span></p>
<p>First of all, you will need to download a bunch of software. I have listed all of this below:</p>
<ul>
<li><a href="http://download.virtualbox.org/virtualbox/2.0.6/VirtualBox-2.0.6-39760-OSX_x86.dmg">Download Sun xVM VirtualBox 2.0.6</a> <em>The <strong>exact version 2.0.6</strong> of VirtualBox must be used for this process, at least until the network drivers are installed. At the time of writing, the latest version 2.1.4 will not allow the network drivers to be installed correctly.</em></li>
<li><a href="http://www.kju-app.org/">Download Q</a></li>
<li><a href="http://wakaba.c3.cx/s/apps/unarchiver.html">Download The Unarchiver</a></li>
<li><a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=21EABB90-958F-4B64-B5F1-73D0A413C8EF&#038;displaylang=en">Download the Microsoft IE6, IE7 &#038; IE8 Disk Images</a></li>
</ul>
<p>Next, I put together a list of steps that need to be followed in order to get this all working. Read though it first, as I have attached the reasons why I have done things a certain way to help you get a feel for what is going on.</p>
<ol>
<li>Install VirtualBox. <em>This is the virtual machine that will be used to run the various OS and browser images.</em></li>
<li>Install The Unarchiver. <em>This will be used to extract the virtual machines from the *.EXE files.</em></li>
<li>Install Q. <em>This will be used in the process of converting the Microsoft *.VHD virtual machines into native VirtualBox *.VDI virtual machines.</em></li>
<li>Run The Unarchiver, and associate it with *.EXE files.</li>
<li>Open the IE6, IE7 &#038; IE8 images using The Unarchiver. A new folder will be created, with a *.VHD in each of these.</li>
<li>Open Terminal, and type the listed commands for each of the *.VHD files. <em>This will allow all of the images to be mounted and executed together without any conflicts. Currently all the Microsoft images <a href="http://forums.virtualbox.org/viewtopic.php?f=7&#038;t=14976" target="_blank">share that same hard disk identifier</a>, and this method allows it to be changed.</em>
<pre>/Applications/Q.app/Contents/MacOS/qemu-img convert -O raw -f vpc OldVHDImage.vhd NewRAWImage.raw
VBoxManage convertdd NewRAWImage.raw NewVDIImage.vdi</pre>
</li>
</ol>
<p><img src="http://api.photoshop.com/home_ef38c0dde81745679f534f6507a6abff/adobe-px-assets/ea116ed5c6af4b99b0bf545925ee8c10" alt="" /></p>
<ol start="7">
<li>Run VirtualBox, and follow the listed steps for each of the *.VDI images.
<ol>
<li>Go to the File menu, and select Virtual Disk Manager&#8230;</li>
<li>Click on the Add toolbar button on the Virtual Disk Manager window, and select the appropriate *.VDI from the file selection dialog.</li>
</ol>
</li>
</ol>
<p><img src="http://api.photoshop.com/home_ef38c0dde81745679f534f6507a6abff/adobe-px-assets/a7566edbcdbc41c8bf18f99007e9fc0f" alt="" /></p>
<ol>
<ol start="2">
<li>You should now see the *.VDI image in the list. Click on the OK button.</li>
<li>Click on the New toolbar button on the Sun xVM VirtualBox window, and follow the prompts on the Create New Virtual Machine window. Ensure that the right OS type is selected, and that adequate RAM is allotted for the virtual machine.</li>
</ol>
</ol>
<p><img src="http://api.photoshop.com/home_ef38c0dde81745679f534f6507a6abff/adobe-px-assets/35a6409876784c269c17eb9d4173bd81" alt="" /></p>
<ol>
<ol start="4">
<li>Select the new virtual machine, and click on the Start toolbar button on the Sun xVM VirtualBox window. Immediately after this, tap F8 to enter the Windows Advanced Options menu.</li>
<li>Select Safe Mode from the menu, and press the Return key.</li>
<li>Once Windows has booted up in safe mode, cancel all of the hardware prompts.</li>
<li>Go to Start, then select Run&#8230; . Type cmd into the input field.</li>
<li>At the command prompt, type each of the listed commands. <em>This will prevent the virtual machines from bluescreening, and will allow the appropriate network drivers to be installed.</em>
<pre>cd \WINDOWS\system32\drivers
ren processr.sys processr.old
exit</pre>
</li>
<li>Restart the virtual machine. Windows will likely prompt you to do this after is has detected the change.</li>
<li>Once Windows has booted up, cancel all of the hardware prompts.</li>
<li>Go to the Devices menu in VirtualBox, and select Install Guest Additions&#8230;</li>
<li>Follow the prompts within Windows to install the guest additions, or drivers. You will be prompted to reboot your virtual machine at the end of this process.</li>
<li>Once Windows has booted up, you will be presented with the Hardware Update Wizard. Select Install the software automatically, and click on the Next button.</li>
<li>Follow the prompts and wait until the network adapter is installed.</li>
</ol>
</li>
</ol>
<p>If all goes well, you should have three virtual machines that can all run together synchronously for some serious browser testing. If you would like a little more information, I would suggest checking out <a href="http://www.10voltmedia.com/blog/2008/12/screencast-install-internet-explorer-on-osx-using-virtualbox/" target="_blank">Jeff Couturier&#8217;s article</a> (he has a nice tutorial video on the site too), and <a href="http://blog.mozmonkey.com/2008/vpc-ie6-ie7-ie8-on-mac-os-x/" target="_blank">Jeremy Gillick&#8217;s article</a>.</p>
<p>UPDATE: It appears this article has been <a href="http://www.poso.dk/2009/04/20/ie6-ie7-ie8-pa-osx-med-virtualbox/" target="_blank">translated into Danish</a> by <a href="http://www.poso.dk/" target="_blank">Rasmus Luckow-Nielsen</a>. Thanks Rasmus!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.affirmix.com/2009/04/01/ie6-ie7-and-ie8-on-mac-os-x-step-by-step/feed/</wfw:commentRss>
		<slash:comments>54</slash:comments>
		</item>
		<item>
		<title>XULRunner &#8211; Adobe AIR&#8217;s Grandad</title>
		<link>http://blog.affirmix.com/2009/02/11/xulrunner-adobe-airs-grandad/</link>
		<comments>http://blog.affirmix.com/2009/02/11/xulrunner-adobe-airs-grandad/#comments</comments>
		<pubDate>Wed, 11 Feb 2009 19:50:16 +0000</pubDate>
		<dc:creator>Andrew Odri</dc:creator>
				<category><![CDATA[miscellaneous]]></category>
		<category><![CDATA[air]]></category>
		<category><![CDATA[documentation]]></category>
		<category><![CDATA[fennec]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[xul]]></category>
		<category><![CDATA[xulrunner]]></category>

		<guid isPermaLink="false">http://blog.affirmix.com/?p=144</guid>
		<description><![CDATA[
XULRunner is a project that has been around since the inception of Firefox, and predates Adobe AIR by quiet a margin. For those who have not really looked into it too much, XULRunner has a lot of similarities to Adobe AIR &#8211; it is a cross platform runtime that allows you to run code written [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://api.photoshop.com/home_ef38c0dde81745679f534f6507a6abff/adobe-px-assets/219a0510d50b4a4b8b9ab8f0765c3dde" alt="Mozilla" /></p>
<p>XULRunner is a project that has been around since the inception of Firefox, and predates Adobe AIR by quiet a margin. For those who have not really looked into it too much, XULRunner has a lot of similarities to Adobe AIR &#8211; it is a cross platform runtime that allows you to run code written in XUL &#8211; an XML derivative very similar to HTML.</p>
<p>A little more information: XUL elements add certain features that are required to add things like menus, menu items, toolbars, toolbar buttons and the like into your application, and can be mixed and matched with HTML. XULRunner also exposes extra functions to JavaScript, allowing you to access files on the host computer, read and write from SQLite databases, and do a lot of things that AIR does in this regard.</p>
<p>I haven&#8217;t played with XUL a whole lot since AIR came out, as documentation has always fallen behind AIR&#8217;s. And performing some advanced functions, like populating a tree component with SQLite results, or manipulating an image, are a little more involved than with AIR.</p>
<p>However, XULRunner has been really branching out to a lot of platform &#8211; Windows, Mac OS and Linux support was all there before AIR even came on the scene. There is also SkyOS support, and today the first &#8220;pre-alpha&#8221; of XULRunner is available for Windows Mobile (codenamed &#8220;Fennec&#8221;). There are also lightweight ports available for mobile Linux distros, and for Symbian S60.</p>
<p>This really opens a lot of doors for developers &#8211; your desktop applications and mobile applications can all share the same codebase. XUL itself is actually quiet nice to write in, and I was always impressed by how it always took advantage of native OS components libraries.</p>
<p>Anyway, I think the XULRunner team deserves very high praise for what they have accomplished &#8211; they have always been ahead of the game when with their platform independent runtime, and they are continuing to push support to an impressive array of platforms.</p>
<ul>
<li><a href="https://developer.mozilla.org/en/XULRunner" target="_blank">XULRunner Documentation</a></li>
<li><a href="https://developer.mozilla.org/En/XUL" target="_blank">XUL Documentation</a></li>
<li><a href="http://dougt.wordpress.com/2009/02/10/milestone-1-fennec-for-windows-mobile/" target="_blank">Doug&#8217;s announcement of Fennec for Windows Mobile</a></li>
<li><a href="http://starkravingfinkle.org/blog/2009/02/xulrunner-1906/" target="_blank">Mark&#8217;s announcement of XULRunner 1.9.0.6</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.affirmix.com/2009/02/11/xulrunner-adobe-airs-grandad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting Started With Adobe AIR And SQLite (And Getting Around The Bugs)</title>
		<link>http://blog.affirmix.com/2009/01/28/getting-started-with-adobe-air-and-sqlite-and-avoiding-the-problems/</link>
		<comments>http://blog.affirmix.com/2009/01/28/getting-started-with-adobe-air-and-sqlite-and-avoiding-the-problems/#comments</comments>
		<pubDate>Thu, 29 Jan 2009 02:29:11 +0000</pubDate>
		<dc:creator>Andrew Odri</dc:creator>
				<category><![CDATA[miscellaneous]]></category>
		<category><![CDATA[air]]></category>
		<category><![CDATA[bitmap]]></category>
		<category><![CDATA[blob]]></category>
		<category><![CDATA[boolean]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[displayobject]]></category>
		<category><![CDATA[responder]]></category>
		<category><![CDATA[sqlite]]></category>
		<category><![CDATA[sqlstatement]]></category>

		<guid isPermaLink="false">http://blog.affirmix.com/?p=101</guid>
		<description><![CDATA[I have been writing some applications in AIR that for the first time make extensive use of SQLite. I hit a few roadblocks along the way, so here are a few things that may come in handy if you are using SQLite in AIR for the first time...]]></description>
			<content:encoded><![CDATA[<p><img src="http://api.photoshop.com/home_ef38c0dde81745679f534f6507a6abff/adobe-px-assets/e8e28e55d2f149f8b09d8d487d020e8b" alt="Adobe AIR" /></p>
<p>I have been writing some applications in AIR that for the first time make extensive use of SQLite. I hit a few roadblocks along the way, so here are a few things that may come in handy if you are using SQLite in AIR for the first time. <span id="more-101"></span></p>
<h3>Reuse SQLStatement Instances</h3>
<p>Rather than creating a new SQLStatement object for each query you want to run, it is recommended that you reuse an existing instance, and just alter the parameters associated with the object. You will reap three benefits from doing this:</p>
<ul>
<li>The query will be cached, so the SQLite connection will not have to compile a new statement every time you want to run the query</li>
<li>You will get automatic type conversion when assigning values like strings, integers, dates and so on</li>
<li>You will improve data integrity within the database because as the automatic type conversion also acts as a kind of filter</li>
</ul>
<p>For queries that get used across an entire application, I have found that putting the SQLConnection object and wrapper functions for the SQLStatement objects inside a singleton class seems to work very well.</p>
<p>NOTE: Every time you change the text property, the query will get recompiled. The trick is in using the parameters.</p>
<p>The following example demonstrates this:</p>
<pre><code>package
{
	import flash.data.SQLConnection;
	import flash.data.SQLStatement;

	public class SQLConnectionWrapper
	{
		private static const SINGLETON_INSTANCE:SQLConnectionWrapper = new SQLConnectionWrapper(SingletonLock);

		public var connection:SQLConnection;

		private var selectRecord:SQLStatement;

		public static function get instance():SQLConnectionWrapper
		{
			return SINGLETON_INSTANCE;
		}

		public function SQLConnectionWrapper(lock:Class)
		{
			// This ensures that only once instance of this class may be created and accessed
			if(lock != SingletonLock){
				throw new Error("Class Cannot Be Instantiated: Use SQLConnectionWrapper.instance");
			}

			createDatabase();
		}

		private function createDatabase():void
		{
			// This creates an SQLConnection object , which can be accessed publicly so that event listeners can be defined for it
			connection = new SQLConnection();

			var databaseFile:File = File.applicationStorageDirectory.resolvePath("database.db");
			connection.openAsync(databaseFile);
		}

		public function getRecord(recordId:int):SQLStatement
		{
			// If selectRecord has not been instantiated, then create the instance with all the data that it needs
			// If it has been instantiated, then we can skip over this part and take advantage of the fact that it has now been cached
			if(!(selectRecord is SQLStatement)){
				selectRecord= new SQLStatement();
				selectRecord.sqlConnection = connection;
				selectRecord.text =
				"SELECT record_id, description, is_active " +
				"FROM record_tbl " +
				"WHERE record_id = :recordId";
			}
			// This simply changes the one parameter that needs to be changed
			// Because recordId has already been declared as an int, this will be converted into an SQLite recognized integer
			selectRecord.parameters[":recordId"] = recordId;

			return selectRecord;
		}
	}
}

// This little class exists to stop extra instances on the singleton being created
class SingletonLock{}</code></pre>
<h3>Use Responders</h3>
<p>One major problem that caught me off guard when trying to reuse instances was event handling. If I were to use SQLConnectionWrapper.instance.getRecord() in multiple places across my application, and attach event listeners to them, I will encounter a problem where all three event listeners get triggered. Even when each event listener is removed, errors still occur due to the fact that the SQLStatement object still thinks that it is executing. Not pretty.</p>
<p>Using Responder objects allows to avoid the pain that come s from constantly adding and removing event listeners, and prevent the race condition that occurs with the SQLStatement objects. The Responder object allows you to define event handlers for both SQLEvent.RESULT and SQLErrorEvent.ERROR events. And rather than attaching itself to the SQLStatement object, it will only handle events generated for each particular call to SQLStatement.execute().</p>
<p>NOTE: After a successful query, the handler will be passed an SQLResult object as the first argument, and not an SQLEvent object.</p>
<p>NOTE: After a failed query, the handler will be passed an SQLError object as the first argument, and not an SQLErrorEvent object.</p>
<p>Here is an example:</p>
<pre><code>package
{
	import SQLConnectionWrapper;</code>

	import flash.net.Responder;
	import flash.data.SQLResult;

	public class SampleApplication
	{
		// Create the responder object once, so that it can be reused again and again
		private var responder:Responder = new Responder(handleSuccess, handleFailure);

		public function SampleApplication():void
		{
			// This opens the database - obviously
			SQLConnectionWrapper.instance.connection.addEventListener(SQLEvent.OPEN, executeQuery);
			SQLConnectionWrapper.instance.connection.open();
		}

		private function executeQuery():void
		{
			// This statement essentially creates a reference to the SQLStatement object that is created once for all time within the SQLConnectionWrapper singleton
			var statement:SQLStatement = SQLConnectionWrapper.instance.getRecord(1);
			statement.execute(-1, responder);
		}

		private function handleSuccess(result:SQLResult):void
		{
			trace("Record ID: " + result.data[0].record_id + ", Description: " + result.data[0].description + ", Is Active: " + result.data[0].is_active);
		}

		private function handleFailure(error:SQLError):void
		{
			trace("Epic Fail: " + error.message);
		}
	}
}</code></pre>
<p><del></p>
<h3>Boolean Objects</h3>
<p>When returning results from a SELECT query, any SQLite Boolean objects will be correctly converted into ActionScript Boolean objects. However, when executing an INSERT or UPDATE query, an integer is actually required. This quick and nasty workaround demonstrates what has to take place:</p>
<p><em>This would need to be part of SQLConnectionWrapper</em></p>
<pre><code>		private function setRecord(description:String, isActive:Boolean):void
		{
			if(!(insertRecord is SQLStatement)){
				insertRecord = new SQLStatement();
				insertRecord.sqlConnection = connection;
				insertRecord.text = "INSERT INTO record_tbl (description, is_active) VALUES (:description, :isActive)";
			}
			insertRecord.parameters[":description"] = description;
			// This is pretty straightforward, but it simply converts the ActionScript Boolean into an int, so that SQLite can accurately create it's own boolean in the database
			insertRecord.parameters[":isActive"] = isActive ? 1 : 0;

			return insertRecord;
		}</code></pre>
<p></del></p>
<h3>Date Objects</h3>
<p>When executing an INSERT or UPDATE query, dates will be inserted into the database as expected (well, kind of &#8211; if you really want to know more about that then just ask about it). In the case of Date objects, though, the troubles occur when trying to return Date objects from a SELECT query. I won&#8217;t try and explain this one, because there is already a <a href="http://www.verysimple.com/blog/2008/09/09/working-with-dates-in-flex-air-and-sqlite/" target="_blank">great explanation of what is happening here</a>.</p>
<p>What I will do is provide some code that demonstrates the quickest way of getting a usable Date object from an SQLite database:</p>
<p>NOTE: The String object that gets returned is formatted so that it can be passed to the <a href="http://livedocs.adobe.com/flex/3/langref/Date.html#Date()" target="_blank">constructor of a Date object</a> without having to jump through any additional hoops.</p>
<p><em>This would need to be part of SQLConnectionWrapper</em></p>
<pre><code>		public function getAllBookings():SQLStatement
		{
			if(!(selectBookings is SQLStatement)){
				selectBookings = new SQLStatement();
				selectBookings.sqlConnection = connection;
				// This statement will return the date as a MM/DD/YYYY formatted string
				selectBookings.text =
				"SELECT booking_id, record_id, STRFTIME('%m/%d/%Y', checkout_date) AS checkout_date, STRFTIME('%m/%d/%Y', checkin_date) AS checkin_date " +
				"FROM booking_tbl";
			}

			return selectBookings;
		}</code></pre>
<p>UPDATE: <a href="http://probertson.com/" target="_blank">Paul Robertson</a> has posted an <a href="http://www.verysimple.com/blog/2008/09/09/working-with-dates-in-flex-air-and-sqlite/#comment-96981" target="_blank">update about this</a>. Apparently setting the column type to DATE, rather than DATETIME, will allow you to use Flex Date objects natively. You can see this <a href="http://livedocs.adobe.com/flex/3/langref/localDatabaseSQLSupport.html#columnAffinity" target="_blank">alluded to in the LiveDocs</a>.</p>
<h3>Blobs and Bitmaps</h3>
<p>Do you want to store images in your database? Do you want to pull them out as DisplayObjects, ready to do with as you wish? Well, here is some code that demonstrates the entire process of loading an image from a file, storing it in your SQLite database, retrieving the image data, and converting it back into a DisplayObject:</p>
<p>NOTE: ByteArray objects do not need any special attention when being either SELECTed from or INSERTed into the database.</p>
<p><em>This would need to be part of the application code</em></p>
<pre><code>		import flash.display.Bitmap;
		import flash.display.Loader;
		import flash.filesystem.File;
		import flash.net.URLLoader;
		import flash.utils.ByteArray;
		import mx.graphics.codec.PNGEncoder;</code>

		private function selectPicture():void
		{
			// This little section here creates a file object, and then launches the file browser so that you can select your image
			var file:File = File.documentsDirectory;
			file.addEventListener(Event.SELECT, handleSelectPicture);
			file.browseForOpen("Select Picture");
		}

		private function handleSelectPicture(event:Event):void
		{
			// Once the image file has been selected, we now have to load it
			var loader:Loader = new Loader();
			loader.contentLoaderInfo.addEventListener(Event.COMPLETE, handleLoadPicture);
			loader.load(new URLRequest(event.target.url));
		}

		private function handleLoadPicture(event:Event):void
		{
			// The first thing that we do is create a Loader object (which is a subclass od DisplayObject)
			var loader:Loader = Loader(event.target.loader);
			// Next, we cast the loader as a Bitmpa object, as the Bitmap object has function to return a BitmapData object based on the image
			var image:Bitmap = Bitmap(loader.content);
			var encoder:PNGEncoder = new PNGEncoder();
			// The PNGEncoder allows you to convert BitmapData object into a ByteArray, ready for storage in an SQLite blob field
			var byteArray:ByteArray = encoder.encode(image.bitmapData);

			var statement:SQLStatement = SQLConnectionWrapper.instance.setPicture(1, byteArray);
			statement.execute(-1, responder);
		}</code></pre>
<p><em>This would need to be part of SQLConnectionWrapper</em></p>
<pre><code>		private function setPicture(recordId:String, byteArray:ByteArray):void
		{
			if(!(insertRecord is SQLStatement)){
				insertRecord = new SQLStatement();
				insertRecord.sqlConnection = connection;
				insertRecord.text = "INSERT INTO picture_tbl (record_id, data) VALUES (:recordId, :byteArray)";
			}
			insertRecord.parameters[":recordId"] = recordId;
			// The ByteArray should be added as a parameter; this makes the whole process of storing the image in the blob field very easy
			insertRecord.parameters[":byteArray"] = byteArray;

			return insertRecord;
		}</code></pre>
<p><em>This would need to be part of the application code</em></p>
<pre><code>		import mx.controls.Image;

		// This function would be defined in a Responder object that handles a successful query of picture_tbl
		private function handleSuccess(result:SQLResult):void
		{
			var image:Image = new Image();
			image.addEventListener(Event.COMPLETE, handleLoadPicture);
			image.load(result.data[0].picture);
		}

		private function handleLoadPicture(event:Event):void
		{
			var picture:DisplayObject = DisplayObject(event.target.content);
		}</code></pre>
<p>Sorry, I was started to get a bit tired of writing towards the end of this article <img src='http://blog.affirmix.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  If you want me to elaborate on anything, just leave a comment. Hopefully the examples are enough to get you up and running with SQLite, whilst avoiding most of the gotchas that come along with it <img src='http://blog.affirmix.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.affirmix.com/2009/01/28/getting-started-with-adobe-air-and-sqlite-and-avoiding-the-problems/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Flex SDK 3.3.0 Stable Now Available</title>
		<link>http://blog.affirmix.com/2009/01/28/flex-sdk-330-stable-now-available/</link>
		<comments>http://blog.affirmix.com/2009/01/28/flex-sdk-330-stable-now-available/#comments</comments>
		<pubDate>Wed, 28 Jan 2009 21:47:12 +0000</pubDate>
		<dc:creator>Andrew Odri</dc:creator>
				<category><![CDATA[miscellaneous]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[release]]></category>
		<category><![CDATA[sdk]]></category>
		<category><![CDATA[stable]]></category>

		<guid isPermaLink="false">http://blog.affirmix.com/?p=114</guid>
		<description><![CDATA[
Now that the new stable is available for download, I would imagine that a new release build isn&#8217;t too far off&#8230;
You can download the latest version of the SDK here: http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+3
From what I can tell, it mostly comprises of bug fixes &#8211; no fancy new functionality seems to have been added. But I guess you [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://api.photoshop.com/home_ef38c0dde81745679f534f6507a6abff/adobe-px-assets/ee09c70759fb4c2f83e07e492f4b5cf0" alt="Flex SDK 3.3.0" /></p>
<p>Now that the new stable is available for download, I would imagine that a new release build isn&#8217;t too far off&#8230;</p>
<p>You can download the latest version of the SDK here: <a href="http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+3" target="_blank">http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+3</a></p>
<p>From what I can tell, it mostly comprises of bug fixes &#8211; no fancy new functionality seems to have been added. But I guess you will have to find out for yourself by trawling through the nightly release notes (joy :S)&#8230; If you find anything noteworthy, let me know, I only noticed a few changes in some of the utility classes.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.affirmix.com/2009/01/28/flex-sdk-330-stable-now-available/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Links For 2009-01-22</title>
		<link>http://blog.affirmix.com/2009/01/22/links-for-2009-01-22/</link>
		<comments>http://blog.affirmix.com/2009/01/22/links-for-2009-01-22/#comments</comments>
		<pubDate>Thu, 22 Jan 2009 18:12:28 +0000</pubDate>
		<dc:creator>Andrew Odri</dc:creator>
				<category><![CDATA[konductor]]></category>
		<category><![CDATA[miscellaneous]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[insideria]]></category>
		<category><![CDATA[links]]></category>
		<category><![CDATA[marketing]]></category>

		<guid isPermaLink="false">http://blog.affirmix.com/?p=96</guid>
		<description><![CDATA[Don&#8217;t worry, the whole links thing won&#8217;t become a regular feature of this blog &#8211; this is just a roundup of a few things I have wanted to post about recently but just didn&#8217;t have the time:


There is a cool writeup about Konductor on O&#8217;Reilly&#8217;s InsideRIA blog (Even though it reads a bit like a [...]]]></description>
			<content:encoded><![CDATA[<p>Don&#8217;t worry, the whole links thing won&#8217;t become a regular feature of this blog &#8211; this is just a roundup of a few things I have wanted to post about recently but just didn&#8217;t have the time:</p>
<p>
<ul>
<li>There is a cool <a href="http://www.insideria.com/2009/01/konductor-air-application.html" target="_blank">writeup about Konductor</a> on O&#8217;Reilly&#8217;s InsideRIA blog (Even though it reads a bit like a blogvertisement in parts, it is very thorough)</p>
<li>There a bunch of new videos about Konductor on our <a href="http://ca.youtube.com/konductorsoftware" target="_blank">Youtube channel</a> &#8211; if you want visual and aural updates of Konductor&#8217;s progress, then subscribe</li>
<li>This one has been blogged to death already, but I am loving <a href="http://www.prettyloaded.com/" target="_blank">Big Spaceship&#8217;s Pretty Loaded</a> &#8211; I hope they can keep adding new content</li>
</ul>
<p>It has been a little barren on the blog lately, but I have a few posts I really want to write up about some really cool stuff we are doing with Dreamweaver extension development, so subscribe to the RSS feed and keep your eye open for it if you are into that kind of thing.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.affirmix.com/2009/01/22/links-for-2009-01-22/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blog Changes</title>
		<link>http://blog.affirmix.com/2008/12/02/blog-changes/</link>
		<comments>http://blog.affirmix.com/2008/12/02/blog-changes/#comments</comments>
		<pubDate>Tue, 02 Dec 2008 23:17:30 +0000</pubDate>
		<dc:creator>Andrew Odri</dc:creator>
				<category><![CDATA[miscellaneous]]></category>
		<category><![CDATA[adobe max]]></category>
		<category><![CDATA[feed]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog.affirmix.com/?p=112</guid>
		<description><![CDATA[I changed the blog theme, so now my blog looks a little more legit. I will be making tweaks to it as I go, but I think now it is a bit of an improvement over the standard Wordpress theme that was there initially.
Also, FYI, if you are subscribed using RSS, the feed URL has [...]]]></description>
			<content:encoded><![CDATA[<p>I changed the blog theme, so now my blog looks a little more legit. I will be making tweaks to it as I go, but I think now it is a bit of an improvement over the standard Wordpress theme that was there initially.</p>
<p>Also, FYI, if you are subscribed using RSS, the feed URL has been changed to <a href="http://feeds.feedburner.com/andrewodri">http://feeds.feedburner.com/andrewodri</a>. All of your orignal feed links should now be redirecting, however.</p>
<p>Also, I am on an Adobe Developer Connection video. I am the guy who say profound things like &#8220;awesome&#8221; and &#8220;Flash Catalyst&#8221;:</p>
<p><object width="486" height="412"><param name="movie" value="http://services.brightcove.com/services/viewer/federated_f8/1596744118"></param><param flashVars="videoId=2572134001&#038;playerId=1596744118&#038;viewerSecureGatewayURL=https://console.brightcove.com/services/amfgateway&#038;servicesURL=http://services.brightcove.com/services&#038;cdnURL=http://admin.brightcove.com&#038;domain=embed&#038;autoStart=false&#038;"></embed><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://services.brightcove.com/services/viewer/federated_f8/1596744118" flashVars="videoId=2572134001&#038;playerId=1596744118&#038;viewerSecureGatewayURL=https://console.brightcove.com/services/amfgateway&#038;servicesURL=http://services.brightcove.com/services&#038;cdnURL=http://admin.brightcove.com&#038;domain=embed&#038;autoStart=false&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="486" height="412"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.affirmix.com/2008/12/02/blog-changes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Design Coding &#8211; The SEO Rapper</title>
		<link>http://blog.affirmix.com/2008/11/07/design-coding-the-seo-rapper/</link>
		<comments>http://blog.affirmix.com/2008/11/07/design-coding-the-seo-rapper/#comments</comments>
		<pubDate>Fri, 07 Nov 2008 20:10:54 +0000</pubDate>
		<dc:creator>Andrew Odri</dc:creator>
				<category><![CDATA[miscellaneous]]></category>
		<category><![CDATA[seo]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://blog.affirmix.com/?p=109</guid>
		<description><![CDATA[I usually find geeky hip-hop annoying and somewhat embarrassing. This one is not only funny, It&#8217;s incredibly informative too. I think it speaks for itself:

http://ca.youtube.com/watch?v=a0qMe7Z3EYg&#038;fmt=18
]]></description>
			<content:encoded><![CDATA[<p>I usually find geeky hip-hop annoying and somewhat embarrassing. This one is not only funny, It&#8217;s incredibly informative too. I think it speaks for itself:</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/a0qMe7Z3EYg&#038;hl=en&#038;fs=1&#038;ap=%2526fmt%3D18"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/a0qMe7Z3EYg&#038;hl=en&#038;fs=1&#038;ap=%2526fmt%3D18" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object><br />
<a href="http://ca.youtube.com/watch?v=a0qMe7Z3EYg&#038;fmt=18" target="_blank">http://ca.youtube.com/watch?v=a0qMe7Z3EYg&#038;fmt=18</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.affirmix.com/2008/11/07/design-coding-the-seo-rapper/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dreamweaver Template Tutorial</title>
		<link>http://blog.affirmix.com/2008/10/14/dreamweaver-template-tutorial/</link>
		<comments>http://blog.affirmix.com/2008/10/14/dreamweaver-template-tutorial/#comments</comments>
		<pubDate>Wed, 15 Oct 2008 05:25:01 +0000</pubDate>
		<dc:creator>Andrew Odri</dc:creator>
				<category><![CDATA[dreamweaver]]></category>
		<category><![CDATA[miscellaneous]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://blog.affirmix.com/?p=51</guid>
		<description><![CDATA[
I just came across a simple, well written tutorial on creating and publishing templates with Dreamweaver, posted in N.Design Studio&#8217;s tutorial section. This is 101 for most web design pro&#8217;s, but many people interested in Konductor still wonder how a lot of this stuff is accomplished within Dreamweaver. This article gives you a nice overview [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://api.photoshop.com/home_ef38c0dde81745679f534f6507a6abff/adobe-px-assets/f7e6be4ddd0b4d7792b0a838d7b92268" alt="Dreamweaver Template" /></p>
<p>I just came across a <a href="http://www.ndesign-studio.com/resources/dreamweaver/dreamweaver-template/">simple, well written tutorial</a> on creating and publishing templates with Dreamweaver, posted in N.Design Studio&#8217;s tutorial section. This is 101 for most web design pro&#8217;s, but many people interested in Konductor still wonder how a lot of this stuff is accomplished within Dreamweaver. This article gives you a nice overview of what is involved in the typical design process in Dreamweaver, which should in turn give you a clearer understanding of the angle we are taking with the Konductor Dreamweaver Extension.</p>
<p>Of course a lot of the time consuming / technical / annoying stuff is made a little easier with the Konductor Extension <img src='http://blog.affirmix.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.affirmix.com/2008/10/14/dreamweaver-template-tutorial/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Web 2.0 Architectural, Design And Social Patterns</title>
		<link>http://blog.affirmix.com/2008/10/07/web-20-architectural-design-and-social-patterns/</link>
		<comments>http://blog.affirmix.com/2008/10/07/web-20-architectural-design-and-social-patterns/#comments</comments>
		<pubDate>Tue, 07 Oct 2008 18:07:33 +0000</pubDate>
		<dc:creator>Andrew Odri</dc:creator>
				<category><![CDATA[miscellaneous]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[thoughts]]></category>

		<guid isPermaLink="false">http://blog.affirmix.com/?p=43</guid>
		<description><![CDATA[Duane Nickull posted an interesting blog entry the other day on &#8220;Forensic Architecture&#8221;. I really had no idea what exactly that was supposed to be, but his post describes it pretty well. He first outlines what the ideal process is for coming up with an appropriate system architecture. He then uses some real world examples [...]]]></description>
			<content:encoded><![CDATA[<p>Duane Nickull posted an <a href="http://technoracle.blogspot.com/2008/10/forensic-architecture-and-other-lessons.html" target="_blank">interesting blog entry</a> the other day on &#8220;Forensic Architecture&#8221;. I really had no idea what exactly that was supposed to be, but his post describes it pretty well. He first outlines what the ideal process is for coming up with an appropriate system architecture. He then uses some real world examples to show how deviation occurs from this in the real world, and what lessons he has learned.</p>
<p>I find system architecture fascinating, so having some real world experiences documented is a cool idea. I think more interesting though is that fact that Duane is writing a book called <a href="http://www.amazon.com/Web-2-0-Patterns-entrepreneurs-information/dp/0596514433" target="_blank">Web 2.0 Patterns: What entrepreneurs and  information architects need to know</a>. Just learning about <a href="http://en.wikipedia.org/wiki/Model-view-controller" target="_blank">MVC</a> and standarized <a href="http://en.wikipedia.org/wiki/Design_pattern_(computer_science)" target="_blank">design patterns</a> had a big effect on how I planned for and wrote software from that point onwards. Having a book outlining architectural, design and interestingly enough social patterns for Web 2.0 is something I&#8217;m sure will be beneficial not only to decision makers, but also developers and micro-ISV&#8217;s who work with new school web applications.</p>
<p>Duane is a super smart guy with tons of experience &#8211; It will be very cool to see his no doubt logical and practical guidelines for Web 2.0 architecture.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.affirmix.com/2008/10/07/web-20-architectural-design-and-social-patterns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
