<?xml version="1.0" encoding="UTF-8"?>
<rss 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/" version="2.0">

<channel>
	<title>As Yet Unclassified</title>
	
	<link>http://benatkin.com/weblog</link>
	<description>Ben Atkin's random thoughts on software development</description>
	<lastBuildDate>Thu, 25 Feb 2010 19:54:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/benatkin" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="benatkin" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Django: Foreign Keys and Coupling</title>
		<link>http://benatkin.com/weblog/2010/02/25/django-foreign-keys-and-coupling/</link>
		<comments>http://benatkin.com/weblog/2010/02/25/django-foreign-keys-and-coupling/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 19:51:21 +0000</pubDate>
		<dc:creator>bmabma</dc:creator>
				<category><![CDATA[uncategorized]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://benatkin.com/weblog/?p=478</guid>
		<description><![CDATA[I have a django project that currently has two apps: one that contains the data for a directory site, and one that provides support functionality for importing the data in the directory site. I want them to be loosely coupled. The support app should be driving the data app. The data app, and its models, [...]]]></description>
			<content:encoded><![CDATA[<p>I have a django project that currently has two apps: one that contains the data for a directory site, and one that provides support functionality for importing the data in the directory site. I want them to be loosely coupled. The support app should be driving the data app. The data app, and its models, shouldn&#8217;t be driving the support app.</p>
<p>A problem I ran into is this: I want a record of an import to remain, even if the imported record is deleted. But, since I used a ForeignKey, and Django has cascading deletes, the record of the import would be deleted. I searched for a way to turn off this behavior, and found two options:</p>
<ul>
<li>Clear the ForeignKey reference to the imported record in the record of the import before deleting the imported record</li>
<li>Use a ManyToManyField instead</li>
</ul>
<p>At first, I used the first option. I saw the second option, but skipped it because it seemed overkill. Something didn&#8217;t sit well with having to clear a field before deleting, though. So, weeks later, I searched again, and was reminded of the ManyToManyField option.</p>
<p>The ManyToManyField option is a trade-off. On one hand, it fixes my coupling issues. On the other hand, it adds an extra table to my support class, and is overkill for something that only needs zero or one instances of the model associated with it. In this case, I chose the ManyToManyField option.</p>
<p>I&#8217;m quite happy with my new choice, and I think I might have chose it earlier if I hadn&#8217;t immediately discounted one approach and listed the pros and cons of each approach first.</p>
]]></content:encoded>
			<wfw:commentRss>http://benatkin.com/weblog/2010/02/25/django-foreign-keys-and-coupling/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>vim: change current directory</title>
		<link>http://benatkin.com/weblog/2010/01/14/vim-change-current-directory/</link>
		<comments>http://benatkin.com/weblog/2010/01/14/vim-change-current-directory/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 16:18:37 +0000</pubDate>
		<dc:creator>bmabma</dc:creator>
				<category><![CDATA[uncategorized]]></category>
		<category><![CDATA[editors]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://benatkin.com/weblog/?p=470</guid>
		<description><![CDATA[I like using the excellent FuzzyFinder plugin for vim. It&#8217;s usefulness is heavily dependent on keeping the current directory what I want, though, because otherwise I could do a lot of drilling. I found that I needed a better way of changing directories. What I wanted most of the time was a way to change [...]]]></description>
			<content:encoded><![CDATA[<p>I like using the excellent <a href="http://www.vim.org/scripts/script.php?script_id=1984">FuzzyFinder</a> plugin for vim. It&#8217;s usefulness is heavily dependent on keeping the current directory what I want, though, because otherwise I could do a lot of drilling. I found that I needed a better way of changing directories. What I wanted most of the time was a way to change to the directory of the current file.</p>
<p>I found this while searching for a way to switch to the current directory. I&#8217;m not sure whether I picked the same mapping as the author.</p>
<pre class="prettyprint" style="border: none">map ,C :cd %:p:h&lt;CR&gt;</pre>
<p>Admittedly, I&#8217;m not sure where the :p:h comes from, but it works well. A couple of months after I found this, I made a second mapping for lcd. Additionally, because I want to lcd to the current directory more often, I made <em>lcd</em> the more convenient remapping.</p>
<pre class="prettyprint" style="border: none">map ,c :lcd %:p:h&lt;CR&gt;
map ,C :cd %:p:h&lt;CR&gt;</pre>
<p>A word about <em>lcd</em>: it changes the directory for the current window, not the current buffer. This sounded obvious to me after I figured it out, but prior to then I thought it was tied to the buffer it&#8217;s invoked on and buffers spawned from that buffer.</p>
<p>Another thing I&#8217;d like to learn is how to change to the global directory when a local directory is set (or remove the current local directory).</p>
]]></content:encoded>
			<wfw:commentRss>http://benatkin.com/weblog/2010/01/14/vim-change-current-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>setting up a default virtualenv</title>
		<link>http://benatkin.com/weblog/2009/12/09/setting-up-a-default-virtualenv/</link>
		<comments>http://benatkin.com/weblog/2009/12/09/setting-up-a-default-virtualenv/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 01:11:47 +0000</pubDate>
		<dc:creator>bmabma</dc:creator>
				<category><![CDATA[uncategorized]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[prompt]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[virtualenv]]></category>

		<guid isPermaLink="false">http://benatkin.com/weblog/?p=464</guid>
		<description><![CDATA[After using virtualenv for months, I finally got around to putting my main virtualenv into my bash profile. It&#8217;s really simple. All I had to do was add the following to ~/.bash_profile:
# python virtualenv
source /Users/ben/virtualenv/pearl/bin/activate
This worked, but there was one thing I wanted to turn off. The activate script that virtualenv creates adds the name [...]]]></description>
			<content:encoded><![CDATA[<p>After using <a href="http://pypi.python.org/pypi/virtualenv">virtualenv</a> for months, I finally got around to putting my main virtualenv into my bash profile. It&#8217;s really simple. All I had to do was add the following to ~/.bash_profile:</p>
<p><code># python virtualenv<br />
source /Users/ben/virtualenv/pearl/bin/activate</code></p>
<p>This worked, but there was one thing I wanted to turn off. The <em>activate</em> script that virtualenv creates adds the name of the current virtualenv to the front of the prompt. This is useful when switching between virtualenv directories, but it&#8217;s not very useful to me when I&#8217;m on the default virtualenv. So I moved my prompt definition to the bottom of the file, so it gets executed after the <em>source</em> command above.</p>
<p><code># prompt (moved after virtualenv so it isn't shown)<br />
PS1="\[\e[31;40m\]\@ \[\e[32;40m\]\w \[\e[36;40m\]\$\[\e[0m\] "</code></p>
<p>By the way, to keep the prompt I use the most often short, I set my own colors. It&#8217;s easy for me to tell that it&#8217;s my main shell, and since it&#8217;s my main shell, I know the username and hostname associated with it.</p>
]]></content:encoded>
			<wfw:commentRss>http://benatkin.com/weblog/2009/12/09/setting-up-a-default-virtualenv/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>define: savvy savvy</title>
		<link>http://benatkin.com/weblog/2009/11/25/define-savvy-savvy/</link>
		<comments>http://benatkin.com/weblog/2009/11/25/define-savvy-savvy/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 23:54:53 +0000</pubDate>
		<dc:creator>bmabma</dc:creator>
				<category><![CDATA[uncategorized]]></category>
		<category><![CDATA[community]]></category>
		<category><![CDATA[wordplay]]></category>

		<guid isPermaLink="false">http://benatkin.com/weblog/?p=456</guid>
		<description><![CDATA[From my drafts folder, originally written 2009-08-19:
savvy savvy n. People who are savvy about identifying savvy people and imitating them.
The savvy savvy are killing Hacker News.
]]></description>
			<content:encoded><![CDATA[<p>From my drafts folder, originally written 2009-08-19:</p>
<p><strong>savvy savvy</strong> <em>n.</em> People who are savvy about identifying savvy people and imitating them.</p>
<p><em>The savvy savvy are killing Hacker News.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://benatkin.com/weblog/2009/11/25/define-savvy-savvy/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>jQuery UI widgets</title>
		<link>http://benatkin.com/weblog/2009/09/08/jquery-ui-widgets/</link>
		<comments>http://benatkin.com/weblog/2009/09/08/jquery-ui-widgets/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 04:17:52 +0000</pubDate>
		<dc:creator>bmabma</dc:creator>
				<category><![CDATA[uncategorized]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://benatkin.com/weblog/?p=459</guid>
		<description><![CDATA[JavaScript is a prototyping programming language, and as such, has many different ways to define classes or create objects. If you try to search for a tutorial on object-oriented programming in JavaScript, you&#8217;ll find that each tutorial has its own way of doing things. It can be very confusing.
Fortunately, jQuery UI has a widget framework, [...]]]></description>
			<content:encoded><![CDATA[<p>JavaScript is a prototyping programming language, and as such, has many different ways to define classes or create objects. If you try to search for a tutorial on object-oriented programming in JavaScript, you&#8217;ll find that each tutorial has its own way of doing things. It can be very confusing.</p>
<p>Fortunately, jQuery UI has a widget framework, that makes setting up object-oriented widgets easy. After using it, I wanted to use it for everything, until I find something at least as easy to use as it. I didn&#8217;t, however, want to include a large dependency like jQuery UI if I was only using it for its widget framework.</p>
<p>I was glad to find, after a little experimentation with the Build Your Download page, that I can get jQuery UI&#8217;s widget framework in a download of only 9.06 kb minified. You can get this by clicking Deselect All and checking UI Core. After that, the theme drop-down box should be set to No Theme.</p>
<p>I made a geocoding widget for Django in a project for a client using this. It simplified my code a great deal.</p>
<p>One thing it does that&#8217;s good for projects that might have a lot of custom widgets on one page (which was not the case for this one) is it takes care of using jQuery&#8217;s data() method, which stores objects in a way that is less likely to cause memory leak issues in Internet Explorer than storing objects using closures.</p>
]]></content:encoded>
			<wfw:commentRss>http://benatkin.com/weblog/2009/09/08/jquery-ui-widgets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>That’s it?!!</title>
		<link>http://benatkin.com/weblog/2009/08/09/thats-it/</link>
		<comments>http://benatkin.com/weblog/2009/08/09/thats-it/#comments</comments>
		<pubDate>Sun, 09 Aug 2009 19:26:27 +0000</pubDate>
		<dc:creator>bmabma</dc:creator>
				<category><![CDATA[uncategorized]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://benatkin.com/weblog/?p=450</guid>
		<description><![CDATA[How do you react when you find out that a lot of grief could have been prevented by something as simple as maintaining a to-do list? Or following or not following a piece of advice from a friend or colleague? Or doing a little bit more or less yak-shaving? Or taking a break when you [...]]]></description>
			<content:encoded><![CDATA[<p>How do you react when you find out that a lot of grief could have been prevented by something as simple as maintaining a to-do list? Or following or not following a piece of advice from a friend or colleague? Or doing a little bit more or less <a href="http://catb.org/jargon/html/Y/yak-shaving.html">yak-shaving</a>? Or taking a break when you need one? Or paying closer attention to Object-Oriented Design?</p>
<p>Are you happy for the learning experience, or do you get angry at yourself because it&#8217;s something you should have already learned?</p>
<p>While self-anger can drive a person to change, I think it&#8217;s important for programmers to be able to take a step back when it gets to be too much. After all, every passionate programmer knows enough to be successful beyond his or her wildest dreams. Execution is the tricky part.</p>
]]></content:encoded>
			<wfw:commentRss>http://benatkin.com/weblog/2009/08/09/thats-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>temporarily making my twitter account private</title>
		<link>http://benatkin.com/weblog/2009/07/21/temporarily-making-my-twitter-account-private/</link>
		<comments>http://benatkin.com/weblog/2009/07/21/temporarily-making-my-twitter-account-private/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 03:59:27 +0000</pubDate>
		<dc:creator>bmabma</dc:creator>
				<category><![CDATA[uncategorized]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[social media]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://benatkin.com/weblog/?p=440</guid>
		<description><![CDATA[I&#8217;ve talked a lot about it, but I still haven&#8217;t taken a proper twitter break. I took a break for about a week. Toward the end of the break, I didn&#8217;t think about twitter a whole lot, but I still thought about it. It&#8217;s quite a habit.
Making it take a couple of steps to check [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve talked a lot about it, but I still haven&#8217;t taken a proper twitter break. I took a break for about a week. Toward the end of the break, I didn&#8217;t think about twitter a whole lot, but I still thought about it. It&#8217;s quite a habit.</p>
<p>Making it take a couple of steps to check my twitter account wasn&#8217;t enough, so I&#8217;m going to try something else—making my twitter account private. One reason for logging back into my twitter account after such a short amount of time was to replace the current tweets on my twitter profile with fresh ones. Now my twitter profile can only be seen by those whom I follow, so that won&#8217;t be such a concern this time.</p>
<p>I made it clear in my twitter profile that I&#8217;m taking a break from twitter and will still be reading my DM&#8217;s. Hopefully people won&#8217;t worry about me this time like a few did when I abruptly deleted my twitter account last October.</p>
<p>So, why has twitter been such a problem for me? I think a big part of it is that I&#8217;m not in control of my experience. If I was in charge, I would make my twitter account purely a microblog. People couldn&#8217;t see who I was subscribed to. I would also change how I manage users and filter and aggregate my feeds. This latter part I can change by writing my own twitter account, which is something I might do at some point.</p>
]]></content:encoded>
			<wfw:commentRss>http://benatkin.com/weblog/2009/07/21/temporarily-making-my-twitter-account-private/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title />
		<link>http://benatkin.com/weblog/2009/07/16/438/</link>
		<comments>http://benatkin.com/weblog/2009/07/16/438/#comments</comments>
		<pubDate>Thu, 16 Jul 2009 23:24:54 +0000</pubDate>
		<dc:creator>bmabma</dc:creator>
				<category><![CDATA[uncategorized]]></category>
		<category><![CDATA[graphics programming]]></category>
		<category><![CDATA[microblog]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://benatkin.com/weblog/?p=438</guid>
		<description><![CDATA[I&#8217;m going to experiment with doing microblog summaries and putting content in a directory. For now I&#8217;m putting them on twitter tagged with #blog, copying the content, and expanding them just a bit. The full articles will simply be directories containing an index.php or index.html file. That way I can play around with the layout [...]]]></description>
			<content:encoded><![CDATA[<p><i>I&#8217;m going to experiment with doing microblog summaries and putting content in a directory. For now I&#8217;m putting them on twitter tagged with #blog, copying the content, and expanding them just a bit. The full articles will simply be directories containing an index.php or index.html file. That way I can play around with the layout of individual posts, or make the pages dirt simple if I so desire.</i></p>
<p><a href="http://benatkin.com/slimtimer-fluid-icon/"><span style="font-size: 140%">Image editing with php &#038; GD is simple and fun. I removed text from a SlimTimer Fluid icon I found on flickr with it.</span></a></p>
]]></content:encoded>
			<wfw:commentRss>http://benatkin.com/weblog/2009/07/16/438/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Do you read your own diary?</title>
		<link>http://benatkin.com/weblog/2009/07/02/do-you-read-your-diary/</link>
		<comments>http://benatkin.com/weblog/2009/07/02/do-you-read-your-diary/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 07:35:44 +0000</pubDate>
		<dc:creator>bmabma</dc:creator>
				<category><![CDATA[uncategorized]]></category>
		<category><![CDATA[diary]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[self-improvement]]></category>

		<guid isPermaLink="false">http://benatkin.com/weblog/?p=428</guid>
		<description><![CDATA[I&#8217;ve been blogging for a few years now. Over the last few months, I&#8217;ve been keeping private notes regularly. I haven&#8217;t been returning to them much after I&#8217;ve written them.
Today I realized that twitter has been a bigger distraction for me than ever after many attempts to deal with it. So I stopped checking it. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been blogging for a few years now. Over the last few months, I&#8217;ve been keeping private notes regularly. I haven&#8217;t been returning to them much after I&#8217;ve written them.</p>
<p>Today I realized that twitter has been a bigger distraction for me than ever after many attempts to deal with it. So I stopped checking it. I was more productive at work today than I&#8217;ve been in months.</p>
<p>After thinking about it, I remembered that I&#8217;ve blogged about various ideas I&#8217;ve had for dealing with twitter productivity problems. I wonder if I would have come to the realization sooner if I made a habit of reading my own blog posts?</p>
<p>I also have a lot of ideas jotted down over the last few months that I haven&#8217;t returned to. I&#8217;m busy right now, but when I get a chance I think I&#8217;ll take a peek.</p>
]]></content:encoded>
			<wfw:commentRss>http://benatkin.com/weblog/2009/07/02/do-you-read-your-diary/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Importance of Play</title>
		<link>http://benatkin.com/weblog/2009/07/02/the-importance-of-play/</link>
		<comments>http://benatkin.com/weblog/2009/07/02/the-importance-of-play/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 07:29:30 +0000</pubDate>
		<dc:creator>bmabma</dc:creator>
				<category><![CDATA[uncategorized]]></category>

		<guid isPermaLink="false">http://benatkin.com/weblog/?p=426</guid>
		<description><![CDATA[A blog post by Heather Herr reminded me of this inspiring TED talk:

Another reminder to learn a language, an instrument, a style of dance, or a sport.
]]></description>
			<content:encoded><![CDATA[<p>A <a href="http://msherrwhenonline.com/2009/04/26/play-school/">blog post</a> by <a href="http://msherrwhenonline.com/">Heather Herr</a> reminded me of this <a href="http://www.ted.com/talks/stuart_brown_says_play_is_more_than_fun_it_s_vital.html">inspiring TED talk</a>:</p>
<p><object width="334" height="326"><param name="movie" value="http://video.ted.com/assets/player/swf/EmbedPlayer.swf"></param><param name="allowFullScreen" value="true" /><param name="wmode" value="transparent"></param><param name="bgColor" value="#ffffff"></param><param name="flashvars" value="vu=http://video.ted.com/talks/embed/StuartBrown_2008P-embed-PARTNER_high.flv&#038;su=http://images.ted.com/images/ted/tedindex/embed-posters/StuartBrown-2008P.embed_thumbnail.jpg&#038;vw=320&#038;vh=240&#038;ap=0&#038;ti=483" /><embed src="http://video.ted.com/assets/player/swf/EmbedPlayer.swf" pluginspace="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" bgColor="#ffffff" width="334" height="326" allowFullScreen="true" flashvars="vu=http://video.ted.com/talks/embed/StuartBrown_2008P-embed-PARTNER_high.flv&#038;su=http://images.ted.com/images/ted/tedindex/embed-posters/StuartBrown-2008P.embed_thumbnail.jpg&#038;vw=320&#038;vh=240&#038;ap=0&#038;ti=483"></embed></object></p>
<p>Another reminder to learn a language, an instrument, a style of dance, or a sport.</p>
]]></content:encoded>
			<wfw:commentRss>http://benatkin.com/weblog/2009/07/02/the-importance-of-play/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
