Convert Greek Unicode to Symbol Font in Microsoft Word on the Mac · 1120 days ago by Andrew Fernandes
As many scientists know, many (most?) online manuscript submission systems are ancient and often require documents to be created with Microsoft Word. A lethal combination! Again, many (if not most) further require DOC formatted files, not DOCX format.
One interesting problem that we’ve recently had was that one journal kept messing up Greek characters in the manuscript. It would replace them with weird symbols. After much messing around, we finally determined that Word was (correctly) inserting Greek letters as Unicode. The online manuscript system simply could not handle the multibyte character encoding, and inserted garbage instead of Greek.
We determined, through a lot of trial and error, that inserting Greek characters as “Insert > Symbol” worked… until a collaborator edited the document on a different machine. Then the Greek characters would become a strange mix of Unicode and Symbol font.
So, playing around with AppleScript, I came up with the following utility. It installs into the “User Scripts” menu item of Word 2008 or later on the Mac. When run, it systematically searches for all Unicode Greek characters and replaces them with their Symbol Font alternatives. It works with both DOC and DOCX files. Windows users are on their own (sorry!).
I’ve included the source file if anyone wants to see how it works. Word 2008 has extensive AppleScript support, it turns out. Most people should probably just download the DMG and run the installer; it contains complete instructions on its use.
- Version 1.0 (10 November 2009)
- Installer: Greek Unicode to Symbol.dmg [48.50kB]
- Test Document: Test Word Document.docx [27.29kB]
- Source Code: Greek Unicode to Symbol.scpt [14.44kB]
- Initial release

An Analytical Framework for Unigenic Evolution · 1208 days ago by Andrew Fernandes
Source code for an R-Project software package that we call “unigenic”. The code has been tested on Mac OS 10.5 and recent versions of Linux-based operating systems, and requires that R ≥ 2.9.1 and a modern Fortran95 compiler be available. For help installing R packages, see Installing Packages on the R web site.
This package is the companion source code for a published at Algorithms for Molecular Biology (DOI:10.1186/1748-7188-5-35).
- Version 1.0 (02 February 2010)
- unigenic_1.0.tar.gz [26.50kB]
- unigenic_example.zip [732.04kB]
- Initial release

Windows 7 and the OEM SLP Master Product Key Slip-Up · 1394 days ago by Andrew Fernandes
By now, most of the hacking community has heard of the massive slip-up made with regard to Windows 7. The OEM SLP Master Product Key was accidentally released online, allowing Windows 7 Ultimate to be easily (and painlessly) permanently illicitly activated.
But was the OEM SLP Master Product Key leak really unplanned? Or at least really that unanticipated?
Think of it this way. How much revenue does Microsoft really stand to lose from this leak, even if they can’t patch or meaningfully revoke illicit activations?
I’m betting not much. Legitimate businesses will still license their software; they can’t afford to be sued for pirating. OEMs will still pay for every copy they ship; if they’re big enough to OEM, they’re big enough for Microsoft to sue.
Who does that leave? the 0.000001% of the population who buy Windows retail. No way they’d pay full price for Windows, so the exorbitant retail price of an “uncrackable” Windows would have them scrambling to OS X, Linux, or FreeBSD.
Of course, now that a simple “crack” is available, they get to continue using Windows. Illicitly, of course, but nobody really cares because every single installation of Windows, be it licit or illicit, continues the Microsoft hegemony.
Which is more likely:
- Microsoft doesn’t “understand chain of custody” or basic “password protection” practices that your bank expects even your grandmother to know, or
- they deliberately cultured an environment that would be highly conducive to an eventual “Windows activation crack” in order to preserve their market
monopolydominance?
Microsoft is a smart company that employs a lot of smart people. I know what I’d bet on!
Well now… The blacklist didn’t take long! I wonder what the next salvo will be…
A conspiracy theorist? Who, me?!

