Procrastiblog

January 17, 2007

Development Tools on Mac OS X

Filed under: Tech — Chris @ 4:48 am

[Editor’s Note] This is old material imported from my now-defunct Wiki

I’ve been using Mac OS X 10.3 (Panther) since it was released. I regularly use Unix tools like make, gcc, latex, etc. I recently had a catastrophic hard disk failure and just got around to re-installing my development environment. The hard disk came from the shop loaded with the OS, but no Developer Tools. I put in my XCode Tools install disc and installed all of the Apple Developer Tools. Afterwards, I got the following error trying to run gcc on anything:

  % gcc t.cld: can't locate file for: -lcrt1.o

Thanks to Dan Smith on MacInTouch I discovered my re-install routine wasn’t sufficient. The repair shop probably installed the OS off a backup disk that didn’t include development libraries; the XCode disc isn’t careful about checking library dependencies.

If you’re installing development tools on a fresh hard disk (or even a brand new Mac, probably), you need to make sure you have the following files in /usr/lib: bundle1.o, crt1.o, dylib1.o and gcrt1.o. If they’re not there, either: (1) do a fresh install off the OS discs, or (2) download and run the full XCode 1.1 or 1.2 installer from the Apple Developer Site (Log In (free registration) -> Downloads -> Mac OS X -> XCode Tools).

Problems with Ghostview

After installing Fink 0.7.2 and using it to install Ghostview 3.6.1-4, I got the following error trying to run gv:

  % gvWarning: Representation size 4 must match superclass's to override highlightedBackgroundWarning: Unsupported shape style for Command widget "toggleCurrent"Warning: Unsupported shape style for Command widget "toggleEven"Warning: Unsupported shape style for Command widget "toggleOdd"Warning: Unsupported shape style for Command widget "unmarkAll"Warning: Unsupported shape style for Command widget "autoResize"Warning: Representation size 2 must match superclass's to override internalWidthBus error

This is apparently a problem with the Fink binary distro of gv. If you rebuild from source (i.e., fink rebuild gv) it should work fine (assuming that all of your X11 dev libraries are set up right—don’t let Fink install XFree86 over your Apple X11 install! (Unless, of course, you know what you are doing)), .

Links

MacInTouch has an incredibly large collection of tips for Panther users, as well as for all kinds of other Mac-related subjects.

January 16, 2007

Hey You Kids, Get Off My Lawn

Filed under: Not Tech — Chris @ 8:36 pm

So I’m standing on the R platform at Atlantic Ave and there’s a group of awkward pre-teen boys running in circles, chasing one another, shoving, tackling, and wrestling and just generally being stupid and irresponsible (not to say annoying) and, basically, I’m standing there devising plans for how I’m going to live with myself when one of these kids falls down onto the tracks and gets run over when the slightly older, completely unamused lady standing next to me walks over and gives them a talking to. Where do you grow the balls to do something like that? To yell at some kids you’ve never met when they’ll probably just laugh at you and ignore you and make faces behind your back?

They didn’t laugh at her—though they seemed terribly pleased with their own raffishness—and they did knock it off—though there was some backsliding as the interminable wait for the train wore on. Could I do that? Could I bend obnoxious children to my will?

January 11, 2007

George Michael Bluth on Success

Filed under: Not Tech, Waste of Time, YouTube — Chris @ 2:13 pm

Happy Times.

Via Unfogged.

January 10, 2007

JPEGs in Subversion

Filed under: Tech — Chris @ 8:41 pm

If you’ve got a JPEG under Subversion and it looks like this

when it should look like this
,
maybe Subversion thinks it’s a text file. Try

svn propdel svn:eol-style MY.jpg
svn propset svn:mime-type image/jpeg MY.jpg

Brought to you courtesy of this guy

Bonus fact: if you’re accessing Subversion via svn+ssh and it asks for your password more than once, fret not. Subversion and SSH are just really dumb. See here.

Person of the Year Update

Filed under: Not Tech, Politics — Chris @ 4:57 pm

Twenty-four hours later my comment still hasn’t shown up. (And, no, it didn’t include any slander, profanity, or links to pornography.) Despite the fact this post is lighting up the left-of-center blogosphere like a Christmas tree, it has only 16 comments so far. Nice participating in your community, Time.com…

January 9, 2007

Joe Klein, Turd Blossom

Filed under: Not Tech, Politics — Chris @ 8:11 pm

I formulated a response to this Joe Klein drivel which has been shit-canned to the Time.com moderator queue for the last four hours*. In the meantime, BooMan has published the definitive take-down:

Friends do not let friends drive drunk. In the case of George W. Bush and the neo-conservatives, they not only are insisting on driving intoxicated, they won’t let us out of the car and they respond to all requests to slow down by stomping on the accelerator. In this situation the only rational thing to do is to wait for them to come to a halt at a stop sign (if they are sober enough to avoid running it) and smack them in the head with a sock full of pennies. We need to take away the car keys, Mr. Klein.

You can call me an “illiberal leftist and reactionary progressive”, you can say my “naivete on national security–and the left wing tendency to assume every U.S. military action abroad is criminal–just aren’t very helpful electorally.” You can talk all the shit you want. But you are still letting your friends drive drunk and criticizing anyone that wants to do something about it.

* I will take this opportunity to say that moderating blog comments is clueless and completely beside the point. Wake up, people! I am the Time Magazine Person of the Year! Why won’t you publish my brilliant writing?

January 6, 2007

The Unix Shell: Argh

Filed under: Tech — Chris @ 6:26 pm

Suppose you’re trying to write a simple shell script. And suppose you very badly want to put a command into a shell variable before you execute it. And suppose that command very badly needs to accept double-quoted strings as arguments. Oh, the layers of indirection! How will the shell tokenize such a thing?

