Archive for 2006

Free stuff on iTunes special: 2006-04-14

Friday, April 14th, 2006

While I was working on a bug report against iTVS, I found this: CSTV 101, commercials for CSTV.

Technorati tags: iTunes, iTunes Music Store, iTMS, iTunes Video Store, iTVS, CSTV.

Know your Xcode

Tuesday, April 11th, 2006

A couple of tips for using Xcode more efficiently.

  • Most commands that start an operation stop it as well. ⌘B, for example, starts and stops a build. ⌘⌥R will terminate a running subprocess.

  • Rule of key commands: With ⌘ and no other modifiers, the key command does at least a build. ⌘⌥ will do that thing alone, without building first. ⇧⌘ opens the progress window for that operation, without actually doing it. This applies to:

    • ⌘B/⇧⌘B (Build, Build Results)1
    • ⌘R/⌘⌥R/⇧⌘R (Build and Run, Run, Run Log)
    • ⌘Y/⌘⌥Y/⇧⌘Y (Build and Debug, Debug Executable, Debugger).

Any other suggestions? Please post them in the comments.

  1. There is no ⌘⌥B because, obviously, you cannot build without building.

Technorati tags: Xcode.

Making Spotlight work for you

Saturday, April 8th, 2006

For a long time now, I’ve kept Spotlight disabled because it constantly cranked away at my hard drive. I couldn’t figure out why that was, until recently, when I had an epiphany:

  • Spotlight updates its index when a file is updated.
  • If Spotlight is updating constantly, one or more files must be getting constantly updated.

What sort of file gets constantly updated?

That’s right. A log file.

So I added the folder with my IRC logs to the blacklist in the “Privacy” tab in Spotlight preferences, et voila, the constant indexing stopped.

Problem solved.

Technorati tags: Spotlight.

Too much spam

Saturday, April 8th, 2006

Anonymous comments are now off again. Too many spam messages get through when they don’t have to sign up for an account.

*sigh*

(Note: The above referred to the old Blogger blog.)

Iron Coder was a blast

Saturday, April 8th, 2006

I competed in the zeroth Iron Coder competition. These are the thoughts I wrote down the day after. (You can tell the age of this post because I was still using 12-hour time.)


It was great fun. I already knew the Accessibility API, so I didn’t have to study at all, though I did hit a couple of thorns in it when I was working on my project. As for Mardi Gras — well, I’ve never been outside California, so I’ve never been to Mardi Gras. I chose the bead theme for my project, as did several others.

I started around 3:20 PM, as soon as I thought of my idea. This was around 10 minutes after the theme was announced. I went to bed around 7 AM, being too exhausted to continue. I slept for five hours. I’d hoped that the FTP upload info would be up by the time I was, but it wasn’t. Good thing, as I did find some things in my project that needed to be finished off.

Colin and I were communicating by IM virtually the entire time that both of us were up. He started his about 12 hours late, so he had half the coding time everybody else had. And by the end of the contest, he’d been up for almost 30 hours. His app, DrunkVision, is all the cooler for that, even if nobody could figure out the secret Quit hot-key. ;)

I finished mine with under half an hour until the end of the 24 hours, and Colin uploaded his with just two minutes to spare. Seems like almost everybody who competed used every waking minute.

And this morning, I slept for 12 hours. So that’s the other side of the pendulum.

I’m looking forward to the next one. I don’t think they should be too frequent; maybe every 6 months to a year. That much time without sleep is hard on anyone. I do want to use all 24 hours on at least one Iron Coder, just to be true to the spirit of it. It’d be rough, but it feels great at the end.


Also, some more thoughts:

  • Several of the entries were actually useful. DrunkVision is one example, though the Mardi Gras-themed colors it uses might not be appropriate for everyday usage. Others were Pancake Day (not compliant with the theme at all, other than the name) and FFMinator. These are apps that you could use at any time, not just Mardi Gras.
  • I agree with the choice of winner. Lucas Eckels’ Symphony is by far the best entry — best use of theme, and of API, and it was executed beautifully.
  • I didn’t like my submission as much as some (including the judge) did. I wanted some bead physics like Blake Seely had. But I don’t know how to do that and didn’t have time to learn. Oh well.

Sometime in the near future, I’ll release Beads 1.1, with a fix to the drawing code. Then I’ll publish a page on my website showing how to draw the beads.

Report-an-Apple-bug Friday! 21

Friday, April 7th, 2006

This bug is Xcode’s Condensed layout does not have scrollers. It was filed on 2006-04-07 at 23:42 PDT.


