22:43 07 Oct 2012.
Updated: 21:55 25 Oct 2012
I switched to writing in reStructuredText in mid-2009, and to writing in Vim in early 2010. Since then I’ve made a lot of tweaks to improve editing efficiency, and eventually collected these in a Vim plugin (and a Python script). The following discussion of that plugin might be of interest to anyone concerned with writing efficiency and/or editor customization.
[more...]
22:44 11 Mar 2012
A discussion of common and custom blog features, and candidate applications that might provide them.
[more...]
Permalink 2 Comments [
Blog,
blogofile,
coding,
JavaScript,
personal,
python,
reStructuredText,
software,
tech,
Vim,
web-development,
WordPress]
21:57 06 Mar 2011
I’m still trying to cut down on the number of books I have in my apartment. That still feels wrong, but the shift to ebooks is making it a little easier. Now I’m getting rid of books that aren’t big favorites of mine, weren’t given to me as gifts, and aren’t in the poorly-defined category of “classics I want to keep”.
Because I’m a pack rat and a data geek, I have a hard time getting rid of books if I haven’t recorded the metadata about them I want to record. Unfortunately, I’m not always diligent about noting that info as I read the books, so the majority of the books I wanted to give away or sell were books where I hadn’t done so—and I really didn’t want to go through them one by one.
Modern technology to the rescue…
[more...]
22:48 10 Feb 2011
I hate giving up on projects. Especially projects that I’ve spent a lot of time on, that have had some success, and that have come close to being finished without making it the final, crucial steps. I really wanted to get a new version of sfmagic.org written, in Python, with good web development practices from top to bottom, but it’s far past time to let that go.
[more...]
23:52 21 Jan 2011.
Updated: 01:35 22 Jan 2011
I’ve mentioned pandoc once before, and it’s again proved rather useful. I’ve been looking for more ways to use it, as I love its core principle (although I naturally wish that it focused on reStructuredText rather than Markdown) of being a comprehensive text format converter. It might at one point be the answer for getting from reST to PDF—something that the current reST tools don’t help me with because I insist on using Unicode, and XeTeX isn’t yet supported. But today pandoc helped with a different task: going from reST to plain text.
[more...]
20:36 18 Oct 2010
Sometimes it’s the little things that make life better, the small victories in ongoing daily battles.
I recently did an overhead squat at 185 pounds (or about 84 kilos, or 13 stone 3); I weigh a little under 180 (that day, 178 pounds) and so that was a bodyweight overhead squat. It actually represents two achievements, because in order to get the bar into the overhead position, I had to push jerk it from behind my neck to locked out above my head, which counts as my best push jerk ever, albeit an unorthodox one. From the overhead locked out position, it’s down into a deep squat and back up; the harder part for me was going down, as once I was at the bottom it wasn’t hard to keep my balance coming back up.
[more...]
20:18 12 Oct 2010.
Updated: 03:35 30 Dec 2010
I frequently run across the need to add key/value pairs to a dict subject to some condition. The “traditional” version of that pattern looks something like this:
if condition:
my_dict[key] = value
Because of my stylistic preferences, I don’t like that, and want to do this:
my_dict[key] = value if condition
That doesn’t work, though, because then key will be set to None in the dict, which is an unwanted side effect.
[more...]
23:57 16 Jul 2010.
Updated: 01:20 17 Jul 2010
The official announcements are out, and my former employer Metaweb no longer exists. I’m happy that the ideas, and most of the people, have found a home, but it feels strange that the company is no longer a distinct entity. In many ways it makes a lot of sense for Google to end up owning them, and I hope the former-Metaweb-now-Google employees prosper.
[more...]
23:23 15 Jul 2010
One of the great things about unit testing is that you can get into a game-like mode where you make incremental but measurable progress—“flow”, basically—but what if it’s just not similar enough to a game for you?
Install Unit Testing Achievements, a Python package that works with nose, unittest, and Django. Somewhat crazy, definitely hilarious. Some of the achievements themselves are excellent, such as My God, It’s Full of Dots: The suite has at least 2,001 passing tests.
Sadly not yet working is another one I like, Heisenbug: Make a passing suite fail without changing anything.
23:36 16 May 2010
After a highly enjoyable, productive, and extended period, it’s time for me to return to the world of paid work.
I’m quite happy with the things I’ve done during my time off. Many of them are important only to me, but then, it’s been my time off.
[more...]
Permalink 3 Comments [
coding,
CrossFit,
diet,
document formats,
exercise,
food,
games,
goals,
personal,
python,
reStructuredText,
roleplaying,
software,
sports,
T,
tech,
tennis,
text editing,
version-control,
Vim,
WordPress,
writing]
13:33 29 Apr 2010
This post could be summarized as “regular expressions are a lot faster than naive for loops”.
I’ve been working on improving the script I use for live wordcount in Vim, partly for performance and partly so that I can package it up as a plugin and share it with other people. Along the way I’ve improved the speed of the script rather significantly, and will go through the key part of that change here.
[more...]
23:31 09 Apr 2010.
Updated: 15:28 18 Jan 2011
I’m going to compare seven different ways in Python to make one list out of several lists containing different numbers of elements, something that strikes me as a common but not necessarily everyday operation.
The philosophy of Python is that generally there should be one obvious and reasonable way to do things. I really like this philosophy—except when the Python way isn’t the way I prefer, of course.
[more...]
11:46 06 Apr 2010
I’ve been writing Python fairly steadily for the past couple of years, and a significant amount of that has been for my own projects; Python is what I tend to use to scratch workflow-related itches. That’s great, but many of these projects reach a point short of “finished” when I stop working on them.
[more...]
12:16 05 Apr 2010
Refactoring is rewriting source code while preserving the functionality of that code. I’m currently refactoring my Python script for Subversion status, because I want to experiment with sharing code on bitbucket and it seemed like a reasonable first project to put up there.
Some people hate refactoring, but I often enjoy it. I get a kick out of figuring out how to make code “better”, although that’s often a subjective judgment. In this case, when I opened up the script to have a look at it, I immediately saw a function that I knew I wanted to refactor. I’m amused by the enjoyment I derived from making the fairly simple change.
[more...]
23:55 25 Feb 2010.
Updated: 01:41 26 Feb 2010
15:56 23 Feb 2010
Last night a friend asked me what functional programming was, and as part of my answer I decided to rewrite a trivial program in the functional style to see what it was like. I did this in Python without using the functional module.
[more...]
23:50 16 Feb 2010.
Updated: 00:57 17 Feb 2010
As a result of my porting over jEdit (Jython) macros to Vim, I now have a fair amount of (Python) Vim scripts, and have learned some things about how to set up those scripts. I’ll go through some of that below, and hopefully other people writing Python scripts for Vim will find it useful.
[more...]
20:05 14 Feb 2010
Over the last couple of weeks I’ve been hacking away on scripts to customize Vim, replicating the scripts I made for jEdit. I’m more or less done, and this blog post is being written in MacVim. This hopefully means that when I’m done with it I’ll be able to publish it from within Vim, the same as with jEdit.
[more...]
15:18 04 Feb 2010
The Python Challenge seems like a good way to have fun with Python through puzzle-solving. As with all riddles, it’s important to read the questions carefully…
23:40 17 Jan 2010
I’m currently trying out Vim (again), and have made more progress this time, mainly due to Seth’s help. The key things that have made it better:
- :set hidden. Absolutely critical, this. Stops Vim from complaining when you try to switch buffers and your current buffer has unsaved changes.
- bufexplorer. Makes switching buffers a lot easier.
- A better Python syntax file. I didn’t like the defaults.
- My own indentation and syntax files for reStructuredText.
Really, though, the key first one was :set hidden. Before that I felt that I had completely misunderstood Vim’s file management model.
[more...]
23:54 08 Jan 2010.
Updated: 15:26 18 Jan 2011
I’ve been looking at a bunch of coding exercises recently, including the demo for Codility, and recalled an exercise that I came up with as an interview question. It’s not incredibly difficult, but strikes me as a good “real-world” exercise—it’s based on a task I had to perform while working on the discuss functionality for freebase.com.
[more...]
06:34 05 Jan 2010.
Updated: 09:41 14 Jan 2010