Site-Specific Relative Evolutionary Rates · 1969 days ago by Andrew Fernandes
Given a multiple sequence alignment, a phylogenetic tree, and an evolutionary model, this program calculates site-specific relative evolutionary rates.
A detailed manuscript describing its theory, implementation, and testing has been published in Oxford’s Bioinformatics (PubMed 18662926)
Note: there is a missing sentence in the Methods section of the original version of the article linked above! Silly me, but I accidentally left off a sentence giving the Hastings-ratio of my Metropolis-Hastings Markov chain Monte Carlo procedure to sample the unit-simplex. The correct procedure can be found on the entry I added to wikipedia on performing a random-walk on the simplex.
- Version 35 (16 February 2009)
- bRate-r35.tgz [415.66kB]
- Minor bugfixes in the likelihood engine
- Included a tool to create your own substitution matrices
- Includes all the matrices from PAML 4.2a
- Added a hack to increase numeric stability on long MCMC runs
- Completely verified the likelihood engine against PHYML 3.0
- The only thing we don’t do is tree rearrangements
- I’ll probably still twiddle with the rate-proposal function
- Something is odd about the summarized “expected rate” value. It is correctly calculated (carefully verified) but it gives a surprisingly high and anomalous likelihood. I’ll have to track this down.
- Version 25 (30 January 2009)
- Complete rewrite of the recursive likelihood engine
- Can now start the likelihood calculation from arbitrary tree nodes
- This will be useful later on when we compute probabalistic ancestors
- In the future we will compute marginals at each tree node
- New! We now integrate over all possible branch lengths, making bRate the first system to treat rates and branch lengths as completely identifiable!
- The last line printed upon quitting is the expected rates, branch lengths, and tree, averaged over the appropriate manifold (the geometric mean)
- Switched to CMake for the build system
- Version 19 (26 August 2008)
- Minor bugfixes in the likelihood code
- Version 18.38M (03 January 2008)
- Initial release

My WinSCard "APDU View" Utility · 2564 days ago by Andrew Fernandes
In this article there is no new information; I’m just posting a link to the archive for my Windows APDU-View utility program. It allows you to “spy” on command and data packets being sent to (and received from) a smartcard.
I have not updated it, and I don’t think it works correctly on WinXP-SP2 or later. I’ve linked to it here mainly for archival purposes.

Updating Adobe CS2 on a Mac · 2565 days ago by Andrew Fernandes
Are you a software developer? Do you use OS X? Have you been frustrated by Adobe’s Creative Suite 2 (CS2) failing its updates for GoLive 8.0.1 and Illustrator 12.0.1?
There are many reported reasons for the failure of the update, and Adobe’s latest updaters are relatively bug-free. However, I still could not get my updaters to update!
It turns out that both of these updaters require Apple’s built-in version of Perl. If you’re like me, you probably had Fink’s, DarwinPorts’, or ActiveState’s Perl installed… and none of these will work if they appear in your PATH before Apple’s Perl!
The solution is to download Adobe’s updaters (or look in the download folder as Adobe tries to update itself), and execute them from the command line, making sure that Apple’s ”/usr/bin/perl” is in your PATH before any other Perl!
The reason Adobe’s updaters fail is that they use the first version of Perl found in the system path, which may or may not be Apple’s system Perl. Unfortunately, there are a couple of Apple-Perl-specific modules that that Adobe’s updaters require, packages not provided by any other Perl distribution.
Thanks to Apple’s ktrace for helping figure this out!

Gaussian Quadrature Formulae for Arbitrary Positive Measures · 2565 days ago by Andrew Fernandes
Abstract
We present computational methods and subroutines to compute Gaussian quadrature integration formulas for arbitrary positive measures. For expensive integrands that can be factored into well-known forms, Gaussian quadrature schemes allow for efficient evaluation of high-accuracy and -precision numerical integrals, especially compared to general ad hoc schemes. In addition, for certain well-known density measures (the normal, gamma, log-normal, Student’s t, inverse-gamma, beta, and Fisher’s F) we present exact formulae for computing the respective quadrature scheme.
Availability
Source code is freely available online as a C-linkable ISO C++ library under a BSD-style license from fernandes.org. The library may be built using single, double, or extended precision arithmetic.
Publication
Please cite:
Fernandes, A. D. and Atchley, W. R. (2006) Gaussian Quadrature Formulae for Arbitrary Positive Measures Evolutionary Bioinformatics Online 2: 261–269. [PDF]
Download
- Version 1.1 (30 August 2006)
- GaussQR-1.1.zip [1.02MB]
- Types renamed to be more c++ friendly
- Includes universal Mac binaries (xCode 2.4)
- Version 1.0 (11 November 2005)
- GaussQR-1.0.zip [45.77kB]
- Initial release

FFTPACK Translated to Pure ISO C/C++ · 2565 days ago by Andrew Fernandes
I have translated FFTPACK into Pure ISO C/C++, and made some nice additions.
- The original FFTPACK aliased integers and real numbers; I removed the aliasing.
- The original code was cleaned up significantly. Also, internal functions are all static, and return-types are consistent.
- Now single, double, and long-double (as well as arbitrary precision) computations are supported.
The distribution contains the cleaned Fortran, the ready-to-compile C and C++ code, documentation, tests, and annotated changes.
Download
- Version 1.1 (30 August 2006)
- fftpack-1.1.zip [44.02kB]
- Types renamed to be more C++ friendly
- Version 1.0 (11 November 2005)
- fftpack-1.0.zip [42.63kB]
- Initial release

