<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Paul Natsuo Kishimoto - 2010</title><link href="https://paul.kishimoto.name/" rel="alternate"/><link href="https://paul.kishimoto.name/feeds/2010.atom.xml" rel="self"/><id>https://paul.kishimoto.name/</id><updated>2010-10-23T00:00:00+02:00</updated><entry><title>Pork and Beans</title><link href="https://paul.kishimoto.name/2010/10/pork-and-beans" rel="alternate"/><published>2010-10-23T00:00:00+02:00</published><updated>2010-10-23T00:00:00+02:00</updated><author><name>Paul Natsuo Kishimoto</name></author><id>tag:paul.kishimoto.name,2010-10-23:/2010/10/pork-and-beans</id><summary type="html">&lt;p&gt;This is the first entry in what will be a regular feature on life in Boston—including Cambridge &amp;amp; &lt;a href="http://web.mit.edu"&gt;MIT&lt;/a&gt;—mainly aimed at family, friends, colleagues, acquaintances, etc. (you know who you are) from Toronto—including Mississauga &amp;amp; &lt;a href="http://utoronto.ca"&gt;UofT&lt;/a&gt;. The title comes from the nicknames &lt;a href="http://en.wikipedia.org/wiki/Name_of_Toronto#Nicknames"&gt;&lt;strong&gt;Hogtown&lt;/strong&gt;&lt;/a&gt; and &lt;a href="http://www.boston.com/travel/boston/boston_nicknames"&gt;&lt;strong&gt;Beantown&lt;/strong&gt;&lt;/a&gt;. "Pork &amp;amp; Beans" is also a Weezer tune with a &lt;a href="http://www.youtube.com/watch?v=PQHPYelqr0E"&gt;meme-packed music video&lt;/a&gt;, and the &lt;a href="http://www.bosstonesmusic.com/"&gt;&lt;u&gt;Bos&lt;/u&gt;s&lt;u&gt;ton&lt;/u&gt;e&lt;/a&gt; musical joke was already taken.&lt;/p&gt;
&lt;p&gt;My aims are…&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;to give you a sense of what it's like to live here,&lt;/li&gt;
&lt;li&gt;to make you want to visit me, and&lt;/li&gt;
&lt;li&gt;to make sure I don't forget what makes …&lt;/li&gt;&lt;/ul&gt;</summary><content type="html">&lt;p&gt;This is the first entry in what will be a regular feature on life in Boston—including Cambridge &amp;amp; &lt;a href="http://web.mit.edu"&gt;MIT&lt;/a&gt;—mainly aimed at family, friends, colleagues, acquaintances, etc. (you know who you are) from Toronto—including Mississauga &amp;amp; &lt;a href="http://utoronto.ca"&gt;UofT&lt;/a&gt;. The title comes from the nicknames &lt;a href="http://en.wikipedia.org/wiki/Name_of_Toronto#Nicknames"&gt;&lt;strong&gt;Hogtown&lt;/strong&gt;&lt;/a&gt; and &lt;a href="http://www.boston.com/travel/boston/boston_nicknames"&gt;&lt;strong&gt;Beantown&lt;/strong&gt;&lt;/a&gt;. "Pork &amp;amp; Beans" is also a Weezer tune with a &lt;a href="http://www.youtube.com/watch?v=PQHPYelqr0E"&gt;meme-packed music video&lt;/a&gt;, and the &lt;a href="http://www.bosstonesmusic.com/"&gt;&lt;u&gt;Bos&lt;/u&gt;s&lt;u&gt;ton&lt;/u&gt;e&lt;/a&gt; musical joke was already taken.&lt;/p&gt;
&lt;p&gt;My aims are…&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;to give you a sense of what it's like to live here,&lt;/li&gt;
&lt;li&gt;to make you want to visit me, and&lt;/li&gt;
&lt;li&gt;to make sure I don't forget what makes home, home!&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I'm also curious if more people will read and comment on these than on previous posts, i.e. if gonzo journalism will prove more engaging than my usual wonkery. At the same time, I'll try to avoid merely touristic content. Expect new entries once a week or so. Whether the two months since my 20 August arrival will ever get backfilled is uncertain.&lt;/p&gt;
&lt;h2&gt;Why I'm here (in 60 words or less)&lt;/h2&gt;
&lt;p&gt;I'm studying in the &lt;a href="http://tppserver.mit.edu"&gt;Technology &amp;amp; Policy Program (TPP)&lt;/a&gt;, a two-year master's program leading to an SM degree. There's both coursework and research involved. It's part of the &lt;a href="http://esd.mit.edu"&gt;Engineering Systems Division&lt;/a&gt; at MIT, which also has a PhD program that I intend to get into. Why policy? Perhaps read more of this website.&lt;/p&gt;
&lt;h2&gt;MIT by the numbers&lt;/h2&gt;
&lt;p&gt;We all like numbers. Consider some data about four entities: the &lt;a href="http://www.utoronto.ca/about-uoft/quickfacts.htm"&gt;University of Toronto&lt;/a&gt;; UofT's &lt;a href="http://www.engineering.utoronto.ca/About/Facts_Figures.htm"&gt;Faculty of Applied Science and Engineering&lt;/a&gt;; &lt;a href="http://web.mit.edu/facts/enrollment.html"&gt;MIT&lt;/a&gt;; and MIT's &lt;a href="http://engineering.mit.edu/about/statistics/statistics.php"&gt;School of Engineering&lt;/a&gt;.&lt;/p&gt;
&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;&lt;th&gt;&lt;/th&gt;&lt;th&gt;UofT&lt;/th&gt;&lt;th&gt;APSE&lt;/th&gt;&lt;th&gt;MIT&lt;/th&gt;&lt;th&gt;SoE&lt;/th&gt;&lt;/tr&gt;
  &lt;/thead&gt;

  &lt;tbody&gt;
    &lt;tr&gt;&lt;td&gt;Undergraduates&lt;/td&gt;&lt;td&gt; 33,371 &lt;/td&gt;&lt;td&gt; 4668 &lt;/td&gt;&lt;td&gt; 4232 &lt;/td&gt;&lt;td&gt; 1886 &lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;Grad Students&lt;/td&gt;&lt;td&gt; 11,638 &lt;/td&gt;&lt;td&gt; 1476 &lt;/td&gt;&lt;td&gt; 6152 &lt;/td&gt;&lt;td&gt; 2794 &lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;Total&lt;/td&gt;&lt;td&gt; ~45,000 &lt;/td&gt;&lt;td&gt; 6144 &lt;/td&gt;&lt;td&gt; 10,384 &lt;/td&gt;&lt;td&gt; 4680 &lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;Faculty&lt;/td&gt;&lt;td&gt; 2551 &lt;/td&gt;&lt;td&gt; 230 &lt;/td&gt;&lt;td&gt; 1009 &lt;/td&gt;&lt;td&gt; 370 &lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;Campus area&lt;/td&gt;&lt;td&gt; 71 ha &lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td&gt; 68 ha &lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;td&gt; &lt;/td&gt;&lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Curiously, the UofT Engineering annual report (link above) cites a global ranking for the category of &lt;em&gt;public&lt;/em&gt; universities, which excludes rich, private schools like MIT and results in a higher placement. But with roughly eight times the endowment (USD 8 billion vs. CAD 1.3 billion) and one fifth as many students as UofT, it's not a fair comparison. We also see that the graduate/undergraduate ratio is much higher here.&lt;/p&gt;
