<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Thoughts by Techxplorer</title>
	<atom:link href="http://techxplorer.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://techxplorer.com</link>
	<description>Thoughts on my experiences with technology</description>
	<lastBuildDate>Mon, 23 Jan 2012 12:15:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='techxplorer.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/5dd756fac29d9d9db0ec158a09916957?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Thoughts by Techxplorer</title>
		<link>http://techxplorer.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://techxplorer.com/osd.xml" title="Thoughts by Techxplorer" />
	<atom:link rel='hub' href='http://techxplorer.com/?pushpress=hub'/>
		<item>
		<title>My Honours Thesis is Online</title>
		<link>http://techxplorer.com/2011/12/28/my-honours-thesis-is-online/</link>
		<comments>http://techxplorer.com/2011/12/28/my-honours-thesis-is-online/#comments</comments>
		<pubDate>Wed, 28 Dec 2011 07:00:26 +0000</pubDate>
		<dc:creator>techxplorer</dc:creator>
				<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[honours-thesis]]></category>
		<category><![CDATA[serval project]]></category>

		<guid isPermaLink="false">http://techxplorer.com/?p=2265</guid>
		<description><![CDATA[This past year I&#8217;ve been studying part time for a Bachelor of Science (Honours) degree specialising in Computer Science at &#8230;<p><a href="http://techxplorer.com/2011/12/28/my-honours-thesis-is-online/">Continue reading &#187;</a></p><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techxplorer.com&amp;blog=193831&amp;post=2265&amp;subd=techxplorer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="attachment_2267" class="wp-caption alignright" style="width: 250px"><a href="http://www.flickr.com/photos/samhames/4699360569/"><img class="size-full wp-image-2267" title="A thesis of procrastination?" src="http://techxplorer.files.wordpress.com/2011/12/writing-thesis.jpg?w=529" alt=""   /></a><p class="wp-caption-text">By: Sam Hames</p></div>
<p>This past year I&#8217;ve been studying part time for a <a title="More information about the degree" href="http://www.flinders.edu.au/courses/rules/undergrad/hbsc/hbsc_home.cfm">Bachelor of Science (Honours) degree</a> specialising in Computer Science at <a title="Flinders University homepage" href="http://www.flinders.edu.au">Flinders University</a>. The focus of my studies has been my honours thesis. My thesis explored the following research question:</p>
<blockquote><p>Is it possible to provide collaborative mapping services on mobile devices in an infrastructure independent manner?</p></blockquote>
<p>To explore this question I developed an Android based application that could support four core objectives. They were:</p>
<ol>
<li>have the users own geographic location displayed on a map;</li>
<li>add incidents, represented by a marker, onto a map;</li>
<li>be able to see the geographic location of other users of the application on the map; and</li>
<li>share details of incidents with other users of the application on the network.</li>
</ol>
<p>The software that I developed uses the resilient Ad Hoc mesh network provided by the <a title="Serval Project homepage" href="http://www.servalproject.org">Serval Project</a> to ensure that communication between instances of the application are infrastructure independent.</p>
<p>The thesis is <a title="More information about my thesis" href="http://bytechxplorer.com/studies/honours-thesis/">available online</a> on my <a title="Stuff by Techxplorer homepage" href="http://bytechxplorer.com/">Stuff by Techxplorer</a> website.</p>
<p>The photo &#8220;<a title="Direct link to the photo" href="http://www.flickr.com/photos/samhames/4699360569/">Writing Thesis</a>&#8221; was uploaded to <a title="Flickr homepage" href="http://www.flickr.com/">Flickr</a> by <a title="Flickr Profile Page" href="http://www.flickr.com/people/samhames/">Sam Hames</a> and used under the terms of a <a title="Details of the license" href="http://creativecommons.org/licenses/by-sa/2.0/deed.en">Creative Commons License</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techxplorer.wordpress.com/2265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techxplorer.wordpress.com/2265/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techxplorer.wordpress.com/2265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techxplorer.wordpress.com/2265/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techxplorer.wordpress.com/2265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techxplorer.wordpress.com/2265/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techxplorer.wordpress.com/2265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techxplorer.wordpress.com/2265/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techxplorer.wordpress.com/2265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techxplorer.wordpress.com/2265/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techxplorer.wordpress.com/2265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techxplorer.wordpress.com/2265/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techxplorer.wordpress.com/2265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techxplorer.wordpress.com/2265/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techxplorer.com&amp;blog=193831&amp;post=2265&amp;subd=techxplorer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techxplorer.com/2011/12/28/my-honours-thesis-is-online/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e3e762252143800cc3b6efe3eaf8913a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">techxplorer</media:title>
		</media:content>

		<media:content url="http://techxplorer.files.wordpress.com/2011/12/writing-thesis.jpg" medium="image">
			<media:title type="html">A thesis of procrastination?</media:title>
		</media:content>
	</item>
		<item>
		<title>First Version of Techxplorer&#8217;s CMS Released</title>
		<link>http://techxplorer.com/2011/12/27/first-version-of-techxplorers-cms-released/</link>
		<comments>http://techxplorer.com/2011/12/27/first-version-of-techxplorers-cms-released/#comments</comments>
		<pubDate>Tue, 27 Dec 2011 07:31:23 +0000</pubDate>
		<dc:creator>techxplorer</dc:creator>
				<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[multimarkdown]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[webdevelopment]]></category>

		<guid isPermaLink="false">http://techxplorer.com/?p=2261</guid>
		<description><![CDATA[Today I released the first version of Techxplorer&#8217;s CMS. The source code is available on GitHub. Techxplorer&#8217;s CMS is a series of &#8230;<p><a href="http://techxplorer.com/2011/12/27/first-version-of-techxplorers-cms-released/">Continue reading &#187;</a></p><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techxplorer.com&amp;blog=193831&amp;post=2261&amp;subd=techxplorer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="attachment_2262" class="wp-caption alignright" style="width: 250px"><a href="http://www.flickr.com/photos/depone/63690548/"><img class="size-full wp-image-2262" title="content-management" src="http://techxplorer.files.wordpress.com/2011/12/content-management.jpg?w=529" alt=""   /></a><p class="wp-caption-text">By: depone</p></div>
<p>Today I released the first version of <a title="Direct link for more information" href="http://bytechxplorer.com/development/personal/techxplorers-cms">Techxplorer&#8217;s CMS</a>. The source code is <a title="Download the source code for the project" href="https://github.com/techxplorer/Techxplorer-s-CMS">available on GitHub</a>.</p>
<p>Techxplorer&#8217;s CMS is a series of PHP scripts, and accompanying JavaScript files, that I use in conjunction with <a title="More information about MultiMarkdown" href="http://fletcherpenney.net/multimarkdown/">MultiMarkdown</a> to manage the <a title="Stuff by Techxplorer homepage" href="http://bytechxplorer.com/">Stuff by Techxplorer</a> website. The CMS was designed with similar goals to that of the <a title="MultiMarkdown CMS homepage" href="http://fletcherpenney.net/multimarkdown/cms/">MultiMarkdown CMS</a>. I decided to develop my own system for three main reasons:</p>
<ol>
<li>I wanted to see if I could do it</li>
<li>I wanted something in PHP as I’m allergic to Perl</li>
<li>I didn’t need all of the functionality that the MultiMarkdown CMS provides</li>
</ol>
<p>The current version of the system provides the following capabilities:</p>
<ol>
<li>Convert MultiMarkdown source files into HTML files when the md file is newer or there is no corresponding HTML file</li>
<li>Match the URL of the request to a HTML file in the content directory</li>
<li>Incorporate the HTML from the file into the website template</li>
<li>Automatically add a table of contents via JavaScript when required</li>
<li>Automatically create links from citations to a bibliography when required</li>
<li>Add an image cycle to a page</li>
<li>Automatically include page, directory and site specific metadata</li>
</ol>
<p>The photo &#8220;<a title="Direct link to the photo" href="http://www.flickr.com/photos/depone/63690548/">Content Management</a>&#8221; was uploaded to <a title="Flickr homepage" href="http://www.flickr.com/">Flickr</a> by <a title="Flickr profile page" href="http://www.flickr.com/people/depone/">depone</a> and used under the terms of a <a title="More information about the license" href="http://creativecommons.org/licenses/by-sa/2.0/deed.en">Creative Commons License</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techxplorer.wordpress.com/2261/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techxplorer.wordpress.com/2261/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techxplorer.wordpress.com/2261/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techxplorer.wordpress.com/2261/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techxplorer.wordpress.com/2261/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techxplorer.wordpress.com/2261/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techxplorer.wordpress.com/2261/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techxplorer.wordpress.com/2261/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techxplorer.wordpress.com/2261/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techxplorer.wordpress.com/2261/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techxplorer.wordpress.com/2261/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techxplorer.wordpress.com/2261/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techxplorer.wordpress.com/2261/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techxplorer.wordpress.com/2261/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techxplorer.com&amp;blog=193831&amp;post=2261&amp;subd=techxplorer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techxplorer.com/2011/12/27/first-version-of-techxplorers-cms-released/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e3e762252143800cc3b6efe3eaf8913a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">techxplorer</media:title>
		</media:content>

		<media:content url="http://techxplorer.files.wordpress.com/2011/12/content-management.jpg" medium="image">
			<media:title type="html">content-management</media:title>
		</media:content>
	</item>
		<item>
		<title>My Expo Poster Won an Award</title>
		<link>http://techxplorer.com/2011/12/27/my-expo-poster-won-an-award/</link>
		<comments>http://techxplorer.com/2011/12/27/my-expo-poster-won-an-award/#comments</comments>
		<pubDate>Tue, 27 Dec 2011 07:11:01 +0000</pubDate>
		<dc:creator>techxplorer</dc:creator>
				<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[honours-thesis]]></category>
		<category><![CDATA[poster presentation]]></category>
		<category><![CDATA[serval project]]></category>

		<guid isPermaLink="false">http://techxplorer.com/?p=2254</guid>
		<description><![CDATA[In November this year my honours course required that I develop a poster presentation. A poster presentation is basically an &#8230;<p><a href="http://techxplorer.com/2011/12/27/my-expo-poster-won-an-award/">Continue reading &#187;</a></p><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techxplorer.com&amp;blog=193831&amp;post=2254&amp;subd=techxplorer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://bytechxplorer.com/assets/images/expo-poster-prize.jpg"><img class="alignright size-full wp-image-2255" title="expo-poster-prize" src="http://techxplorer.files.wordpress.com/2011/12/expo-poster-prize-thumbnail.jpg?w=529" alt=""   /></a>In November this year my honours course required that I develop a poster presentation. A poster presentation is basically an A1 sized poster that you stand in front of while people wander around the expo. It is a great opportunity for <a title="CSEM school homepage" href="http://flinders.edu.au/science_engineering/csem/">the school</a> to promote the research and projects that have been undertaken over the course of the year by the students.</p>
<p>In the morning members of the school are invited to attend and check out what we&#8217;ve been doing. Some are assigned individual students and they must assess their posters. At the same time a group of industry representatives is also working their way through the expo evaluating a number of projects for awards.</p>
<p>My poster, and presentation, was selected for the &#8220;Most Outstanding Software Engineering Project 2011&#8243;. On Christmas Eve the award arrived in the mail, which was a very pleasant surprise.</p>
<p>The poster is <a title="Download my poster" href="http://bytechxplorer.com/downloads/comp4007-poster.pdf">available as a PDF</a> via my <a title="Stuff by Techxplorer homepage" href="http://bytechxplorer.com/">bytechxplorer.com</a> site and my <a title="View my honours thesis online" href="http://bytechxplorer.com/studies/honours-thesis/">honours thesis is also available</a>.</p>
<p>Many thanks to my supervisors for providing feedback on my poster and for giving me the opportunity to work on the <a title="Serval Project homepage" href="http://www.servalproject.org">Serval Project</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techxplorer.wordpress.com/2254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techxplorer.wordpress.com/2254/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techxplorer.wordpress.com/2254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techxplorer.wordpress.com/2254/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techxplorer.wordpress.com/2254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techxplorer.wordpress.com/2254/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techxplorer.wordpress.com/2254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techxplorer.wordpress.com/2254/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techxplorer.wordpress.com/2254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techxplorer.wordpress.com/2254/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techxplorer.wordpress.com/2254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techxplorer.wordpress.com/2254/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techxplorer.wordpress.com/2254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techxplorer.wordpress.com/2254/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techxplorer.com&amp;blog=193831&amp;post=2254&amp;subd=techxplorer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techxplorer.com/2011/12/27/my-expo-poster-won-an-award/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e3e762252143800cc3b6efe3eaf8913a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">techxplorer</media:title>
		</media:content>

		<media:content url="http://techxplorer.files.wordpress.com/2011/12/expo-poster-prize-thumbnail.jpg" medium="image">
			<media:title type="html">expo-poster-prize</media:title>
		</media:content>
	</item>
		<item>
		<title>Using timestamp Fields in MySQL with Lithium</title>
		<link>http://techxplorer.com/2011/11/25/using-timestamp-fields-in-mysql-with-lithium/</link>
		<comments>http://techxplorer.com/2011/11/25/using-timestamp-fields-in-mysql-with-lithium/#comments</comments>
		<pubDate>Fri, 25 Nov 2011 04:51:54 +0000</pubDate>
		<dc:creator>techxplorer</dc:creator>
				<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[li3]]></category>
		<category><![CDATA[lithium]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://techxplorer.com/?p=2248</guid>
		<description><![CDATA[This post is a continuation of the series of posts that I&#8217;ve written on my experiences with the Lithium framework. In the MARQues project I wanted to &#8230;<p><a href="http://techxplorer.com/2011/11/25/using-timestamp-fields-in-mysql-with-lithium/">Continue reading &#187;</a></p><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techxplorer.com&amp;blog=193831&amp;post=2248&amp;subd=techxplorer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="attachment_2252" class="wp-caption alignright" style="width: 250px"><a href="http://www.flickr.com/photos/tonivc/2283676770"><img class="size-full wp-image-2252" title="time" src="http://techxplorer.files.wordpress.com/2011/11/time.jpg?w=529" alt=""   /></a><p class="wp-caption-text">By: Toni Verdú Carbó</p></div>
<p>This post is a continuation of the series of posts that I&#8217;ve written on <a title="List of posts tagged Lithium" href="http://techxplorer.com/tag/lihtium/">my experiences</a> with the <a title="Lithium homepage" href="http://lithify.me/">Lithium</a> framework.</p>
<p>In the <a title="MARQues project Google Code page" href="http://code.google.com/p/marques-project/">MARQues project</a> I wanted to have a very simple way of logging the occurrence of various activities. The two activities I&#8217;m most interested in are the two types of searching that a user can undertake. I want the system to be able log when a search is undertaken and what search terms were used.</p>
<p>Initially I&#8217;d developed my simple activity logging table in the MySQL database with a <a title="Direct link to the MySQL documentation on this type of field" href="http://dev.mysql.com/doc/refman/5.1/en/timestamp.html">timestamp field</a>. Unfortunately this field doesn&#8217;t currently work with the Lithium framework. No matter what I did the field was always populated with zeros. This is a <a title="Direct link to the bug report" href="https://github.com/UnionOfRAD/lithium/issues/28">known issue</a> and is currently marked as an enhancement.</p>
<p>To resolve the issue I changed the field to an ordinary <a title="Direct link to the MySQL documentation on this type of field" href="http://dev.mysql.com/doc/refman/5.1/en/datetime.html">datetime field</a> and used the PHP <a title="Direct link to the PHP documentation on this function" href="http://www.php.net/manual/en/function.date.php">date function</a> to populate it. For example I use the model like this:</p>
<p><pre class="brush: php;">

// build an array of values
$log = array(
  'type'  =&gt; 'search',
  'notes' =&gt; $this-&gt;request-&gt;data['search'],
  'timestamp' =&gt; date('Y-m-d H:i:s')
);

// create an instance of the model using the values
$activity = ActivityLogs::create($log);

// save the model
$activity-&gt;save();

</pre></p>
<p>I hope this post proves useful to other who may be experiencing similar issues.</p>
<p>The photo &#8220;<a title="Direct link to the photo on Flickr" href="http://www.flickr.com/photos/tonivc/2283676770">The passage of Time</a>&#8221; was uploaded to <a title="Flickr homepage" href="http://www.flickr.com/">Flickr</a> by <a title="Flickr profile page" href="http://www.flickr.com/people/tonivc/">Toni Verdú Carbó</a> and used under the terms of a <a title="More information about the license" href="http://creativecommons.org/licenses/by-nc-nd/2.0/">Creative Commons License</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techxplorer.wordpress.com/2248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techxplorer.wordpress.com/2248/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techxplorer.wordpress.com/2248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techxplorer.wordpress.com/2248/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techxplorer.wordpress.com/2248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techxplorer.wordpress.com/2248/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techxplorer.wordpress.com/2248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techxplorer.wordpress.com/2248/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techxplorer.wordpress.com/2248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techxplorer.wordpress.com/2248/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techxplorer.wordpress.com/2248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techxplorer.wordpress.com/2248/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techxplorer.wordpress.com/2248/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techxplorer.wordpress.com/2248/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techxplorer.com&amp;blog=193831&amp;post=2248&amp;subd=techxplorer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techxplorer.com/2011/11/25/using-timestamp-fields-in-mysql-with-lithium/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e3e762252143800cc3b6efe3eaf8913a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">techxplorer</media:title>
		</media:content>

		<media:content url="http://techxplorer.files.wordpress.com/2011/11/time.jpg" medium="image">
			<media:title type="html">time</media:title>
		</media:content>
	</item>
		<item>
		<title>Making IE9 Behave</title>
		<link>http://techxplorer.com/2011/11/25/making-ie9-behave/</link>
		<comments>http://techxplorer.com/2011/11/25/making-ie9-behave/#comments</comments>
		<pubDate>Fri, 25 Nov 2011 02:58:02 +0000</pubDate>
		<dc:creator>techxplorer</dc:creator>
				<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[IE9]]></category>
		<category><![CDATA[marques]]></category>

		<guid isPermaLink="false">http://techxplorer.com/?p=2240</guid>
		<description><![CDATA[Recently I discovered that the main page of a website that I&#8217;m developing wasn&#8217;t rendering properly in Internet Explorer 9 (IE9). &#8230;<p><a href="http://techxplorer.com/2011/11/25/making-ie9-behave/">Continue reading &#187;</a></p><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techxplorer.com&amp;blog=193831&amp;post=2240&amp;subd=techxplorer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="attachment_2243" class="wp-caption alignright" style="width: 179px"><a href="http://www.flickr.com/photos/horrigans/3445692558/"><img class="size-full wp-image-2243" title="naughty-child" src="http://techxplorer.files.wordpress.com/2011/11/naughty-child.jpg?w=529" alt=""   /></a><p class="wp-caption-text">By: Sarah Horrigan</p></div>
<p>Recently I discovered that the main page of a website that I&#8217;m developing wasn&#8217;t rendering properly in <a title="Wikipedia article on this topic" href="http://en.wikipedia.org/wiki/Internet_Explorer_9">Internet Explorer 9</a> (IE9). The page in question includes <a title="Wikipedia article on this topic" href="http://en.wikipedia.org/wiki/HTML5">HTML5</a> specific elements, included the appropriate <a title="Wikipedia article on this topic" href="http://en.wikipedia.org/wiki/Doctype">doctype</a> and the response headers included the appropriate <a title="Wikipedia article on this topic" href="http://en.wikipedia.org/wiki/Internet_media_type">mime-type</a> as well.</p>
<p>In browsers such as Google Chrome and Mozilla Firefox the page would render as expected. In IE9 the page would render, and the icon for compatibility mode would appear. The intention of this mode, as far as I can tell, is to alert the user that the page may be using content that works best in another rendering mode. Unfortunately for me in my experience this mode doesn&#8217;t understand HTML5 specific tags. If a user used this mode the page would fail to render properly.</p>
<p>To fix this it is necessary to define a <a title="More information on this topic" href="http://msdn.microsoft.com/en-us/library/cc288325(v=vs.85).aspx">document compatibility mode</a> by including an Internet Explorer specific meta tag in the head of the page.</p>
<p>In my case the header went from this:</p>
<p><pre class="brush: xml;">
&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
  &lt;head&gt;
    &lt;title&gt;My HTML page&lt;/title&gt;
  &lt;/head&gt;
&lt;/html&gt;
</pre></p>
<p>to this:</p>
<p><pre class="brush: xml;">

&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
  &lt;head&gt;
    &lt;!-- Explicitly Enable IE9 Standards mode --&gt;
    &lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=9&quot; &gt;
    &lt;title&gt;My HTML page&lt;/title&gt;
  &lt;/head&gt;
&lt;/html&gt;

</pre></p>
<p>There are two things that irk me about this situation. First, while it is possible to determine that IE 9 has decided that compatibility mode should be presented as an option to the user, it isn&#8217;t possible to determine why. Which makes it near impossible to diagnose what is going on.</p>
<p>Second, is that my standards compliant page, which validated fine according to the <a title="Direct link to the validator" href="http://validator.w3.org/">W3C Validator</a>, now must contain a vendor specific extension. I was naive enough to think that the days of vendor specific extension in the HTML were going to be a thing of the past.</p>
<p>The photo &#8220;<a title="Direct link to the photo" href="http://www.flickr.com/photos/horrigans/3445692558/">Little Monkey</a>&#8221; was uploaded to <a title="Flickr homepage" href="http://www.flickr.com/">Flickr</a> by <a title="Flickr profile page" href="http://www.flickr.com/people/horrigans/">Sarah Horrigan</a> and used under the terms of a <a title="Direct link to the license information" href="http://creativecommons.org/licenses/by-nc/2.0/deed.en">Creative Commons license</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techxplorer.wordpress.com/2240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techxplorer.wordpress.com/2240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techxplorer.wordpress.com/2240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techxplorer.wordpress.com/2240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techxplorer.wordpress.com/2240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techxplorer.wordpress.com/2240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techxplorer.wordpress.com/2240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techxplorer.wordpress.com/2240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techxplorer.wordpress.com/2240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techxplorer.wordpress.com/2240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techxplorer.wordpress.com/2240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techxplorer.wordpress.com/2240/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techxplorer.wordpress.com/2240/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techxplorer.wordpress.com/2240/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techxplorer.com&amp;blog=193831&amp;post=2240&amp;subd=techxplorer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techxplorer.com/2011/11/25/making-ie9-behave/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e3e762252143800cc3b6efe3eaf8913a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">techxplorer</media:title>
		</media:content>

		<media:content url="http://techxplorer.files.wordpress.com/2011/11/naughty-child.jpg" medium="image">
			<media:title type="html">naughty-child</media:title>
		</media:content>
	</item>
		<item>
		<title>MultiMarkdown, LaTeX and Bibliographies &#8211; Part 2</title>
		<link>http://techxplorer.com/2011/10/25/multimarkdown-latex-and-bibliographies-part-2/</link>
		<comments>http://techxplorer.com/2011/10/25/multimarkdown-latex-and-bibliographies-part-2/#comments</comments>
		<pubDate>Tue, 25 Oct 2011 02:19:29 +0000</pubDate>
		<dc:creator>techxplorer</dc:creator>
				<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[honours-thesis]]></category>
		<category><![CDATA[multimarkdown]]></category>

		<guid isPermaLink="false">http://techxplorer.com/?p=2226</guid>
		<description><![CDATA[In an earlier post I wrote about my explorations of using MultiMarkdown to create a LaTeX document that included a &#8230;<p><a href="http://techxplorer.com/2011/10/25/multimarkdown-latex-and-bibliographies-part-2/">Continue reading &#187;</a></p><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techxplorer.com&amp;blog=193831&amp;post=2226&amp;subd=techxplorer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="attachment_2233" class="wp-caption alignright" style="width: 250px"><a href="http://www.flickr.com/photos/bluefootedbooby/401302758/"><img class="size-full wp-image-2233" title="typeset" src="http://techxplorer.files.wordpress.com/2011/10/typeset1.jpg?w=529" alt=""   /></a><p class="wp-caption-text">By: vlasta2</p></div>
<p>In <a title="Direct link to the earlier post" href="/2011/10/07/multimarkdown-latex-and-bibliographies-part-1/">an earlier post</a> I wrote about my explorations of using <a title="Official MutliMarkdown website" href="http://fletcherpenney.net/multimarkdown/">MultiMarkdown</a> to create a <a title="Wikipedia article on this topic" href="http://en.wikipedia.org/wiki/LaTeX">LaTeX</a> document that included a bibliography. Since that post I&#8217;ve made some changes.</p>
<p>First, I&#8217;m now using the <a title="Official MultiMarkdown Composer homepage" href="http://multimarkdown.com/">MultiMarkdown Composer</a> application to author my document. I&#8217;ve only had it a few days, and so far like it very much.</p>
<p>Second, I&#8217;ve written a rudimentary <a title="Wikipedia article on this topic" href="http://en.wikipedia.org/wiki/Bash_(Unix_shell)">bash</a> script to automate the creation of the <a title="Wikipedia article on this topic" href="http://en.wikipedia.org/wiki/Portable_Document_Format">PDF</a> document. In my current workflow I keep my source file separate from the output. Mainly because the creation of the PDF from the LaTeX file creates more than 10 additional files and I didn&#8217;t want these mixed up with my source files.</p>
<p>The script is as follows:</p>
<p><pre class="brush: bash;">
#!/bin/bash
# script to help in making the document
# set some options
set -o nounset
set -o errexit
# get the current directory
WORK_DIR=`pwd`
MMD_UTILS_DIR=/path/to the/MultiMarkdown/Utilities

# clean up the output directory
rm -f &quot;$WORK_DIR&quot;/output/*

# merge the source files together
&quot;$MMD_UTILS_DIR&quot;/mmd_merge.pl &quot;$WORK_DIR&quot;/index.txt &gt; &quot;$WORK_DIR&quot;/output/latest.md

# convert to latex
/usr/local/bin/multimarkdown &quot;$WORK_DIR&quot;/output/latest.md -t latex -o &quot;$WORK_DIR&quot;/output/latest.tex

# change to the output directory
cd &quot;$WORK_DIR&quot;/output

# run pdflatex
/usr/texbin/pdflatex -halt-on-error latest.tex &amp;&gt; stage-01.log

# run pdflatex
/usr/texbin/pdflatex -halt-on-error latest.tex &amp;&gt; stage-02.log

# make the bibliography
/usr/texbin/bibtex latest.aux &amp;&gt; stage-03.log

# run pdflatex
/usr/texbin/pdflatex -halt-on-error latest.tex &amp;&gt; stage-04.log

# run pdflatex
/usr/texbin/pdflatex -halt-on-error latest.tex &amp;&gt; stage-05.log
</pre></p>
<p>The script has been developed to work on my MacBook running the lastest version Mac OS X and that also has the latest <a title="Official MacTeX webpage" href="http://www.tug.org/mactex/2011/">MacTeX</a> version installed as well as the <a title="Download the MMD Support Files" href="https://github.com/fletcher/MMD-Support">MMD Support Files</a> and the <a title="Download link for the MMD LaTeX Support Files" href="https://github.com/fletcher/peg-multimarkdown-latex-support">MMD LaTeX Support Files</a>.</p>
<p>The &#8220;<a title="Direct link to the photo" href="http://www.flickr.com/photos/bluefootedbooby/401302758/">Type ornaments</a>&#8221; photo was uploaded to <a title="Flickr homepage" href="http://www.flickr.com/">Flickr</a> by <a title="Flickr Profile Page" href="http://www.flickr.com/people/bluefootedbooby/">vlasta2</a> and used under the terms of a <a title="Details of the license" href="http://creativecommons.org/licenses/by-nc-nd/2.0/">Creative Commons License</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techxplorer.wordpress.com/2226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techxplorer.wordpress.com/2226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techxplorer.wordpress.com/2226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techxplorer.wordpress.com/2226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techxplorer.wordpress.com/2226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techxplorer.wordpress.com/2226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techxplorer.wordpress.com/2226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techxplorer.wordpress.com/2226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techxplorer.wordpress.com/2226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techxplorer.wordpress.com/2226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techxplorer.wordpress.com/2226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techxplorer.wordpress.com/2226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techxplorer.wordpress.com/2226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techxplorer.wordpress.com/2226/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techxplorer.com&amp;blog=193831&amp;post=2226&amp;subd=techxplorer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techxplorer.com/2011/10/25/multimarkdown-latex-and-bibliographies-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e3e762252143800cc3b6efe3eaf8913a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">techxplorer</media:title>
		</media:content>

		<media:content url="http://techxplorer.files.wordpress.com/2011/10/typeset1.jpg" medium="image">
			<media:title type="html">typeset</media:title>
		</media:content>
	</item>
		<item>
		<title>Lithium Routing and JSON</title>
		<link>http://techxplorer.com/2011/10/18/lithium-routing-and-json/</link>
		<comments>http://techxplorer.com/2011/10/18/lithium-routing-and-json/#comments</comments>
		<pubDate>Tue, 18 Oct 2011 01:50:35 +0000</pubDate>
		<dc:creator>techxplorer</dc:creator>
				<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[li3]]></category>
		<category><![CDATA[lithium]]></category>

		<guid isPermaLink="false">http://techxplorer.com/?p=2217</guid>
		<description><![CDATA[I&#8217;ve been writing a series of posts lately on my experiences with the Lithium framework. Mainly about generating JSON as &#8230;<p><a href="http://techxplorer.com/2011/10/18/lithium-routing-and-json/">Continue reading &#187;</a></p><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techxplorer.com&amp;blog=193831&amp;post=2217&amp;subd=techxplorer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="attachment_2222" class="wp-caption alignright" style="width: 250px"><a href="http://www.flickr.com/photos/14617207@N00/4471342864/"><img class="size-full wp-image-2222" title="route-66" src="http://techxplorer.files.wordpress.com/2011/10/route-66.jpg?w=529" alt=""   /></a><p class="wp-caption-text">By: Alan Berning</p></div>
<p>I&#8217;ve been writing a series of posts lately on <a title="List of posts tagged Lithium" href="/tag/lihtium/">my experiences</a> with the <a title="Lithium homepage" href="http://lithify.me/">Lithium</a> framework. Mainly about generating <a title="Wikipedia article on this topic" href="http://en.wikipedia.org/wiki/JSON">JSON</a> as that&#8217;s what I&#8217;m working on at the moment.</p>
<p>This morning I noticed an issue I was having with the routes to my controller. I don&#8217;t know if it is a bug, something I don&#8217;t understand and am implementing wrong.</p>
<p>What I noticed was that a URL like the one below was causing output to be in JSON format, but the id number (3) at the end of the URL wasn&#8217;t being passed into my function.</p>
<p><code>http://example.com/mycontroller/myfunction/3.json</code></p>
<p>The function definition in the controller looks like this:</p>
<p><pre class="brush: php;">
public function myfunction($id = null) {
	// do something with the id variable
}
</pre></p>
<p>The routes that I believe are allowing me to specify the content type as part of the URL is like this:</p>
<p><pre class="brush: php;">
Router::connect('/{:controller}/{:action}/{:id:[0-9]+}.{:type}', array('id' =&gt; null));
Router::connect('/{:controller}/{:action}.{:type}');
</pre></p>
<p>For the moment I&#8217;ve needed to adjust my function so that it uses the <a title="Lithium documentation on this class" href="http://lithify.me/docs/lithium/action/Request">Request object</a> associated with the controller when the function runs to look for the id parameter manually if the request is for JSON data like this:</p>
<p><pre class="brush: php;">
public function myfunction($id = null) {
	// check if this is a request for JSON data
	// and if so retrieve the id value
	if($id == null &amp;&amp; $this-&gt;request-&gt;type() == 'json') {
		$id = $this-&gt;request-&gt;params['id'];
	}
}
</pre></p>
<p>If anyone else is having issues like this I hope this post helps, and if anyone knows what I&#8217;m doing wrong please leave a comment.</p>
<p>The &#8220;<a title="Direct link to the photo" href="http://www.flickr.com/photos/14617207@N00/4471342864/">route 66</a>&#8221; photo was uploaded to <a title="Flickr homepage" href="http://www.flickr.com/">Flickr</a> by <a title="Flickr profile page" href="http://www.flickr.com/people/14617207@N00/">Alan Berning</a> and used under the terms of a <a title="Details of the license" href="http://creativecommons.org/licenses/by-nc-sa/2.0/">Creative Commons license</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techxplorer.wordpress.com/2217/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techxplorer.wordpress.com/2217/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techxplorer.wordpress.com/2217/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techxplorer.wordpress.com/2217/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techxplorer.wordpress.com/2217/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techxplorer.wordpress.com/2217/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techxplorer.wordpress.com/2217/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techxplorer.wordpress.com/2217/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techxplorer.wordpress.com/2217/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techxplorer.wordpress.com/2217/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techxplorer.wordpress.com/2217/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techxplorer.wordpress.com/2217/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techxplorer.wordpress.com/2217/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techxplorer.wordpress.com/2217/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techxplorer.com&amp;blog=193831&amp;post=2217&amp;subd=techxplorer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techxplorer.com/2011/10/18/lithium-routing-and-json/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e3e762252143800cc3b6efe3eaf8913a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">techxplorer</media:title>
		</media:content>

		<media:content url="http://techxplorer.files.wordpress.com/2011/10/route-66.jpg" medium="image">
			<media:title type="html">route-66</media:title>
		</media:content>
	</item>
		<item>
		<title>Output JSON from a Lithium Controller – Enhanced</title>
		<link>http://techxplorer.com/2011/10/17/output-json-from-a-lithium-controller-%e2%80%93-enhanced/</link>
		<comments>http://techxplorer.com/2011/10/17/output-json-from-a-lithium-controller-%e2%80%93-enhanced/#comments</comments>
		<pubDate>Mon, 17 Oct 2011 01:40:12 +0000</pubDate>
		<dc:creator>techxplorer</dc:creator>
				<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[li3]]></category>
		<category><![CDATA[lihtium]]></category>

		<guid isPermaLink="false">http://techxplorer.com/?p=2208</guid>
		<description><![CDATA[Last Friday I wrote a post about my initial explorations in revisiting the topic of using a Lithium controller to &#8230;<p><a href="http://techxplorer.com/2011/10/17/output-json-from-a-lithium-controller-%e2%80%93-enhanced/">Continue reading &#187;</a></p><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techxplorer.com&amp;blog=193831&amp;post=2208&amp;subd=techxplorer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="attachment_2213" class="wp-caption alignright" style="width: 250px"><a href="http://www.flickr.com/photos/emsl/4905109560"><img class="size-full wp-image-2213" title="lithium" src="http://techxplorer.files.wordpress.com/2011/10/lithium.jpg?w=529" alt=""   /></a><p class="wp-caption-text">By: EMSL</p></div>
<p>Last Friday I <a title="Direct link to the post" href="/2011/10/14/output-json-from-a-lithium-controller-revisited/">wrote a post</a> about my initial explorations in revisiting the topic of using a <a title="Official Lithium website" href="http://lithify.me/">Lithium</a> controller to output <a title="Wikipedia article on this topic" href="http://en.wikipedia.org/wiki/JSON">JSON</a> encoded data. In the post I mentioned a technique that I&#8217;d determined would allow me to check if a request to a controller was for JSON encoded data or not.</p>
<p>The code looked like this:</p>
<p><pre class="brush: php;">

if($this-&gt;request-&gt;type() == 'json') {
	// build an array of elements and return it
} else {
	// build data elements to be used in the template
}
</pre></p>
<p>Over the weekend I determined a way to provide an enhanced experience to the user using this technique.</p>
<p>In essence what my code now does is output a basic page when a request that should be for JSON data is not constructed correctly i.e. when it is missing the .json suffix.</p>
<p>As an example my code now looks like this:</p>
<p><pre class="brush: php;">

if($this-&gt;request-&gt;type() == 'json') {
	// build an array of elements and return it
} else {
	// build data elements to be used in the template
	// get the data

	// set a title
	$title = 'Did you mean to get JSON data?';

	// get the URL used for the request
	$url = $this-&gt;request-&gt;url;

	// use a basic layout
	$this-&gt;_render['layout'] = 'not_json';

	// build the page
	return compact('data', 'title', 'url');
}

</pre></p>
<p>In essence:</p>
<ul>
<li>Line 05 is where you would retrieve the data that should be returned in JSON format, or at least a subset that makes the page more useful</li>
<li>Line 08 is a descriptive title for the page</li>
<li>Line 11 is the URL that was used to request the page</li>
<li>Line 14 changes the layout used to build the page from the default to one called <code>not_json</code></li>
<li>Line 17 returns this data and renders the page</li>
</ul>
<p>The key here is that this basic structure could be extended to provide additional information and not just a limited HTML page that illustrates that an error was made.</p>
<p>The <code>not_json</code> layout is a file (<code>not_json.html.php</code>) that lives in the <code>app/views/layouts</code> directory and is a very basic HTML page. It could be a more complex page, for example one that responds with an error code or contains additional explanatory information. For my purposes a very basic HTML page will suffice for the time being.</p>
<p>The &#8220;<a title="Direct link to the photo" href="http://www.flickr.com/photos/emsl/4905109560">Lithium Manganese Phosphate</a>&#8221; photo was uploaded to <a title="Flickr homepage" href="http://www.flickr.com/">Flickr</a> by <a title="EMSL Flickr profile page" href="http://www.flickr.com/photos/emsl/">EMSL</a> and used under the terms of a <a title="Details of the license" href="http://creativecommons.org/licenses/by-nc-sa/2.0/deed.en">Creative Commons license</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techxplorer.wordpress.com/2208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techxplorer.wordpress.com/2208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techxplorer.wordpress.com/2208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techxplorer.wordpress.com/2208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techxplorer.wordpress.com/2208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techxplorer.wordpress.com/2208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techxplorer.wordpress.com/2208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techxplorer.wordpress.com/2208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techxplorer.wordpress.com/2208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techxplorer.wordpress.com/2208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techxplorer.wordpress.com/2208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techxplorer.wordpress.com/2208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techxplorer.wordpress.com/2208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techxplorer.wordpress.com/2208/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techxplorer.com&amp;blog=193831&amp;post=2208&amp;subd=techxplorer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techxplorer.com/2011/10/17/output-json-from-a-lithium-controller-%e2%80%93-enhanced/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e3e762252143800cc3b6efe3eaf8913a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">techxplorer</media:title>
		</media:content>

		<media:content url="http://techxplorer.files.wordpress.com/2011/10/lithium.jpg" medium="image">
			<media:title type="html">lithium</media:title>
		</media:content>
	</item>
		<item>
		<title>Output JSON from a Lithium Controller &#8211; Revisited</title>
		<link>http://techxplorer.com/2011/10/14/output-json-from-a-lithium-controller-revisited/</link>
		<comments>http://techxplorer.com/2011/10/14/output-json-from-a-lithium-controller-revisited/#comments</comments>
		<pubDate>Fri, 14 Oct 2011 06:31:36 +0000</pubDate>
		<dc:creator>techxplorer</dc:creator>
				<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[li3]]></category>
		<category><![CDATA[lithium]]></category>

		<guid isPermaLink="false">http://techxplorer.com/?p=2202</guid>
		<description><![CDATA[In an earlier post I wrote about my experiences in using the Lithium framework to respond to a request with JSON encoded &#8230;<p><a href="http://techxplorer.com/2011/10/14/output-json-from-a-lithium-controller-revisited/">Continue reading &#187;</a></p><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techxplorer.com&amp;blog=193831&amp;post=2202&amp;subd=techxplorer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In an <a title="Direct link to the earlier post" href="/2011/10/05/output-json-from-a-lithium-controller/">earlier post</a> I wrote about my experiences in using the <a title="Lithium homepage" href="http://lithify.me/">Lithium framework</a> to respond to a request with <a title="Wikipedia article on this topic" href="http://en.wikipedia.org/wiki/JSON">JSON</a> encoded data. Today I wanted to expand on that experience by detecting if the request was made for JSON data or not.</p>
<p>The key to determining if the request was for JSON data is the <a title="Official Documentation on the class" href="http://lithify.me/docs/lithium/action/Request">Request</a> class, specifically the <a title="Official documentation on the type function" href="http://lithify.me/docs/lithium/action/Request::type()">type</a> function.</p>
<p>As an example the code in my controller looks like this:</p>
<p><pre class="brush: php;">

if($this-&gt;request-&gt;type() == 'json') {
	// build an array of elements and return it
} else {
	// build data elements to be used in the template
}
</pre></p>
<p>In this way a request for example <code>http://example.com/example.json</code> will return data in a JSON encoded format. A request for <code>http://example.com/example</code> will return the data in HTML, some other format, or even produce an error.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techxplorer.wordpress.com/2202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techxplorer.wordpress.com/2202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techxplorer.wordpress.com/2202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techxplorer.wordpress.com/2202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techxplorer.wordpress.com/2202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techxplorer.wordpress.com/2202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techxplorer.wordpress.com/2202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techxplorer.wordpress.com/2202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techxplorer.wordpress.com/2202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techxplorer.wordpress.com/2202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techxplorer.wordpress.com/2202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techxplorer.wordpress.com/2202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techxplorer.wordpress.com/2202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techxplorer.wordpress.com/2202/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techxplorer.com&amp;blog=193831&amp;post=2202&amp;subd=techxplorer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techxplorer.com/2011/10/14/output-json-from-a-lithium-controller-revisited/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e3e762252143800cc3b6efe3eaf8913a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">techxplorer</media:title>
		</media:content>
	</item>
		<item>
		<title>Generating a Database Diagram from an SQL Script</title>
		<link>http://techxplorer.com/2011/10/11/generating-a-database-diagram-from-an-sql-script/</link>
		<comments>http://techxplorer.com/2011/10/11/generating-a-database-diagram-from-an-sql-script/#comments</comments>
		<pubDate>Tue, 11 Oct 2011 01:46:26 +0000</pubDate>
		<dc:creator>techxplorer</dc:creator>
				<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[graphiz]]></category>
		<category><![CDATA[marques]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://techxplorer.com/?p=2195</guid>
		<description><![CDATA[One of the more critical components of any open source system is the documentation. In a previous project the team &#8230;<p><a href="http://techxplorer.com/2011/10/11/generating-a-database-diagram-from-an-sql-script/">Continue reading &#187;</a></p><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techxplorer.com&amp;blog=193831&amp;post=2195&amp;subd=techxplorer&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="attachment_2198" class="wp-caption alignright" style="width: 250px"><a href="http://www.flickr.com/photos/shindotv/3835364539/"><img class="size-full wp-image-2198" title="database" src="http://techxplorer.files.wordpress.com/2011/10/database.jpg?w=529" alt=""   /></a><p class="wp-caption-text">By: Shin</p></div>
<p>One of the more critical components of any open source system is the documentation. In a previous project the team I was a part of was complimented on our documentation and how we kept it up to date. One of the hardest aspects of a system to document, and keep up to date, is the database schema. With some prior thought it can be made easier.</p>
<p>The first aspect of the database to document is to add comments where appropriate. As an example in the <a title="More information about the system" href="http://code.google.com/p/marques-project/">MARQues system</a> I&#8217;ve added a brief comment to each field and table. These comments are available in <a title="Wikipedia article on this topic" href="http://en.wikipedia.org/wiki/Graphical_user_interface">GUI</a> client that I use and also forms part of the <a title="Direct link to the database schema file" href="http://marques-project.googlecode.com/git/assets/database/database-schema.sql">database-schema</a> file.</p>
<p>The second aspect is to define the <a title="Wikipedia article on this topic" href="http://en.wikipedia.org/wiki/Foreign_key">foreign key relationships</a> between tables. In MySQL this means I use the <a title="Wikipedia article on this topic" href="http://en.wikipedia.org/wiki/InnoDB">InnoDB table type</a> where possible.</p>
<p>The third aspect is to use the database-schema file to create a diagram of the database structure. For this I use the <a title="More information about this script" href="http://code.google.com/p/mysqlviz/">mysqlviz script</a> which uses the database-schema file to create a script in the <a title="Wikipedia article on this topic" href="http://en.wikipedia.org/wiki/DOT_language">DOT language</a>. This script is then used by the <a title="Official Graphviz homepage" href="http://www.graphviz.org/">Graphviz application</a> to create the final image.</p>
<p>This sounds like a lot of work but I&#8217;ve written a small script which takes care of all of the steps which looks like this:</p>
<p><pre class="brush: bash;">

#!/bin/bash
# a script to make it easier to export the database schema
# and create a basic schema diagram
# set some variables
# adjust accordingly to match your own environment
CURR_PATH=`pwd`
OUTPUT_FILE=database-schema.sql
IMAGE_FILE=database-schema.png
MYSQLDUMP_CMD=/opt/local/bin/mysqldump5
DOT_CMD=/usr/local/bin/dot
USER=mysql_user
PASSWORD=mysql_password
DATABASE=mysql_database
# do the export
$MYSQLDUMP_CMD --user=$USER --password=$PASSWORD --no-data --comments --dump-date $DATABASE &gt; $CURR_PATH/$OUTPUT_FILE
# turn the dump into an image
$CURR_PATH/mysqlviz -f $CURR_PATH/$OUTPUT_FILE | $DOT_CMD -Tpng &gt; $CURR_PATH/$IMAGE_FILE

</pre></p>
<p>Obviously I&#8217;m using MySQL as my database platform which I&#8217;ve installed using the technique I <a title="Direct link to the previous post" href="/2011/10/10/installing-mysql-on-mac-os-x-revisited/">posted about yesterday</a>. You can see an example of the output <a title="Direct link to the schema diagram" href="http://marques-project.googlecode.com/git/assets/database/database-schema.png">here</a>.</p>
<p>The last aspect is to include additional text where necessary. For the MARQues system I keep <a title="MARQues Database Schema Wiki page" href="http://code.google.com/p/marques-project/wiki/DatabaseSchema">this page in the wiki</a> up to date with explanatory text about the database.</p>
<p>The &#8220;<a title="Direct link to the photo" href="http://www.flickr.com/photos/shindotv/3835364539/">Original Database</a>&#8221; photo was uploaded to <a title="Flickr homepage" href="http://www.flickr.com/">Flickr</a> by <a title="Flickr profile page" href="http://www.flickr.com/people/shindotv/">Shin</a> and used under the terms of a <a title="Details of this license" href="http://creativecommons.org/licenses/by-nc-sa/2.0/deed.en">Creative Commons</a> license.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/techxplorer.wordpress.com/2195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/techxplorer.wordpress.com/2195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/techxplorer.wordpress.com/2195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/techxplorer.wordpress.com/2195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/techxplorer.wordpress.com/2195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/techxplorer.wordpress.com/2195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/techxplorer.wordpress.com/2195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/techxplorer.wordpress.com/2195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/techxplorer.wordpress.com/2195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/techxplorer.wordpress.com/2195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/techxplorer.wordpress.com/2195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/techxplorer.wordpress.com/2195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/techxplorer.wordpress.com/2195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/techxplorer.wordpress.com/2195/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=techxplorer.com&amp;blog=193831&amp;post=2195&amp;subd=techxplorer&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://techxplorer.com/2011/10/11/generating-a-database-diagram-from-an-sql-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e3e762252143800cc3b6efe3eaf8913a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">techxplorer</media:title>
		</media:content>

		<media:content url="http://techxplorer.files.wordpress.com/2011/10/database.jpg" medium="image">
			<media:title type="html">database</media:title>
		</media:content>
	</item>
	</channel>
</rss>
