<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><description>Indeterminate things.</description><title>DeWitt Clinton</title><generator>Tumblr (3.0; @dewitt)</generator><link>https://micro.unto.net/</link><item><title>Still here</title><description>&lt;p&gt;Post.&lt;/p&gt;</description><link>https://micro.unto.net/post/701658495003607040</link><guid>https://micro.unto.net/post/701658495003607040</guid><pubDate>Tue, 22 Nov 2022 13:48:05 -0800</pubDate></item><item><title>Still alive</title><link>https://micro.unto.net/post/674905571632300032</link><guid>https://micro.unto.net/post/674905571632300032</guid><pubDate>Mon, 31 Jan 2022 06:41:49 -0800</pubDate><category>Alive.</category></item><item><title>Alive</title><description>&lt;p&gt;This account is alive.&lt;/p&gt;</description><link>https://micro.unto.net/post/161781127012</link><guid>https://micro.unto.net/post/161781127012</guid><pubDate>Tue, 13 Jun 2017 10:43:42 -0700</pubDate></item><item><title>Just setting up my Tumblr</title><link>https://micro.unto.net/post/145152426187</link><guid>https://micro.unto.net/post/145152426187</guid><pubDate>Mon, 30 May 2016 06:33:10 -0700</pubDate></item><item><title>I should post here occasionally.</title><description>&lt;p&gt;I don&amp;rsquo;t want to give up my Tumblr username (which is also used for commenting and whatnot).&lt;/p&gt;

&lt;p&gt;Here&amp;rsquo;s a picture of an axolotl.&lt;/p&gt;

&lt;p&gt;&lt;img src="https://64.media.tumblr.com/tumblr_ltwubhQFUD1qznwra.jpg" alt=""/&gt;&lt;/p&gt;</description><link>https://micro.unto.net/post/12147648009</link><guid>https://micro.unto.net/post/12147648009</guid><pubDate>Sun, 30 Oct 2011 20:14:40 -0700</pubDate></item><item><title>Please comment on this post</title><description>&lt;p&gt;&lt;a href="http://friendfeed.com/e/91ab47e8-5a75-7c8f-bd98-aeb549b9107e/Disqus-has-somehow-integrated-with-FriendFeed/"&gt;Dave noticed&lt;/a&gt; that Disqus was now pulling FriendFeed comments and displaying them inline.  Brilliant idea.  I may switch my wordpress blog to use Disqus just for this.  More &lt;a href="http://blog.disqus.net/2009/01/26/posting-and-pulling-comments-from-friendfeed/"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To test, please comment below, either &lt;a href="http://micro.unto.net/post/73442248/please-comment-on-this-post"&gt;here&lt;/a&gt; via Disqus or on the &lt;a href="http://friendfeed.com/e/6f79c0b6-077f-d68b-9438-0f8af3109033/Please-comment-on-this-post/"&gt;FriendFeed thread&lt;/a&gt;.&lt;/p&gt;</description><link>https://micro.unto.net/post/73442248</link><guid>https://micro.unto.net/post/73442248</guid><pubDate>Tue, 27 Jan 2009 00:19:00 -0800</pubDate></item><item><title>Trying to make this work</title><description>&lt;p&gt;I&amp;rsquo;ve known for a while &amp;ndash; and the sentiment has only grown over the past few weeks &amp;ndash; that there is something about the way I use and interact with the contemporary social publishing tools and the surrounding culture &amp;ndash; sites like Twitter/FriendFeed/etc &amp;ndash; that isn&amp;rsquo;t quite working for me.   Not to imply that those sites aren&amp;rsquo;t working in general, just that something is out of alignment for me individually.&lt;/p&gt;

&lt;p&gt;Background: Six months or so ago I made a conscious decision to establish more of a web presence again. I had all but stopped writing on my personal site after taking my current job, but at the same time much of what I was thinking about and working on was designed to help that ecosystem thrive.  So while I&amp;rsquo;m naturally shy in person, I bit the bullet and tried to actively engage with people on the web.&lt;/p&gt;

&lt;p&gt;The best part of those sites is when I learn something new.  Not just &lt;em&gt;meet&lt;/em&gt; someone new (there are several billion people in the world &amp;ndash; meeting people is easy, or so sez Thom Yorke) and not just meet someone smarter (there are billions of them, too) but to establish a connection with people that think about the &lt;em&gt;things I am interested in&lt;/em&gt;.  Me, I&amp;rsquo;m interested in things like computer science  and intellectual property law right now.  Politics, music, art, sure, but what really fascinates me most these days is algorithms, programming languages, ip licensing, stuff like that.  So I was not simply seeking any random group, but rather a &lt;em&gt;peer&lt;/em&gt; group.&lt;/p&gt;

