Wednesday 26 February 2014

In XCode 5, turn on 80-column line guide

Problem:

I am using XCode 5 and the coding style guide that I am using requires avoiding lines going past the 80-column mark, if possible.

How do I turn on the 80-column guide?

Solution:

  1. Go to the XCode Preferences (in the menu: XCode -> Preferences...)
  2. Go to the Text Editing tab
  3. Check "Page guide at column: "
  4. Change the number to 80, or to whatever column your required style guide needs

Friday 21 February 2014

Toggle Doxygen in Eclipse Kepler CDT C/C++ Editor

Problem:

I'm working on C/C++ in Eclipse Kepler and I would like to toggle the IDE editor's Doxygen comment helpers as they appear to be turned off by default. How do I do this?

Solution:

To toggle the "automatically generate Doxygen comment" feature in Eclipse, go to:

Preferences ... -> C/C++ -> Editor

Then look for the panel labeled Documentation tool comments and change Workspace default to "None" or "Doxygen", depending on your preference.

This is illustrated in the following image:

Notes:

If you are unsure of what Doxygen is, check out this quick explanation from Wikipedia (as of Feb 21, 2014):

Doxygen is a documentation generator, a tool for writing software reference documentation. The documentation is written within code, and is thus relatively easy to keep up to date. Doxygen can cross reference documentation and code, so that the reader of a document can easily refer to the actual code.
Article link: http://en.wikipedia.org/wiki/Doxygen. It's a fairly useful tool and you should consider using it if you don't already have a consistent style for writing comments in C++ code.

References:

Monday 3 February 2014

How to detect displays in OS X 10.9 Mavericks

Problem:

How do I detect displays in OS X Mavericks? The Systems Preferences option to detect displays seems to be missing.

Solution:

While in the "Displays" Systems Preferences panel, press the "option" key and the "Detect Displays" button will appear when using OS X Mavericks.

Image below: OS X 10.9 Displays panel with the "Detect Display" button missing by default

Image below: OS X 10.9 Displays panel after pressing the "Option" key

Notes:

This was tested to work in OS X 10.9 and 10.9.1. Your mileage may vary in other versions.

References: