robfelty.com


Why doesn’t Mac update standard UNIX utilities?

Posted in linguistics, linux, mac osx, perl

Quarter note = 09152008 robfelty
Treble clef 4/4 Time
I am currently teaching a course on programming for linguists. We are using python, but for the first few classes, I have been going over some standard UNIX utilities like cd, ls and such, plus using regular expressions with grep and sed. I actually don’t use sed that much. I tend to reach for perl, since I know it better, and it can do pretty much all the same stuff that sed can plus much more. But sed is simpler […] (Read more)

Collaping categories 0.6.1

Posted in wordpress

Quarter note = 09072008 robfelty
Treble clef 4/4 Time
I just released version 0.6.1. This update is mostly bug fixes introduced in 0.6. I apologize for all the bugs in 0.6. It was a major rewrite, and I expected bugs, but probably should have labeled it alpha. I want to especially thank Hans Klaus for doing quite a bit of testing in 0.6.1, including testing the formatting with several different themes. Here is the changelog for 0.6.1: Improved styling so that collapsing and expanding symbols use a fixed-width font, […] (Read more)

Perl slurping

Posted in perl

Quarter note = 09032008 robfelty
Treble clef 4/4 Time
It seems like whenever I go to slurp in a whole file into a string in Perl, I have to search around to remember the exact syntax. So I decided to put it here for myself, so I won’t have to search any further than my own site. In this particular instance, I am trying to remove any <span> blocks from a file. I can simply do the following: perl -e '$string = do {local( $/ ); }; $string=~s/.*?//gs; print […] (Read more)

Strange bracketing behavior in grep and sed

Posted in linux

Quarter note = 09032008 robfelty
Treble clef 4/4 Time
I finally figured out this thorny issue I have been dealing with for the last hour. In perl, if I can create a character class like “[\[\]a-f]” which matches any characters a-f, [, and ]. This does not work in grep or sed though. I finally discovered that the right bracket “]” should not be escaped in grep or sed. I don’t really understand why. Perl will let you do it either way. You know what they say: “knowing is […]

Collapsing categories update

Posted in wordpress

Quarter note = 08282008 robfelty
Treble clef 4/4 Time
I have just a pretty major revision to collapsing categories, version 0.6. It includes the following changes: Can have multiple instances of widgets, each with separate options No longer works as non-widget All options are stored in one database row Added more sorting options Added option to include or exclude certain categories Added option to expand certain categories by default Added option to have category names either link to category archive or to activate expanding and collapsing I realized this […] (Read more)