&lt;p&gt;Because the dirty little truth is that I care about the world of social media, public relations, silicon valley, startup culture, etc., about as much as I care about search engine optimization or the names of celebrity babies.  It is the context in which we operate and live, but that alone does not make it interesting.  In fact, most of it is a distraction &amp;ndash; navels are not novel, and gazing at them just takes your eye of anything interesting up ahead.&lt;/p&gt;

&lt;p&gt;(This entire post is an exercise in hypocrisy, which is why I&amp;rsquo;m burying it on a feed that has few readers.)&lt;/p&gt;

&lt;p&gt;To address the situation, I&amp;rsquo;m aggressively pruning my reading lists &amp;ndash; the thinking man&amp;rsquo;s attempt at going ostrich.  I&amp;rsquo;m continuing to ween my Reader subscriptions, moving people that discuss social media and the like into a separate folder.  I created a &amp;ldquo;Social&amp;rdquo; list on FF and as people post or like things that I would preferred not to be distracted at the time, I&amp;rsquo;m moving them into the Social list and off of the Home page.  And I already don&amp;rsquo;t read Twitter other than the occasional search for comments directed at me or topics I&amp;rsquo;m interested in, so that&amp;rsquo;s not as much of an issue.&lt;/p&gt;

&lt;p&gt;It&amp;rsquo;s not that I don&amp;rsquo;t like you or your blog, it&amp;rsquo;s that I just don&amp;rsquo;t like that I&amp;rsquo;m reading it all the time.  So now I&amp;rsquo;ll just shunt those posts off to a place where I can collect and read them at a later date.  Please don&amp;rsquo;t take that personally &amp;ndash; information overload and the propensity for distraction just really has me down right now.  It was either this or stop using these sites entirely.&lt;/p&gt;

&lt;p&gt;I guess I just want these tools to serve me in a more professional and academic capacity, rather than a social or entertainment capacity.  Hopefully this will work.&lt;/p&gt;</description><link>https://micro.unto.net/post/67517942</link><guid>https://micro.unto.net/post/67517942</guid><pubDate>Tue, 30 Dec 2008 09:40:40 -0800</pubDate></item><item><title>Counting paragraph tags</title><description>&lt;p&gt;Earlier today I wondered &lt;a href="http://micro.unto.net/post/64933772/quick-poll-or"&gt;how often the various forms of paragraph tags were used&lt;/a&gt; in HTML.&lt;/p&gt;

&lt;p&gt;The three forms are:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;A: &amp;lt;p&amp;gt;...&amp;lt;/p&amp;gt;
B: ...&amp;lt;p&amp;gt;...
C: ...&amp;lt;p/&amp;gt;...
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The &lt;a href="http://friendfeed.com/e/1636b576-ee97-58de-4633-804addf1bfd2/Quick-poll-or-p-p/"&gt;consensus on FriendFeed&lt;/a&gt; was that the first form was clearly the way to go.   But I was left wondering if, because of the legacy of early HTML, the second form might still be used with some frequency.&lt;/p&gt;

&lt;p&gt;So this afternoon I wrote a quick mapreduce that examined a random sample of the web and counted paragraph tags.&lt;/p&gt;

&lt;p&gt;The parser maintained a simple stack as it traversed through the document.  Form A, &lt;code&gt;&amp;lt;p&amp;gt;...&amp;lt;/p&amp;gt;&lt;/code&gt;, is the number of balanced pairs at the end of the document, including empty pairs.  Form B, &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt;, is the number of open p tags that have no closing tag.  And form C, &lt;code&gt;&amp;lt;p/&amp;gt;&lt;/code&gt;,  is the number of self closing tags.&lt;/p&gt;

&lt;p&gt;The parser didn&amp;rsquo;t check for semantic validity &amp;ndash; &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; tags could appear anywhere and still be counted &amp;ndash; but I reasoned the number of misplaced tags would appear roughly equally in all three forms, so it was okay to ignore semantic errors for this casual experiment.&lt;/p&gt;

&lt;p&gt;In the 833,866 html documents considered, form A (balanced pairs) was found 7,325,544 times, form B (unbalanced opening tags) was found 1,129,180 times, and form C (self closing tags) was found 44,180 times.&lt;/p&gt;

&lt;p&gt;So the container &lt;code&gt;&amp;lt;p&amp;gt;...&amp;lt;/p&amp;gt;&lt;/code&gt; is used about 7x as much as the separator &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt;, and both are used far more than the self-closing &lt;code&gt;&amp;lt;p/&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;We also learn that 50.1% of the documents sampled contain only form A, 4.41% contain only form B, and a mere 0.21% contain only form C.&lt;/p&gt;