Summary:

The Condensed layout for Xcode’s project window does not have scrollers.

Steps to Reproduce:

  1. Choose “Preferences” from the Xcode menu, or press ⌘,.
  2. Switch to the General pane.
  3. Choose the Condensed layout.
  4. Open or create a project.
  5. If necessary, perform some combination of resizing the window and expanding groups and categories so that the total height of the rows of the visible items in the project window exceeds the height of the table view in that window.

Expected Results:

The window has or gains scrollers.

Actual Results:

No scrollers.

Regression:

The Default/Detail view, which is the only layout in all Mac OS X versions of Project Builder and the pre-Condensed versions of Xcode and the default in versions that do have Condensed, does not have this problem.

Notes:

The All-in-One layout does not have this problem either.

The window can be scrolled using a scroll wheel or scroll-capable trackpad, or software such as Catchy Software’s MaxiMice. The window can also be indirectly scrolled by using the arrow keys to select the next item up/down.


Technorati tags: , , .

Report-an-Apple-bug Friday! 20

Friday, April 7th, 2006

This bug is RadarWeb does not uses separate first name from MyInfo. Yes, I know that that statement is incoherent — I don’t know how “does not” got in there. In any case, it was filed on 2006-04-07 at 04:04 PDT.


Summary:

ADC (including RadarWeb) uses the developer’s last name from MyInfo, but uses its own storage for the first name.

Steps to Reproduce:

  1. Go to Apple’s MyInfo page and login.
  2. Change your name.
  3. Go to ADC or RadarWeb and login.

Expected Results:

ADC or RadarWeb greets you as, for example, “Peter Hosey”.

Actual Results:

ADC or RadarWeb greets you as, for example, “Mac-arena Hosey”.

Regression:

None known.

Notes:

I originally signed up for my ADC account under my pseudonym, “Mac-arena the Bored Zo”. When I signed up for iTMS, I noticed in the terms of service that one’s real name is required. So I changed it. ADC only picked up half the change. It seems to use separate storage for the first name, but the same storage for the last name.

iTunes and MyInfo display my first name correctly.


The relevant section of the TOS is section 7. Quoth the TOS:

You agree to provide accurate, current, and complete information required to register with the Service and at other points as may be required in the course of using the Service (“Registration Data”).

And one of the things required is one’s name.

UPDATE 23:19 PDT: At 14:10, an Apple employee replied to the bug report, telling me that he updated my profile to reflect the change. It is, indeed, updated. The bug report is still open, however, and set to the “Verify” state.


Technorati tags: ,

Report-an-Apple-bug Friday! 19

Friday, April 7th, 2006

This bug is Disjoint selections don’t drop where you tell them to. It was filed on 2006-04-07 at 03:28 PDT.


Summary:

When you drop a disjoint multiple selection of songs into a position in a playlist, they will land in the position above the song that you dropped them below.

Steps to Reproduce:

  1. Create a playlist containing songs A, B, C, D, E, F, and G.
  2. Select any of songs CG, so long as at least one of DF is not selected.
  3. Drag and drop the selection above B.

Expected Results:

The songs land between A and B.

Actual Results:

The songs land at the top, above A.

Regression:

All versions 6 and later have this bug. I don’t know if any previous versions have it.

Notes:

Contiguous and single selections are not affected. Dragging a contiguous or single selection in step 3 above will land the song or songs between A and B, as expected.

The direction of the drag (up or down) does not matter. The bug will happen either way.

Workaround:

Drag and drop songs one contiguous bunch at a time, or drop them below song B instead of above it.


Technorati tags: ,

Report-an-Apple-bug Friday! 18

Friday, April 7th, 2006

This bug is Preview uses its own made-up value for resolution of PostScript images. It was filed on 2006-04-07 at 00:45 PDT.

I discovered this bug when making the navigation buttons I donated to Simone Manganelli (you may recognize his1 name if you’ve been reading the comments on this blog) for switching among his stylesheets. The PNG images that I saved from Preview showed up as 32×32 in the Finder. So I had to open the EPS file in Photoshop, which is how I found out that the resolution was wrong.


Summary:

PostScript documents can specify a resolution. Preview, when converting to PDF and then to raster format, ignores that value and uses 150 dpi instead.

Steps to Reproduce:

  1. Open an Encapsulated PostScript (.eps) file containing an explicit resolution in Preview.
  2. Save as PNG or TIFF.
  3. Open the PNG or TIFF in Photoshop. (NOTE: This is incorrect. I meant to change this but forgot. See below. —PRH)
  4. Choose “Image Size”. (NOTE: This is incorrect. I meant to change this but forgot. See below. —PRH)

