<?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>Dwight Jack Diary &#187; Projects</title>
	<atom:link href="http://www.dwightjack.com/diary/category/projects/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dwightjack.com/diary</link>
	<description>Diary of music, design and code</description>
	<lastBuildDate>Tue, 13 Jul 2010 20:46:53 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>CRUDités: PHP5 class for MySQL database</title>
		<link>http://www.dwightjack.com/diary/2009/07/07/crudites-php5-class-for-mysql-database/</link>
		<comments>http://www.dwightjack.com/diary/2009/07/07/crudites-php5-class-for-mysql-database/#comments</comments>
		<pubDate>Tue, 07 Jul 2009 07:00:05 +0000</pubDate>
		<dc:creator>Dwight Jack</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[CRUDités]]></category>
		<category><![CDATA[ezSQL]]></category>
		<category><![CDATA[MySQL class]]></category>
		<category><![CDATA[PHP database class]]></category>

		<guid isPermaLink="false">http://www.dwightjack.com/diary/?p=203</guid>
		<description><![CDATA[CRUDités is a set of handy methods to quickly manage many operations of writing, storing and deleting from and to MySQL databases]]></description>
			<content:encoded><![CDATA[<p>Even if nowadays many web developers prefer to use Frameworks such as Zend, CakePHP or CodeIgniter, we often have small coding tasks to do, that aren&#8217;t worth the cost of deploying a whole application structure.</p>
<h3>ezSQL</h3>
<p>When dealing with MySQL databases, one of the most used PHP class is <a href="http://www.woyano.com/jv/ezsql" target="_blank"><strong>ezSQL</strong></a>, by Justin Vincent. If you&#8217;ve never listen about it, just think that a slightly modified version of this class is used as the core of <strong>Wordpress database library</strong>, and every time you query the database for a post, ezSQL comes in action.</p>
<p>Despite its effectiveness, ezSQL development seems to have stopped to version 2.04.</p>
<p>Since in my projects i often use this class to work with MySQL databases,<strong> i&#8217;ve written a small extension to the ezSQL_MySQL adapter</strong> to add shortcuts and more efficient functionalities to make further easier to manage databases&#8217; data with PHP. Here you are <strong>CRUDités</strong>.</p>
<h3>CRUDités: MySQL appetizer</h3>
<p><a title="CRUDités Homepage" href="http://www.dwightjack.com/projects/crudites/" target="_blank"><img class="alignright size-full wp-image-206" style="float:right;margin-left:10px" src="http://www.dwightjack.com/diary/wp-content/uploads/2009/07/logo.png" alt="CRUDités Logo" width="240" height="81" /></a></p>
<p><em>Crudités</em> are traditional French appetizers comprising sliced or whole raw vegetables. As of its name, CRUDités is just a set of <strong>handy methods</strong> to quickly manage many operations of writing, storing and deleting from and to MySQL databases.</p>
<p>Aside from the basic ezSQL methods, it adds some methods to <strong>build MySQL queries from strings and data arrays</strong>, new methods to retrieve datas from columns and rows, some utility methods and a whole <strong>new table binding system</strong>, to store table&#8217;s fields and quickly update and store new datas.<br />
For example you&#8217;ll be able to query a database and get a resulting array of rows just with this code:</p>
<pre><code>$rows = $db-&gt;get_data(array(
      'select' =&gt; 'id,name,surname',
      'from' =&gt; 'customer_names'
));
</code></pre>
<p>You can get more informations about the project by visiting its <strong><a href="http://www.dwightjack.com/projects/crudites/" target="_blank">main page</a></strong>, or you can directly download the class file by clicking here: <a href=http://www.dwightjack.com/diary/wp-content/plugins/download-monitor/download.php?id=12>CRUDités (13.5 kB)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dwightjack.com/diary/2009/07/07/crudites-php5-class-for-mysql-database/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Introducing Bicycle 1.2: a lightweight JavaScript library</title>
		<link>http://www.dwightjack.com/diary/2009/06/15/bicycle-12-a-lightweight-javascript-library/</link>
		<comments>http://www.dwightjack.com/diary/2009/06/15/bicycle-12-a-lightweight-javascript-library/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 20:53:05 +0000</pubDate>
		<dc:creator>Dwight Jack</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[ajax framework]]></category>
		<category><![CDATA[javascript framework]]></category>
		<category><![CDATA[javascript library]]></category>
		<category><![CDATA[javascript shortcuts]]></category>

		<guid isPermaLink="false">http://www.dwightjack.com/diary/?p=175</guid>
		<description><![CDATA[Bicycle is a lightweight and efficient small library for JavaScript development featuring basic shortcuts and a full wrapper for events, AJAX and form handling]]></description>
			<content:encoded><![CDATA[<p>When i first stepped into JavaScript i found that one of web developers&#8217; common practice  was collecting  snippets of code (in form of prototypes, functions and shortcuts) to overcome both known JavaScript missing features and language&#8217;s verboseness.</p>
<p>Day by day, i&#8217;ve understood why so many developers use libraries (or frameworks) such as <strong>Mootools</strong> or <strong>jQuery:</strong> It&#8217;s a <em>matter of typing</em>.</p>
<pre><code>document.getElementById("test"); //native Javascript
$("#test"); // with jQuery</code></pre>
<p>At the same time i&#8217;ve learnt that <strong>libraries aren&#8217;t always worth their weight</strong>. Small projects don&#8217;t need them, and just writing a shortcut like:</p>
<pre><code>function id(string) {
   return document.getElementById(string);
}</code></pre>
<p>can make your life better (and more lightweight).</p>
<h3>Introducing Bicycle 1.2</h3>
<p><img class="size-full wp-image-184" align="right" style="margin-left:15px;" title="Bicycle 1.2" src="http://www.dwightjack.com/diary/wp-content/uploads/2009/06/bicyclelogo.png" alt="Bicycle 1.2" width="200" height="108" />That said, here is a new version of <strong>Bicycle</strong>, my little &#8220;JavaScript Collection&#8221;. As from the name, it&#8217;s a lightweight and load-cost-effective library (about <strong>9Kb minified</strong>) with everything is needed to <strong>keep your code simple and cross-browser</strong>. Here is a sample code:</p>
<pre><code>var el = $getEls("test");  // get the element with id "test"
var input = $TN("nametext");  // get the first element with name "nametext"</code></pre>
<h3>Chainability</h3>
<p>Anyway, if you need something more, since this new version Bicycle features a convenient <strong>chainability wrapper</strong>, with even new methods such as <strong>mouse and DOM-ready events</strong> and <strong>AJAX handling</strong>.</p>
<p>The chainable structure is bound to the <code>$b</code> namespace, so that you can use it along with other libraries. Here is a sample code:</p>
<pre><code>$b("#test").css("color","red").txt("New text!");</code></pre>
<p>See the <strong><a href="http://www.dwightjack.com/projects/bicycle/symbols/chain_chain-addons.html" target="_blank">documentation</a></strong> for more methods.</p>
<h3>Form Handling</h3>
<p>Finally, as a bonus, i&#8217;ve added a smart piece of code called <strong>Telegraph</strong>, which is basically a<strong> form handling library</strong> to quickly get and manipulate form inputs:</p>
<pre><code>$b.getForm("myForm").value("testinput"); // get an input value
$b.getForm("myForm").serialize(); // serialize form data in a JavaScript object</code></pre>
<h3>Grab a copy</h3>
<p>At last, <em>more code</em> can&#8217;t mean <em>same weight</em>, but i suppose you won&#8217;t mind it, &#8217;cause  Bicycle core + chainability + new methods + Telegraph is just <strong>22Kb minified</strong>.</p>
<p>Head to the main <a title="Bicycle JavaScript library" href="http://www.dwightjack.com/projects/bicycle/about.html" target="_blank"><strong>project page</strong></a> to get more infos and <a href="http://www.dwightjack.com/projects/bicycle/index.html" target="_blank">documentation</a>, or <strong><a title="Download Bicycle 1.2" href="http://www.dwightjack.com/diary/wp-content/plugins/download-monitor/download.php?id=11" target="_blank">grab a copy</a></strong> of the source code and &#8220;<em>take a ride</em>&#8221; with your brand new Bicycle.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dwightjack.com/diary/2009/06/15/bicycle-12-a-lightweight-javascript-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
