Skip to content

Instantly share code, notes, and snippets.

@zvving
zvving / CLLocation+Sino.h
Last active January 9, 2019 02:39
火星坐标系转换扩展。Earth(国外 WGS84), mars(国内 GCJ-02), bearPaw(百度 BD-09) 坐标系间相互转换
//
// CLLocation+Sino.h
//
// Created by i0xbean@gmail.com on 13-4-26.
// 火星坐标系转换扩展
//
// earth(国外 WGS84), mars(国内 GCJ-02), bearPaw(百度 BD-09) 坐标系间相互转换
// 未包含 mars2earth. 需要这个可参考 http://xcodev.com/131.html
#import <CoreLocation/CoreLocation.h>
@flypiggy
flypiggy / test.sml
Created January 24, 2013 01:10
change the assignment name then "$sml test.sml" to make test
use "assignment1.sml";
(* assert for test *)
fun assert (e: bool, message: string) =
let val prefix = "Testing [" ^ message ^ "]"
in if e then print( prefix ^ "----PASS\n")
else print(prefix ^ "----FAIL\n")
end
(* factroies for Q1-Q5 *)
@xxd
xxd / fileControl.h
Created May 13, 2012 13:51
Read,Write,List files in sandbox
// 把 图片 写入 沙盒
-(void)photoFile {
//此处首先指定了图片存取路径(默认写到应用程序沙盒 中)
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES);
//并给文件起个文件名
NSString *uniquePath=[[paths objectAtIndex:0] stringByAppendingPathComponent:@"pin"];
BOOL blHave=[[NSFileManager defaultManager] fileExistsAtPath:uniquePath];
if (blHave) {