摘要: http://stackoverflow.com/questions/17684170/objective-c-priority-queuePriorityQueue.h//// PriorityQueue.h//#import #import "comparable.h"//Implements a priority queue. All objects in queue must implement the comparable protocol and must be all of the same type. The queue can be explicity t 阅读全文
posted @ 2014-01-22 12:33 翛尧 阅读(386) 评论(0) 推荐(0)
摘要: C = ControlM = Meta = Alt | EscDel = Backspace基本快捷键(Basic)C-x C-f "find"文件, 即在缓冲区打开/新建一个文件C-x C-s 保存文件C-x C-w 使用其他文件名另存为文件C-x C-v 关闭当前缓冲区文件并打开新文件C-x i 在当前光标处插入文件C-x b 新建/切换缓冲区C-x C-b 显示缓冲区列表C-x k 关闭当前缓冲区C-z 挂起emacsC-x C-c 关闭emacs光标移动基本快捷键(Basic Movement)C-f 后一个字符C-b 前一个字符C-p 上一行C-n 下一行M-f 阅读全文
posted @ 2013-11-19 12:17 翛尧 阅读(336) 评论(0) 推荐(0)
摘要: 系统重启 Mac OS X:1shutdown- r now关闭 Mac OS X:1shutdownnow电源管理/省电获取当前电源管理设置的信息1pmset -g设置显示器无活动15分钟后关闭1sudopmset displaysleep 15让计算机在无活动30分钟后休眠1sudopmsetsleep30OS X 外观禁用仪表盘(别忘了将仪表盘 Dock 图标拖动出来)1defaults write com.apple.dashboard mcx-disabled -boolean YES2killall Dock启用仪表盘1defaults write com.apple.dashbo 阅读全文
posted @ 2013-11-13 10:28 翛尧 阅读(1002) 评论(0) 推荐(0)
摘要: 混淆了 python2 里边的 str 和 unicode 数据类型。0.你需要的是让编码用实际编码而不是 ascii1.对需要 str->unicode 的代码,可以在前边写上import sysreload(sys)sys.setdefaultencoding(‘utf8′)把 str 编码由 ascii 改为 utf8 (或 gb18030)2.python3 区分了 unicode str 和 byte arrary,并且默认编码不再是 ascii 阅读全文
posted @ 2013-11-11 16:00 翛尧 阅读(754) 评论(0) 推荐(0)
摘要: http://stackoverflow.com/questions/10277576/google-protocol-buffers-on-ioshttp://stackoverflow.com/questions/8759202/google-protocol-buffers-on-ios-objective-c####build 2.4.1 failed on mac os x 10.9I think the right way to fix it is to modify the message.h like below#ifdef __DECCXX// HP C++'s io 阅读全文
posted @ 2013-11-07 17:42 翛尧 阅读(2856) 评论(0) 推荐(0)
摘要: https://developer.apple.com/library/ios/documentation/General/Conceptual/CocoaTouch64BitGuide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40013501-CH1-SW1Table 1-1Size and alignment of integer data types in OS X and iOSInteger data typeILP32 sizeILP32 alignmentLP64 sizeLP64 alignmentchar1 b 阅读全文
posted @ 2013-10-16 18:15 翛尧 阅读(436) 评论(0) 推荐(0)
摘要: - (void)drawRectFor7{#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_7_0 UIFont *font = [UIFont boldSystemFontOfSize:_fontSize]; NSDictionary *attributes = nil; NSDictionary *strokeAttributes = nil; if (_useLightText) { strokeAttributes = [NSDictionary dictionaryWithObj... 阅读全文
posted @ 2013-10-14 14:14 翛尧 阅读(3111) 评论(0) 推荐(0)
摘要: 原文: http://liyiwen.iteye.com/blog/705489之前 comp.graphic.algorithms 上有一个讨论,是关于怎么样使用曲线对多边形进行插值处理,使得最终产生的曲线是光滑的而且能通过所有的顶点。Gernot Hoffmann 建议说使用著名的 B-Spline 来进行插值。这里有他当时的文章。B-Spline 在这里效果很好,它看起来就像是一个固定在多边形顶点上的橡皮尺(elastic ruler)。 但我有个大胆的推测,我觉得肯定还存在更简单的方法。比如,使用三次贝塞曲线(cubic Bezier)进行近似。贝塞尔曲线有两个固定点(起点和终点),另 阅读全文
posted @ 2013-09-18 10:12 翛尧 阅读(427) 评论(0) 推荐(0)
摘要: 原文:http://www.tanhao.me/pieces/1104.htmlNSLog(NSString *format, ...)+(id)arrayWithObjects:(id)firstObj, ...+(id)dictionaryWithObjectsAndKeys:(id)firstObject , ...需要用到C语言中关于变参的一组宏:va_start,va_arg,va_end函数调用:[self method:@"1",@"2",@"3",nil];像大多数变参函数一样,未尾一定要加上nil,因为这一组宏都没有 阅读全文
posted @ 2013-09-05 15:35 翛尧 阅读(224) 评论(0) 推荐(0)
摘要: 原帖:http://troybrant.net/blog/2010/01/mkmapview-and-zoom-levels-a-visual-guide/So, how exactly does the code provided in the previous post work? What follows is a visual explanation of Google Maps, zoom levels, and how you go about adding support for zoom levels to the MKMapView class.Round to FlatTh 阅读全文
posted @ 2013-08-16 10:27 翛尧 阅读(700) 评论(0) 推荐(0)