HOW TO INSTALL pjreddie/DARKNET ON OSX
- use brew
brew install opencv
- setup opencv.pc to pkgconfig, e.g :
brew install opencv
/// Performs `block` immediately and ignores subsequent calls during the same runloop. | |
#define pspdf_ensureCalledOnlyOncePerRunloop(block) do { \ | |
static const char __onceKey; _pspdf_ensureCalledOnlyOncePerRunloop(self, &__onceKey, block); } while(0) | |
extern void _pspdf_ensureCalledOnlyOncePerRunloop(id self, const void *key, dispatch_block_t block); | |
void _pspdf_ensureCalledOnlyOncePerRunloop(id self, const void *key, dispatch_block_t block) { | |
NSCParameterAssert(block); | |
NSCParameterAssert(self); | |
PSPDFAssertOnMainThread(); // run loop needs the main thread. |
@interface PSPDFWindow () | |
@property (nonatomic, strong) UIViewController *realRootViewController; | |
@end | |
@implementation PSPDFWindow | |
- (void)setHidden:(BOOL)hidden { | |
[super setHidden:hidden]; | |
// Workaround for rdar://19592583 |
This is the code path that changed the status bar orientation on iOS 7: | |
* thread #1: tid = 0x698dbf, 0x00085830 WindowRotationIssue`-[AppDelegate application:willChangeStatusBarOrientation:duration:](self=0x7a041f90, _cmd=0x0137a18d, application=0x79e39cc0, newStatusBarOrientation=UIInterfaceOrientationPortraitUpsideDown, duration=0.80000000000000004) + 96 at AppDelegate.m:23, queue = 'com.apple.main-thread', stop reason = breakpoint 3.1 | |
* frame #0: 0x00085830 WindowRotationIssue`-[AppDelegate application:willChangeStatusBarOrientation:duration:](self=0x7a041f90, _cmd=0x0137a18d, application=0x79e39cc0, newStatusBarOrientation=UIInterfaceOrientationPortraitUpsideDown, duration=0.80000000000000004) + 96 at AppDelegate.m:23 | |
frame #1: 0x00bb6ab5 UIKit`-[UIApplication setStatusBarOrientation:animationParameters:notifySpringBoardAndFence:] + 242 | |
frame #2: 0x00bfa8e4 UIKit`-[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:isRotating:] + 4761 | |
frame #3: 0x00bf9646 UIKit`-[UIWi |
// | |
// Warnings.xcconfig | |
// | |
// The list of warnings we (don’t) use, and the reasons why. | |
// | |
// :MARK: Warnings in use: | |
// :MARK: -everything | |
// We want the best possible diagnostics, so we simply enable everything that exists, and then opt–out of what doesn’t make sense for us. | |
// | |
// :MARK: - Warnings not to be promoted: |
// Playground - noun: a place where people can play | |
import Cocoa | |
var str = "Hello, playground" | |
// Here's take 1. First, I defined the algebra like I would in | |
// Scala, as separate protocols: | |
protocol Semigroup { | |
typealias T |
class F<A> { | |
} | |
protocol Functor { | |
typealias A | |
typealias B | |
typealias FA = F<A> | |
typealias FB = F<B> | |
func fmap(a: FA, fn: (A -> B)) -> FB | |
} |
protocol Monad { | |
typealias F | |
typealias U | |
class func bind<M : Monad where M.U == U>(Self, F -> M) -> M | |
class func `return`(F) -> Self | |
} | |
extension Array : Monad { | |
typealias F = T |
// cc autotes.m -o autotes -framework Foundation -fobjc-arc && ./autotes | |
#import <Foundation/Foundation.h> | |
// use it like lambda(…args…)(…return value…) | |
#define lambda(...) \ | |
^(__VA_ARGS__) _lambda_body | |
#define _lambda_body(...) \ | |
{ return __VA_ARGS__; } |
A number of tech news outlets, including WIRED, GigaOm, and MIT Technology Review, have recently started writing about Multipeer Connectivity ("one weird trick that the NSA hates"). Since the NSHipster article on the subject has been linked to in a lot of this coverage, I wanted to share some additional thoughts on the matter:
Multipeer Connectivity(http://nshipster.com/multipeer-connectivity/) represents a significant shift in the opposite direction of how we conventionally think about mobile applications. Nearly every app on your phone operates in a client-server model, with the device making requests to remote cloud services to send and receive messages, photos, and videos. The [