Xserver
xserver · 共 538 篇文章
float equal
(BOOL)floatA:(float)f1 equalB:(float)f2 { const float EPSINON = 0.00001; if ((f1 > 0.0f && f2 > 0.0f) || (f1 < 0.0f && f2 < 0.0f)) { float x = fabsf(f1) - fabsf(f2); if (x >= -EPSINON && x <= EPSINON) { return YES; } } return NO; } 别用乘法放大为整形比较...本质是不能比较,计算机浮点数精度问题。
2013-05-23 18:21 · C/C++ Primer · Objective-C Primer · 评论(0)
Coding Guidelines for Cocoa
参考: https://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/CodingGuidelines/CodingGuidelines.html http://gracelancy.com/?p=106 http://zh-google-styleguide.readthedocs.org/en/latest/google-objc-styleguide/features/ 命名: 骆驼命名法,首字母小写 空格: Tab键盘:xcode默认4个 a + b; // + - * / , 等符号两边带空格 @in…
2013-05-17 16:53 · Objective-C Primer · 评论(0)
Cell
(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { selectedCellIndexPath = indexPath; withRowAnimation:UITableViewRowAnimationNone]; ; } (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { if(selectedCellIndexPath !…
2013-05-16 14:32 · Objective-C Primer · 评论(0)
Object-C编程规范
1.参考苹果的文档 “Coding Guidelines for Cocoa” http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CodingGuidelines/CodingGuidelines.html%23//apple_ref/doc/uid/10000146-SW1 2.Google的 “Google Objective-C Style Guide” http://google-styleguide.googlecode.com/svn/trunk/objcguide.xml 3.Googl…
2013-05-15 10:49 · Objective-C Primer · 评论(0)
Git ignore of xcode
#OS junk files [tt]humbs.db *.DS_Store *.bak* #Xcode files #This ignores everything inside a *.xcodeproj except the project.pbxproj *.xcodeproj/ !*.xcodeproj/project.pbxproj *.log xcuserdata #Project files [bb]uild/ #Version control files .svn *.orig # built application files *.apk *.ap_ # files fo…
2013-05-14 14:50 · 工具使用 · 评论(0)
Git 教程
书籍Pro Git。 Githug通关攻略 http://lingavin.com/blog/2013/05/03/githug-strategy/ ppt, Good!! PPT http://www.open-open.com/doc/view/28de2c358d284f18af0587bb824a6b10 动画教程 http://pcottle.github.io/learnGitBranching/ 图解 Git http://www.open-open.com/lib/view/open1363565553531.html 快速架设一个简单的基于 SSH 的 Git 服务 htt…
2013-05-08 18:38 · 工具使用 · 评论(0)
webpy_Cookbook
http://webpy.org/cookbook/index.zh-cn URL控制,学习正则 http://webpy.org/cookbook/url_handling.zh-cn 正则: http://www.cnblogs.com/deerchao/archive/2006/08/24/zhengzhe30fengzhongjiaocheng.html 根据模块 制定URL,使之可以剥离 GET 多参数 class index: def GET(self): return "Hello, world!" def GET(self, name): name = 'Bob' retur…
2013-05-06 22:31 · Python Primer · 评论(0)
webpy_CGI 伏笔
http://webpy.org/install.zh-cn 摘: 开发 web.py 内置了web服务器。可以按照 tutorial 学习如何写一个Web应用。 写完后,将你的代码放到 code.py 并如下面的方法来启动服务器: python code.py 打开你的浏览器输入 http://localhost:8080/ 查看页面。 若要制定另外的端口,使用 python code.py 1234。 产品 现在所运行 web.py 程序的web服务器是挺不错的, 但绝大多数网站还是需要更加专业一些的web服务器。web.py 实现了 WSGI 并能在任何兼容它的服务器上运行。 WSGI…
2013-05-06 10:18 · Python Primer · 评论(0)
app PNG
#--- iPIN - iPhone PNG Images Normalizer v1.0 Copyright (C) 2007 Author: Axel E. Brzostowski http://www.axelbrz.com.ar/ axelbrz@gmail.com References: http://iphone.fiveforty.net/wiki/index.php/PNG_Images http://www.libpng.org/pub/png/spec/1.2/PNG-Contents.html This program is free software: you can…
2013-03-22 11:53 · Python Primer · 评论(0)
JS前夜
JS具有脚本、浏览器运行的特性,方便使用。简单的工具应该使用JS+HTML来制作。 <html> <head><meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <title>URL转换</title> </head> <body> <p>用于 <a href="http://goxiazai.cc/"> http://goxiazai.cc/</a> MAC下载无法获取迅雷url的转换</p> 输入URL :</p> <textarea id="urlText" type="text" name="url…
2013-03-21 10:26 · JavaScript Primer · 评论(0)
Hackintosh & tonymacx
全程参考http://t.cn/SxWfsa的指南进行的, 可以参考http://t.cn/zYDiFNe来进行配件的选择。 主板信息毋须更改,仅需变色龙+http://t.cn/zYDiFND的工具即可实现直接驱动起来。 U盘引导: http://notebook.it168.com/a2012/0119/1304/000001304037_1.shtml macdrive Chameleon
2013-03-20 12:19 · 杂事 · 评论(0)
win Ctrl Alt 互换
MAC 重度用户适用 http://hi.baidu.com/pragmatist/item/6bccf15ea9f5f2c9d3e10c38 注册表位置: 如果没有此键,就新建一个 新建一个二进制值的Key,名叫:Scancode Map 输入如下的值: 00,00,00,00 00,00,00,00 03,00,00,00 38,00,1D,00 1D,00,38,00 00,00,00,00
2013-03-20 00:05 · Windows技 · 评论(0)
python__re
xpath解析html,使用正则不好... http://www.cnblogs.com/sevenyuan/archive/2010/12/06/1898075.html re.compile 返回一个正则对象 re.split 分割字符 re.match re.search re.findall 查找全部 \W 匹配任意不是字母,数字,下划线,汉字的字符 \S 匹配任意不是空白符的字符 \D 匹配任意非数字的字符 \B 匹配不是单词开头或结束的位置 匹配除了x以外的任意字符 匹配除了aeiou这几个字母以外的任意字符 http://www.cnblogs.com/deerchao/arc…
2013-03-19 17:49 · Python Primer · 评论(0)
Django
https://docs.djangoproject.com/en/1.5/#django-documentation https://docs.djangoproject.com/en/1.5/topics/ https://docs.djangoproject.com/en/1.5/intro/overview/# 老老实实看文档,快不了。 OMG,发现中文教程,版本<1.5。可以帮助理解 http://code.google.com/p/docs-django-zh-cn/wiki/IntroTutorial02 --编码问题、中文 http://blog.sina.com.cn/s/…
2013-03-03 20:04 · Python Primer · 评论(0)