Archive for the 'Technology' Category

Hooray!

I got a message from an OKCupid user today, one I hadn’t contacted. It’s nice to get something out of the blue like this:

Hello dear, how are you doing today, hope great, let me introduce myself, my name is merry william , 29 years female from chicago. I searched your profile, read it and I was amazed with the content of your words

Doesn’t she sound intelligent?

Continue reading »


Weak chess engines

For a long time, I’ve thought that there’s been a hole in the computer chess world—there are no chess engines that play weak games with human-like mistakes (that I’m aware of). It’s easy to make a chess engine that plays a 2000+ strength game, but weakening these engines by limiting their search depth or time always seems to produce games with many strong moves and a few blunders. I can’t be completely sure—it could just be paranoia—but it seems like real weak players (i.e. most casual players) make mistakes that are quite different, and more fun to compete against. Are there any engines that play good weak chess, that accurately mimic the style of a human weak player? Am I crazy for thinking that existing engines don’t?


Unfogged Greasemonkey script

I made a little script for Unfogged comments threads that linkifies numbers in comments to go to the comment with that number. Link.

It sort of breaks on comments with links in them that have numbers in the URL. Not sure how I’d go about fixing that.

It should be extendable, with trivial modifications, to most other blogs with comments that use comment numbers in the same way.


Morality is unsustainable

“Darwin”, of DarwinCatholic, (h/t Gene Expression) writes here about a Business Week piece on the ethics of selective abortion using genetic screening for various disorders.

Continue reading »


Emacs and lisp

I’ve just started working on my first really substantial lisp application. It’s going to be the application described in this old post. I’m using CLX and writing my own midi library using device IO to /dev/snd/midi0 (on Linux, of course—using the midi ports on Windows is about a million times harder).

And anyway, it reminded me that I never did publicize the neat parentheses macros I’ve been using to make programming in Lisp with Emacs easier. It works a lot like Eclipse does—when you type an open paren, it inserts the close paren. Then when you type the close paren, it simply moves the cursor past what it had inserted before. That way, if you move around with the cursor, your parens are all still in balance. It doesn’t work perfectly. Typing unmatched parens in strings becomes annoying. And surrounding an existing form(s) in a new form, while easy, isn’t entirely intuitive. What happens is that if the cursor is at an open paren when you type another open paren, it puts another closing paren after the form and puts a space after the open paren you inserted. If you don’t want that to happen, you can type a space before typing the open paren. If you want to grab more than just the one form (or if you’re not right in front of a form or want to grab it anyway) you can type Ctrl+N before the open paren and it will enclose the next N forms. Finally, typing a Ctrl+0 before typing “(” will remove the pair of parentheses at the cursor. Also a bit awkward, but better than nothing.

I’ve found that this makes using Lisp much nicer. Source after the break. Continue reading »


Packrat parser dependency analysis memoization optimization

Bryan Ford has written some nice papers on PEG parsers and the packrat algorithm. (Wikipedia on parsers.) In a nutshell, the packrat algorithm for implementing parsers for PEG grammars achieves unlimited lookahead in an input stream with reasonable resources by memoizing the results of specific grammar rules (storing the result of a rule at individual points in the input stream so that the rule is calculated at most once per input position, and usually much less). In his thesis, in section 4.4.2, he lists (among others) an optimization that helps alleviate the large memory requirements of packrat parsers. By analyzing a PEG grammar before using it to parse an input (or before generating a parser) it can be determined that some rules will not call others recursively, and thus can be de-memoized with the parser remaining O(n) (though a bit slower).

This is a good start. But another optimization I don’t see mentioned anywhere (possibly because it doesn’t apply to a parser implemented in Haskell) is to perform an analysis on rules to automatically determine backtracking scopes. Once certain rules complete sucessfully (usually medium level rules, like “statement” in grammar for a C-like language) it should be possible to guarantee that a whole class of lower-level ones (lexing rules, often) will not be called again on a position inside of the text included in the high-level rule. By grouping rules’ memoization into related structures, it should be possible to easily and quickly free large block of intermediate results as these higher-level statements are matched.

This analysis would be pretty obvious in certain places for a human to give hints about. Whether it’s possible for the parser (or parser compiler) to perform this analysis usefully, I’m not sure.


The end of the world

Six nuclear targets that, if hit, could effectively end civilization. (From Michael Anissimov.)


Wordpress category hider plugin

OK, it was so easy to write a plugin as opposed to doing other things that I went ahead and made a plugin to do it.

My category hider plugin allows you to make posts in a selected category (or more than one) display a stub text on the main page of your blog and in your rss feeds. The post still displays in full in your archive pages (but only for the selected category) and on its own page. Of course, tweaking where it gets hidden is trivial.

If you want the category’s posts to be completely absent on the page or in the feed, I doubt a plugin would allow you to do this. If it is possible, it would be a very different plugin. (If you know PHP, on the other hand, the hack is pretty straightforward.)

I’m not going to bother providing a download right now. If you’re interested, comment, and I’ll see about getting together a download for it.


On diarizing

I used to keep a diary. I think it was for about three or four years. Over a thousand entries in the thing. I stopped that when I stopped needing it so much. I stopped it when I realized that no one would ever really like to read it. I mean, even I didn’t like to read it. Just to write it.

But now that I’m not keeping it anymore, now that I have a real, public-oriented blog, I sometimes miss being able to go on and on about personal things without worrying about boring people. So, I wonder if there’s a way to include that sort of thing on my blog without making people who aren’t really interested read them too. I could put the post under a fold (I wish there were a better term for that—I was trying to google it a while back and had a hell of a time finding what I was looking for), so that people had to click on a link from the main page. With a warning above the fold. And that’s all great, except that the whole post would still show up in my RSS feeds. I don’t want to put a password on it—I want it to be publicly available, but only protected from wandering eyes.

I could start another blog, but that’s excessive, and it would dilute my readership anyway. What would be ideal, I guess, would be to have a separate section of the blog. A category that doesn’t show up in the main feed or the front page. Or maybe an author that gets a separate directory. Maybe another wordpress install? I’d rather avoid that if I can, but it’s one possibility. Maybe I should look up a “main page & feed” hack that lets me make certain posts less visible.

UPDATE: OK, so it was easier to write my own plugin. Here.


Why I hate IM

I’ve never liked IM (instant messaging). I’ve never formed a friendship over it. I’ve never advanced existing friendships over it. Now, I’ve found it pretty useful, sure. It helps me keep in touch with coworkers and existing friends.

But I’ve always been so nervous when using IM. Perhaps not as bad as this, but I always worry so much about missing important cues. Does the person really want to talk to me, or are they responding out of politeness? What does it mean when the person doesn’t initiate conversations? How often is often enough, and how often isn’t? I always end up feeling neglected by the people I chat with, or pushy for talking so much, or like I’m holding up all the effort in the conversation. Now, according to some, this makes me paranoid. But am I, really? Well, probably.