Cameron Desautels

Hacking life for fun and profit.

100 MPH in the Wrong Direction

| Comments

It’s easy to go 100 miles per hour in the wrong direction and think you’re accomplishing something by your efforts and when you arrive in a strange place and finally stop to ask where you are you wonder how you got so off-track when you tried so hard. But of course it’s the most basic principle of reality that, as Lao-Tse put it, if we don’t change where we’re going we’ll end up where we’re headed.


This post, written 2012-06-30, is part of a series of older writings I’m trying to polish and publish before they collect even more dust.

Buddhist Acceptance

| Comments

I’ve probably written about Buddhism two dozen times but never published a word of it. I think that’s owing to the fact that I don’t feel a sense of expertise, only an acute interest. Perhaps that’s not the best approach since even the masters of Buddhism don’t claim mastery.

I’ve never called myself a Buddhist because I’ve never been a disciple, but rather one fortunate enough to be warmed by simple proximity to its ideas. Its influence on my life waxes and wanes, but there’s an omnipresent feeling of kinship with those who ask the question “what should I do with my life?” and have the courage to answer it without resorting to self-deception.

To those who ask such questions, Buddhism’s 1,500 years of quiet introspection are hard to ignore. Its humble way of presenting deep truths unadorned makes it easy to mistake them for the mundane. We expect treasures to be hidden, not left in plain sight.

One important lesson I’ve learned from Buddhism is that thinking that your life should be without problems is itself a source of problems. An impediment to happiness. If we accept that we will always have (some) problems then we should rarely have cause to be upset by our situation. We’ve calibrated our instruments to be in line with reality instead of starting from the foundation that life should be something other than it is. This is what a Buddhist means when he says that our problems are of our own creation.

We should accept, even aesthetically that the world is clumsy, complex, and hilarious. Apes wearing suits because someone taught them to be afraid of their skin. A reverse Emperor’s New Clothes in which the naked man is wise and the clothed men have been deceived.

So many of the great sages of Zen and Taoism are remembered to have great senses of humor. Why is this? What exactly is it about being wise (in Zen) that creates a sense of humor? Maybe we need to question which way the arrow of implication points: perhaps it is having a sense of humor that leads one to be wise. If the ultimate answer is that there is no answer, what choice have we but to laugh?

It may sound like I’m suggesting both holding our most important ideas dear and laughing at them—and that’s exactly what I’m doing.


This post, started 2012-03-29, is part of a series of older writings I’m trying to polish and publish before they collect even more dust.

Accept It, Ubiquitous Computing Is Here to Stay

| Comments

I have to admit I’m pretty excited about Google Glass. It’s a big step forward for lifelogging, for augmented reality, and for ubiquitous computing of all kinds. I haven’t gotten my hands on Glass personally, but it really feels like there’s good reason to be excited. Tech blogger Robert Scoble recently wrote:

I will never live a day of my life from now on without it (or a competitor). It’s that significant.

I can imagine dozens of ways to make life better with a device like this, and I’ve only just begun thinking about the possibilities.

I also have my concerns. Concerns about how well it will work, about intrusiveness, about privacy, and about platform lock-in. But I continue to be amazed by the amount of abject fear and hatred being aimed at Google Glass. We’ve hardly even seen what it is (let alone what it can be), and already there’s panic. We’ve seen violence threatened against Glass wearers and we’ve seen anti-Glass political organizations emerge.

Some of this might be incumbency backlash, but mostly this is just good old-fashioned fear. And not necessarily Luddite fear either—there’s no need for name-calling or dismissiveness—the things these people are afraid of are often legitimate concerns. Make no bones about it, there will be problems. There will be challenges. Privacy will have to explored, re-defined. There will be questions of legality. Social problems—gaps will emerge between the have and have-nots. And last but not least, questions of human happiness.

