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
#!/usr/bin/env python | |
"""Simple HTTP Server With Upload. | |
This module builds on BaseHTTPServer by implementing the standard GET | |
and HEAD requests in a fairly straightforward manner. | |
""" |
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
#! /usr/bin/env bash | |
dir=$1 | |
if [ -z "$dir" ]; then | |
echo "输入参数有误!" | |
exit | |
else | |
echo "正在处理$dir" | |
fi |
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
#! /bin/sh | |
# 获得输入的jar文件 | |
JAR_FILE=$1; | |
# 这里直接使用dx命令,是因为我已经提前配置好了环境变量,dx目录位于: | |
# $ANDROID_HOME/sdk/build-tools/android-4.3.1/dx | |
dx --dex --verbose --no-strict --output=temp.dex $JAR_FILE > /dev/null | |
# 计算jar包中的方法数 |
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
@interface SREAGLContext : NSObject | |
+ (EAGLContext*)sharedContext; | |
+ (EAGLContext*)newContext: (EAGLRenderingAPI) api; | |
@end | |
@implementation SREAGLContext |
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
+ (CVPixelBufferRef)pixelBufferFromImage:(UIImage *)image { | |
NSData * rawImageData = [UIImage RawRepresentation:image pixelFormat:SVPixelFormat_BGRA]; | |
NSDictionary * attributes = @{ | |
(NSString *)kCVPixelBufferIOSurfacePropertiesKey : @{}, | |
(NSString *)kCVPixelBufferCGImageCompatibilityKey : @(YES), | |
(NSString *)kCVPixelBufferOpenGLESCompatibilityKey : @(YES), | |
(NSString *)kCVPixelBufferCGBitmapContextCompatibilityKey : @(YES), | |
}; | |
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
CVPixelBufferRef pxbuffer = NULL; | |
CVPixelBufferCreateWithBytes(kCFAllocatorDefault,width,height,kCVPixelFormatType_32ARGB,data,4 * width, NULL, NULL, NULL, &pxbuffer); | |
CIImage* tmpImage = [CIImage imageWithCVPixelBuffer:pxbuffer]; | |
UIImage* newImage = [UIImage imageWithCIImage:tmpImage]; | |
NSLog(@"imageSize:%@",NSStringFromCGSize(newImage.size)); | |
dispatch_async(dispatch_get_main_queue(), ^{ | |
imageView.image = newImage; |