<?xml version="1.0"?>
<?xml-stylesheet href="/transform" type="text/xsl"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:bibo="http://purl.org/ontology/bibo/" xmlns:bs="http://purl.org/ontology/bibo/status/" xmlns:ci="https://vocab.methodandstructure.com/content-inventory#" xmlns:dct="http://purl.org/dc/terms/" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xhv="http://www.w3.org/1999/xhtml/vocab#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" lang="en" prefix="bibo: http://purl.org/ontology/bibo/ bs: http://purl.org/ontology/bibo/status/ ci: https://vocab.methodandstructure.com/content-inventory# dct: http://purl.org/dc/terms/ foaf: http://xmlns.com/foaf/0.1/ rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# xhv: http://www.w3.org/1999/xhtml/vocab# xsd: http://www.w3.org/2001/XMLSchema#" vocab="http://www.w3.org/1999/xhtml/vocab#" xml:lang="en">
  <head>
    <title property="dct:title">Two Expedient, Desirable Products</title>
    <base href="https://doriantaylor.com/two-expedient-desirable-products"/>
    <link href="document-stats#E-E_XIh_KUDfR8XiHZvdXJ" rev="ci:document"/>
    <link href="elsewhere" rel="alternate bookmark" title="Elsewhere"/>
    <link href="this-site" rel="alternate index" title="This Site"/>
    <link href="http://purl.org/ontology/bibo/status/published" rel="bibo:status"/>
    <link href="" rel="ci:canonical" title="Two Expedient, Desirable Products"/>
    <link href="lexicon/#EgKBzmX3EeQ5uHb5NelbqL" rel="dct:audience" title="Project Manager"/>
    <link href="lexicon/#EzqXIsriaILFcWjXdS7FbI" rel="dct:audience" title="Software Developer"/>
    <link href="person/dorian-taylor#me" rel="dct:creator" title="Dorian Taylor"/>
    <link href="person/dorian-taylor" rel="meta" title="Who I Am"/>
    <link about="./" href="3f36c30c-6096-454a-8a22-c062100ae41f" rel="alternate" type="application/atom+xml"/>
    <link about="./" href="f07f5044-01bc-472d-9079-9b07771b731c" rel="alternate" type="application/atom+xml"/>
    <link about="./" href="this-site" rel="alternate"/>
    <link about="./" href="elsewhere" rel="alternate"/>
    <link about="./" href="e341ca62-0387-4cea-b69a-cdabc7656871" rel="alternate" type="application/atom+xml"/>
    <link about="verso/" href="3f36c30c-6096-454a-8a22-c062100ae41f" rel="alternate" type="application/atom+xml"/>
    <link about="verso/" href="this-site" rel="alternate"/>
    <link about="verso/" href="elsewhere" rel="alternate"/>
    <meta content="two-expedient-desirable-products" datatype="xsd:token" property="ci:canonical-slug"/>
    <meta content="In order to promote my principle of expedient desirable products, I figured it would make sense to begin providing some." name="description" property="dct:abstract"/>
    <meta content="2010-04-12T07:12:11+00:00" datatype="xsd:dateTime" property="dct:created"/>
    <meta content="two-expedient-desirable-products" property="dct:identifier"/>
    <meta content="2010-04-12T09:36:19+00:00" datatype="xsd:dateTime" property="dct:issued"/>
    <meta content="2010-04-12T07:14:52+00:00" datatype="xsd:dateTime" property="dct:modified"/>
    <meta content="2010-04-12T07:16:41+00:00" datatype="xsd:dateTime" property="dct:modified"/>
    <meta content="2010-04-12T09:37:41+00:00" datatype="xsd:dateTime" property="dct:modified"/>
    <meta content="2010-04-21T19:25:00+00:00" datatype="xsd:dateTime" property="dct:modified"/>
    <meta content="2022-05-31T04:18:52+00:00" datatype="xsd:dateTime" property="dct:modified"/>
    <meta content="2022-05-31T15:10:50+00:00" datatype="xsd:dateTime" property="dct:modified"/>
    <meta about="person/dorian-taylor#me" content="Dorian Taylor" name="author" property="foaf:name"/>
    <meta content="summary" name="twitter:card"/>
    <meta content="@doriantaylor" name="twitter:site"/>
    <meta content="Two Expedient, Desirable Products" name="twitter:title"/>
    <meta content="In order to promote my principle of expedient desirable products, I figured it would make sense to begin providing some." name="twitter:description"/>
    <object>
      <nav>
        <ul>
          <li>
            <a href="document-stats#E-E_XIh_KUDfR8XiHZvdXJ" rev="ci:document" typeof="qb:Observation">
              <span>urn:uuid:f84fd722-1fca-4503-97d1-f1788766f757</span>
            </a>
          </li>
        </ul>
      </nav>
    </object>
  </head>
  <body about="" id="EGojlKNpUYmcgcD7BaveoL" typeof="bibo:Article">
    <section id="E3pTMch5RGKO06puDIyzZK">
      <p>The <a href="http://www.ribbonfarm.com/2010/03/01/the-expedient-desirable-product/" title="Expedient Desirable Product" rel="dct:references">expedient desirable product</a> is a principle of software acquisition I coined in response to <a rel="dct:references" href="http://www.startuplessonslearned.com/" title="Lessons Learned">Eric Ries'</a> <a href="http://www.startuplessonslearned.com/2009/08/minimum-viable-product-guide.html" title="Lessons Learned: Minimum Viable Product: a guide" rel="dct:references">minimum viable product</a>. Distilled into two accessible sentences, it would go something like this:</p>
      <blockquote id="ENvOZiChEQFeMXnMcIzWaI">
        <p style="font-weight: bold">Forget trying to stay <em>on-task</em> and don't waste time vacillating over what constitutes the minimum set of features. What do I have the means to make <em>right now</em> and deliver <em>today</em> that will have <em>some</em> value, either to my customer or to improve my own process?</p>
      </blockquote>
      <p>Over the last few days I've made a couple things that scratched two annoying itches, and I share them here for anybody interested.</p>
    </section>
    <section id="toggle-executable-bit-in-emacs">
      <h2>Toggle Executable Bit in Emacs</h2>
      <p>When I program, <a href="http://www.gnu.org/software/emacs/" title="GNU Emacs - GNU Project - Free Software Foundation (FSF)" rel="dct:references">I use Emacs</a>. When I write a program <span class="parenthesis" title="which is almost all the time">in an <a href="http://en.wikipedia.org/wiki/Interpreted_language" title="Interpreted language &#x2014; Wikipedia" rel="dct:references">interpreted language</a></span>, possibly even another <em>expedient desirable product</em>, I want to use it right away. I continually find myself switching into a <a href="http://en.wikipedia.org/wiki/Computer_terminal" title="Computer terminal &#x2014; Wikipedia" rel="dct:references">terminal window</a> to run the program I'm working on only to find that I have neglected to set it to executable. I stumble and grumble, apply <a href="http://en.wikipedia.org/wiki/Chmod" title="chmod &#x2014; Wikipedia" rel="dct:references"><kbd>chmod</kbd></a> and continue on my way, ever so slightly irritated. Wouldn't it be nice to be able to have the file set to executable <em>before</em> I switch to my terminal?</p>
      <p>That's exactly the problem I set out to solve. I took about an hour and a half, which was probably entirely too long. I probably also replicated existing Emacs functionality, but damn it, it's an even bet that it would have taken just as long to <a href="http://www.gnu.org/software/emacs/manual/html_node/emacs/index.html" title="GNU Emacs Manual" rel="dct:references">wade through the documentation</a> to locate it. The function is trivial, <a href="file/toggle-exec-on-current-file.el" title="toggle-exec-on-current-file.el" rel="dct:references">as you can see here</a>. I spent most of my time looking up the relevant functions in the <a href="http://www.gnu.org/software/emacs/manual/html_node/elisp/index.html" title="GNU Emacs Lisp Reference Manual" rel="dct:references">Emacs Lisp reference</a>, but at least I could be sure of my results.</p>
      <p>You see, I had specific requirements about how this function ought to behave. For instance, it doesn't make sense to have executable bits set on a file where the read bits aren't set, so I made my function only set executable bits to correspond with read bits. It may be a bit pedantic, but the side effects caused by na&#xEF;ve bit-flipping are sure to annoy me more than the original problem. Plus, once you solve a problem with a piece of code, that problem is <em>solved forever</em> &#x2014; that is, until the problem changes. I mapped my function to the key sequence <kbd>C-x !</kbd> and it works like a charm.</p>
    </section>
    <section id="convert-ning-events-to-ical-with-xslt">
      <h2>Put <a href="http://www.ning.com/" title="Ning | Create and discover Ning Social Networks for your interests and passions." rel="dct:references">Ning</a> Events Somewhere I Would Use Them</h2>
      <p>I don't get out nearly enough, and I manage my social calendar in <em>exactly one place</em>: <a href="http://www.apple.com/macosx/what-is-macosx/mail-ical-address-book.html" title="Apple - Mac OS X - What is Mac OS X - Mail, iCal, Address Book" rel="dct:references">iCal</a>. There is a <a href="http://www.creativetechnology.org/" title="W2: Community Media Arts Vancouver BC" rel="dct:references">local non-profit group I like called W2</a> that puts on <a href="http://www.creativetechnology.org/events/event/listUpcoming" title="Events - W2: Community Media Arts Vancouver BC" rel="dct:references">a number of interesting presentations</a> around the intersection of culture and technology, but I keep forgetting about them as they do not present themselves sufficiently in front of my face.</p>
      <p>The W2 <abbr title="World-Wide Web">Web</abbr> site currently sits atop the white-label <em>yet-another-social-network</em> factory <a href="http://www.ning.com/" title="Ning | Create and discover Ning Social Networks for your interests and passions." rel="dct:references">known as Ning</a>. It appears that whomever <a href="http://blog.pmarca.com/" title="" rel="dct:references">Mr. Andreessen</a> hired to design the system neglected to provide a convenient way of funnelling the events put on by his customers into a single place, such as iCal. To irritate things further, <em>individual</em> events can be exported to iCal, but not the entire set. This is bothersome.</p>
      <p>My first thought with regard to this problem was that the <acronym title="Really Stupid Syndication">RSS</acronym> feed for the events would contain the relevant data, neatly parceled out for a simple format conversion. I was wrong. Trying to parse the entries in the <acronym title="David Winer has singlehandledly caused more harm to Web standards than any other person (except possibly Ian Hickson)">RSS</acronym> feed would have been a nightmare. It turns out that the actual event listings page has more information about the events than the feed. It's paginated to the first ten or something, but that's good enough to me. Either way, it was clear that I ought to turn to my old partner in <a href="http://en.wikipedia.org/wiki/Web_scraping" title="Web scraping &#x2014; Wikipedia" rel="dct:references"><abbr title="World-Wide Web">Web</abbr>-scraping</a> crime, <a href="http://www.w3.org/TR/xslt" title="XSL Transformations (XSLT)" rel="dct:references"><acronym title="Extensible Stylesheet Transformations">XSLT</acronym></a>.</p>
      <p>This little jaunt cost me in the order of about three hours to get right, which I chalk up to the conscious omission of <a href="http://en.wikipedia.org/wiki/Regular_expression" title="Regular expression &#x2014; Wikipedia" rel="dct:references">regular expressions</a> from the <a href="http://www.w3.org/TR/xslt" title="XSL Transformations (XSLT)" rel="dct:references"><acronym title="Extensible Stylesheet Transformations">XSLT</acronym> 1.0 specification</a> and my nascent understanding of the <a href="http://tools.ietf.org/html/rfc5545" title="Internet Calendaring and Scheduling Core Object Specification (iCalendar)" rel="dct:references">iCalendar data format</a>, which I picked up for use with another project. <a type="text/xsl" href="file/ning-to-ical.xsl" title="ning-to-ical.xsl" rel="dct:references">I made it, though</a>, and <a type="text/calendar" href="file/w2.ics" title="w2.ics" rel="dct:references">the results</a> are pretty tidy. I haven't tested it outside of the W2 calendar, but I surmise it ought to work with just about any Ning events page, unless Ning customers can mangle their layouts to the extent of <a rel="dct:references" href="http://www.myspace.com/" title="MySpace - a Place for Fail">a MySpace page</a> or something.</p>
      <p>The beauty of writing this scraper in <acronym title="Extensible Stylesheet Transformations">XSLT</acronym> is that I can run it with <a href="http://xmlsoft.org/XSLT/xsltproc2.html" title="The xsltproc tool" rel="dct:references"><kbd>xsltproc</kbd></a> which ships with <a href="http://xmlsoft.org/XSLT/" title="libxslt" rel="dct:references"><kbd>libxslt</kbd></a>, which is typically found installed by default on any sane <a href="http://www.linux.org/" title="The Linux Home Page at Linux Online" rel="dct:references">Linux</a> or <a href="http://www.apple.com/macosx/" title="Apple - Mac OS X Snow Leopard - The world&#x2019;s most advanced OS" rel="dct:references">Mac OS X</a> platform, and which handily includes its own <acronym title="Hypertext Transfer Protocol">HTTP</acronym> client &#x2014; so no messing around with pipes and <a href="http://curl.haxx.se/" title="cURL and libcurl" rel="dct:references"><kbd>curl</kbd></a> or whatever. The final touch for this project was to upload the file to my Web host and install a <a href="http://en.wikipedia.org/wiki/Cron" title="cron &#x2014; Wikipedia" rel="dct:references"><kbd>cron</kbd></a> job that more or less ran the following, and to subscribe to the result with iCal (backslashes added for readability, but it will work if you copy and paste it):</p>
      <pre class="code" style="font-size: 75%">xsltproc --html <a type="text/xsl" href="file/ning-to-ical.xsl" title="ning-to-ical.xsl" rel="dct:references">ning-to-ical.xsl</a> \
 <a href="http://www.creativetechnology.org/events/event/listUpcoming" rel="dct:references">http://www.creativetechnology.org/events/event/listUpcoming</a> \
 &gt; <a type="text/calendar" href="file/w2.ics" title="w2.ics" rel="dct:references">w2.ics</a></pre>
 <p>I entreat you to give it a shot if you dare. It might be useful to you too.</p>
    </section>
    <section id="EwzINLYQocfc9t-urs8llL">
      <h2>But Wait, There's More</h2>
      <p>There is one other extremely prolific source of social events that I am considering cracking open: <a rel="dct:references" href="http://www.facebook.com/" title="Welcome to Failbook">Facebook</a>. The problem is, you have to actually <em>go to and endure Facebook</em> in order to look at them. You can't export them to anything useful; you can't concentrate them into a place where you would actually make use of them.</p>
      <p>I've toyed around with <a rel="dct:references" href="http://developers.facebook.com/" title="Facebook Developers">Facebook's <acronym title="Application Programming Interface">API</acronym></a>, but the whole thing sets me on edge. You see, from what I understand, Facebook <em>poisons their query results</em> with bogus data in order to nab people attempting to extract their precious proprietary user-generated information. <a href="http://www.youtube.com/watch?v=Z_u7VGiMO0U" title="YouTube - Monty Python - Albatross" rel="dct:references">As much of an albatross</a> Facebook is, it would be a capital pain in the kiester to <a href="http://en.wikipedia.org/wiki/IRCd#K-line" title="IRCd &#x2014; Wikipedia" rel="dct:references">get k-lined</a> for trying to make their service useful. <a href="http://en.wikipedia.org/wiki/Chilling_effect_%28term%29" title="Chilling effect (term) &#x2014; Wikipedia" rel="dct:references">Consider me chilled</a>.</p>
      <p>Chilled, maybe, but not entirely discouraged. As the eminently inspiring <a href="http://en.wikipedia.org/wiki/Grace_Hopper" title="Grace Hopper &#x2014; Wikipedia" rel="dct:references">Rear Admiral Grace Hopper</a> once said, <a href="http://www.youtube.com/watch?v=CVMhPVInxoE" title="YouTube - 1982HopperSafer2" rel="dct:references">it is easier to ask forgiveness than to get permission</a>. That said, I am arguably more worried about inundating myself with spammy events than snagging one of Facebook's tripwires, since the signal-to-noise ratio is so painfully low.</p>
      <p>It occurs to me, however, that the <a href="http://en.wikipedia.org/wiki/Bayesian_spam_filtering" title="Bayesian spam filtering &#x2014; Wikipedia" rel="dct:references">Bayesian filtering</a> that was once so successful with plain old e-mail spam would be almost perversely useful in filtering out unwanted Facebook events, since the latter typically don't try to obfuscate their content. There is also the issue of logging in to the <acronym title="Application Programming Interface">API</acronym>, which must be done through a browser. If I find myself having to log in to Facebook every day to keep my calendar generator going, I might scrap the idea entirely. Anyhow, the current status of this little project fits neatly into that of <em>mulling over</em>.</p>
      <aside role="note" id="E8X1YZ9LjriVfBRehX8t0I">
        <p><acronym title="Post Script">PS</acronym>: I am sure that there are plenty of Facebook applications that contravene the developer terms of service and provide this functionality, but there exists the issue of finding and evaluating them, and the collateral effect of having to rely on some dodgy third party and of course unnecessarily divulge information to them. I am also aware of other services like <a href="http://upcoming.yahoo.com/" title="Home - Upcoming" rel="dct:references">Upcoming</a> which <em>do</em> provide iCal subscriptions, but those entail the progenitors of events to register with them, which is frankly less likely these days than just mining Facebook. The bottom line is that the channel for this kind of information shouldn't matter, I should be able to aggregate events all in one place, and put them in front of my face all at once so that I can decide which ones to attend or not.</p>
      </aside>
    </section>
    <section id="E_0muxK2pFt9PfO8R28JkL">
      <h2>In Case You Missed Them</h2>
      <ul>
        <li><a href="file/toggle-exec-on-current-file.el" title="toggle-exec-on-current-file.el" rel="dct:references">The Emacs function to toggle executable bits of the current file</a>.</li>
        <li><a type="text/xsl" href="file/ning-to-ical.xsl" title="ning-to-ical.xsl" rel="dct:references">The <acronym title="Extensible Stylesheet Translations">XSLT</acronym> stylesheet to convert a Ning events page into an iCal file</a>.</li>
      </ul>
      <p>Both are subject to a <a rel="dct:references xhv:license" href="http://www.opensource.org/licenses/bsd-license.php" title="Open Source Initiative OSI - The BSD License:Licensing | Open Source Initiative"><acronym title="Berkeley System Design">BSD</acronym> licence</a>, of course. Enjoy!</p>
    </section>
  </body>
</html>