But it’s only truly scary in a kind of short-sighted vacuum where technology runs amok and there’s no one there to stop it. The truth is that once we let these kinds of technologies spread their wings, social protocols will develop. (They always do.) Laws will come into force as needed. Human decency will have its say. Privacy doesn’t happen because “invasive” technologies are banned, it happens because we agree not to use them against each other in disagreeable ways.

We need to see these technologies for what they are—the natural advancement of our species. Man is not just his body, he’s also his tools. We couldn’t have made it this far without them. They’re a part of us. Our identity is defined by our interaction with tools, just as much as it’s defined by behaviors like our curiosity for life or our affection for each other.

Yes, these tools are going to bring problems, but they’re new problems. They’re the next level of problems. And they come with benefits. Harnessing fire brought conflagrations. Working steel brought weapons and wars. Navigation brought conquest. Mathematics brought artillery. Medicine brought malpractice and biological warfare. Atomic science brought nuclear bombs. Advanced agriculture brought obesity. But should we hope to undo all of these things? Should we reject technologies before we know what they are or what they can do?

Technologies don’t always end up being good, but they are good more often than bad. And all the progress we’ve made in improving the quality of life on this planet from shivering, starving, disease-plagued, ignorant, violent, uncomfortable cavemen who barely lived twenty years, up to the lives we have today—we have technology to thank for it. As well as the people who took the plunge, fought back the fear, and declared that they didn’t want the problems of their parents and would boldly face a new set of problems. Technology is how we grow as a species—it is a part of us in the most real sense.

The rapid adoption rates of smart phones show that we want technology as close to us as we can get it. And we don’t just want to have a device available—it’s not one smart phone or tablet per home—we want it to be our own. It’s a personal technological device. It’s an extension of ourselves. The logical next step is to strap it to bodies. And the step after that? Into our bodies.

And the thing is, Google Glass won’t be the winner. Despite all the impotent rage and all the exuberant hopes, it’s a stepping-stone; it’s a start. But it’s the next step. And Google’s humble attitude of experimentation and admission that ‘we don’t know what it is yet’ might just be the perfect way to start out.

Maybe people aren’t ready (yet) to wear technology on their faces. Maybe an iBracelet / iWatch (if such a thing is even in the works) might be more palatable to consumers, even if it ultimately turns out to be an intermediate step to something more like Glass.

But whatever it is, rather than rejecting what we fear, let’s shape what’s to come. Let’s try it out, see what it can do, and then share with our fellow man what we think is good and what we think is bad. At the end of the day there’s no stopping it—only guiding it. This is the natural next step in an unbroken procession that started when a primate first picked up a stick to poke at something. Let’s embrace a new set of problems—together.

The Beauty of Mathematics

| Comments

Those who cannot appreciate the “cold and austere”1 beauty of mathematics are looking at the package and not the contents. One finds in the packaging a world of strict, formal symbols and fixed (non-creative) rules for manipulation. Non-creative arenas by definition resist the ultimate human act of creation (read: art). But it’s not in the results that we find the principal beauty of mathematics–it’s in the creation, the problem-solving, which requires the greatest human creativity the world has ever seen. It’s a realm of dazzling breadth and infinite depth; a shelf of approaches to each of a lifetime of topics.

In the world of computer science it’s commonly noted that there’s no algorithm for the design of algorithms, which is to say that the solving of any given computational problem requires unique, creative effort. We can’t write a program that can write all of our other programs—the same carries over into mathematics.

If you believe that mathematics is routine manipulation of uninspired symbols, odds are you’ve studied so little math that you only understand the fixed routines which are the building blocks wielded unconsciously in the creative energies of the mathematically adept.

Why is math so disliked? Because it’s challenging. Many of us struggle with the nuances of the basic manipulations, and that means we never get to the creative part. Any child can pick up a brush and paint—good painting is hard but simple painting is easy. Simple math is still hard. You can’t readily intuit it.

But as you progress through the echelons of mathematics you find that the nature of math education changes markedly. Instructors are no longer so concerned about your numeric mistakes or accidental sign changes–the very things they focused on previously. Strangely enough, the numbers most of us think of as math start to disappear entirely. Patterns are reified and particulars are relinquished.

