How I like to code

Tag Archives: MacOS

Building OpenCV as a macOS Universal Intel Binary

So, for my project, I needed an Intel Universal build of the OpenCV library. The copy of the OpenCV source I have on my machine is version 3.0.0 and it has worked well for me, so I’ll start with that. My build machine is running macOS 10.12 and has Xcode 8 installed on it. OpenCV […]

A note about performance

On a multi-core Mac, running 10.8, I ran a test to compare the speed differences of incrementing or decrementing a value with no-locks, atomics and finally, a mutex lock. The no-lock is the baseline, and here is the difference in speed with the later 2 items: Atomics: 3X slower on the same thread Mutex: 7X […]

Spaces, where are you?

I took me long enough to figure out how to do this, but MacLife on has it all spelled out.

Vector drawing programs

Matt Inman made a video where he discussed how he does his illustrations for his website: If you haven’t seen any of this stuff, I would recommend that you only do it while you are home because his site is a big productivity killer. Anyway, it got me very interested in doing illustrations again, […]


This is a little old, but I wanted to share the link any for those looking for CPUID on the MacOS; download-maccpuid/

“Selectively Disable Warnings” with clang

I saw this demo done at WWDC on how to turn off warnings, only when truly warranted, while compiling with clang: #if defined (__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored “-Wunused-value” #endif // defined __clang__ void ImAUselessLittleFunction ( int pleaseUseMe ) { pleaseUseMe; // Nope, you are not going to be used } […]

File managers

For the longest time, the only file manager I used on the Mac was the Finder. I was fine with that and I never thought of needing another program. My co-worker though uses a program named PathFinder by CocoaTech. After seeing it in action, I thought it would be a great tool for organizing my […]

Running AppleScript commands from the

I found some pages on the web on how to run an AppleScript from the terminal, but this seems to be the only one that works in my situation: ?View Code APPLESCRIPTecho ‘tell application "Google Chrome" to quit’ | /usr/bin/osascript In my case, my keyboard stopped working so I wanted to safely shut down the […]

More fun with symbols

I found some very useful environment variables you can set on the application you are debugging when you need to see what symbols are being recorded by dlopen when it opens all of the libraries in your application: click on me, click on me please! So, from your Xcode project, double click your debug app: […]

Symbol visibility in Mac OS libraries

I was having a nice coding day. Xcode was behaving nicely and all of my code seem to behave like I wanted to … then … Crash. Okay. I can handle a crash. But. Looking at the call stack from the crash, something didn’t look right. In the call stack there was a reference to […]