<?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>Kerkness.ca &#187; Code</title>
	<atom:link href="http://www.kerkness.ca/content/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kerkness.ca</link>
	<description>flexing my kerkness, among other things</description>
	<lastBuildDate>Wed, 14 Oct 2009 15:12:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.3</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Unofficial Kohana 3.0 Wiki</title>
		<link>http://www.kerkness.ca/unofficial-kohana-3-0-wiki/</link>
		<comments>http://www.kerkness.ca/unofficial-kohana-3-0-wiki/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 15:12:39 +0000</pubDate>
		<dc:creator>Kerk</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://www.kerkness.ca/?p=618</guid>
		<description><![CDATA[I invite everyone to check out the Unofficial Kohana 3.0 Wiki.
Unofficial Kohana 3.0 Wiki
The purpose of this Wiki is to provide a place where the Kohana community can collaborate on documentation and tutorials and to provide a staging ground for writing official documentation.
]]></description>
			<content:encoded><![CDATA[<p>I invite everyone to check out the Unofficial Kohana 3.0 Wiki.</p>
<p><a href="http://kerkness.ca/wiki">Unofficial Kohana 3.0 Wiki</a></p>
<p>The purpose of this Wiki is to provide a place where the Kohana community can collaborate on documentation and tutorials and to provide a staging ground for writing official documentation.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kerkness.ca/unofficial-kohana-3-0-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Kohana for Wordpress RC1 Usage Examples</title>
		<link>http://www.kerkness.ca/kohana-for-wordpress-rc1-usage-examples/</link>
		<comments>http://www.kerkness.ca/kohana-for-wordpress-rc1-usage-examples/#comments</comments>
		<pubDate>Sun, 09 Aug 2009 16:32:33 +0000</pubDate>
		<dc:creator>Kerk</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://www.kerkness.ca/?p=606</guid>
		<description><![CDATA[Now that Kohana version 3.0 has reached a release candiate version I have also moved the Kohana-For-Wordpress plugin into a RC1 status and thought it would be useful to post some usage examples. Click here to download the plugin
There are five ways which you can call a Kohana controller from wordpress
1 &#8211; Use wordpress permalinks, [...]]]></description>
			<content:encoded><![CDATA[<p>Now that Kohana version 3.0 has reached a release candiate version I have also moved the Kohana-For-Wordpress plugin into a RC1 status and thought it would be useful to post some usage examples. <a href="http://wordpress.org/extend/plugins/kohana-for-wordpress/">Click here to download the plugin</a></p>
<p>There are five ways which you can call a Kohana controller from wordpress</p>
<p>1 &#8211; Use wordpress permalinks, .htaccess and Kohana default routing</p>
<p>2 &#8211; Use wordpress dashboard to bind kohana controllers to wordpress pages</p>
<p>3 &#8211; Use a template tag to call a controller from your wordpress templates</p>
<p>4 &#8211; Use a shortcut tag to call a controller from within a wordpress post or page</p>
<p>5 &#8211; Add a KohanaWidget to your wordpress sidebar</p>
<h2>Using Permalinks and Default Routing</h2>
<p>Follow the Wordpress instructions to set up permalinks for your blog. I use a custom permalink structure of <strong>/%postname%/</strong> which works well.  If you do this then you can also call any valid Kohana controller as long as the controller name does not conflict with your post name.</p>
<p>For example. If you have the following Kohana controller in <strong>application/classes/controller/mycontroller</strong> you&#8217;ll be able to call this controller from the url <strong>http:/myblogurl.com/mycontroller</strong>.</p>
<p><em>Important things to remember:</em> You&#8217;re controller will be loaded as if it is the content of a wordpress page. The page content will be whatever you set as your controller response. The title of the page however is taken from the wordpress database by default.  To set the title of your page with your Kohana controller you must update the &#8216;title&#8217; property of the Kohana request object as shown below</p>
<p style="padding-left: 30px;"><em>$this-&gt;request-&gt;title = &#8220;My Page Title&#8221;;</em></p>
<h2>Bind a Kohana Controller to a Wordpress Page</h2>
<p>If you go to the <em><strong>Settings &gt; Kohana</strong> </em>section of your wordpress dashboard you&#8217;ll have the ability to set some custom page routing.  Simply enter the Kohana controller ( <em><strong>controller/action/id</strong></em> )  in the appropriate input field and select a wordpress page from the dropdown menu.  You also have the option to set the desired placement of the controller&#8217;s response.</p>
<h2>Calling a Kohana Controller from a Wordpress Template</h2>
<p>From any wordpress template or theme file you have the option of calling a Kohana Controller using the following syntax</p>
<p style="padding-left: 30px;">&lt;?php kohana(&#8217;controller/action/id&#8217;); ?&gt;</p>
<h2>Using a Shortcut tag to call a Kohana Controller from a Post or Page</h2>
<p>If you want to call a Kohana Controller directly from a Wordpress post or page just use the following syntax when editing your content</p>
<p style="padding-left: 30px;">[ request controller/action/id ]</p>
<h2>Add a KohanaWidget to your Wordpress Sidebar</h2>
<p>From the <em><strong>Apperance &gt; Widget</strong></em> section of your dashboard add the KohanaWidget to your sidebar and provide a title and the controller you wish to call ( example  <em><strong>controller/action/id</strong></em> )</p>
<h2>Questions and Support</h2>
<p>For more support and to get answers to your questions head to <a href="http://forum.kohanaphp.com">http://forum.kohanaphp.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kerkness.ca/kohana-for-wordpress-rc1-usage-examples/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Dynamically add row to a table using PHP and Mootools</title>
		<link>http://www.kerkness.ca/add-row-to-table/</link>
		<comments>http://www.kerkness.ca/add-row-to-table/#comments</comments>
		<pubDate>Mon, 25 May 2009 19:44:54 +0000</pubDate>
		<dc:creator>Kerk</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[injection]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[table]]></category>

		<guid isPermaLink="false">http://www.kerkness.ca/?p=529</guid>
		<description><![CDATA[This short cross browser example will show you how to dynamically add rows to a table using PHP and Mootools.
The Files

table_form.html  ::  This is our main HTML file.  It contains a HTML Table and a simple Form.
table_form.php :: This is the php file which will process the form and return results back to our HTML [...]]]></description>
			<content:encoded><![CDATA[<p>This short cross browser example will show you how to dynamically add rows to a table using PHP and Mootools.</p>
<h2>The Files</h2>
<ul>
<li>table_form.html  ::  This is our main HTML file.  It contains a HTML Table and a simple Form.</li>
<li>table_form.php :: This is the php file which will process the form and return results back to our HTML page</li>
<li><a href="http://kerkness.ca/moo/table_form/table_form.js">table_form.js</a> :: This is the Javascript file which will handle submitting data to php and handle the response</li>
<li>table_form.css :: basic css file to add styling</li>
</ul>
<p><a href="http://kerkness.ca/moo/table_form/table_form.html">View a Demo</a></p>
<p><a href="http://kerkness.ca/moo/table_form/table_form.zip">Download the full Source</a></p>
<p>I&#8217;ve tried to add detailed comments to the source code but if you have any questions just post them in the comments.</p>
<h2>The Bare Bones : Row Injection</h2>
<p>For those who are only interested in the table row injection here is a function which will get the job done and is crossbrowser. If you find otherwise let me know. The key here is instead of creating individual elements for tr and td and injecting them into the table, you create a full table element with a single row and inject that into your table.</p>
<pre name="code" class"js">
var inject_row = function( table, data )
{
    var str = '';
    data.each(function(item, index){
        str += '&lt;td&gt;'+item+'&lt;/td&gt;';
    });
    var tr = new Element('div', {
        html: '&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;' + str + '&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;'
    }).getElement('tr');
    tr.inject( table );
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.kerkness.ca/add-row-to-table/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Kohana Media Controller</title>
		<link>http://www.kerkness.ca/kohana-media-controller/</link>
		<comments>http://www.kerkness.ca/kohana-media-controller/#comments</comments>
		<pubDate>Mon, 25 May 2009 04:42:30 +0000</pubDate>
		<dc:creator>Kerk</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Components]]></category>
		<category><![CDATA[controllers]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[kohana]]></category>
		<category><![CDATA[media]]></category>

		<guid isPermaLink="false">http://www.kerkness.ca/?p=523</guid>
		<description><![CDATA[Here is a Media Controller I put together for my own Kohana projects. This controller will server valid css, javascript, png, jpeg or gif files that are in your Kohana application/views/media folder.
view the source here
Usage

save the source code linked above as media.php and place it in your application/controllers/ folder
place your css files in the folder [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a Media Controller I put together for my own Kohana projects. This controller will server valid css, javascript, png, jpeg or gif files that are in your Kohana application/views/media folder.</p>
<p><a href="http://kerkness.ca/downloads/kohana/media_controller.txt">view the source here</a></p>
<h2>Usage</h2>
<ul>
<li>save the source code linked above as <strong>media.php</strong> and place it in your <em>application/controllers/</em> folder</li>
<li>place your <strong>css</strong> files in the folder <em>application/views/media/css/</em></li>
<li>place your <strong>js</strong> files in the folder <em>application/views/media/js/</em></li>
<li>place your <strong>images</strong> in the folder <em>application/views/image/</em></li>
</ul>
<p>You can now load your files easily using Kohana helpers. NOTE: using file extensions when calling files is optional</p>
<pre>echo html::stylesheet( array('media/css/style'), array('screen') );</pre>
<pre>echo html::script(array('media/js/mootools'), FALSE);</pre>
<pre>echo html::image('media/image/loading');</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.kerkness.ca/kohana-media-controller/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Hot Flash Alert :: An Alert Box using Mootools</title>
		<link>http://www.kerkness.ca/mootools-alert-box/</link>
		<comments>http://www.kerkness.ca/mootools-alert-box/#comments</comments>
		<pubDate>Sat, 23 May 2009 17:29:16 +0000</pubDate>
		<dc:creator>Kerk</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Components]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[alert]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mootools]]></category>

		<guid isPermaLink="false">http://www.kerkness.ca/?p=507</guid>
		<description><![CDATA[I&#8217;ve been playing around with mootools and have created a little alert box called &#8220;Hot Flash Alert&#8221; which can be handy for flashing confirmation messages to a user or informing them of input errors.
Example
Show Alert then Fade
Show Alert
To use Hot Flash Alert in your web site you&#8217;ll need to complete a few simple steps.
Step 1 [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been playing around with mootools and have created a little alert box called &#8220;Hot Flash Alert&#8221; which can be handy for flashing confirmation messages to a user or informing them of input errors.</p>
<h2>Example</h2>
<p><a id="hot_flash_fade_out_button" href="#">Show Alert then Fade</a></p>
<p><a id="hot_flash_button" href="#">Show Alert</a></p>
<p>To use Hot Flash Alert in your web site you&#8217;ll need to complete a few simple steps.</p>
<h2>Step 1 : Include the required Javascript and CSS files in your web site header.</h2>
<p>The Hot Flash Alert requires <a href="http://ajax.googleapis.com/ajax/libs/mootools/1.2.1/mootools-yui-compressed.js">Mootools.js</a>, <a href="http://kerkness.ca/hot_flash/hot_flash.js">hot_flash.js</a>, and <a href="http://kerkness.ca/hot_flash/hot_flash.css">hot_flash.css</a> .</p>
<h2>Step 2 : Add the Alert Box DIV to your theme</h2>
<p>The Hot Flash Alert is actually a div which sits in your web page until it is called.  It&#8217;s probably best to stick the div at the bottom of your web page so that it displays on top of any other absolutely positioned elements.</p>
<pre>
&lt;div id="alert_box"&gt;
   &lt;div id="alert_head"&gt;
      &lt;a id="alert_box_x" href="#"&gt;close&lt;/a&gt;
   &lt;/div&gt;
   &lt;div id="alert_box_message"&gt;&lt;/div&gt;
&lt;/div&gt;</pre>
<p>You can customize the DIV anyway you want but it will require all four elements &#8216;alert_box&#8217;, &#8216;alert_head&#8217;, &#8216;alert_box_x&#8217; and &#8216;alert_box_message&#8217;.  The styling of these elements is handled by the <a href="http://kerkness.ca/hot_flash/hot_flash.css">hot_flash.css</a> file.</p>
<h2>Step 3 :  Call the hot_flash() javascript method</h2>
<p>Once all the pieces are in place you can pop open the Hot Flash Alert by calling the hot_flash() javacript method. </p>
<pre>
 // text = the message that will be displayed
 // duration (optional) milliseconds to fade out the alert
 hot_flash( text, duration );
</pre>
<p>Here are some examples.</p>
<pre>
  // simple alert that fades out on it's own
  // over 2000 milliseconds ( or 2 seconds )
  hot_flash('hello world', 2000 );

  // simple alert with close button
  hot_flash('goodbye world');</pre>
<p>It&#8217;s as simple as that.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kerkness.ca/mootools-alert-box/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Kohana and Wordpress playing together</title>
		<link>http://www.kerkness.ca/kohana-and-wordpress-playing-together/</link>
		<comments>http://www.kerkness.ca/kohana-and-wordpress-playing-together/#comments</comments>
		<pubDate>Wed, 13 May 2009 22:15:27 +0000</pubDate>
		<dc:creator>Kerk</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[kohana php mvc wordpress]]></category>

		<guid isPermaLink="false">http://www.kerkness.ca/?p=502</guid>
		<description><![CDATA[I&#8217;ve recently developed a crush on Kohana, a PHP5 framework that uses an MVC architecture. For many years I have been using my own framework and have never found anything which I liked better until now. I find Kohana impressive because it uses strict PHP5 OOP, has a  powerful event handler and can be easily [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently developed a crush on <a title="Kohana PHP" href="http://kohanaphp.com/" target="_blank">Kohana</a>, a PHP5 framework that uses an MVC architecture. For many years I have been using <a title="Kerkness" href="http://www.kerkness.ca/kerkness/" target="_self">my own</a> framework and have never found anything which I liked better until now. I find Kohana impressive because it uses strict PHP5 OOP, has a  powerful event handler and can be easily extended.  It is also small and not bloated which was one of the reasons why I&#8217;ve never adobted the larger PHP frameworks such as Zend or PEAR.</p>
<h2>Building Wordpress Plugins using Kohana</h2>
<p>The other PHP framework which I have to also admit having a crush on is <a href="http://wordpress.org" target="_blank">Wordpress</a>. While Wordpress is the complete opposite of something like Kohana, it&#8217;s still a very powerful and popular framework for building sites. I often find myself having to build a web site for someone else to manage and maintain.  Wordpress is great for this because out of the box it has a lot of features that your basic webmaster is looking for and it has a large community that can provide support ( something I don&#8217;t like doing ). The only downside to building a web site in Wordpress (IMHO) is that when it comes to building custom plugins the process is simply not OOP.</p>
<p>In order to bridge these two worlds and make my life a little easier I have created the <a title="Kohana For Wordpress" href="http://kerkness.ca/kohana-for-wordpress" target="_self">Kohana for Wordpress</a> plugin. Hopefully this plugin will be useful to some people.</p>
<p><a href="http://kerkness.ca/kohana-for-wordpress">More details and download the plugin here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kerkness.ca/kohana-and-wordpress-playing-together/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Forgotten PHP : Some useful and simple PHP features that I often forget about.</title>
		<link>http://www.kerkness.ca/forgotten-php-some-useful-and-simple-php-features-that-i-often-forget-about/</link>
		<comments>http://www.kerkness.ca/forgotten-php-some-useful-and-simple-php-features-that-i-often-forget-about/#comments</comments>
		<pubDate>Fri, 01 May 2009 22:06:49 +0000</pubDate>
		<dc:creator>Kerk</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[number_format]]></category>
		<category><![CDATA[parse_str]]></category>
		<category><![CDATA[sprintf]]></category>
		<category><![CDATA[substr_count]]></category>
		<category><![CDATA[urldecode]]></category>
		<category><![CDATA[urlencode]]></category>
		<category><![CDATA[vsprintf]]></category>

		<guid isPermaLink="false">http://www.kerkness.ca/?p=425</guid>
		<description><![CDATA[I&#8217;ve been programming with PHP for many years but regardless how familiar I am with the language I am constantly looking at reference documentation for reminders on how to do things. Here&#8217;s a list of some really handy PHP functions that I often forget about and then will stumble across them in documentation and am [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been programming with PHP for many years but regardless how familiar I am with the language I am constantly looking at <a href="http://ca.php.net/manual/en/funcref.php" target="_blank">reference documentation</a> for reminders on how to do things. Here&#8217;s a list of some really handy PHP functions that I often forget about and then will stumble across them in documentation and am reminded why I shouldn&#8217;t forget about them.</p>
<h2>How to format text to be inserted into a url</h2>
<p>If you need to pass some text or a dynamic string in a URL use <strong><em>urlencode()</em></strong> and <em><strong>urldecode()</strong></em></p>
<pre>// encoding the string
$str = "Jerry's Bedding Plants &amp; Ice Cream";
$url = 'http://www.example.com/page.php?args=' . urlencode( $str );

// decoding the string in page.php
$str = urldecode( $_GET['args'] );</pre>
<h2>Parsing a query string</h2>
<p>Want to automatically take the query string and dump the values into an array ? Use <em><strong>parse_str()</strong></em> . You can easily get the query string from <strong><em>$_SERVER['QUERY_STRING']</em></strong></p>
<pre name="code" class"php">$query = $_SERVER['QUERY_STRING'];  // foo=bar&amp;bar=foo&amp;cool=me&amp;you=ok
$vars = array();
parse_str( $query, $vars );
print_r( $vars );

/* output
Array
(
  [foo] =&gt; bar
  [bar] =&gt; foo
  [cool] =&gt; me
  [you] =&gt; ok
)
*/</pre>
<h2>Creating a formatted string</h2>
<p>Most people are very familiar with <strong><em>printf()</em></strong> in php but if you&#8217;re like me you often forget about <em><strong>sprintf()</strong></em> which returns your formatted string instead of printing it to the screen.</p>
<pre>$isodate = sprintf("%04d-%02d-%02d", $year, $month, $day);</pre>
<p>Another one you might forget about is <em><strong>vsprintf()</strong></em> which is similar to <em><strong>sprintf()</strong></em> but works with an array</p>
<pre name="code" class"php">$data = array( $year, $month, $day );
$isodate = vsprintf("%04d-%02d-%02d", $data );</pre>
<h2>Formatting numbers</h2>
<p>For some reason I always forget the arguments for the PHP <em><strong>number_format()</strong></em> function. The function takes one, two or 4 arguments ( will not accept just 3 arguments ).</p>
<pre name="code" class"php">// string number_format  ( float $number  , int $decimals  , string $dec_point  , string $thousands_sep  )
$number = number_format( '32456.82', 2, '.', ',' );</pre>
<h2>Count the number of times a small string occurs in a large string</h2>
<pre name="code" class"php">// how many times do I say rad;
$str = "I've got some rad moves, super rad moves, I've got rad mad bad not sad rad moves.";
$rad_count = substr_count( $str, 'rad' );</pre>
<p>Happy coding nerds !</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kerkness.ca/forgotten-php-some-useful-and-simple-php-features-that-i-often-forget-about/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ajax shhmajax : Just show me a simple XMLHttpRequest Example</title>
		<link>http://www.kerkness.ca/ajax-shhmajax-just-show-me-a-simple-xmlhttprequest-example/</link>
		<comments>http://www.kerkness.ca/ajax-shhmajax-just-show-me-a-simple-xmlhttprequest-example/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 17:05:22 +0000</pubDate>
		<dc:creator>Kerk</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Musings]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[XMLHttpRequest]]></category>

		<guid isPermaLink="false">http://www.kerkness.ca/?p=414</guid>
		<description><![CDATA[There is no shortage of bloated and complicated &#8216; ajax &#8216; libraries out there. I say ajax with quotes because I find the term to be somewhat useless other than to add further confusion to something that should just be called what it is.. an XMLHttpRequest. When the term &#8216; ajax &#8216; first started being [...]]]></description>
			<content:encoded><![CDATA[<p>There is no shortage of bloated and complicated &#8216; ajax &#8216; libraries out there. I say ajax with quotes because I find the term to be somewhat useless other than to add further confusion to something that should just be called what it is.. an XMLHttpRequest. When the term &#8216; ajax &#8216; first started being used I was like all &#8220;oooh, what&#8217;s this ? &#8221; but then I was like &#8221; oh, it&#8217;s just XMLHttpRequest.  I&#8217;ve been using that for a few years &#8220;.</p>
<p>Anyway here are a couple of very simple and straightforward ajax functions ( yes I&#8217;m calling them ajax even tho I hate the word ).</p>
<p><code><br />
function ajaxPost(url,stream,callback)<br />
{<br />
	ajaxRequest(url,stream,callback,'POST');<br />
}</p>
<p>function ajaxGet(url,callback)<br />
{<br />
	ajaxRequest(url, '' ,callback, 'GET' );<br />
}</p>
<p>function ajaxRequest(url,stream,callback,method)<br />
{<br />
	if( ! method ) method = 'POST';<br />
    var xmlhttp = new XMLHttpRequest();<br />
    xmlhttp.open(method, url, true);<br />
    xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');<br />
    xmlhttp.onreadystatechange=function() {<br />
        if(xmlhttp.readyState==4)<br />
            { callback(xmlhttp.responseText); }<br />
    };<br />
    xmlhttp.send(stream);<br />
}<br />
</code></p>
<p>Here&#8217;s an example of how to use these functions.</p>
<p><code><br />
&lt;script&gt;<br />
function callRequest()<br />
{<br />
     var uri = "http://kerkness.ca/kerkdemo/hello.world";<br />
     var stream = "myvar=this&#038;myothervar=that";<br />
     ajaxGet( uri, requestResponseHandler );<br />
}<br />
function requestResponseHandler( response )<br />
{<br />
    alert( response );<br />
}<br />
&lt;/script&gt;</p>
<p>&lt;a href="#" onclick="callRequest()"&gt;clicky me&lt;/a&gt;</p>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kerkness.ca/ajax-shhmajax-just-show-me-a-simple-xmlhttprequest-example/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How To Launch an Adobe Air WindowedApplication in Full Screen Mode</title>
		<link>http://www.kerkness.ca/how-to-launch-an-adobe-air-windowedapplication-in-full-screen-mode/</link>
		<comments>http://www.kerkness.ca/how-to-launch-an-adobe-air-windowedapplication-in-full-screen-mode/#comments</comments>
		<pubDate>Sat, 28 Mar 2009 03:23:35 +0000</pubDate>
		<dc:creator>Kerk</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[adobe air]]></category>
		<category><![CDATA[mxml]]></category>
		<category><![CDATA[windowedapplication]]></category>

		<guid isPermaLink="false">http://www.kerkness.ca/?p=408</guid>
		<description><![CDATA[Here is a basic Adobe Air WindowedApplication set up to launch in full screen mode.

&#60;?xml version="1.0" encoding="utf-8"?&#62;
&#60;mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" applicationComplete="init()"&#62;

&#60;mx:Script&#62;
	&#60;![CDATA[

private function init():void
{
	systemManager.stage.displayState=flash.display.StageDisplayState.FULL_SCREEN_INTERACTIVE
}
	]]&#62;
&#60;/mx:Script&#62;

&#60;/mx:WindowedApplication&#62;

]]></description>
			<content:encoded><![CDATA[<p>Here is a basic Adobe Air WindowedApplication set up to launch in full screen mode.</p>
<pre>
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" applicationComplete="init()"&gt;

&lt;mx:Script&gt;
	&lt;![CDATA[

private function init():void
{
	systemManager.stage.displayState=flash.display.StageDisplayState.FULL_SCREEN_INTERACTIVE
}
	]]&gt;
&lt;/mx:Script&gt;

&lt;/mx:WindowedApplication&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.kerkness.ca/how-to-launch-an-adobe-air-windowedapplication-in-full-screen-mode/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Monitor your flash log when debugging Flex or Air Application on OSX</title>
		<link>http://www.kerkness.ca/monitor-your-flash-log-when-debugging-flex-or-air-application-on-osx/</link>
		<comments>http://www.kerkness.ca/monitor-your-flash-log-when-debugging-flex-or-air-application-on-osx/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 20:37:41 +0000</pubDate>
		<dc:creator>Kerk</dc:creator>
				<category><![CDATA[Actionscript]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[adobe air]]></category>
		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">http://www.kerkness.ca/?p=404</guid>
		<description><![CDATA[When building and debugging a Flex or Air application it can be a big help if you&#8217;re able to monitor the progress the application makes through your various classes and views.  A great way to do this is to add trace(&#8221;I am here&#8221;) function calls to your code and then monitor the flash log [...]]]></description>
			<content:encoded><![CDATA[<p>When building and debugging a Flex or Air application it can be a big help if you&#8217;re able to monitor the progress the application makes through your various classes and views.  A great way to do this is to add <strong><em>trace(&#8221;I am here&#8221;)</em></strong> function calls to your code and then monitor the flash log file when running the application.</p>
<ol>
<li>Make sure you have the debugger version of the flash player installed</li>
<li>Add  trace(&#8221;your test message or details&#8221;);  to your code where appropriate</li>
<li>Open Applications/Utilities/Terminal</li>
<li>Go to the location of the Flash log file..<br />
<strong><em>/Users/[username]/Library/Preferences/[App Name]/Local Store/<br />
</em></strong></li>
<li>Type the following command<br />
<strong><em>tail -f flashlog.txt<br />
</em></strong></li>
<li>Launch your application.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.kerkness.ca/monitor-your-flash-log-when-debugging-flex-or-air-application-on-osx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