Let the command in question be the following homely shell script.

string-arg.sh:
#! /bin/sh
# Usage: string-arg.sh [-s STRING]*
while test ${1+set}; do
case $1 in
"-s")
if ! test ${2+set}; then
echo "no string after -s"
exit 1
else
echo "string arg=\"$2\""
shift 2
continue
fi
esac
echo "bad arg: $1"
exit 1
done

Let’s see what happens.

% ./string-arg.sh -s "quoted arg"
string arg="quoted arg"
% cmd="./string-arg.sh -s \"quoted arg\""
% echo $cmd
./string-arg.sh -s "quoted arg"
% $cmd
string arg=""quoted"
bad arg: arg"
% eval $cmd
string arg="quoted arg"

AND REMEMBER, KIDS: echo `foo` gives you the output of foo and { foo; echo $? } gives you its exit value.

if foo 
then bar
fi

executes bar if foo succeeds (conventionally), which is equivalent to

foo && bar

in the short-circuiting parlance.

if ! foo 
then bar
fi

executes bar if foo fails (conventionally), which is equivalent to

foo || bar

in the short-circuiting parlance.

if `foo`
then bar
fi

executes bar if the command output by foo exists and returns exit value 0 (if it doesn’t exist, it will just exit).

if test `foo`
then bar
fi

executes bar if foo doesn’t produce any output.

[UPDATE] One more thing. Setting shell variables.

% CMD=cmd arg
bash: arg: command not found
% CMD= cmd arg
bash: cmd: command not found
% CMD= "cmd arg"
bash: cmd arg: command not found
% CMD="cmd arg"
% echo $CMD
cmd arg

This often trips me up, because make is much more forgiving and I hack more Makefiles than shell scripts.

[UPDATE 1/8/2007] I got the if-then stuff wrong the first time. Which goes to show you how desperately I need this tutorial. In shell-world exit code 0 is “true” and exit code not-0 is “false”. This is sort of the opposite of the C convention, with the caveat that exit values and arithmetic values shouldn’t be conflated.

Another trip-up from C to the shell is that whitespace makes a bigger difference. if ! foo; then bar; fi is not the same as if !foo; then bar; fi.

if foo
then bar
fi

is not the same as if foo then bar fi. {foo; bar;} is not the same as { foo; bar;}. And so on, world without end.

January 5, 2007

The Top Chef Says: Nobody Likes You!

Filed under: Not Tech, Top Chef — Chris @ 4:45 pm

I’m trying to avoid too much basic cable blogging, but I feel moved to comment on the horror of this week’s Top Chef. Sam, Ilan, and Betty’s “nobody likes you, Marcel, and we’re going to prove it” act was straight out of my junior-high nightmares. Isn’t it strange that last year’s “villain,” Tiffany, earned everone’s loathing because she wasn’t a team player and picked on Dave and Miguel, whereas this year’s “villain,” Marcel, is visibly trying to be cooperative and is being picked on by everybody else?

I think the key fact here is that the contestants take what is said at the Judge’s Table very personally. Despite the fact that those in the “bottom three” are forced to opine on “who should go home”—and despite the fact that it’s generally good strategy not to choose oneself—naming names gets you in trouble. Tiffany did herself in by being excessively cut-throat at the Judge’s Table (and also the lying). The last straw with Marcel was probably when he failed to credit Sam with last week’s win (never mind that standing by and letting others take credit for success is hardly the path to victory).

I didn’t like Marcel to start, but his sense of humor in the face of everyone’s hostility has really won me over. He’s pretentious and arrogant (but, come on, he’s not Stephen “You will never succeed, and you will fail horribly” Asprinio (who also won me over in the end, now that I think about it)), he easily descends into self-parody (asked why his turkey roulade was dry, he responded that he didn’t have access to a thermal immersion circulator (or, um, butter)), and he probably doesn’t have the skill to win the competition. But at least he’s not a total dick!

I always hated Betty and I’m glad to see her go. Her excessive cheerfulness seemed to be tautly and thinly stretched over a chasm of extreme bitchiness. Up till this episode, I liked Sam and Ilan and had them figured as top contenders. I’ll be rooting against them from now on. And for Elia and Marcel.

P.S. To Ilan: Marcel will stop making foams when make something other than paella.

What’s Better-Than Armond White?

Filed under: Not Tech — Chris @ 4:32 pm

Finally, his whole critical style distilled to one infographic. Unfortunately, Steven Spielberg didn’t release a movie this year… we’ll have to wait until 2008 to find out why Indiana Jones IV is better than the entire oeuvre of Jim Jarmusch. (Via The House Next Door)

This reminds me: several weeks ago John Podhoretz of the National Review called Manohla Dargis’ review of Inland Empire “the most pretentious piece of writing in all of recorded history.” These can only be the words of a man who has never read Armond White.

December 29, 2006

NotTech

Filed under: Not Tech — Chris @ 7:11 am

Blogger has introduced Post Labels and Label-specific Site Feeds. If you are not interested in Linux device drivers and are absolutely certain that you never will be, you might like to try subscribing to: Site Feed (NotTech)

If you think I’m particularly fascinating on the subject of politics, you might try:
Site Feed (Politics)

If you’re in the market for videos of men getting hit in the crotch with a baseball and white men who should know better saying “Nigger” over and over, try:
Site Feed (YouTube)
(That one is going to be really low frequency.)

And if you wait up every night for a new post on device drivers, try:
Site Feed (Tech)

NOTE TO BLOGGER: It would be cool if the Site Feeds could add and subtract tags rather than just subscribing to single tags. E.g., instead of a “NotTech” tag, I could have a “ProcrastiBlog minus Tech” feed. Or “Politics plus YouTube”. Or whatever.

« Newer PostsOlder Posts »

Blog at WordPress.com.