Expected Results:

The resolution is as stated in the EPS file.

Actual Results:

The resolution is 150 dpi in a TIFF file, or 150.0124 dpi in a PNG.

Regression:

None known.

Notes:

The Document Structuring Conventions, upon which EPS is based, provide for a resolution in the optional “Requirements” comment. For example:

%%Requirements: resolution(x,y)

Preview appears to target a specific length in real-world measurements (inches or cm). Not only does it force the resolution to 150 dpi, it also rasterizes the image at double-size (which compensates for the resolution change, but only in applications that pay attention to the DPI — which are not many, at least in the case of PNG files). This is symptomatic of Preview converting to PDF as an intermediary, as proven by using pstopdf and then saving the PDF as PNG or TIFF — it is still saved as 150 dpi, double-size.

The solution is twofold:

  1. Rasterize at 72 dpi by default. This is the default resolution of PostScript, upon which PDF is based, so it is sane to expect both PDFs and PostScript (including EPS) files to be rasterized at that resolution by default. If you really want the double-size behavior, then the DPI should be saved as 144 dpi instead.
  2. Allow the PS-to-PDF converter to accept a resolution in its PS input.

On 2006-04-07 at 01:48 PDT, I added the following information:

Oops. I meant to change the Steps to Reproduce but forgot. Here are the correct steps:

  1. Open an Encapsulated PostScript (.eps) file containing an explicit resolution in Preview.
  2. Save as PNG or TIFF.
  3. Choose “Get Info” from Preview’s Tools menu, or press ⌘I.

  1. I’m assuming that Simone Manganelli is a he. If not, sorry; no offense intended.

Technorati tags: , , .

Driver training, part 2

Thursday, April 6th, 2006
  • Turning is hard. It’s easy enough in concept, but it’s hard to do a sharp turn that doesn’t cut into any other lanes.
  • I’m not used to the idea of braking gradually.
  • I drive slowly. Defies the stereotype, for sure. The instructor asked me “How old are you?” “21, going on 22.” “You drive like you’re 90. Speed it up.” Keeping the speed of the car below the speed limit, safe for traffic, and above 10 kept me very busy.
  • Mirrors are another thing that keep me busy.

My main problem was that the instructor kept giving me a constant feed of low-level directions: “Apply the brakes, signal, mirrors, look over your shoulder, now gas, let off the gas, turn, brakes, …” When we were done, I suggested to him that he should just tell me what to do (e.g. “Turn right here”) and let me do it. Catch me if I get something wrong, but otherwise, let me do it, and I’ll probably get it right. Otherwise:

  1. I’ll be following him, instead of thinking and acting on my own.
  2. I’m not going to be able to get along when he’s not there.

Lesson 3 of 3 is today. Here’s hoping I don’t need more.

Driver training, part 1

Wednesday, April 5th, 2006

As I remarked to my instructor, “Driving is easy. It’s all the other cars that are the problem.”

Status report after lesson 1 of 3: Turning corners and handling intersections are my current weak points. I’m also not too good about keeping a watch on my rear-view mirror. Other than that, I’m doing well. Especially considering that it was raining the whole time.

I do wish that cars would come with rear-window (including passenger windows) wipers standard. You’re supposed to look out of it before making a right turn at an intersection or pulling away from a curb. But I could barely see anything for all the water drops there. The mirrors were working much better for these purposes.

Two more hours tomorrow.

Free stuff on iTunes: 2006-04-04

Tuesday, April 4th, 2006

Well, there’s supposed to be. This is linked on the front page of the TV Shows section: The Andy Milonakis Show, season 2. The season premiere is supposed to be there for free. But there are no episodes listed and the show isn’t even in the Browse listing of TV Shows. You can even buy the whole season — $1.99 for 0 episodes.

The customer reviews are pretty negative, so maybe MTV got so embarrassed that they simply asked Apple to pull the season.

UPDATE 2006-04-05 00:11 PST: It’s up now.

In case you’re curious, season 1 is available for money. The only way to get there is by clicking the parent segment in the breadcrumb trail when you visit season 2 (or by clicking my link).

Technorati tags: iTunes, iTunes Music Store, iTMS, iTunes Video Store, iTVS, Andy Milonakis, iTVS, MTV.

Report-an-Apple-bug Friday! 17

Saturday, April 1st, 2006

