CGContextRef context = ();
//设置起始点
CGContextMoveToPoint (context, 160, 100);
CGContextAddLineToPoint (context, 100, 180);
CGContextAddLineToPoint (context, 160, 180);
// 设置边界
[[UIColor blackColor] setStroke];
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
<!DOCTYPE html> | |
<html lang="zh-CN" class="fullscreen"> | |
<head> | |
<title>flex未知高度垂直居中写法</title> | |
<style> | |
html, | |
body { | |
width: 100%; |
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
// add child view | |
UIViewController* controller = [self.storyboard instantiateViewControllerWithIdentifier:@"test"]; | |
[self addChildViewController:controller]; | |
controller.view.frame = CGRectMake(0, 44, 320, 320); | |
[self.view addSubview:controller.view]; | |
[controller didMoveToParentViewController:self]; | |
// remove child view | |
UIViewController *vc = [self.childViewControllers lastObject]; | |
[vc.view removeFromSuperview]; |
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
<?php | |
error_reporting(0); //抑制所有错误信息 | |
@header("content-Type: text/html; charset=utf-8"); //语言强制 | |
ob_start(); | |
$title = "Yahei-PHP Prober"; | |
$version = "v0.3.5"; //版本号 | |
define('HTTP_HOST', preg_replace('~^www\.~i', '', $_SERVER['HTTP_HOST'])); |
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
1、 三角函数 | |
double sin (double);正弦 | |
double cos (double);余弦 | |
double tan (double);正切 | |
2 、反三角函数 | |
double asin (double); 结果介于[-PI/2, PI/2] | |
double acos (double); 结果介于[0, PI] | |
double atan (double); 反正切(主值), 结果介于[-PI/2, PI/2] | |
double atan2 (double, double); 反正切(整圆值), 结果介于[-PI, PI] | |
3 、双曲三角函数 |
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
#import "UITableView+reloadDataAnimated.h" | |
@implementation UITableView (reloadDataAnimated) | |
- (void)reloadDataWithAnimated:(BOOL)animated | |
{ | |
[self reloadData]; | |
if (animated) { | |
CATransition *animation = [CATransition animation]; |
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
version=`/usr/libexec/PlistBuddy -c "Print CFBundleVersion" $PRODUCT_SETTINGS_PATH` | |
version=`expr $version + 1` | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $version" $PRODUCT_SETTINGS_PATH | |
#/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $version" $PRODUCT_SETTINGS_PATH 这行代码会让version也自增,一般不需要 |
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
/* | |
@Author:thewei | |
@website:http://www.99is.com | |
@title: 异步事件任务队列类 | |
*/ | |
(function(){ | |
TaskQe = function(){ | |
this._arrayFn = []; //事件集合 |
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
// Example usage: Fetch it's own code from GitHub | |
JSONP( 'https://api.github.com/users/erjjones?callback=?', function( response ) { | |
var data = response.data; | |
console.log(data.followers); | |
}); |
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
import urllib.request | |
import asyncio | |
import json | |
r = urllib.request.urlopen('https://raw.githubusercontent.com/spacelan/wechat-emoticon/master/emoticons.json').read().decode('utf8') | |
json_obj = json.loads(r) | |
@asyncio.coroutine | |
def download(todo): | |
urllib.request.urlretrieve(todo.get('url'), todo.get('md5') + '.gif') |
OlderNewer