How to interface with a Stream Deck device.
The device uses the HID protocol to communicate with its software.
// example of how to move a current value towards a target value at a constant speed | |
// without going over the target value | |
// formula is the same for vectors of any dimension | |
Vector3 Seek(Vector3 currentValue, Vector3 targetValue, float maxSpeed, float dt) | |
{ | |
// delta/difference from current value to target value | |
Vector3 delta = targetValue - currentValue; | |
// don't take the square root of magnitude yet | |
// so we can potentially early out on degenerate case of currenvValue ~= targetValue |
diff --git a/builddefs/common_features.mk b/builddefs/common_features.mk | |
index 18f8b0bbfc..4ef3e230e4 100644 | |
--- a/builddefs/common_features.mk | |
+++ b/builddefs/common_features.mk | |
@@ -878,6 +878,10 @@ ifeq ($(strip $(JOYSTICK_ENABLE)), yes) | |
endif | |
endif | |
+ifeq ($(strip $(APPLE_FN_ENABLE)), yes) | |
+ OPT_DEFS += -DAPPLE_FN_ENABLE |
The libdispatch is one of the most misused API due to the way it was presented to us when it was introduced and for many years after that, and due to the confusing documentation and API. This page is a compilation of important things to know if you're going to use this library. Many references are available at the end of this document pointing to comments from Apple's very own libdispatch maintainer (Pierre Habouzit).
My take-aways are:
You should create very few, long-lived, well-defined queues. These queues should be seen as execution contexts in your program (gui, background work, ...) that benefit from executing in parallel. An important thing to note is that if these queues are all active at once, you will get as many threads running. In most apps, you probably do not need to create more than 3 or 4 queues.
Go serial first, and as you find performance bottle necks, measure why, and if concurrency helps, apply with care, always validating under system pressure. Reuse
import UIKit | |
import AVFoundation | |
class ViewController: UIViewController, AVSpeechSynthesizerDelegate { | |
let synth = AVSpeechSynthesizer() | |
let avsesh = AVAudioSession.sharedInstance() | |
let voice = AVSpeechSynthesisVoice(language: "en-GB") | |
let avopts:AVAudioSessionCategoryOptions = [ | |
.MixWithOthers, | |
.DuckOthers, |
#import "UWFacebookService.h" | |
@implementation UWFacebookService | |
// Static | |
static const int ddLogLevel = LOG_LEVEL_DEBUG; | |
// Strong | |
@synthesize facebookGraphUser = _facebookGraphUser; |
/* ---------------------------------------------------------- */ | |
/* */ | |
/* A media query that captures: */ | |
/* */ | |
/* - Retina iOS devices */ | |
/* - Retina Macs running Safari */ | |
/* - High DPI Windows PCs running IE 8 and above */ | |
/* - Low DPI Windows PCs running IE, zoomed in */ | |
/* - Low DPI Windows PCs and Macs running Firefox, zoomed in */ | |
/* - Android hdpi devices and above */ |
// | |
// NSDictionary+NSNullUtility.h | |
// | |
// | |
// Created by Pablo Heredia on 12-07-12. | |
// Copyright (c) 2012. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
OPTIONS = metaclass.m -o metaclass -std=c99 -framework Foundation -arch x86_64 -Os | |
isa: | |
clang -DUSE_ISA=1 $(OPTIONS) | |
./metaclass | |
object_getClass: | |
clang -DUSE_ISA=0 $(OPTIONS) | |
./metaclass |