August 21, 2008

Apache on OS X: Case sensitivity

Many Apache users use .htaccess files to control access to files. Of course, sometimes only some files are password protected:

<Files ~ "admin.*">
...
Require valid-user
</files>

Now, this wouldn't protect a file named AdminList, or ADMINFOO, because regular expressions are not usually case-insensitive, but no problem; just name your files consistently.

On OS X, the default filesystem is case-insensitive (technically case-preserving). This means that, if there is a file named 'adminlist.php', and you enter the URL ADMINLIST.PHP:

1. The Files directive doesn't match it.
2. The web server displays it without complaint, because it can open a file by that name.

If you serve pages on OS X, and use .htaccess, you have to fix this. Now.

Note that the canonical <Files ~ "^\.ht"> used to prevent access to .htpasswd does not prevent access to .HTPASSWD. Seriously, this is bad mojo. (But Apple does it right in their httpd.conf...)

Posted by seebs at 12:49 PM | Comments (1)

August 10, 2008

Humanscale Freedom: Dumb name, decent chair

Like a lot of geeks, I spend a lot of time in a chair. Like too many geeks, I pick up office chairs at an office store, sit in them a lot until they break, and then go get another one.

My old chair finally became pretty much unusable. Height adjustment was dodgy (and tended to sink over time), and the tilt was just... All it would do is tilt forward about seven degrees with any weight on it. No spring at all.

I decided to look into chairs again. I went to an office store, and got a chair that seemed comfy, but it turned out to be pretty bad. Specifically, although you don't notice it right away sitting in it, there's a support strut under the front of the seat which does a bang-up job of cutting off circulation -- this noticably aggravated some blood circulation issues I was already having. Whoops.

So I did some research and decided to get a Real Chair. You know the kind; the office chairs that cost a few hundred dollars instead of under two hundred. The Aeron is the most famous, and one of the big contenders for the product that the most people love and the most other people hate.

Two of the big contenders were the Humanscale Freedom and Liberty chairs (IMHO, very pretentious names). Reading reviews, it seemed that some people loved them and some hated them. The normal strategy with pricey things of buying online to save money doesn't work as well with chairs; they cost money to ship, and trying a few out, or trying several out at once, is a bit weak. So I went to a store and tried some out, and decided to just accept the store markup as the cost of getting to mess around.

The Freedom and Liberty are both astoundingly comfortable, by my standards. The Liberty's mesh back is nicer, I think; it felt distinctly cool to lean back on it. Originally, my plan had been to get this chair because I don't really like tall-backed chairs; they are uncomfortable and annoying to me, in general.

However, I did want to try other chairs, and one of the other chairs was the Freedom, both with and without headrest. The headrest stunned me by actually being comfortable. Normally, even in chairs with a headrest, I lean my head forwards a bit while tilting the chair back; I don't know why, but they always seem to fit poorly. In the Freedom, the headrest actually seemed to fit well.

The Freedom's design is pretty unusual. The headrest and back both move a little as you tilt the chair back, trying to adjust automatically. I am not sure how well it works, yet, but it's better than not having the feature at all. It has many fewer adjustments than many chairs; most notably, the tilt stiffness is set magically by your weight, which works well enough for me.

I have previously hated armrests; this chair's arm rests may change my mind. They can be adjusted to be mostly out of the way, but to let me rest my arms when I actually intend to, rather than having something in the way when I'm typing. They magically stay adjusted to the same height; this is awesome for me, but might not suit everybody, as bilateral symmetry is more of a heuristic than an absolute truth. Seat depth, back height, chair height, and headrest height are all adjustable fairly easily.

The seat itself is excellent; it's their "technogel" padding, whatever that is, but the net result is that it is extremely comfortable, and I've been quite liking it.

As with many ergonomic devices, I found it took a while to get used to. The back support isn't perfect for me, but it seems to do well with adaptation. I think the issue is that the magical relation between leaning forwards and backwards and the height of the back isn't quite right for me. On the other hand, it's by far the best I've ever experienced.

So, here's my thoughts, a couple of days in:

1. The wheels are pretty rolly. If I were in a less tilty house, this would be awesome; as is, my chair sometimes just sorta rolls away from my desk. But this is easily corrected.
2. For leaning back anywhere from just a tad to about a 45 degree angle (as far as it goes), this is probably the best chair I've ever owned that wasn't a recliner -- and I actually like it better than a recliner, because it's SO much better for getting up again. It requires only light pressure to move either way. Very relaxing.
3. While sitting upright, it's pretty good, but my habit of leaning forwards a bit, acquired from old chair, is working against me. If I actually sit upright, it's quite nice. If I lean forward a bit, my back gets sore... But I think I expected that.

Assuming this chair stays working as it is now for a few years, do I think it's worth the money (a bit over $1k)? Yes. I earn my living sitting in a chair 8-12 hours a day, and being able to sit in my chair an extra half hour a day comfortably would quite easily pay for the chair.

