<?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>jonezy.org &#187; programming</title>
	<atom:link href="http://www.jonezy.org/blog/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jonezy.org/blog</link>
	<description>me and you and everyone we know</description>
	<lastBuildDate>Wed, 27 Jan 2010 03:58:06 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Connecting to different database on the fly using Subsonic 2.x</title>
		<link></link>
		<comments>http://www.jonezy.org/blog/2009/11/03/connecting-to-different-database-on-the-fly-using-subsonic-2-x/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 12:18:13 +0000</pubDate>
		<dc:creator>jonezy</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://www.jonezy.org/blog/?p=312</guid>
		<description><![CDATA[Recently I started working on a project at work that requires me to connect to more then a single database at a time (different parts of the app connecting to different databases at the same time).  I figured this should be pretty straight forward, Subsonic is relatively mature and should probably support this out [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I started working on a project at work that requires me to connect to more then a single database at a time (different parts of the app connecting to different databases at the same time).  I figured this should be pretty straight forward, <a href="http://subsonicjproject.com" target="_blank">Subsonic</a> is relatively mature and should probably support this out of the box.</p>
<p>It doesn&#8217;t.</p>
<p>After figuring out that there was no simple easy solution for this, the next logical step was to start <a href="http://www.google.com" target="_blank">googling</a> for answers right?  Obviously.  Off I went, finding little bits and pieces here and there, never the complete solution though, I thought I had a solution and my app worked for a couple of weeks until all of a sudden one day I could no longer connect to more than a single database!  FML as they say!</p>
<p>I happened to stumble on this<a href="http://stackoverflow.com/questions/968391/subsonic-dynamic-connections" target="_blank"> stackoverflow</a> post that sort of addressed my issue, it gave some of the pieces of the solution, but I had to piece the rest of it together myself.  After finally fixing my problem I give to you, dear reader, my solution.</p>
<p>Note: this post assumes that you have used subsonic, are fairly well versed in using it and have had the exact same problem as me.</p>
<p>1. Generate you DAL as normal using whatever method you like (i write a batch file to generate mine)</p>
<p>2. Create a file called whatever and place it in your subsonic project with this<a href="http://snipt.org/nHg" target="_blank"> code in it</a> (links to snipt.org, i&#8217;m straight copying and pasting my file, so change your namespaces and all that business).</p>
<p>3. Create a base class that all of your data access classes will inherit from (I call my RepositoryBase.cs)</p>
<p>4. Have the repository classes accept a connection string as part of the constructor, and pass it on to the base class.</p>
<p>5. In the base class, call the static method in the file you created in step 2 like so:</p>
<p>SSPProvider.SetProvider(&#8221;ConnectionStringName&#8221;, &#8220;ConnectionString&#8221;);</p>
<p>6. All of your subsonic related code will now use whatever connection string you passed to the SetProvider method.</p>
<p>7. ???</p>
<p>8. Profit?</p>
<p>Not so sure about the profit thing, but the code to switch databases works like a charm.</p>
<p>If there is interest I can post a more complete example but this should get you going for now.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonezy.org/blog/2009/11/03/connecting-to-different-database-on-the-fly-using-subsonic-2-x/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>subsonic won&#8217;t update my bit field?</title>
		<link></link>
		<comments>http://www.jonezy.org/blog/2009/10/28/subsonic-wont-update-my-bit-field/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 18:10:54 +0000</pubDate>
		<dc:creator>jonezy</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[SubSonic]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://www.jonezy.org/blog/?p=354</guid>
		<description><![CDATA[I recently ran into a really strange problem while using SubSonic.  I had a bit column in my database that was set to not allow nulls and had a default value of false.  Pretty standard stuff in the world of database design I guess.
When it came time to start saving my entities to the database, [...]]]></description>
			<content:encoded><![CDATA[<p>I recently ran into a really strange problem while using <a href="http://www.subsonicproject.com" target="_blank">SubSonic</a>.  I had a bit column in my database that was set to not allow nulls and had a default value of false.  Pretty standard stuff in the world of database design I guess.</p>
<p>When it came time to start saving my entities to the database, everything was working ok, except&#8230;. except after I had created a record in the database I could never change the IsActive column, like wtf?  I could never toggle between true and false on an existing record, but an insert would save the record perfectly every time.</p>
<p>To make a long incredibly frustrating story short, it turns out that if you have a bit field, that is set to allow nulls and has a default value of false it will never update (this is only using <a href="http://www.subsonicproject.com" target="_blank">SubSonic</a>).</p>
<p>So to ensure your bit fields work correctly in <a href="http://www.subsonicproject.com" target="_blank">SubSonic</a>, make sure those bit columns allow null and don&#8217;t have any default values!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonezy.org/blog/2009/10/28/subsonic-wont-update-my-bit-field/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>xcopy won&#8217;t copy .css files</title>
		<link></link>
		<comments>http://www.jonezy.org/blog/2009/10/20/xcopy-wont-copy-css-files/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 14:58:50 +0000</pubDate>
		<dc:creator>jonezy</dc:creator>
				<category><![CDATA[agile]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://www.jonezy.org/blog/?p=350</guid>
		<description><![CDATA[I use xcopy as part of a build script to copy a bunch of files and directories from a subversion checkout directory to another directory so that I can zip them and upload them to a server.
I have an exclude file that I use to tell xcopy to ignore files like the obj directory and [...]]]></description>
			<content:encoded><![CDATA[<p>I use xcopy as part of a build script to copy a bunch of files and directories from a subversion checkout directory to another directory so that I can zip them and upload them to a server.</p>
<p>I have an exclude file that I use to tell xcopy to ignore files like the obj directory and .cs codebehind files.  I noticed that none of my .ascx and .css files were being copied?!  Turns out the .cs entry in my excludes list was causing those other files that had .cs in the extension not to get copied.</p>
<p>The solution?  Add a backslash to the end of the .cs entry so it looks like this:</p>
<p>.cs\</p>
<p>All your other files with .cs in the extension will now get copied.</p>
<p>Hope this helped someone!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonezy.org/blog/2009/10/20/xcopy-wont-copy-css-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>If your gonna fuck up, do it early</title>
		<link></link>
		<comments>http://www.jonezy.org/blog/2009/10/15/if-your-gonna-fuck-up-do-it-early/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 10:42:36 +0000</pubDate>
		<dc:creator>jonezy</dc:creator>
				<category><![CDATA[agile]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://www.jonezy.org/blog/?p=330</guid>
		<description><![CDATA[I&#8217;ve worked in the online industry for the last 12 years or so, one thing above all else I&#8217;ve learned in my time in this industry
You are going to fuck it up
Now I use the phrase &#8220;fuck it up&#8221; in place of fail for effect, for impact, ya know if this was a power point [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve worked in the online industry for the last 12 years or so, one thing above all else I&#8217;ve learned in my time in this industry</p>
<p>You are going to fuck it up</p>
<p>Now I use the phrase &#8220;fuck it up&#8221; in place of fail for effect, for impact, ya know if this was a power point there would be one whole slide dedicated to the phrase &#8220;you are going to fuck it up&#8221; yes, that lesson is that important.</p>
<p>Now you might think what a great way to instantly ruin any project!  So what your telling me Chris is no matter what, I&#8217;m going to fuck this project I&#8217;m about to start working on up?</p>
<p>Yes, that is what I&#8217;m telling you&#8230; But, its not the only thing that I&#8217;m going to tell you.</p>
<p>There&#8217;s an expression that&#8217;s become increasingly popular in the development world as the popularity of agile and lean development rises.</p>
<p>&#8220;Fail early, fail often&#8221;</p>
<p>It sounds so insanely wrong so anti everything you&#8217;ve ever learned doesn&#8217;t it?  Once you get over the stigma of failure you&#8217;ll quickly realize that failure isn&#8217;t as bad as you&#8217;ve been conditioned to perceive it.  Early failures cost less both in financial terms as well as in more personal ways that we won&#8217;t touch on here.</p>
<p>The concept of fail early, fail often is wonderfully summed up (quote stolen from codinghorror.com)</p>
<p><strong>Learning doesn&#8217;t happen from failure itself but rather from analyzing the failure, making a change, and then trying again. Over time this gives you a deep understanding of the problem domain. </strong>(Michael Hunter on <a href="http://blogs.msdn.com/micahel/archive/2005/08/17/FailFast.aspx" target="_blank">fail early and often</a>)</p>
<p>I sum it up a bit differently: <strong>&#8220;The only real failures are ones that you don&#8217;t learn from&#8221;</strong></p>
<p>So go out there dev&#8217;s and fail away, not only are you going to understand more about the stuff your working on, but you&#8217;ll likely discover more about yourself and the people around you as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonezy.org/blog/2009/10/15/if-your-gonna-fuck-up-do-it-early/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building new features makes sense!</title>
		<link></link>
		<comments>http://www.jonezy.org/blog/2009/10/13/building-new-features-makes-sense/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 16:11:39 +0000</pubDate>
		<dc:creator>jonezy</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[work]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.jonezy.org/blog/?p=334</guid>
		<description><![CDATA[But spending an insane amount of time upfront without ever having tested or planning said feature doesn&#8217;t make sense at all.
If you are going to spend time working on new features, don&#8217;t spend time on planning what you think might work.  Build something quickly and let your users decide on how it should work.
You [...]]]></description>
			<content:encoded><![CDATA[<p>But spending an insane amount of time upfront without ever having tested or planning said feature doesn&#8217;t make sense at all.</p>
<p>If you are going to spend time working on new features, don&#8217;t spend time on planning what you think might work.  Build something quickly and let your users decide on how it should work.</p>
<p>You might think you know how it should work, but chances are you don&#8217;t.</p>
<p>Make it so it&#8217;s good enough, release it, get feedback and repeat.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonezy.org/blog/2009/10/13/building-new-features-makes-sense/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP Menu controls aren&#8217;t rendering correctly in google chrome</title>
		<link></link>
		<comments>http://www.jonezy.org/blog/2009/09/29/asp-menu-controls-arent-rendering-correctly-in-google-chrome/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 13:52:36 +0000</pubDate>
		<dc:creator>jonezy</dc:creator>
				<category><![CDATA[c#]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[personal]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://www.jonezy.org/blog/?p=322</guid>
		<description><![CDATA[&#8220;ASP Menu controls aren&#8217;t rendering correctly in google chrome&#8221;
I did a search for this exact phrase about a month ago to solve a quirky problem that I encountered while using the built in asp:menu control that was introduced with version 2.0 of the framework.
I could go into a long explanation of how difficult it was [...]]]></description>
			<content:encoded><![CDATA[<p><em>&#8220;ASP Menu controls aren&#8217;t rendering correctly in google chrome&#8221;</em></p>
<p>I did a search for this exact phrase about a month ago to solve a quirky problem that I encountered while using the built in asp:menu control that was introduced with version 2.0 of the framework.</p>
<p>I could go into a long explanation of how difficult it was to find the solution to my problem but instead of doing that I am simply going to give you the solution, that&#8217;s all I wanted when I went searching and it took a long time to get it so here dear reader is the solution for you.</p>
<p>To the asp:Menu control render correctly in chrome (or safari) paste the following bit of code in your Page_Load event on every page that you use the control</p>
<pre>        if (Request.UserAgent.IndexOf("AppleWebKit") &gt; 0)
            Request.Browser.Adapters.Clear();</pre>
<p><a href="http://snipt.org/nTh" target="_blank">or grab it on snipt.org</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonezy.org/blog/2009/09/29/asp-menu-controls-arent-rendering-correctly-in-google-chrome/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

