I made some science.

Take the MIT Weblog Survey

You too can make science, by participating in the MIT weblog survey. Go on, you know you want to…

ecto: Auto abbr/acronym

There are a couple of instances of scripts out there that automatically apply abbr and acronym tags to pages, but I wanted to be able to do the same in ecto. This is also the first time I wrote a plugin script for ecto, and I wanted to do it in python. Please note that this here script is untested until I get onto my Mac and test the hell out of it. The script works, with the caveat listed in TODO.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    #! /usr/bin/env python
    
    'A script for ecto that adds abbr and acronym tags to the text'
        
    TODO = '''
    Fix it so that acronyms without a space either side (for example,
    that finish a sentence) work.
        
    Lookup on the internet for a list of acronyms/abbreviations?
    '''
        
    acronyms={'WYSIWYG':'What You See Is What You Get',
              'DOM':'Document Object Model'}
    abbrs={'XHTML':'eXtensible HyperText Markup Language',
           'NSLU2':'[Linksys] Network Storage Link (USB) 2.0'}
        
    # Add more values to your hearts content…
    
    # get input data - depends on implementation.  For ecto:
    import sys
    data = open(sys.argv[1]).read()
        
    # replace only the first instance of each acronym/abbreviation
    for each in acronyms:
        data.replace(' '+each+' ', '<acronym title="'+acronyms[each]+'">'+each+'</acronym>',1)
    for each in abbrs:
        data.replace(' '+each+' ', '<abbr title="'+abbrs[each]+'">'+each+'</abbr>',1)
        
    #return data to ecto
    open(sys.argv[1],'w').write(data)

Note: Comments turned off: too much Spam on this entry.

Abusive Comments

I’ve noticed a few abusive comments on various posts, and it struck me as interesting as to the general form of them:

  • They are always anonymous, or pseudo-anonymous (kala@kala.com, god@heaven.net).
  • They always include lots of swearing.
  • They almost always lack proper capitalisation and punctuation.
  • They don’t actually make a decent point.

I am actually happy to have posts critical of stuff I have written, as long as they actually provide useful feedback. I don’t really want to have to turn moderation of comments on, I’d rather just remove comments that are totally inappropriate (SPAM, not adding anything useful to the discussion, etc), but if I get too many abusive comments, I may just have to…

The World According To Matt

I can’t quite remember how I came up with the title of this blog, but I know it had something to do with “The World According to Garp”, which I remembered as “Life According To Garp”. I’m glad I got it wrong, because there is another site with the title The World According To Matt. I did a bit of a look, and he started it well before I started mine, so I’m going to do the honourable thing and come up with a new title. I might go by a Google Search referer I got today: Monkey Female Names According To Matt. Doesn’t quite have the ring I’m after… Here’s my top options:

  • I don’t like your trousers
  • Barely Respectable, Rarely Bespectacled
  • Mistaken at the top of my voice
  • hateful AND boring
  • Paint the Tiger/Carve the Swan
  • Afterisms (Inc)

Vote for which one you like most in the comments. Here are some more options:

  • part of the precipitate
  • vanilla won ton soup
  • Chewing Gum For Your Eyes (thanks to Frank Lloyd Wright)
  • Not An Actual Emergency
  • At night, the ice weasels come
  • I’ll have a pie, thanks!
  • Segmentation Fault: Core Dumped taken
  • Proto-Nasal-Philosophy (Inc)
  • Not Company Policy
  • The Global Dictator
  • Still safe to eat, just
  • A thousand measure of rice
  • You can’t polish a turd
  • Thinking of a Flannelette Shirt
  • Like a fortune cookie, only without a witty fortune, or a cookie
  • Footprints in my hair
  • Counting Thoughts: 1…
  • Old enough to conform
  • Intolerable Bryl Cream
  • Always Rely on Miracles
  • Believe the Donkey, for he Brays
  • Taste the Fat
  • Impermanently Confused
  • Love is no excuse
  • Not Evil. Lively.
  • Youth is a Curse
  • They kill people for less than that
  • Twatology
  • Damn this Childproof Cupboard!
  • Everyone Likes Berries
  • Power, without responsibility
  • Adequately Competent
  • Whatever you do it ends up raining
  • Ghandara, Indiana
  • Are we there yet?
  • Simultaneous Noise Production

Referers deciding post topics

I regularly check my Referers list in the WP backend - it’s interesting to see who has visited my site, or rather, where they came from. I really like a couple of features - especially how it points out Google referers. It struck me as a useful way to see how my site ranks in terms of Google searches. A couple of terms return a page from my site as the first hit. For example: [Google: probability of our existence][1] This in itself is interesting - and it’s accurate. The post in question is about the Probability of our Existence. But more interesting is what people have searched on, found my site and visited about, where the topic is not quite right. To increase user satisfaction, I could write posts about what they were searching for initially. For example:

  • How to rate song with itunes
  • Old postsecret posts
  • Easiest way to resize pictures
  • 1 itunes library for multiple users
  • resizing the length of songs in itunes

The thing I think is most interesting is that most of my hits come from searches for sudoku - and I only ever wrote one post on it! (And it doesn’t really tell how to solve them…but details how I wrote a program to solve them.)

[1]: http://www.google.com/search?hl=en&q=probability of our existence&spell=1

Blog Post Page Breaks

I didn’t realise this until last night, but it’s easy to split a post into several pages, use the following: I wonder if there’s a setting in ecto to automatically paginate…

Bug in XMLRPC.php

Yay! The days of having every post I posted with ecto automatically having the default category as well as those that I choose are numbered! An official bug report of the error (including the line of code where the bug occurs) has been put into the Word Press bug system (mosquito).

Transferring posts with ecto.

I moved blogs from one server to another some time ago, and luckily I was using ecto to post, so had an archive of the posts on my computer. I wrote an AppleScript to move a post from one server/account (ecto calls them personalities) to another, and popped it into the ~/Library/Application Support/ecto/scripts directory, set up a shortcut key, and then it was just a matter of opening a post, pressing the key, and it posted the old post to the new server. Some posts caused ecto to crash, but I could live with that. Anyway, here is the script: tell application “ecto”     set _draft to document 1     tell _draft         set _date to entry date         set current personality to “Blogsome”         set entry date to _date         do post     end tell end **tell **

Deleting Users in WordPress

If you have turned on User Registration, or have created any users; and promoted them beyond level 0, then you won’t be able to delete them. That’s right, to delete a user in WordPress (1.5µ anyway), that user must be level 0.

Auto-resizing of images

I found a need for a tool the other day - blogsome has a 300k size limit on image file uploads. Wouldn’t it be nice to be able to have image files automatically resized/recompressed so they are smaller than a certain size…I wonder if this is possible. I’d like to see this feature in ecto. Rather than just presets, make a ‘smart action’, that automatically chooses image size/compression to make the image fit in a certain amount of data.