It becomes a world of grand relationships and universal truths. The possibility of changing the entire nature of truth waits around every corner of calculation. An unexpected answer could mean a mistake or could mean you’ve revolutionized the understanding of man.

I’ve long thought math educators2 squandered their significance in reducing the manipulation of equations to an impertinent, mechanical process. Computation over epistemology3. The substrate is truth, not numbers! You don’t add 2 to both sides—you leverage the universal truth that abstract quantities (any in the universe!) held in equivalence will remain in equivalence when modified by constant addition. You’ve amalgamated a truth and a metatruth into a third, irrefutable, novel truth.

Math, rightly viewed, is a world of grand, democratic, intrigue where a legend can be dethroned with the stroke of a pen. Even the dead are not safe. And every last student in every corner of the world holds this unbounded power in the palm of his or her hand. If that’s not romantic, I don’t know what is.

Footnotes

  1. “Mathematics, rightly viewed, possesses not only truth, but supreme beauty - a beauty cold and austere, like that of sculpture.” —Bertrand Russell
  2. Mine, at least.
  3. The branch of philosophy that concerns itself with the nature of truth and knowledge.

The Importance of Tiny Things

| Comments

This weekend, as I was waiting at my doctor’s office for the results of my rapid strep test, I downloaded and started reading Kurzweil’s new book, How to Create a Mind. The first chapter relates the story of geologist Charles Lyell (1797–1875), his influential Principles of Geology, and the impact it had on Darwin’s work on natural selection.

Particularly interesting to me is the idea that (apparently) one of the greatest contributions of Lyell—and one of the hardest to swallow—is the understanding that geologic change, such as the creation of canyons, results from the aggregation of tiny changes over long periods of time. This seems so incredibly obvious now, but Kurzweil writes that “this proposal was originally met with ridicule, but within two decades […] achieved mainstream acceptance.” Darwin’s On the Origin of Species was met with similar doubts (and occasionally still is).

It makes me wonder if there’s a larger theme of a collective realization of the importance of tiny things in aggregate. In some ways I think the realization might still be on-going, and ever will be since the human mind doesn’t seem especially adept at this kind of reasoning. We tend to round numbers to quantities easier to handle (e.g. the odds of getting in a car crash seem so low so we effectively round them to zero, and 3:13pm is a lot like a quarter past three), which works fairly well until we’re dealing with a system where these numbers compound.

There are scattered traces of this understanding going all the way back to Aristotle and Lao Tse, but I suspect a widespread, shared understanding within the scientific community was absent, and certainly a formal framework was. Even the term “emergence” was coined in 1875, the year Lyell died. Chaos theory originates in the 1880s with Poincaré. These things are certainly coincident, if not correlated.

It makes me wonder if the title of Stephan Wolfram’s A New Kind of Science, a weighty tome discussing cellular automata, might not be quite so presumptuous as it seems at first glance. We now know that the simplest of things like a trivial cellular automaton can implement a Turing machine, the whole of modern computation can be reduced to what can be implemented by a Turing machine, and cellular automata can be found in nature. Obviously computation can happen on larger levels (after all I’m typing this on a computer), but at this point it’s hard not to think that computation is happening all the time, all over the universe, at even the tiniest levels. We need a framework to understand these things if we’re to progress in our understanding of the universe.

But as this formal framework matures, we’d all do well to start to accepting the import of smaller things, even if we don’t have a rigid understanding of it. After studying artificial intelligence and natural language processing in graduate school I decided that I didn’t want to work in that field immediately because the state of the science was / is, to me, frustrating—most modern AI research is done using complex systems like neural nets which, once trained, defy understanding. The golden age of artificial intelligence, where we build machines with an organized, clean internal understanding of the external world is seemingly gone (here’s a fantastic explanatory interview with Chomsky on the subject). Whatever you say about neural nets, though, the one thing you can’t deny is that they work (at least to a point). We do know how to use them. But I, for one, don’t particularly want to father children I can’t understand at all. The framework for understanding needs to catch up to the framework for creation. Maybe we’ll always be able to cause phenomena more complex than we can understand, but it feels like the bar for understanding is frustratingly low.