If you look into these:
1. Sit in one yourself. Be aware of the adjustments; some are not obvious.
2. Get the fabric, not the leather, and get the "technogel" seat.
3. Be sure to try leaning back in it. The chair is quite decent for sitting, but the huge win is the amazing comfort of leaning back in the chair. Ten seconds leaning back with eyes closed in this is more relaxing than a minute trying to lean back in my other chair.
4. Just ignore the name.

I like the arm rests in this; they're well-designed, genuinely adequately padded, and can be moved to a position where you can use them when you want to without getting in your way. A definite plus.

Posted by seebs at 01:39 PM | Comments (1)

July 28, 2008

I'm not dead, really.

It's been a while. :)

So, the big summary is, I overcommitted back around February, but didn't notice quickly enough, and didn't cope well, so I'm still getting unburied. Since then, we've sold off the old house, my mom's moved to a new apartment, I've done a big chunk of a consulting project, I've written a bit over a third of a book (which was originally going to be done by now, unfortunately), gotten tetanus shots, written several columns, tutorials, and articles, and actually sorta caught up at work.

One of the underlying reasons I update so rarely is that Movable Type's Berkeley DB backend is sorta lame. I am trying to decide what if anything to migrate to; it looks like TextPattern is probably my best choice, but it also requires me to learn more new skills. (WordPress uses PHP, and I already know PHP; I also already hate PHP.)

Anyway, yes, there's still a blog, and I even plan to post in it occasionally.

For those who might have wondered: Yes, MS Word 2008 is still unusable on the Mac. However, a recent update may have fixed the horrible visual corruption glitches, even though the release notes do not mention anything of the sort.

Posted by seebs at 12:02 AM | Comments (0)

June 18, 2008

A farewell to clowns.

About a week ago, I learned something really interesting. I learned that I have clowns, and that these clowns are treatable.

For most of my life, I have been erratically brilliant; my scores ranged from over 100% (perfect scores plus extra credit) to failing, even on the same topic, over the course of a couple of months. I have been told that I am not working up to my potential dozens of times; I suspect that phrase and its variants were about 40% of my report cards by volume.

Recently, a friend on a message board mentioned being given a stimulant by a doctor as a quick sanity check for attention deficit disorder. Apparently, in people with ADD, stimulants tend to produce a calming effect, rather than a jittering effect. And, oddly, I've always liked to get some caffeine before going to bed so I can get to sleep.

Well, isn't that something.

So I went to see a psychologist, and she suggested talking to a doctor or a psychiatrist. The waiting period for a psychiatrist is a few months around here, but the waiting period for a regular doctor is about three days. So I went and saw a doctor, and he said that my symptoms did indeed sound like ADD, and how about we try some pills.

Now, you've probably heard about "ritalin zombies". This is a common trope in our culture; ritalin turns children into zombies! Interestingly, the medication I'm on now is the same chemical as ritalin. I did some research. In fact, the zombie thing is a pure myth. It isn't even a coherent myth. If you give ritalin to children who don't have ADD, it acts like any stimulant normally would; it makes them hyper.

So I tried one of these pills. I went out to dinner with my spouse and another friend, to have people who could observe whether my behavior changed. At first, it didn't seem to. No big effect. But then the observable changes started showing up. I normally jitter constantly; I stopped. I normally can't hear music in restaurants clearly; suddenly I could make things out. I could remember a couple of things I was planning to get to, and I could remember more than one of them, simultaneously.

This is all new to me. So far as I can tell, the idea I had of what the word "calm" meant referred to a state which most people would have described as "a little less frantic".

It turns out that, for the last thirty years, there has been a troupe of clowns following me around performing slapstick. Being medicated makes them pile into their tiny little car and drive away. It is pretty amazing.

So far as I can tell, it does not prevent me from thinking, give me an unexpected desire for the soft, moist, brains of living people, or otherwise have noticable downsides. I got some headaches from drinking less caffeine, but that's normal. So where does all the fear of Ritalin and its ilk come from? Who spreads this thought about it turning children into zombies?

Why, that would be various front groups operated and funded by the Church of Scientology, international. L. Ron Hubbard was apparently denied medication and psychiatric care by the department of Veterans Affairs, and he seems to have devoted substantial effort thereafter to ensuring that, if he couldn't have basic health care needs met, no one else could either. So Scientologists spread lies about what medication does, and how well it works, and what its side-effects are, and people hear horror stories about children losing all their creativity... And they don't hear about adults finally getting to have a conversation in which they can actually hear everything the other parties say, or being able to read a book without having to stop halfway through a paragraph to do something else.

Anyway, since it might be interesting to other people who are similarly afflicted, or are just curious:

The medication I'm on is methylphenidate, aka Ritalin or Concerta. I'm getting "Concerta", which is time-release capsules; 18mg over about 10-14 hours.