&lt;p&gt;Further, 11.0% contain both form A and B, 0.70% contain both B and C, and 0.10% contain both B and C.  And 0.15% of documents contain all three forms.&lt;/p&gt;

&lt;p&gt;Interestingly, a full 33.29% of the documents sampled contained no &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; tags of any form at all.  Presumably those documents use &lt;code&gt;&amp;lt;br&amp;gt;&lt;/code&gt; and/or &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; tags to structure text into blocks, but I need to dig into this further.&lt;/p&gt;

&lt;p&gt;The lesson for me is that, in keeping with the earliest HTML specifications, &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; is still used occasionally as a separator character in some documents.  But because of the higher frequency of both A and B appearing (as opposed to B alone), it is slightly more likely than not that an unbalanced paragraph tag is that way by accident rather than by intent.&lt;/p&gt;

&lt;p&gt;So there you have it.  More than than you ever wanted to know about the simple little &lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt; tag.&lt;/p&gt;</description><link>https://micro.unto.net/post/65110341</link><guid>https://micro.unto.net/post/65110341</guid><pubDate>Mon, 15 Dec 2008 22:52:00 -0800</pubDate><category>web</category><category>html</category><category>statistics</category><category>standards</category></item><item><title>Quick poll: &lt;p&gt;, &lt;p/&gt;, or &lt;p&gt;&lt;/p&gt;</title><description>&lt;p&gt;Do you write paragraph tags in HTML like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;The quick brown fox jumps over the lazy dog.
&amp;lt;p&amp;gt;
The five boxing wizards jump quickly.
&amp;lt;p&amp;gt;
Amazingly few discotheques provide jukeboxes.
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Or do you always close them between paragraphs, like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Sixty zippers were quickly picked from the woven jute bag.
&amp;lt;p/&amp;gt;
A quart jar of oil mixed with zinc oxide makes a very bright paint.
&amp;lt;p/&amp;gt;
Jackdaws love my big sphinx of quartz.
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Or do you enclose the paragraph itself, like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;p&amp;gt;
  Sphinx of black quartz, judge my vow.
&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;
  How quickly daft jumping zebras vex.
&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;
  Jinxed wizards pluck ivy from the big quilt.
&amp;lt;/p&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Just thinking about the history of HTML&amp;hellip;&lt;/p&gt;</description><link>https://micro.unto.net/post/64933772</link><guid>https://micro.unto.net/post/64933772</guid><pubDate>Mon, 15 Dec 2008 01:02:35 -0800</pubDate><category>html</category><category>web history</category><category>markup</category></item><item><title>A caching decorator pattern for django views in App Engine</title><description>&lt;p&gt;&lt;b&gt;Step 1)&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Download and put decorator.py from  Michele Simionato’s &lt;a href="http://www.phyast.pitt.edu/~micheles/python/documentation.html"&gt;decorator module&lt;/a&gt; in your path.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 2)&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Add the following generic memcaching decorator to your views.py:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;import logging
from google.appengine.api import memcache
from decorator import *
CACHE_EXPIRATION = 3600

def cacheable(keygen=None, expiration=CACHE_EXPIRATION):
  """A decorator that caches results in memcache.
  
  keygen: 
    A function that returns the cache key based on the *args and
    **kwargs of the function being called.  If keygen is 
    not specified, the first positional argument will be used.
  expiration:
    The length of time to cache the response in seconds.
  """
  # Define the decorator itself as a closure within cacheable
  def call(f, *args, **kwargs):
    # Don't use the cache at all if there is no expiration
    if not expiration:
      return f(*args, **kwargs)

    # Use the supplied keygen to create a local cache key
    # or use the first positional arg if none is supplied
    if keygen:
      local_key = keygen(*args, **kwargs)
    else:
      local_key = args[0]

    # Create a global cache key that remains stable across instances
    global_key = '%s:%s:%s' % (f.__module__, f.__name__, local_key)

    logging.debug('Checking cache for %s' % local_key)
    result = memcache.get(global_key)
    if result:
      logging.debug('Found %s in cache.' % local_key)
    else:
      logging.debug('Cache miss for %s.' % local_key)
      result = f(*args, **kwargs)
      logging.debug('Caching %s' % local_key)
      if not memcache.add(global_key, result, expiration):
        logging.error('Error caching response for %s.' % local_key)
    return result

  return decorator(call)&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;b&gt;Step 3)&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Define a key generation function for http requests.  This one ignores query parameters, but yours probably shouldn’t.  By default the caching decorator uses the first parameter of the function call as the key, but in the case of http requests, we’ll use the request path.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;def request_keygen(request, *args, **kwargs):
  """Returns a key based on the request path.                                                                                                                                                                                     
                                                                                                                                                                                                                                  
  Args:                                                                                                                                                                                                                           
    request: The http request object.                                                                                                                                                                                             
  """
  if not request or not request.path:
    raise ServerError('First parameter must be a request with a path.')
  return request.path&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;b&gt;Step 4)&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Apply the decorator to any view corresponding to a GET request.  The key will be the request.path, so if your logic uses query parameters be sure to modify request_keygen accordingly.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;@cacheable(keygen=request_keygen)
