<?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>Mark Stahler - Blog &#187; Code</title>
	<atom:link href="http://blog.markstahler.ca/category/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.markstahler.ca</link>
	<description>Coding, Gaming, CrackBerry&#039;ing and everything else white and nerdy</description>
	<lastBuildDate>Mon, 30 Aug 2010 01:07:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Python development on Windows &#8211; Setuptools &amp; Pip configuration</title>
		<link>http://blog.markstahler.ca/2010/08/python-development-on-windows-setuptools-pip-configuration/</link>
		<comments>http://blog.markstahler.ca/2010/08/python-development-on-windows-setuptools-pip-configuration/#comments</comments>
		<pubDate>Sun, 29 Aug 2010 02:42:43 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://blog.markstahler.ca/?p=288</guid>
		<description><![CDATA[Sometimes installing Python modules on Windows is a pain. You have seen the setuptools error message complaining that you don&#8217;t have Visual Studio 2003 installed? Yes, well then you have probably seen that the fix is easy: python setup.py build –compiler=mingw32 install But what if you want to install using easy_install or pip? or you [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes installing Python modules on Windows is a pain. You have seen the setuptools error message complaining that you don&#8217;t have Visual Studio 2003 installed? Yes, well then you have probably seen that the fix is easy:</p>
<p>python setup.py build –compiler=mingw32 install</p>
<p>But what if you want to install using easy_install or pip? or you want to use a pip requirements.txt file in a virtualenv? I have the solution for you.</p>
<p>First: Install MinGw including gcc, make and all the other regular goodies you would have on a Unix system.</p>
<p>Second: Add your \MinGw\bin directory to your path.</p>
<p>Third: If you are using an older version of Python (pre 2.6.6) you will have to manually set your HOME environment variable to your user directory.</p>
<p>Finally: In your <strong>C:\Users\Admin</strong> (where Admin is your Windows user account, Windows XP users, adjust to \Documents and Settings\ appropriately), create a text file called <strong>pydistutils.cfg</strong> and paste in the following options:</p>
<p><em>[build]<br />
compiler = mingw32</em></p>
<p>That&#8217;s it! Enjoy using the magical goodness of pip and easy_install on packages like Twisted, SimpleJson (with speedups) and postgres</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.markstahler.ca/2010/08/python-development-on-windows-setuptools-pip-configuration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python &#8211; Convert a Dictionary to a List</title>
		<link>http://blog.markstahler.ca/2010/02/python-convert-a-dictionary-to-a-list/</link>
		<comments>http://blog.markstahler.ca/2010/02/python-convert-a-dictionary-to-a-list/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 02:53:03 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://blog.markstahler.ca/?p=278</guid>
		<description><![CDATA[We can easily create a Python list by pulling only the values out of a dictionary. This is done via the values() method. >>> x = {'a':1, 'b':2} >>> x {'a': 1, 'b': 2} >>> y = list(x.values()) >>> y [(1), (2)]]></description>
			<content:encoded><![CDATA[<p>We can easily create a Python list by pulling only the values out of a dictionary. This is done via the values() method.</p>
<p><code><br />
>>> x = {'a':1, 'b':2}<br />
>>> x<br />
{'a': 1, 'b': 2}<br />
>>> y = list(x.values())<br />
>>> y<br />
[(1), (2)<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.markstahler.ca/2010/02/python-convert-a-dictionary-to-a-list/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby on Rails + Gmail SMTP (TLS)</title>
		<link>http://blog.markstahler.ca/2009/07/ruby-on-rails-gmail-smtp-tls/</link>
		<comments>http://blog.markstahler.ca/2009/07/ruby-on-rails-gmail-smtp-tls/#comments</comments>
		<pubDate>Sat, 18 Jul 2009 00:55:36 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.markstahler.ca/?p=197</guid>
		<description><![CDATA[This took way too long to figure out the answer to without using a custom plugin. I hope this helps others! I was setting up Redmine with Gmail as an SMTP server utilizing config/email.yml. Behold! email.yml with no other related changes in environment.yml using Rails 2.2.2 production: delivery_method: :smtp smtp_settings: enable_starttls_auto: :true address: smtp.gmail.com port: [...]]]></description>
			<content:encoded><![CDATA[<p>This took way too long to figure out the answer to without using a custom plugin. I hope this helps others! I was setting up Redmine with Gmail as an SMTP server utilizing config/email.yml. Behold!</p>
<p>email.yml with no other related changes in environment.yml using Rails 2.2.2</p>
<pre name="code">production:

delivery_method: :smtp
smtp_settings:
enable_starttls_auto: :true
address: smtp.gmail.com
port: 587
domain: GMAILDOMAIN.com
authentication: :plain
tls: :true
user_name: "EMAIL@YOURGMAILDOMAIN.com"
password: "YOURPASS"
</pre>
<p>If you are setting up Redmine, there is a nice feature under Administration > Settings > Email Notifications > and in the very bottom right corner of the page, a &#8220;Send a Test Email&#8221; link. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.markstahler.ca/2009/07/ruby-on-rails-gmail-smtp-tls/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>List of Free and cheap Subversion (SVN) repository hosts</title>
		<link>http://blog.markstahler.ca/2009/02/list-of-free-and-cheap-svn-repository-hosts/</link>
		<comments>http://blog.markstahler.ca/2009/02/list-of-free-and-cheap-svn-repository-hosts/#comments</comments>
		<pubDate>Mon, 16 Feb 2009 21:24:32 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://www.markstahler.ca/?p=110</guid>
		<description><![CDATA[So currently I am hosting 4 SVN repos on the same box as our web server. The server is maintained by me and gets backed up not nearly enough. So before I have a disaster and lose months of work I began looking to at least store my code somewhere safer. In my search to [...]]]></description>
			<content:encoded><![CDATA[<p>So currently I am hosting 4 SVN repos on the same box as our web server. The server is maintained by me and gets backed up not nearly enough. So before I have a disaster and lose months of work I began looking to at least store my code somewhere safer. In my search to find SVN hosting this is what I found which can hopefully save you some searching:</p>
<ul>
<li><a href="http://xp-dev.com">XP Dev</a> &#8211;  <span style="text-decoration: underline;">Completely free </span>SVN repository hosting for projects smaller than 1.5 gbs. Free for Open Source and private projects, with any number of contributors. XP Dev offers a pretty <a href="http://xp-dev.com/wiki/1/Features">impressive list of features</a> for a free service including issue tracking, wikis and task management. Looks like a great and promising site. They even have posted <a href="http://xp-dev.com/wiki/1/Importing-A-Subversion-Repository">a guide to help you migrate your existing repository </a>over to them. Commiters must create an XP Dev account.</li>
<li><a href="https://www.projectlocker.com">Project Locker</a> &#8211; Appears to be the best value from the bunch for paid SVN hosting. Appears as if you want to have a Trac you either need to be an Open Source project or pay. For $5 USD you can get 5 commiters, unlimited repos, unlimited Tracs and of course backups. Comparison of service options <a href="https://www.projectlocker.com/scenario/startup">here</a>.</li>
<li><a href="http://svnrepository.com/">SVN Repository</a> &#8211; Appears similar to Project Locker except more expensive on small projects. Cheaper for unlimited number of commiters. Comparison of options on <a href="http://svnrepository.com/">main page</a>.</li>
<li> <a href="http://www.devjavu.com/">DejaVu</a> &#8211; Another but not nearly as cheap as the others, cheapest plan is $19 USD if you are not one of the &#8216;chosen ones&#8217; who recieve a free invite only account.</li>
<li> <a href="http://www.assembla.com/">Assembla</a> &#8211; Offers a free workspace for free and public projects including ticketing system, Trac, team collaboration, wikis, time tracking and more. Assembla is much more than just project hosting, they offer a team management system where the cost is determined by the number of users. Assembla also offers Git and Mercurial as source control options.</li>
<li> <a href="http://www.dreamhost.com">Dreamhost</a> &#8211; Offers unlimited SVN repos for web hosting account holders. SVN is an old version 1.43 which lacks merging. Setup instructions can be <a href="http://wiki.dreamhost.com/Svn">found here</a>.</li>
</ul>
<p><span style="text-decoration: underline;">The Free and Open Source Contenders:</span></p>
<ul>
<li><a href="http://sourceforge.net/">SourceForge</a> &#8211; Everyone knows what SourceForge is. Free for Open Source projects, offers source control, basic project pages including issue tracking and crappy discussion forums,</li>
<li> <a href="http://www.codeplex.com/">Codeplex</a>- Microsofts Open Source project hosting community. If you have an Open Source Windows related project you can host it on Codeplex which provides source control, issue tracking, and discussion forums.</li>
<li> <a href="http://code.google.com">Google Code </a>- If you have an Open Source project and want a little more than just source control you can <a href="http://code.google.com/hosting/">get a Google Code </a>workspace. The Google Code account is free and includes SVN, a wiki and issue tracking as well as a basic public project page.</li>
</ul>
<p>Let me know of any others in the comments and I will add them.</p>
<p>*Prices and information accurate as of February 2009.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.markstahler.ca/2009/02/list-of-free-and-cheap-svn-repository-hosts/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The beautiful phrase &#8220;Man, I am an idiot&#8230;&#8221;</title>
		<link>http://blog.markstahler.ca/2009/01/the-beautiful-phrase-man-i-am-an-idiot/</link>
		<comments>http://blog.markstahler.ca/2009/01/the-beautiful-phrase-man-i-am-an-idiot/#comments</comments>
		<pubDate>Fri, 23 Jan 2009 02:49:13 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.markstahler.ca/?p=106</guid>
		<description><![CDATA[How often do you have &#8220;Man, I am an idiot&#8221; moments? Forgetting to pay a bill on time, saying something stupid and regretting it immediately after, or chopping the tip of your finger off cutting red peppers? Yeah, gross&#8230; Well if I did either of those things I dont think I would be too happy [...]]]></description>
			<content:encoded><![CDATA[<p>How often do you have &#8220;Man, I am an idiot&#8221; moments? Forgetting to pay a bill on time, saying something stupid and regretting it immediately after, or chopping the tip of your finger off cutting red peppers? Yeah, gross&#8230; Well if I did either of those things I dont think I would be too happy but in the programming world &#8221;Man, I am an idiot&#8221; is one of the things I like to hear most&#8230;</p>
<p>Today my team and I were plugging away, coding up a storm. We have some upcoming deadlines so we are all in crunch mode. The problem is that if I have done a ton of work that is all on a  related task, I begin to make stupid errors. I dont know if that is normal but I need to mix up my tasks. A little of programming, a little of building gui forms, database work or whatever else needs to be done.</p>
<p>Anyways, what got me thinking about this is that today I had to give a hand to two friends that were having problems that they couldn&#8217;t figure out in their code. It never hurts to have someone else take a glace at your simple mistakes, the same two friends helped me figure out a problem in 5 minutes that stumped me for an hour. So for each friend, I go over, looking over their shoulder as we step through the program. I offer some advice or suggestions where I think the bug may be hiding and leave them to get it. Lo and behold, after 5-10 minutes after I left each of them I hear one of my favourite programming phrases: &#8220;Man, I am an idiot.&#8221; </p>
<p>I am not saying I found their problem but sometimes when we explain our code to other we read parts of it that you think are 100% fine and wouldnt think to check it yourself. I myself have yelled many a &#8220;Man, I am an idiot&#8221; to whoever is in earshot when I have a eureka moment. I love the feeling of overcoming a seemingly insurmountable error in ones software that turns out to be something a new programmer could spot. So today was a good day, alot was accomplished and issues were resolved. I hope to have more &#8220;Man, I am an idiot&#8221; moments soon as there are still alot of bugs <img src='http://blog.markstahler.ca/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>What is your best &#8221;Man, I am an idiot&#8221; moment?</p>
<p>P.S. The errors in the software I believe were that a regular expression wasnt being matched properly because of a missing escape character and the other had a simple SubSonic/SQL query problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.markstahler.ca/2009/01/the-beautiful-phrase-man-i-am-an-idiot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Log4net app.config with console and file logging</title>
		<link>http://blog.markstahler.ca/2008/12/log4net-appconfig-with-console-and-file-loggin/</link>
		<comments>http://blog.markstahler.ca/2008/12/log4net-appconfig-with-console-and-file-loggin/#comments</comments>
		<pubDate>Wed, 03 Dec 2008 01:31:59 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Final University Project]]></category>

		<guid isPermaLink="false">http://www.markstahler.ca/?p=5</guid>
		<description><![CDATA[Here is a quick example .config of log4net that does basic logging to the console and to a text file. I found a great tutorial outlining the config here but it didnt have a full example anywhere from what I found. &#60;?xml version="1.0" encoding="utf-8" ?&#62; &#60;configuration&#62;     &#60;userSettings&#62;        &#60;!—My project application settings --&#62;         [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a quick example .config of log4net that does basic logging to the console and to a text file. I found a great tutorial outlining the config <a href="http://www.beefycode.com/post/Log4Net-Tutorial-pt-1-Getting-Started.aspx">here</a> but it didnt have a full example anywhere from what I found.<span id="more-5"></span></p>
<pre name="code" class="xml">

&lt;?xml version="1.0" encoding="utf-8" ?&gt;
&lt;configuration&gt;
    &lt;userSettings&gt;
       &lt;!—My project application settings --&gt;
        &lt;/Client.Properties.Settings&gt;
        &lt;log4net&gt;
          &lt;appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender"&gt;
            &lt;target value="Console.Error" /&gt;
            &lt;layout type="log4net.Layout.SimpleLayout" /&gt;
          &lt;/appender&gt;
          &lt;appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender"&gt;
            &lt;file value="log.txt" /&gt;
            &lt;appendToFile value="true" /&gt;
            &lt;rollingStyle value="Size" /&gt;
            &lt;maxSizeRollBackups value="10" /&gt;
            &lt;maximumFileSize value="1MB" /&gt;
            &lt;staticLogFileName value="true" /&gt;
            &lt;layout type="log4net.Layout.SimpleLayout" /&gt;
          &lt;/appender&gt;
          &lt;root&gt;
            &lt;level value="ALL" /&gt;
            &lt;appender-ref ref="ConsoleAppender" /&gt;
            &lt;appender-ref ref="RollingFileAppender" /&gt;
          &lt;/root&gt;
        &lt;/log4net&gt;
    &lt;/userSettings&gt;
&lt;!—My WCF binding settings were in here --&gt;
&lt;/configuration&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.markstahler.ca/2008/12/log4net-appconfig-with-console-and-file-loggin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