This bug is iTMS: “Isms” is actually “Talisman”. It was submitted on 2006-03-31 at 23:59 PST.


Summary:

iTMS sells two albums by Divinorum. But these two albums are actually both the same one.

Steps to Reproduce:

  1. Buy “Isms” from iTMS.
  2. Listen to all of the tracks.

Expected Results:

You hear “Isms”.

Actual Results:

You hear “Talisman”.

Regression:

As far as I known, “Isms” has always been wrong. I submitted feedback when I bought “Isms” from iTMS in 2005-06. It’s still wrong.

Notes:

Bjorn Lynne distributes a number of his tracks for free, including two Divinorum tracks. One is “Antigravity”, the first track of “Isms”.

Listening to the iTMS previews of “Isms” and “Talisman” makes clear that they are the same. Listen to both “Antigravity” (track 1 of “Isms”) and “The Human Male” (track 1 of “Talisman”), for example.

Another demonstration is the track times. The “Antigravity” MP3 that Lynne distributes for free is 8 minutes and 14 seconds long. The version on iTMS is 7 minutes and 6 seconds long — the same length as “The Human Male”. All of the track lengths are the same between the two albums, except for track 11 (“Talisman” has 11 tracks; “Isms” has only 10 tracks).


Technorati tags: , .

Report-an-Apple-bug Friday! 16

Friday, March 31st, 2006

This feature request is iTunes should offer menu items to sort the selection. It was filed on 2006-03-31 at 23:35 PST.


Summary:

iTunes should allow [the user to specify — oops! —the Bored Zo] the order in which playlist items are stored in the playlist.

Steps to Reproduce:

  1. Right-click on a selection, or click in the Edit menu.
  2. In the ‘Sort by’ submenu, choose one of the criteria listed.

Expected Results:

The selected items are repositioned within the playlist (that is, the order in which they are stored changes).

Actual Results:

No results, because no such submenu exists.

Regression:

None known.

Notes:

iTunes does currently allow the user to change the order in which items are displayed by clicking a column header. But it offers no quick and easy way to sort items within the playlist itself (that is, to change the order in which the items are stored).

When a display sort (one of the column headers besides the far-left one) is selected, iTunes could run a dialog box: “The order in which the selected items are stored in the playlist was changed. The order in which they are displayed and will be played has not changed, because you have a different sort (^0) selected for display (in the column headers).” (^0 = name of selected column).


At 23:45, I added the following information:

Summary should read: iTunes should allow +the user to specify+ the order in which playlist items are stored in the playlist.

I had edited it and didn’t notice that I removed that part. Sorry.


Technorati tags: , .

How to evict __MyCompanyName__ from their office building

Tuesday, March 28th, 2006

UPDATE 2008-07-15: You no longer need to do this as of Xcode 3.1. Make sure you fill out your Address Book. (If you don’t want to use the company name on your Address Book “Me” card, then you do need to follow these instructions.) Thanks to BJ Homer for pointing this out in his comment.

Xcode comes with a number of document templates. You see the list of them when you choose File→New Document in Xcode. The templates are actually stored at /Library/Application Support/Apple/Developer Tools/File Templates. Most files contain a header comment that looks like this:

/*
 *  «FILENAME»
 *  «PROJECTNAME»
 *
 *  Created by «FULLUSERNAME» on «DATE».
 *  Copyright «YEAR» «ORGANIZATIONNAME». All rights reserved.
 *
 */

The problem is ORGANIZATIONNAME. This gets replaced with “__MyCompanyName__”, and there is no obvious way to change this other than by changing it every time (or by editing the templates, a solution that gets clobbered when you upgrade Xcode).

I was reading Step into Xcode, and found that on page 53, it gives instructions for defeating __MyCompanyName__. Here’s the important part, from the book:

defaults write com.apple.xcode PBXCustomTemplateMacroDefinitions '{ ORGANIZATIONNAME = "Joan Smith"; }'

This information is also available on this Xcode release notes page. It’s slightly inaccurate (__CompanyName__ rather than __MyCompanyName__) and well-buried, but it documents the same thing as the book.

Presumably, you could override any macro name or add your own using that default. But ORGANIZATIONNAME is the important one.

I debated about posting this here (publicly, rather than only privately to the Adium and Growl developer lists), because I got the info from the book. But I decided that it’s OK because (1) it is also documented by Apple and (2) it’s an example of the good info in this book. So here it is.

UPDATE 2007-04-07: Markus Magnuson sagely points out that you must relaunch Xcode after making this change. This really applies to any application whose prefs you plan on hand-modifying; Xcode is no exception. Thanks for the reminder. ☺