Day 1 (Thursday): Stacked on top of my usual heavy dose of caffeine, this produced the most surreal experience I've ever had -- I was not distracted. I've never experienced that before. VERY strange, but I'm told it's about what life is like for most people. It was just amazing; I could hold my hand up, without actively thinking about holding it still, and it just ... didn't move. Normally I twitch and jitter constantly. In the next 4 hours or so I did all the work I'd planned for Friday, a fair bit of what I'd planned for Monday, and got a few other things done.
Day 2 (Friday): Much less caffeine. Distractible and headachey until I added a bit of caffeine to cut back on the withdrawal symptoms. Then got back to being happy and functional, although not quite with the glass-like clarity of the first day.
Day 3 (Saturday): Medium caffeine, got a boatload of work done. Good focus, able to remember complicated task lists.
Day 4 (Sunday): Medium caffeine. Got a whole lot of work done. Fairly distractable and twitchy, but I could decide to keep working on something; my brain didn't just turn into jello when I tried.
Day 5 (Monday): A bit more caffeine again. Did some serious editing and revision work. This is normally very hard for me, but it went well.
Day 6 (Tuesday): Decent focus, and got a large chunk of code done. To put it in perspective, in about an hour and a half I did something for which I'd budgeted a full working day (and which another programmer had taken a couple of working days to accomplish).
Day 7 (Wednesday): Finally got around to blogging.

This stuff doesn't make me "not ADD". It doesn't make me slow or stupid. It doesn't change my ability to switch from one task to another faster than nearly anyone I know. It does give me the ability to not switch if I don't have a good reason to. If anything, it reduces the cost of switching, because I don't have to take notes on what I was doing -- I can just switch back after the interruption is over.

Posted by seebs at 01:55 PM | Comments (5)

June 08, 2008

Microsoft Word for Mac: STAY AWAY.

So, I have to do some writing sometimes which involves things like, say, a standardized template form provided as a Microsoft Word document.

I naively assumed that it would be possible to do this using Microsoft Word. I was wrong.

I'm no fan of Word. It's always been, by my standards, a bit dodgy. I have never liked it. The autonumbering is a famous pain, and the world is full of people who have tried, and failed, to get it to number documents correctly. The spell checker is, well, no better than most others, and they're all pretty bad.

So let me be clear: If it were just the usual run of poorly considered UI choices that Microsoft provides, I wouldn't make a big deal about it. We're used to it. It's the cost of their large size.

Microsoft Word 2008, by contrast, is unusable. I do not say this lightly.

Let's start with the release version. I started editing a document in Word 2008. I double-clicked a word... No effect. Now, in versions of Word since, oh, version 3 or so (which I used in 1988), double-clicking a word has selected it. That's been true on Mac, and on Windows, and so on. It's essentially universal. No luck.

So I downloaded the first emergency patch, to version 12.0.1... And suddenly double-clicking worked.

What didn't?

  • At unpredictable intervals, if there are two windows open, the one in the foreground drops behind the one in the background. You can't click on it to bring it to the front, because it's already in the front so far as it knows. You have to click on the other window, and then click back.
  • If one window has little floating menus out, and the other doesn't, the windows sporadically and unpredictably move up and down the screen when you switch between them, in a way that suggests that Word is trying to make sure that the window doesn't hide those menus -- even though they're six inches to the right of its rightmost point.
  • Saving the current file (command-S) sometimes causes the window to lose focus.
  • Scrolling through the file usually (and I do mean "more often than not") causes the display of text to become unrecognizable. Typical behaviors include partial lines of text or two or more paragraphs rendered on top of each other.
  • After you have scrolled, there is no reasonable expectation that the text displayed is actually what you will get if you click on the screen.
  • The text cursor disappears sometimes. Sometimes, it comes back.

Okay, well, let's try the big update to 12.1.0.

The scrolling problem is still there. Also, a new "feature" has been added. Mac systems have virtual desktops. Pop-up menus, such as paragraph style selections, appear on a different desktop. Why? Who knows why. But they do, so if you click on a paragraph, and try to select the pop-up selector to change its style... The screen shifts to another display.

The clever reader, not being inclined to believe crazy stuff just 'cuz someone on the internet said so, might try this, and say "hey, it works". I thought so too. Then I switched to another screen, came back, and found that the problem had respawned.

In short:

  • You cannot scroll through the text of a document and read it.
  • Even if you could, you couldn't edit it, except by (for instance) doing a select-all and then clicking on the newly-revealed location where you want to edit.
  • Anything that involves a pop-up menu will likely put you on a different display.

This is not merely annoying, it is unusable.

(Why, you ask, don't I use NeoOffice? Because I'm trying to read comments other people made, and NeoOffice doesn't seem willing to display them. The closest it has is a supposed "review" mode where you look at changes people made between two versions of a document; it won't let you Just Look At The Changes. Pages can't handle some of the formatting quirks in a couple of the paragraphs in the template. Either is much better at the editing task, but neither can handle the carefully-crafted incompatible and underdocumented edge cases of the format.)

Posted by seebs at 09:41 PM | Comments (0)