<?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>Michael Wales &#187; Projects</title>
	<atom:link href="http://www.michaelwales.com/category/projects/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.michaelwales.com</link>
	<description>Senior Developer Michael Wales, featuring articles on web development (PHP, Python and Ruby), industry highlights and open source software releases.</description>
	<lastBuildDate>Tue, 22 Mar 2011 04:04:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Tiara: HTML5 Game Engine</title>
		<link>http://www.michaelwales.com/2011/01/tiara-html5-game-engine/</link>
		<comments>http://www.michaelwales.com/2011/01/tiara-html5-game-engine/#comments</comments>
		<pubDate>Sat, 22 Jan 2011 13:06:08 +0000</pubDate>
		<dc:creator>Michael Wales</dc:creator>
				<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Web Standards]]></category>

		<guid isPermaLink="false">http://www.michaelwales.com/?p=234</guid>
		<description><![CDATA[Update 3: The demo page has been updated to feature an index of currently completed demos. After a long day of working on image/sprite support I took a break from engine development and built up a quick demo, Example 3, that features some actual gameplay elements! Update 2: Redditor gramathy just informed me it&#8217;s also [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.michaelwales.com/wp-content/uploads/2011/01/HTML5_Logo_128.png" alt="HTML5" title="HTML5" width="128" height="128" class="alignright" /><strong>Update 3:</strong> The <a href="http://www.michaelwales.com/tiarajs/" title="TiaraJS">demo page</a> has been updated to feature an index of currently completed demos. After a long day of working on image/sprite support I took a break from engine development and built up a quick demo, <a href="http://www.michaelwales.com/tiarajs/example3/index.html" title="TiaraJS: Example 3">Example 3</a>, that features some actual gameplay elements!</p>
<p><strong>Update 2:</strong> Redditor <a href="http://www.reddit.com/user/gramathy" title="Reddit:gramathy">gramathy</a> just informed me it&#8217;s also working in Safari, if those of you in that world are willing to run a quick test for me. <a href="http://twitter.com/erikbrannstrom" title="Twitter: erikbrannstrom">@erikbrannstrom</a> told me it&#8217;s also working in Firefox 4 Beta.</p>
<p><strong>Update:</strong> If you run Google Chrome, I have a demo running publicly <a href="http://michaelwales.com/tiarajs" title="Tiara: Example 2">right here</a> &#8211; if you could reply with your FPS count (lower-left) and system info you feel is relevant, it would be much appreciated. </p>
<p>Gaming has always been a passion of mine and as any of my friends can tell you, I&#8217;m constantly coming up with ideas for new games. Unfortunately, my expertise in this little programming world has been primarily delegated to the world of web development. Thankfully, with HTML5 on the horizon, I can finally combine these two passions of mine into one package of pure awesome and peak out my nerdometer to its maximum.</p>
<p>I&#8217;ve spent the last 6 hours working on a JavaScript game engine, using HTML&#8217;s new <code>canvas</code> element, that is based off of the extremely fun and easy to use <a href="http://www.love2d.org/" title="Love2d">Love2d</a> game engine for Lua. Now, there is a bare minimum of functionality here thus far but I&#8217;m having a lot of fun working on this and I think it&#8217;s a great foundation to continue working off of. I shared a few quick screenshots on <a href="http://www.forrst.com/" title="Forrst">Forrst</a>, of my <a href="http://forr.st/~RSS" title="Forrst: Tiara HTML5 Game Engine">first</a> and <a href="http://forr.st/~RSu" title="Forrst: Tiara HTML5 Game Engine (Example 2)">second</a> example demos &#8211; complete with code and performance summaries; but, I also wanted to record a quick demo so everyone could see this bad boy in action.</p>
<p>The video below (<a href="http://www.youtube.com/watch?v=vd6zT_yEWnM" title="Tiara: HTML5 Game Engine">HD available</a> on YouTube) sits just under 10 minutes and will introduce you to the engine, I discuss what my goals are in basing the API off of Love2d&#8217;s API and I actually rebuild my second example demo and bounce a square around the screen! Check it out and let me know what you think in the comments!</p>
<p><iframe title="YouTube video player" class="youtube-player" type="text/html" width="640" height="390" src="http://www.youtube.com/embed/vd6zT_yEWnM?rel=0&amp;hd=1" frameborder="0" allowFullScreen></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://www.michaelwales.com/2011/01/tiara-html5-game-engine/feed/</wfw:commentRss>
		<slash:comments>63</slash:comments>
		</item>
		<item>
		<title>Fun with APIs: KnowYourTrend.com</title>
		<link>http://www.michaelwales.com/2011/01/fun-with-apis-knowyourtrend-com/</link>
		<comments>http://www.michaelwales.com/2011/01/fun-with-apis-knowyourtrend-com/#comments</comments>
		<pubDate>Fri, 07 Jan 2011 14:33:37 +0000</pubDate>
		<dc:creator>Michael Wales</dc:creator>
				<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://www.michaelwales.com/?p=230</guid>
		<description><![CDATA[What started as just an exercise in toying with a vast array of APIs has officially launched as of last night, KnowYourTrend.com. As I combined the various APIs together, into a single comprehensive collection of information on a subject, I actually started to find the information useful. Looking over sites like Google Trends or Twitter [...]]]></description>
			<content:encoded><![CDATA[<p>What started as just an exercise in toying with a vast array of APIs has officially launched as of last night, <a href="http://www.knowyourtrend.com/" title="KnowYourTrend: News, Video, Photos and Tweets about Current Trends">KnowYourTrend.com</a>. As I combined the various APIs together, into a single comprehensive collection of information on a subject, I actually started to find the information useful.</p>
<p>Looking over sites like <a href="http://trends.google.com/" title="Google Trends">Google Trends</a> or <a href="http://search.twitter.com/" title="Twitter Search">Twitter Search</a> I often find myself wondering, &#8220;What is <em>X</em>, and why is it trending?&#8221; For example, <a href="http://www.knowyourtrend.com/trends/gary-mason" title="KnowYourTrend: News, Video, Photos and Tweets about Gary Mason">Gary Mason</a> is currently trending on Twitter &#8211; I have no clue who this is or why they are trending. <a href="http://www.knowyourtrend.com/" title="KnowYourTrend">KnowYourTrend</a> quickly puts all of this information on the front page and you quickly learn he was a pretty big-deal British boxer that recently passed away.</p>
<p>There&#8217;s still a lot of work to be done for sure: bringing in more APIs (YouTube and Amazon are currently on the priority list); relating pages to one another (you could quickly check out why <a href="http://www.knowyourtrend.com/trends/orlando-bloom" title="KnowYourTrend: News, Video, Photos and Tweets about Orlando Bloom">Orlando Bloom</a> is trending, discover his wife <a href="http://www.knowyourtrend.com/trends/miranda-kerr" title="KnowYourTrend: News, Video, Photos and Tweets about Miranda Kerr">Miranda Kerr</a> just went into labor and go check out her page as well); among various other ideas.</p>
<p>Overall, it&#8217;s been a fun little diversion from my main project right now, <a href="http://www.aftermil.com/" title="AfterMil: Discover your post-military career">AfterMil</a>, that (<em>runs and looks at repository</em>) only took 48 hours to turn around from concept to deployment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.michaelwales.com/2011/01/fun-with-apis-knowyourtrend-com/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ErkanaAuth Now Hosted on Bitbucket</title>
		<link>http://www.michaelwales.com/2010/03/erkanaauth-now-hosted-on-bitbucket/</link>
		<comments>http://www.michaelwales.com/2010/03/erkanaauth-now-hosted-on-bitbucket/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 02:41:08 +0000</pubDate>
		<dc:creator>Michael Wales</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[authorization library]]></category>
		<category><![CDATA[Bitbucket]]></category>
		<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[ErkanaAuth]]></category>
		<category><![CDATA[Mercurial]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.michaelwales.com/?p=140</guid>
		<description><![CDATA[As the entire CodeIgniter community runs over to Mercurial and Bitbucket, thanks to EllisLab&#8217;s huge announcement earlier today it seemed only fitting to get ErkanaAuth hosted over there as soon as possible. Honestly, I&#8217;ve been wanting to do something like this for a lot of my open-source work for a long time; I just keep [...]]]></description>
			<content:encoded><![CDATA[<p class="aligncenter"><img src="http://www.michaelwales.com/wp-content/uploads/2010/02/erkanaauth-banner.png" alt="ErkanaAuth" title="ErkanaAuth" /></p>
<p>As the entire <a href="http://www.codeigniter.com/" title="CodeIgniter">CodeIgniter</a> community runs over to <a href="http://mercurial.selenic.com/" title="Mercurial">Mercurial</a> and <a href="http://www.bitbucket.org" title="Bitbucket">Bitbucket</a>, thanks to <a href="http://codeigniter.com/news/ellislab_moves_to_mercurial_assembla_bitbucket_codeigniter_2.0_baking/" title="CodeIgniter 2.0.0 Baking">EllisLab&#8217;s huge announcement earlier today</a> it seemed only fitting to get ErkanaAuth hosted over there as soon as possible.</p>
<p>Honestly, I&#8217;ve been wanting to do something like this for a lot of my open-source work for a long time; I just keep putting it off. I love the distributed environment for collaborating on projects like this, because you guys probably have a lot of great ideas for this library! Now, you can contribute as well!</p>
<p>Go ahead: <a href="http://bitbucket.org/walesmd/codeigniter-erkana-auth/" title="Bitbucket: CodeIgniter Erkana Auth">check out the repository</a>, fork it, make some changes and send me pull requests so I can look over them. You can check out my <a href="http://www.michaelwales.com/2010/02/erkanaauth-version-2-0a/" title="Michael Wales: ErkanaAuth Version 2.0a">original post for my thoughts</a> in where I see this library headed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.michaelwales.com/2010/03/erkanaauth-now-hosted-on-bitbucket/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>ErkanaAuth Version 2.0a</title>
		<link>http://www.michaelwales.com/2010/02/erkanaauth-version-2-0a/</link>
		<comments>http://www.michaelwales.com/2010/02/erkanaauth-version-2-0a/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 16:57:49 +0000</pubDate>
		<dc:creator>Michael Wales</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[authorization library]]></category>
		<category><![CDATA[BSD license]]></category>
		<category><![CDATA[ErkanaAuth]]></category>
		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://www.michaelwales.com/?p=43</guid>
		<description><![CDATA[In November 2007 I released an authentication library for CodeIgniter named ErkanaAuth. It was very simple to use since it just provided a few methods to make authentication simpler for you &#8211; it didn&#8217;t hijack the entire process. The post announcing that library, and the code, has long since been lost but you can still [...]]]></description>
			<content:encoded><![CDATA[<p class="aligncenter"><img src="http://www.michaelwales.com/wp-content/uploads/2010/02/erkanaauth-banner.png" alt="ErkanaAuth" title="ErkanaAuth" width="696" height="230" /></p>
<p>In November 2007 I released an authentication library for <a href="http://www.codeigniter.com/" title="CodeIgniter">CodeIgniter</a> named ErkanaAuth. It was very simple to use since it just provided a few methods to make authentication simpler for you &#8211; it didn&#8217;t hijack the entire process. The post announcing that library, and the code, has long since been lost but you can still read the original post thanks to <a href="http://web.archive.org/web/20071111145023/http://www.michaelwales.com/2007/10/erkana-codeigniter-authorization-library/" title="Wayback Machine: Michael Wales - Erkana CodeIgniter Authorization Library">Archive.org&#8217;s Wayback machine</a>.</p>
<p>Recently, I&#8217;ve taken on a personal project of a rather grand-scale and have started factoring out the authentication logic into a library of it&#8217;s own, which I am referring to as ErkanaAuth 2.0. I am now releasing the library in its current state which is <strong>vastly unfinished</strong>! Nonetheless, I would love to hear your thoughts on the direction the library is headed and features you would like to see.</p>
<p>I don&#8217;t think I can reiterate this enough at this point in time, this is <strong>hardcore alpha</strong> &#8211; I should have called this <em>ErkanaAuth Version 2.0ha-dont-fucking-use-me-in-production-code</em>. I mean, in theory you could use this, and if its a library you want to use in future applications I strongly encourage you to give it a go. The authentication mechanism is secure but the library as a whole is sorely lacking in features at this point and is pretty hard-coded to a strict environment.</p>
<h4>Features</h4>
<ul>
<li>Authentication via username or email address and password.</li>
<li>Account creation using username or email address as unique identifier.</li>
<li>Locking of controllers/methods to logged-in users in one line.</li>
<li>Passwords are hashed with a salt prior to storing in the database.</li>
<li>User token stored in session is a hashed representation of the user&#8217;s ID and their password hash. Encrypting the session cookie via CodeIgniter&#8217;s <samp>config/config.php</samp> file adds another layer of security against altered session data.</li>
</ul>
<h4>Planned Features</h4>
<ul>
<li>Exponential delay on failed login attempts.</li>
<li>Group-based authorization system.</li>
<li>Require email validation on account creation.</li>
<li>Optional Captcha on account creation.</li>
<li>Linking of Facebook / Twitter authentication to Erkana Auth Account.</li>
<li>Forgotten password resets.</li>
<li>Extensive account API for building of authentication administration panels.</li>
<li>Extensive group API for building of authorization administration panels.</li>
</ul>
<h4>Installation</h4>
<p>The downloadable package includes a number of directories and files within those directories. It is advised to extract the archive in a temporary location, ensure there are no naming conflicts with your current application and then move the directories into your CodeIgniter application&#8217;s directory. The most common naming conflict will be with the <samp>models/account.php</samp> file. The list of files included are:</p>
<ul>
<li><samp>helpers/erkana_auth_helper.php</samp></li>
<li><samp>language/english/erkana_auth_lang.php</samp></li>
<li><samp>libraries/Erkana_auth.php</samp></li>
<li><samp>models/account.php</samp></li>
<li><samp>sql/1-create_accounts_email.sql</samp></li>
<li><samp>sql/1-create_accounts_username.sql</samp></li>
</ul>
<p>After installing the library within your application directory you must decide whether your application will authenticate based on username/password or email/password and run the correct SQL file on your database schema. This file will create a table named <code>accounts</code>, the statement run by <samp>sql/1-create_accounts_email.sql</samp> is:</p>
<script type="text/javascript" src="http://gist.github.com/294774.js"></script><noscript><p style="background-color:#ECEFF6;border:1px solid #D4DAE8;padding:5px;text-align:center;">Code snippets use JavaScript, please <a href="http://www.michaelwales.com/2010/02/erkanaauth-version-2-0a/">view this post</a> at MichaelWales.com or enable JavaScript in your browser.</p></noscript>
<p>If you run <samp>sql/1-create_accounts_username.sql</samp> the following statement will be executed:</p>
<script type="text/javascript" src="http://gist.github.com/294777.js"></script><noscript><p style="background-color:#ECEFF6;border:1px solid #D4DAE8;padding:5px;text-align:center;">Code snippets use JavaScript, please <a href="http://www.michaelwales.com/2010/02/erkanaauth-version-2-0a/">view this post</a> at MichaelWales.com or enable JavaScript in your browser.</p></noscript>
<h4>Usage</h4>
<p>ErkanaAuth aims to be as simple as possible in its usage. As of this version, this is primarily due to the limited scope of its functionality, but the overall feel for the library will differ as little as possible from what can be seen as of now. Many of the limitations on the library (i.e., strict naming of form fields) will be corrected as development continues.</p>
<p>ErkanaAuth does not assist in the creation of any front-end related code (i.e., user registration forms, login forms) at this time. ErkanaAuth simply provides a powerful set of methods to be used within your controllers to assist in getting an authentication system up and running as quickly as possible. Additionally, there is a helper function to display useful error messages to your users for invalid form submissions.</p>
<h5>Creating a User</h5>
<p>The <code>create_account()</code> method accepts a single string parameter of either <code>email</code> (default) or <code>username</code>, which should reflect the authentication mechanism you opted for during the installation and execution of the SQL file earlier. This method will return <code>TRUE</code> or <code>FALSE</code> if the user was created and can be used similarly as to how the standard <code>form_validation</code> library is used.</p>
<p>The library currently requires the following form fields to be present with the corresponding rulesets:</p>
<ul>
<li><code>email</code>: Only if you select the email authentication mechanism (<code>required|max_length[120]|valid_email|trim</code>)</li>
<li><code>username</code>: Only if you select the username authentication mechanism (<code>required|min_length[4]|max_length[20]|trim</code>)</li>
<li><code>password</code>: Always required (<code>required|matches[passwordconf]</code>)</li>
<li><code>passwordconf</code>: Always required (<code>required</code>)</li>
</ul>
<p>The controller method that displays and processes your account creation form should call the <code>create_account()</code> method and redirect on <code>TRUE</code>, otherwise loading the view file that contains your account creation form. In the following example, the user is redirected to <code>accounts/index()</code> which would display our login form.</p>
<script type="text/javascript" src="http://gist.github.com/294795.js"></script><noscript><p style="background-color:#ECEFF6;border:1px solid #D4DAE8;padding:5px;text-align:center;">Code snippets use JavaScript, please <a href="http://www.michaelwales.com/2010/02/erkanaauth-version-2-0a/">view this post</a> at MichaelWales.com or enable JavaScript in your browser.</p></noscript>
<h5>Validating a User&#8217;s Login Credentials</h5>
<p>The <code>validate_login()</code> method accepts a single string parameter of either <code>email</code> (default) or <code>username</code>, which should reflect the authentication mechanism you opted for during the installation and execution of the SQL file earlier. This method will return <code>TRUE</code> or <code>FALSE</code> if the credentials are valid and can be used similarly as to how the standard <code>form_validation</code> library is used.</p>
<p>The library currently requires the following form fields to be present:</p>
<ul>
<li><code>email</code>: Only if you select the email authentication mechanism</li>
<li><code>username</code>: Only if you select the username authentication mechanism</li>
<li><code>password</code>: Always required</li>
</ul>
<p>The controller method that displays and processes your login form should call the <code>validate_login()</code> method and redirect on <code>TRUE</code>, otherwise loading the view file that contains your login form. In the following example, the user is redirected to <code>announcements/index()</code> which would display a &#8220;dashboard&#8221; like page and only be accessible to logged in users.</p>
<script type="text/javascript" src="http://gist.github.com/294803.js"></script><noscript><p style="background-color:#ECEFF6;border:1px solid #D4DAE8;padding:5px;text-align:center;">Code snippets use JavaScript, please <a href="http://www.michaelwales.com/2010/02/erkanaauth-version-2-0a/">view this post</a> at MichaelWales.com or enable JavaScript in your browser.</p></noscript>
<h5>Validating a User&#8217;s Logged-in Status at Page Load</h5>
<p>The <code>required()</code> method provides a simple, one-line, way to validate a user&#8217;s session and ensure the user is logged into a valid account. This line should be placed within the constructor of any controller class you would like to complete protect or as the first line of a method you would like to protect. The following example is a controller named <code>Announcements</code> that currently only has its <code>index()</code> method protected. Any other methods added to this controller would not be protected without either moving the <code>required()</code> method to the constructor or placing a call to the <code>required()</code> method within the controller methods themselves.</p>
<script type="text/javascript" src="http://gist.github.com/294808.js"></script><noscript><p style="background-color:#ECEFF6;border:1px solid #D4DAE8;padding:5px;text-align:center;">Code snippets use JavaScript, please <a href="http://www.michaelwales.com/2010/02/erkanaauth-version-2-0a/">view this post</a> at MichaelWales.com or enable JavaScript in your browser.</p></noscript>
<h5>Displaying Errors on Invalid Form Submissions</h5>
<p>The library includes a helper with the function <code>authentication_errors()</code> to assist in displaying errors upon form submission. This function will return all errors, delimited by a <code><br /></code>. If there are no errors, <code>NULL</code> is returned. In the following example, we are displaying a login form that will display errors at the top of the form if any exist from prior submission attempts:</p>
<script type="text/javascript" src="http://gist.github.com/294816.js"></script><noscript><p style="background-color:#ECEFF6;border:1px solid #D4DAE8;padding:5px;text-align:center;">Code snippets use JavaScript, please <a href="http://www.michaelwales.com/2010/02/erkanaauth-version-2-0a/">view this post</a> at MichaelWales.com or enable JavaScript in your browser.</p></noscript>
<h4>Technical Details</h4>
<p>During account creation an alphanumeric string is randomly generated to serve as the user&#8217;s salt. This salt is then hashed with the user&#8217;s password and the resulting hash is stored in the database to validate against.</p>
<p>On a login attempt, the database is queried for a record based on your authentication mechanism (email or username). That record is then compared against the user submitted data for validation. On a successful validation, session variables are stored consisting of the record&#8217;s <code>id</code> and a hash of the record&#8217;s <code>id</code> field and <code>password_hash</code> field.</p>
<p>When a user visits a protected page the session is first checked for the variables that are set by a successful login. If these session variables exist, the database is queried for the record identified. If this record exists, the session is further validated by comparing the stored hash of the record&#8217;s <code>id</code> and <code>password_hash</code> with the data that is stored in the record.</p>
<h4>Download</h4>
<p><a href="http://www.michaelwales.com/wp-content/uploads/2010/02/erkana_auth-2.0a.zip">Erkana Auth 2.0a is available for download</a>. At this early stage of development a version control repository has not been made publicly available. In the future, Subversion and Git repositories will be made available.</p>
<h4>License</h4>
<p>ErkanaAuth 2.0a is licensed under the BSD License as defined by the <a href="http://creativecommons.org/licenses/BSD/">Human-Readable Creative Commons Deed</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.michaelwales.com/2010/02/erkanaauth-version-2-0a/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
	</channel>
</rss>
<!-- This Quick Cache file was built for (  www.michaelwales.com/category/projects/feed/ ) in 0.21492 seconds, on Feb 4th, 2012 at 1:53 am UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Feb 4th, 2012 at 2:53 am UTC -->