Free stuff on iTunes: 2006-03-28

Tuesday, March 28th, 2006

As usual, it’s video:

The Conviction pilot costs money now, BTW. But the feelies are still free.

Technorati tags: iTunes, iTunes Music Store, iTMS, iTunes Video Store, iTVS, Battlestar Galactica, Ghost Hunters.

A programming koan

Tuesday, March 28th, 2006

I considered how to rotate a raster image earlier today. Without doing any research into the subject, I wrote down my thoughts on it on a webpage, complete with images drawn in Photoshop. Feel free to answer the open-hanging question in the comments here.

Within epsilon of perfect

Monday, March 27th, 2006

(Title taken from my own assessment of my spelling.)

It’s been known for awhile that rather than directly comparing two floating-point numbers, you should instead subtract the larger from the smaller and compare the difference to some epsilon value. The reason for this is that two numbers might be very very similar, but not exactly equal. “Epsilon” in a mathematical sense means “minimum precision that you care about”. The epsilon value for money, for example, is usually 0.01 — differences lower than this are thrown away.

So of course I went scrounging in the headers, found macros named FLT_EPSILON, DBL_EPSILON, LDBL_EPSILON, and recommended to all my programmer friends that they use these constants for comparisons of floating-point values rather than == and !=.

From time to time, facts just float up to the top of my head for no obvious reason. I have a sheet taped to my wall called “Word of the Day”; when a word pops into my head like this, completely unrelated to any previous thoughts, I write it down on that sheet to look up later. I consider this a more advanced (if slow) form of self-education. They might be long-forgotten memories, or something else; I don’t know, I just write them down and look them up.

About half an hour ago, this happened to me again. Except this time, the thought was definitely a memory, of something I’d read in float.h:

/* The difference between 1 and the least value greater than 1 that is
   representable in the given floating point type, b**1-p.  */

Another thought had bubbled up with this, and it was an epiphany: Technically, this means that the expression x != (x + FOO_EPSILON) should evaluate to 1. In other words, subtracting from FOO_EPSILON isn’t necessary.

So, as is my wont, I wrote a test app. Sure enough, that expression does evaluate to 1.

So forget what I said. x != y is directly equivalent to comparison against FOO_EPSILON, and it’s easier to read, too. So just use that.

Technorati tags: , .

Report-an-Apple-bug Friday! 15

Friday, March 24th, 2006

This bug is Terminal leaves files open when invoking shell directly. It was filed on 2006-03-24 at 23:45 PST.

UPDATE 2006-03-25: Uploaded the test app to GeoCities. Linked below.

UPDATE 2006-08-27: By GeoCities, I now mean boredzo.org. Link updated.


Summary:

When Terminal invokes a specific shell directly, rather than by invoking /usr/bin/login, several files are left open.

Steps to Reproduce:

  1. Launch Terminal.
  2. Terminal menu→Preferences….
  3. Select “Execute this command (specify complete path):”
  4. Specify the complete path.
  5. File menu→New Shell.
  6. Run the attached test app, or run ps and then run lsof with the pid of the shell.

Expected Results:

The test app prints “3”. lsof reports only three file descriptors: 0, 1, and 2, the respective FDs of stdin, stdout, and stderr.

Actual Results:

The test app prints “10”, “11”, “14”, or some other number. lsof reports a lot of open files having to do with Carbon (suggesting that the shell probably did not open them itself).

Regression:

None known.

Notes:

The test program creates and opens a file, and reports the FD it gets back from open. open returns the first FD that was available. In the absence of any other open files, this should be 3 (because that’s the FD after stdin, stdout, and stderr).

When I tested using test-app-free version of the above steps, I did observe that zsh 4.3.1 leaves open one file of its own (the terminal device). Perhaps it opens /dev/tty. This open file is not passed onto subprocesses, however, as is demonstrated by the test app.

Terminal (or Carbon) is responsible for all the other files that Terminal leaves open; this is obvious from the paths of the open files. Maybe login is closing them; in this case, Terminal should do this itself when the user chooses to bypass login.


Technorati tags: , .

Ah-HA!

Friday, March 24th, 2006

I found the problem that was preventing me from uploading things to my site at GeoCities. Turns out it was SurfRabbit, probably deleting some hidden input from the form.

Apologies to them for all the hate I’ve been putting on them lately. Soon I will be uploading the files that have been waiting for the problem to be resolved. This includes the attachments to several Radar reports.

Technorati tags: .