<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>the corioblog &#187; dom</title>
	<atom:link href="http://www.coriolinus.net/tag/dom/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.coriolinus.net</link>
	<description>read, and be entertained</description>
	<lastBuildDate>Sat, 09 Jul 2011 19:53:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>A first look at Chrome</title>
		<link>http://www.coriolinus.net/2008/09/02/a-first-look-at-chrome/</link>
		<comments>http://www.coriolinus.net/2008/09/02/a-first-look-at-chrome/#comments</comments>
		<pubDate>Wed, 03 Sep 2008 01:46:47 +0000</pubDate>
		<dc:creator>coriolinus</dc:creator>
				<category><![CDATA[geekspeak]]></category>
		<category><![CDATA[Caching]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[dom]]></category>

		<guid isPermaLink="false">http://www.coriolinus.net/?p=2520</guid>
		<description><![CDATA[I&#8217;m using Chrome right now to post this; I&#8217;ve been trying it out for the last hour or so. My first impression: it is not yet ready to replace Firefox as my primary browser. It delivers on the promises in the comic. Tabs are first-class entities; a window is more a convenient way to organize [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m using <a href="http://www.google.com/chrome">Chrome</a> right now to post this; I&#8217;ve been trying it out for the last hour or so. My first impression: it is not yet ready to replace <a href="http://www.mozilla.com/en-US/firefox/">Firefox</a> as my primary browser.</p>
<p>It delivers on the promises in the comic. Tabs are first-class entities; a window is more a convenient way to organize a bunch of tabs than a necessity. I didn&#8217;t notice any difference in the speed of Javascript, but I&#8217;m willing to postulate that it&#8217;s improved. The interface is nicely minimalist; there is very little present except the bare minimum necessary for browsing.</p>
<p>However, there are a few things that Chrome lacks that I consider essential for a daily use browser:</p>
<ul>
<li><strong>Open All in Tabs</strong>. This ability shapes my daily browsing; to have to revert now to opening collections of pages manually or serially seems absurd. I had hoped that Chrome&#8217;s Omnibox would recognize the name of a folder of links and offer that feature automatically, but it does not.</li>
<li><strong>Bookmark menu support</strong>. Chrome&#8217;s natural way to access your bookmarks is by typing into the Omnibox, which is nice enough as far as it goes. However, some people have large, organized collections of bookmarks. When I want one of them, my natural way of getting to it is by opening the bookmarks menu, then drilling down through the subfolders until I have what I want. I may remember no part of the page title or URL, but I can still find what I want this way. Unfortunately, the only direct access to your bookmarks through Chrome is by opening a row of bookmark buttons, which takes up valuable UI space. Lonely on one end of that row is the bookmark menu access button. It would be nice if that button sat next to the other buttons in the primary row.</li>
<li><strong>Caching</strong>. I want to see a three part strategy for loading commonly accessed pages:<br />
1. Load and render immediately from the cache<br />
2. Download simultaneously from site<br />
3. As the current version of the page comes in, diff against the cached version. As necessary, either completely restart rendering or insert changed elements via DOM manipulation.</p>
<p>Instead of that, Chrome currently appears to cache nothing at all. I accidentally loaded a page in the current frame instead of a new tab, so I hit the back button. I then had to wait for the site to be completely reloaded before I could relaunch my link. Hitting the back button should be essentially instantaneous.</li>
<li><strong>Mature Plugins</strong>. The Chrome developers don&#8217;t need to worry too much about this one; it&#8217;ll fix itself as time passes. However, I won&#8217;t be willing to use this as a primary browser until, at a minimum, the equivalent of <a href="http://adblockplus.org/">Adblock Plus</a> is developed.</li>
</ul>
<p>This is a promising start; given time, Chrome has the potential to develop into a serious competitor against Firefox. However, it&#8217;s not quite ready for the prime time yet.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.coriolinus.net/2008/09/02/a-first-look-at-chrome/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Protocol Buffers</title>
		<link>http://www.coriolinus.net/2008/07/08/protocol-buffers/</link>
		<comments>http://www.coriolinus.net/2008/07/08/protocol-buffers/#comments</comments>
		<pubDate>Wed, 09 Jul 2008 01:14:23 +0000</pubDate>
		<dc:creator>coriolinus</dc:creator>
				<category><![CDATA[misc.link]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[dom]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[I/O stream]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.coriolinus.net/?p=2167</guid>
		<description><![CDATA[Subtitle: The good, the bad, and the&#8230; no, wait; this is a Google project. XML and Java have the same sort of flavor to them: they&#8217;re reasonably good and very widely used; they&#8217;re the sort of product that design committees everywhere aspire to create. Their flaws only really become visible after something better comes along. [...]]]></description>
			<content:encoded><![CDATA[<p>Subtitle: The good, the bad, and the&#8230; no, wait; this is a Google project.</p>
<p>XML and Java have the same sort of flavor to them: they&#8217;re reasonably good and very widely used; they&#8217;re the sort of product that design committees everywhere aspire to create. Their flaws only really become visible after something better comes along. In Java&#8217;s case, Python demonstrated that a whole lot of the structure and required text that gives Java code its rigidity can be stripped away, leaving a language that&#8217;s a joy to develop in. However, there hasn&#8217;t been an analogous improvement on XML.</p>
<p>Until yesterday.</p>
<p>Protocol Buffers have a non-descriptive name; I had no idea what to expect when I clicked <a href="http://google-opensource.blogspot.com/2008/07/protocol-buffers-googles-data.html">the link to the announcement</a> that Google put out. As it turns out, they&#8217;re a generic data serialization format (much like XML), except without all the human-readability business that so bloats actual XML. From the announcement:</p>
<blockquote><p>Protocol Buffers allow you to define simple data structures in a special definition language, then compile them to produce classes to represent those structures in the language of your choice. These classes come complete with heavily-optimized code to parse and serialize your message in an extremely compact format. Best of all, the classes are easy to use: each field has simple &#8220;get&#8221; and &#8220;set&#8221; methods, and once you&#8217;re ready, serializing the whole thing to – or parsing it from – a byte array or an I/O stream just takes a single method call.</p></blockquote>
<p>In case you missed that, <em>all you have to write is the schema</em>. All the encoding and decoding crap that you have to wade through in XML has already been abstracted away; they generate classes to do that for you. This is, in fact, cooler than sliced bread.</p>
<p>Of course, there <a href="http://code.google.com/apis/protocolbuffers/docs/overview.html#whynotxml">do exist times</a> when XML might better serve your needs:</p>
<blockquote><p>However, protocol buffers are not always a better solution than XML – for instance, protocol buffers would not be a good way to model a text-based document with markup (e.g. HTML), since you cannot easily interleave structure with text. In addition, XML is human-readable and human-editable; protocol buffers, at least in their native format, are not. XML is also – to some extent – self-describing. A protocol buffer is only meaningful if you have the message definition (the <code>.proto</code> file).</p></blockquote>
<p>In my experience, the human-readability and self-documentation inherent in XML have always been bonus features not essential to the core mission, which was getting data from Point A to Point B. However, I&#8217;ve had to spend countless hours wrangling with DOM and SAX, dealing with the problem of getting the data into and out of that intermediate form.</p>
<p>There is one wart that I noticed: you still have to create and read the Messages entirely distinctly from your own native class structure. The natural thing to do, if you want to use this to serialize and deserialize a class, would be just to put all the members into the Message definition and put the methods into a subclass of the generated class. However, that is <a href="http://code.google.com/apis/protocolbuffers/docs/reference/python-generated.html#message">expressly forbidden</a>. All is not lost, though: all you really need, at simplest, is a pair of methods like this:</p>
<pre class="brush: python">
class AClass(object):
     ...
     def toPBuff(self):
          out = AClassPBuff()
          for member in dir(self):
               if not (callable(member) or &#039;__&#039; in member or member in self.__excludeFromSerialize):
                    setattr(out, member, getattr(self, member))
          return out

     @classmethod
     def fromPBuff(cls, pBuff):
          out = AClass()
          for member in dir(out):
               if not (callable(member) or &#039;__&#039; in member or member in self.__excludeFromSerialize):
                    setattr(out, member, getattr(pBuff, member))
          return out
</pre>
<p>In short, even if only in terms of making efficient use of developer time, this is already an awesome project. Once you count in that it is also faster and slimmer than the alternatives, this becomes astonishingly cool. Expect it to be making appearances in my code from now on.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.coriolinus.net/2008/07/08/protocol-buffers/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>losing my college webspace has been catastrophic for these early links</title>
		<link>http://www.coriolinus.net/2002/04/28/losing-my-college-webspace-has-been-catastrophic-for-these-early-links/</link>
		<comments>http://www.coriolinus.net/2002/04/28/losing-my-college-webspace-has-been-catastrophic-for-these-early-links/#comments</comments>
		<pubDate>Sun, 28 Apr 2002 20:42:00 +0000</pubDate>
		<dc:creator>coriolinus</dc:creator>
				<category><![CDATA[brain flotsam]]></category>
		<category><![CDATA[dom]]></category>

		<guid isPermaLink="false">http://www.coriolinus.net/2002/04/28/76/</guid>
		<description><![CDATA[Obviously, I managed to connect to several nodes of lj-dom.]]></description>
			<content:encoded><![CDATA[<p><a href="http://users.wpi.edu/~peterg/images/friendsgraphic.png" target="_new">Obviously, I managed to connect to several nodes of lj-dom.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.coriolinus.net/2002/04/28/losing-my-college-webspace-has-been-catastrophic-for-these-early-links/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

