<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>mason</title>
    <link rel="alternate" type="text/html" href="http://www.masonsimon.com/mt/" />
    <link rel="self" type="application/atom+xml" href="http://www.masonsimon.com/mt/atom.xml" />
    <id>tag:www.masonsimon.com,2008-06-11:/mt//1</id>
    <updated>2010-01-19T05:07:04Z</updated>
    
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type Pro 4.21-en</generator>

<entry>
    <title>why you must use pinned transfers to compare CUDA device bandwidth</title>
    <link rel="alternate" type="text/html" href="http://www.masonsimon.com/mt/2010/01/why-you-must-use-pinned-transf.html" />
    <id>tag:www.masonsimon.com,2010:/mt//1.23</id>

    <published>2010-01-19T04:46:28Z</published>
    <updated>2010-01-19T05:07:04Z</updated>

    <summary>correct me if i&apos;m wrong, but NVIDIA&apos;s bandwidthTest program included in the CUDA SDK takes single timing measurements and reports them. if there&apos;s any noise in the measurements, these single reports may be misleading. i wrote my own bandwidth test...</summary>
    <author>
        <name>mason</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.masonsimon.com/mt/">
        correct me if i&apos;m wrong, but NVIDIA&apos;s bandwidthTest program included in the CUDA SDK takes single timing measurements and reports them. if there&apos;s any noise in the measurements, these single reports may be misleading. i wrote my own bandwidth test program that takes 100 measurements and spews out the resulting data for analysis. with my program at least, there is plenty of noise if you measure unpinned rather than pinned transfers.
        <![CDATA[<meta charset="utf-8"><br class="Apple-interchange-newline" />below are some plots to show it.&nbsp;<span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: arial, sans-serif; border-collapse: collapse; ">each plot shows the percentage of transfers that completed in &lt;= the amount of time on the x axis. so the closer a line is to being purely vertical, the less variation there is in the transfer times for that device. the farther left a line is, the faster the transfer times for that device. the plots compare transfer times on my two systems--maul and vader, to transfer times on a friend's system. note that&nbsp;</span><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: arial, sans-serif; border-collapse: collapse; ">i've restricted the plot so the y-axis only goes to 0.99 (99%) so that outliers don't squish the x-axis.</span><br /><div><span class="mt-enclosure mt-enclosure-image" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; display: inline; "><img alt="device.to.host_unpinned.png" src="http://www.masonsimon.com/mt/device.to.host_unpinned.png" width="480" height="480" class="mt-image-none" /></span><br /><div><span class="mt-enclosure mt-enclosure-image" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; display: inline; "><br /></span></div><div><span class="mt-enclosure mt-enclosure-image" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; display: inline; ">in this plot, the green and orange lines are all over each other, but in the next one...</span></div><div><span class="mt-enclosure mt-enclosure-image" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; display: inline; "><br /></span></div><div><span class="mt-enclosure mt-enclosure-image" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; display: inline; "><img alt="device.to.host_pinned.png" src="http://www.masonsimon.com/mt/device.to.host_pinned.png" width="480" height="480" class="mt-image-none" /></span></div><div><br /></div><div>...they separate neatly (up till 90% or so).</div><div><br /></div><div>if you want my measurement code or the R code to analyze its results, shoot me an email or comment.</div></div>]]>
    </content>
</entry>

<entry>
    <title>notes on The Mythical Man Month</title>
    <link rel="alternate" type="text/html" href="http://www.masonsimon.com/mt/2009/06/notes-on-the-mythical-man-mont.html" />
    <id>tag:www.masonsimon.com,2009:/mt//1.22</id>

    <published>2009-06-09T10:56:16Z</published>
    <updated>2009-06-09T11:07:41Z</updated>

    <summary><![CDATA[For tips on designing a software system,&nbsp;I read The Mythical Man-Month. I recommend it, but here are my notes in case you just want the juicy bits:...]]></summary>
    <author>
        <name>mason</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.masonsimon.com/mt/">
        <![CDATA[For tips on designing a software system,&nbsp;I read <a href="http://www.amazon.com/gp/product/0201835959?ie=UTF8&amp;tag=dorcod-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0201835959">The Mythical Man-Month</a><img src="http://www.assoc-amazon.com/e/ir?t=dorcod-20&amp;l=as2&amp;o=1&amp;a=0201835959" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />. I recommend it, but here are my notes in case you just want the juicy bits:]]>
        <![CDATA[<div><span class="Apple-style-span" style="font-weight: bold; ">ch1 the tar pit</span></div>
<div>a bunch of software engineering projects run over budget and schedule</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div><strong>ch2 the mythical man month</strong></div>
<div>he estimates</div>
<div>1/3 time for planning</div>
<div>1/6 for coding</div>
<div>1/4 for component test and preliminary system test and debugging</div>
<div>1/4 for final system test and debugging</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div><strong>ch3 the surgical team</strong></div>
<div>even a small team of really good programmers won't be able to churn out a large system as fast as a hulking team of crappy programmers</div>
<div>&nbsp;</div>
<div>there are combinatorial costs as you increase team size, due to all the communication that has to be done between subsets of members. you can solve this by making specialized teams supporting one star--to minimize communication--rather than making teams of equals who all have to talk and argue</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div><strong>ch4 aristocracy, democracy, and system design</strong></div>
<div>have a few architects design--the builders will get to be creative in satisfying that design, even if they miss out on the fun of initially architecting it, and the product will be better as a result of having that cohesive design by a small group than it would've been if done democratically</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div><strong>ch5 the second-system effect</strong></div>
<div>the first system you design is necessarily simple and clean because you need to get it out the door. so you make notes of all the neato features you'd want to have if you had more time. and those make it into your second system. but you already know they were unnecessary because you built the first one without them, and even worse, they may have been made obsolete by a basic difference between this second system and the first, which generated these feature-ideas. so watch out buddy</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div><strong>ch6 passing the word</strong></div>
<div>decide what parts of your spec are just undefined</div>
<div>&nbsp;</div>
<div>making two implementations is a good way to ensure the spec is followed, rather than changed to match the implementation</div>
<div>&nbsp;</div>
<div>when an implementer has a question, he must ask the architect, and the architect should record these questions and answers and disseminate them to all implementers</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div><strong>ch7 why did the Tower of Babel fail?</strong></div>
<div>the OS/360 project kept a daily-updated workbook that contained all the specifications. but the workbooks couldn't just be updated silently, there needed to be a changelog describing the updates, and the updates needed to be marked (this sounds very familiar...)</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div><strong>ch8 calling the shot</strong></div>
<div>in estimates, you must budget time for stuff that's totally unrelated to coding and debugging: interruptions, meetings, ...</div>
<div>&nbsp;</div>
<div>there are some conclusions drawn here from thin data... i don't trust 'em</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div><strong>ch9 ten pounds in a five-pound sack</strong></div>
<div>when your code can trade off space and time, make two versions: one that's light on space and one that's light on time, then use the appropriate ones</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div><strong>ch10 the documentary hypothesis</strong></div>
<div>writing out your ideas and estimates and budget, ... forces you to make a ton of small decisions that are essential, so do it.</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div><strong>ch11 plan to throw one away</strong></div>
<div>think of the first system you build as an instructive exercise that teaches you what you actually need to build, then build that new thing.</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div><strong>ch12 sharp tools</strong></div>
<div>they used to automatically schedule (scarce) machine time in 4-hour chunks--so you'd submit a job and it would get scheduled and run, then you'd get the results and could try again if it failed. but they found it was way more effective to just give a whole team unlimited access to the machines for 6-hours in which they could run as many jobs as they needed. that way if your first job failed immediately you could just fix it and start a new one.</div>
<div>&nbsp;</div>
<div>let developers build their components freely, but when ready to drop into the system, they give that version to the integration manager who is the only one with the power to allow changes to it. after testing the integrated system, that version of the codebase can be released</div>
<div>&nbsp;</div>
<div>build tools to test the performance of your system automatically</div>
<div>&nbsp;</div>
<div>use high-level languages (he likes PL/I for system programming, with APL to prototype algorithms) and interactive programming environments</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div><strong>ch13 the whole and the parts</strong></div>
<div>designing top-down will help you to dodge bugs that result from poor specification</div>
<div>&nbsp;</div>
<div>test your components well and individually--even though it's tempting to use one component to test that another works</div>
<div>&nbsp;</div>
<div>don't throw stuff together and start system testing until you've done component (unit) testing</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div><strong>ch14 hatching a catastrophe</strong></div>
<div>prefer specific, well-defined milestones to ones that are more vague but easier for outsiders to understand</div>
<div>&nbsp;</div>
<div>when a component gets behind schedule, its manager doesn't want to tell his boss, because the boss might step in. but the boss needs to know this stuff, so if you're the boss, don't step in when the manager can solve the problem--you want to know this stuff so don't give the manager a reason to hide it from you.</div>
<div>&nbsp;</div>
<div>lay out your milestones in a chart showing their dependencies (like a PERT chart), and regularly review your progress through that chart</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div><strong>ch15 the other face</strong></div>
<div>document your code.</div>
<div>&nbsp;</div>
<div>describe the program at a high level, in prose--you should probably do this before you even code it</div>
<div>&nbsp;</div>
<div>you probably don't need to make flow charts, and definitely don't make a flow chart that's bigger than 1 page</div>
<div>&nbsp;</div>
<div>put yor documentation in the same file as your code</div>
<div>&nbsp;</div>
<div>make more paragraph-length comments and fewer single-line comments</div>
<div>&nbsp;</div>
<div>document as you go</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div><strong>ch16 no silver bullet-essence and accident in software engineering</strong></div>
<div>it's hard to visualize a piece of software--there are too many dimensions of stuff going on</div>
<div>&nbsp;</div>
<div>big software systems are too complicated to fully specify up-front--instead, rapidly prototype the system, then figure out the details</div>
<div>&nbsp;</div>
<div>grow your software system bit-by-bit so you have working versions all along the way--don't set out to build it through incremental progress toward a grand goal</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div><strong>ch17 no silver bullet refired</strong></div>
<div>not much content here</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div><strong>ch18 propositions of the mythical man-month true or false?</strong></div>
<div>this chapter is a big outline of the whole book with references to current data. i skipped this because i was more interested in his personal experience than in research on software engineering, which i tend to find questionable. how generalizable are the results of analyzing one software engineering project going to be when the studies are purely historical and don't include experimental manipulation?<strong> </strong>how comparable are lines of code statistics between projects? how interesting is lines of code as a summary statistic anyway?</div>]]>
    </content>
</entry>

<entry>
    <title>migrate from Google Docs to Evernote with gdocs2evernote</title>
    <link rel="alternate" type="text/html" href="http://www.masonsimon.com/mt/2009/01/migrate-from-google-docs-to-ev.html" />
    <id>tag:www.masonsimon.com,2009:/mt//1.21</id>

    <published>2009-01-08T18:54:29Z</published>
    <updated>2009-01-08T19:00:59Z</updated>

    <summary>Google Docs and Evernote will both store your text data on their servers. I&apos;ve used both for keeping my diary, but I&apos;m moving over to Evernote completely now. Here&apos;s a python program I wrote that downloads all of your Google...</summary>
    <author>
        <name>mason</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.masonsimon.com/mt/">
        <![CDATA[Google Docs and Evernote will both store your text data on their servers. I've used both for keeping my diary, but I'm moving over to Evernote completely now. Here's a python program I wrote that downloads all of your Google Docs from a particular folder and puts them into an Evernote notebook: <span class="mt-enclosure mt-enclosure-file" style="display: inline;"><a href="http://www.masonsimon.com/mt/gdocs2evernote.zip">gdocs2evernote.zip</a> (Windows only)</span>]]>
        
    </content>
</entry>

<entry>
    <title>do arithmetic on time with Timelab</title>
    <link rel="alternate" type="text/html" href="http://www.masonsimon.com/mt/2009/01/do-arithmetic-on-time-with-tim.html" />
    <id>tag:www.masonsimon.com,2009:/mt//1.20</id>

    <published>2009-01-04T15:55:23Z</published>
    <updated>2009-01-04T16:14:38Z</updated>

    <summary>A calculator that could do arithmetic on time, like 5:13*2 + 10:50 = 21:16, would be handy. So I built it. Download Timelab to try it! You&apos;ll need python to run Timelab (macs already have this installed)....</summary>
    <author>
        <name>mason</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.masonsimon.com/mt/">
        <![CDATA[A calculator that could do arithmetic on time, like 5:13*2 + 10:50 = 21:16, would be handy. So I built it. Download <span class="mt-enclosure mt-enclosure-file" style="display: inline;"><a href="http://www.masonsimon.com/mt/timelab.py">Timelab</a></span> to try it! You'll need <a href="http://www.python.org/ftp/python/2.6.1/python-2.6.1.msi">python</a> to run Timelab (macs already have this installed).]]>
        
    </content>
</entry>

<entry>
    <title>Eigenfaces for art</title>
    <link rel="alternate" type="text/html" href="http://www.masonsimon.com/mt/2009/01/eigenfaces-for-art.html" />
    <id>tag:www.masonsimon.com,2009:/mt//1.19</id>

    <published>2009-01-02T17:27:07Z</published>
    <updated>2009-01-02T19:09:00Z</updated>

    <summary>If you discard color, a 100x100 pixel image has 10,000 pieces of information--one for each pixel. Consider each image a data point. To plot them, you&apos;d need graph paper with 10,000 axes, because each pixel&apos;s value tells you the position...</summary>
    <author>
        <name>mason</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.masonsimon.com/mt/">
        <![CDATA[<span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; ">If you discard color, a 100x100 pixel image has 10,000 pieces of information--one for each pixel. Consider each image a data point. To plot them, you'd need graph paper with 10,000 axes, because each pixel's value tells you the position of the image (data point) along the corresponding dimension. And you thought images were 2-D.</span>]]>
        <![CDATA[<span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; "><div style="height: 90%; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; position: relative; color: rgb(51, 51, 51); background-image: initial; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: rgb(255, 255, 255); font: normal normal normal 13px/normal arial, helvetica, hirakakupro-w3, osaka, 'ms pgothic', sans-serif; background-position: initial initial; "><div>The reason for putting images in this 10,000 dimensional space is to find how far one point is from another; in terms of images: to find how similar one image is to another. This can be useful for face recognition. But 10,000 dimensions are too much (google "the curse of dimensionality"). Intuitively, we don't need that many, because to describe how one person's face differs from another, we say things like "his nose is bigger than hers", "her mouth is wider than his", ... and these high-level differences aren't captured by any single pixel.</div><div><br /></div><div>Now forget about faces for a moment, and think about colors. All the colors your computer screen can display are formed by mixing red, green, and blue. So plot each color you're interested in using 3 axes--one for red, green, and blue--and look at how close they are to each other in 3-D.</div><div><br /></div><div>The critical step with colors was to recognize that each is a mixture of 3 components. Faces (and other images) can be analyzed this way too. Now the components aren't obvious like they were for colors--you have to choose them yourself, and you'll probably want more than 3.  <a href="http://en.wikipedia.org/wiki/Principal_components_analysis" style="text-decoration: underline; ">Principal Components Analysis (PCA)</a> is the best way to choose them because it picks the components that express the most difference between faces--so just knowing that face A is 40% composed of component C1 (the best) while face B is 70% composed of C1 should tell you that A and B are very different. In the same way that red, green, and blue are themselves colors, each component is itself an image, like this one:</div><div><br /></div><div><span class="mt-enclosure mt-enclosure-image" style="display: inline; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; "><img alt="eigface36.png" src="http://www.masonsimon.com/mt/eigface36.png" width="350" height="350" class="mt-image-none" /></span></div><div><br /></div><div>These "eigenfaces" are just an intermediate step in the technique (I've partially described) that <a href="http://www.cs.ucsb.edu/~mturk/Papers/jcn.pdf" style="text-decoration: underline; ">Turk and Pentland developed to do face recognition</a>. But I found some of them stunning, like the ones above and below.</div><div><br /></div><div><span class="mt-enclosure mt-enclosure-image" style="display: inline; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; "><img alt="eigface49.png" src="http://www.masonsimon.com/mt/eigface49.png" width="350" height="350" class="mt-image-none" /></span></div><div><br /></div><div><a href="https://cee.princeton.edu/people/e7/billington/profile.html" style="text-decoration: underline; ">David Billington</a> taught me that good engineering often produces good aesthetics, and that happened in this case. My next idea for eigenfaces as art is to incorporate color, which will take them out of the engineering realm (because color varies too much due to lighting to be useful for recognition, I've heard), but I'm curious to see what colorful eigenfaces look like.</div></div></span>]]>
    </content>
</entry>

<entry>
    <title>real-time seam carving with openFrameworks</title>
    <link rel="alternate" type="text/html" href="http://www.masonsimon.com/mt/2008/12/real-time-seam-carving-with-op.html" />
    <id>tag:www.masonsimon.com,2008:/mt//1.18</id>

    <published>2008-12-13T22:01:28Z</published>
    <updated>2008-12-14T20:21:58Z</updated>

    <summary>As a final project for my computer graphics class last semester, I implemented a fast version of a technique called &quot;seam carving&quot;. Seam carving resizes an image by removing the least noticeable bits. I designed my seam carver to do...</summary>
    <author>
        <name>mason</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.masonsimon.com/mt/">
        <![CDATA[As a final project for <a href="http://www.cs.princeton.edu/courses/archive/spr08/cos426/">my computer graphics class last semester</a>, I implemented a fast version of a technique called <a href="http://www.faculty.idc.ac.il/arik/SCWeb/imret/index.html">"seam carving"</a>. Seam carving resizes an image by removing the least noticeable bits. I designed my seam carver to do this resizing on video streaming in from a webcam in such a way that you could remove an object from the video. Read on for my writeup, or just <a href="http://www.masonsimon.com/mt/seam%20ripper.zip">download the code</a> and try it for yourself.]]>
        <![CDATA[<iframe src="http://viewer.zoho.com/embed.jsp?f=hNdcTh" frameborder="0" width="600" height="500"></iframe>]]>
    </content>
</entry>

<entry>
    <title>How to solve &quot;unknown error&quot; when installing a device driver in Windows Vista</title>
    <link rel="alternate" type="text/html" href="http://www.masonsimon.com/mt/2008/10/how-to-solve-unknown-error-whe.html" />
    <id>tag:www.masonsimon.com,2008:/mt//1.17</id>

    <published>2008-10-28T18:27:17Z</published>
    <updated>2008-10-28T18:46:57Z</updated>

    <summary>Windows Update kept trying to upgrade my graphics card (Intel 945GM in Lenovo X60 tablet) and failing. I tried manually upgrading the driver with ones from both Intel and Lenovo, and neither worked. Here are the steps that solved my...</summary>
    <author>
        <name>mason</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.masonsimon.com/mt/">
        Windows Update kept trying to upgrade my graphics card (Intel 945GM in Lenovo X60 tablet) and failing. I tried manually upgrading the driver with ones from both Intel and Lenovo, and neither worked. Here are the steps that solved my problem:
        <![CDATA[1) Open windows explorer to "c:\Windows\inf\"<div>2) Right click "INFCACHE.1" and select "Properties"<br /></div><div>3) Go to the "Security" tab and click "Edit"</div><div>4) Select "Users" and then check "Full control" under the "Allow" column below, then hit "OK"</div><div>5) "OK" again</div><div>6) Now right click "INFCACHE.1" and "Rename" it to "INFCACHE.1.old"</div><div><br /></div><div>I also did this for "setupapi.ev1", "setupapi.ev2", "setupapi.ev3", and "drvindex.dat", but I'm not sure they're necessary.</div><div><br /></div><div>7) Try installing your driver again (you might need to restart before doing this, I'm not sure)</div><div><br /></div><div>If that works it's probably safe to delete those files you renamed to ".old" (Windows should have made fresh ones, minus the ".old" extension). Apparently that INFCACHE file can get junked up, but Windows doesn't know to recreate it unless you manually remove (or rename) it.</div><div><br /></div><div><br /></div><div>These links helped me out:</div><div><a href="http://support.microsoft.com/kb/940199">http://support.microsoft.com/kb/940199</a></div><div><a href="http://forums.logitech.com/logitech/board/message?board.id=bluetooth&amp;message.id=3755">http://forums.logitech.com/logitech/board/message?board.id=bluetooth&amp;message.id=3755</a></div><div><a href="http://www.broadbandreports.com/forum/r18594702-Vista-Corrupt-INFCACHE1">http://www.broadbandreports.com/forum/r18594702-Vista-Corrupt-INFCACHE1</a></div>]]>
    </content>
</entry>

<entry>
    <title>Random grammatical sentence generator using CFG</title>
    <link rel="alternate" type="text/html" href="http://www.masonsimon.com/mt/2008/10/random-grammatical-sentence-ge.html" />
    <id>tag:www.masonsimon.com,2008:/mt//1.16</id>

    <published>2008-10-18T06:47:09Z</published>
    <updated>2008-10-18T18:13:32Z</updated>

    <summary>Context-free grammars (CFGs) can be used as a model for natural language. That means they capture the structure of language in a relatively simple form that can be reasoned about and used to generate new instances of natural language. My natural...</summary>
    <author>
        <name>mason</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.masonsimon.com/mt/">
        <![CDATA[<a href="http://en.wikipedia.org/wiki/Context-free_grammar">Context-free grammars</a> (CFGs) can be used as a model for natural language. That means they capture the structure of language in a relatively simple form that can be reasoned about and used to generate new instances of natural language. My natural language processing book says CFGs were proven insufficient for modeling German spoken in Zurich (<a href="http://www.amazon.com/gp/product/0131873210?ie=UTF8&amp;tag=dorcod-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0131873210">Speech and Language Processing (2nd Edition)</a>, p.538), but they're good enough to bring you the following silly, random, grammatical sentences:]]>
        <![CDATA[<script>

function randInt(low_bound_inclusive, high_bound_inclusive) {
    var range = high_bound_inclusive - low_bound_inclusive;
    var r = Math.random();
    r = r * range;
    r = r + low_bound_inclusive;
    r = Math.round(r);
    return r;
}



proper_nouns = [
    'John',
    'Mary'
];

nominals = [
    'fish',
    'cat',
    'dog',
    'zebra',
    'horse',
    'donkey',
    'giraffe',
    'walrus',
];

determiners = [
    'the',
    'a',
];

past_tense_verbs = [
    'ate',
    'dragged in',
    'befriended',
    'saluted',
];

// cfg maps between a non-terminal symbol and the list of expansions it can have
cfg = {
    'S': ['NP VP'],
    'NP': ['DN', 'PN'],
    'DN': ['DET N', 'DET N that NP V'],
    'PN': proper_nouns,
    'VP': ['V NP'],
    'V': past_tense_verbs,
    'DET': determiners,
    'N': nominals,
}
var nonterminals = [
    'S',
    'PN',
    'VP',
    'V',
    'NP',
    'DET',
    'N', 
    'DN',
];


function generate(g) {
    var tokens = g.split(' ');
    for (var i = 0; i < tokens.length; i++) { var token = tokens[i];
        for (var j = 0; j < nonterminals.length; j++) {
            var nonterminal = nonterminals[j];
            if (token === nonterminal) {
                // select one of the possible expansions of token to use
                var expansions = cfg[nonterminal];
                var expansion = expansions[randInt(0, expansions.length-1)];

                // now replace this instance of token with a recursive expansion of its expansion
                g = g.replace(token, generate(expansion));
                break;
            }
        }
        // if no nonterminal matched, then token was a terminal symbol
    }
    // all nonterminal symbols have been replaced by terminal ones
    return g;
}

document.writeln('<ul>');
for (var i = 0; i < 5; i++) {
  var sentence = generate('S');
  document.writeln('<li>' + sentence + '</li>');
}
document.writeln('</ul>');
</script>

They may not make sense. They may be hard to understand. But they should be grammatical. <div><br /></div><div>Refresh to see more. View source to see how it's done.</div>]]>
    </content>
</entry>

<entry>
    <title>Is the Problem of Other Minds a problem?</title>
    <link rel="alternate" type="text/html" href="http://www.masonsimon.com/mt/2008/09/is-the-problem-of-other-minds.html" />
    <id>tag:www.masonsimon.com,2008:/mt//1.15</id>

    <published>2008-09-27T17:37:51Z</published>
    <updated>2008-09-27T16:50:38Z</updated>

    <summary>The Book of Tea contains an excerpt I love:One day Soshi was walking on the bank of a river with a friend. &quot;How delightfully the fishes are enjoying themselves in the water!&quot; exclaimed Soshi. His friend spake to him thus:...</summary>
    <author>
        <name>mason</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.masonsimon.com/mt/">
        <![CDATA[<div><a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&amp;location=http%3A%2F%2Fwww.amazon.com%2FBook-Tea-Kakuzo-Okakura%2Fdp%2F4990284836%3Fie%3DUTF8%26s%3Dbooks%26qid%3D1222533715%26sr%3D8-1&amp;tag=dorcod-20&amp;linkCode=ur2&amp;camp=1789&amp;creative=9325">The Book of Tea</a><img src="http://www.assoc-amazon.com/e/ir?t=dorcod-20&amp;l=ur2&amp;o=1" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /> contains an excerpt I love:</div><div><br /></div>One day Soshi was walking on the bank of a river with a friend. "How delightfully the fishes are enjoying themselves in the water!" exclaimed Soshi. His friend spake to him thus: "You are not a fish; how do you know that the fishes are enjoying themselves?" "You are not myself," returned Soshi; "how do you know that I do not know that the fishes are enjoying themselves?"]]>
        
    </content>
</entry>

<entry>
    <title>Find yourself in photos of the SF Marathon (more coming soon)</title>
    <link rel="alternate" type="text/html" href="http://www.masonsimon.com/mt/2008/09/find-yourself-in-photos-of-the.html" />
    <id>tag:www.masonsimon.com,2008:/mt//1.14</id>

    <published>2008-09-11T16:10:57Z</published>
    <updated>2008-09-27T16:56:19Z</updated>

    <summary>I ran the half-marathon in San Francisco this past summer. It was amazing. Afterwards I wanted pictures to remember it by--specifically, pictures that had me in them to remember my experience. Before the race, MarathonFoto informed me that &quot;you and your...</summary>
    <author>
        <name>mason</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.masonsimon.com/mt/">
        <![CDATA[<p>I ran the half-marathon in San Francisco this past summer. It was amazing. Afterwards I wanted pictures to remember it by--specifically, pictures that had <b>me</b> in them to remember <b>my</b> experience. Before the race, <a href="http://www.marathonfoto.com" rel="nofollow">MarathonFoto</a> informed me that "you and your family will not have to worry about trying to capture your special race moments" because they would take pictures. Great! They neglected to mention those pictures would cost $40 each to download.</p>

<p>I liked the pictures, but that heads-up they gave before the race was slimy. I wondered, "how can I make a better, cheaper service for finding photos of myself (and put these guys out of business :P)?" The result is <a href="http://www.bibfind.com">bibfind.com</a>: a crowd-sourced photo tagging system that uses the bib numbers worn by runners to identify them in photos.</p>]]>
        <![CDATA[<span class="Apple-style-span" style="border-collapse: collapse; color: rgb(0, 0, 0); "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(51, 51, 51);">I like to say it's powered by our collective narcissism. When you go to <a href="http://www.bibfind.com" style="text-decoration: underline; ">bibfind.com</a> you get to select the race you ran and enter the bib number you'd like to see photos of. But before you get to see those photos, you've got to look at some random photos from the race, and tag them with the bib numbers you see. Then you are shown the photos you searched for (assuming such photos exist and have been tagged).</span></span><div><br /></div><div>At this point the only photos in the system are ones posted on <a href="http://flickr.com">flickr</a> of the SF Marathon, but I'll expand to other races and photo services when the site is ripe enough. If you ran the SF Marathon or know anyone who did, try to find yourself at <a href="http://www.bibfind.com" style="text-decoration: underline; ">bibfind.com</a>. If you just want to check the site out, try searching for bib #  8685; you'll see a hilarious photo.</div><div><br /></div><div>If you've got any questions or suggestions, leave a comment here or use the link at the bottom of the site to put in feedback.</div>]]>
    </content>
</entry>

<entry>
    <title>Automatic style-checking with Strunk and White&apos;s rules</title>
    <link rel="alternate" type="text/html" href="http://www.masonsimon.com/mt/2008/09/automatic-style-checking-with.html" />
    <id>tag:www.masonsimon.com,2008:/mt//1.13</id>

    <published>2008-09-05T18:15:49Z</published>
    <updated>2008-09-06T18:04:45Z</updated>

    <summary>I read The Elements of Style by Strunk and White to get better at writing. The biggest section is on common misuses of words and expressions in English. I thought the section was valuable, but more than I&apos;d be able...</summary>
    <author>
        <name>mason</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.masonsimon.com/mt/">
        <![CDATA[<p>I read <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&amp;location=http%3A%2F%2Fwww.amazon.com%2FElements-Style-Third-William-Strunk%2Fdp%2F0024181900%3Fie%3DUTF8%26s%3Dbooks%26qid%3D1220631204%26sr%3D8-2&amp;tag=dorcod-20&amp;linkCode=ur2&amp;camp=1789&amp;creative=9325">The Elements of Style by Strunk and White</a><img style="margin: 0px; border-top-style: none! important; border-right-style: none! important; border-left-style: none! important; border-bottom-style: none! important" height="1" alt="" src="http://www.assoc-amazon.com/e/ir?t=dorcod-20&amp;l=ur2&amp;o=1" width="1" border="0" /> to get better at writing. The biggest section is on common misuses of words and expressions in English. I thought the section was valuable, but more than I'd be able to keep in my head while writing. To solve that problem, I made a script that analyzes some given text and then annotates each potential misuse with a link to Strunk's guidance.</p> ]]>
        <![CDATA[<script>







	// this is a list of commonly misused expressions' names and definitions (in regex form), each with a link giving detail on usage
	var cm = [
		['All right',
		 /\bal(l )?right/gi,
		 'http://crockford.com/wrrrld/style5.html#1'],

		['As good or better than',
		 /\bas good or better than/gi,
		 'http://crockford.com/wrrrld/style5.html#2'],

		['As to whether',
		 /\bas to whether/gi,
		 'http://crockford.com/wrrrld/style5.html#3'],

		['Bid',
		 /\b(?:bid|bade)\b/gi,
		 'http://crockford.com/wrrrld/style5.html#4'],

		['Case',
		 /\bcases?\b/gi,
		 'http://crockford.com/wrrrld/style5.html#5'],

		['Certainly',
		 /\bcertainly\b/gi,
		 'http://crockford.com/wrrrld/style5.html#6'],

		['Character',
		 /\bcharacter\b/gi,
		 'http://crockford.com/wrrrld/style5.html#7'],

		['Claim, vb.',
		 /\bclaim(?:ed)?\b/gi,
		 'http://crockford.com/wrrrld/style5.html#8'],

		['Compare',
		 /\bcompare\b/gi,
		 'http://crockford.com/wrrrld/style5.html#9'],

		['Clever',
		 /\bclever\b/gi,
		 'http://crockford.com/wrrrld/style5.html#10'],

		['Consider',
		 /\bconsider(?:ed)?\b/gi,
		 'http://crockford.com/wrrrld/style5.html#11'],

		['Dependable',
		 /\bdependable\b/gi,
		 'http://crockford.com/wrrrld/style5.html#12'],

		['Due to',
		 /\bdue to\b/gi,
		 'http://crockford.com/wrrrld/style5.html#13'],

		['Effect',
		 /\b(?:effect|affect)\b/gi,
		 'http://crockford.com/wrrrld/style5.html#14'],

		['Etc',
		 /\betc\.*\b/gi,
		 'http://crockford.com/wrrrld/style5.html#15'],

		['Fact',
		 /\bfact\b/gi,
		 'http://crockford.com/wrrrld/style5.html#16'],

		['Factor',
		 /\bfactor\b/gi,
		 'http://crockford.com/wrrrld/style5.html#17'],

		['Feature',
		 /\bfeature\b/gi,
		 'http://crockford.com/wrrrld/style5.html#18'],

		['Fix',
		 /\bfix\b/gi,
		 'http://crockford.com/wrrrld/style5.html#19'],

		['He is a man who',
		 /\bis a \w+ (?:who|which)\b/gi,
		 'http://crockford.com/wrrrld/style5.html#20'],

		['However',
		 /\bhowever\b/gi,
		 'http://crockford.com/wrrrld/style5.html#21'],

		['Kind of',
		 /\b(?:kind of|sort of)\b/gi,
		 'http://crockford.com/wrrrld/style5.html#22'],

		['Less',
		 /\b(?:less|fewer)\b/gi,
		 'http://crockford.com/wrrrld/style5.html#23'],

		['Line, along these lines',
		 /\balong (?:these|those|the)(?: same)? lines?\b/gi,
		 'http://crockford.com/wrrrld/style5.html#24'],

		['Literal, literally',
		 /\bliteral(?:ly)?\b/gi,
		 'http://crockford.com/wrrrld/style5.html#25'],

		['Lose out',
		 /\blose out\b/gi,
		 'http://crockford.com/wrrrld/style5.html#26'],

		['Most',
		 /\bmost\b/gi,
		 'http://crockford.com/wrrrld/style5.html#27'],

		['Nature',
		 /\bnature\b/gi,
		 'http://crockford.com/wrrrld/style5.html#28'],

		['Near by',
		 /\bnear ?by\b/gi,
		 'http://crockford.com/wrrrld/style5.html#29'],

		['Oftentimes, ofttimes',
		 /\b(?:oftentimes|ofttimes)\b/gi,
		 'http://crockford.com/wrrrld/style5.html#30'],

		['One hundred and one',
		 /\bone[ -]hundred(?:[ -]and)?[ -]one\b/gi,
		 'http://crockford.com/wrrrld/style5.html#31'],

		['One of the most',
		 /\bone of the most\b/gi,
		 'http://crockford.com/wrrrld/style5.html#32'],

		['People',
		 /\bthe (?:people|public)\b/gi,
		 'http://crockford.com/wrrrld/style5.html#33'],

		['Phase',
		 /\bphase\b/gi,
		 'http://crockford.com/wrrrld/style5.html#34'],

		['Possess',
		 /\bposses(?:ed|or)?\b/gi,
		 'http://crockford.com/wrrrld/style5.html#35'],

		['Respective, respectively',
		 /\brespective(?:ly)?\b/gi,
		 'http://crockford.com/wrrrld/style5.html#36'],

		['So (for emphasis)',
		 /\bso\b/gi,
		 'http://crockford.com/wrrrld/style5.html#37'],

		['State',
		 /\bstate\b/gi,
		 'http://crockford.com/wrrrld/style5.html#39'],

		['Student body',
		 /\bstudent body\b/gi,
		 'http://crockford.com/wrrrld/style5.html#40'],

		['System',
		 /\bsystem\b/gi,
		 'http://crockford.com/wrrrld/style5.html#41'],

		['Thanking you in advance',
		 /\b(?:thanking you in advance|thanks in advance|TIA)\b/gi,
		 'http://crockford.com/wrrrld/style5.html#42'],

		['They',
		 /\b(?:they|he or she|him or her|his or hers?)\b/gi,
		 'http://crockford.com/wrrrld/style5.html#43'],

		['Very',
		 /\bvery\b/gi,
		 'http://crockford.com/wrrrld/style5.html#44'],

		['Viewpoint',
		 /\bviewpoint\b/gi,
		 'http://crockford.com/wrrrld/style5.html#45'],

		['While',
		 /\bwhile\b/gi,
		 'http://crockford.com/wrrrld/style5.html#46'],

		['Whom',
		 /\bwhom\b/gi,
		 'http://crockford.com/wrrrld/style5.html#47'],

		['Worth while',
		 /\bworth ?while\b/gi,
		 'http://crockford.com/wrrrld/style5.html#48'],

		['Would',
		 /\b(?:would|should)\b/gi,
		 'http://crockford.com/wrrrld/style5.html#49'],
	];

	
	var N = cm.length;
	N = 48; // for some reason Windows Live Writer was counting wrong so I had to manually set this

	function analyze_and_annotate_text(text) {
		text = text.replace(/\n/g, '<br/ / / />');
		var out = document.getElementById('output');
		for (var i = 0; i < N-1; i+=1) {
			var name = cm[i][0],
			    regex = cm[i][1],
			    link = cm[i][2];
			text = text.replace(regex, '$& [<a href='+link+'>'+name+'</a>]');
		}
		out.innerHTML = text;
	}</script>  <div>In the box below, type or paste the text to style-check.    <br /><textarea id="text_to_check" rows="15" cols="50">Would you consider trying this out to see if it's worthwhile?</textarea><button onclick="analyze_and_annotate_text(document.getElementById('text_to_check').value)">style-check</button>     <p>The text you entered above is reproduced below. Inserted after each potential misuse is an annotation pointing you to the relevant comment by Strunk.</p>    <br />    <div id="output"></div>    <p></p> </div>]]>
    </content>
</entry>

<entry>
    <title>Making whitespace meaningful in order of operations</title>
    <link rel="alternate" type="text/html" href="http://www.masonsimon.com/mt/2008/08/making-whitespace-meaningful-i.html" />
    <id>tag:www.masonsimon.com,2008:/mt//1.12</id>

    <published>2008-08-30T04:23:06Z</published>
    <updated>2008-09-06T17:55:46Z</updated>

    <summary>Of all the mundane details that programming bothers me with, operator precedence/arithmetical order of operations pisses me off the most. Pardon the vulgarity, but if you&apos;ve ever had to wonder whether 5 + 6 * 2 was equal to 22...</summary>
    <author>
        <name>mason</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.masonsimon.com/mt/">
        <![CDATA[<p>Of all the mundane details that programming bothers me with, operator precedence/arithmetical order of operations pisses me off the most. Pardon the vulgarity, but if you've ever had to wonder whether 5 + 6 * 2 was equal to 22 or 17, or even worse--had a bug caused by guessing wrong in that sort of situation, you know how I feel.</p>  <p> </p>  ]]>
        <![CDATA[<p>I like using whitespace to disambiguate that sort of expression for myself, as in 5+6 * 2 (note the lack of space between "5", "+", and "2"). This works great; the "5+6" groups together to our eyes because of the lack of space, and is clearly separate from the "*" and "2" because of the intervening whitespace. (If you're interested: this sort of thing was studied by the German Gestalt psychologists.) The problem with using a scheme like this isn't that it doesn't work for us--it works great; the problem is that all programming languages I know of disregard the information contained in the whitespace. So while I'd say 5+6 * 2 equals 22, the computer would say otherwise.</p>  <p> </p>  <p>Steve McConnell recommends you "use more parentheses than you think you need" (pg738 in <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&amp;location=http%3A%2F%2Fwww.amazon.com%2FCode-Complete-Practical-Handbook-Construction%2Fdp%2F0735619670%2F&amp;tag=dorcod-20&amp;linkCode=ur2&amp;camp=1789&amp;creative=9325">Code Complete, 2nd edition</a><img style="margin: 0px; border-top-style: none! important; border-right-style: none! important; border-left-style: none! important; border-bottom-style: none! important" height="1" alt="" src="http://www.assoc-amazon.com/e/ir?t=dorcod-20&amp;l=ur2&amp;o=1" width="1" border="0" />). That solution is very practical, but it amounts to giving in to the language. I'm an idealistic young kid, and I think we should make the languages suit us instead of changing ourselves to suit the languages. I've also taken enough philosophy courses that just thinking bores me, so here's some action:</p>  <p> </p>  <div><script type="text/javascript">

	function thoughtful_evaluate(expression) {
		var x = '';
		var chunks = expression.split(/\s/);
		for (i in chunks) {	var chunk = chunks[i];
			if (chunk.match(/^[\+\-\/\*]$/) != null)
				// this chunk is a single operator
				x += chunk;
			else
				x += eval(chunk);
		}
		return eval(x);
	}

	function compute_results() {
		var x = document.getElementById('t').value;

		if (x.match(/^[1234567890\+\-\/\*\s]*$/) == null) {
			alert('invalid expression; only numbers and arithmetic operators are allowed.');
		}

		document.getElementById('standard_result').innerHTML = eval(x);
		document.getElementById('thoughtful_result').innerHTML = thoughtful_evaluate(x);
	}</script>Type an arithmetic expression in the box below and then click "evaluate".     <br /><input value="5+6 * 2" id="t" /><button onclick="compute_results();">evaluate</button>     <br />Below, you see the results of evaluating the above expression under two different schemes: <a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Operators/Operator_Precedence#Table">JavaScript's standard order of operations</a> and my "thoughtful" order of operations which groups expressions based on whitespace.     <table><tbody>       <tr>         <td><b>standard</b></td>          <td id="standard_result"> </td>       </tr>        <tr>         <td><b>thoughtful</b></td>          <td id="thoughtful_result"> </td>       </tr>     </tbody></table> </div>  <p> </p>  <p>The code that accomplishes this feat is simple; view source to see exactly how it's done. The heavy lifting is accomplished in under 10 lines of code, and those aren't very dense lines either.</p>  <p> </p>  <p>Now the real question is, will I find some open source language and implement this thoughtful grouping? We'll see...</p>]]>
    </content>
</entry>

<entry>
    <title>Spatial Frequency in Vision and (a bit about) Art</title>
    <link rel="alternate" type="text/html" href="http://www.masonsimon.com/mt/2008/08/spatial-frequency-in-vision-an.html" />
    <id>tag:www.masonsimon.com,2008:/mt//1.11</id>

    <published>2008-08-15T22:19:44Z</published>
    <updated>2008-09-27T16:53:58Z</updated>

    <summary>I just gave a presentation in my Cognitive Neuroscience course at Stanford about Oliva and Schyns&apos; paper &quot;Coarse Blobs or Fine Edges? Evidence That Information Diagnosticity Changes the Perception of Complex Visual Stimuli&quot;, doi:10.1006/cogp.1997.0667. I was happy with the presentation, so...</summary>
    <author>
        <name>mason</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.masonsimon.com/mt/">
        <![CDATA[<p>I just gave a presentation in my Cognitive Neuroscience course at Stanford about Oliva and Schyns' paper <a href="http://dx.doi.org/10.1006/cogp.1997.0667">"Coarse Blobs or Fine Edges? Evidence That Information Diagnosticity Changes the Perception of Complex Visual Stimuli", doi:10.1006/cogp.1997.0667</a>. I was happy with the presentation, so I post my slides here for anyone who's interested.</p> ]]>
        <![CDATA[<iframe src="http://docs.google.com/EmbedSlideshow?docid=dc7zxs8q_498894pwcp&amp;size=m" frameborder="0" width="555" height="451"></iframe>]]>
    </content>
</entry>

<entry>
    <title>iphone call data visualization</title>
    <link rel="alternate" type="text/html" href="http://www.masonsimon.com/mt/2008/07/iphone-call-data-visualization.html" />
    <id>tag:www.masonsimon.com,2008:/mt//1.10</id>

    <published>2008-07-31T05:54:40Z</published>
    <updated>2008-09-06T17:57:07Z</updated>

    <summary>I read Edward Tufte&apos;s book The Visual Display of Quantitative Information, and afterwards I was burning to visualize some data. I settled on charting the time of day that I make phone calls at.  ...</summary>
    <author>
        <name>mason</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.masonsimon.com/mt/">
        <![CDATA[<p>I read Edward Tufte's book <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&amp;location=http%3A%2F%2Fwww.amazon.com%2FVisual-Display-Quantitative-Information-2nd%2Fdp%2F0961392142%3Fie%3DUTF8%26s%3Dbooks%26qid%3D1217475484%26sr%3D8-1&amp;tag=dorcod-20&amp;linkCode=ur2&amp;camp=1789&amp;creative=9325">The Visual Display of Quantitative Information</a><img style="margin: 0px; border-top-style: none! important; border-right-style: none! important; border-left-style: none! important; border-bottom-style: none! important" height="1" alt="" src="http://www.assoc-amazon.com/e/ir?t=dorcod-20&amp;l=ur2&amp;o=1" width="1" border="0" />, and afterwards I was burning to visualize some data. I settled on charting the time of day that I make phone calls at.</p>  <p> </p>  <h2></h2>  ]]>
        <![CDATA[<h3><strong>the graphic</strong></h3>  <p><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="784" alt="call graphic" src="http://www.masonsimon.com/mt/WindowsLiveWriter/iphonecalldatavisualization_121B1/call%20graphic_3.png" width="388" align="right" border="0" />Thinking about this data, it occurred to me that a simple bar chart or histogram would be inappropriate, because I'd have to choose some arbitrary point at which to start drawing the bars, say midnight, with the result that 11pm would end up on the other side of the chart. That would be wrong, because in reality one comes right after the other. To solve that problem, I decided to plot my calls in a circle. The result is that the angular distance between two data measures on the chart corresponds directly with their temporal distance (fancy term isn't it?).</p>  <p> </p>  <p>Similarly, the "small multiple" (Tufte's term) plots for each weekday are arranged in a flattened clockwise loop to keep temporally adjacent days near to each other.</p>  <p> </p>  <p>Initially, I envisioned this plot as a circular histogram, and that's how I coded it. Then I had the idea of making those small multiple plots for the individual days, and I realized that I'd need to use a consistent scale for comparisons between those plots to be meaningful. So it turned into a circular bar chart.</p>  <p> </p>  <p>I liked the way that looked, but one of Tufte's points kept nagging me: he says that the amount of visual real-estate you give to the representations of your data points should be directly proportional to the magnitude of those data points (I'm paraphrasing, accurately I hope). Looking at my circular bar chart, I realized that I was violating that principle, and that he was right about it. I varied the radius of each circular "bar" in proportion to the amount of calls during the corresponding hour, but the area of a pie slice (segment of a circle) is proportional to the square of the radius of the pie. That means that the area of the circular bar for an hour with 5 calls would be less than half the area for the circular bar representing 10 calls. So I scrapped the bars in favor of lines; they're one-dimensional, and so are the data they represent.</p>  <p> </p>  <p>The lines for daytime hours are colored in shades of yellow, and nighttime ones in shades of blue. Tufte says that most people can distinguish blue from other colors, even if they're colorblind, and as a bonus, there's some semantic relationship between those colors and the hours of the day they correspond with (skycolor). Unfortunately the yellow is hard to see against a white background. Expletive deleted.</p>  <p> </p>  <h3><strong>the making of</strong></h3>  <p>To get at my phone's call data, I mangled mrflip's perl code for extracting the SQLite database from the iphone's backup files (see <a href="http://groups.google.com/group/iphonewebdev/browse_thread/thread/ee513eec0f7b4f94/514ace960061bce8?lnk=gst&amp;q=extract">this thread</a>). Then I put together some python scripts to digest the call data into a form that's conducive to charting and send it down the pipeline to a buggy little piece of <a href="http://processing.org">Processing</a> code that draws the actual graphics. The bugs have to do with the calculation of the low, median, and high values that are labeled on the charts, but I touched up the graphic in Photoshop to mask the issues.</p>  <p> </p>  <p>That cover-up was a profound philosophical moment for me. I had the option of tightening my code to handle all cases, pass all unit tests (hah! as if I wrote those), and be prepared for use by total strangers. But as the gears in my mind spun up to design this bulletproof algorithm, the monkeywrench of cool rationality fell in. Taking that code from functional with bugs to bugless would have taken a disproportionate amount of time. I'm ok with mostly bugless, because this code is throwaway; it was just a tool I made as one step in the process of generating the chart.</p>  <p> </p>  <p>This is what I like most about being able to code: if I don't have the tools I need to make something, I can make the tools.</p>]]>
    </content>
</entry>

<entry>
    <title>WANTED: Engineer to make wildest fantasies reality</title>
    <link rel="alternate" type="text/html" href="http://www.masonsimon.com/mt/2008/07/wanted-engineer-to-make-wildes.html" />
    <id>tag:www.masonsimon.com,2008:/mt//1.9</id>

    <published>2008-07-07T18:33:35Z</published>
    <updated>2008-09-12T00:35:05Z</updated>

    <summary>As a software engineer with experience doing web development, I hear a lot of people with ideas for hot new websites. In most of these situations where there&apos;s an idea looking for someone to implement it, I get the sense...</summary>
    <author>
        <name>mason</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://www.masonsimon.com/mt/">
        <![CDATA[<p>As a software engineer with experience doing web development, I hear a lot of people with ideas for hot new websites. In most of these situations where there's an idea looking for someone to implement it, I get the sense that the software engineer's point of view isn't understood. Here's my edited response to a request for someone with spare time to implement an idea that was described at the level of detail of requiring community features and that users be able to upload content:</p>]]>
        <![CDATA[<p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; margin-top: 0px; margin-right: 0px; margin-bottom: 0.75em; margin-left: 0px; ">--------------------------</p><p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; margin-top: 0px; margin-right: 0px; margin-bottom: 0.75em; margin-left: 0px; ">Let me start by saying that I think it's great that neat opportunities for web developers are posted on this list. Keep 'em coming! But as a software engineer I tend to have reservations about "I have an idea; now I need an <br />engineer" type requests, so I thought I'd lay out my thought process here for the benefit of everyone. Before I start, a caveat: I may not be representative of all web developers; I believe there are websites where you can go to post a job description and have someone remotely code your site for you, but I'm not the sort of engineer that looks for jobs there, so please take what I have to say with this in mind.</p><p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; margin-top: 0px; margin-right: 0px; margin-bottom: 0.75em; margin-left: 0px; ">First question I usually have is "what's the idea?" I have a mountain of ideas to implement whenever I find the time and inclination, so an overly vague description is unlikely to get me interested. Of course I understand the desire to protect your idea, but for me at least, the description has to be more of a sales pitch than a "need handyman to build 4'x6' doghouse"-style ad in the paper.</p><p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; margin-top: 0px; margin-right: 0px; margin-bottom: 0.75em; margin-left: 0px; ">The secrecy also raises a big red flag for me. I think: he's protecting the idea, so he's in love with it, and without any detail on his background, I have to assume that the idea person ("Idea" from now on) is non-technical. <br />From that combination I conclude that I'll have to do more work than Idea realizes and thus suggests, Idea will be frustrated by the slow rate of progess relative to his expectations, AND Idea will believe that the idea is worth at least as much as my implementation (which is taking so damn long!), so he'll be unwilling to give up an appropriate amount of equity/cash. All of these conclusions might be wrong. Idea might be a PhD in CS who got an MBA, now works at a nice consulting firm, and just wants to do this idea on the side but doesn't have time to code it himself. But I need to hear this up front, otherwise I assume the worst (described above) and nothing is going to get me to play a role in that sad story.</p><p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; margin-top: 0px; margin-right: 0px; margin-bottom: 0.75em; margin-left: 0px; ">After that initial stuff is out of the way, I'm curious what I can expect from this project. Is it going to be fun from a technical standpoint? Web development involves a lot of mindless drudgery, particularly when it comes to tweaking the visual aspects of a website. So either the idea should be so exciting that I won't mind that stuff, there should be a graphic designer taking care of front-end details, or the financial prospects have to be good enough that I can slog through it (but this option is probably not the most preferable). Which brings me to...</p><p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; margin-top: 0px; margin-right: 0px; margin-bottom: 0.75em; margin-left: 0px; ">What's it going to pay? I'm not necessarily interested in exact dollars, but more, what sort of cash-equity combination is it. If it's all cash, this might be the sort of job for one of those rent-a-coder websites; if it's all equity, then how will my equity compare to Idea's? If it's not all one or the other, what sort of mix is it (and I'm still interested in how my proportion compares to Idea's)? If the equity is significant (and it probably should be to get our interests aligned) then sell me on the business merits. I've already got a fancy piece of paper entitling me to thousands of shares in a tech-startup, so if you want to sell me another, it had better be even fancier (I'm joking :P) or I also need to be convinced that yours will be worth the ink it's printed with.</p><p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; margin-top: 0px; margin-right: 0px; margin-bottom: 0.75em; margin-left: 0px; ">--------------------------</p><p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; margin-top: 0px; margin-right: 0px; margin-bottom: 0.75em; margin-left: 0px; "> </p><p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1em; font-weight: normal; margin-top: 0px; margin-right: 0px; margin-bottom: 0.75em; margin-left: 0px; ">Hopefully that gave you a peek into the software engineer's perspective on ideas needing an engineer, because propositions that take this perspective into account are way more likely to get my attention (and other engineers too I'd guess). It probably sounded one-sided, because I'm sure I'm biased here. I understand that we engineer's need business people too; there are plenty of business administration tasks that I'm sure I'd find even less interesting than making the corners on some box render correctly across all the browsers out there. So good luck with whatever idea you're pursuing!</p>]]>
    </content>
</entry>

</feed>
