This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 直接崩溃 | |
int *volatile nptr = 0; | |
int c = *nptr; | |
printf("%d", c); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSDictionary *dict = @{@"modelId":11}; | |
NSString *url = @"http://xxx/api/file/upload"; | |
[manager POST:url parameters:dict constructingBodyWithBlock:^(id<AFMultipartFormData> _Nonnull formData) { | |
[formData appendPartWithFileData:imageData name:@"modelObjUrl" fileName:@"mesh.obj" mimeType:@"application/octet-stream"]; | |
[formData appendPartWithFileData:imageData name:@"modelMtlUrl" fileName:@"mesh.obj.mtl" mimeType:@"application/octet-stream"]; | |
[formData appendPartWithFileData:imageData name:@"modelImageUrl" fileName:@"mesh.png" mimeType:@"application/octet-stream"]; | |
[formData appendPartWithFileData:imageData name:@"modelCropImageUrl" fileName:@"crop.png" mimeType:@"application/octet-stream"]; | |
} progress:^(NSProgress * _Nonnull uploadProgress) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ (instancetype)shareInstance | |
{ | |
static id instance = nil; | |
static dispatch_once_t onceToken; | |
dispatch_once(&onceToken, ^{ | |
instance = [[self alloc] init]; | |
}); | |
return instance; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tensorflow.examples.tutorials.mnist import input_data | |
mnist = input_data.read_data_sets("MNIST_data",one_hot=True) | |
print(mnist.train.images.shape,mnist.train.labels.shape) | |
print(mnist.test.images.shape,mnist.test.labels.shape) | |
print(mnist.validation.images.shape,mnist.validation.labels.shape) | |
import tensorflow as tf | |
sess = tf.InteractiveSession() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Advanced Animations with UIKit | |
video: https://devstreaming-cdn.apple.com/videos/wwdc/2017/230lc4n1loob9/230/230_hd_advanced_animations_with_uikit.mp4?dl=1 | |
pdf: https://devstreaming-cdn.apple.com/videos/wwdc/2017/230lc4n1loob9/230/230_advanced_animations_with_uikit.pdf | |
Advanced Touch Bar | |
video: https://devstreaming-cdn.apple.com/videos/wwdc/2017/222ijxk2akkrebmr/222/222_hd_advanced_touch_bar.mp4?dl=1 | |
pdf: https://devstreaming-cdn.apple.com/videos/wwdc/2017/222ijxk2akkrebmr/222/222_advanced_touch_bar.pdf | |
Advances in TVMLKit | |
video: https://devstreaming-cdn.apple.com/videos/wwdc/2017/202ximbb9e2dq222/202/202_hd_advances_in_tvmlkit.mp4?dl=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// YYDuckObj.h | |
// YYDuckObj | |
// | |
// Created by yauzz on 17/8/13. | |
// Copyright © 2017年 yauzz. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OVERVIEW: LLVM 'Clang' Compiler: http://clang.llvm.org | |
USAGE: clang -cc1 [options] <inputs> | |
OPTIONS: | |
-### Print the commands to run for this compilation | |
--analyze Run the static analyzer | |
--migrate Run the migrator | |
--relocatable-pch Build a relocatable precompiled header | |
--serialize-diagnostics <value> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)displayAsyncLayer:(_ASDisplayLayer *)asyncLayer asynchronously:(BOOL)asynchronously | |
{ | |
ASDisplayNodeAssertMainThread(); | |
ASDN::MutexLocker l(__instanceLock__); | |
if (_hierarchyState & ASHierarchyStateRasterized) { | |
return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 注册Runloop观察者,from YYKit | |
static void YYRunLoopObserverCallBack(CFRunLoopObserverRef observer, CFRunLoopActivity activity, void *info) { | |
if (transactionSet.count == 0) return; | |
NSSet *currentSet = transactionSet; | |
transactionSet = [NSMutableSet new]; | |
[currentSet enumerateObjectsUsingBlock:^(YYTransaction *transaction, BOOL *stop) { | |
#pragma clang diagnostic push | |
#pragma clang diagnostic ignored "-Warc-performSelector-leaks" | |
[transaction.target performSelector:transaction.selector]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
A proxy used to hold a weak object. | |
It can be used to avoid retain cycles, such as the target in NSTimer or CADisplayLink. | |
sample code: | |
@implementation MyView { | |
NSTimer *_timer; | |
} | |
NewerOlder