<?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"
	>

<channel>
	<title>Craig Weston</title>
	<atom:link href="http://blog.craigweston.ca/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://blog.craigweston.ca</link>
	<description>Just another blog of an aspiring software developer</description>
	<pubDate>Tue, 19 Aug 2008 22:53:36 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Android SDK Beta Released</title>
		<link>http://blog.craigweston.ca/?p=21</link>
		<comments>http://blog.craigweston.ca/?p=21#comments</comments>
		<pubDate>Tue, 19 Aug 2008 22:42:08 +0000</pubDate>
		<dc:creator>Craig</dc:creator>
		
		<category><![CDATA[Android]]></category>

		<category><![CDATA[Beta]]></category>

		<guid isPermaLink="false">http://blog.craigweston.ca/?p=21</guid>
		<description><![CDATA[So a beta for the Android SDK has been released and just in time I&#8217;d say. With talks of an Android phone being released in September in the United States and bot talk&#8217;s first release only a week ago I&#8217;m looking forward to some good development going on with bot talk in the next month [...]]]></description>
			<content:encoded><![CDATA[<p>So a beta for the Android SDK has been released and just in time I&#8217;d say. With talks of an Android phone being released in September in the United States and <a href="http://bot-talk.com">bot talk&#8217;s</a> first release only a week ago I&#8217;m looking forward to some good development going on with bot talk in the next month and hopefully soon a stable first version release. </p>
<p>The earlier version of the SDK surprisingly provided alot of functionality and stability for such an early release. Because of this I am very excited and hopeful for this beta release.From what I quickly read today it seems that the beta is bringing some new features while stripping some of the old features as such as the built in GTalkService and the Bluetooth API. One new feature that is really appealing to me is the graphical preview for XML layouts when using eclipse. I can really see myself getting alot of use out of this because before it was kind of a pain to test out your layouts quickly as you changed and modified things.</p>
<p>So if you want to find out more about this beta, you can read more about this <a href="http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html">here.</a> In a couple of days when i get this final project wrapped up for school (yes i still have one left to do) I will be downloading and installing this beta and working with the rest of the bot-talk team to bring it up to speed. When this happens I will post some more information on our findings.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.craigweston.ca/?feed=rss2&amp;p=21</wfw:commentRss>
		</item>
		<item>
		<title>Last Day of College</title>
		<link>http://blog.craigweston.ca/?p=20</link>
		<comments>http://blog.craigweston.ca/?p=20#comments</comments>
		<pubDate>Thu, 14 Aug 2008 03:48:21 +0000</pubDate>
		<dc:creator>Craig</dc:creator>
		
		<category><![CDATA[General]]></category>

		<category><![CDATA[school]]></category>

		<guid isPermaLink="false">http://blog.craigweston.ca/?p=20</guid>
		<description><![CDATA[So today was my last day of college. I wrote my very last exam today, which was for a web XML class.  I now have 3 weeks off and then I will be starting my final coop term. So, technically I&#8217;m not completely done, but classes are finished now at least.  The hope [...]]]></description>
			<content:encoded><![CDATA[<p>So today was my last day of college. I wrote my very last exam today, which was for a web XML class.  I now have 3 weeks off and then I will be starting my final coop term. So, technically I&#8217;m not completely done, but classes are finished now at least.  The hope is now that I have some free time I will be able to get back into doing more web development, as I haven&#8217;t really had a chance to lately other then the <a href="http://bot-talk.com">bot talk</a> website. Speaking of which, <em>bot talk</em> is now out as a very early beta. Still some bugs to be worked out and some more feature functionality to be added.</p>
<p>Anyways, I&#8217;m getting a bit off topic, so expect more blogging, and a lot more source from me soon as I will be trying to keep busy with this time off that I now have.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.craigweston.ca/?feed=rss2&amp;p=20</wfw:commentRss>
		</item>
		<item>
		<title>Handling Many .NET Controls with a Single Event Handler</title>
		<link>http://blog.craigweston.ca/?p=19</link>
		<comments>http://blog.craigweston.ca/?p=19#comments</comments>
		<pubDate>Sun, 10 Aug 2008 05:42:45 +0000</pubDate>
		<dc:creator>Craig</dc:creator>
		
		<category><![CDATA[.Net]]></category>

		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[Controls]]></category>

		<category><![CDATA[Event Handlers]]></category>

		<category><![CDATA[Events]]></category>

		<guid isPermaLink="false">http://blog.craigweston.ca/?p=19</guid>
		<description><![CDATA[I recently needed a control to display a large amount of PictureBox controls in a grid like fashion. I obviously didn&#8217;t want a click event handler for each PictureBox, that would be ridiculous since they essentially all did the same thing.  The following is the solution I came up with after looking at MSDN and [...]]]></description>
			<content:encoded><![CDATA[<p>I recently needed a control to display a large amount of PictureBox controls in a grid like fashion. I obviously didn&#8217;t want a click event handler for each PictureBox, that would be ridiculous since they essentially all did the same thing.  The following is the solution I came up with after looking at MSDN and some other sites.</p>
<p>First to organize the controls into a group I wrapped them all in a panel control. This allows me to grab all of the controls from the panel and loop through them like so. While looping through them I apply a new event to the click event property and specify my own custom event handler which is defined later in the class. This all occurs in the constructor of the form.</p>
<pre class="chili"><code class=""""""""""">public Grid()
{
	InitializeComponent();

	foreach (Control c in GridPanel.Controls)
	{
		c.Click += new System.EventHandler(this.ClickEventHandler);
	}
}</code></pre>
<p> </p>
<p>Now I define the handler which I stated above as the click event handler to handle all events from any controls in the panel. Of course since one handler is being used for all controls we need some way to determine which control was clicked. I do this by grabbing the control reference from the <em>sender </em> parameter, and grabbing the ID of it.</p>
<pre class="chili"><code class=""""""""">private void ClickEventHandler(object sender, System.EventArgs e)
{
	if (GridClicked != null)
	{
		PictureBox p = (PictureBox)sender;
		mId = p.Name;

		//do something here
	}
}</code></pre>
<p>Hope this helps simplify your code in the future by reducing repetitive events for similar controls.</p>
<p> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.craigweston.ca/?feed=rss2&amp;p=19</wfw:commentRss>
		</item>
		<item>
		<title>Rolling your own PHP MVC: Apache Mod-Rewrite</title>
		<link>http://blog.craigweston.ca/?p=18</link>
		<comments>http://blog.craigweston.ca/?p=18#comments</comments>
		<pubDate>Fri, 11 Jul 2008 13:57:31 +0000</pubDate>
		<dc:creator>Craig</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Mod Rewrite]]></category>

		<category><![CDATA[PHP MVC]]></category>

		<category><![CDATA[Routing]]></category>

		<guid isPermaLink="false">http://blog.craigweston.ca/?p=18</guid>
		<description><![CDATA[So I&#8217;ve decided to start a multi part series describing how to develop a basic framework implementing a MVC architecture for PHP. What I will be describing and using as code references will be the foundation of a MVC I wrote a couple months ago. Hopefully the information provided will help you get on your [...]]]></description>
			<content:encoded><![CDATA[<p>So I&#8217;ve decided to start a multi part series describing how to develop a basic framework implementing a MVC architecture for PHP. What I will be describing and using as code references will be the foundation of a MVC I wrote a couple months ago. Hopefully the information provided will help you get on your way to also writing your own MVC, or will just help you understand the MVC pattern better.</p>
<p>Todays post will be focused on setting up apache mod rewrite rule to control your url structure and to allow a clean way of routing requests to your controllers.</p>
<p><strong>Apache mod re-write</strong><br />
Apache mod re-write can be used for a variety of things. For further reading on the subject I recommend visiting the <a href="http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html">Apache documentation</a>. What I am about to demonstrate will give you the functionality to turn ugly urls like <em>&#8220;http://yourdomain.com/index.php?module=mymodule&#038;action=myaction&#8221; </em>into a cleaner and more search engine friendly <em>&#8220;http://yourdomain.com/mymodule/myaction&#8221;</em>. In the next post I will describe how to parse these urls and dispatch the appropriate php scripts.</p>
<p>The first thing you need to do is create a <em>.htaccess</em> file in your web root directory.<br />
<code>% touch .htaccess</code></p>
<p>Enter the following code into this file.</p>
<pre>RewriteEngine on</code>

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php?module=$1 [L,QSA]</pre>
<p>What this does is start the rewrite engine and gives it a rule for interpreting urls that follow the regex expression specified. The <em>$1 </em> can be thought of as a variable in which the parameters are substituted. <em>^(.*)$</em> tells apache to take any series of characters and substitute it where the $1 is. </p>
<p>This is not by any means the only way to do this and there are more restrictive ways then mine. I however like to keep mine more open because I explode the url and parse it as I need to. Doing it like this removes issues regarding whether the url contains a closing slash or not, or how many parameters are supplied. These details are handled in the dispatcher.</p>
<p>For another implementation of this rule visit my friend Greg Meloche&#8217;s blog at <a href="http://geekhut.org/2008/06/how-to-basic-apache-mod-rewrite/">GeekHut.org</a>.</p>
<p>My next post will cover the router/dispatcher, where you will see how this url is parsed and where the real functionality takes place.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.craigweston.ca/?feed=rss2&amp;p=18</wfw:commentRss>
		</item>
		<item>
		<title>Enabling Java Applet Support in Firefox</title>
		<link>http://blog.craigweston.ca/?p=17</link>
		<comments>http://blog.craigweston.ca/?p=17#comments</comments>
		<pubDate>Fri, 11 Jul 2008 05:31:48 +0000</pubDate>
		<dc:creator>Craig</dc:creator>
		
		<category><![CDATA[General]]></category>

		<category><![CDATA[Firefox]]></category>

		<category><![CDATA[Java Applet]]></category>

		<category><![CDATA[Plugins]]></category>

		<guid isPermaLink="false">http://blog.craigweston.ca/?p=17</guid>
		<description><![CDATA[While attempting to use Droid Draw(check this out if you haven&#8217;t yet, its awesome) to create some xml layouts for an Android activity that I was working on, I realized that currently I didn&#8217;t have support to run java applets in my browser. 
Here&#8217;s the basic instructions to do so in Fedora 8 using Firefox [...]]]></description>
			<content:encoded><![CDATA[<p>While attempting to use <a href="http://www.droiddraw.org/">Droid Draw</a>(check this out if you haven&#8217;t yet, its awesome) to create some xml layouts for an Android activity that I was working on, I realized that currently I didn&#8217;t have support to run java applets in my browser. </p>
<p>Here&#8217;s the basic instructions to do so in Fedora 8 using Firefox for all of you who are interested in doing this&#8230;</p>
<p>Login as root.<br />
<code>% su</code></p>
<p>Find your plugins directory for firefox and change to that directory. Mine is in my home directory<br />
<code>% cd /home/craig/firefox/plugins</code></p>
<p>Create a symlink to the java plugin, assuming you know where this is. Refer to mine if you are unable to locate yours.<br />
<code>% ln -s /usr/java/jdk1.6.0_06/jre/plugin/i386/ns7/libjavaplugin_oji.so</code></p>
<p>Heres a trick you also may not know. By typing the following in the Firefox address bar you are presented with plugin information.<br />
<code>about:plugins</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.craigweston.ca/?feed=rss2&amp;p=17</wfw:commentRss>
		</item>
		<item>
		<title>String Tokenizer Class in C++</title>
		<link>http://blog.craigweston.ca/?p=16</link>
		<comments>http://blog.craigweston.ca/?p=16#comments</comments>
		<pubDate>Tue, 08 Jul 2008 23:12:57 +0000</pubDate>
		<dc:creator>Craig</dc:creator>
		
		<category><![CDATA[C++]]></category>

		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[c++ string manipulation]]></category>

		<category><![CDATA[string tokenizer]]></category>

		<category><![CDATA[tokenizer]]></category>

		<guid isPermaLink="false">http://blog.craigweston.ca/?p=16</guid>
		<description><![CDATA[I&#8217;ve been using java&#8217;s StringTokenizer lately and recently needed to use the same functionality in c++ for one of my classes, so I wrote a c++ utility class to handle this. It is presented much like the java tokenizer class but obviously toned down a bit.

/* @class Tokenizes a string and generates elements
 */
class Tokenizer [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using java&#8217;s <em>StringTokenizer</em> lately and recently needed to use the same functionality in c++ for one of my classes, so I wrote a c++ utility class to handle this. It is presented much like the java tokenizer class but obviously toned down a bit.</p>
<div style="max-width:100%;overflow:auto;">
<pre>/* @class Tokenizes a string and generates elements
 */
class Tokenizer {

private: 

	vector<string> _elements;
	string _data;
	char _delimiter;
	int _index;

public:

	Tokenizer(string value, const char delimiter = &#8216; &#8216;)
	: _data(value)
	, _delimiter(delimiter)
	, _index(0)
	{
		//tokenize our input so its ready to be transversed
		tokenize();
	}

	/* @brief Provides the next element to the caller
	 * @param element The string to store the element (passed by reference)
	 * @return Whether or no we have reached the end
	 */
	bool next(string&#038; element) {

		if(_index >= _elements.size())
			return false; 

		element =  _elements[_index];
		++_index;
		return true;
	}

	/* @brief Resets the internal pointer to the beginning of the element
	 * list
	 */
	bool first() {
		_index = 0;
	}

private:

	/* @brief Seperates and stores each element in the string
	 */
	void tokenize() {

		int first = 0;
		int last = 0;

		do {
			//search for the first or next token
			last = _data.find_first_of(_delimiter, first);	

			if(last == -1) {
				if(first == _data.size())
				 	//there no tokens or characters left, exit
					break;
				else {
					//still one element left but no final token
					last = _data.size();
					_elements.push_back(_data.substr(first, last - first));
					break;
				}
			}
			else {
				//found token, store element
				_elements.push_back(_data.substr(first, last - first));
				first = last + 1;
			}

		} while(last != -1 );
	}

};</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.craigweston.ca/?feed=rss2&amp;p=16</wfw:commentRss>
		</item>
		<item>
		<title>Transmission not Launching on Mac (OS X)</title>
		<link>http://blog.craigweston.ca/?p=14</link>
		<comments>http://blog.craigweston.ca/?p=14#comments</comments>
		<pubDate>Fri, 27 Jun 2008 01:37:04 +0000</pubDate>
		<dc:creator>Craig</dc:creator>
		
		<category><![CDATA[Mac]]></category>

		<category><![CDATA[Security Update]]></category>

		<category><![CDATA[Torrents]]></category>

		<category><![CDATA[Transmission]]></category>

		<guid isPermaLink="false">http://blog.craigweston.ca/?p=14</guid>
		<description><![CDATA[So its been awhile since I&#8217;ve used my Macbook for downloading torrents. Lately I haven&#8217;t been downloading torrents much at all and have also been working in Fedora alot. Today however I decided too, but to my surprise I was not able too. Every time I would try to open Transmission I would see it [...]]]></description>
			<content:encoded><![CDATA[<p>So its been awhile since I&#8217;ve used my Macbook for downloading torrents. Lately I haven&#8217;t been downloading torrents much at all and have also been working in Fedora alot. Today however I decided too, but to my surprise I was not able too. Every time I would try to open <a href="http://www.transmissionbt.com/">Transmission</a> I would see it pop up in my dashboard and then go away. This seemed really strange to me because it has always been a really reliable application. Turns out after some Googling, that  the problem was because I didn&#8217;t have <em>Security Update 2008-002</em> installed. I don&#8217;t really keep up on all the Mac news that much so I guess this is my fault. Anyways I downloaded the update and installed it and now Transmission works again. If your having a similar issue this is likely your problem and I  hope this post helped. I don&#8217;t have any more information on it, I didn&#8217;t really feel like looking into it anymore, it works, I&#8217;m happy, I&#8217;ll read up on the security update later&#8230;I&#8217;m going to go learn some more Ajax.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.craigweston.ca/?feed=rss2&amp;p=14</wfw:commentRss>
		</item>
		<item>
		<title>Assembly Signing in .NET</title>
		<link>http://blog.craigweston.ca/?p=12</link>
		<comments>http://blog.craigweston.ca/?p=12#comments</comments>
		<pubDate>Thu, 19 Jun 2008 00:26:12 +0000</pubDate>
		<dc:creator>Craig</dc:creator>
		
		<category><![CDATA[.Net]]></category>

		<category><![CDATA[Assemblies]]></category>

		<category><![CDATA[Assembly Signing]]></category>

		<guid isPermaLink="false">http://blog.craigweston.ca/?p=12</guid>
		<description><![CDATA[Since I&#8217;m looking at this stuff at the moment for my .NET exam tomorrow I thought I would write up a quick post about it.
What I am going to try to demonstrate in this post is three things; signing an assembly, moving an assembly to a different location on the system, and forcing the client [...]]]></description>
			<content:encoded><![CDATA[<p>Since I&#8217;m looking at this stuff at the moment for my .NET exam tomorrow I thought I would write up a quick post about it.</p>
<p>What I am going to try to demonstrate in this post is three things; signing an assembly, moving an assembly to a different location on the system, and forcing the client to use a different version of the assembly. I will break this up into different steps.</p>
<p><strong>Signing an Assembly</strong><br />
To sign an assembly we need a public and private key pair. This can be done on the Visual Studio command line using the following command.</p>
<p><code>% sn -k mykeyfile.snk</code></p>
<p>Next we need to associate our assembly with our key. This can easily be done in Visual Studio by going to the project properties for the assembly and going to the <em>Signing </em>tab. Here you can browse for your key and attach it.</p>
<p><strong>Moving the Assembly</strong><br />
To move the dll to a different directory other then the same folder as your client exe file we need to add a config file to the client folder.  It should be the same name as your client.exe and should have the .config extension. Edit this file with an editor of some sort, I prefer Notepad++ in Windows.</p>
<p>Enter the following:</p>
<div style="max-width:100%;overflow:auto;">
<pre class="chili"><code class="xml""""""""""""""""""""""""""">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;
&lt;configuration&gt;
&lt;runtime&gt;
&lt;assemblyBinding xmlns=&quot;urn:schemas-microsoft-com:asm.v1&quot;&gt;
&lt;dependentAssembly&gt;
&lt;assemblyIdentity name=&quot;Classes&quot; publicKeyToken=&quot;5ce03d2c8ba6d217&quot;/&gt;
&lt;codeBase version=&quot;1.0.0.1&quot; href=&quot;C:/Classes.dll&quot;/&gt;
&lt;/dependentAssembly&gt;
&lt;/assemblyBinding&gt;
&lt;/runtime&gt;
&lt;/configuration&gt;</code></pre>
</div>
<p>For now I won&#8217;t explain all of this file, but will focus on the task we are doing. The parts which are important to us are&#8230;
<div style="max-width:100%;overflow:auto;">
<pre class="chili"><code class="xml""""""""""""""""""""""""">&lt;assemblyIdentity name=&quot;Classes&quot; publicKeyToken=&quot;5ce03d2c8ba6d217&quot;/&gt;
&lt;codeBase version=&quot;1.0.0.1&quot; href=&quot;C:/Classes.dll&quot;/&gt;
</code></pre>
</div>
<p>The <em>assemblyIdentity</em> specifiys the assembly name and public key token.<br />
To get the public key token to enter here you can use the command line tool <em>sn</em> again with the <em>-T</em> flag.</p>
<p><code>% sn -T the_dll_name.dll</code></p>
<p>The <em>codeBase</em> allows us to specify an alternate location of the assembly, in this case the <em>C:\</em> drive. You can change the location to whatever you want. Remove the dll from the client folder and to the new location, run the executable and you should still be able to use the assembly just as before.</p>
<p><strong>Binding to New Versions</strong><br />
To force a client to use a specific version of an assembly we can add the <em>bindingRedirect</em> tag.</p>
<div style="max-width:100%;overflow:auto;">
<pre class="chili"><code class="xml""""""""""""""""""""""""">&lt;bindingRedirect oldVersion=&quot;1.0.0.0&quot; newVersion=&quot;1.0.0.1&quot;/&gt;</code></pre>
</div>
<p>Specify the two attributes, the old version and new version. The new version being the version you currently want to use. Again, save and run the executable and if all has gone well you should only be able to use the assembly with the new version.</p>
<p>In case you are wondering, you can change your assembly version in Visual Studio by going to <em>project properties-&gt;Application tag-&gt;Assembly Information button</em>.</p>
<p>Hope this helps in your assembly configuration tasks.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.craigweston.ca/?feed=rss2&amp;p=12</wfw:commentRss>
		</item>
		<item>
		<title>PHP MVC Framework Prototype</title>
		<link>http://blog.craigweston.ca/?p=11</link>
		<comments>http://blog.craigweston.ca/?p=11#comments</comments>
		<pubDate>Tue, 17 Jun 2008 08:07:16 +0000</pubDate>
		<dc:creator>Craig</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Personal Projects]]></category>

		<category><![CDATA[framework]]></category>

		<category><![CDATA[MVC]]></category>

		<guid isPermaLink="false">http://blog.craigweston.ca/?p=11</guid>
		<description><![CDATA[This is a MVC framework I have been working on over the weekend. Its in the very early stages of development but the base has been coded and is working fairly well and meeting my original goals.

The main components consist of the following.
The Dispatcher:
The dispatcher is the main controller, front controller, or router as I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>This is a MVC framework I have been working on over the weekend. Its in the very early stages of development but the base has been coded and is working fairly well and meeting my original goals.</p>
<p style="text-align: center;"><a href="http://blog.craigweston.ca/images/phpmvc_large.jpg"><img class="aligncenter" src="http://blog.craigweston.ca/images/phpmvc_small.jpg" alt="PHP MVC Framework" /></a></p>
<p>The main components consist of the following.</p>
<p><strong>The Dispatcher:</strong><br />
The dispatcher is the main controller, front controller, or router as I&#8217;ve also heard people call it. It handles extracting the path data from the URL and decides which module and action to run. It is the boss of the application and is in charge of initialization, authentication, and calling the event on each module.</p>
<p><strong>Module</strong><br />
I call this somewhat of a mvc hybrid because I don&#8217;t directly consider the module a controller. In a way it is a secondary controller to the dispatcher but I find it performs more then just routing data between the models and view. To think of it in file structure terms, the module specifies a folder on the system, and each class/php file in that folder represents a major component of that module. Within each of these classes there are methods(events) that can be called which act on these components. For example a <strong>users</strong> module may have a <strong>profile</strong> being the class and the event being <strong>edit</strong>. We could then call this with <em>http://test.com/users/profile/edit/</em></p>
<p><strong>Model</strong><br />
In a way we could stick most of the database interaction and model code within the module if we really want to. This however would create really bloated module classes and limit code reuse. I find it better to keep my models separate and treat them as data object classes who&#8217;s main focus is to encapsulate data and directly talk to the database.</p>
<p><strong>Presenter</strong><br />
The presenter is the go between for the module and the view. Essentially it includes the view template and takes the data from the module and generates variables which can then be used by the view template to display its content. By doing this we can abstract the presenter later and easily change the final output to say a <em>smarty</em> template or some other format.</p>
<p><strong>View</strong><br />
As mentioned above the view gets its data from the <em>presenter. </em>It contains very little <em>php</em> code with its only purpose being filling itself with the data it receives from the <em>presenter </em>and generating the final output document.</p>
<p><strong>Authentication</strong><br />
Authentication occurs in the dispatcher before running an event of a module and is implemented on the component level. As mentioned above each module is made up a series of pieces (components) which make up its general functionality. Each of these components derive from a module authentication class. This gives each component the same interface for authentication to be performed by the dispatcher. At this stage I have created two parent module authentication classes that can be inherited from; private_module and public_module. Private module  is a module that checks for session state to ensure a user is logged in. The public module authentication just returns true because it requires no authentication for the user to use the module. I chose to do it this way for flexibility because new authentication types can be easily added to the existing framework and integrated with little modification to anything else. Any other globally required module functionality can also be added to these classes and forced upon all components if need be.</p>
<p>So that is the general break down of my framework at this stage. Feel free to add any feedback and suggestions.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.craigweston.ca/?feed=rss2&amp;p=11</wfw:commentRss>
		</item>
		<item>
		<title>lftp</title>
		<link>http://blog.craigweston.ca/?p=10</link>
		<comments>http://blog.craigweston.ca/?p=10#comments</comments>
		<pubDate>Tue, 17 Jun 2008 05:20:38 +0000</pubDate>
		<dc:creator>Craig</dc:creator>
		
		<category><![CDATA[Tools]]></category>

		<category><![CDATA[ftp]]></category>

		<category><![CDATA[lftp]]></category>

		<guid isPermaLink="false">http://blog.craigweston.ca/?p=10</guid>
		<description><![CDATA[I have been using the unix command line ftp tool alot lately however I&#8217;ve recently noticed that uploading an entire directory recursively doesn&#8217;t seem to be possible. After doing a quick search on Google, most responses verified my fears. Possible suggestions were  to tar the directory locally then use ssh to transfer it and [...]]]></description>
			<content:encoded><![CDATA[<p>I have been using the unix command line ftp tool alot lately however I&#8217;ve recently noticed that uploading an entire directory recursively doesn&#8217;t seem to be possible. After doing a quick search on Google, most responses verified my fears. Possible suggestions were  to tar the directory locally then use ssh to transfer it and then un-tar it on the server. However since I don&#8217;t have ssh setup on my server yet this wasn&#8217;t an option and I needed something quick. The ssh idea just seemed like overkill, come on&#8230; ftp is supposed to do these types of things.</p>
<p>I decided to give <em>lftp</em> a try and so far I am really liking it compared to regular ftp and it was able to do what I hoped.</p>
<p>Uploading an entire directory with <em>lftp</em> can be done with the <em>mirror</em> command and the <em>-R</em> option as seen below.<br />
<code>% mirror -R some_directory</code></p>
<p>To download an entire directory from the server just exclude the <em>-R</em> command.<br />
<code>% mirror  some_directory</code></p>
<p>Feel free to let me know if there is a way with regular ftp to do this. I didn&#8217;t spend a whole lot of time researching it but from what I found it didn&#8217;t seem possible.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.craigweston.ca/?feed=rss2&amp;p=10</wfw:commentRss>
		</item>
	</channel>
</rss>
