tadhg.com
tadhg.com
 

Posts concerning coding

Typeface Considerations

23:31 06 Aug 2009. Updated: 09:20 07 Aug 2009

I used to be somewhat obsessed with fonts. When I was doing more graphic design, I regularly looked for new fonts, tried to use just the right font for just the right occasion, and generally was very picky about them. Over time, that’s faded considerably, and I settled down to using fairly unspectacular fonts for most things, accepting that for the most part the “basic” serif and sans serif fonts available on the majority of systems were good enough.

After a system upgrade today, Lucida Sans Typewriter, the font I’ve been using in jEdit, suddenly stopped working properly without anti-aliasing. I couldn’t get it back to what it had looked like before, and so I was left with finding another suitable editor font.
[more...]

Permalink     4 Comments     [, , ]    

Python Script for Subversion Status

23:48 02 Aug 2009. Updated: 00:54 03 Aug 2009

I find in my use of Subversion that I often want to see a side-by-side list of files that aren’t under version control and files that have some other status. I also want these lists to be sorted alphabetically. Naturally, I ended up writing a Python script for this.
[more...]

Permalink     Comment     [, , , , ]    

Better reST–WordPress Pipeline

23:15 28 Jul 2009

Last week I posted about my setup for going from reStructuredText to WordPress. It involved a shell script, some Python scripts, and the pbpaste and pbcopy commands. It worked, but it was a little on the convoluted side.

Now I have a slightly better process, and one that I will have used to publish this post.
[more...]

Permalink     Comment     [, , , , , , , ]    

Better Word Count in jEdit

22:33 19 Jul 2009

I tend to care about word count in my writing. I’ve never been paid by the word, but nevertheless, it matters to me. From time to time I write fiction where I set the word count in advance, and then I try to hit it precisely. Even when that’s not the case, I just like to know how many words there are in a piece I’m writing. For this reason, a "word count" function is completely critical to me for whatever word processor or text editor I’m using to write.

jEdit has such a feature. It’s more or less the same as the one that I’ve been using in AbiWord, and in various word processors before that. But for quite some time I’ve wanted a better word counter. Since jEdit is now my application for all writing and I can script for it in Python, it was time to make the word counter I wanted.
[more...]

Permalink     Comment     [, , , , , ]    

jEdit Macros in Python

16:57 17 Jul 2009. Updated: 17:52 18 Jul 2009

jEdit has long been my text editor of choice, and I’m using it more than ever now that I’m writing more or less everything in it. I’ve been waiting a while for 4.3 to come out, but overall I remain quite happy with it. I do occasionally wonder about switching to vim or Emacs, but jEdit’s generally been able to do whatever I wanted it to.

I haven’t done much scripting with it, though. I recently came up with some use cases for scripts—involving reStructuredText, naturally—but I was a little reluctant to do the scripting because it involves Java and I really want to keep my current focus on Python and JavaScript.

I was therefore rather happy to discover the existence of the JythonInterpreter plugin, which makes it possible to write macros for jEdit in Python.
[more...]

Permalink     2 Comments     [, , , , ]    

Some Character Encoding Gotchas

10:31 16 Jul 2009

While scripting my reStructuredText to WordPress workflow, I ran into a bunch of character encoding problems.
[more...]

Permalink     Comment     [, , , ]    

Blog Workflow with reStructuredText

22:57 14 Jul 2009. Updated: 23:13 28 Jul 2009

I wrote about moving my writing over to reStructuredText on Sunday, and since then I’ve moved both my morning pages and my blog writing to it. The latter proved more complicated, primarily because I wanted to make the process almost as easy as writing pseudo-HTML (which is more or less WordPress’ native format, and kind of mine, too, for the last several years). With some hacky wrangling, I’ve managed to set that up.
[more...]

Permalink     4 Comments     [, , , , , , , ]    

Python Script to Change OS X Desktop Backgrounds

22:42 29 Jun 2009

OS X has built-in functionality to rotate between different desktop backgrounds, but if you have multiple monitors and want backgrounds that fit together (i.e. that have two halves, one on each monitor), you need to set that manually. I wanted a script to do this for me, selecting a pair of backgrounds for each day. I wrote one in AppleScript, but was so unimpressed by it that I decided I’d do it over in Python.
[more...]

Permalink     Comment     [, , ]    

Python Syntax Highlighting for star-light

23:37 26 Jun 2009

A couple of years ago I plugged star-light, a syntax highlighter that’s entirely client-side. I’ve been happy with it, but wanted a Python mode for it. I was going to post some other code this evening, and then decided that I should just make the Python mode myself.

This led to fun with regular expressions.
[more...]

Permalink     Comment     [, , , , ]    

PyWebSF Logo Attempt

23:03 21 Jun 2009

My brother asked me a while ago to design a logo for PyWebSF, and tonight I took a shot at it. Part of me thinks it has a certain something, and part of me thinks it’s exactly the sort of thing you get when you ask an engineer to do a designer’s job.
[more...]

Permalink     Comment     [, , ]    

WordPress 2.8 Upgrade

17:44 14 Jun 2009

Today I upgraded this blog to WordPress 2.8, a relatively smooth process. I ran into completely unrelated problems (hitting the process limit for my shell account) that derailed things for a while, but the WordPress upgrade itself was smooth.

