exponent for Fan Control

Here’s another patch for some third party software, this time for keeping your intel mac CPU cool.

I’ve been using Lobotomo’s Fan Control preference pane and daemon to control my 2.16 GHz Core 2 Duo Macbook Pro’s fan speeds since I installed OS X.

It’s useful because it means you can idle with quieter fans in a cool environment, but still have them rev up to max before you burn your fingers. However, one thing that’s annoyed me for a while is that you only really control the floor and ceiling thresholds of a linear response curve.

In my experience (engineers or physicists can correct me), at a constant CPU load, there are multiple equilibrium temperature/fan-speed combinations, but they’re not collinear. In the original Fan Control, the response curve is linear. Taking a hint from gamma correction, I have patched Fan Control 1.2 to use an exponential curve. Where T is the temperature, the target fan speed F is governed by the equation:

F_b + (F_m - F_b) ((T - T_l)/(T_b - T_l))^γ

I also reduced the minimum upper threshold temperature to 60˚C.

You can browse the source in git or download the binary installer. I’ve only tested on the MacBook Pro (running Leopard). Feedback is welcome as comments here on the blog.

Screenshot
exponential curve screenshot

Of course, there may be more effective measures to combat a hot macbook pro.

Decent terminal font

I haven’t been able to find a good replacement for Monaco for use as a terminal font on OS X.

try figuring this one out with bleary eyes
try figuring this one out with bleary eyes

My personal favourite terminal font, neep alt isn’t readily useable from OS X.

None of the Proggy fonts are as clean as Monaco, although Proggy Tiny 11 comes close.

  • lower-case “a” should be double-storey, so it doesn’t look anything like lower-case “o”
  • zero “0” should be slashed
  • lower-case “l” should have a serif on the bottom like lower-case “t”, and not look like numeral “1” or upper-case “I”.
  • upper-case “U” and “V” differ by at least 7 pixels
  • gentle curves rather than blocky rectangles, please

It’s disappointing that Monaco can get so much right and get lower-case “a” wrong. Still, if anyone wants to port neep alt to a format OS X and iTerm can handle (even if it’s only at 13pt semicondensed)… I tried once with fontforge but it was pretty broken.

Cocoa devs fail Data Structures & Algorithms?

I can’t find a linked-list class in Cocoa. Yes, I do want to do middle-insertions, and I’d have a fine time amortising my sequential access to constant time. Fine; it’s not like they’re hard to implement.

The scary thing is that when searching, I blindly fell into the pool of ignorance displayed in this circa-2004 Cocoa-dev thread. To be fair, the OP was more concerned about iterator functionality than a list implementation, but most of the responses seemed oblivious to:

  • The iterator design pattern
  • The time-complexity advantages of a linked-list implementation over arrays and deques (NSArray) and hashes and trees (NSDictionary and NSSet)

Continue reading “Cocoa devs fail Data Structures & Algorithms?”