A Fire Upon the Deep (Zones of Thought, #1)
![]() |
|
![]() |
|
It must be horrible to have said something smart, maybe even insightful, once, and be labeled for life as a visionary, or a pundit, or some other similar insult.
Consider Clay Shirky's comments on this article. It's absolute nonsense, based on random guessing.
I promise this: this blog will have no insight on anything as long as I write it. I couldn't handle the pressure.
Interesting thing about writing a post every day: I didn't get blocked yet. Sure, this is only the 9th post, but considering my previous post-a-month cadence, and that I would just have nothing to write about, it's clear to me that writing leads to writing.
That is perhaps the most obvious thing that not everyone notices: the way to do things is to do things. The way to write free software is to write software that is free. To go to Alaska you have to go. To Alaska. To write, you have to write. To do music, you have to do music. To make bread, you have to make bread.
Will every piece of bread you make be good? Will everything you write be good? Will you get to Alaska? No. You will fail.
But if you don't do failed crap first, then there is no way to do anything decent later. I think it was Amadeo Carrizo (famous, old, goalkeeper) who said about a (not so famous, young, goalkeeper) "He's not bad, but he needs to be scored on a few hundred times more before he's good".
I have a long history of failure. I have a short story of successes. I am working on it.
Of all the corpses of my projects, there is one thatI feel worse about, which is rst2pdf. I feel bad about abandnoning several, but rst2pdf was actually a useful tool, used by a bunch of people, and that it has never gathered enough momentum with other developers is sad.
So, I will pick it up. I will spend about 4 hours a week on it. The plan is to:
Gather some patches that are lingering on the issue tracker
Fix some simple-ish bugs
Make another release with 1) and 2)
And of course:
Not let it fall in disrepair again
In the meantime, here is a nice thing I just heard about. Dimitri Christodoulou has hacked rst2pdf so that it can handle the raw:: html
directive.
This, dear friends is completely nuts, absolutely out of scope for any given docutils tool, and just too cool :-)
I will try to hijack his code (proper credit and so on), and incorporate it into rst2pdf.
And Dimitri, or anyone else who wants to do cool stuff with rst2pdf: let me know! I will give you commit rights immediately!
This comes from this thread in the Python Argentina mailing list (which I strongly recommend if you read spanish).
I was the other day trying to do shell-script-like-things on python (as part of a monster setup.py) and I was annoyed that in shell it's easy to do this:
cd foo
bar -baz
cd -
Or this:
pushd foo
bar -baz
popd
Or this:
(cd foo && bar -baz)
And on Python I had to do this, which is verbose and ugly:
cwd = os.getcwd()
try:
os.chdir('foo')
os.system('bar -baz')
finally:
os.chdir(cwd)
This is what I wanted to have:
with os.chdir('foo'):
os.system('bar -baz')
And of course, you can't do that. So, I asked, how do you implement that context manager? I got several answers.
That's available in Fabric:
with cd("foo"): run("bar")
It's not hard to do:
class DirContextM(object): def __init__(self, new_dir): self.new_dir = new_dir self.old_dir = None def __enter__(self): self.old_dir = os.getcwd() os.chdir(self.new_dir) def __exit__(self, *_): os.chdir(self.old_dir)
It's even easier to do:
from contextlib import contextmanager @contextmanager def cd(path): old_dir = os.getcwd() os.chdir(path) yield os.chdir(old_dir)
That's cool, so let's add it to path.py
Maybe check for exceptions
@contextmanager def cd(path): old_dir = os.getcwd() os.chdir(path) try: yield finally: os.chdir(old_dir)
All in all, I learned how to do context managers, about contextlib, about fabric and about path.py. Which is not bad for 15 minutes :-)