I’m wildly off-topic, but it’s interesting to me to look at my previous post and realize that all of the points I outlined were about friction, the impact of tiny forces. Not knowing where to write (categorization), not knowing who to write to (audience), and not knowing if I should write publicly (privacy) are all impacting the much larger issue of actually writing. It’s so much easier to see on “paper”, when a bit more consideration is given and a bit less gut instinct applied. But little things do matter, and a broken pencil or a drafty house has probably forestalled a Hemingway or a Handel.

As it turns out I do have strep—for which I can thank an extremely large number of low-probability transmissions of a minuscule bacterium rapidly evolving through numerous unlikely mutations of a tiny computational molecule called DNA.

The Lean Write-Up?

| Comments

Well, I’m planning to start using this blog again…I hate to make yet another “I’m doing this again” metapost only to follow it with silence, so here’s the rundown on what’s different this time:

  1. I actually do write quite a bit, it’s just a question of where, but deciding where to write something often stalls me on writing it at all, so a default, catch-all bucket will likely boost output (I switched to one “omninotebook” a couple years back rather than topical notebooks and that has definitely helped—I see this as the shared edition). A corollary is that I’ll be thinking less about the appropriate audience for my posts and leaving that to self-selection.
  2. I’m interested in becoming less selfish with my ideas. I tend to want to keep them to myself for competitive advantage but I suspect the value of the connections I’d make by sharing is higher than the value of secrecy.
  3. I need a persistent, temporal scratchpad because organization is too hard. “Persistent”—I form a lot of ideas partially and connect or complete them later; I need a place to keep these as they grow. An idea nursery. “Temporal”—when I don’t yet know what something is (often the point of writing) I don’t know how to categorize it thematically; what file does that go it? What blog does that belong on? in those cases the best context I have for making sense of it is what I was thinking about before (and later, after) it. “Scratchpad”—fully formed, polished ideas ready for presentation often have a place elsewhere, but I don’t have enough time to get everything to that level. Ship it, iterate.

In summary, lower production value, higher output. Code with bugs, arguments with logical errors, unapologetic leaps in topic—should be fun. Besides, I’ll be opening the kimono—and who doesn’t love a sexy metaphor?

ZSH: Quick Quoting

| Comments

Some spelunking in the ZSH manual last week revealed some real treasures I’ve gotten good use out of already: ESC-" and ESC-'.

ESC-" runs the command escape-region, which you can use to have zsh escape any arbitrary piece of text for you. No more pasting in URLs, file paths, or regular expressions and trying to manually sort out what characters you need to escape—just let the shell do it for you.

Like so many other conventions, ZSH borrows from Emacs the idea of the region, a (possibly invisible) span of text from the point where the user last placed the mark to the current cursor position. Many commands use the region as an indication of what area of text to operate upon. In both Emacs and ZSH, the most basic way to set the mark is with CTRL-SPC.

So if we’ve just typed in the following text…

1
$ echo I *love* zsh!

…I can escape the parameters to echo with CTRL-SPC ESC-3 ESC-b ESC-" (set-mark-command, digit-argument (3), backward-word, escape-region) and voila!:

1
$ echo 'I *love* zsh!'

But something I’ve used even more than that is to set the mark in advance of pasting in something I know I’ll want to escape. So if I have a URL on the pasteboard that I want to curl that might contain nasty characters I’ll enter:

1
$ curl -O

Then hit CTRL-SPC CMD-V ESC-" and end up with a properly escaped URL, ready to be curled:

1
$ curl -0 'http://cran.r-project.org/doc/manuals/R-intro.html#A-sample-session'

BTW, it is smart enough to escape existing quotes in the region.

