<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>mindless technology</title>
	<atom:link href="http://mindlesstechnology.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://mindlesstechnology.wordpress.com</link>
	<description>my mindless musings on modern machinery</description>
	<lastBuildDate>Mon, 23 Jan 2012 01:48:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='mindlesstechnology.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>mindless technology</title>
		<link>http://mindlesstechnology.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://mindlesstechnology.wordpress.com/osd.xml" title="mindless technology" />
	<atom:link rel='hub' href='http://mindlesstechnology.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Get a random subsequence of elements</title>
		<link>http://mindlesstechnology.wordpress.com/2011/01/16/get-a-random-subsequence-of-elements/</link>
		<comments>http://mindlesstechnology.wordpress.com/2011/01/16/get-a-random-subsequence-of-elements/#comments</comments>
		<pubDate>Sun, 16 Jan 2011 21:11:40 +0000</pubDate>
		<dc:creator>Seth</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[math]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://mindlesstechnology.wordpress.com/?p=364</guid>
		<description><![CDATA[Here's a bit of code to create a sequence of random elements of a desired length, initialized from another sequence.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mindlesstechnology.wordpress.com&amp;blog=2886517&amp;post=364&amp;subd=mindlesstechnology&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a bit of code to create a sequence of random elements of a desired length, initialized from another sequence.</p>
<p><pre class="brush: python;">
import random

def random_generator(low, high, count): 
    &quot;&quot;&quot;Get a generator to return count random numbers between low and high.&quot;&quot;&quot;
    while count &amp;gt; 0:
        yield random.randint(low, high)
        count -= 1

def random_subsequence(sequence, count, start=0, end=None):
    &quot;&quot;&quot;Choose count elements from the sequence, optionally restricted between 
    start and end.
    &quot;&quot;&quot;
    if not end or end &amp;gt; len(sequence) - 1:
        end = len(sequence) - 1

    return (sequence[r] for r in random_generator(start, end, count))

if __name__ == &quot;__main__&quot;:
    sequence = [2, 3, 5, 7, 11, 13, 17, 19, 23, 27, 29]
    four_primes = random_subsequence(sequence, 4)
    two_big_primes = random_subsequence(sequence, 2, len(sequence)/2)

    print &quot;Four primes:&quot;, list(four_primes)
    print &quot;Two big primes:&quot;, list(two_big_primes)
</pre></p>
<p>Notes: This is similar to the library random.sample() method, except if count is greater than or equal to len(sequence), you can produce &#8220;sub&#8221; sequences which are longer than the original sequence. </p>
<p>This works equally well with strings or any other subscriptable object (like xrange). </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mindlesstechnology.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mindlesstechnology.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mindlesstechnology.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mindlesstechnology.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mindlesstechnology.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mindlesstechnology.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mindlesstechnology.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mindlesstechnology.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mindlesstechnology.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mindlesstechnology.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mindlesstechnology.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mindlesstechnology.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mindlesstechnology.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mindlesstechnology.wordpress.com/364/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mindlesstechnology.wordpress.com&amp;blog=2886517&amp;post=364&amp;subd=mindlesstechnology&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mindlesstechnology.wordpress.com/2011/01/16/get-a-random-subsequence-of-elements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5ad057107bf330ce298dc878e949ceab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">- S -</media:title>
		</media:content>
	</item>
		<item>
		<title>Source code clip of the day</title>
		<link>http://mindlesstechnology.wordpress.com/2010/07/19/source-code-clip-of-the-day/</link>
		<comments>http://mindlesstechnology.wordpress.com/2010/07/19/source-code-clip-of-the-day/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 21:33:36 +0000</pubDate>
		<dc:creator>Seth</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://mindlesstechnology.wordpress.com/?p=354</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mindlesstechnology.wordpress.com&amp;blog=2886517&amp;post=354&amp;subd=mindlesstechnology&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><pre class="brush: csharp;">
private static void Main(string[] args)
{
    options = new Options(args);
    if (options.Help)
    {
        // TODO: Write help
        return;
    }

    ...
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mindlesstechnology.wordpress.com/354/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mindlesstechnology.wordpress.com/354/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mindlesstechnology.wordpress.com/354/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mindlesstechnology.wordpress.com/354/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mindlesstechnology.wordpress.com/354/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mindlesstechnology.wordpress.com/354/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mindlesstechnology.wordpress.com/354/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mindlesstechnology.wordpress.com/354/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mindlesstechnology.wordpress.com/354/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mindlesstechnology.wordpress.com/354/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mindlesstechnology.wordpress.com/354/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mindlesstechnology.wordpress.com/354/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mindlesstechnology.wordpress.com/354/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mindlesstechnology.wordpress.com/354/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mindlesstechnology.wordpress.com&amp;blog=2886517&amp;post=354&amp;subd=mindlesstechnology&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mindlesstechnology.wordpress.com/2010/07/19/source-code-clip-of-the-day/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5ad057107bf330ce298dc878e949ceab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">- S -</media:title>
		</media:content>
	</item>
		<item>
		<title>1934 Ford Sedan, by Arcade Manufacturing Co.</title>
		<link>http://mindlesstechnology.wordpress.com/2009/11/28/1934-ford-sedan-by-arcade-manufacturing-co/</link>
		<comments>http://mindlesstechnology.wordpress.com/2009/11/28/1934-ford-sedan-by-arcade-manufacturing-co/#comments</comments>
		<pubDate>Sun, 29 Nov 2009 00:20:32 +0000</pubDate>
		<dc:creator>Seth</dc:creator>
				<category><![CDATA[Ancient Technology]]></category>
		<category><![CDATA[antiques]]></category>

		<guid isPermaLink="false">http://mindlesstechnology.wordpress.com/?p=279</guid>
		<description><![CDATA[Occasionally I sell stuff on eBay, usually antique toys. I&#8217;m excited enough about this car that I thought I&#8217;d share a few pictures of it before I put it up for auction. This car is both very hard to find and in very good condition (aside from the missing wheel).<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mindlesstechnology.wordpress.com&amp;blog=2886517&amp;post=279&amp;subd=mindlesstechnology&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Occasionally I sell stuff on eBay, usually antique toys. I&#8217;m excited enough about this car that I thought I&#8217;d share a few pictures of it before I put it up for auction. This car is both very hard to find and in very good condition (aside from the missing wheel). </p>
<p><a href="http://mindlesstechnology.files.wordpress.com/2009/11/1.jpg"><img src="http://mindlesstechnology.files.wordpress.com/2009/11/1.jpg?w=300&#038;h=224" alt="" title="1" width="300" height="224" class="alignleft size-medium wp-image-281" /></a></p>
<p><a href="http://mindlesstechnology.files.wordpress.com/2009/11/4.jpg"><img src="http://mindlesstechnology.files.wordpress.com/2009/11/4.jpg?w=300&#038;h=224" alt="" title="4" width="300" height="224" class="alignleft size-medium wp-image-282" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mindlesstechnology.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mindlesstechnology.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mindlesstechnology.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mindlesstechnology.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mindlesstechnology.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mindlesstechnology.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mindlesstechnology.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mindlesstechnology.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mindlesstechnology.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mindlesstechnology.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mindlesstechnology.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mindlesstechnology.wordpress.com/279/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mindlesstechnology.wordpress.com/279/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mindlesstechnology.wordpress.com/279/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mindlesstechnology.wordpress.com&amp;blog=2886517&amp;post=279&amp;subd=mindlesstechnology&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mindlesstechnology.wordpress.com/2009/11/28/1934-ford-sedan-by-arcade-manufacturing-co/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5ad057107bf330ce298dc878e949ceab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">- S -</media:title>
		</media:content>

		<media:content url="http://mindlesstechnology.files.wordpress.com/2009/11/1.jpg?w=300" medium="image">
			<media:title type="html">1</media:title>
		</media:content>

		<media:content url="http://mindlesstechnology.files.wordpress.com/2009/11/4.jpg?w=300" medium="image">
			<media:title type="html">4</media:title>
		</media:content>
	</item>
		<item>
		<title>&#8220;Using Relative URL Protocol Schemes&#8221; or &#8220;One Less Special Case for IE&#8221;</title>
		<link>http://mindlesstechnology.wordpress.com/2009/11/16/using-relative-url-protocol-schemes-or-one-less-special-case-for-ie/</link>
		<comments>http://mindlesstechnology.wordpress.com/2009/11/16/using-relative-url-protocol-schemes-or-one-less-special-case-for-ie/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 02:23:58 +0000</pubDate>
		<dc:creator>Seth</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://mindlesstechnology.wordpress.com/?p=264</guid>
		<description><![CDATA[So the other day I was perusing through some of the RFCs, and came across RFC 1808. It&#8217;s called &#8220;Relative Uniform Resource Locators.&#8221; Of particular interest is section 2.4.3, &#8220;Parsing the Network Location/Login,&#8221; which says something like: &#8220;Hey, remember the last time you were creating a web application that needed to run in both HTTP [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mindlesstechnology.wordpress.com&amp;blog=2886517&amp;post=264&amp;subd=mindlesstechnology&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So the other day I was perusing through some of the RFCs, and came across <a href="http://www.ietf.org/rfc/rfc1808.txt">RFC 1808</a>. It&#8217;s called &#8220;Relative Uniform Resource Locators.&#8221; Of particular interest is section 2.4.3, &#8220;Parsing the Network Location/Login,&#8221; which says something like: </p>
<p>&#8220;Hey, remember the last time you were creating a web application that needed to run in both HTTP and HTTPS? Remember how you had to write logic to detect the current request&#8217;s scheme, because you had to generate URLs as https:// when you were secure? Remember that you never thought there was a problem until Jimmy in Marketing looked at your site in Internet Explorer 5.5, and he said to your boss, &#8216;It says, &#8220;Are you sure you want to display insecure items?&#8221;, what&#8217;s that mean?&#8217; </p>
<p>Yeah, you don&#8217;t have to do that anymore.&#8221;<br />
<span id="more-264"></span></p>
<p>The problem is essentially this: </p>
<p>When you&#8217;re creating a link on a page that may be viewed securely (https://site.com/page.html), you have to change the protocol of the link to match the scheme you&#8217;re using. If you don&#8217;t, people using Internet Explorer get a dialog box in their face every time they load the page. </p>
<p>The usual method for fixing this is to add logic to your application which finds out (using various methods) whether the page is being accessed securely (https://) or insecurely (http://), and generates an appropriate prefix. You then take this prefix and stuff it in front of every generated link. </p>
<p>RFC 1808 § 2.4.3 says basically, just leave off <em>scheme:</em> from your url, and the web browser will figure it out for you. </p>
<p>Instead of writing your links like this:<br />
<code>
<pre>
    def make_url(url):
        if do_magic_to_see_if_we_are_secure():
            scheme = "https://"
        else:
            scheme = "http://"
        return scheme + url
    print make_url("site.com/page.html")
</pre>
<p></code></p>
<p>All you have to do is this:<br />
<code>
<pre>
    url = "//site.com/page.html"
</pre>
<p></code></p>
<p>Now when you go to https://site.com, your link becomes &#8220;https://site.com/page.html&#8221;.</p>
<p>When you go to http://site.com, your link becomes &#8220;http://site.com/page.html&#8221;. </p>
<p>Done. No code. One less special case for IE. </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mindlesstechnology.wordpress.com/264/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mindlesstechnology.wordpress.com/264/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mindlesstechnology.wordpress.com/264/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mindlesstechnology.wordpress.com/264/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mindlesstechnology.wordpress.com/264/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mindlesstechnology.wordpress.com/264/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mindlesstechnology.wordpress.com/264/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mindlesstechnology.wordpress.com/264/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mindlesstechnology.wordpress.com/264/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mindlesstechnology.wordpress.com/264/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mindlesstechnology.wordpress.com/264/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mindlesstechnology.wordpress.com/264/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mindlesstechnology.wordpress.com/264/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mindlesstechnology.wordpress.com/264/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mindlesstechnology.wordpress.com&amp;blog=2886517&amp;post=264&amp;subd=mindlesstechnology&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mindlesstechnology.wordpress.com/2009/11/16/using-relative-url-protocol-schemes-or-one-less-special-case-for-ie/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5ad057107bf330ce298dc878e949ceab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">- S -</media:title>
		</media:content>
	</item>
		<item>
		<title>Someone&#8217;s not thinking &#8230;</title>
		<link>http://mindlesstechnology.wordpress.com/2009/11/15/someones-not-thinking/</link>
		<comments>http://mindlesstechnology.wordpress.com/2009/11/15/someones-not-thinking/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 00:29:11 +0000</pubDate>
		<dc:creator>Seth</dc:creator>
				<category><![CDATA[Machines]]></category>

		<guid isPermaLink="false">http://mindlesstechnology.wordpress.com/?p=261</guid>
		<description><![CDATA[Ever run low on disk space? Ever try to free up disk space by deleting so-called temporary files? (After all, they&#8217;ve been abandoned by their programmer, might as well put them out of their misery.) A few weeks ago I ran into this situation on a Windows 2003 R2 Server. This is what it told [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mindlesstechnology.wordpress.com&amp;blog=2886517&amp;post=261&amp;subd=mindlesstechnology&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Ever run low on disk space? Ever try to free up disk space by deleting so-called temporary files? (After all, they&#8217;ve been abandoned by their programmer, might as well put them out of their misery.) </p>
<p>A few weeks ago I ran into this situation on a Windows 2003 R2 Server. This is what it told me:<br />
<img src="http://mindlesstechnology.files.wordpress.com/2009/11/cant-delete-cause-not-enough-free-space.png?w=620" alt="Not enough space to delete" title="Not enough space to delete"   class="alignleft size-full wp-image-260" /></p>
<p>Seriously? <span id="more-261"></span></p>
<p>In reality, I know that the filesystem has to be updated (written to) in order to delete a file. You have to mark the space that the file occupies as &#8220;available.&#8221; But really, did no one on the NTFS team consider saving a few kilobytes for emergencies? </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mindlesstechnology.wordpress.com/261/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mindlesstechnology.wordpress.com/261/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mindlesstechnology.wordpress.com/261/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mindlesstechnology.wordpress.com/261/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mindlesstechnology.wordpress.com/261/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mindlesstechnology.wordpress.com/261/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mindlesstechnology.wordpress.com/261/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mindlesstechnology.wordpress.com/261/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mindlesstechnology.wordpress.com/261/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mindlesstechnology.wordpress.com/261/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mindlesstechnology.wordpress.com/261/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mindlesstechnology.wordpress.com/261/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mindlesstechnology.wordpress.com/261/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mindlesstechnology.wordpress.com/261/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mindlesstechnology.wordpress.com&amp;blog=2886517&amp;post=261&amp;subd=mindlesstechnology&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mindlesstechnology.wordpress.com/2009/11/15/someones-not-thinking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5ad057107bf330ce298dc878e949ceab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">- S -</media:title>
		</media:content>

		<media:content url="http://mindlesstechnology.files.wordpress.com/2009/11/cant-delete-cause-not-enough-free-space.png" medium="image">
			<media:title type="html">Not enough space to delete</media:title>
		</media:content>
	</item>
		<item>
		<title>F1 help in Windows [XP] Explorer</title>
		<link>http://mindlesstechnology.wordpress.com/2009/10/18/f1-help-in-windows-xp-explorer/</link>
		<comments>http://mindlesstechnology.wordpress.com/2009/10/18/f1-help-in-windows-xp-explorer/#comments</comments>
		<pubDate>Sun, 18 Oct 2009 23:40:21 +0000</pubDate>
		<dc:creator>Seth</dc:creator>
				<category><![CDATA[Luser Tricks]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://mindlesstechnology.wordpress.com/?p=238</guid>
		<description><![CDATA[Have you ever accidentally hit the F1 key in Explorer when you meant F2 (or 1, or Esc)? Normally missing a key isn&#8217;t a big deal, but in this case F1 triggers the Windows help center. Help may be valuable sometimes (I wouldn&#8217;t know, I&#8217;ve never used it), but for me, the accidental keypress costs [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mindlesstechnology.wordpress.com&amp;blog=2886517&amp;post=238&amp;subd=mindlesstechnology&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Have you ever accidentally hit the F1 key in Explorer when you meant F2 (or 1, or Esc)? Normally missing a key isn&#8217;t a big deal, but in this case F1 triggers the Windows help center. Help may be valuable sometimes (I wouldn&#8217;t know, I&#8217;ve never used it), but for me, the accidental keypress costs me 20-30 seconds of productivity while I wait for the thing to load and close it. <span id="more-238"></span></p>
<p>Details:<br />
F1 in explorer triggers the HELPCTR.EXE program to launch. While this behavior itself isn&#8217;t (easily) configurable, you can convince Windows that HELPCTR.EXE has a different location, say &#8220;c:\windows\system32\cscript.exe&#8221;, for example. (Cscript is the program that Windows uses to run script host files. It simply quits if you run it without arguments.) </p>
<p>Open RegEdit.exe, go to HKEY_LOCAL_MACHINE \ Software \ Microsoft \ Windows \ CurrentVersion \ AppPaths. Find &#8220;HELPCTR.EXE&#8221;, and replace it&#8217;s default entry with &#8220;C:\Windows\system32\CSCRIPT.EXE&#8221;.</p>
<p>That&#8217;s it. Now in Windows Explorer, F1 effectively does nothing. </p>
<p>Side effects:<br />
1. Windows uses the AppPaths to find applications. This means that the Help Center will also stop working from the start menu. If you&#8217;re the kind of person who gets annoyed with the Help Center running on F1, you probably won&#8217;t mind that the icon in the start menu doesn&#8217;t work either. </p>
<p>2. This is a system level change (HKEY_LOCAL_MACHINE). This means that other users of your computer also will not be able to access the help center.</p>
<p>3. Use F1 as an application launcher. Just replace the path with a useful application. Pressing F1 now opens this application. </p>
<p>4. I only know that this works for sure in Windows XP. I don&#8217;t ever plan to operate a machine that has Vista, so I can&#8217;t tell you if it will work there. Same goes for Windows 7. </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mindlesstechnology.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mindlesstechnology.wordpress.com/238/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mindlesstechnology.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mindlesstechnology.wordpress.com/238/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mindlesstechnology.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mindlesstechnology.wordpress.com/238/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mindlesstechnology.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mindlesstechnology.wordpress.com/238/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mindlesstechnology.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mindlesstechnology.wordpress.com/238/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mindlesstechnology.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mindlesstechnology.wordpress.com/238/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mindlesstechnology.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mindlesstechnology.wordpress.com/238/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mindlesstechnology.wordpress.com&amp;blog=2886517&amp;post=238&amp;subd=mindlesstechnology&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mindlesstechnology.wordpress.com/2009/10/18/f1-help-in-windows-xp-explorer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5ad057107bf330ce298dc878e949ceab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">- S -</media:title>
		</media:content>
	</item>
		<item>
		<title>On the Economy of Light Bulbs</title>
		<link>http://mindlesstechnology.wordpress.com/2009/08/21/on-the-economy-of-light-bulbs/</link>
		<comments>http://mindlesstechnology.wordpress.com/2009/08/21/on-the-economy-of-light-bulbs/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 20:14:38 +0000</pubDate>
		<dc:creator>Seth</dc:creator>
				<category><![CDATA[Machines]]></category>
		<category><![CDATA[economics]]></category>

		<guid isPermaLink="false">http://mindlesstechnology.wordpress.com/?p=193</guid>
		<description><![CDATA[On May 17th, 2003, I bought this compact fluorescent light bulb for $5.99. A couple days ago it finally stopped working, ending it&#8217;s 76 month career of generating photons. I&#8217;m pretty sure this was one of the first compact fluorescent bulbs that I&#8217;ve ever bought. And, as far as I know, this has been the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mindlesstechnology.wordpress.com&amp;blog=2886517&amp;post=193&amp;subd=mindlesstechnology&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img src="http://mindlesstechnology.files.wordpress.com/2009/08/light-bulb.jpg?w=620" alt="This compact fluorescent lightbulb lasted 11,400 hours"   class="alignright size-full wp-image-197" /></p>
<p>On May 17th, 2003, I bought this compact fluorescent light bulb for $5.99. A couple days ago it finally stopped working, ending it&#8217;s 76 month career of generating photons.<span id="more-193"></span> I&#8217;m pretty sure this was one of the first compact fluorescent bulbs that I&#8217;ve ever bought. And, as far as I know, this has been the longest lasting. Over the last few years, I have purchased about 50 CFL&#8217;s. I&#8217;ve replaced every bulb in my house with CFL&#8217;s, except two or three that are infrequently used. This one I bought for full price, but my local nationwide non-independent retailer will sometimes sell CFL bulbs for 99¢ as part of some government program. </p>
<p>I was and still am a bit skeptical about CFL bulbs. Why? Well, about half of the CFL bulbs that I have bought (especially the 99¢ ones) only last about three to nine months, which is no better than an incandescent bulb. Sure, they have a &#8220;5 year warranty&#8221;, but it sure seems like an awful lot of work to get a <em>light bulb</em> replaced under warranty. Not to mention that the shipping charges for the replacement bulb are probably equal to the cost of a new one. But what really burns me up is that you can&#8217;t throw them away. Each bulb has between 1 and 5 mg of mercury in them (less than 1/10000 oz.). That doesn&#8217;t seem like much, but environmental mercury is highly toxic and already a huge problem. Each little bit that gets in the ground water quickly travels up the food chain. Those at the top of the food chain get the highest concentrations (hint: people are the top of the food chain). Last year, about 100 million CFL bulbs were sold. Those bulbs contain about 50,000 lbs. of mercury, all of which will likely be tossed in the trash. Oh, and most of them emit ultraviolet radiation. You&#8217;re probably fine if you stay more than a foot a way from the bulb. </p>
<p>I am also skeptical about power savings, and being a numbers guy, I wondered what the savings actually are. Here are the results. </p>
<table border="0" style="border-collapse:collapse;" cellpadding="4">
<col style="border-right:1px solid black;" />
<col style="border-right:1px solid #999;" />
<col />
<thead>
<tr style="border-bottom:1px solid black;">
<th>
<th>Compact Fluorescent</th>
<th>Incandescent</th>
</tr>
</thead>
<tbody>
<tr style="border-bottom:1px solid #999;">
<td>Cost</td>
<td>$5.99</td>
<td>about 50¢</td>
</tr>
<tr style="border-bottom:1px solid #999;">
<td>Power Consumption</td>
<td>20 watts</td>
<td>60 watts</td>
</tr>
<tr style="border-bottom:1px solid #999;">
<td>Operating Time</td>
<td>11,400 hours</td>
<td>about 1000 hours</td>
</tr>
<tr style="border-bottom:1px solid #999;">
<td>Total # of bulbs needed</td>
<td>1</td>
<td>about 12</td>
</tr>
<tr style="border-bottom:1px solid #999;">
<td>Total bulb cost</td>
<td>$5.99</td>
<td>50¢ * 12 = $6.00</td>
</tr>
<tr style="border-bottom:1px solid #999;">
<td>Power Used</td>
<td>20W * 11,400 hours = 228 kilowatt hours</td>
<td>60W * 11,400 hours = 684 kilowatt hours</td>
</tr>
<tr style="border-bottom:1px solid #999;">
<td>Total Operating Cost</td>
<td>228 kWh * 8.8¢ / kWh = about $20</td>
<td>684 kWh * 8.8¢ = about $60</td>
</tr>
<tr style="border-bottom:1px solid #999;">
<td>Total Cost of Ownership</td>
<td>about $26</td>
<td>about $66</td>
</tr>
</tbody>
</table>
<p><strong>Estimated Savings:</strong> about $40, about 450 kWh, and about 1000 pounds of CO<sub>2</sub>.</p>
<p>So, there you have it. Even if your CFL bulb burns out after a year, you still save about a dollar when compared with an incandescent. I have about 30 CFL light bulbs in my house. This means every year I&#8217;m saving about $100. Not bad. </p>
<p>I&#8217;m still upset about the mercury. I already trashed a number of bulbs before realizing that they all contained mercury. Now I&#8217;m just saving them in a box until I can find a recycler. </p>
<p>I look forward to LED bulbs. They aren&#8217;t made with mercury, they don&#8217;t emit ultraviolet radiation, and they use 1/4 as much power as a CFL. Unfortunately, right now they are so expensive that I would have to run one for 6 years just to break even with my $5.99 CFL bulb (9 years for a 99¢ model). And they aren&#8217;t really bright enough. Most are less than half as bright as an incandescent 60W bulb. As time goes by though, they will get less expensive and brighter. And just one LED bulb can potentially replace 100 incandescent bulbs, saving about $500 in energy over it&#8217;s lifetime. Not bad for a bunch of diodes. </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mindlesstechnology.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mindlesstechnology.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mindlesstechnology.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mindlesstechnology.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mindlesstechnology.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mindlesstechnology.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mindlesstechnology.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mindlesstechnology.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mindlesstechnology.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mindlesstechnology.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mindlesstechnology.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mindlesstechnology.wordpress.com/193/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mindlesstechnology.wordpress.com/193/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mindlesstechnology.wordpress.com/193/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mindlesstechnology.wordpress.com&amp;blog=2886517&amp;post=193&amp;subd=mindlesstechnology&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mindlesstechnology.wordpress.com/2009/08/21/on-the-economy-of-light-bulbs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5ad057107bf330ce298dc878e949ceab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">- S -</media:title>
		</media:content>

		<media:content url="http://mindlesstechnology.files.wordpress.com/2009/08/light-bulb.jpg" medium="image">
			<media:title type="html">This compact fluorescent lightbulb lasted 11,400 hours</media:title>
		</media:content>
	</item>
		<item>
		<title>Get your motherboard model in Linux</title>
		<link>http://mindlesstechnology.wordpress.com/2009/08/18/get-your-motherboard-model-in-linux/</link>
		<comments>http://mindlesstechnology.wordpress.com/2009/08/18/get-your-motherboard-model-in-linux/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 20:37:14 +0000</pubDate>
		<dc:creator>Seth</dc:creator>
				<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://mindlesstechnology.wordpress.com/?p=189</guid>
		<description><![CDATA[If you ever need to remotely determine the motherboard model of your linux server, try using dmidecode. This dumps the BIOS information, and that will usually yield the motherboard model. [root@gluon ~]# dmidecode ... Handle 0x0001 DMI type 1, 25 bytes. System Information Manufacturer: Supermicro Product Name: X6DH8 Version: 0123456789 ... dmidecode displays a bunch [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mindlesstechnology.wordpress.com&amp;blog=2886517&amp;post=189&amp;subd=mindlesstechnology&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you ever need to remotely determine the motherboard model of your linux server, try using dmidecode. This dumps the BIOS information, and that will usually yield the motherboard model.<br />
<span id="more-189"></span><br />
<code><br />
[root@gluon ~]# dmidecode<br />
...<br />
Handle 0x0001<br />
        DMI type 1, 25 bytes.<br />
        System Information<br />
                Manufacturer: Supermicro<br />
                Product Name: X6DH8<br />
                Version: 0123456789<br />
...<br />
</code></p>
<p>dmidecode displays a bunch of other information as well, including information on the RAM modules themselves:<br />
<code><br />
Handle 0x0017<br />
        DMI type 17, 27 bytes.<br />
        Memory Device<br />
                Array Handle: 0x0014<br />
                Error Information Handle: No Error<br />
                Total Width: 72 bits<br />
                Data Width: 64 bits<br />
                Size: 1024 MB<br />
                Form Factor: DIMM<br />
                Set: 1<br />
                Locator: DIMM#1B<br />
                Bank Locator: Bank 1<br />
                Type:<br />
                Type Detail: Synchronous<br />
                Speed: 533 MHz (1.9 ns)<br />
...<br />
</code></p>
<p>We&#8217;re doing some RAM upgrades on a couple of old servers, and this method sure beats taking the server offline and physically looking at the motherboard. </p>
<p>An even better idea would be to keep this sort of information in your IT records somewhere.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mindlesstechnology.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mindlesstechnology.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mindlesstechnology.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mindlesstechnology.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mindlesstechnology.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mindlesstechnology.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mindlesstechnology.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mindlesstechnology.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mindlesstechnology.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mindlesstechnology.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mindlesstechnology.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mindlesstechnology.wordpress.com/189/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mindlesstechnology.wordpress.com/189/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mindlesstechnology.wordpress.com/189/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mindlesstechnology.wordpress.com&amp;blog=2886517&amp;post=189&amp;subd=mindlesstechnology&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mindlesstechnology.wordpress.com/2009/08/18/get-your-motherboard-model-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5ad057107bf330ce298dc878e949ceab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">- S -</media:title>
		</media:content>
	</item>
		<item>
		<title>Even Faster Django Unit Tests</title>
		<link>http://mindlesstechnology.wordpress.com/2009/08/13/even-faster-django-unit-tests/</link>
		<comments>http://mindlesstechnology.wordpress.com/2009/08/13/even-faster-django-unit-tests/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 06:58:41 +0000</pubDate>
		<dc:creator>Seth</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[django]]></category>

		<guid isPermaLink="false">http://mindlesstechnology.wordpress.com/?p=184</guid>
		<description><![CDATA[Last year, I wrote about speeding up django unit tests. With this method, I&#8217;ve been able to significantly reduce the time it takes to run my unit tests. But I still have a real short attention span. If anything, it&#8217;s shorter than it was last year. I also have an additional problem: I tend to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mindlesstechnology.wordpress.com&amp;blog=2886517&amp;post=184&amp;subd=mindlesstechnology&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Last year, I wrote about <a href="http://mindlesstechnology.wordpress.com/2008/08/16/faster-django-unit-tests">speeding up django unit tests</a>. With this method, I&#8217;ve been able to significantly reduce the time it takes to run my unit tests.</p>
<p>But I still have a real short attention span. If anything, it&#8217;s shorter than it was last year. I also have an additional problem: I tend to create databases that have lots of preloaded data. This means that when I run tests or when I&#8217;m doing model development, I have to wait for all that data to load. Waiting sucks. <span id="more-184"></span>Plus, in order to be able to test with the SQLite database, I have to keep my SQL compatible with both the MySQL and sqlite engines (usually not a problem, but sometimes it can be). </p>
<p>Solution? I put my database on a RAM disk. I now have full speed unit tests. If I make a model change, I can toss the whole database and reload everything instantly. When I&#8217;m running unit tests, I can run them against the same database engine that I use in production. </p>
<p><strong>Current Method (still a bit rough)</strong></p>
<p>Load up your favorite RAM disk software. I don&#8217;t have a favorite yet, but so far I&#8217;m having good luck with the free one from http://www.romexsoftware.com.</p>
<p>Create yourself a RAM disk, put it on your favorite drive letter (I use R:\). The disk doesn&#8217;t have to be large, since there probably won&#8217;t be tons of data on it. I only have 2GB of memory on my laptop, so I made a dainty 64MB RAM disk. (Note: if you are running 32-bit windows and have more than 3GB of RAM, you might be able to make your <em>unusable</em> memory into a RAM disk .. there are some details on the site above).</p>
<p>Make yourself a &#8220;Create Ramdisk MySQL.cmd&#8221; batch file (see below). Edit the necessary variables so they&#8217;ll work on your system, then run the file. Since the contents of ram disks are frequently lost (like when you reboot), the setup here needs to be automated. The batch file does 3 things. It creates the needed folders on the ram disk. It copies over your &#8220;mysql&#8221; database (so your passwords will still work). And it installs a Windows service for the ramdisk mysql (called MySQLR).  </p>
<p>Make a copy of your my.ini file called my_ramdisk.ini (or whatever you like). Edit this new file and change the appropriate data directories to R:\mysql_volatile\data and R:\mysql_volatile\innodb.</p>
<p>If you need to have your normal mysql server running, then alter the my_ramdisk.ini so so the server runs on a different port (you will also have to alter the port number in your settings.py). I only use the mysql server on my computer for development, so can just turn it off before starting the ramdisk mysql.  </p>
<p>Start up the ram disk mysql. After running the batch file, you&#8217;ll have a new service called MySQLR. Use the service control manager gui, or, since you&#8217;re going to be on the command line to run your unit tests anyway, just type <code>sc start mysqlr</code>. </p>
<p>And finally, connect to your new mysql server and create a database for your project. </p>
<p><strong>Listing: </strong>&#8220;Create Ramdisk MySQL.cmd&#8221;<br />
<code><br />
SETLOCAL</p>
<p>REM path to the ramdisk mysql config file<br />
set config=c:\Servers\mysql\my_ramdisk.ini<br />
REM ramdisk drive letter<br />
set ramdisk=R:<br />
REM datadir is your normal mysql data folder<br />
set datadir=C:\data\mysql<br />
REM path to your the mysqld-nt binary<br />
set mysqld=c:\servers\mysql\bin\mysqld-nt.exe</p>
<p>mkdir %ramdisk%\mysql_volatile<br />
mkdir %ramdisk%\mysql_volatile\data</p>
<p>rem copy mysql database to retain permissions<br />
xcopy /ei  %datadir%\data\mysql %ramdisk%\mysql_volatile\data\mysql</p>
<p>rem install a service for the ramdisk mysql<br />
%mysqld% --install MySQLR --defaults-file=%config%<br />
</code></p>
<p><strong>Notes: </strong><br />
Remove the MySQLR service by running <code>mysqld-nt.exe --remove MySQLR</code>.</p>
<p>You might want to alter the batch file to copy the django application&#8217;s database to the ramdisk as well (saves you having to run that step manually).</p>
<p>Unit tests with the RAM disk MySQL is around 30 times faster than normal MySQL, and only about a second and a half slower than using the SQLite backend. </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mindlesstechnology.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mindlesstechnology.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mindlesstechnology.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mindlesstechnology.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mindlesstechnology.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mindlesstechnology.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mindlesstechnology.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mindlesstechnology.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mindlesstechnology.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mindlesstechnology.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mindlesstechnology.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mindlesstechnology.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mindlesstechnology.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mindlesstechnology.wordpress.com/184/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mindlesstechnology.wordpress.com&amp;blog=2886517&amp;post=184&amp;subd=mindlesstechnology&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mindlesstechnology.wordpress.com/2009/08/13/even-faster-django-unit-tests/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5ad057107bf330ce298dc878e949ceab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">- S -</media:title>
		</media:content>
	</item>
		<item>
		<title>Workaround for Subclipse crash</title>
		<link>http://mindlesstechnology.wordpress.com/2009/08/02/workaround-for-subclipse-crash/</link>
		<comments>http://mindlesstechnology.wordpress.com/2009/08/02/workaround-for-subclipse-crash/#comments</comments>
		<pubDate>Sun, 02 Aug 2009 18:55:08 +0000</pubDate>
		<dc:creator>Seth</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[workaround]]></category>

		<guid isPermaLink="false">http://mindlesstechnology.wordpress.com/?p=179</guid>
		<description><![CDATA[A couple weeks ago I tried to setup Aptana on my Mac, but was quite disappointed to find out that whenever I used Subversion, the JVM would crash. It took a while, but this morning I narrowed down the problem. The JavaHL native client for Subclipse adapter was blowing up the JVM. In retrospect, I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mindlesstechnology.wordpress.com&amp;blog=2886517&amp;post=179&amp;subd=mindlesstechnology&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A couple weeks ago I tried to setup Aptana on my Mac, but was quite disappointed to find out that whenever I used Subversion, the JVM would crash. It took a while, but this morning I narrowed down the problem. </p>
<p>The JavaHL native client for Subclipse adapter was blowing up the JVM. In retrospect, I should have figured this out earlier, since the JVM doesn&#8217;t really crash that often. Because the JavaHL is calling into the svn shared lib&#8217;s on my machine, it has the possibility to crash.</p>
<p>The workaround is pretty simple: uninstall the JavaHL client adapter and install the SVNKit client adapter. The SVNKit adapter is pure java code, so it doesn&#8217;t call into the libraries directly. Any bugs that may exist in SVNKit will just throw java exceptions instead of killing the JVM. </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mindlesstechnology.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mindlesstechnology.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mindlesstechnology.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mindlesstechnology.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mindlesstechnology.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mindlesstechnology.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mindlesstechnology.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mindlesstechnology.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mindlesstechnology.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mindlesstechnology.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mindlesstechnology.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mindlesstechnology.wordpress.com/179/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mindlesstechnology.wordpress.com/179/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mindlesstechnology.wordpress.com/179/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mindlesstechnology.wordpress.com&amp;blog=2886517&amp;post=179&amp;subd=mindlesstechnology&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mindlesstechnology.wordpress.com/2009/08/02/workaround-for-subclipse-crash/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5ad057107bf330ce298dc878e949ceab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">- S -</media:title>
		</media:content>
	</item>
	</channel>
</rss>
