Archive for March 28, 2013

Thursday, March 28, 2013

appscript on GitHub

Matt Neuburg (via Clark Goble):

Hamish has made it very clear that he isn’t willing to touch this code any further. So it seems obligatory that someone else should put it in a place and form where people can fork it and continue to maintain it. Here it is, then.

There’s no reason in the world, for example, why appscript should stop working just because Hamish insists on using ascr/gdte as a way of fetching an application’s dictionary. There are many other ways to fetch the dictionary that work perfectly well with appscript. The next step, clearly, will be to commit some of those into this repository.

TextEdit 1.8 Source Code

Apple has posted the source for TextEdit, which used to be available as part of the Xcode installer (via Zach Drayer). I miss the days when you could do a local search of all the sample code and documentation. Now, everything is scattered online, where it’s harder to search and subject to removal.

Regular Expression to Match Multiples of 3

Alok Menghrajani (via Nicolas Seriot):

An easier way to solve the problem requires understanding that regular expressions can be written as finite state machines, and vice versa. […] The state machine is going to process the input and keep track of the sum of the digits. We only need the sum modulo 3, so we’ll have a pretty simple state machine with 3 states: state A (starting state), state B (we are off by 1), state C (we are off by 2).

Core Text and Upper Case Numbers

Amy Worrall:

The reason I’m currently looking at number case is because I’m implementing an unread badge in an iOS app. I need to put a number centred in a circle, and our designer has given me the font to use. It turns out the font (Raleway, one of the Google fonts) defaults to lower case numbers, which makes centring them hard.