Archive for the ‘Apple’ Category

Sub-pixel rendering in Mac OS X

Wednesday, May 5th, 2010

In OS X Snow Leopard, Apple changed the Appearances preferences so that you could either enable sub-pixel rendering (”font smoothing”) when available (i.e. if it detects that you are using an LCD monitor), or completely disable it. However, it can be a bit buggy, and often incorrectly recognises your LCD monitor as a CRT, thereby disabling sub-pixel rendering for fonts in newly started applications. Aside from the fact that it makes one’s eyes bleed, it’s also extremely irritating when half of your applications have sub-pixel rendering enabled – and the other half don’t. Let me give you an example:

With sub-pixel rendering enabled

Without sub-pixel rendering enabled

Without sub-pixel rendering enabled

Not nice. Fortunately the fix isn’t too hard; a single command in Terminal:

defaults -currentHost write -globalDomain AppleFontSmoothing -int 2

This command simply tells OS X to always use medium sub-pixel rendering, whether or not it thinks it is available. It’s fairly safe to just “set and forget”, as people very rarely use CRTs. Hopefully Apple will fix this bug properly, however, and this hack will no longer be needed.

Issues with C++ strings in OS X’s standard library

Monday, February 22nd, 2010

It seems that someone at Apple has turned on _GLIBCXX_FULLY_DYNAMIC_STRING in such a way that it is breaking _GLIBCXX_DEBUG builds. This means that (with some Xcode/GCC/OS X versions) if you try to use strings from the C++ standard library without enabling the _GLIBXX_FULLY_DYNAMIC_STRING preprocessor macro, your debug builds will have a runtime error similar to the following:

malloc: * error for object 0x10000a720: pointer being freed was
    not allocated * set a breakpoint in malloc_error_break to debug

In order to solve this issue from Xcode, you need to modify your build target information. Double-click your build target from the ‘Targets’ drop-down list in the left-hand column, navigate to the build tab, then scroll down to the ‘GCC – Preprocessing’ area, and enable fully dynamic strings by adding a new macro to the ‘Preprocessor Macros’ list: _GLIBCXX_FULLY_DYNAMIC_STRING=1

Feel free to leave a comment if you have any extra information on the issue (including fixes in newer versions/etc/etc).

References:
http://stackoverflow.com/questions/2234557/c-using-stdgetline-prints-pointer-being-freed-was-not-allocated
http://lists.apple.com/archives/cocoa-dev/2009/Sep/msg01199.html

I got a Mac!

Friday, January 8th, 2010

I, uuh… successfully broke my ThinkPad T61 the other day. Still not quite sure how I managed that! But the hinge just completely snapped, and I broke the LCD further whilst attempting to take the LCD bezel off.

So I was computerless! Well, not quite computerless, but working on the ThinkPad became a bit iffy. Two “fixes” were investigated: purchasing a temporary laptop whilst getting the T61 fixed; buying a new laptop to replace the T61 completely.

The first option – to buy a new laptop to use whilst getting the T61 repaired was thrown out of the window quite quickly. To the get the entire LCD assembly replaced on my T61 would have been prohibitively expensive, excaberated by two factors. a) I’d have to purchase a temporary laptop as well; b) I originally purchased the T61 with a high-resolution (1400×1050) LCD, which I had grown rather fond of. In addition to those two factors, I had also been planning on upgrading to a Mac in the relatively near future.

So we decided to go for the upgrade route! I put in order for a 13″ MacBook Pro, which arrived yesterday morning. After fiddling around with things for most of the day (or possibly more accurately: working out what various buttons did), I finally had it set up how I liked it. I can definitely say that the move to Apple/OS X was a good one, and I’m thoroughly enjoying it.

As can be expected from moving to a different operating system (and possibly even a different way of thinking), my “working environment” has had to be adjusted. I didn’t really like OS X’s Spaces (even though I was a huge fan of multiple desktops in Linux), and this has led me to only keeping open the applications which I’m actively using open. In the past, I’d have web/email on one desktop, IM on another desktop and code on my third desktop. However, I’d keep switching to IM/web/email whilst coding – not very productive! Using OS X has encouraged me to only open what I need to complete a particular task – so if I’m programming, I’ll have Eclipse or TextMate open, and only open Safari if I need to quickly look something up. That’s it. It has resulted in huge productivity gains – I’m not quite sure why I didn’t work this out before!

On another note, I’ve become a huge fan of TextMate and Tweetie. Now, when I was using Linux, I would never have even considered forking out some of my *ahem* hard-earned money for a program. Ever. If I was using Microsoft Windows I would either use an Open Source application which had been ported to Windows, or (I’m sorry to say) I would pirate it. Now I’m perfectly willing to pay for software, and plan to do so for TextMate and Tweetie as soon as I can. They are both amazing pieces of software, and I’d strongly recommend them to any OS X users. I’m also using MarsEdit to write this blog post, but I currently blog so infrequently that I’m not sure I’d be willing to purchase it. Perhaps if it encourages me to blog more, I’ll look into paying for a full version.

Olympus E-P1 and my next computer.

Friday, June 19th, 2009

The Olympus E-P1 looks absolutely stunning. It’s highly likely that I’ll be buying one of those come September.

The E-P1 does away with the mirror box of D-SLRs, whilst retaining a large Micro Four Thirds sized sensor, which results in a camera which isn’t really an SLR, but produces high quality images akin to those typical of D-SLRs. It seems to be an ideal camera for street photography – the silver model isn’t overly obtrusive, and coupled with the 17mm lens and optical viewfinder (fitted onto the hot-shoe), makes for a compact camera capable of taking high-quality images whilst still being small enough to not be highly noticeable. It is quite expensive, at £749.99 for the kit including the 17mm lens and optical viewfinder, but I feel that it is well worth it, and there won’t be many (if any) running costs involved – no film to develop and scan. As well as this, Olympus will be producing an adaptor which will allow me to use my OM lenses from my OM-2n on the E-P1, which is a great benefit. I will be waiting until reviews are available on the camera before making a final decision, but I’m almost certain that it is the camera for me.

I have also been looking into the 13″ MacBook Pro, and believe that come September, I will have enough money to purchase a model. I’m willing to accept the lower resolution of the 13″ model due to the extra portability offered, especially as I am also planning to purchase the 24″ Apple Cinema Display to go with it, which runs at 1920×1200. An expensive investment, but well worth it I feel. The MacBook Pro comes with an SDHC card-reader, which will be extremely useful when coupled with the aforementioned Olympus E-P1, which also uses SDHC cards – that’s one less cable for me to worry about! It is highly likely that I will purchase Aperture with the MacBook, and use that for photo management. I’ve looked into Lightroom as well, but it seems from reviews that Aperture is more suited to my needs. Furthermore, Macs provide an ideal environment for doing development work in, especially as they are Unix-based, and thus have a half-decent shell available to users. I’ll most likely be using Eclipse for Java programming, and I’ll possibly be doing some Qt development on Macs as well, but we shall see.