<?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>Delivering Quality &#187; Software Development</title>
	<atom:link href="http://www.markdeepwell.com/category/software-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.markdeepwell.com</link>
	<description>A Software Developers View of the World</description>
	<lastBuildDate>Sat, 31 Dec 2011 22:41:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Sanitize User Input for XSS in PHP</title>
		<link>http://www.markdeepwell.com/2011/08/sanitize-user-input-for-xss-in-php/</link>
		<comments>http://www.markdeepwell.com/2011/08/sanitize-user-input-for-xss-in-php/#comments</comments>
		<pubDate>Thu, 01 Sep 2011 06:04:39 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Tip]]></category>
		<category><![CDATA[HTML Purifier]]></category>
		<category><![CDATA[XSS]]></category>

		<guid isPermaLink="false">http://www.markdeepwell.com/?p=637</guid>
		<description><![CDATA[The best way to sanitize any input from your user is to use the HTML Purifier library. HTML Purifier will remove any XSS from your code, produce valid HTML, and generally make you sleep just a bit safer at night. It doesn&#8217;t completely sanitize user input, and you still need to be careful with it [...]]]></description>
			<content:encoded><![CDATA[<p>The best way to sanitize any input from your user is to use the <a href="http://htmlpurifier.org/">HTML Purifier</a> library. HTML Purifier will remove any XSS from your code, produce valid HTML, and generally make you sleep just a bit safer at night. It doesn&#8217;t completely sanitize user input, and you still need to be careful with it before using it anywhere (such as an SQL statement), but it will remove all XSS attacks against your website.</p>
<p>Here&#8217;s a simple example of how to use it:</p>
<pre class="brush: php; title: ; notranslate">
$purifier = new HTMLPurifier();
$purifier-&gt;purify($user_string);
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.markdeepwell.com/2011/08/sanitize-user-input-for-xss-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Yii Override Command Parameters</title>
		<link>http://www.markdeepwell.com/2011/07/yii-override-command-parameters/</link>
		<comments>http://www.markdeepwell.com/2011/07/yii-override-command-parameters/#comments</comments>
		<pubDate>Mon, 11 Jul 2011 14:35:48 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[commandMap]]></category>
		<category><![CDATA[config]]></category>
		<category><![CDATA[Yii]]></category>

		<guid isPermaLink="false">http://www.markdeepwell.com/?p=629</guid>
		<description><![CDATA[The Yii Framework is very flexible and has a variety of way you can configure it. Here I will show you how you can customize parameters on a Command task. The default Yii Migration command asks the user for a confirmation before running if there are any tables that have been changed, this is quite [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.yiiframework.com/">Yii Framework</a> is very flexible and has a variety of way you can configure it. Here I will show you how you can customize parameters on a Command task.</p>
<p>The default Yii Migration command asks the user for a confirmation before running if there are any tables that have been changed, this is quite a sensible default, but I don&#8217;t want to be asked if the command should be run after a deployment. Of course it should be.</p>
<p>To see what options can be configured, open the Migrations file</p>
<pre>
vendors/framework/cli/commands/MigrateCommand.php
</pre>
<p>Any of the public class variables can be configured in your config/console.php file. Using the <b>commandMap</b> parameter, you can configure values for Yii Commands. Then specify the <b>migrate</b> task, and then the config values you want to change. In this case, I want to change interactive to false, so it won&#8217;t ask for a confirmation.</p>
<p>Sample config/console.php:</p>
<pre class="brush: php; title: ; notranslate">
return array(
 ...
  // database migration, don't ask for confirmation
  'commandMap'=&gt;array(
    'migrate'=&gt;array(
      'class'=&gt;'system.cli.commands.MigrateCommand',
      'interactive'=&gt;false,
    ),
  ),
);
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.markdeepwell.com/2011/07/yii-override-command-parameters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to add Local Config Variables to Yii</title>
		<link>http://www.markdeepwell.com/2011/06/how-to-add-local-config-variables-to-yii/</link>
		<comments>http://www.markdeepwell.com/2011/06/how-to-add-local-config-variables-to-yii/#comments</comments>
		<pubDate>Thu, 30 Jun 2011 22:13:58 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[config]]></category>
		<category><![CDATA[local settings]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[Yii]]></category>

		<guid isPermaLink="false">http://www.markdeepwell.com/?p=623</guid>
		<description><![CDATA[Often times you want to be able to specify configuration parameters or settings that only apply to a single environment. These local configuration don&#8217;t need to, and shouldn&#8217;t be entered into version control, and should over ride default values. I needed a solution for a project I was working on so I wrote one for [...]]]></description>
			<content:encoded><![CDATA[<p>Often times you want to be able to specify configuration parameters or settings that only apply to a single environment. These local configuration don&#8217;t need to, and shouldn&#8217;t be entered into version control, and should over ride default values. I needed a solution for a project I was working on so I wrote one for Yii.</p>
<p>The main configuration file protected/config/main.php returns an array of parameters. Edit this file to merge 2 arrays, 1 from main.php, and another from local.php.</p>
<p>Edit main.php to look like this:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

return CMap::mergeArray(
  array(
    'basePath'=&gt;dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
    'name'=&gt;'Web app',

... other parameters ...

    'params'=&gt;array(
      // this is used in contact page
      'adminEmail'=&gt;'webmaster@example.com',
    ),
  ),
  local_config()
);

// return an array of custom local configuration settings
function local_config()
{
  if (file_exists(dirname(__FILE__).'/local.php'))
  {
    return require_once(dirname(__FILE__).'/local.php');
  }

  return array();
};
</pre>
<p>And then add any of your own configuration to local.php in the same config directory.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
return array(
  'components'=&gt;array(
    'db'=&gt;array(
      'connectionString' =&gt; 'mysql:host=localhost;dbname=db_name',
      'username' =&gt; 'my_user',
      'password' =&gt; 'secret',
      'enableParamLogging'=&gt;true,
    ),
    'log'=&gt;array(
      'class'=&gt;'CLogRouter',
      'routes'=&gt;array(
        'file'=&gt;array(
          'class'=&gt;'CFileLogRoute',
          'levels'=&gt;'trace, info, error, warning',
        ),
        'profile'=&gt;array(
          'class'=&gt;'CProfileLogRoute',
          'report'=&gt;'summary',
        ),
      ),
    ),
  ),
  'params'=&gt;array(
    // this is used in contact page
    'adminEmail'=&gt;'yourself@example.com',
  ),
);
</pre>
<p>Here we&#8217;ve overridden the adminEmail parameter to yourself@example.com, we&#8217;ve added in custom database username and password, and we&#8217;ve enabled logging.</p>
<p>Feel free to use this as a straightforward way to add custom config values to your Yii project. Just remember to make local.php an ignored file in Git or Subversion.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.markdeepwell.com/2011/06/how-to-add-local-config-variables-to-yii/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Add an i18n Static Page to Symfony</title>
		<link>http://www.markdeepwell.com/2011/05/add-an-i18n-static-page-to-symfony/</link>
		<comments>http://www.markdeepwell.com/2011/05/add-an-i18n-static-page-to-symfony/#comments</comments>
		<pubDate>Mon, 16 May 2011 02:00:48 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[i18n]]></category>
		<category><![CDATA[multilingual]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[static page]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://www.markdeepwell.com/?p=611</guid>
		<description><![CDATA[My last post explained the basics on how to add static pages in symfony, this post expands on that and shows you how to do it for a multilingual site. We split the template finding code out for code maintainability, and we enhance it on where to look for the file. First it tries to [...]]]></description>
			<content:encoded><![CDATA[<p>My last post explained the basics on how to <a href="http://www.markdeepwell.com/2011/03/add-a-static-page-to-symfony/">add static pages in symfony</a>, this post expands on that and shows you how to do it for a multilingual site.</p>
<p>We split the template finding code out for code maintainability, and we enhance it on where to look for the file. First it tries to find the template in the language and country eg: en_CA, then it tries to find the template in the matching language, and if that is not found, it falls back to the default language.</p>
<pre class="brush: php; title: ; notranslate">
/**
 * Load a static page.
 * @param sfRequest $request A request object
 */
public function executePage(sfWebRequest $request)
{
  $template = $this-&gt;findTemplate($request-&gt;getParameter('view'), $this-&gt;getUser()-&gt;getCulture());
  $this-&gt;forward404Unless($template);
  $this-&gt;setTemplate($template);
}

/**
 * Check if a template page exists for a given culture.
 * Be intelligent and check if language &amp; country exist, try language, and then default to english.
 * @param string $name Template filename to check
 * @param string $culture Symfony culture string
 */
protected function findTemplate($name, $culture)
{
  // for safety, strip out all non-alphanumeric characters
  $name = preg_replace('/[^a-zA-Z0-9\s]/', '', $name);

  $directory = $this-&gt;getContext()-&gt;getModuleDirectory() . DIRECTORY_SEPARATOR .&quot;templates&quot;;
  // try language and country: en_CA
  if (is_readable($directory . DIRECTORY_SEPARATOR . $culture. DIRECTORY_SEPARATOR . $name .&quot;Success.php&quot;))
  {
    return $culture. DIRECTORY_SEPARATOR . $name;
  }
  // try langage only: en
  elseif (is_readable($directory . DIRECTORY_SEPARATOR . substr($culture, 0, 2). DIRECTORY_SEPARATOR . $name .&quot;Success.php&quot;))
  {
    return substr($culture, 0, 2). DIRECTORY_SEPARATOR . $name;
  }
  // try default language
  elseif (is_readable($directory . DIRECTORY_SEPARATOR . $name .&quot;Success.php&quot;))
  {
    return $name;
  }
  return false;
}
</pre>
<p>The template directory should have the default language file as usual, eg: templates/helpSuccess.php, and then there should be folders for each language and possibly language &#038; country with the same filename, but localized. eg: templates/fr/helpSuccess.php</p>
]]></content:encoded>
			<wfw:commentRss>http://www.markdeepwell.com/2011/05/add-an-i18n-static-page-to-symfony/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add a Static Page to Symfony</title>
		<link>http://www.markdeepwell.com/2011/03/add-a-static-page-to-symfony/</link>
		<comments>http://www.markdeepwell.com/2011/03/add-a-static-page-to-symfony/#comments</comments>
		<pubDate>Mon, 28 Mar 2011 15:02:19 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[static page]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://www.markdeepwell.com/?p=597</guid>
		<description><![CDATA[Static pages can be added to Symfony quite easily. Edit your routing.yml file which is probably located at apps/frontend/config/routing.yml, and add the following routes to add an about, a privacy, and a terms and conditions page. If you are going to keep the generic rules, make sure you add these new rules before the default [...]]]></description>
			<content:encoded><![CDATA[<p>Static pages can be added to Symfony quite easily.</p>
<p>Edit your routing.yml file which is probably located at apps/frontend/config/routing.yml, and add the following routes to add an about, a privacy, and a terms and conditions page.</p>
<pre class="brush: plain; title: ; notranslate">
# static pages
about:
  url:   /about
  param: { module: home, action: page, view: about }
privacy:
  url:   /privacy
  param: { module: home, action: page, view: privacy }
terms:
  url:   /terms
  param: { module: home, action: page, view: terms }
</pre>
<p>If you are going to keep the generic rules, make sure you add these new rules <strong>before</strong> the default actions.</p>
<p>Clear your cache:<br />
./symfony clear-cache</p>
<p>Then inside the module named <strong>home</strong> (create it if it doesn&#8217;t exist), add the following action:</p>
<pre class="brush: php; title: ; notranslate">
  /**
   * Load a static page.
   * @param sfRequest $request A request object
   */
  public function executePage(sfWebRequest $request)
  {
    $directory = $this-&gt;getContext()-&gt;getModuleDirectory().DIRECTORY_SEPARATOR.&quot;templates&quot;;
    $name = $request-&gt;getParameter('view');
    // for safety, strip out all non-alphanumeric characters
    $name = preg_replace('/[^a-zA-Z0-9\s]/', '', $name);
    if (is_readable($directory.DIRECTORY_SEPARATOR.$name.&quot;Success.php&quot;))
    {
      return $this-&gt;setTemplate($name);
    }
    else
    {
      $this-&gt;forward404();
    }
  }
</pre>
<p>The template files will be on the home/templates directory, called aboutSuccess.php, privacySuccess.php, and termsSuccess.php</p>
<p>This action will check if the template file exists, and if so load the template, if not it will forward to the 404 not found page. Easy and safe static templates. Add more routes and the appropriate template file as required.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.markdeepwell.com/2011/03/add-a-static-page-to-symfony/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Development Best Practices</title>
		<link>http://www.markdeepwell.com/2011/01/web-development-best-practices/</link>
		<comments>http://www.markdeepwell.com/2011/01/web-development-best-practices/#comments</comments>
		<pubDate>Mon, 10 Jan 2011 05:01:47 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Future Proof]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.markdeepwell.com/?p=584</guid>
		<description><![CDATA[Choosing a Technology Framework Does it really matter if you use ASP.NET MVC, Struts 2, Yii, or Rails? Well it might, but for many websites these modern frameworks are just as competitive as the next. Use the stack that is most appropriate for your customer&#8217;s situation and is the best choice at the time. Since [...]]]></description>
			<content:encoded><![CDATA[<h3>Choosing a Technology Framework</h3>
<p>Does it really matter if you use ASP.NET MVC, Struts 2, Yii, or  Rails? Well it might, but for many websites these modern frameworks are  just as competitive as the next. Use the stack that is most appropriate  for your customer&#8217;s situation and is the best choice at the time. Since  this is the real world, it will probably change a couple of years in the  future.</p>
<h3>Leverage Community Extensions</h3>
<p>Each framework out there has libraries of modules, extensions or plugins that enhance functionality and provide features that would you otherwise would need to write yourself. If it exists, and it&#8217;s in good shape, don&#8217;t write it yourself, leverage existing extensions that are appropriately licensed for your project.</p>
<h3>Future Proof your URLs</h3>
<p>It no longer makes sense to have a web site with extensions, be it .html, .php, .jsp, or .whatever you can think of. <a href="http://arstechnica.com/">Arstechnica</a> even created their own .ars, for no reason that I could tell. Yes the web started with .html because websites were simply serving static files, but that is no longer relevant anymore.</p>
<p>If you build a website with .jsp as the suffix to all URLs, and then a couple of years later your boss wants to re-write the website in python, does that mean you change all URLs to be .py, and setup mass url re-writing schemes to handle the old URLs? No, this would be a nightmare. Protect your future self by completely leaving the actual technology used to build the website outside of the URL.</p>
<p>Another bonus is that these URLs also end up being more SEO friendly!</p>
<h3>Use a JavaScript Framework (maybe)</h3>
<p>If you are building an AJAX heavy website such as GMail or Facebook, use a JavaScript framework. This is not relevant for many sites that simply use JavaScript to provide some enhanced functionality, but for websites that are heavily dependent upon JavaScript and simply cannot function without it.</p>
<p>I&#8217;m not talking about jQuery or Prototype, while those are good libraries that abstract the differences between browsers and provide easy to use functions, they are not built as a comprehensive framework. I&#8217;m suggesting you use a framework like JavaScriptMVC, SproutCore, or Spry. These frameworks can be used in tandem with jQuery, but go much farther in helping you organize and control your JavaScript code.</p>
<p>Watch a <a href="http://javascriptmvc.s3.amazonaws.com/videos/2_0/2_0_demo.htm">demo video</a> of what JavaScriptMVC can do for you.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.markdeepwell.com/2011/01/web-development-best-practices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Hosted jQuery</title>
		<link>http://www.markdeepwell.com/2010/09/google-hosted-jquery/</link>
		<comments>http://www.markdeepwell.com/2010/09/google-hosted-jquery/#comments</comments>
		<pubDate>Thu, 09 Sep 2010 03:38:29 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Web Application]]></category>
		<category><![CDATA[CDN]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://www.markdeepwell.com/?p=547</guid>
		<description><![CDATA[Google provides hosting for many of the most popular JavaScript libraries. I&#8217;m a big fan of jQuery so I&#8217;m going to show you how to use Google&#8217;s hosted version of jQuery and thereby removing resources from your web server and speeding up site performance. Performance can be increased because your user is going to download [...]]]></description>
			<content:encoded><![CDATA[<p>Google provides hosting for many of the most popular <a href="http://code.google.com/apis/libraries/">JavaScript libraries</a>. I&#8217;m a big fan of jQuery so I&#8217;m going to show you how to use Google&#8217;s hosted version of jQuery and thereby removing resources from your web server and speeding up site performance.</p>
<p>Performance can be increased because your user is going to download the jQuery file from Google&#8217;s CDN network and not from your server. Also, it could be even faster if the user visited another website that also uses Google&#8217;s hosted jQuery. If that is the case then your user won&#8217;t need to download it again and will use the exactly same cached version.</p>
<p>There are two ways to do this.</p>
<p>The fastest and simplest is to link directly to the Google&#8217; hosted jQuery file:</p>
<pre class="brush: jscript; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot; src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js&quot;&gt;&lt;/script&gt;
</pre>
<p>The second approach has more features but there is a slight delay while the jsapi loads the correct version of jQuery. If you want the absolute best performance use the first version.</p>
<p>1) <a href="http://code.google.com/apis/ajaxsearch/signup.html">Signup</a> to get your own API key</p>
<p>2) Add the following code to your layout:</p>
<pre class="brush: jscript; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot; src=&quot;http://www.google.com/jsapi?key=INSERT-YOUR-KEY&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
google.load(&quot;jquery&quot;, &quot;1.4.2&quot;);

  google.setOnLoadCallback(function() {
    // Put you init code here instead of using $(document).ready()
  });
&lt;/script&gt;
</pre>
<p>You can also specify the latest version of the 1.4 branch:</p>
<pre class="brush: jscript; title: ; notranslate">
google.load(&quot;jquery&quot;, &quot;1.4&quot;);
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.markdeepwell.com/2010/09/google-hosted-jquery/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Ruby Subversion Bindings</title>
		<link>http://www.markdeepwell.com/2010/06/ruby-subversion-bindings/</link>
		<comments>http://www.markdeepwell.com/2010/06/ruby-subversion-bindings/#comments</comments>
		<pubDate>Sun, 27 Jun 2010 05:30:01 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Basics]]></category>
		<category><![CDATA[Software Bindings]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby Subversion Bindings]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[SVN]]></category>

		<guid isPermaLink="false">http://www.markdeepwell.com/?p=516</guid>
		<description><![CDATA[Subversion has bindings for a variety of languages: Java, Perl, Python and Ruby. Of these I am most interested in the Ruby bindings as I&#8217;m building a Rails application. Unfortunately the documentation is completely lacking and bits of it are scattered throughout the web. This is an attempt to provide the code and how-to for [...]]]></description>
			<content:encoded><![CDATA[<p>Subversion has bindings for a variety of languages: Java, Perl, Python and Ruby. Of these I am most interested in the Ruby bindings as I&#8217;m building a Rails application. Unfortunately the documentation is completely lacking and bits of it are scattered throughout the web. This is an attempt to provide the code and how-to for the most common tasks.</p>
<p>Before we get to the code, validate you have the Ruby Subversion bindings installed correctly by running irb from a terminal:</p>
<p>irb(main):001:0&gt; require &#8216;svn/client&#8217;<br />
=&gt; true</p>
<p>Onto the source code. Start it off by including the required svn modules:</p>
<pre class="brush: ruby; title: ; notranslate">
require &quot;svn/core&quot;
require &quot;svn/client&quot;
require &quot;svn/wc&quot;
require &quot;svn/repos&quot;
</pre>
<p>Then setup the context with your subversion credentials:</p>
<pre class="brush: ruby; title: ; notranslate">
ctx = Svn::Client::Context.new()
ctx.add_simple_provider
ctx.auth_baton[Svn::Core::AUTH_PARAM_DEFAULT_USERNAME] = 'username'
ctx.auth_baton[Svn::Core::AUTH_PARAM_DEFAULT_PASSWORD] = 'password'
</pre>
<p>Now you can run any of the following commands on a remote subversion repository.</p>
<h3>SVN Info</h3>
<pre class="brush: ruby; title: ; notranslate">
repos_uri = 'http://svn.website.com/project/trunk'
revision = 50
begin
  ctx.info(repos_uri, revision) do |path, info|
    puts(&quot;Url: #{info.url}&quot;)
    puts(&quot;Last changed rev: #{info.last_changed_rev}&quot;)
    puts(&quot;Last changed author: #{info.last_changed_author}&quot;)
    puts(&quot;Last changed date: #{info.last_changed_date}&quot;)
    puts(&quot;Kind: #{info.kind}&quot;)
  end
rescue Svn::Error =&gt; e
  # catch a generic svn error
  raise &quot;Failed to retrieve SVN info at revision &quot; + revision.to_s
end
</pre>
<h3>SVN Checkout</h3>
<pre class="brush: ruby; title: ; notranslate">
repos_uri = 'http://svn.website.com/project/trunk'
output_dir '/home/billy/project_name'
revision = 50
begin
  ctx.checkout(repos_uri, output_dir, revision.to_i, nil)
rescue Svn::Error::CLIENT_UNRELATED_RESOURCES =&gt; e # revision doesn't exist
  raise &quot;No such revision &quot; + revision.to_s + &quot; at &quot; + repos_uri
end
</pre>
<h3>SVN Log</h3>
<pre class="brush: ruby; title: ; notranslate">
repos_uri = 'http://svn.website.com/project/trunk'
ctx.log(repos_uri, 0, 'HEAD', 0, true, nil) do |changed_paths, rev, author, date, message|
  puts(&quot;Revision: #{rev}&quot;)
  puts(&quot;Author: #{author}&quot;)
  puts(&quot;Date: #{date}&quot;)
  puts(&quot;Message: #{message}&quot;)
  puts(&quot;---------------------------&quot;)
end
</pre>
<h3>SVN List</h3>
<pre class="brush: ruby; title: ; notranslate">
repos_uri = 'http://svn.website.com/project/trunk'
ctx.list(repos_uri, &quot;HEAD&quot;) do |path, dirent, lock, abs_path|
  if !path.blank?
    puts(&quot;Path: #{path}&quot;)
  end
end
</pre>
<p>That should get you started with the ruby bindings. If you want to know how to do anything else let me know in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.markdeepwell.com/2010/06/ruby-subversion-bindings/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Debugging Form Errors in symfony 1.3+</title>
		<link>http://www.markdeepwell.com/2010/04/debugging-form-errors-in-symfony-1-3/</link>
		<comments>http://www.markdeepwell.com/2010/04/debugging-form-errors-in-symfony-1-3/#comments</comments>
		<pubDate>Thu, 15 Apr 2010 16:19:13 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[form validation]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://www.markdeepwell.com/?p=503</guid>
		<description><![CDATA[Symfony 1.3 (or symfony 1.4) provides an incredibly helpful feature to help debug forms. This new feature is included in the developer toolbar and shows valuable information about the forms on the page. To access the detailed form information, click on the view button, click on the template or partial that the form is in, [...]]]></description>
			<content:encoded><![CDATA[<p>Symfony 1.3 (or symfony 1.4) provides an incredibly helpful feature to help  debug forms. This new feature is included in the developer toolbar and shows valuable information about the forms on the page. To access the detailed form information, click on the <em>view</em> button, click on the template or partial that the form is in, and then click to expand the form. It lists each form widget and if any errors for a given widget exist they are shown   right under it. Errors are also highlighted to make them easy to   spot.</p>
<p><a href="http://www.markdeepwell.com/wp-content/uploads/2010/04/form-widget-view.jpg"><img class="aligncenter size-full  wp-image-508" title="form widget view" src="http://www.markdeepwell.com/wp-content/uploads/2010/04/form-widget-view.jpg" alt="" width="435" height="202" /></a></p>
<p>The symfony debug toolbar will look like this when there is a validation error in one of the forms on the current page. This is one of the most incredibly useful features I&#8217;ve seen and greatly  improves productivity while building forms in the symfony framework. Congratulations to the symfony developers who came up with this tool!</p>
<p><a href="http://www.markdeepwell.com/wp-content/uploads/2010/04/symfony-debug-toolbar-1.4.jpg"><img class="aligncenter size-full  wp-image-509" title="symfony debug toolbar 1.4" src="http://www.markdeepwell.com/wp-content/uploads/2010/04/symfony-debug-toolbar-1.4.jpg" alt="" width="492" height="21" /></a></p>
<p>Have symfony 1.1 or 1.2? read <a href="http://www.markdeepwell.com/2009/07/catch-symfony-form-errors/">catch symfony form errors</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.markdeepwell.com/2010/04/debugging-form-errors-in-symfony-1-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What Will Web Development Look Like in 5 Years</title>
		<link>http://www.markdeepwell.com/2010/03/what-will-web-development-look-like-in-5-years/</link>
		<comments>http://www.markdeepwell.com/2010/03/what-will-web-development-look-like-in-5-years/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 16:40:45 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Software Tools]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[5 Years]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Canvas]]></category>
		<category><![CDATA[Framework]]></category>
		<category><![CDATA[Future]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WebGL]]></category>

		<guid isPermaLink="false">http://www.markdeepwell.com/?p=438</guid>
		<description><![CDATA[Developing applications for the web has changed significantly over the last 5 years. Since 2005 the term AJAX has been coined, Ruby on Rails is now an open source web application framework, jQuery was created and has subsequently revolutionized JavaScript development, and now HTML5 is the top buzzword of the day. I believe the next [...]]]></description>
			<content:encoded><![CDATA[<p>Developing applications for the web has changed significantly over the last 5 years. Since 2005 the term AJAX has been coined, Ruby on Rails is now an open source web application framework, jQuery was created and has subsequently revolutionized JavaScript development, and now HTML5 is the top buzzword of the day. I believe the next 5 years will hold just as many improvements for web developers.</p>
<p>I foresee a new framework will be created to make developing fully interactive AJAX applications  as easy as it is to write current MVC applications. Current  frameworks like Ruby on Rails and Symfony provide everything you need to develop a modern application without having to build plumbing infrastructure; however, they do not provide nice components for interactive applications. In addition to a robust server core, this new framework will have   a client side JavaScript component that simplifies the process of building interactive web 2.0 applications. Some critical components would be:</p>
<ul>
<li>Form Validation. Libraries do exist to validate forms in JavaScript,  but they don&#8217;t integrate with the server side form validation. In this new framework you won&#8217;t have to write form validation code twice.</li>
<li>Paginated Lists. Almost all web applications have at least one page where data needs to be searched and listed with pagination. We need to have this same functionality in JavaScript to skip a full page reload and provide local caching of the results.</li>
<li>Animation Library. While script.aculo.us and jQuery have made simple animations and visual effects much easier to do, I believe we can go even farther. Web applications also need to gain that fluidity and soft animations that desktop applications such as Exposé have had for a couple of years.</li>
</ul>
<p>I also see huge resources being directed towards mobile development because ALL current generation smart phones are built for an incredible web browsing experience. As home users have switched from <a href="http://www.canada.com/technology/tech-biz/laptops+dominate+desktop+face+obsolescence/1151512/story.html">desktop computers</a> to <a href="http://www.google.com/trends?q=laptop%2C+desktop">laptop computers</a> in the last few years, people will slowly start switching to hand-held devices for their primary communication and Internet needs. Most likely this will have one primary effect: web frameworks will have a mobile optimized version of the site done automatically. Little to none developer intervention will be required as only resolution, text sizes, and layouts will be modified for the mobile version.</p>
<p>Lastly I see tools and libraries around 2D and 3D drawing elements. Most likely these libraries would be rendering to a <a href="https://developer.mozilla.org/en/Canvas_tutorial">Canvas</a> or a <a href="http://planet-webgl.org/">WebGL</a> element but something better could be created. Both of these are young standards right now that show a lot of promise on delivering the ability to draw pixels directly in a native HTML web page. While they will be used first in simple computer games, I am very interested to see what libraries are created to facilitate these elements being used appropriately inside next generation web applications.</p>
<p>What do you think the next 5 years will bring?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.markdeepwell.com/2010/03/what-will-web-development-look-like-in-5-years/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

