<commit_before># Cinder-AppNap
`Cinder-AppNap` is a [CinderBlock](http://libcinder.org/) to access the Activity APIs introduced in OS X 10.9 that tie into [App Nap](http://www.apple.com/osx/advanced-technologies/).

### EXAMPLE
```C++
void VisionApp::setup() {
    PerformActivity("Preprocess images", [this](void) {
        auto handle = std::async([this](void) {
            preprocessImages();
        });
        handle.wait();
    });
}
```

Longer-running operations can use a more explicit form
```C++
void CaptureApp::setup() {
    mActivity = Activity::create("OSC I/O and maintain camera control");
    mActivity->begin();
}

void CaptureApp::shutdown() {
    mActivity->end();
}
```<commit_msg>add more detail on the activity API interaction<commit_after># Cinder-AppNap
`Cinder-AppNap` is a [CinderBlock](http://libcinder.org/) to access the Activity APIs introduced in OS X 10.9.

OS X 10.9 uses heuristics to improve system battery life, performance and responsiveness and governs the resources made available to applications and their behavior to achieve this. At times the system behavior isn't desirable and `Cinder-AppNap` can be used to hint an exceptional need. Doing so can obviously negatively affect the battery life, performance and responsiveness of the system as a whole, so one should *be critical of its use and disciplined in minimizing its use to a narrow scope*.

While the CinderBlock is (perhaps poorly) named `Cinder-AppNap`, an application can provide hints that affect other behaviors like timer coalescing and the application termination. `Cinder-AppNap` currently disables idle system sleep and sudden termination which is hopefully a fit for most Cinder application needs, but could certainly be made more flexible should the need arise.

### EXAMPLE
```C++
void VisionApp::setup() {
    PerformActivity("Preprocess images", [this](void) {
        auto handle = std::async([this](void) {
            preprocessImages();
        });
        handle.wait();
    });
}
```

Long-running operations can use a more explicit form:
```C++
void CaptureApp::setup() {
    mActivity = Activity::create("Maintain camera control");
    mActivity->begin();
}

void CaptureApp::shutdown() {
    mActivity->end();
}
```
{'fraction_non_alphanumeric': 0.11239964317573595, 'fraction_numerical': 0.004014272970561998, 'mean_word_length': 4.168202764976958, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1903352', 'n_tokens_mistral': 635, 'n_tokens_neox': 601, 'n_words': 243}