You can also use the similar command quote-line (on ESC-') to escape the entire line of input, but I haven’t found as much use for that yet.

Emacs: Tab Width Woes

| Comments

Emacs uses the value of the tab-width variable to decide how wide tab characters should be displayed. Setting tab-width is usually one of the first customizations Emacs newbies make:

1
(setq-default tab-width 2)

Displaying tab characters at whatever width you prefer works well for most applications but eventually fails when files mix tab and space characters and (invariably) make assumptions about what the width of those characters will be.

One particularly conspicuous offender is the Emacs (Lisp) source code. I feel like I’ve recently reached a new level of skill with Emacs—a point where I’m finally effective enough with it that I write Emacs Lisp to improve my workflow as a regular part of my daily workflow. One consequence of this is that I spend a lot of time reading Emacs source code, looking for either implementation clues or undocumented gems. It’s a hell of a lot of fun but unfortunately it means that I spend a lot of time alternating between my preferred tab-width of 2 and 8, the size the Emacs source thinks a tab should be.

My initial solution was to throw together a quick function to toggle between these two values, which I bound to C-c TAB:

1
2
3
4
5
6
7
8
(defun camdez/toggle-tab-width ()
  "Toggles `tab-width' between 8 and 2."
  (interactive)
  (setq tab-width
        (if (= tab-width 2)
            8
          2))
  (message "Tab width set to %d" tab-width))

It could definitely use a lot of improvement but that’s the kind of thing that I now tend to hammer out quickly and improve later if the concept survives the prototyping phase. I keep this type of hacks in a file called experimental.el which I load from my Emacs initialization file. I also keep this file in the x register so that I can immediately jump to it with C-x r j x:

1
2
(load-library "experimental")
(set-register ?x (cons 'file "~/.emacs.d/experimental.el"))

But I was never thrilled about the idea of having to manually toggle that value, even if it was a couple keystrokes away. I started scheming about ways to analyze source files to determine what tab-width they implied (certainly possible—not a lot of fun) when I realized that the Emacs source was really the only place where I was having this problem.

My next thought, then, was to create a hook that would fire whenever a file was opened, examine the file path, and set the tab-width to 8 if it was part of the Emacs distribution. But hardcoding a file path? That’s a bit distasteful.

I realized today that there’s a wonderfully effective, simple solution called “Directory Variables”. All you have to do is put a file called dir-locals.el in a directory and whenever Emacs visits a file in that directory (or one of it’s subdirectories), those local variables will be loaded and applied. In fact, there’s a even command that will build the file contents for us. Here’s how we can set it up for the Emacs source:

  1. Open a file in the Emacs lisp directory. The easiest way to this is pull up the documentation for a function in the standard distribution (say, occur) with C-h f occur RET, tab to the file name it says it’s defined in, and hit RET to jump to that function’s definition.
  2. Next, run M-x add-dir-local-variable RET.
  3. Hit RET to accept the default of only applying this variable to emacs-lisp-mode.
  4. Enter tab-width as the variable to set.
  5. Enter 8 as the value of the variable.
  6. You’ll now be looking at a new file with contents like this:
1
2
3
4
5
;;; Directory Local Variables
;;; See Info node `(emacs) Directory Variables' for more information.

((emacs-lisp-mode
  (tab-width . 8)))

Save the file with C-x C-s and you’re good to go. Now whenever you open a file in the Emacs source code it’ll have the tab-width properly set to 8.

Tea Timing

| Comments

Starbucks and I are out of sync—I finish my lunch break just ahead of my tea.

Which probably only says that I’m timing by the wrong mechanism.

Magnets

| Comments

I knew this girl, she was made of magnets
Plasticine smiles and rubescent haircuts
Entheogenic traps of reluctant wake-ups
Candyland costumes and boys wearing make-ups

Buoyed by bouts of relaxed recitation
“Oscillate?” “No, I think ‘vacillation’.”
Gloamingtime breakfasts, forgotten vocations
Approaches of proximal family relations

I suppose what I’d say, if I had to be curt
is—Fucking magnets, how do they work?