<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet 
href="http://osric.com/chris/accidental-developer/rss2.xsl" type="text/xsl" media="screen"?>
<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>The Accidental Developer</title>
	<atom:link href="http://osric.com/chris/accidental-developer/feed/" rel="self" type="application/rss+xml" />
	<link>http://osric.com/chris/accidental-developer</link>
	<description>What if Gregor Samsa awoke a computer programmer?</description>
	<lastBuildDate>Tue, 09 Mar 2010 15:15:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Testing for multiple versions of Internet Explorer</title>
		<link>http://osric.com/chris/accidental-developer/2010/03/testing-for-multiple-versions-of-internet-explorer/</link>
		<comments>http://osric.com/chris/accidental-developer/2010/03/testing-for-multiple-versions-of-internet-explorer/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 22:43:56 +0000</pubDate>
		<dc:creator>Chris Herdt</dc:creator>
				<category><![CDATA[Testing]]></category>
		<category><![CDATA[browsers]]></category>
		<category><![CDATA[cross-browser compatibilty]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[internet explorer]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[virtual pc]]></category>

		<guid isPermaLink="false">http://osric.com/chris/accidental-developer/?p=266</guid>
		<description><![CDATA[Using Microsoft's Virtual PC and their supplied Virtual Hard Disks, you can run virtual machines with Internet Explorer 6 and Internet Explorer 7 for testing web pages on these legacy browsers.]]></description>
			<content:encoded><![CDATA[<p>Only one version of Internet Explorer (IE) can exist on a single windows installation by default. I had previously used <a href="http://tredosoft.com/Multiple_IE">Multiple IE</a> as a way of testing web pages on older versions of IE. This allows you to have IE3, IE4, IE5, IE5.5, and IE6 installed alongside your existing IE7 or IE8 install. You can even run them concurrently.<br />
<img src="http://osric.com/chris/accidental-developer/wp-content/uploads/2010/03/ie-logo-150x150.png" alt="Internet Explorer Logo" title="Internet Explorer Logo" width="150" height="150" class="alignright size-thumbnail wp-image-267" /><br />
I don&#8217;t test pages on anything earlier than IE6 anymore, but IE6 still accounts for more than 5% of my site traffic. Multiple IE basically helps me test both IE6 and IE8 from the same machine. However, there is still the IE7 gap, plus Multiple IE, which is no longer being updated or maintained, can produce some glitchy behavior.</p>
<p>It turns out, though, Microsoft offers some tools to help test their legacy browsers.<br />
<span id="more-266"></span><br />
Microsoft offers several <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=21EABB90-958F-4B64-B5F1-73D0A413C8EF&#038;displaylang=en">Windows virtual hard disks (VHDs)</a> that can be loaded using <a href="http://www.microsoft.com/windows/virtual-pc/">Virtual PC</a>. If you run IE8, you can download VHDs that include IE6 and IE7, and run them through a virtual environment.</p>
<p>Two drawbacks compared to Multiple IE: the VHD files are huge (some are 800+ MB), and in my experience, the virtual machines run hopelessly slowly. (The latter may be due to my environment or my Virtual PC settings.) However, it does allow you to test web pages on fully-functional versions of IE6, IE7, and IE8 without maintaining separate testing machines.</p>
<p>I&#8217;m running VMWare Fusion on Mac OSX (Leopard), which allows me to test Firefox and Safari on the Mac, as well as the PC versions of the browsers through a Windows VM. I could presumably create separate VMs for IE6 and IE7, although that may not be kosher with Microsoft&#8217;s licensing for my copy of Windows XP. It is frankly easier, however, to run Virtual PC through my Windows VM, than to install Windows XP twice more over.</p>
]]></content:encoded>
			<wfw:commentRss>http://osric.com/chris/accidental-developer/2010/03/testing-for-multiple-versions-of-internet-explorer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Hunt the Wumpus</title>
		<link>http://osric.com/chris/accidental-developer/2010/01/javascript-hunt-the-wumpus/</link>
		<comments>http://osric.com/chris/accidental-developer/2010/01/javascript-hunt-the-wumpus/#comments</comments>
		<pubDate>Sun, 31 Jan 2010 00:09:10 +0000</pubDate>
		<dc:creator>Chris Herdt</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[wumpus]]></category>

		<guid isPermaLink="false">http://osric.com/chris/accidental-developer/?p=263</guid>
		<description><![CDATA[I am taking a course in discrete mathematics this semester, and the professor suggested we take a look at a game called Hunt the Wumpus.
Hunt the Wumpus was originally created in the 1970s, and unfortunately, most of the versions you can find on the web today are easier and less interesting that the original. The [...]]]></description>
			<content:encoded><![CDATA[<p>I am taking a course in discrete mathematics this semester, and the professor suggested we take a look at a game called Hunt the Wumpus.</p>
<p>Hunt the Wumpus was originally created in the 1970s, and unfortunately, most of the versions you can find on the web today are easier and less interesting that the original. The original eschewed a square grid for the game board and instead used a &#8220;squashed&#8221; dodecahedron, where each game space was one of the vertices.</p>
<p>It is also noteworthy for introducing the <em>superbat</em>, a feature of other games (including Zork) that followed Hunt the Wumpus, and for the humorous feedback (e.g. &#8220;ZAP&#8211;Superbat Snatch! Elsewhereville for you!&#8221;) that many of my favorite games adopted.</p>
<p>At any rate, I decided to recreate a version of the easier and less interesting grid-based game in Javascript:<br />
<a href="http://osric.com/wumpus/">Hunt the Wumpus</a></p>
]]></content:encoded>
			<wfw:commentRss>http://osric.com/chris/accidental-developer/2010/01/javascript-hunt-the-wumpus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Online Advertisements and Statistical Analysis</title>
		<link>http://osric.com/chris/accidental-developer/2009/12/online-advertisements-and-statistical-analysis/</link>
		<comments>http://osric.com/chris/accidental-developer/2009/12/online-advertisements-and-statistical-analysis/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 18:21:49 +0000</pubDate>
		<dc:creator>Chris Herdt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[banner ads]]></category>
		<category><![CDATA[click-thru rate]]></category>
		<category><![CDATA[ctr]]></category>
		<category><![CDATA[online ads]]></category>
		<category><![CDATA[online advertising]]></category>
		<category><![CDATA[statistics]]></category>
		<category><![CDATA[stats]]></category>

		<guid isPermaLink="false">http://osric.com/chris/accidental-developer/?p=249</guid>
		<description><![CDATA[Quite a few years ago, I was in the online advertising business. My team and I created banner ads to run alongside web site content, to entice viewers to click on ads and find out more about advertiser offers. We scheduled ads to run alongside specific content. We targeted ads towards users in specific geographic [...]]]></description>
			<content:encoded><![CDATA[<p>Quite a few years ago, I was in the online advertising business. My team and I created banner ads to run alongside web site content, to entice viewers to click on ads and find out more about advertiser offers. We scheduled ads to run alongside specific content. We targeted ads towards users in specific geographic regions, thanks to a browser cookie that told us their ZIP code. And we constantly managed inventory.</p>
<p>Although we made animated ads, we avoided anything that blinked. There were no monkeys to punch.</p>
<p>Click-Through Rate (or Click-Thru Rate or CTR) was a key measurement of an ad&#8217;s success. Although at first we would sometimes see click CTRs between 1-2% (meaning that an ad was clicked between 10 and 20 out of every 1000 views, or <em>impressions</em>), as online advertising proliferated, and as our systems got better at filtering out false impressions and clicks from various robots, crawlers, and spiders, CTRs trended much lower: 0.25% suddenly looked good, and 0.10% was not uncommon in some cases. That&#8217;s 1 click for every 1000 impressions.</p>
<p>That&#8217;s why we were insanely interested in a blog post we found, now presumably lost to the ages, that ran a set of 6 banner ads, which varied only slightly, and analyzed the results to determine what aspects of the ads could improve CTRs. Did including the phrase &#8220;click here&#8221; really help? If the words &#8220;click here&#8221; were in blue and underlined, like a typical web link, would that improve the CTR?<br />
<span id="more-249"></span><br />
They ran 30,000 impressions of each ad. I don&#8217;t recall if they set a frequency cap (wherein you limit the number of impressions a specific viewer sees); I don&#8217;t believe they did. I don&#8217;t recall exact details of each ad or the results, but it looked something like this:</p>
<ol>
<li>Ad for amazing offer: 0.27% CTR</li>
<li>Same ad with &#8220;click here&#8221; in black on the <em>left</em> side of the ad: 0.28% CTR</li>
<li>&#8220;Click here&#8221; in black on the <em>right</em> side of the ad: 0.30% CTR</li>
<li>&#8220;Click here&#8221; in blue on the right side of the ad: 0.32% CTR</li>
<li>&#8220;Click here&#8221; underlined in blue on the right side of the ad: 0.33% CTR</li>
<li>&#8220;Click here&#8221; in blue, inside a button on the right side of the ad: 0.36% CTR</li>
</ol>
<p>Naturally, the result of this was that all of our ads soon had a gray button in the lower-left corner with the words &#8220;Click Here&#8221; in it, underlined and in blue:</p>
<div id="attachment_254" class="wp-caption alignnone" style="width: 478px"><img src="http://osric.com/chris/accidental-developer/wp-content/uploads/2009/12/amazing-offer-click-here_468x60.gif" alt="Example banner ad" title="Example banner ad" width="468" height="60" class="size-full wp-image-254" /><p class="wp-caption-text">Example banner ad</p></div>
<p>I was a bit skeptical, though. Could we really say from 30,000 impressions that a 0.33% CTR is significantly different from 0.36%? It&#8217;s a difference of 9 clicks. Could that be attributed to random chance?</p>
<p>I don&#8217;t have a background in statistics, so I asked my father, a scientist. He handed me a 1000-page epidemiology textbook and said&#8211;and I love this part&#8211;that a banner ad click is a lot like a disease state: an individual either has the disease (a click) or does not have the disease. Needless to say, I didn&#8217;t make a lot of headway into the world of epidemiology, but the question still troubled me.</p>
<p>Now I am taking an introductory class on statistical analysis, and although my analysis may oversimplify things greatly, I think it is safe to say that we should not have concluded that every ad needed a button-like box with the words &#8220;click here&#8221; in blue in the lower-right corner.</p>
<p>If we look at any one of the banners in isolation, the CTR is really just a sample <del datetime="2009-12-07T15:49:44+00:00">mean</del> proportion [thanks to Patrick for the correction]. We could run millions of impressions of the same banner&#8211;would it have the same CTR? What is the standard error? To find the confidence interval for the best performing ad, we can run it through this equation:</p>
<p><code>p +/- z*sqrt((p(1 - p))/n)<br />
p = 0.0036, z = 1.96 (for 95% confidence), and n = 30,000.</code></p>
<p>The result? 0.36% +/- 0.07%. We are 95% confident that the true population CTR is somewhere between 0.29% and 0.43%. Well&#8211;yikes! I&#8217;m 95% confident that our measurement isn&#8217;t very precise. When we&#8217;re dealing with such low proportions, we could really use more precision. We would need to run a test with more than 30,000 impressions.</p>
<p>What if we wanted to run a test where we were 95% confident that our value was within just one-one hundredth of a percent (0.01%) of the population mean? In other words, CTR% +/- 0.005%? We have an equation for that too:</p>
<p><code>n = (z^2*p(1-p))/e^2<br />
n = desired number of impressions, z = 1.96 (for 95% confidence), p = 0.0036, e = 0.00005</code></p>
<p>To be 95% confident that our sample CTR is within 0.01% of the population CTR, we would need to run<br />
<em><strong>5,517,522</strong></em> impressions.</p>
<p>Although the data presented in that blog post from years ago seemed compelling, I think I was right to be skeptical. As I said, this is based on what I&#8217;ve learned from an introductory course on statistical analysis. If you think I&#8217;m way off base, feel free to enlighten me in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://osric.com/chris/accidental-developer/2009/12/online-advertisements-and-statistical-analysis/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Typography on the Web</title>
		<link>http://osric.com/chris/accidental-developer/2009/10/typography-on-the-web/</link>
		<comments>http://osric.com/chris/accidental-developer/2009/10/typography-on-the-web/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 22:08:51 +0000</pubDate>
		<dc:creator>Chris Herdt</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[font replacement]]></category>
		<category><![CDATA[fonts]]></category>
		<category><![CDATA[sifr]]></category>
		<category><![CDATA[typekit]]></category>
		<category><![CDATA[typography]]></category>

		<guid isPermaLink="false">http://osric.com/chris/accidental-developer/?p=242</guid>
		<description><![CDATA[In spite of my fondness for typography, I have always been fairly antagonistic towards web typography &#8220;solutions&#8221; like sIFR. Sure, it&#8217;s a better idea than using a GIF file for every headline, but is it really necessary?
I&#8217;m skeptical. What is it buying you, and at what cost? What&#8217;s the return on investment? Is it improving [...]]]></description>
			<content:encoded><![CDATA[<p>In spite of my fondness for typography, I have always been fairly antagonistic towards web typography &#8220;solutions&#8221; like <a href="http://www.mikeindustries.com/blog/sifr/">sIFR</a>. Sure, it&#8217;s a better idea than using a GIF file for every headline, but is it really necessary?</p>
<p>I&#8217;m skeptical. What is it buying you, and at what cost? What&#8217;s the return on investment? Is it improving conversions, improving customer/reader loyalty?</p>
<p>To me, content is king. I&#8217;ve visited, bookmarked, and returned to many web sites that are no-frills black-text-on-a-white-background. I remember fondly the days of <a href="http://en.wikipedia.org/wiki/Gopher_%28protocol%29">Gopher</a>, shortly before the rise of the World-Wide Web: all information, and <em>no waste</em>.</p>
<p>Let&#8217;s say there are 3 kinds of people in the world:</p>
<ol>
<li>Graphic Designers</li>
<li>Computer Programmers</li>
<li>Everyone Else</li>
</ol>
<p>Let&#8217;s look at these groups from the bottom-up:<br />
<span id="more-242"></span><br />
<strong>Everyone Else</strong><br />
These people don&#8217;t really know or care about typefaces. They are likely to stick with whatever default font is selected in Microsoft Office. To Everyone Else, there are 3 fonts in the world: Serif, Sans Serif, and Illegible.</p>
<p>(There is a curious subset of Everyone Else, known as Human Resources Managers. These cheery folks recognize 2 fonts: Comic Sans and Stodgy.)</p>
<p><strong>Computer Programmers</strong><br />
These people know that there are many different font files on their computers, and that some are TrueType and some are PostScript. To Computer Programmers, there are 4 fonts in the world: Serif, Sans Serif, Monotype, and Illegible.</p>
<p><strong>Graphic Designers</strong><br />
Graphic designers love type. They are well-versed in the <a href="http://www.fontshop.com/help/glossary.php">anatomy of a typeface</a>, and speak lovingly of typeface designer Eric Gill. They can identify by sight 20,000 different fonts, and have probably designed several themselves.</p>
<p>On the web, you can be fairly certain that a given user will have Arial or Helvetica (sans serif), and some variant of Times (serif). There are a few others, but basically you tend to focus on serif and sans serif. You can adjust various type properties via CSS: font sizes, colors, leading (that&#8217;s the space between lines), and even letter-spacing. Take a look at <a href="http://www.3point7designs.com/blog/2008/06/10-examples-of-beautiful-css-typography-and-how-they-did-it/">10 Examples of Beautiful CSS Typography and how they did it</a> to see some interesting examples.</p>
<p>At the recent <a href="http://wordcampbirmingham.org/">WordCamp Birmingham</a>, I caught <a href="http://www.sara-cannon.com/">Sara Cannon&#8217;s</a> presentation on Branding Wordpress. She talked about sIFR, and I thought that, perhaps for the sake of peace and brotherhood, I should go ahead and use sIFR and play around with some funky type. The sIFR text is selectable as text. It&#8217;s not as bloated as you might think&#8211;even the SWF file containing the specific fonts can be optimized to only include the characters you need&#8211;and even though it uses Flash, it is used to enhance the page on Flash-capable browsers. For everyone else, it still appears as regular HTML type.</p>
<p>Other folks at the conference (including <a href="http://www.studionashvegas.com/">Mitch Canter</a>) mentioned <a href="http://www.typekit.com/">TypeKit</a>, a web-based service, as an alternative to sIFR. I decided to try it on this blog by using a couple fonts with a little more character for the title and headings. I think the typefaces I picked might have a little too much character&#8211;they are falling into my <em>Illegible</em> category&#8211;but it works, and it&#8217;s easy.</p>
]]></content:encoded>
			<wfw:commentRss>http://osric.com/chris/accidental-developer/2009/10/typography-on-the-web/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>WordPress Security Tips</title>
		<link>http://osric.com/chris/accidental-developer/2009/09/wordpress-security-tips/</link>
		<comments>http://osric.com/chris/accidental-developer/2009/09/wordpress-security-tips/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 22:18:32 +0000</pubDate>
		<dc:creator>Chris Herdt</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[birmingham]]></category>
		<category><![CDATA[file permissions]]></category>
		<category><![CDATA[mod_suexec]]></category>
		<category><![CDATA[security plugins]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[wcbham09]]></category>
		<category><![CDATA[wordcamp]]></category>

		<guid isPermaLink="false">http://osric.com/chris/accidental-developer/?p=235</guid>
		<description><![CDATA[I attended the WordCamp Birmingham conference this past weekend to find out more about all things WordPress. WordPress is an open source blog engine/lightweight Content Management System (CMS) that has a huge community of users and developers, and an enormous repository of plugins to extend its functionality.
One of the presentations I attended, Mitch Canter&#8217;s session [...]]]></description>
			<content:encoded><![CDATA[<p>I attended the <a href="http://wordcampbirmingham.org/">WordCamp Birmingham</a> conference this past weekend to find out more about all things <a href="http://wordpress.org/">WordPress</a>. WordPress is an open source blog engine/lightweight Content Management System (CMS) that has a huge community of users and developers, and an enormous repository of plugins to extend its functionality.</p>
<p>One of the presentations I attended, <a href="http://www.studionashvegas.com/">Mitch Canter</a>&#8217;s session on WordPress Security, had 6 good tips for making your WordPress-based site more secure:<br />
<span id="more-235"></span>
<ol>
<li><strong>Updgrade WordPress</strong><br />
WordPress recently released an important security update. Making sure that you are using the most current version will ensure that you have the latest security patches. (WordPress will complain if you aren&#8217;t running the latest, greatest version, so no need to fear: you&#8217;ll know.)</li>
<li><strong>Update your plugins</strong><br />
Plugins are 3rd-party code that can have their own security flaws [a good reason, in my opinion, to do a little research before you install any old WordPress plugin you find lying around the internet]. Find out if updates are available for yours.</li>
<li><strong>Set your file permissions</strong><br />
A lot of WordPress users may not be familiar with Unix/Linux file permissions, and once they find out, they may become even more confused, as files permissions use an octal-based numeric scheme to determine who (the owner, the group, or other users) can do what (read, write, execute) with a file.</p>
<p>Depending on which user your web server runs as, your files should be set to 0775, which means you (the owner of the files) and the associated group can read, write, and execute the files, but other users can only read and execute the files. With Apache 2, you can use <a href="http://httpd.apache.org/docs/2.0/mod/mod_suexec.html">mod_suexec</a> and a SuexecUserGroup command to make the webserver run commands as a specific user and group, which means you should <em>never</em> have to make any of your files or directories world-writable.</p>
<p>["World-writable" is a misnomer here--it really means "writable by anyone who has access to the server." That means other legitimate users who may have an account on the same machine, or malicious users who have compromised someone else's account on the system.]</li>
<li><strong>Make backups</strong><br />
I was really glad this came up, because security is about much more than preventing malicious attacks. It&#8217;s about maintaining your data over time. Mitch suggested the <a href="http://wordpress.org/extend/plugins/wp-db-backup/">wp-db backup</a><br />
WordPress plugin. [Although one of the options is to have WordPress send an e-mail with the compressed data, e-mail is not a secure way to transfer data, and I would recommend against it.]</li>
<li><strong>Delete the <em>admin</em> account</strong><br />
Every WordPress install comes with a privileged account, &#8216;admin&#8217;. Automated attacks can be launched against your system attempting to login as this user with a guessed password.</p>
<p>Anyone that really wants to hack into your system can do a bit of sleuthing and probably guess your actual login name&#8211;but creating a new account with administrative privileges and changing the admin account should at least provide some protection against the most automated attacks.</li>
<li><strong>Change your WordPress database table prefix.</strong><br />
This setting is contained within the wp-config.php file, and it&#8217;s easiest to change it when you are first setting up a new WordPress install. Otherwise, you will need to change not only the config setting, but additionally all the table names in your database. This change will help protect you from automated SQL injection attacks.</li>
</ol>
<p>Some additional ideas were floated during the questions and comments portion of the session, most of which included plugins, such as:</p>
<ul>
<li><a href="http://wordpress.org/extend/plugins/wp-security-scan/">WP Security Scan</a></li>
<li><a href="http://www.seoegghead.com/software/wordpress-firewall.seo">WP Firewall</a></li>
<li><a href="http://wordpress.org/extend/plugins/stealth-login/">Stealth Login</a></li>
</ul>
<p>Other ideas included:</p>
<ul>
<li>Restricting access to the files within wp-admin to specific IP addresses (this may not work for most people, who want to update their sites from wherever they happen to be)</li>
<li>Installing a <a href="http://www.tc.umn.edu/~brams006/selfsign.html">self-signed SSL certificate</a> and requiring SSL (https instead of http) to log in. This wouldn&#8217;t be good solution if you are setting up a site for someone else, as they would get browser warnings unless they permanently accept the self-signed certificate.</li>
</ul>
<p>I will probably be posting further updates this week with my notes from the WordCamp.</p>
]]></content:encoded>
			<wfw:commentRss>http://osric.com/chris/accidental-developer/2009/09/wordpress-security-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mistakes I Made When Setting Up My WinXP/OSX Intel-Based Mac</title>
		<link>http://osric.com/chris/accidental-developer/2009/09/mistakes-i-made-when-setting-up-my-winxposx-intel-based-mac/</link>
		<comments>http://osric.com/chris/accidental-developer/2009/09/mistakes-i-made-when-setting-up-my-winxposx-intel-based-mac/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 20:46:37 +0000</pubDate>
		<dc:creator>Chris Herdt</dc:creator>
				<category><![CDATA[Workstation]]></category>
		<category><![CDATA[boot camp]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[core 2 duo]]></category>
		<category><![CDATA[dropbox]]></category>
		<category><![CDATA[google chrome]]></category>
		<category><![CDATA[mac mini]]></category>
		<category><![CDATA[macdrive]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[refit]]></category>
		<category><![CDATA[software bloat]]></category>
		<category><![CDATA[vmware fusion]]></category>
		<category><![CDATA[windows xp]]></category>
		<category><![CDATA[winxp]]></category>

		<guid isPermaLink="false">http://osric.com/chris/accidental-developer/?p=228</guid>
		<description><![CDATA[I really like my little Intel-based (Core 2 Duo) Mac Mini. It has a small footprint, low power draw, and it has wifi (so I don&#8217;t need a Cat 5 cable snaking through my apartment). Surprisingly, after comparing it to other small-footprint systems with comparable specs, the Mac was about the same price and came [...]]]></description>
			<content:encoded><![CDATA[<p>I really like my little Intel-based (Core 2 Duo) Mac Mini. It has a small footprint, low power draw, and it has wifi (so I don&#8217;t need a Cat 5 cable snaking through my apartment). Surprisingly, after comparing it to other small-footprint systems with comparable specs, the Mac was about the same price and came with the added option of running OSX. I set it up as a dual-boot WinXP and OSX system so that I can continue to run all my Windows software, as well as checking out some of the nifty Mac software (like the night we sat around making <a href="http://osric.com/chris/movies/chevy-volt.html">humorous commercials for the Chevy Volt</a> using Garage Band and iMovie).</p>
<p>Aside from just using Apple&#8217;s <a href="http://www.apple.com/support/bootcamp/">Boot Camp</a> to select which OS I wanted to use the <em>next</em> time I started the computer, I also installed <a href="http://refit.sourceforge.net/">rEFIt</a>, a boot-loader that will let me select which OS I want as I start the system, and <a href="http://www.vmware.com/products/fusion/">VMWare Fusion</a>, so that I can run WinXP from within OSX.</p>
<p>From my experience with with a dual-boot WinXP and Ubuntu Linux laptop, I wasn&#8217;t looking forward to sharing files between the 2 systems by setting up an antediluvian FAT32 partition. However, one of my friends recommended <a href="http://www.mediafour.com/products/macdrive/">MacDrive</a>, a program that allows Windows to read from and write to an HFS+ volume. Magic, right?</p>
<p>Everything was looking rosy, until I decided to be stingy and give Windows XP a 10 GB partition.<br />
<span id="more-228"></span><br />
The <a href="http://support.microsoft.com/kb/314865">system requirements for Windows XP</a> indicate that a minimum of 1.5 GB drive space is needed. People have installed XP on 4GB Asus eees, so I actually thought I was being generous by giving over 6 times the minimum.</p>
<p>The problem, in this case, doesn&#8217;t have anything to do with Microsoft. My three biggest problems so far have been with <a href="http://www.google.com/chrome">Chrome</a>, <a href="https://www.getdropbox.com/">Dropbox</a>, and <a href="http://www.openoffice.org/">Open Office</a>. The first 2 don&#8217;t seem to offer the user the choice of selecting a custom install location, and install on the Windows partition by default. Open Office just didn&#8217;t take to being installed on the MacDrive volume&#8211;I haven&#8217;t figured it out beyond that.</p>
<p>You might be thinking, how much space can Chrome possibly use? It&#8217;s the sleekest browser around, right? I don&#8217;t know if it was the recent updates that did it, but the Chrome application was hogging 118 MB for the application&#8211;Firefox uses 27 MB, by comparison&#8211;and other files in my Application Data folder were taking up nearly a gigabyte of space.</p>
<p>Dropbox is a slick program that allows you to map a folder on your system to space in the cloud. You can drop-and-drag your files just like with any other Windows folder, but the files are stored on a server, and are accessible to you via a password-protected web page, or via any other computer where you install the Dropbox software. A change to the web interface or to a folder on any one system is automatically synchronized with the other systems. Even though I had put my local Dropbox repository on the MacDrive volume, the software itself was on the Windows partition, along with a heft chunk (~500 MB) of cache data, again, in the Application Data folder.</p>
<p>Before long, I was getting messages about low disk space on the Windows volume every few minutes. I tried to uninstall Open Office Writer, the only component of Open Office I originally had room to install, to free up 300 MB, and was informed that there wasn&#8217;t enough drive space to uninstall it. The irony! At one point, I had 0 KB free on my Windows volume. I managed to delete a few files until I could uninstall Open Office and Chrome.</p>
<p>On top of that, when running Windows XP in VMWare Fusion, Windows can&#8217;t access the MacDrive volume. Since that&#8217;s where I installed all my Windows software, I can run Windows in OSX, but I can&#8217;t run any of my Windows software.</p>
<p>How much space is enough space for your Windows partition? It&#8217;s hard to say. If you really want to run Windows from within VMWare Fusion, you should probably give it a sizable partition. Otherwise, I hope that giving it an extra 15 GB would be sufficient. Why be stingy when drive space is so cheap? Maybe I&#8217;m old-fashioned, but I prefer lean software to bloated. Can you imagine installing Chrome from floppies? Remember the <a href="http://www.alistapart.com/articles/5k/">The 5K Awards</a>, for web sites that could pack a punch in mere kilobytes? OK, maybe we don&#8217;t need to be that sparing with our drive space, but a little efficiency would go a long way.</p>
]]></content:encoded>
			<wfw:commentRss>http://osric.com/chris/accidental-developer/2009/09/mistakes-i-made-when-setting-up-my-winxposx-intel-based-mac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>7 Ways Twitter is Like Cigarette Smoking</title>
		<link>http://osric.com/chris/accidental-developer/2009/09/7-ways-twitter-is-like-cigarette-smoking/</link>
		<comments>http://osric.com/chris/accidental-developer/2009/09/7-ways-twitter-is-like-cigarette-smoking/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 20:59:55 +0000</pubDate>
		<dc:creator>Chris Herdt</dc:creator>
				<category><![CDATA[twitter]]></category>
		<category><![CDATA[facebook]]></category>

		<guid isPermaLink="false">http://osric.com/chris/accidental-developer/?p=220</guid>
		<description><![CDATA["People who have never tried it don't get it" and 6 other ways in which Twitter is like cigarette smoking. One important difference: Twitter doesn't cause cancer.]]></description>
			<content:encoded><![CDATA[<p><strong>1. People who have never tried it don&#8217;t get it.</strong><br />
As far as I can tell, the naysayers have never tried Twitter. I&#8217;ve seen people complain about <a href="http://twitter.com">Twitter </a>on <a href="http://www.facebook.com">Facebook</a>, but a Facebook status update and a tweet are nearly the same: short snippets of information that you want to share.</p>
<p>The at-signs (@) and hashes (#) that have become ubiquitous on Twitter may be part of the problem. Although I feel that if you can decipher an emoticon you ought to be able to handle @replies and #hashtags.</p>
<p><strong>The difference?</strong><br />
A tweet is public if your Twitter timeline is public. (A timeline is akin to your wall on Facebook.) This is probably one reason why marketers love it: they get to push links out to the world, including search engines, whereas on Facebook you actually have to work to build an audience. (More on Facebook later.)</p>
<p><strong>2. It&#8217;s addictive.</strong><br />
Clearly, it can be. Maybe not to the same extent as nicotine, but some people can&#8217;t stay off Twitter. People complain about how many breaks smokers take. Sick of your friends leaving you alone at a party while they compose a tweet? Annoyed that they ignore you to check the latest on their Blackberries? Tired of your co-workers taking tweet breaks? Which leads to&#8230;</p>
<p><strong>3. It interrupts you.</strong><br />
Cravings for cigarettes driving you to distraction? Twitter can drive you insane. I quickly disabled updates on my phone, because I would have exceeded my 400 monthly SMS messages in the span of a few days. I installed <a href="http://www.twhirl.org/">twhirl</a>, and later <a href="http://tweetdeck.com/beta/">TweetDeck</a>, and found that I was getting notifications almost every minute. That&#8217;s no way to work. I changed my TweetDeck settings to check for updates every 40 minutes. I may find out about the latest celebrity death 10 minutes after you do, but I still have some semblance of mental focus.</p>
<p><strong>4. Users love to talk about it</strong><br />
Smokers love to talk about smoking. What brand you smoke, the way you hold your cigarettes, whether or not you prefer hard-packs or soft-packs, whether or not you pack your cigarettes before you open them&#8211;these are the sorts of conversations people have on their smoke breaks. My friend Brady cited all the unnecessary talking about smoking as a top reason to quit smoking.</p>
<p>Twitterers love to talk about Twitter. People are in love with Twitter right now, and they aren&#8217;t afraid to shout it from the rooftops. Which apps they use, who they follow, how it can turn their struggling companies into a giants. Even I am guilty of this: about a quarter of my tweets reference Twitter. I imagine this may fade over time, along with the accompanying backlash. After all, remember blowthedotoutyourass.com?</p>
<p><strong>5. You do it more when you&#8217;re drinking.</strong><br />
&#8230;and that&#8217;s not a good thing.</p>
<p><strong>6. Short and unsatisfying.</strong><br />
Oscar Wilde wrote, &#8220;A cigarette is the perfect type of a perfect pleasure.  It is exquisite, and it leaves one unsatisfied.&#8221; I&#8217;ve seen people pack a lot of info into a mere 140 characters, but sometimes 140 characters just isn&#8217;t enough. That is why more than half of the tweets I am perusing right now contain shortened links from sites like <a href="http://bit.ly/">bit.ly</a>, <a href="http://short.to">short.to</a>, <a href="http://ff.im">ff.im</a>, and <a href="http://tr.im">tr.im</a>.</p>
<p>[I actually really dislike shortened links, because they remove a critical piece of info--the destination URL--from the link. If someone posts a link with little-to-no explanation, I will not click on it for two reasons: one, there's no incentive, two, it could be spam or lead to a malicious web site.] </p>
<p><strong>7. It&#8217;s bad for your health.</strong><br />
OK, I admit it: that&#8217;s a weak link. Just don&#8217;t tweet while driving, OK? But just as smokers often pass on exercise, Twitter may cause people or companies to scrimp on more important things, like phone calls, face-to-face conversations, making good products, or even updating Facebook. Time spent on Twitter is time not spent on something else.</p>
<p>(That&#8217;s right, I said Facebook. As I mentioned to a friend recently, <em>if Facebook stepped on Twitter, Facebook would hardly notice</em>. Check out <a href="http://siteanalytics.compete.com/facebook.com+twitter.com/">Facebook vs. Twitter on Compete.com</a>. To which should you devote more time?)</p>
<p><strong>Afterthoughts</strong><br />
I should note that I have been tobacco-free for years and would never advocate tobacco use. On the other hand, I think with some caveats, Twitter can be fun, useful, and relatively harmless.</p>
<p>I decided to capitalize Twitter in this post because it is a proper noun. I&#8217;ll respect bell hooks&#8217; preference for lowercasing, but that&#8217;s where I decided to draw the line this time; I reserve the right to be inconsistent.</p>
<p><strong>Additions?</strong><br />
Feel free to contribute your own comparisons in the comments!</p>
]]></content:encoded>
			<wfw:commentRss>http://osric.com/chris/accidental-developer/2009/09/7-ways-twitter-is-like-cigarette-smoking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript insertAfter()</title>
		<link>http://osric.com/chris/accidental-developer/2009/08/javascript-insertafter/</link>
		<comments>http://osric.com/chris/accidental-developer/2009/08/javascript-insertafter/#comments</comments>
		<pubDate>Fri, 28 Aug 2009 23:12:47 +0000</pubDate>
		<dc:creator>Chris Herdt</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[insertAfter]]></category>
		<category><![CDATA[insertBefore]]></category>

		<guid isPermaLink="false">http://osric.com/chris/accidental-developer/?p=217</guid>
		<description><![CDATA[Although Javascript doesn't contain a DOM function for Node.insertAfter(), you can easily emulate it using Node.insertBefore -- and even call it via Node.insertAfter()]]></description>
			<content:encoded><![CDATA[<p>There is no <em>Node.insertAfter()</em> DOM function in Javascript, but it is clearly something that developers would like.</p>
<p>As the <a href="https://developer.mozilla.org/en/Gecko_DOM_Reference">Gecko DOM Reference</a> for <a href="https://developer.mozilla.org/En/DOM/Node.insertBefore">Node.insertBefore()</a> points out, this can easily be achieved with<br />
<code>parentDiv.insertBefore(nodeToInsert, nodeToInsertAfter.nextSibling);</code></p>
<p>If <em>nodeToInsertAfter</em> doesn&#8217;t have a next sibling, a NULL value will be returned and <em>nodeToInsert</em> will be inserted as the last child of <em>parentDiv</em>.</p>
<p>If you find it frustrating to type <em>insertBefore</em> when you want to <em>insertAfter</em>, that&#8217;s OK: you can add that function to the Object object:<br />
<code>Object.prototype.insertAfter = function (newNode) { this.parentNode.insertBefore(newNode, this.nextSibling); }</code></p>
<p>Now you can type:<br />
<code>nodeToInsertAfter.insertAfter(nodeToInsert)</code></p>
]]></content:encoded>
			<wfw:commentRss>http://osric.com/chris/accidental-developer/2009/08/javascript-insertafter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Perl and PDF::API2 to Update PDF Properties and Metadata</title>
		<link>http://osric.com/chris/accidental-developer/2009/08/using-perl-and-pdfapi2-to-update-pdf-properties-and-metadata/</link>
		<comments>http://osric.com/chris/accidental-developer/2009/08/using-perl-and-pdfapi2-to-update-pdf-properties-and-metadata/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 17:05:17 +0000</pubDate>
		<dc:creator>Chris Herdt</dc:creator>
				<category><![CDATA[perl]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[pdf-api2]]></category>
		<category><![CDATA[titlecase]]></category>
		<category><![CDATA[work smarter not harder]]></category>

		<guid isPermaLink="false">http://osric.com/chris/accidental-developer/?p=212</guid>
		<description><![CDATA[What do you do when you have 600 PDF documents with titles in all caps, when you need the titles to be title-cased? I dreaded the thought of asking anyone to open each document and edit the titles by hand, not to mention fearing the typos that process might introduce.
For better or worse, here was [...]]]></description>
			<content:encoded><![CDATA[<p>What do you do when you have 600 PDF documents with titles in all caps, when you need the titles to be title-cased? I dreaded the thought of asking anyone to open each document and edit the titles by hand, not to mention fearing the typos that process might introduce.</p>
<p>For better or worse, here was my solution:</p>
<ul>
<li>Grab the Perl <a href="http://search.cpan.org/dist/PDF-API2/">PDF::API2</a> module from <a href="http://www.cpan.org/">CPAN</a></li>
<li>Grab a <a href="http://daringfireball.net/2008/05/title_case">Perl titlecase script</a></li>
<li>Write a script opens the PDF, titlecases the title, and saves the PDF</li>
</ul>
<p>Sounds fast and easy, right? Well, there were a few hitches:<br />
<span id="more-212"></span></p>
<ul>
<li>Perl on my work system is jacked, thanks to a bunch of Oracle files for Perl 5.8.3 that interfere with my Perl 5.8.8 installation. Rather than try to sort that out, I decided to use a clean system instead.</li>
<li>The PDF I was using as a test case threw an error, which I could eliminate if I saved it as an older PDF version (1.4 or lower). I spent quite a bit of time trying to figure that out, until I discovered that the real files I needed to update did not produce that error. (In case you ever need to, though, it is simple to use Acrobat Pro to change the PDF version of multiple files in one fell swoop.)</li>
<li>The title is stored in multiple places. I expected to find it in the info hash, but if the title is also stored in the XML-based XMP metadata, you can get some unexpected results. I updated my script to update both.</li>
</ul>
<p>The titlecase script I found treats all-uppercase words as acronyms or other terms that belong in all caps. This was a simple workaround: I lowercased everything before sending it through the titlecase function. Of course, many of the titles contained acronyms and other terms that should have been left in all caps: ADR, ERISA, IRS, and NLRB, D.C. and U.S., and Roman numerals, e.g. VII. I added the terms I found to the titlecase script to uppercase those terms.</p>
<p>I had the script produce a text file listing the filenames, the original title, and the updated title so that I could check it for errors. Names, like McDonnell, were converted to Mcdonnell. On top of that, some of the titles contained OCR errors. But cobbling together a script and updating those few errors by hand was still less time-consuming, and far less tedious, than manually titlecasing 600 PDFs.</p>
]]></content:encoded>
			<wfw:commentRss>http://osric.com/chris/accidental-developer/2009/08/using-perl-and-pdfapi2-to-update-pdf-properties-and-metadata/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Twitter Status IDs and Direct Message IDs</title>
		<link>http://osric.com/chris/accidental-developer/2009/08/twitter-status-ids-and-direct-message-ids/</link>
		<comments>http://osric.com/chris/accidental-developer/2009/08/twitter-status-ids-and-direct-message-ids/#comments</comments>
		<pubDate>Wed, 05 Aug 2009 02:20:13 +0000</pubDate>
		<dc:creator>Chris Herdt</dc:creator>
				<category><![CDATA[python]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[twitter api]]></category>
		<category><![CDATA[twitter bot]]></category>

		<guid isPermaLink="false">http://osric.com/chris/accidental-developer/?p=203</guid>
		<description><![CDATA[I built a twitter-bot in Python using the python-twitter API wrapper (code included in post). Twitter status update IDs and direct message (DM) IDs use different sequences, which is important if you are trying to retrieve messages posted after a specified ID.]]></description>
			<content:encoded><![CDATA[<p><img src="http://osric.com/chris/accidental-developer/wp-content/uploads/2009/08/twitter-bird.png" alt="twitter-bird" title="twitter-bird" width="80" height="55" class="alignleft size-full wp-image-206" />I recently created a <a href="http://twitter.com/osric8ball">Magic Eight Ball twitter-bot</a> as a demo. Written in <a href="http://www.python.org/">Python</a> using the <a href="http://code.google.com/p/python-twitter/">python-twitter</a> API wrapper, it runs every 2 minutes and polls <a href="http://twitter.com/">twitter</a> for new replies (status updates containing <em>@osric8ball</em>) and direct messages (DMs) to <em>osric8ball</em>. If there are any, it replies with a random 8-Ball response.</p>
<p>Every status update and DM has an associated numeric ID. Initially, I stored the highest ID in a log file and used that when I polled twitter (i.e. &#8220;retrieve all replies and DMs with ID > highest ID&#8221;). However, I discovered that status updates and DMs apparently are stored in separate tables on twitter&#8217;s backend, as they have a separate set of IDs. Since the highest status ID was an order of magnitude larger than the highest DM ID, my bot completely ignored all DMs. This was not entirely obvious at first, as the IDs looked very similar, other than an extra digit: 2950029179 and 273876291.</p>
<p>My fix for this was to store both the highest status update ID and the highest DM ID is separate log files.</p>
<p>Another interesting twist: you have to be a follower of a user in order to send that user a DM.<span id="more-203"></span><br />
At first I thought I had solved this by telling the bot to follow anyone who sent it a message. However, if you submit an API request to follow a user whom you are already following, it produces an error. So I added a check to see if the bot was already following the user, and, if not, follow the user.</p>
<p>In case anyone is interested, the entire code is below:<br />
<code>#!/usr/bin/python2.4</p>
<p>import twitter<br />
import random</p>
<p>replyfile = 'twitterreply.log'<br />
dmfile = 'twitterdm.log'<br />
last_id = 0</p>
<p>api = twitter.Api(username='osric8ball', password='[actualpassword]')</p>
<p>friends = api.GetFriends()</p>
<p>responses = ['Signs Point To Yes','Yes','You May Rely On It','Ask Again Later','Concentrate And Ask Again','Outlook Good','My Sources Say No','Better Not Tell You Now','Without A Doubt','Reply Hazy, Try Again','It Is Decidedly So','Cannot Predict Now','My Reply Is No','As I See It Yes','It Is Certain','Yes Definitely','Don\'t Count On It','Most Likely','Very Doubtful','Outlook Not So Good']</p>
<p>def areWeFriends(screen_name):<br />
        isFriend = 0<br />
        for friend in friends:<br />
                if friend.screen_name == screen_name:<br />
                        isFriend = 1<br />
        return isFriend</p>
<p>def makeFriend(screen_name):<br />
        if areWeFriends(screen_name) == 0:<br />
                api.CreateFriendship(user=screen_name)</p>
<p>def sendReply(screen_name):<br />
        makeFriend(screen_name)<br />
        response = responses[random.randint(0,19)]<br />
        api.PostUpdates('@' + screen_name + ': ' + response)<br />
        print '@' + screen_name + ': ' + response</p>
<p>def sendDirectMessage(screen_name):<br />
        makeFriend(screen_name)<br />
        response = responses[random.randint(0,19)]<br />
        api.PostDirectMessage(screen_name,response)<br />
        print 'd ' + screen_name + ': ' + response</p>
<p>#Read logs<br />
log = open(replyfile, 'r')<br />
last_reply_id = log.read()<br />
log.close()</p>
<p>log = open(dmfile, 'r')<br />
last_dm_id = log.read()<br />
log.close()</p>
<p>if last_reply_id &gt; 0 and last_dm_id &gt; 0:</p>
<p>        #Get replies and direct messages<br />
        replies = api.GetReplies(since_id=last_reply_id)<br />
        directMessages = api.GetDirectMessages(since_id=last_dm_id)</p>
<p>        #Update logs<br />
        if directMessages != []:<br />
                last_dm_id = directMessages[0].id</p>
<p>        if replies != []:<br />
                last_reply_id = replies[0].id</p>
<p>        if last_reply_id &gt; 0:<br />
                log = open(replyfile,'w')<br />
                log.write( str(last_reply_id) )<br />
                log.close()</p>
<p>        if last_dm_id &gt; 0:<br />
                log = open(dmfile,'w')<br />
                log.write( str(last_dm_id) )<br />
                log.close()</p>
<p>        # Loop through replies<br />
        for reply in replies:<br />
                sendReply(reply.user.screen_name)</p>
<p>        # Loop through direct messages<br />
        for directMessage in directMessages:<br />
                sendDirectMessage(directMessage.sender_screen_name)</p>
<p>else:<br />
        print 'Unable to read ' + replyfile + ' or ' + dmfile<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://osric.com/chris/accidental-developer/2009/08/twitter-status-ids-and-direct-message-ids/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
