<?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>jamesoff.net &#187; Coding</title>
	<atom:link href="http://jamesoff.net/site/category/coding/feed/" rel="self" type="application/rss+xml" />
	<link>http://jamesoff.net/site</link>
	<description>you heard</description>
	<lastBuildDate>Thu, 01 Sep 2011 17:39:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Alfred script to change network location in OS X</title>
		<link>http://jamesoff.net/site/2011/06/09/alfred-script-to-change-network-location-in-os-x/</link>
		<comments>http://jamesoff.net/site/2011/06/09/alfred-script-to-change-network-location-in-os-x/#comments</comments>
		<pubDate>Thu, 09 Jun 2011 18:43:32 +0000</pubDate>
		<dc:creator>jamesoff</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[alfred]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[useful]]></category>

		<guid isPermaLink="false">http://jamesoff.net/site/?p=434</guid>
		<description><![CDATA[Please see my Alfred Extensions page for updates! I wrote this little scriptlet to change network location in OS X using Alfred, but you could trigger it using whatever method you wanted. If you&#8217;re using Alfred 0.9.9 or later, you should be able to download this ZIP file and import it! if you using an [...]]]></description>
			<content:encoded><![CDATA[<p><b>Please see my <a href="http://jamesoff.net/site/alfred-extensions/">Alfred Extensions</a> page for updates!</b></p>

<p>I wrote this little scriptlet to change network location in OS X using <a href="http://alfredapp.com">Alfred</a>, but you could trigger it using whatever method you wanted.</p>

<p>If you&#8217;re using Alfred 0.9.9 or later, you should be able to download <a href="http://cl.ly/2t1O2G16341p2E1z3407">this ZIP file</a> and import it!</p>

<p>if you using an earlier version, follow the instructions below:</p>

<p><strike></p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>scselect <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-i</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>query<span style="color: #7a0874; font-weight: bold;">&#125;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">-c</span> <span style="color: #000000;">4</span>-<span style="color: #000000;">39</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">xargs</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>scselect</pre></div></div>


<p></strike></p>

<p><b>UPDATE</b> 2011-06-11: I have significantly improved the script to work around a bug caused by the 3Connect profile (3Connect is pants FYI), as well as use <code>growlnotify</code> to tell you if the change worked or not. It also allows substring matches (anchored at the start) so you can use &#8220;auto&#8221; for &#8220;Automatic&#8221;. If you have more than one profile that starts with a matching substring, the behaviour is currently undefined.</p>

<p><a href="http://jamesoff.net/site/wp-content/uploads/2011/06/Screen-shot-2011-06-11-at-19.02.40.png"><img src="http://jamesoff.net/site/wp-content/uploads/2011/06/Screen-shot-2011-06-11-at-19.02.40.png" alt="Growl showing network change notification" title="Screen shot 2011-06-11 at 19.02.40" width="322" height="100" class="alignnone size-full wp-image-441" /></a></p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">MSG</span>=<span style="color: #000000; font-weight: bold;">`/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>scselect <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">egrep</span> <span style="color: #660033;">-i</span> <span style="color: #ff0000;">&quot;\({query}&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">-c</span> <span style="color: #000000;">4</span>- <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">-f</span> <span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">head</span> <span style="color: #660033;">-n</span> <span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">xargs</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>scselect <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-E</span> <span style="color: #ff0000;">'s/.+ \((.+)\)/Location changed to \1/'</span><span style="color: #000000; font-weight: bold;">`</span>; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$MSG</span>&quot;</span> = <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>growlnotify <span style="color: #660033;">-a</span> <span style="color: #000000; font-weight: bold;">/</span>System<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>PreferencePanes<span style="color: #000000; font-weight: bold;">/</span>Network.prefPane <span style="color: #660033;">-m</span> <span style="color: #ff0000;">&quot;Unable to change location&quot;</span> Error; <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>growlnotify <span style="color: #660033;">-a</span> <span style="color: #000000; font-weight: bold;">/</span>System<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>PreferencePanes<span style="color: #000000; font-weight: bold;">/</span>Network.prefPane <span style="color: #660033;">-m</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$MSG</span>&quot;</span> Location changed; <span style="color: #000000; font-weight: bold;">fi</span>;</pre></div></div>


<p>If you want it without Growl notifications, use this version:</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>scselect <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">egrep</span> <span style="color: #660033;">-i</span> <span style="color: #ff0000;">&quot;\({query}&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">-c</span> <span style="color: #000000;">4</span>- <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">-f</span> <span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">head</span> <span style="color: #660033;">-n</span> <span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">xargs</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>scselect</pre></div></div>


<p>It&#8217;s slightly convoluted as it&#8217;s case-insensitive. To use it, create a Terminal/Shell script entry like this:</p>

<p><img src="http://f.cl.ly/items/3t0B301j3Q2X102y1C0V/Screen%20shot%202011-06-09%20at%2020.38.05.png" alt="Alfred settings" /></p>

<p>Now you can just type &#8220;location work&#8221; or similar into Alfred to change network location. I&#8217;ll add Growl-confirmation support when the next version of Alfred is released :)</p>
]]></content:encoded>
			<wfw:commentRss>http://jamesoff.net/site/2011/06/09/alfred-script-to-change-network-location-in-os-x/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>iPhone apps, Xcode and Dropbox</title>
		<link>http://jamesoff.net/site/2011/01/10/iphone-apps-xcode-and-dropbox/</link>
		<comments>http://jamesoff.net/site/2011/01/10/iphone-apps-xcode-and-dropbox/#comments</comments>
		<pubDate>Mon, 10 Jan 2011 12:33:27 +0000</pubDate>
		<dc:creator>jamesoff</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[my stuff]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[dropbox]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://jamesoff.net/site/?p=428</guid>
		<description><![CDATA[A while back I put some of my Xcode bits (i.e. the Random Recipe Generator) into my Dropbox to make it easier to stay up to date on my laptop and my desktop. (Yes, I know, source control blah blah blah :) However, building the Distribution version of the app gave me this warning: &#8220;The [...]]]></description>
			<content:encoded><![CDATA[<p>A while back I put some of my Xcode bits (i.e. the <a href="http://itunes.com/apps/jamesseward/randomrecipegenerator">Random Recipe Generator</a>) into my <a href="http://db.tt/ojcracC">Dropbox</a> to make it easier to stay up to date on my laptop and my desktop. (Yes, I know, source control blah blah blah :)</p>

<p>However, building the Distribution version of the app gave me this warning:</p>

<blockquote>&#8220;The CodeResources file must be a symbolic link to _CodeSignature/CodeResources&#8221;</blockquote>

<p>which I duly ignored. However, the Application Loader (used to push the new binary to the App Store) also complained about that and wouldn&#8217;t upload it.</p>

<p>It looks like Dropbox&#8217;s replication may have been to blame for the symlink stopping being a symlink, so the solution is to use the handy new selective sync option in Dropbox and not sync the build/ directory between my machines (which is pretty much pointless anyway and certainly generates a lot of network overhead when you build). Having done that and built a clean copy it worked fine.</p>
]]></content:encoded>
			<wfw:commentRss>http://jamesoff.net/site/2011/01/10/iphone-apps-xcode-and-dropbox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mac OS X Service to use b.oooom.net</title>
		<link>http://jamesoff.net/site/2010/12/31/mac-os-x-service-to-use-b-oooom-net/</link>
		<comments>http://jamesoff.net/site/2010/12/31/mac-os-x-service-to-use-b-oooom-net/#comments</comments>
		<pubDate>Fri, 31 Dec 2010 11:03:43 +0000</pubDate>
		<dc:creator>jamesoff</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[internets]]></category>
		<category><![CDATA[my stuff]]></category>
		<category><![CDATA[apple scripting boooom]]></category>

		<guid isPermaLink="false">http://jamesoff.net/site/?p=425</guid>
		<description><![CDATA[Use this Mac OS X Hints tip and use the following URL for the &#8220;download&#8221; line: http://b.oooom.net/shrink.php?api=1&#38;url=]]></description>
			<content:encoded><![CDATA[<p>Use this <a href="http://hints.macworld.com/article.php?story=20101223123552534">Mac OS X Hints tip</a> and use the following URL for the &#8220;download&#8221; line:</p>

<p><code>http://b.oooom.net/shrink.php?api=1&amp;url=</code></p>
]]></content:encoded>
			<wfw:commentRss>http://jamesoff.net/site/2010/12/31/mac-os-x-service-to-use-b-oooom-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Delphi documentation</title>
		<link>http://jamesoff.net/site/2008/04/11/delphi-documentation/</link>
		<comments>http://jamesoff.net/site/2008/04/11/delphi-documentation/#comments</comments>
		<pubDate>Fri, 11 Apr 2008 11:43:26 +0000</pubDate>
		<dc:creator>jamesoff</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[delphi]]></category>
		<category><![CDATA[wtf]]></category>

		<guid isPermaLink="false">http://jamesoff.net/site/?p=352</guid>
		<description><![CDATA[While writing some Delphi code at work, I spotted this in the documentation. Not sure if I want to call that function or not now&#8230;]]></description>
			<content:encoded><![CDATA[<p>While writing some Delphi code at work, I spotted this in the documentation. Not sure if I want to call that function or not now&#8230;</p>

<p><a href='http://jamesoff.net/site/wp-content/uploads/2008/04/delphi.png'><img src="http://jamesoff.net/site/wp-content/uploads/2008/04/delphi.png" alt="" title="delphi documentation" width="350" height="264" class="aligncenter size-full wp-image-353" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://jamesoff.net/site/2008/04/11/delphi-documentation/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Irssi typing speed script</title>
		<link>http://jamesoff.net/site/2008/04/10/irssi-typing-speed-script/</link>
		<comments>http://jamesoff.net/site/2008/04/10/irssi-typing-speed-script/#comments</comments>
		<pubDate>Thu, 10 Apr 2008 13:40:45 +0000</pubDate>
		<dc:creator>jamesoff</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[my stuff]]></category>
		<category><![CDATA[irc]]></category>
		<category><![CDATA[irssi]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://jamesoff.net/site/?p=351</guid>
		<description><![CDATA[I have written an irssi script which measures how fast you type on IRC and reports both words per minute and characters per minute. More details and download: WPM script.]]></description>
			<content:encoded><![CDATA[<p>I have written an irssi script which measures how fast you type on IRC and reports both words per minute and characters per minute.</p>

<p>More details and download: <a href="/site/irssi-scripts/wpm/">WPM script</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://jamesoff.net/site/2008/04/10/irssi-typing-speed-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BBC News Stylish script</title>
		<link>http://jamesoff.net/site/2008/04/01/bbc-news-stylish-script/</link>
		<comments>http://jamesoff.net/site/2008/04/01/bbc-news-stylish-script/#comments</comments>
		<pubDate>Tue, 01 Apr 2008 10:02:13 +0000</pubDate>
		<dc:creator>jamesoff</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[internets]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[stylish]]></category>

		<guid isPermaLink="false">http://jamesoff.net/site/?p=341</guid>
		<description><![CDATA[The new BBC News layout seems to be causing some people to stress out a bit &#8211; but then all new redesigns do until they get used to them. I quite like it, but for a friend I knocked this up quickly to get rid of the two banners across the top of the page. [...]]]></description>
			<content:encoded><![CDATA[<p>The new <a href="http://news.bbc.co.uk">BBC News</a> layout seems to be causing some people to stress out a bit &#8211; but then all new redesigns do until they get used to them. I quite like it, but for a friend I knocked this up quickly to get rid of the two banners across the top of the page.</p>

<p>You&#8217;ll need <a href="http://userstyles.org/stylish/">Stylish</a> and then stick this in a userscript for it. You may need to adjust the domain (2nd line) if you don&#8217;t use <code>news.bbc.co.uk</code> to access the site.</p>

<p><span id="more-341"></span></p>


<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #a1a100;">@namespace url(http://www.w3.org/1999/xhtml);</span>
&nbsp;
<span style="color: #a1a100;">@-moz-document domain(&quot;news.bbc.co.uk&quot;) {</span>
&nbsp;
<span style="color: #cc00cc;">#blq-displayoptions</span><span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#blq-accessibility-</span><span style="color: #993333;">help</span><span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#blq-mast</span> <span style="color: #00AA00;">&#123;</span> 
  <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span> !important<span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.newsbanner</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span> !important<span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>


<p>The first block (<code>#blq-displayoptions</code> et al) is for the grey banner; the second block is for the red BBC News one.</p>
]]></content:encoded>
			<wfw:commentRss>http://jamesoff.net/site/2008/04/01/bbc-news-stylish-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GuardChan now bans</title>
		<link>http://jamesoff.net/site/2008/02/17/guardchan-now-bans/</link>
		<comments>http://jamesoff.net/site/2008/02/17/guardchan-now-bans/#comments</comments>
		<pubDate>Sun, 17 Feb 2008 23:31:55 +0000</pubDate>
		<dc:creator>jamesoff</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[eggdrop]]></category>
		<category><![CDATA[irc]]></category>
		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://jamesoff.net/site/2008/02/17/guardchan-now-bans/</guid>
		<description><![CDATA[After a user request on IRC, my guardchan script can now actually ban as well as kicking when it detects an unauthorised user joining the channel. (The page for the script incorrectly said that it kickbanned already, but that was an error due to me writing the script about a thousand years ago.) Hope it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>After a user request on IRC, my <a href="/site/code/eggdrop-scripts/guardchan">guardchan</a> script can now actually ban as well as kicking when it detects an unauthorised user joining the channel.</p>

<p>(The page for the script incorrectly said that it kickbanned already, but that was an error due to me writing the script about a thousand years ago.)</p>

<p>Hope it&#8217;s of some use :)</p>
]]></content:encoded>
			<wfw:commentRss>http://jamesoff.net/site/2008/02/17/guardchan-now-bans/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A productive day</title>
		<link>http://jamesoff.net/site/2007/10/28/a-productive-day/</link>
		<comments>http://jamesoff.net/site/2007/10/28/a-productive-day/#comments</comments>
		<pubDate>Sun, 28 Oct 2007 22:52:46 +0000</pubDate>
		<dc:creator>jamesoff</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Fun]]></category>
		<category><![CDATA[my stuff]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[bmotion]]></category>
		<category><![CDATA[ds]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[monitor]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://jamesoff.net/site/2007/10/28/a-productive-day/</guid>
		<description><![CDATA[What a productive day (for a Sunday): Released bMotion 0.1.0 &#8211; only about 3 years after I planned on it originally. 0.1.0 is greatly improved over the previous version, and a few weeks ago I finally decided I should stop pointless tinkering with it and get a stable releasable version :) Finished Zelda: Phantom Hourglass [...]]]></description>
			<content:encoded><![CDATA[<p>What a productive day (for a Sunday):</p>

<ol>
<li><p>Released <a href="http://bmotion.net">bMotion 0.1.0</a> &#8211; only about 3 years after I planned on it originally. 0.1.0 is greatly improved over the previous version, and a few weeks ago I finally decided I should stop pointless tinkering with it and get a stable releasable version :)</p></li>
<li><p>Finished <a href="http://www.zelda.com/phantomhourglass/">Zelda: Phantom Hourglass</a> on the DS &#8211; mainly in celebration of releasing bMotion.</p></li>
<li><p>Started using my Simple Monitor project at home and on my colo, and it&#8217;s working well so far. The only problem was that both machines needed Python updating to support the native sqlite class. Once that was fixed, both worked fine and are now monitoring their services. Once I get some other features I&#8217;m planning on written in, I&#8217;ll release it for other people to try.</p></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://jamesoff.net/site/2007/10/28/a-productive-day/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Checking for another process before starting JKDefrag</title>
		<link>http://jamesoff.net/site/2007/10/23/checking-for-another-process-before-starting-jkdefrag/</link>
		<comments>http://jamesoff.net/site/2007/10/23/checking-for-another-process-before-starting-jkdefrag/#comments</comments>
		<pubDate>Tue, 23 Oct 2007 14:22:58 +0000</pubDate>
		<dc:creator>jamesoff</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://jamesoff.net/site/2007/10/23/checking-for-another-process-before-starting-jkdefrag/</guid>
		<description><![CDATA[A user on the JKDefrag forum was asking about not running JKDefrag if another process is running (as they don&#8217;t play nice together), so I whipped this up. You&#8217;ll need PsList from SysInternals in your path somewhere. Change the three SET lines to point to jkdefrag, give the parameters you want to use, and the [...]]]></description>
			<content:encoded><![CDATA[<p>A user on the <a href="http://www.kessels.com/forum/viewtopic.php?t=695">JKDefrag forum</a> was asking about not running JKDefrag if another process is running (as they don&#8217;t play nice together), so I whipped this up.</p>

<p>You&#8217;ll need <a href="http://www.microsoft.com/technet/sysinternals/ProcessesAndThreads/PsList.mspx">PsList</a> from SysInternals in your path somewhere.</p>

<p>Change the three SET lines to point to jkdefrag, give the parameters you want to use, and the name of the program to avoid. (Get the name of the program from PsList.)</p>

<p>The &#8220;>2 NUL&#8221; sends stderr to NUL to avoid printing the PsList banner. It works on Vista, not sure about XP/2003. If it doesn&#8217;t just remove it and live with the PsList banner showing up.</p>

<p>Making this check for more than one process is an exercise for the reader. Also, you could use this with PsExec to check for the process on a remote host and then launch JKDefrag over there.</p>


<div class="wp_syntax"><div class="code"><pre class="dos" style="font-family:monospace;"><span style="color: #33cc33;">@</span><span style="color: #b1b100; font-weight: bold;">echo</span> off
<span style="color: #808080; font-style: italic;">
REM Only run jkdefrag if another process is not running</span>
<span style="color: #808080; font-style: italic;">
REM Path to jkdefrag</span>
<span style="color: #b1b100; font-weight: bold;">SET</span> JKDEFRAG=c:\jkdefrag\jkdefrag.exe
<span style="color: #808080; font-style: italic;">
REM Options for jkdefrag</span>
<span style="color: #b1b100; font-weight: bold;">SET</span> JKDEFRAGOPTS=-a 3
<span style="color: #808080; font-style: italic;">
REM Process we don't want running</span>
<span style="color: #b1b100; font-weight: bold;">SET</span> AVOID=explorer
<span style="color: #808080; font-style: italic;">
&nbsp;
REM Here we go!</span>
&nbsp;
pslist <span style="color: #33cc33;">%</span><span style="color: #448888;">AVOID</span><span style="color: #33cc33;">%</span> <span style="color: #33cc33;">&gt;</span> <span style="color: #0000ff; font-weight: bold;">NUL</span> 2<span style="color: #33cc33;">&gt;</span> <span style="color: #0000ff; font-weight: bold;">NUL</span>
<span style="color: #00b100; font-weight: bold;">if</span> <span style="color: #33cc33;">%</span><span style="color: #448888;">ERRORLEVEL</span><span style="color: #33cc33;">%</span> == 0 <span style="color: #00b100; font-weight: bold;">goto</span> skip
<span style="color: #808080; font-style: italic;">
REM If we made it here, pslist didn't find the process</span>
<span style="color: #b1b100; font-weight: bold;">echo</span> Couldn't find <span style="color: #33cc33;">%</span><span style="color: #448888;">AVOID</span><span style="color: #33cc33;">%</span> running, starting jkdefrag...
<span style="color: #33cc33;">%</span><span style="color: #448888;">JKDEFRAG</span><span style="color: #33cc33;">%</span> <span style="color: #33cc33;">%</span><span style="color: #448888;">JKDEFRAGOPTS</span><span style="color: #33cc33;">%</span>
<span style="color: #00b100; font-weight: bold;">goto</span> end
&nbsp;
:<span style="color: #b100b1; font-weight: bold;">skip</span>
<span style="color: #b1b100; font-weight: bold;">echo</span> <span style="color: #33cc33;">%</span><span style="color: #448888;">AVOID</span><span style="color: #33cc33;">%</span> is running, <span style="color: #000000; font-weight: bold;">not</span> running jkdefrag
&nbsp;
:<span style="color: #b100b1; font-weight: bold;">end</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://jamesoff.net/site/2007/10/23/checking-for-another-process-before-starting-jkdefrag/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TASK: Shoot yourself in the foot</title>
		<link>http://jamesoff.net/site/2007/07/21/task-shoot-yourself-in-the-foot/</link>
		<comments>http://jamesoff.net/site/2007/07/21/task-shoot-yourself-in-the-foot/#comments</comments>
		<pubDate>Sat, 21 Jul 2007 18:57:15 +0000</pubDate>
		<dc:creator>jamesoff</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Fun]]></category>

		<guid isPermaLink="false">http://jamesoff.net/site/2007/07/21/task-shoot-yourself-in-the-foot/</guid>
		<description><![CDATA[I found this online somewhere while I was working at Grey Matter, and I&#8217;ve had it printed out ever since. So I can recycle the hardcopy, I&#8217;m reproducing it here. Feel free to add your own contributions in the comments :) TASK: Shoot yourself in the foot C: You shoot yourself in the foot C++: [...]]]></description>
			<content:encoded><![CDATA[<p>I found this online somewhere while I was working at Grey Matter, and I&#8217;ve had it printed out ever since. So I can recycle the hardcopy, I&#8217;m reproducing it here. Feel free to add your own contributions in the comments :)</p>

<p><em>TASK: Shoot yourself in the foot</em></p>

<ul>
<li><p>C: You shoot yourself in the foot</p></li>
<li><p>C++: You accidentally create a dozen instances of yourself and shoot them all in the foot. Providing emergency medical assistance is impossible since you can&#8217;t tell which are bitwise copies and which are just pointing at others and saying, &#8220;That&#8217;s me, over there.&#8221;</p></li>
<li><p>FORTRAN: You shoot yourself in each toe iteratively until you run out toes, then you read in the next foot and repeat. If you run out of bullets, you continue with the attempts to shoot yourself anyway because you have no exception-handling capability.</p></li>
<li><p>Pascal: The compiler won&#8217;t let you shoot yourself in the foot.</p></li>
<li><p>Ada: After correctly packing your foot, you attempt to concurrently load the gun, pull the trigger, scream, and shoot yourself in the foot. When you try, however, you discover you can&#8217;t because your foot is of the wrong type.</p></li>
<li><p>COBOL: Using a COLT 45 HANDGUN, AIM gun at LEG, THEN place ARM.HAND.FINGER on HANDGUN.TRIGGER and SQUEEZE. THEN return HANDGUN to HOLSTER. CHECK whether SHOELACE needs to be RE-TIED.</p></li>
<li><p>LISP: You shoot yourself in the appendage which holds the gun with which you shoot yourself in the appendage which holds the gun with which you shoot yourself in the appendage which holds the gun with which you shoot yourself in the appendage which holds the gun with which you shoot yourself in the appendage which &#8230;</p></li>
<li><p>FORTH: Foot in yourself shoot.</p></li>
<li><p>Prolog: You tell your program that you want to be shot in the foot. The program figures out how to do it, but the syntax doesn&#8217;t permit it to explain it to you.</p></li>
<li><p>BASIC: Shoot yourself in the foot with a water pistol. On large systems, continue until entire lower body is waterlogged.</p></li>
<li><p>Visual Basic: You&#8217;ll only appear to have shot yourself in the foot, but you&#8217;ll have had so much fun doing it that you won&#8217;t care.</p></li>
<li><p>HyperTalk: Put the first bullet of the gun into foot left of log of you. Answer the result.</p></li>
<li><p>Motif: You spend days writing a UIL description of your foot, the bullet, its trajectory, and the intricate scrollwork on the ivory handles of the gun. When you finally get around to pulling the trigger, the gun jams.</p></li>
<li><p>APL: You shoot yourself in the foot, then spend all day figuring out how to do it in fewer characters.</p></li>
<li><p>SNOBOL: If you succeed, shoot yourself in the left foot. If you fail, shoot yourself in the right foot.</p></li>
<li><p>Concurrent Euclid: You shoot yourself in somebody else&#8217;s foot.</p></li>
<li><p>370 JCL: You send your foot down to MIS and include a 400-page document explaining exactly how you want it to be shot. Three years later, your foot comes back deep fried.</p></li>
<li><p>Paradox: Not only can you shoot yourself in the foot, but your users can too.</p></li>
<li><p>Access: You try to point the gun at your foot, but it shoots holes in all your Borland distributions diskettes instead.</p></li>
<li><p>Revelation: You&#8217;re sure you&#8217;re going to be able to shoot yourself in the foot, just as soon as you figure out what all these nifty little bullet thingies are for.</p></li>
<li><p>Assembler: You try to shoot yourself in the foot, only to discover you must first invent the gun, the bullet, the trigger, and your foot.</p></li>
<li><p>Modula2: After realising that you can&#8217;t actually accomplish anything in this language, you shoot yourself in the head.</p></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://jamesoff.net/site/2007/07/21/task-shoot-yourself-in-the-foot/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