def HomeView(request):
  """Prints the homepage"""
  return render_to_response('home.tmpl')&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;b&gt;Step 5)&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Use the decorator anywhere you’d like to cache the response in memcache.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;@cacheable()
def get_url(url):
  """Retrieves a URL and caches the results.                                                                                                                                                                                      
                                                                                                                                                                                                                                  
  Args:                                                                                                                                                                                                                           
    url: A url to be fetched                                                                                                                                                                                                      
  Returns:                                                                                                                                                                                                                        
    a http response                                                                                                                                                                                                               
  """
  return urlfetch.fetch(url)&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;b&gt;Step 6)&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Sprinkle liberally.&lt;/p&gt;</description><link>https://micro.unto.net/post/64695210</link><guid>https://micro.unto.net/post/64695210</guid><pubDate>Sat, 13 Dec 2008 13:04:00 -0800</pubDate><category>appengine</category><category>google</category><category>python</category><category>performance</category><category>django</category></item><item><title>A bookmarklet for generating QR codes</title><description>&lt;p&gt;Many new mobile devices, such as a T-Mobile G1 running &lt;a href="http://code.google.com/android/"&gt;Android&lt;/a&gt;, have barcode scanners that can extract URLs automatically from &lt;a href="http://en.wikipedia.org/wiki/QR_Code"&gt;QR codes&lt;/a&gt;.  Already popular in Japan, QR codes provide a mechanism for encoding arbitary data in an error-tolerant image format, offering a flexible way of distributing information like URLs in a machine readible form that can be emailed, printed out, or displayed on a screen.  While OCR techniques are steadily improving, QR codes are significantly easier for a machine to read than strings of characters, and sometimes work better than publishing a URL directly.&lt;/p&gt;
&lt;p&gt;The Google Chart API has &lt;a href="http://code.google.com/apis/chart/types.html#qrcodes"&gt;support for generating QR codes&lt;/a&gt;, and we can use that feature to create a browser bookmarklet that makes it trivial to generate a QR code for any site on the fly.&lt;/p&gt;
&lt;p&gt;Simply drag this bookmarklet to your browser toolbar:&lt;/p&gt;
&lt;p&gt;&lt;a href="#javascript:void(window.open('http://chart.apis.google.com/chart?cht=qr&amp;amp;chs=300x300&amp;amp;chl='+escape(document.location)));"&gt;QR Code&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Now visit any site you like and click on the &amp;lsquo;QR Code&amp;rsquo; bookmarklet.  A new window or browser tab will open, and in it you will find your QR code.   You can download this image and email it around or print it, or you can save the URL and use it directly in a &amp;lt;img /&amp;gt; element and embed the code on your own pages.  Anyone with a QR code scanner on their mobile device can easily navigate to the site just by holding their phone up to the code and scanning it in.&lt;/p&gt;
&lt;p&gt;For example, here&amp;rsquo;s the QR code for &lt;a href="http://blog.unto.net/"&gt;http://blog.unto.net/&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://chart.apis.google.com/chart?cht=qr&amp;amp;chs=300x300&amp;amp;chl=http%3A//blog.unto.net/" width="300" height="300"/&gt;&lt;/p&gt;
&lt;p&gt;This QR code was generated via the URL:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://chart.apis.google.com/chart?cht=qr&amp;amp;chs=300x300&amp;amp;chl=http%3A//blog.unto.net/"&gt;http://chart.apis.google.com/chart?cht=qr&amp;amp;chs=300x300&amp;amp;chl=http%3A//blog.unto.net/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Enjoy!&lt;/p&gt;</description><link>https://micro.unto.net/post/63738649</link><guid>https://micro.unto.net/post/63738649</guid><pubDate>Mon, 08 Dec 2008 10:54:28 -0800</pubDate><category>qr codes</category><category>apis</category><category>developer</category><category>mobile</category><category>android</category><category>google</category></item><item><title>Test posting via Tumblr, please ignore</title><description>&lt;img src="https://64.media.tumblr.com/C4jjP1M9th64zy7mk7Rrild5o1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Test posting via Tumblr, please ignore&lt;/p&gt;</description><link>https://micro.unto.net/post/63396844</link><guid>https://micro.unto.net/post/63396844</guid><pubDate>Sat, 06 Dec 2008 10:21:36 -0800</pubDate></item></channel></rss>