&lt;p&gt;In this context you can appreciate UofT's plans to slightly increase the graduate student population at the St. George campus and shift some of the arts &amp;amp; science student body to the satellite campuses.&lt;/p&gt;
&lt;h2&gt;Other miscellaneous observations&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://whereis.mit.edu/?go=NW30"&gt;My residence&lt;/a&gt; is in a corner of campus, north of a cross-cutting rail corridor, that is populated by big biotech firms, small biotech firms, and biotech firms of middling size. These include &lt;a href="http://www.mlnm.com/"&gt;Takeda Millenium Oncology&lt;/a&gt;, &lt;a href="http://www.novartis.com/"&gt;Novartis&lt;/a&gt;, &lt;a href="http://www.sanofi-aventis.us/"&gt;Sanofi Aventis&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;There's quite a lot of craft beer in Boston, which is a good thing because the lowest common denominator (&lt;a href="http://www.ratebeer.com/beer/pabst-blue-ribbon/734/"&gt;PBR&lt;/a&gt;, &lt;a href="http://www.ratebeer.com/beer/miller-high-life/407/"&gt;Miller High Life&lt;/a&gt;, &lt;a href="http://www.ratebeer.com/beer/bud-light/474/"&gt;Bud Light&lt;/a&gt;) is low indeed. Some good pours I've had are &lt;a href="http://www.ratebeer.com/beer/harpoon-ipa/694/"&gt;Harpoon IPA&lt;/a&gt;, &lt;a href="http://www.ratebeer.com/beer/21st-amendment-brew-free-or-die-ipa/8189/"&gt;21st Amendment IPA&lt;/a&gt; and &lt;a href="http://www.ratebeer.com/beer/green-flash-stout-double-stout/84962/"&gt;Green Flash Double Stout&lt;/a&gt;. Unibroue stuff also seems to be popular.&lt;/li&gt;
&lt;li&gt;More Mexican food than I've seen in my life, and less variety in everything else (especially Chinese, Japanese, Korean, Indian). I haven't found anything to match &lt;a href="http://www.ethiopianhouse.com/"&gt;Ethiopian House&lt;/a&gt; or &lt;a href="http://www.mteverestrestaurant.ca/"&gt;Mount Everest&lt;/a&gt;, and I am overdue to &lt;a href="http://www.yelp.com/search?find_desc=pho&amp;amp;ns=1&amp;amp;find_loc=02139+Boston,+MA"&gt;find a place to satisfy a phō craving&lt;/a&gt;. It looks like the nearest places are at least 2 km away. Burritos may replace noodle soup as a cheap staple.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://harvard.edu/"&gt;That &lt;em&gt;other&lt;/em&gt; university&lt;/a&gt; has a dragon boat team, but MIT has none. There maybe be four teams in the whole city…if I've missed one. Compare with at least ten teams of varying competitiveness from UofT alone that show up at &lt;a href="http://www.dragonboats.com/pages/home.html"&gt;TIDBRF&lt;/a&gt; each June.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This is becoming a bit of a grab bag, and long, so I'll end here. The next post will be more focused on the student body, ESD and "freebies." If there are other things you'd specifically like to hear about please leave a comment!&lt;/p&gt;</content><category term="2010"/></entry><entry><title>Fun &amp; games with dbus-python</title><link href="https://paul.kishimoto.name/2010/08/fun-games-with-dbus-python" rel="alternate"/><published>2010-08-04T00:00:00+02:00</published><updated>2010-08-04T00:00:00+02:00</updated><author><name>Paul Natsuo Kishimoto</name></author><id>tag:paul.kishimoto.name,2010-08-04:/2010/08/fun-games-with-dbus-python</id><summary type="html">&lt;p&gt;Getting Things GNOME! (well, at least &lt;a href="https://code.launchpad.net/~gtg-contributors/gtg/dbus-server"&gt;my GSoC branch of it&lt;/a&gt;) is on its way to having a feature-complete DBus interface to its data store and the objects (Tasks and Tags) inside of it, as well as a client-side library.&lt;/p&gt;
&lt;p&gt;More on that later. This post is a memo of some lessons learned while reading &amp;amp; grokking the entire dbus-python codebase, its &lt;a href="http://dbus.freedesktop.org/doc/dbus-python/doc/tutorial.html"&gt;still-incomplete tutorial&lt;/a&gt;, and trying to make use of it all. &lt;a href="http://bazaar.launchpad.net/~aptdaemon-developers/aptdaemon/main/files"&gt;Aptdaemon&lt;/a&gt; was an invaluable help.&lt;/p&gt;
&lt;h2&gt;1. Claim your bus…and give it up nicely&lt;/h2&gt;
&lt;p&gt;This is akin to your mother telling you to, "Clean your room!" Claiming an object …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Getting Things GNOME! (well, at least &lt;a href="https://code.launchpad.net/~gtg-contributors/gtg/dbus-server"&gt;my GSoC branch of it&lt;/a&gt;) is on its way to having a feature-complete DBus interface to its data store and the objects (Tasks and Tags) inside of it, as well as a client-side library.&lt;/p&gt;
&lt;p&gt;More on that later. This post is a memo of some lessons learned while reading &amp;amp; grokking the entire dbus-python codebase, its &lt;a href="http://dbus.freedesktop.org/doc/dbus-python/doc/tutorial.html"&gt;still-incomplete tutorial&lt;/a&gt;, and trying to make use of it all. &lt;a href="http://bazaar.launchpad.net/~aptdaemon-developers/aptdaemon/main/files"&gt;Aptdaemon&lt;/a&gt; was an invaluable help.&lt;/p&gt;
&lt;h2&gt;1. Claim your bus…and give it up nicely&lt;/h2&gt;
&lt;p&gt;This is akin to your mother telling you to, "Clean your room!" Claiming an object path (&lt;code&gt;/org/gnome/GTG/Server&lt;/code&gt;) on a bus (&lt;code&gt;org.gnome.GTG&lt;/code&gt;) and then silently exiting is a good way to confuse the session bus and any clients who are trying to talk to your object. There's no automatic notification that you're gone; the proxies and interfaces they may be using won't &lt;a href="http://www.youtube.com/watch?v=MA2KmJMKFrQ#t=1m23s"&gt;self-destruct&lt;/a&gt;. Even the session bus may think you're still there, and tell new clients to look in the wrong place.&lt;/p&gt;
&lt;p&gt;This can lead to client code blocking for a &lt;em&gt;long&lt;/em&gt; time as it waits in vain for a response—annoying! To avoid this, explicitly claim the bus from the server on startup:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; import dbus
&amp;gt;&amp;gt;&amp;gt; dbus.SessionBus().request_name('org.gnome.GTG')
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;…and on shutdown (even if it's caused by a process signal or exception) be sure to release it:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; dbus.SessionBus().release_name('org.gnome.GTG')
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You can also do this by creating a &lt;a href="http://dbus.freedesktop.org/doc/dbus-python/api/dbus.service.BusName-class.html"&gt;&lt;code&gt;dbus.service.BusName&lt;/code&gt;&lt;/a&gt; instance, but be sure to &lt;code&gt;del&lt;/code&gt; it before exiting.&lt;/p&gt;
&lt;h2&gt;2. Start simply&lt;/h2&gt;
&lt;p&gt;Like us, you may be able to start the server-side code from the command line (&lt;code&gt;gtg --daemon&lt;/code&gt;). Trying to call this directly—for example via an &lt;a href="http://docs.python.org/library/os.html#os.popen"&gt;os.popen&lt;/a&gt;—is asking for a major headache. There is also no need to muck about with &lt;a href="http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/"&gt;daemonization recipes&lt;/a&gt; or ensure the server code runs in the proper environment; the DBus authors and your distro developers have taken care of that.&lt;/p&gt;
&lt;p&gt;Instead, make use of service definition files. On Ubuntu, these go in &lt;code&gt;/usr/share/dbus-1/services/&lt;/code&gt; and look like:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;[D-BUS Service]
Name=org.gnome.GTG
Exec=/usr/bin/gtg --daemon
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;From your code, you can invoke this precisely and directly with the single call:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; import dbus
&amp;gt;&amp;gt;&amp;gt; dbus.SessionBus().start_service_by_name('org.gnome.GTG')
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If the server is already running, the method simply returns a different value.&lt;/p&gt;
&lt;h2&gt;3. Object paths aren't URLs&lt;/h2&gt;
&lt;p&gt;In the age of Google, we are accustomed to seeing all kinds of data URL-encoded, resulting in monstrosities like:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href="http://maps.google.ca/maps?f=d&amp;amp;source=s_d&amp;amp;saddr=Vancouver,+BC&amp;amp;daddr=Winnipeg,+Manitoba+to:Trans-Canada+Hwy%2FON-17+S+to:45.422733,-75.698376+to:Halifax,+Nova+Scotia&amp;amp;hl=en&amp;amp;geocode=FQt57wIdQIKp-CkllQ21IO6FVDEciNbXbMfgpg%3BFYMz-QIdZ5A1-ikRKxr5-3PqUjFkyrnG-hoqKw%3BFTbY6QIdrG7H-g%3B%3BFbFJqQId8Oo1_CnB-tsHFCFaSzHcLYtDpuNrZg&amp;amp;mra=dpe&amp;amp;mrcr=1&amp;amp;mrsp=3&amp;amp;sz=14&amp;amp;via=2,3&amp;amp;sll=45.415865,-75.694084&amp;amp;sspn=0.064467,0.055189&amp;amp;ie=UTF8&amp;amp;t=h&amp;amp;z=14&amp;amp;layer=c&amp;amp;cbll=45.423222,-75.698705&amp;amp;panoid=W0H3GL0BecRylGpWyASQVQ&amp;amp;cbp=12,338.79,,1,-4.03"&gt;http://maps.google.ca/maps?f=d&amp;amp;source=s_d&amp;amp;saddr=Vancouver,+BC&amp;amp;daddr=Winnipeg,+Manitoba+to:Trans-Canada+Hwy%2FON-17+S+to:45.422733,-75.698376+to:Halifax,+Nova+Scotia&amp;amp;hl=en&amp;amp;geocode=FQt57wIdQIKp-CkllQ21IO6FVDEciNbXbMfgpg%3BFYMz-QIdZ5A1-ikRKxr5-3PqUjFkyrnG-hoqKw%3BFTbY6QIdrG7H-g%3B%3BFbFJqQId8Oo1_CnB-tsHFCFaSzHcLYtDpuNrZg&amp;amp;mra=dpe&amp;amp;mrcr=1&amp;amp;mrsp=3&amp;amp;sz=14&amp;amp;via=2,3&amp;amp;sll=45.415865,-75.694084&amp;amp;sspn=0.064467,0.055189&amp;amp;ie=UTF8&amp;amp;t=h&amp;amp;z=14&amp;amp;layer=c&amp;amp;cbll=45.423222,-75.698705&amp;amp;panoid=W0H3GL0BecRylGpWyASQVQ&amp;amp;cbp=12,338.79,,1,-4.03&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;…and creating a market for &lt;a href="http://tinyurl.com"&gt;URL shorteners&lt;/a&gt;. Even file system paths are in Unicode, and the DBus documentation &lt;a href="http://dbus.freedesktop.org/doc/dbus-tutorial.html#objects"&gt;misleadingly suggests&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;The object path looks like a filesystem path, for example an object could be named `/org/kde/kspread/sheets/3/cells/4/5`.&lt;/blockquote&gt;

&lt;p&gt;Don't get too excited by this. The characters you can use in a DBus object path are: /, a-z, A-Z, 0-9 and _. That's it. In GTG!, we use UUIDs for Task and Tag IDs:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; import uuid
&amp;gt;&amp;gt;&amp;gt; str(uuid.uuid())
'9bcb25f3-a630-4030-b82f-cd4cb7b17d65'
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So you might guess that a path for this object (a Task, say) could be &lt;code&gt;/org/gnome/GTG/Task/9bcb25f3-a630-4030-b82f-cd4cb7b17d65&lt;/code&gt;, right? Wrong. The hyphens aren't allowed, and we have to use:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; uuid.uuid4().hex
'4a08654fce994a92b49a8b62ff5a7817'
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Similarly, if you want to use human-readable strings (Tag names, for example) in paths, you'll either have to munge them to be acceptable, or deny your users the use of hyphens and spaces. Messy. Much easier just to choose a simple scheme of unique identifiers and pass &lt;em&gt;actual&lt;/em&gt; data through &lt;em&gt;actual&lt;/em&gt; method calls.&lt;/p&gt;</content><category term="2010"/></entry><entry><title>GTG GSoC, week 7 — "Testing, testing, 1, 2, 3…"</title><link href="https://paul.kishimoto.name/2010/07/gtg-gsoc-week-7-testing-testing-1-2-3" rel="alternate"/><published>2010-07-12T00:00:00+02:00</published><updated>2010-07-12T00:00:00+02:00</updated><author><name>Paul Natsuo Kishimoto</name></author><id>tag:paul.kishimoto.name,2010-07-12:/2010/07/gtg-gsoc-week-7-testing-testing-1-2-3</id><summary type="html">&lt;p&gt;Recently I have been working on two things related to achieving a client-server separation in Getting Things GNOME!&lt;/p&gt;
&lt;p&gt;One is a test suite that will cover all aspects and functionality of the DBus interfaces. The second is low-level code to support the interfaces themselves.&lt;/p&gt;
&lt;p&gt;Why not do them in sequence? Well, tinkering with the low level code is helping to outline what will and will not be possible with the
"DBus magic" I've blogged about on two &lt;a href="http://paul.kishimoto.name/300"&gt;previous&lt;/a&gt; &lt;a href="http://paul.kishimoto.name/301"&gt;occasions&lt;/a&gt;. Tests don't have to target against code that &lt;em&gt;already&lt;/em&gt; exists, but they should at least target code that &lt;em&gt;could&lt;/em&gt; exist.&lt;/p&gt;
&lt;p&gt;To …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Recently I have been working on two things related to achieving a client-server separation in Getting Things GNOME!&lt;/p&gt;
&lt;p&gt;One is a test suite that will cover all aspects and functionality of the DBus interfaces. The second is low-level code to support the interfaces themselves.&lt;/p&gt;
&lt;p&gt;Why not do them in sequence? Well, tinkering with the low level code is helping to outline what will and will not be possible with the
"DBus magic" I've blogged about on two &lt;a href="http://paul.kishimoto.name/300"&gt;previous&lt;/a&gt; &lt;a href="http://paul.kishimoto.name/301"&gt;occasions&lt;/a&gt;. Tests don't have to target against code that &lt;em&gt;already&lt;/em&gt; exists, but they should at least target code that &lt;em&gt;could&lt;/em&gt; exist.&lt;/p&gt;
&lt;p&gt;To explain more, the concept is to have more than just a DBus interface on the server. For the client, the dbus-python &lt;code&gt;ProxyObject&lt;/code&gt; and &lt;code&gt;Interface&lt;/code&gt; classes are a useful starting point, but I want to go further and let GTG! clients behave as if the objects they are handling were local (although, as James &lt;a href="http://paul.kishimoto.name/300#comment-1171"&gt;pointed out&lt;/a&gt;, clients will be faster if they don't naïvely trigger too many calls on the bus). This means providing a &lt;em&gt;client library&lt;/em&gt; that clients can optionally import and use, instead of grappling directly with the server's DBus interface.&lt;/p&gt;
&lt;p&gt;In coding this client library several interesting winkles have come up. For example, the &lt;a href="http://dbus.freedesktop.org/doc/dbus-tutorial.html"&gt;DBus tutorial&lt;/a&gt; discusses the distinction between &lt;em&gt;well-known&lt;/em&gt; names ('org.gnome.GTG') and &lt;em&gt;unique&lt;/em&gt; names (:34-907)—but these are only for buses. Each object (e.g. a GTG! Tag or Task) available on a bus needs to have an object path ('/org/gnome/GTG/Task/12345' or '/org/gnome/GTG/Task/54321').&lt;/p&gt;
&lt;p&gt;Because of the DBus message-passing architecture, &lt;em&gt;there is no way to know if anything exists at a given object path, until you try to access it&lt;/em&gt;. By analogy, the Internet's &lt;a href="http://en.wikipedia.org/wiki/Domain_Name_System"&gt;Domain Name System (DNS)&lt;/a&gt; can tell you that my website &lt;code&gt;paul.kishimoto.name&lt;/code&gt; exists at such-and-such an IP. But to determine if there is anything at a specific URL (http://paul.kishimoto.name/notapage), you need to try to access it and maybe get an HTTP &lt;a href="http://en.wikipedia.org/wiki/404_error"&gt;404 error&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Clients only care about actual Tasks and Tags, and repeatedly checking that its proxies still reference valid targets would be a pain in the neck. The solution is to provide &lt;a href="http://bazaar.launchpad.net/~gtg-contributors/gtg/dbus-server/annotate/head:/GTG/client.py#L159"&gt;helper code&lt;/a&gt; that checks the remote object exists before it hands a proxy to the client.&lt;/p&gt;
&lt;p&gt;Another problem that is cropping up is that the client needs to be able to understand and manipulate the tree hierarchy of Tags and Tasks, over the bus. But that will be another post…&lt;/p&gt;</content><category term="2010"/></entry><entry><title>Ignorance, or spite</title><link href="https://paul.kishimoto.name/2010/06/ignorance-or-spite" rel="alternate"/><published>2010-06-27T00:00:00+02:00</published><updated>2010-06-27T00:00:00+02:00</updated><author><name>Paul Natsuo Kishimoto</name></author><id>tag:paul.kishimoto.name,2010-06-27:/2010/06/ignorance-or-spite</id><summary type="html">&lt;p&gt;Some thoughts on the occasion of the G20 summit in Toronto.&lt;/p&gt;
&lt;p&gt;The police presence and violent protest were both of a scale unprecedented for this city. The security cost, at over $1 billion, was also unprecedented in the history of the G-summits and is &lt;a href="http://www.theglobeandmail.com/news/world/g8-g20/news/sarkozy-says-his-g8g20-will-cost-one-tenth-of-canadas/article1619637/"&gt;unlikely to ever be equalled&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Much ink will be shed on the taxonomy of protesters (a term which, apparently, also now includes opportunist vandals with no policy demands), the validity of their various motives and the contemptible nature of their actions. Equally, the actions of individuals among the tens of thousands of police involved will be …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Some thoughts on the occasion of the G20 summit in Toronto.&lt;/p&gt;
&lt;p&gt;The police presence and violent protest were both of a scale unprecedented for this city. The security cost, at over $1 billion, was also unprecedented in the history of the G-summits and is &lt;a href="http://www.theglobeandmail.com/news/world/g8-g20/news/sarkozy-says-his-g8g20-will-cost-one-tenth-of-canadas/article1619637/"&gt;unlikely to ever be equalled&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Much ink will be shed on the taxonomy of protesters (a term which, apparently, also now includes opportunist vandals with no policy demands), the validity of their various motives and the contemptible nature of their actions. Equally, the actions of individuals among the tens of thousands of police involved will be put under the microscope.&lt;/p&gt;
&lt;p&gt;Both those debates will prove fruitless. To me, it is more important to see the three outsized aspects of the event—police presence, violence and cost—as foreseeable consequences of the unnecessary and astoundingly poor choice of a venue for the summit.&lt;/p&gt;
&lt;p&gt;I have heard two believable theories about &lt;em&gt;how&lt;/em&gt; the choice was made: ignorance and spite.&lt;/p&gt;
&lt;p&gt;The 'ignorance' theory was advanced on &lt;a href="http://www.cbc.ca/thecurrent/2010/06/june-21-2010.html"&gt;CBC's The Current&lt;/a&gt; by Deborah Cowen of the University of Toronto. She noted that the Conservative government, with almost no seats in Toronto, Montréal or Vancouver, has an essentially rural background on which it draws and little firsthand knowledge about how large cities &lt;em&gt;actually are&lt;/em&gt;. The implication is that they might have honestly but falsely believed that the effect of promoting Toronto, Ontario and/or Canada would outweigh any disruption caused by security measures and protests.&lt;/p&gt;
&lt;p&gt;The 'spite' theory (of my more cynical friends) holds that the disruption was expected and anticipated by the government. In this view, the decision was to be seen—and appreciated—by the Conservatives' rural base as a giant middle finger raised towards Toronto and its citizens.&lt;/p&gt;
&lt;p&gt;The first explanation wins by Ockham's Razor, at least; but whichever is more accurate, it is certain the decision was made for political, not economical (read: cost-saving) reasons.&lt;/p&gt;
&lt;p&gt;To explain a bit more &lt;em&gt;why&lt;/em&gt; I think the choice was 'astoundingly poor,' and the consequences 'predictable' I will channel Jane Jacobs, late Torontonian, whose &lt;em&gt;The Death and Life of Great American Cities&lt;/em&gt; I recently read and enjoyed. Any errors in my paraphrase of her writings are, of course, my own.&lt;/p&gt;
&lt;p&gt;One of Jacobs' criteria for distinguishing Great (&lt;a href="http://en.wiktionary.org/wiki/great"&gt;very big, large scale; important&lt;/a&gt;) Cities is diversity of use. On a summer weekend in Toronto, the downtown streets might be used by shoppers, baseball fans, theatregoers, businesspeople, diners, marketers, people-watchers, store clerks, deliverymen, walkers, those passing through to the lake or parts west, east or north, local residents, café patrons, cyclists, taxi drivers, buskers, runners, transit staff, and a whole cast of others my imagination is too weak to summon. The vast majority of these people are strangers to one another, but their mere presence civilizes the streets, so that events like the &lt;a href="http://en.wikipedia.org/wiki/Jane_Creba"&gt;2005 Boxing Day shooting of Jane Creba&lt;/a&gt; are truly rare, unexpected and shocking.&lt;/p&gt;
&lt;p&gt;Jacobs contrasts diverse use with the atmosphere in single-use residential projects, where the same advantages (many eyes at all hours) are not enjoyed and, not coincidentally, comparatively more gang-related violence occurs.&lt;/p&gt;
&lt;p&gt;During an event like the current summit, normal usage is suppressed. Within the security perimeter, there is no use at all by locals. Security measures impede normal use in surrounding areas, so that the Blue Jays and theatres take their business elsewhere or cancel whole performances (even at large cost). People who would have attended these larger events have no reason to be in the same areas for meals and other secondary activities. The secondary businesses they would have frequented, always sensitive to demand, run reduced staffs, further depleting the stock of people on the streets. And so on. In the current, extraordinary situation, even residents flee who are able to stay with friends in the suburbs or out of town.&lt;/p&gt;
&lt;p&gt;Note that at no point is a collective decision made along the lines of, "Let's turn over the streets to rioters!"; instead, the deadening is an aggregate result of reasonable responses by normal individuals.&lt;/p&gt;
&lt;p&gt;The few uses that remain can be numbered on one hand: peaceful protesting, spectating (both amateur and professional), policing and violence. The dead streets are a boon only to those engaged in the latter two activities, who find it easier to identify members of the other groups without actual citizens around.&lt;/p&gt;
&lt;p&gt;Without any hysterics about professional anarchists or police &lt;em&gt;agents provocateurs&lt;/em&gt;, then, it is easy to see why emptying the city invites situations that would be impossible under everyday circumstances. That this conclusion can be reached on the basis of accessible, popular writing from the 1960s makes me doubt that no one in government raised an objection to the choice of location. Mayor David Miller and other representatives of the city claim openly that they put forward the Exhibition grounds (which, note, are &lt;em&gt;already&lt;/em&gt; largely empty) as an alternative.&lt;/p&gt;
&lt;p&gt;Those voices were obviously disregarded when the decision was made, and that disregard is the root cause of everything we have witnessed.&lt;/p&gt;</content><category term="2010"/></entry><entry><title>GTG GSoc, week 4 — Magic, dates, specs and more shuffling</title><link href="https://paul.kishimoto.name/2010/06/gtg-gsoc-week-4-magic-dates-specs-and-more-shuffling" rel="alternate"/><published>2010-06-20T00:00:00+02:00</published><updated>2010-06-20T00:00:00+02:00</updated><author><name>Paul Natsuo Kishimoto</name></author><id>tag:paul.kishimoto.name,2010-06-20:/2010/06/gtg-gsoc-week-4-magic-dates-specs-and-more-shuffling</id><summary type="html">&lt;p&gt;My fourth Getting Things GNOME! Summer of Code week had four work foci (a trend which will hopefully not continue 'til week 10…)&lt;/p&gt;
&lt;p&gt;One, I put up &lt;a href="http://paul.kishimoto.name/300"&gt;some code&lt;/a&gt; to the Planet, having been encouraged by &lt;a href="http://paul.kishimoto.name/298#comments"&gt;good responses to earlier queries&lt;/a&gt;. This time I stuck my neck out by proposing something larger, and in short order was told three new things to consider—for example, the &lt;a href="http://en.wikipedia.org/wiki/Mixin"&gt;mixin concept&lt;/a&gt;. With this input, I have improved my &lt;code&gt;FancyInterface&lt;/code&gt;, which lets you access DBus properties as Python attributes of &lt;code&gt;ProxyObject&lt;/code&gt;s. Check out the code (standalone, for the moment) &lt;a href="http://bazaar.launchpad.net/~khaeru/+junk/dbus-magic/files"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Many of the …&lt;/p&gt;</summary><content type="html">&lt;p&gt;My fourth Getting Things GNOME! Summer of Code week had four work foci (a trend which will hopefully not continue 'til week 10…)&lt;/p&gt;
&lt;p&gt;One, I put up &lt;a href="http://paul.kishimoto.name/300"&gt;some code&lt;/a&gt; to the Planet, having been encouraged by &lt;a href="http://paul.kishimoto.name/298#comments"&gt;good responses to earlier queries&lt;/a&gt;. This time I stuck my neck out by proposing something larger, and in short order was told three new things to consider—for example, the &lt;a href="http://en.wikipedia.org/wiki/Mixin"&gt;mixin concept&lt;/a&gt;. With this input, I have improved my &lt;code&gt;FancyInterface&lt;/code&gt;, which lets you access DBus properties as Python attributes of &lt;code&gt;ProxyObject&lt;/code&gt;s. Check out the code (standalone, for the moment) &lt;a href="http://bazaar.launchpad.net/~khaeru/+junk/dbus-magic/files"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Many of the the &lt;em&gt;fields&lt;/em&gt; in the GTG data model will be exported as DBus &lt;em&gt;properties&lt;/em&gt; using the above code. &lt;a href="http://live.gnome.org/gtg/DBus"&gt;These chunks of XML code&lt;/a&gt; give an overall picture of the interfaces that will be used in GTG, in the standard &lt;a href="http://dbus.freedesktop.org/doc/dbus-specification.html#introspection-format"&gt;DBus introspection format&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Third, I've &lt;a href="https://code.launchpad.net/~gtg-contributors/gtg/new-date-class/+merge/28009"&gt;proposed a new Date class&lt;/a&gt; for GTG. Dates in GTG go beyond what's provided by the &lt;a href="http://docs.python.org/library/datetime.html"&gt;&lt;code&gt;datetime&lt;/code&gt;&lt;/a&gt; module, because we support some 'fuzzy' concepts like &lt;em&gt;now&lt;/em&gt;, &lt;em&gt;soon&lt;/em&gt; and &lt;em&gt;later&lt;/em&gt;. Not only must these be stored and sorted (alongside fixed dates and non-/null dates), but they'll have to go over DBus as strings once my project is complete…hence the new class.&lt;/p&gt;
&lt;p&gt;Fourth and last, the divorce proceedings for existing code continue! With &lt;a href="http://wiki.github.com/jgoerzen/offlineimap/"&gt;OfflineIMAP&lt;/a&gt; (&lt;em&gt;highly&lt;/em&gt; recommended) as my inspiration, &lt;a href="https://code.launchpad.net/~gtg-contributors/gtg/code-layout-2"&gt;this merge&lt;/a&gt; will make the "gtg" executable your one-stop shop for GTK, command-line and other, future UIs. Forcing "gtcli" and "gtg" together helped me see which dependencies were of &lt;em&gt;one&lt;/em&gt; UI; which were of &lt;em&gt;all&lt;/em&gt; UIs, and which things are needed by both the UIs and core.&lt;/p&gt;</content><category term="2010"/></entry><entry><title>Class attributes with dbus-python</title><link href="https://paul.kishimoto.name/2010/06/class-attributes-with-dbus-python" rel="alternate"/><published>2010-06-14T00:00:00+02:00</published><updated>2010-06-14T00:00:00+02:00</updated><author><name>Paul Natsuo Kishimoto</name></author><id>tag:paul.kishimoto.name,2010-06-14:/2010/06/class-attributes-with-dbus-python</id><summary type="html">&lt;p&gt;DBus is great, and so is Python—each for their own reasons. One mismatch is that everything passing over the bus must be a &lt;em&gt;message&lt;/em&gt; or &lt;em&gt;signal&lt;/em&gt;. You wind up with Python code that looks like&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;proxyobject.SetThis('foo')
bar = proxyobject.GetThat()
proxyobject.DoSomeOtherStuff()
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But then you realize the dbus-python binding is very Pythonic, so you can extend it in a Pythonic way. Here's something I banged together in about half an hour:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; import dbus

 class FancyInterface(dbus.Interface):
     """A fancier DBus Interface.

     Derived classes should define a list of strings __dbus_properties__ and a
     _dbus_interface. For every listed property ('foo' …&lt;/code&gt;&lt;/pre&gt;</summary><content type="html">&lt;p&gt;DBus is great, and so is Python—each for their own reasons. One mismatch is that everything passing over the bus must be a &lt;em&gt;message&lt;/em&gt; or &lt;em&gt;signal&lt;/em&gt;. You wind up with Python code that looks like&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;proxyobject.SetThis('foo')
bar = proxyobject.GetThat()
proxyobject.DoSomeOtherStuff()
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But then you realize the dbus-python binding is very Pythonic, so you can extend it in a Pythonic way. Here's something I banged together in about half an hour:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; import dbus

 class FancyInterface(dbus.Interface):
     """A fancier DBus Interface.

     Derived classes should define a list of strings __dbus_properties__ and a
     _dbus_interface. For every listed property ('foo') the named interface
     should support two methods:
       * GetFoo() -- accepts nothing, returns a single value.
       * SetFoo(..) -- returns nothing, accepts a single value of the same type
         as GetFoo.

     Then DerivedClass.foo may be accessed as if it were a normal variable.

     """
     def __init__(self, object):
         # next four lines from dbus.Interface.__init__()
         if isinstance(object, dbus.Interface):
             self._obj = object.proxy_object
         else:
             self._obj = object
         # set up properties
         for a in self.__dbus_properties__:
             fget = lambda self: self._obj.get_dbus_method('Get' +
               a.capitalize())()
             fset = lambda self, value: self._obj.get_dbus_method('Set' +
               a.capitalize())(value)
             setattr(self.__class__, a, property(fget, fset))


 class Sample(FancyInterface):
     _dbus_interface = 'com.example.SampleInterface'
     __dbus_properties__ = ('foo', 'bar',)
     def __init__(self, object): FancyInterface.__init__(self, object)
     # this class is 'empty' otherwise…
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Using &lt;code&gt;FancyInterface&lt;/code&gt;, it becomes even easier to forget you're talking to a proxy of a remote object:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;bus = dbus.SessionBus()
o = Sample(bus.get_object('com.example.SampleService',
  '/SomeObject'))
o.foo = 'Hello, '
o.bar = 'world!'
print o.foo, o.bar
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Look for this stuff being used in &lt;a href="https://launchpad.net/gtg"&gt;GTG&lt;/a&gt; in the near future! (Also, fixes to my blog CSS…)&lt;/p&gt;</content><category term="2010"/></entry><entry><title>GTG GSoc, week 3 — Grilled cheese sandwiches!</title><link href="https://paul.kishimoto.name/2010/06/gtg-gsoc-week-3-grilled-cheese-sandwiches" rel="alternate"/><published>2010-06-12T00:00:00+02:00</published><updated>2010-06-12T00:00:00+02:00</updated><author><name>Paul Natsuo Kishimoto</name></author><id>tag:paul.kishimoto.name,2010-06-12:/2010/06/gtg-gsoc-week-3-grilled-cheese-sandwiches</id><summary type="html">&lt;p&gt;The third week of my Summer of Code project (separating client and server parts of Getting Things GNOME!) was a busy one.&lt;/p&gt;
&lt;p&gt;In some long but well-reasoned discussion on the &lt;a href="https://launchpad.net/~gtg-contributors"&gt;gtg-contributors&lt;/a&gt; mailing list, we reached consensus that the GTG data model will add task duration, and drop an older kind of task ID in favour of &lt;a href="http://docs.python.org/library/uuid.html"&gt;UUID&lt;/a&gt;s. The duration field will let users estimate how long it will take them to complete a task or set of tasks. As for UUIDs, the benefit ("universally unique") is in the name!&lt;/p&gt;
&lt;p&gt;One other proposal—adding a priority field—is still under …&lt;/p&gt;</summary><content type="html">&lt;p&gt;The third week of my Summer of Code project (separating client and server parts of Getting Things GNOME!) was a busy one.&lt;/p&gt;
&lt;p&gt;In some long but well-reasoned discussion on the &lt;a href="https://launchpad.net/~gtg-contributors"&gt;gtg-contributors&lt;/a&gt; mailing list, we reached consensus that the GTG data model will add task duration, and drop an older kind of task ID in favour of &lt;a href="http://docs.python.org/library/uuid.html"&gt;UUID&lt;/a&gt;s. The duration field will let users estimate how long it will take them to complete a task or set of tasks. As for UUIDs, the benefit ("universally unique") is in the name!&lt;/p&gt;
&lt;p&gt;One other proposal—adding a priority field—is still under debate.&lt;/p&gt;
&lt;p&gt;Also, the &lt;a href="https://code.launchpad.net/~gtg-contributors/gtg/code-layout/+merge/27279"&gt;first part&lt;/a&gt; of an aforementioned code reorganization went in. (Of about seven bzr branches I've had merged with &lt;code&gt;lp:gtg&lt;/code&gt;, the biggest are &lt;a href="https://code.launchpad.net/~khaeru/gtg/prefs-dialog/+merge/19367"&gt;1909&lt;/a&gt;, 624 and &lt;a href="https://code.launchpad.net/~khaeru/gtg/bugfix-lp-492713"&gt;225&lt;/a&gt; lines, a trend which might continue…but still no match for &lt;a href="https://code.launchpad.net/~gtg-user/gtg/backends-first-merge/+merge/26532"&gt;&lt;em&gt;this&lt;/em&gt;&lt;/a&gt;!)&lt;/p&gt;
&lt;p&gt;This week and next, my biggest task is deciding which DBus interfaces should be exposed by the server part of GTG, and what each one should look like. It turns out that when your application is a delicious &lt;a href="http://en.wikipedia.org/wiki/Grilled_cheese_sandwich#Grilled_cheese_sandwich_.2F_Toasted_Sandwich"&gt;grilled cheese sandwich&lt;/a&gt; of usefulness, the decision to pull it apart means you need to deal with a glue-like mass of sticky, melted cheese.&lt;/p&gt;
&lt;p&gt;…maybe that food-based metaphor will only work for fellow Canadians. What I mean is that a line needs to be drawn across the codebase demarcating what is "server" and what is "client", and in any moderately-complex application that line ends up crossing many, many function calls. The sheer number of these, a non-issue for a monolithic app, becomes problematic because each will need to be spec'd and later maintained to spec.&lt;/p&gt;
&lt;p&gt;In this case, the way out was to &lt;code&gt;grep&lt;/code&gt; up &lt;a href="http://live.gnome.org/gtg/SoC/2010/PaulKishimoto/DBusNotes"&gt;a list of calls from the GTG UI to GTG core&lt;/a&gt;. Examination of this list suggested &lt;a href="http://live.gnome.org/gtg/SoC/2010/PaulKishimoto/DBusNotes#Changes"&gt;several ways&lt;/a&gt; to streamline the flow of data, which become work items that give me lots of coding to do. Onward!&lt;/p&gt;</content><category term="2010"/></entry><entry><title>GTG SoC, week 2 — GNOME's Next Top Model</title><link href="https://paul.kishimoto.name/2010/06/gtg-soc-week-2-gnomes-next-top-model" rel="alternate"/><published>2010-06-07T00:00:00+02:00</published><updated>2010-06-07T00:00:00+02:00</updated><author><name>Paul Natsuo Kishimoto</name></author><id>tag:paul.kishimoto.name,2010-06-07:/2010/06/gtg-soc-week-2-gnomes-next-top-model</id><summary type="html">&lt;p&gt;Following on my last week's work &lt;a href="http://paul.kishimoto.name/297"&gt;mapping the Getting Things GNOME! data model&lt;/a&gt;, week 2 of my GSoC experience involved preparing &lt;a href="http://live.gnome.org/gtg/DataModel/Analysis"&gt;this somewhat-lengthy analysis&lt;/a&gt; of how we store tasks in GTG, and how it should change. Of course, it doesn't hold a candle to things like the &lt;a href="http://tools.ietf.org/html/rfc5545"&gt;168-page iCalendar RFC&lt;/a&gt;…of which a &lt;a href="http://tools.ietf.org/html/rfc5545#section-3.3.10"&gt;good&lt;/a&gt; &lt;a href="http://tools.ietf.org/html/rfc5545#section-3.8.4.4"&gt;ten&lt;/a&gt; &lt;a href="http://tools.ietf.org/html/rfc5545#section-3.8.5"&gt;percent&lt;/a&gt; is devoted to the recurrence specification grammar for VEVENTs and VTODOs.&lt;/p&gt;
&lt;p&gt;Needless to say, I recommended we find a more straightforward way of solving &lt;a href="https://bugs.launchpad.net/gtg/+bug/344432"&gt;this bug&lt;/a&gt;. To make you read the actual analysis, I won't give away my other conclusions here!&lt;/p&gt;
&lt;p&gt;I have also …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Following on my last week's work &lt;a href="http://paul.kishimoto.name/297"&gt;mapping the Getting Things GNOME! data model&lt;/a&gt;, week 2 of my GSoC experience involved preparing &lt;a href="http://live.gnome.org/gtg/DataModel/Analysis"&gt;this somewhat-lengthy analysis&lt;/a&gt; of how we store tasks in GTG, and how it should change. Of course, it doesn't hold a candle to things like the &lt;a href="http://tools.ietf.org/html/rfc5545"&gt;168-page iCalendar RFC&lt;/a&gt;…of which a &lt;a href="http://tools.ietf.org/html/rfc5545#section-3.3.10"&gt;good&lt;/a&gt; &lt;a href="http://tools.ietf.org/html/rfc5545#section-3.8.4.4"&gt;ten&lt;/a&gt; &lt;a href="http://tools.ietf.org/html/rfc5545#section-3.8.5"&gt;percent&lt;/a&gt; is devoted to the recurrence specification grammar for VEVENTs and VTODOs.&lt;/p&gt;
&lt;p&gt;Needless to say, I recommended we find a more straightforward way of solving &lt;a href="https://bugs.launchpad.net/gtg/+bug/344432"&gt;this bug&lt;/a&gt;. To make you read the actual analysis, I won't give away my other conclusions here!&lt;/p&gt;
&lt;p&gt;I have also started &lt;a href="http://live.gnome.org/gtg/UserStories"&gt;a page for user stories&lt;/a&gt; to guide future development, and begun &lt;a href="https://code.launchpad.net/~gtg-contributors/gtg/code-layout/+merge/26624"&gt;moving around large blocks of code&lt;/a&gt; to start to tease apart the user-facing and core portions of GTG.&lt;/p&gt;
&lt;p&gt;Some questions for the Planet hive mind:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Which is preferred idiom — &lt;code&gt;import sys; sys.exit(1)&lt;/code&gt; or &lt;code&gt;raise SystemExit(1)&lt;/code&gt;? The latter avoids an import…&lt;/li&gt;
&lt;li&gt;Likewise, most modern PyGTK applications include a &lt;code&gt;pygtk.require('2.0')&lt;/code&gt; wrapped in a &lt;code&gt;try/except&lt;/code&gt; clause. Is this suggested/required in &lt;em&gt;every&lt;/em&gt; file that imports &lt;code&gt;gtk&lt;/code&gt;, only the &lt;em&gt;lowest&lt;/em&gt; level, or only &lt;em&gt;once&lt;/em&gt; per application (presumably in the root or top-level UI module)?&lt;/li&gt;
&lt;/ol&gt;</content><category term="2010"/></entry><entry><title>Getting Things GNOME!</title><link href="https://paul.kishimoto.name/2010/05/getting-things-gnome" rel="alternate"/><published>2010-05-29T00:00:00+02:00</published><updated>2010-05-29T00:00:00+02:00</updated><author><name>Paul Natsuo Kishimoto</name></author><id>tag:paul.kishimoto.name,2010-05-29:/2010/05/getting-things-gnome</id><summary type="html">&lt;p&gt;Hello, Planet GNOME! I'm Paul Kishimoto, working this summer on &lt;a href=""&gt;Getting Things GNOME!&lt;/a&gt; as part of Google's Summer of Code. You've already heard from &lt;a href="http://allievi.sssup.it/techblog/?cat=71"&gt;Luca&lt;/a&gt; and &lt;a href="http://karlojez.wordpress.com/2010/05/23/"&gt;Karlo&lt;/a&gt;, my partners in &lt;del&gt;crime&lt;/del&gt; coding.&lt;/p&gt;
&lt;p&gt;To complement both Karlo's &lt;a href="http://live.gnome.org/gtg/soc2010_jez"&gt;web-based interface to GTG&lt;/a&gt; (which will let you &lt;em&gt;access&lt;/em&gt; your tasks from anywhere) and Luca's &lt;a href="http://live.gnome.org/gtg/soc2010_invernizzi"&gt;multi-backend overhaul&lt;/a&gt; (which will let you &lt;em&gt;store&lt;/em&gt; them anywhere), I will be working on a client-server separation in GTG. If you are interested, you can read &lt;a href="http://live.gnome.org/gtg/SoC/2010/PaulKishimoto"&gt;details in my work plan&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The possibility of client-server separation in GTG will be largely enabled by the wonderful DBus. Accordingly, I have …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Hello, Planet GNOME! I'm Paul Kishimoto, working this summer on &lt;a href=""&gt;Getting Things GNOME!&lt;/a&gt; as part of Google's Summer of Code. You've already heard from &lt;a href="http://allievi.sssup.it/techblog/?cat=71"&gt;Luca&lt;/a&gt; and &lt;a href="http://karlojez.wordpress.com/2010/05/23/"&gt;Karlo&lt;/a&gt;, my partners in &lt;del&gt;crime&lt;/del&gt; coding.&lt;/p&gt;
&lt;p&gt;To complement both Karlo's &lt;a href="http://live.gnome.org/gtg/soc2010_jez"&gt;web-based interface to GTG&lt;/a&gt; (which will let you &lt;em&gt;access&lt;/em&gt; your tasks from anywhere) and Luca's &lt;a href="http://live.gnome.org/gtg/soc2010_invernizzi"&gt;multi-backend overhaul&lt;/a&gt; (which will let you &lt;em&gt;store&lt;/em&gt; them anywhere), I will be working on a client-server separation in GTG. If you are interested, you can read &lt;a href="http://live.gnome.org/gtg/SoC/2010/PaulKishimoto"&gt;details in my work plan&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The possibility of client-server separation in GTG will be largely enabled by the wonderful DBus. Accordingly, I have spent a good amount of time vacuuming down the &lt;a href="http://www.freedesktop.org/wiki/Software/dbus#Documentation"&gt;excellent DBus documentation&lt;/a&gt; in an effort to get beyond being a mere hacker and to the point where I can exploit its features fully.&lt;/p&gt;
&lt;p&gt;Once you board the bus, there are many people already on it to talk to. It also turns out that some of those people care about &lt;em&gt;tasks&lt;/em&gt;, in similar ways to GTG!, and furthermore there are other task enthusiasts who don't yet ride the bus. So, my second work item for this week was to &lt;a href="http://live.gnome.org/gtg/DataModel"&gt;map out exactly what GTG thinks a task &lt;em&gt;is&lt;/em&gt;&lt;/a&gt;, and then go about &lt;a href="http://spreadsheets.google.com/ccc?key=0AhRkDXhnjLt8dHM3MmZ0YmJnMm1UM1hySFNlaDBVc1E&amp;amp;hl=en_GB"&gt;comparing it to other tools&lt;/a&gt;, including (in no particular order) &lt;a href="http://projects.gnome.org/tracker/"&gt;Tracker&lt;/a&gt;, &lt;a href="http://projecthamster.wordpress.com"&gt;Hamster&lt;/a&gt;, &lt;a href="http://live.gnome.org/action/show/GnomeActivityJournal"&gt;Zeitgeist&lt;/a&gt;, &lt;a href="http://live.gnome.org/Planner"&gt;Planner&lt;/a&gt;, and more.&lt;/p&gt;
&lt;p&gt;Understanding these relationships is key to making GTG! work together closely and intelligently with whatever set of other applications each user prefers, ultimately giving them the freedom to work in the way they want.&lt;/p&gt;</content><category term="2010"/></entry><entry><title>A very simple creature</title><link href="https://paul.kishimoto.name/2010/04/a-very-simple-creature" rel="alternate"/><published>2010-04-05T00:00:00+02:00</published><updated>2010-04-05T00:00:00+02:00</updated><author><name>Paul Natsuo Kishimoto</name></author><id>tag:paul.kishimoto.name,2010-04-05:/2010/04/a-very-simple-creature</id><summary type="html">&lt;p&gt;Recently several people have expressed frustration, within hearing range, over infuriating actions of large companies. For example, Apple's practice of generating excessive hype for unremarkable hardware by applying a spot of polish and a kiloton of marketing. &lt;a href="http://www.cbc.ca/consumer/story/2010/03/29/air-canada-challenge-toronto-island.html"&gt;Aggressive lawsuits&lt;/a&gt; and &lt;a href="http://en.wikipedia.org/wiki/Patent_troll"&gt;patent trolling&lt;/a&gt; are another instance. &lt;a href="http://www.hudsondredging.com/harpers_missed_the_boat/"&gt;Attacks on the reputability&lt;/a&gt; of excellent sources of journalism are a third.&lt;/p&gt;
&lt;p&gt;The corporation is a paradox. Unlike the human beings that own and work for it, the corporate entity can be physically massive and far-reaching, to the point of incomprehensibility. We are hard-pressed to even picture Toyota's 300,000 employees, or the 9 million …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Recently several people have expressed frustration, within hearing range, over infuriating actions of large companies. For example, Apple's practice of generating excessive hype for unremarkable hardware by applying a spot of polish and a kiloton of marketing. &lt;a href="http://www.cbc.ca/consumer/story/2010/03/29/air-canada-challenge-toronto-island.html"&gt;Aggressive lawsuits&lt;/a&gt; and &lt;a href="http://en.wikipedia.org/wiki/Patent_troll"&gt;patent trolling&lt;/a&gt; are another instance. &lt;a href="http://www.hudsondredging.com/harpers_missed_the_boat/"&gt;Attacks on the reputability&lt;/a&gt; of excellent sources of journalism are a third.&lt;/p&gt;
&lt;p&gt;The corporation is a paradox. Unlike the human beings that own and work for it, the corporate entity can be physically massive and far-reaching, to the point of incomprehensibility. We are hard-pressed to even picture Toyota's 300,000 employees, or the 9 million cars it sells annually. Conversely, while the behaviour of their employees and investors as individuals is complex, corporate 'behaviour' is very simply-motivated.&lt;/p&gt;
&lt;p&gt;In fact, it is not &lt;em&gt;reductio ad absurdum&lt;/em&gt; to say that nearly all business ventures have a single purpose: to generate a return on investment. This is an ineluctable truth, their &lt;em&gt;raison d'être&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;With this in mind, we see that it is unreasonable to treat corporate behaviour as if it were human behaviour. "Singly-motivated" humans are frequently described as insane. Likewise, it is unreasonable to describe corporate behaviour using the human qualities of hypocrisy, audacity, justice, honesty, fairness, consistency, etc.&lt;/p&gt;
&lt;p&gt;On the other hand, lower life forms, which respond predictably to changes in their environment, are a good model. If I say that ivy will put roots in weak mortar, unable to know that such action will cause the wall on which it lives to collapse, you can begin to see my meaning.&lt;/p&gt;
&lt;p&gt;Bacterial colonies can be made to commit suicide by consuming all the food in a closed container. Similarly, when the return on investment is demanded quickly, the corporation can be expected shoot itself in the foot by generating short-term profit and ignoring (or actively denying) the possibility of long-term repercussions.&lt;/p&gt;
&lt;p&gt;There are, of course, attempts to quantify the human impact of corporate activities. In such discussions you hear the terms goodwill, corporate social responsibility, ethical consumerism, and so on. But at root these are ways of assigning monetary value to efforts to limit profit-reducing public backlash against corporate actions which are seen as 'evil'. In nature, small creatures will avoid the unwanted attention of predators and competitors.&lt;/p&gt;
&lt;p&gt;Applying this sort of analysis doesn't reduce the human damage often caused by corporate actors, but it certainly renders most instances unsurprising. The comparison works best for larger companies, in which the actions of the whole are most divorced from any good intent of the many individual employees. It also explains why we tend to see fewer 'inhumane' behaviours from non-profit organizations and charities. Freed of the overriding imperative to generate returns, these entities can adopt decision-making structures that tend to increase other outcomes.&lt;/p&gt;
&lt;p&gt;Finally, to my mind, the analogy clarifies the issue of public versus private provision of government services. To shoehorn the positive societal impacts we expect from certain government programs into the measure of profit or return on investment is often inappropriate. Even where it is, private service providers can &lt;em&gt;only&lt;/em&gt; be expected to yield the desired outcome if the direction of increased return is carefully aligned with more positive societal impact. On the other hand, as outlined above, the same providers can be expected to find &lt;em&gt;all&lt;/em&gt; new ways of generating returns which do not necessarily correspond to any societal improvement—bursting like so many blades of grass through cracks in the figurative pavement.&lt;/p&gt;</content><category term="2010"/></entry><entry><title>Obesity</title><link href="https://paul.kishimoto.name/2010/02/obesity" rel="alternate"/><published>2010-02-16T00:00:00+01:00</published><updated>2010-02-16T00:00:00+01:00</updated><author><name>Paul Natsuo Kishimoto</name></author><id>tag:paul.kishimoto.name,2010-02-16:/2010/02/obesity</id><summary type="html">&lt;p&gt;I have almost finished reading the brilliant book &lt;a href="http://www.beacon.org/productdetails.cfm?PC=1384"&gt;&lt;em&gt;Beyond Growth&lt;/em&gt;&lt;/a&gt; by the economist &lt;a href="http://en.wikipedia.org/wiki/Herman_Daly"&gt;Herman Daly&lt;/a&gt;. It is worth quoting at length:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;We have three economic problems to consider: allocation, distribution and scale.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Allocation&lt;/strong&gt; refers to the apportioning of resources among alternative product uses—food, bicycles, cars, medical care. An allocation is &lt;em&gt;efficient&lt;/em&gt; if it corresponds to effective demand, that is, the relative preferences of the citizens as weighted by their relative incomes, both taken as given. An &lt;em&gt;inefficient&lt;/em&gt; allocation will use resources to produce a number of things that people will not buy, and will fail to produce other things …&lt;/p&gt;&lt;/blockquote&gt;</summary><content type="html">&lt;p&gt;I have almost finished reading the brilliant book &lt;a href="http://www.beacon.org/productdetails.cfm?PC=1384"&gt;&lt;em&gt;Beyond Growth&lt;/em&gt;&lt;/a&gt; by the economist &lt;a href="http://en.wikipedia.org/wiki/Herman_Daly"&gt;Herman Daly&lt;/a&gt;. It is worth quoting at length:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;We have three economic problems to consider: allocation, distribution and scale.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Allocation&lt;/strong&gt; refers to the apportioning of resources among alternative product uses—food, bicycles, cars, medical care. An allocation is &lt;em&gt;efficient&lt;/em&gt; if it corresponds to effective demand, that is, the relative preferences of the citizens as weighted by their relative incomes, both taken as given. An &lt;em&gt;inefficient&lt;/em&gt; allocation will use resources to produce a number of things that people will not buy, and will fail to produce other things that people would buy if only they could find them. It would be characterized by shortages of the latter and surpluses of the former.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Distribution&lt;/strong&gt; refers to the apportioning of goods produced (and the resources they embody) among different people (as opposed to different commodities). Distributions are &lt;em&gt;just&lt;/em&gt; or &lt;em&gt;unjust&lt;/em&gt;; allocations are &lt;em&gt;efficient&lt;/em&gt; or &lt;em&gt;inefficient&lt;/em&gt;. There is an efficient allocation for each distribution of income.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Scale&lt;/strong&gt; refers to the physical size of the economy relative to the ecosystem. The economy is viewed, in its physical dimensions, as a subsystem of the larger ecosystem. Scale is measured as population times per capita resource use—in other words total resource use—the volume of the matter/energy throughput (metabolic flow) by which the ecosystem sustains the economic subsystem. Scale may be &lt;em&gt;sustainable&lt;/em&gt; or &lt;em&gt;unsustainable&lt;/em&gt;. An &lt;em&gt;efficient&lt;/em&gt; allocation does not imply a &lt;em&gt;just&lt;/em&gt; distribution. Neither an &lt;em&gt;efficient&lt;/em&gt; allocation or a &lt;em&gt;just&lt;/em&gt; distribution, nor both, implies a &lt;em&gt;sustainable&lt;/em&gt; scale.&lt;/p&gt;
&lt;p&gt;The three concepts are quite distinct, although relations among them exist, as noted above.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;(I had planned to write on this topic, but instead put a gift card towards this purchase—a lucky choice, in hindsight. Usually I am happier to read on new topics than to share my clumsy initial thoughts. Experience is starting to show this is a good habit.)&lt;/p&gt;
&lt;p&gt;Daly points out that economics and the problem of &lt;em&gt;scale&lt;/em&gt; cannot escape elementary thermodynamics. Human economic activity takes low-entropy matter &amp;amp; energy as input and produces high-entropy wastes. The ecosystem has a limited ability to convert the latter to the former. He also hints that the scale of the economy is &lt;strong&gt;un&lt;/strong&gt;sustainable, or will soon be at current rates of growth. There are also a number of elegantly simple diagrams I will surely reproduce and reuse. &lt;/p&gt;
&lt;p&gt;The very clear explanations lend weight to a number of incubating personal beliefs:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;"Ethical-" or "green consumerism" cannot solve problems of _scale_. The much-touted power of individuals making smart product choices is limited to adjusting effective demand, and in turn _allocation_. Really the only choice which can help us (well-off North Americans) solve the scale problem is to _not consume_.&lt;/li&gt;
  &lt;li&gt;Posturing about "equal treatment" of rich and poor nations in (for example) carbon-limiting agreements is misguided. If there is an optimal scale for the global economy, the corresponding per capita resource use is certainly lower than the current level in the richest nations, or higher than that in the poorest. The necessary adjustments differ greatly depending on which is the case.&lt;/li&gt;
  &lt;li&gt;As a corollary to the above, poor nations (Daly says bluntly "the South") cannot follow the same historical trajectory of development as the North. China and India, for example, err badly in aiming for the North American level of consumption. North America, unconscious of the image it presents, errs badly in encouraging such aims. We cannot all live this way; the only "fair" thing is that no one try either to achieve _or maintain_ it.&lt;/li&gt;
  &lt;li&gt;Population control is an inescapable necessity. Either our current 6.8-billion must live in general poverty, or some lower number may live comfortably. It is better to accomplish this peacefully than violently.&lt;/li&gt;
  &lt;li&gt;In order to muster the political courage to control population, we must first prove to ourselves that we can solve other problems associated with reaching optimal scale.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These considerations motivate major changes, but of course they don't mean that we must choose to be unhealthy, uncomfortable, hungry or unhappy.&lt;/p&gt;
&lt;p&gt;More (hopefully) soon.&lt;/p&gt;</content><category term="2010"/></entry></feed>