I use Subversion to upgrade, first using
svn export --force http://core.svn.wordpress.org/tags/2.8/ .
in my development environment, seeing if things look okay there, then checking in the 2.8 changes to my own repository (the only niggly part because I neglected to clean the dev environment of changes before the export, so I had to look through things to see what was part of the upgrade), backing up my live database, and then checking the changes out to the live environment. It all looks fine, and hopefully will continue to function normally.

Permalink     Comment     [, , , , , ]    

Pylons Via Apache Port Issues

16:42 12 Jun 2009

I’ve been using Pylons (and, more recently, the Pylons-based TurboGears 2.0) for various projects for a while, and a few weeks ago ran into an annoying and specific problem: using Pylons via Apache made Pylons occasionally think it was running on a different port.

There’s a relatively easy answer to this, but until I was reading through TurboGears documentation, I didn’t find it.
[more...]

Permalink     Comment     [, , , , , ]    

PyWebSF: Meetup for SF-Area Python Web Developers

22:07 09 Jun 2009. Updated: 19:42 11 Jun 2009

My brother is organizing what will hopefully become a regular web-centric Python meeting. The first meeting is planned for 18:00 Tue 23 Jun 2009 at the SF Public Library. I think a couple of speakers are lined up already, although I don’t have details on the talks. I’ll be there, and if you’re a Python developer with web interests, or a web developer into or curious about Python, you should attend too!

Permalink     Comment     [, , , , ]    

WP Plugins: Recent Commentary and Show Tags in RSS

19:38 23 Mar 2009

I finally got around to writing up docs for, and then packaging, the two WordPress plugins I’ve finished recently:

I’m currently looking at support for series in WordPress, and am considering either writing my own plugin or using/forking the Organize Series plugin.

Permalink     Comment     [, , , , , ]    

Some RSS Changes

19:44 19 Mar 2009

I’ve made some changes to my Related Posts by Tags plugin, so that it’s now possible to add the list of related posts to the RSS feed entries. As I was experimenting with this, I realized that I wanted the RSS entries to show the tags for a post as well, so I wrote a (very simple) plugin to do that, too.

As a result, those of you reading this via RSS will now see a list of tags at the end of posts, followed by links to related posts. Please let me know if this doesn’t work as intended, or if you have other comments on the change.

Permalink     5 Comments     [, , , , ]    

Yahoo!’s Website Performance Rules

16:32 12 Mar 2009. Updated: 02:38 15 Mar 2009

While I’m familiar with a lot of them, I’d never actually read Yahoo!’s performance recommendations. They’re clearly laid out, with lots of good information in there. I should have a look at changing some of my own stuff into CSS sprites, as well as some of the other suggestions—these rules make a difference to users even on sites like mine.

Except for those of you who read all this via RSS, of course.

Permalink     Comment     [, , ]    

New Blog Functionality: Recent Commentary

21:39 23 Feb 2009

I’ve had a Recent Comments section on the front-page sidebar of the site for quite some time, and decided it was time for an upgrade. The old version was straightforward: it displayed a list of the most recent comments and who made them. What I decided I wanted was, rather, a list of the posts with the most recent comments on them, how many comments there were, and a list of the people who made the comments in timestamp order.
[more...]

Permalink     Comment     [, , , , , ]    

My WordPress Development Setup

16:29 13 Feb 2009

One of the first things I did with my resuscitated blog was to figure out how I could develop for it in a reasonable fashion.
[more...]

Permalink     Comment     [, , , , ]    

Related Posts Plugin and SQL Trickery

11:55 10 Feb 2009
Permalink     4 Comments     [, , , , ]    

Blog Move Steps, Part Three: DNS Change

23:58 27 Jan 2009. Updated: 01:13 30 Jan 2009

I’ve wrangled my old plugins and custom code so that it mostly works, except for one or two features (such as “related posts” based on tags) that I’ll revive later. Good enough for now, so I’m making the DNS changes and going ahead.

If you’re seeing this text, you’re on the new server, and all should be well. But if you don’t see another post after this one by about Friday, it suggests RSS problems, so please drop me a line.

Permalink     1 Comment     [, , ]    

Blog Move Steps, Part Two

22:30 26 Jan 2009. Updated: 16:46 28 Jan 2009

I continued working on the blog move today, and most of the tricky database-related steps are done.
[more...]

Permalink     Comment     [, , ]    

Blog Move Steps, Part One

23:53 25 Jan 2009. Updated: 16:46 28 Jan 2009

I spent time today working on moving this blog to a new home, while also combining the articles from the old (real) blog and from this temporary one, and upgrading my version of WordPress in the process.
[more...]

Permalink     Comment     [, , ]    

Rules of Database App Aging

18:58 19 Jan 2009. Updated: 16:48 28 Jan 2009

I came across a blog post about the Rules of Database App Aging today. I’m having another look at my database assumptions at the moment, and the three rules that Peter Hawkins lays out seem solid:
1. All Fields Become Optional.
2. All Relationships Become Many-to-Many.
3. Chatter Always Expands.
[more...]

Permalink     2 Comments     [, ]