::::: : the wood : davidrobins.com

My name is David Robins: Christian, lead developer (resume), writer, photographer, runner, libertarian (voluntaryist), and student.

This is also my son David Geoffrey Robins' site.

Back to emacs

News, Technical, Work ·Saturday February 5, 2011 @ 16:59 EST (link)

After frustration with the limited programmability of my work editor (Source Insight) and its custom macro language (read: wheel reinvention with a square wheel, and what's now a dead language; they don't seem to be updating the editor any more), and dissatisfaction with vi as insufficiently GUI-integrated and powerful, I went through the basic Emacs tutorial (C-h t) and then through the online help built the macro I wanted to covert a reference (or local) variable to a pointer, binding it to a key:
(require 'cl) ; for flet

(defun replace-region (match replace) (beginning-of-buffer) (while (re-search-forward match nil t) (replace-match replace nil nil)) )

(defun ref-to-pointer (beg end) (interactive "r") (let ((old-var (read-string "Reference to replace? " "rt" nil "rt"))) (save-excursion (undo-boundary) (flet ((undo-boundary () nil)) (narrow-to-region beg end) (replace-region (concat "\\b" old-var "\\.") (concat "p" old-var "->")) (replace-region (concat "\\b" old-var "\\b") (concat "*p" old-var)) (widen) ) ) (undo-boundary) ) )

(global-set-key (kbd "<f11>") 'ref-to-pointer)
I originally used replace-regexp rather than the loop in replace-region, but the help for replace-regexp itself suggested the new method. Out of the box, Emacs (EmacsW32) has source code highlighting, which remains perhaps to customize, and tagging seems fairly simple to set up (and EmacsW32 comes with etags). One feature I do like from Source Insight is that files added to the current project are automatically prefix-matched on open, and functions can be tagged by Hungarian "syllable" (e.g., Foo can be found not only in FooFromBar but also ). But I suspect these can be overcome. Another command I'd like to write is one that reads an error output line and jumps to the location in the file (maybe even with next/previous commands). I suspect this already exists and just needs some tweaking to work in .err files.

Other notes: after a replace, the mark deactivates which hides the highlight (apparently the only way to bring it back is to do an exchange-point-and-mark) but it's still there, and it does get adjusted if text is inserted before it. The business with flet and undo-boundary make the action atomic for purposes of undo. Narrowing ensure that changes only occur within our region of interest (which is why beginning-of-buffer is safe, and it's helpful for regions defined by point being after mark: although beg is always ≤ end, it doesn't actually move point for the purposes of re-search-forward).

Books finished: The Woods Out Back, A People'S History of the United States, Passage To Dawn.

How would opt-in government work?

Political, Economics ·Sunday January 30, 2011 @ 15:22 EST (link)

If people could decide what government services they wanted to buy (and what they wished to forgo, up to all of it and never dealing with the state except possibly when they deal with others that do so), how would it work?

You would need two passes: first you need to figure out how much people will pay for a given service. In pass one, you need to present the service and find out which people in the area of interest will pay and how much. In the second, you need to find a price point at which you will provide the service: anyone willing to pay less doesn't get it; they can possibly offer to pay the price point, wait until the next offering, do without, or buy it elsewhere. Those that are willing to pay at least the price point pay that point, and get the service. Why don't you need two passes with current private service providers? Two reasons: because they grow organically (starting with little capital and clientele) and/or because they know in advance (based on similar demographics from other areas) what their customer base will be, so can plan their services along those lines. But switching to opt-in requires doing quickly what businesses do over time. Another solution of course would just to auction everything (building and supplies) off and start from scratch, but this seems like a more painful transition.

However, this plan has a few implicit assumptions which effectively has already reduced the system to anarchy (in the sense of statelessness, not chaos), following Roy A. Childs' argument in his open letter to Ayn Rand. That is, we have assumed that (1) the state can no longer violently exclude competition—there are no more forced monopolies; you can buy police service from whomever you want. (2) Taxation—forced taking—is no longer used to fund anything. These two requirements are the same as that which Childs latched on to in his letter: if you don't forcefully exclude competition, and you don't force payment, then you don't have a state. Effectively, all the "government services" people would be buying into would just be the legacy providers, competing against a host of businesses that, no longer excluded by force and competing against subsidies extracted by force, can go head to head on merit. (Do brick-and-mortar libraries need to exist? Perhaps not when they're unsubsidized and e-versions are much cheaper.)

The "margins" are interesting too just because of the implications. Can a government cop from a department that you don't contract with pull you over for speeding? No, because you've caused no harm and not consented. Can they arrest you for murder? It depends. Acting as an agent of the victim or their heirs, they could, but if wrong any violent acts they did to bring you in would be initiatory rather than "postponed defensive" (restorational) violence and they would be liable for it just like any assault or battery.

So if anyone agrees with an opt-in state, congratulations: you're a fan of the stateless society. Welcome to voluntaryism!

Another SVRC shoot: revolvers

News, Guns ·Saturday January 29, 2011 @ 15:32 EST (link)

Group of MSGun folk arranged an outing to SVRC Saturday; a few couldn't make it (Mark, the Bessos) but we had a nice group: Garrett and Trinity, each with their children, Josh, and Shawn and Doug who I didn't previously know. We were there from 1230 to about 1530 (Honey left earlier). There was an invitation to go to Garrett's for an after party/cleaning, and I brought some brews and cleaning supplies for it, but I was finished at the range before they were and wanted to get back home to my Honey :) so didn't end up going.

Of Mark's five guns that I borrowed - the Dan Wesson 744, S&W 19, Ruger Blackhawk, Security Six, and SP101, I only shot three: Josh had an SP101, so I shot it instead, and I didn't shoot the Ruger Blackhawk since I'd decided against single action. Of the two .357s, I lean toward the Security Six and might pick one up; they're fun to shoot.

I got to shoot Garrett's SCAR-L, and we found that it doesn't like Wolf steel-cased (failed to cycle after most of them and one minor jam). I plan to get a SCAR-H (instead of the FAL I'd been researching, since it has everything the FAL does and more). I'm not planning to shoot steel through the SCAR-H (is there even steel .308?) so I'm not worried about that. My Rock River Arms AR-15 eats steel quite happily so it will remain the plinking gun with the SCAR-H as Royce's "battle rifle".

I cleaned the revolvers I shot on Sunday; not too difficult—I hope I'm doing it right—for the most part similar to semi-automatics with an easier takedown: clean the cylinders and barrel with bore snake and patches (I don't have an appropriately-sized brush), and scrub the nooks and crannies with a toothbrush and then wipe down with a clean rag, using MPro-7 cleaning solution to break free the fouling.

Books finished: The Call of Cthulhu and Other Weird Stories, Starless Night, How I Found Freedom In an Unfree World, Siege of Darkness.

New Year's Eve shooting with friends

News, Guns ·Friday December 31, 2010 @ 18:04 EST (link)

We just got back from shooting at SVRC with Jim and Jessica B. and Trinity D. and Garrett W., and Jim and Jessica's friend Shane. We were there from about 2-5pm; it started to get dark toward the end. I shot my Glock (34), Browning Buck Mark, Shane's Ruger 10/22 (with red dot—people had fun picking off cans, which of course were cleaned up at the end), and my AR-15 (using the steel-cased ammo I reserve for outdoors since my indoor range doesn't allow it). They've put up some orange metal clangers at the end of the range (about 178 yards) which I was able to hit consistently, although I had less luck with my paper targets at shorter range even, because they were body targets using lines which aren't very visible at distance. I'll keep those for pistol shooting in future and use targets with dark centers for rifle.

Since everyone we shot with has memberships at SVRC now, we hope to go more often with others. I'll probably also renew my WCA membership, although single only, not family: it's just economics—last year Honey went with me so few times that I would have saved just paying the extra for her whenever she came along. And they are offering a 10% discount since I was one of the original members when they first opened.

Taxation = robbery: an exploration

Political, Law, Economics ·Thursday December 30, 2010 @ 21:59 EST (link)

In For A New Liberty, Murray Rothbard asks: "What distinguishes the edicts of the State from the commands of a bandit gang? Indeed, it would be a useful exercise for nonlibertarians to ponder this question: How can you define taxation in a way which makes it different from robbery?"

I thought this might be an interesting question to pose to Facebook's question feature; and so I did, using the question exactly as worded: How can you define taxation in a way which makes it different from robbery?

I stipulated: Please, no "social contract" type myths or other religious arguments and magic implied contracts, and try to abstain from fallacies—reason and logic are preferred.

And here is "A Summary and Categorization of Answers Proffered":
  1. The Irrelevant. These answer entirely different questions and do not have relevance to the particular question being asked. For example, people mention, as if it answered the question in the negative:
    1. How the proceeds of taxation are used differs from other robbery and can sometimes help the victim. But this occurs after the act of taking and is not relevant to it. (A question to encourage discussion of this might be “Are you happy with how your taxes are used?” or similar.) And charity should be voluntary.
    2. Their own or even a few others’ happiness with their tax level. A few people’s happiness with the system does not change the act.
    3. The ability to vote to change it. Again, this is outside of the scope of the question (and it is not moral to infringe on the rights of an individual because you outnumber them). A slight variant which also relies on majorities is the purported ability to revolt to change it.
    4. How will the roads be maintained (the poor be educated, society not collapse into chaos) without taxes? Entirely irrelevant to the act of taking (and the answer is: privately, the same way shoes are sold and skyscrapers are built and maintained without taxes).
    5. If you don’t like taxation, move elsewhere. Also irrelevant to the issue of the extortion being offered; the story of a woman being raped in her own house, told “If you don’t like it, leave” and responding “But this is my house!” is a good parallel.
    6. Any questions about a society without a government that can tax (e.g., Objectivist minarchist government funded by contributions, or stateless society). These are interesting things to think about but not directly relevant to the Question. If anyone wants to create such questions I’d be happy to continue discussion there.

  2. The bizarre.
    1. Magic contracts that, without signatories, acceptance, or terms, somehow bind people living on their own (or rented) property and trading voluntarily with others; “social contract”, “you consent by not leaving”, and so on.
    2. The government owns everything. Ridiculous indeed: private property owners own their property, everything else is really unowned under the fiction of “public” property, and can be homesteaded (practically, only if you have enough military power to fight off the state; but still, might is not right).
    3. A variant of the “magic contract” idea is the “payment for services” idea. But no other entity can force you to pay at arbitrary rates for services you don’t want, or could get much cheaper in a competitive market; the force part makes it robbery.
    4. Since you know you will be made to pay on entering a particular region, you have consented by entering. The problem is of course that only consent is consent – knowing harm will be done to you does not make the harm moral, just known. This is similar but not identical to (a).

  3. The technical.
    1. Robbery is defined as “illegal” theft. Some definitions include that; some don’t; but this is effectively a special pleading fallacy (the entity doing the taking also defines “legal”). I’m happy to modify my question to say “without special pleading or treatment for the state” (i.e., judge the act, not who does it).
    2. Robbery requires the taking to be in the immediate presence of the victim. Some definitions do, indeed; I’d be happy to expand the question to any sort of wrongful taking of property: extortion, theft, and so on.
Something I think I'd like to explore a little more is property rights in general. I appreciate Locke's homesteading definition, and Rothbard's acquisition by voluntary trade (Nozick and Rand follow similar paths); but an out for statists today is to claim that the state is just a private entity that is demanding arbitrary rent (1(b), above). Now, the obvious counter to that is that they never claim such a thing, don't operate at all like a business, didn't homestead the land, use force against peaceful people, and so on. However the concern (among those of a socialist bent, including some self-described anarchists that still want a redistributing state) is that in a free society a corporation could theoretically legitimately acquire all the land in an area—it's highly unlikely in practice; when they were seen to be attempting it people would step in to counter or increase their prices a great deal—and act like a state. So I'll think about it and write up something soon; in the meantime, take a look at the discussions on the Facebook question asking What is the basis for private property as a human right?.

Books finished: Defending the Undefendable, Wizard's First Rule, Dragonflight, The End of Religion, For a New Liberty.

Python: WSGI, templating engines, and the C API

News, Technical, Photography ·Sunday December 19, 2010 @ 00:55 EST (link)

I set up WSGI on my web server (Apache, with mod_wsgi). I believe the last time I checked the WSGI specification hadn't even been updated for Python 3 (due to the Unicode changes). The major web frameworks (such as Pylons, CherryPy, Django, and Twisted) don't have stable ports yet, but most have a branch or some initial work, tests passing, etc. I set up .py files to be handled by WSGI and installed Mako and Jinja2 as templating engines but settled on Mako as it's a little more powerful than Jinja2. That also means it lets you do perhaps more than a templating engine should, but it's easier to self-restrict when using a more powerful engine than extend a limited one. Perl's Template Toolkit, which I used with mod_perl elsewhere on the site, is just the right level of power for templating; supposedly it was an inspiration for Mako (which replaced the now obsolete Myghty).

I ported my pH parser from Perl (XS and C++) to Python's C API. This was my first use of the Python C API, and it went quite well. The Python/C API Reference Manual and Extending and Embedding the Python Interpreter were my primary sources, and a vast array of web searches (many of which ended up at Stack Overflow, a great merit-based programming Q&A community). One problem I had was instantiating a Python (non-C) object that I used to represent elements in the parse tree. I started with PyObject_New and added PyObject_Init, and found very little help online but some examples did lead me to try calling PyObject_CallObject on the PyTypeObject, which did the right thing—constructed the object (invoking the standard __call__ implementation for classes no doubt).

I also got to use distutils, which I'd avoided so far by having my Python modules in separate tree added to the module path; but C modules need a proper build and install. It was, fortunately, quite easy to do, even with __init.py__ and a combination of Python and C modules in the pH.parser package.

My current project, after these segues, is to develop a decent Javascript embedded image slider/viewer. I may use it to improve the new (internal, probably won't be public) "photo manager", which I'll use to improve tagging and organization that I was hacking on sporadically. For example, it now uses a new window to pop up image details; that's very '90s; something like Lightbox, using a Javascript layer, would be far more appropriate.

There are several I'm looking at for inspiration: popSlides for great popups and transitions (probably inspired by the older Lightbox), but it has no thumbnail navigation; popeye 2.0 due to the neat trick of growing from thumbnail to detail view in place, although horrible choice of placement of controls (mid-image) and darkening the image; GalleryView is a very basic filmstrip gallery, as is jMyCarousel; Smooth Div Scroll for the, well, smooth scroll, autoscroll, and nice edge controls via mouse-over (and speedup if you press the button); ImageFlow has a neat effect of showing central items larger and having others recede, like the Mac dock, but has horrible navigation; and AD Gallery is quite smooth and adds good-looking captions but shows the larger image inline, where I want a popup. These are all jQuery-based (some use jQuery UI); I settled on jQuery, although I also use Prototype/Scriptaculous.

A synthesis of the best features of all of these (for my purposes) will be developed, and I'll embedded it in these entries as appropriate rather than using the present static thumbnail system. It should also make it faster for me to put up entries with photos, since I won't need to worry about layout any more: I'll automate it, and just pick the photos I want to use and let my new engine handle the presentation.

Books finished: Heidegger and a Hippo Walk Through Those Pearly Gates, Basic Economics.

Word on WoA/SoC/ARM

News, Work ·Friday December 10, 2010 @ 17:02 EST (link)

We got Word running (after my porting work) on the ARM architecture (aka "SoC", System on a Chip, or WoA, standing for something else (Windows on ARM?), which will likely be running on a tablet; none of which we can bruit about in the halls). But I wanted to privately log it as a milestone.

(Since it was mentioned at CES in January 2011, I think it's safe to publish now! Note: entry date is correct but it wasn't made public until April 29, 2011.)

Books finished: Forge of the Elders.

The answer to statist "like it or leave" fallacies

Political ·Sunday November 21, 2010 @ 01:50 EST (link)

From a comment on The Stranger's blog, the Slog, on entry Why The Stranger is Wrong About Everything, by intern Matt Luby. The comment's author is only given as "cubbybear" and I don't know if there's an original source beyond that.
To everyone that says "if you don't like the violence inherent in the system then leave", I have a short story:

You are a woman and throw a party. Late that night, a man at the party tries to rape you. You scream at him to stop, but as he pins you down he whispers in your ear, "if you don't want to get raped then you should just leave."

"But this is my house," you respond.

Strangely, most of your fellow party goers side with the rapist.

Books finished: The Road To Serfdom, The Pig That Wants To Be Eaten.

Reassembling the Ruger

Guns ·Saturday November 6, 2010 @ 20:54 EDT (link)

I finally got around to finishing cleaning the Ruger 10/22; it had been sitting on the other couch disassembled, waiting for my brass hammer and punch set to arrive, but they arrived a few weeks ago and that excuse no longer worked. While Honey rested after getting back from watching Disney on Ice with her friend, I finished cleaning the Ruger—took out the bolt since I hadn't yet, and cleaned the spring too. This page and this video were helpful.

A few tricky points: getting the bolt back in (pushing the spring back by levering a screwdriver and then holding the cocking handle left the part that needed to line up with the bolt canted a little, so getting the bolt to seat properly proved tricky. After that it was mostly easy—the trigger assembly attachment pins were nowhere near as easy to put in as the video showed (he just pushed them in; I had to use my brass hammer). A pin near the trigger—one I hadn't touched—had worked its way out a little and stopped the assembly from fitting into the stock, but a few whacks from the brass hammer fixed that too (when all you have is a hammer… fortunately I had plenty of other tools).

Anarcho-capitalist meetup

News, Political ·Friday November 5, 2010 @ 22:47 EDT (link)

We attended our first meetup with the Seattle Anarcho-Capitalists, picking up a few other Microsofties too. We met Elliott at building 36 @ 1820, then drove to Bellevue to pick up Eric at a Microsoft building on 112th. Took longer than we expected to get there—traffic was bad. It was actually less bad going to Seattle; we parked in a lot near Jeremy (the host)'s apartment. Had a good time eating and drinking and socializing with the an-caps; met Matt, the intern at The Stranger who wrote Why The Stranger is Wrong About Everything on their blog ("the Slog"), and talked with him and various others for a while. Bitcoins were a frequent topic of conversation, thanks to Elliott. We headed out around 2200; Eric had gotten a ride to another Seattle venue with his girlfriend, and we took Elliott back to building 36 to pick up his car—and me mine. I was almost out of gas, so Honey followed me to the nearest gas station; we'd taken her car into Seattle since it was full and was a four-door.

Books finished: Nullification, Knife of Dreams, The Truth About Muhammad, The Politically Incorrect Guide To American History.

<Previous 10 entries>