Blog

Xcode: Per-Architecture SDK

I just crossed the website for SystemVersionCheck, an application boot-strapper that checks the Mac OS version before launching. It is meant to be used by application developers to warn of insuffisent system version prior launching, as a solution to the LSMinimumSystemVersion plist key which isn’t well supported by earlier version of Mac OS X. I have noting to say about SystemVersionCheck really, only about something I do not agree in the conclusion of its presentation page.

The SystemVersionCheck page concludes:

Developers should choose to be in one of the following categories:

A. Use gcc 4.0 and build Universal Binaries. Support 10.3.9 and later. (Easy)

B. Use gcc 3.3. Support 10.2 and later. (Easy)

C. Flex your Xcode muscles and build an application that runs everywhere. (Harder)

Now, if I say that the latest version of Gamma Control, Black Light, and Sim Daltonism were all compiled with GCC 4 and that they work on Mac OS X 10.2.8 and that they are universal binaries, what would you say? You might think: “C. … (Harder)”. But in reality it’s pretty simple, you just need to know the trick.

The trick: I use the Mac OS X 10.2.8 SDK as my target SDK, then add a SDKROOT_i386 key with value /Developer/SDKs/MacOSX10.4u.sdk as a custom setting to the target or to the whole project. Intel-GCC will now use the universal 10.4 SDK while PowerPC-GCC will use the 10.2.8 SDK. All this with GCC 4.

I found that trick late last year somewhere on the internet, maybe in an Apple mailing list archive — I really don’t remember. And it has been working pretty well for me since.


September 1752

This particular month has something special. If you type cal 9 1752 on any Unix command line to get a calendar of this particular month you’ll get this output:

   September 1752
 S  M Tu  W Th  F  S
       1  2 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30

Not a typical calendar by any means! Where have gone the days between September 2 and 14? Answer: September 1752 is the month Britain switched from the Julian calendar to the Gregorian calendar.

This means that dates prior September 1752 should be calculated according to the Junian calendar right? This is where it gets confusing: not all countries have switched at the same time.

So when you have an old date, you should make sure you know which calendar to use before doing any calculation with it.

(via email from Henri Sivonen on WhatWG mailing list)


Tricked Deck

I read the presentation page for The Deck today. As described, The Deck is a closed advertising network which is picky about its members and the ads it serve. And I have to say I like their concept. There is one claim in the description I find dubious however. Under “Cost Per Influence” they write:

Plus, The Deck ads are not redirected and the average page rank of the eight Deck sites is 7.125 which can make a significant difference in an advertiser’s search rankings during and well after a campaign is complete.

The theory behind this is that when a website ranks high in search engines, it helps to increase the ranking of the websites it links to. So if an important website were to feature an ad which links somewhere, that somewhere could make some gain in search engine rankings.

But I’m pretty sure it won’t work in case of The Deck simply because of this:

<script type="text/javascript" 
        src="http://www.northmay.com/deck/deckd_js.php"></script>

Whatever the page rank of their site, if they place their ads on the pages using JavaScript (and all sites on the network do), there is no sane way a search engine is going to even notice there is a link.

Well, maybe that’s not what they meant by “can make a significant difference in an advertiser’s search rankings”, maybe they are talking about the non-JavaScript link in the “About The Ads” section of their page for The Deck. But the inclusion of their average page rank seems pretty much misleading if thats the case.


And so appeared SmartyPants Typographer

Somewhat as an imitation of what I’ve done with PHP Markdown Extra, today I unveil a special extension of PHP SmartyPants which adds customizable quote characters and automatic conversion of spaces into unbreakable spaces where appropriate, avoiding undesirable line breaks. Let me present you SmartyPants Typographer and its little story.

In French it is usual to have a space before some punctuation marks, like the colon “ :” and inside « guillemets ». It is also common to have a space before other punctuation like the exclamation and question marks. The problem is that people don’t know, or understand, what an unbreakable space is. It looks the same as a normal space and unless someone sees his colon fall on the next line he won’t realize something is wrong. That is, until the browser rewrap the text to fit the page.

Typographer, as a project, began some years ago when I wanted to avoid such kind of bad line breaks on my website. A little while after porting John’s Gruber’s SmartyPants to PHP, which became PHP SmartyPants, I started a SmartyPants-like project called Cosmos which was all about space, about making the space character smarter. And thus I built regular expressions that would change spaces with “smart” ones around punctuation, inside numbers when the space is used as a thousand separator (as in many parts of the world) and around common unit symbols (like kg, °C, Kb).

I also added a way to force the space to be added where there was none. The idea was to use the script to enforce spacing typographic rules, especially French typographic rules. But since there is not set of rules in French that would please everyone I was forced to add a configuration for each of the characters.

Cosmos was integrated into my website rapidly, as easily as PHP SmartyPants and PHP Markdown are, and I have been ready since that time to ship it as a separate stript that would have worked in WordPress and as a Smarty text modifier, just like PHP SmartyPants. There was only one problems: I wanted to have a suitable-for-everyone default configuration. Another downside was that it added an extra parsing layer of HTML tokenization over SmartyPants, not a show stopper, but still something I wasn’t happy with.

Cosmos stagnated for a year or two in that almost-ready state. Then, in october 2005 came a discussion on the Markdown mailing list that made me think. This particular discussion was about adding support for new types of quotes in SmartyPants. I came with the conclusion that for SmartyPants to support almost any kind of quote used in western languages, it needed only a small additions.

All this interested me much. It also came to my mind that I could integrate Cosmos in that new international version of SmartyPants. When I suggested the idea to the list, John Gruber answered this:

Could be a good addition. More or less fits as a SmartyPants feature if you think of SmartyPants as a system for controlling all things related to web typography and layout, not just punctuation.

(Emphasis mine)

This became my source of inspiration for the new name: SmartyPants Typographer.

In the middle of May, I finally decided I’d make an object-oriented version of PHP Markdown. The idea was to be able to use both PHP Markdown and PHP Markdown Extra inside one PHP script, something I’ll need in a near future. I did the same too with PHP SmartyPants with the more secretive goal of creating Typographer. Writing it as an extension to an object-oriented SmartyPants makes multiple spacing configurations possible within the same PHP script by creating multiple parser objects.

So I created Typographer based on the object-oriented PHP SmartyPants I made. Then I decided it needed some more real-world testing. Cosmos was running on my website for ages, but only for what I wrote as a way to enforce my custom spacing rules around French punctuation. So I asked Rémi Prévost for some help: I wanted him to install Typographer on his WordPress-based French weblog. He agreed, and I begun to track how it converted spaces in the comment he received. I’d be surprised anyone commenting there noticed anything, but by looking at the source I could check that the unbreakable spaces were placed correctly. The conclusion is that beside two minor bugs, everything seems perfect. Thank you Rémi for the testing.

The bugs are now corrected. Now that I’m satisfied of the result, now that it has been tested and I know it works well, I’m releasing it as PHP SmartyPants Typographer, which you can download from the PHP SmartyPants main page. And the PHP Markdown Dingus has been updated so you can test-drive Typographer.

Typographer, in its default configuration, doesn’t add or remove any space to your text; it will only make spaces unbreakable where appropriate, so it should be suitable for any language, any spacing-style, and should be pretty unnoticeable, except for the absence of some ugly line breaks when people add space around their punctuation.



  • © 2003–2025 Michel Fortin.