十三郎的IT生活

 

2014年3月12日

iOS的 BOOL bool Boolean boolean_t区别

@import url(http://www.cnitblog.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);

1.
BOOL typedef signed char BOOL;

YES #define YES (BOOL)1
NO #define NO  (BOOL)0

BOOL 使用了一个8 位(一个字节)的整数进行表示,8 位全0 就是NO。
2^8 = 512
 8960 用二进制表示是大于8 位的,也就是说高位无效,
只保留8960 的低八位,8960 的低八位恰好全都是0,因此8960 就是NO 了
因此在Objective-C中一定要注意这个问题,非零值未必是BOOL 的YES,但是0 一定是NO。


2.
bool    c语言 int
Defined in stdbool.h, ISO C/C++ standard type
true     非0
false   0


3.
Boolean unsigned char type
Mac OS historic type, sizeof(Boolean)==1


4.
boolean_t  int type

#ifndef _MACH_I386_BOOLEAN_H_
#define _MACH_I386_BOOLEAN_H_

#if defined(__x86_64__) && !defined(KERNEL)
typedef unsigned int boolean_t;
#else
typedef int boolean_t;
#endif

#endif /* _MACH_I386_BOOLEAN_H_ */

posted @ 2014-03-12 21:04 十三郎 阅读(1214) | 评论 (0)编辑 收藏

2013年10月22日

Installing ffmpeg ios libraries armv7, armv7s, i386 and universal on Mac with 10.8

FFmpeg Build Instructions MAC 10.8 or better

Copy ffmpeg-2.0.tar.bz2 (https://ffmpeg.org/releases/ffmpeg-1.0.7.tar.bz2,https://ffmpeg.org/download.html) and Unzip to Documents folder

Install gas-preprocessor

  1. Click on the ZIP icon to download https://github.com/mansr/gas-preprocessor.
  2. Copy gas-preprocessor.pl to /usr/bin directory.
  3. Change permission of gas-preprocessor.pl by setting the privilege to Read & Write for all.

 

open terminal and paste in following command and press enter:

export DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer/"

cd to ffmpeg-2 folder and paste in following command and press enter:

mkdir armv7
mkdir armv7s
mkdir i386
mkdir -p universal/lib

 

./configure --prefix=armv7 --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --enable-avresample --enable-cross-compile --sysroot="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk" --target-os=darwin --cc="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc" --extra-cflags="-arch armv7 -mfpu=neon -miphoneos-version-min=6.1" --extra-ldflags="-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -miphoneos-version-min=6.1" --arch=arm --cpu=cortex-a9 --enable-pic

make clean && make && make install

 


./configure --prefix=armv7s --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --enable-avresample --enable-cross-compile --sysroot="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk" --target-os=darwin --cc="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc" --extra-cflags="-arch armv7s -mfpu=neon -miphoneos-version-min=6.1" --extra-ldflags="-arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -miphoneos-version-min=6.1" --arch=arm --cpu=cortex-a9 --enable-pic

make clean && make && make install

 


./configure --prefix=i386 --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --enable-avresample --enable-cross-compile --sysroot="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk" --target-os=darwin --cc="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc" --extra-cflags="-arch i386" --extra-ldflags="-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk -miphoneos-version-min=6.1" --arch=i386 --cpu=i386 --enable-pic --disable-asm

make clean && make && make install


To make universal library ( which is the library added to xcode ) paste in following command and press enter:

cd armv7/lib
for file in *.a
do
cd ../..
xcrun -sdk iphoneos lipo -output universal/lib/$file  -create -arch armv7 armv7/lib/$file -arch armv7s armv7s/lib/$file -arch i386 i386/lib/$file
echo "Universal $file created."
cd -
done
cd ../..
导入Xcode后,设置 Header Search Paths路径(ffmpeg所在路径)

 

posted @ 2013-10-22 14:59 十三郎 阅读(1149) | 评论 (0)编辑 收藏

2013年5月20日

搜索引擎

搜索引擎:

http://www.looksmart.com/
http://www.infospace.com/
http://www.dmoz.org/
AOL 即美国在线,是美国也是世界上最早的门户网站之一, 80% 是美国本土用户,其搜索结果全部来自于 Google 。也就是说,有良好的 Google 排名也有良好的 AOL 排名。

Lycos 是全世界最早的搜索引擎之一。根据媒体调查统计, Lycos 以月 3700 万次的独立访问排名第 5 大用户最常访问的网站。目前, Lycos 主要搜索结果来自于 Alltheweb 。 

Ask 规模不大,但很有特色的搜索搜索。 Ask 是 DirectHit 的母公司,于 2001 年收购 Teoma 搜索引擎,并全部采用 Teoma 搜索结果。

Overture 是最早的付费搜索引擎(竞价排名搜索引擎)。搜索结果被 Yahoo, MSN 等采用。 Overture 收购了 Google 的对手 Inktomi 后被 Yahoo 收购,它开通了含约 32 亿文档的 “ 全球最大 ” ( Overture )的搜索索引服务,也是业界提供关键词标准流量的公司。

Netscape 由著名的浏览器公司网景公司开发的搜索引擎, Netscape 的搜索结果全部来自于 Google 。另外,全世界最大的开放式目录 DMOZ 录属于网景公司。

AltaVista 全世界最古老的搜索引擎之一,也是功能最完善,搜索精度较高的全文搜索引擎之一。截止 2002 年 6 月, AltaVista 宣称其数据库已存有 11 亿个 Web 文件,并且经过升级,其搜索精度已达业界领先水平。该搜索引擎已于 2003 年被 Yahoo 收购。

Inktomi 只对搜索引擎提供搜索结果。 2003 年被 Overture 收购。在 2004 年 Yahoo 开发自己全新的搜索引擎技术之前, Inktomi 还是全球第二大搜索引擎,其搜索结果被 Hotbot, MSN 等著名的网站采用。

HotBot 是比较活跃的搜索引擎,数据更新速度比其他引擎都快。网页库容量为 1.1 亿,以独特的搜索界面著称。该引擎已被 Lycos 收购,成为 Terra Lycos Network 的一部分。

AllTheWeb 是目前成长最快的搜索引擎,支持 225 种文件格式搜索,其数据库已存有 49 种语言的 21 亿个 Web 文件,而且以其更新速度快,搜索精度高而受到广泛关注,被认为是 Google 强有力的竞争对手。

LookSmart 与 Yahoo 、 Open Directory Project ( Dmoz )等齐名的分类目录搜索引擎,,向包括 MSN 、 AltaVista 、 Excite 提供目录搜索。在全球拥有相当规模的商业客户资源,并通过与 MSN 、 AltaVista 、 Infospace 等重量级门户合作,共享资源,使得 LookSmart 成为国内出口企业进行境外搜索引擎注册推广的一条重要渠道。

Infospace 是著名的元搜索引擎。元搜索引擎在接受用户查询请求时,同时在其他多个引擎上进行搜索,并将结果返回给用户。

Infoseek 是全球著名的搜索引擎之一,提供全文检索功能,并有较细致的分类目录。网页收录极其丰富,以西文为主。

CNN 美国有线新闻网( CNN )是美国时代华纳旗下的新闻媒体网站。于 2001 年随时代华纳集团并入了美国在线。 CNN 覆盖了六大洲,成为了历史上第一个名副其实的全球电视网。

posted @ 2013-05-20 11:42 十三郎 阅读(252) | 评论 (0)编辑 收藏

2012年6月28日

svn 操作

导入
 svn import 项目 svn://IP地址/ios/项目 -m'init xxx project'

导出
svn co svn://IP址/ios/项目

删除git

find . -name .git -exec rm -rf {} \;

删除svn
find . -type d -name ".svn" | xargs rm -rf


添加全部文件,@2x文件
svn status | grep "^?" | awk '{print $2}' | xargs -I {} svn add {}@

posted @ 2012-06-28 15:54 十三郎 阅读(291) | 评论 (0)编辑 收藏

2012年2月14日

时区时差换算(GMT,UTC,PST,PDT)

1.GMT
格林威治标准时间GMT

2.UTC
UTC指的是Coordinated Universal Time- 世界协调时间(又称世界标准时间、世界统一时间)
所以基本上UTC的本质强调的是比GMT更为精确的世界时间标准,不过对于现行表款来说,GMT与UTC的功能与精确度是没有差别的。


3.PDT
PDT 是 Pacific Daylight Time 的缩写

美国夏季始于每年4月的第1个周日,
止于每年10月的最后一个周日。
夏令时比正常时间早一小时,
与PDT时间相对应的是PST , Pacific Standard Time 。 夏时制结束后就是PST

4.PST
PST
PST是太平洋标准时间(西八区),与北京时间(东八区)时差-16个小时,
也就是北京时间减去16就是PST时间。而PDT比PST早1个小时,就是说PDT与北京时间时差为-15小时

posted @ 2012-02-14 15:12 十三郎 阅读(19969) | 评论 (0)编辑 收藏

2011年6月9日

iPhone开发各种图标大小

发布
512x512      1024x1024

New Document
  iPhone iPad
分辨率为 320x480, 320x480(i4),320x568(i5) ,375x667(i6),414x736(i6+)
1024x768
 像素  320x480, 640x960(i4),640x1136(i5) ,750x1334(i6),1242x2208(i6+)  
状态栏(电池) 20 20
导航栏 44 44
tab bar 49 49
tab内图片 30x30 max: 48x32 30x30
桌面图标 57x57 72x72
spotlight 50x50  
setting 29x29  

在Iphone  960px X 640px分辨率中
图标显示尺寸 114px X 114px
20像素的圆角
4像素的90度黑色投影
2像素的90度白色内投影
默认自带的高光

在Iphone  480px X 320px分辨率中
图标显示尺寸 57px X 57px
10像素的圆角
2像素的90度黑色投影
1像素的90度白色内投影
默认自带的高光

在Ipad  1024px X 768px分辨率中
图标显示尺寸 72px X 72px
13像素的圆角
2像素的90度黑色投影
1像素的90度白色内投影
默认自带的高光

图标标准:
    90度直角边
    没有高光
    不带alpha通道透明
    另外要提供48×48图标一个,用于spotlight搜索和设置

图片深度24位(RGB各8位),另带8位alpha通道,建议使用PNG格式图片




视频

16:9

1920:1080

posted @ 2011-06-09 13:58 十三郎 阅读(5642) | 评论 (0)编辑 收藏

2011年6月7日

ASCII字符编码表

ASCII字符编码表附录
附录A ASCII字符编码表

ASCII值
控制字符 ASCII值 控制字符 ASCII值 控制字符 ASCII值 控制字符
0 NUT 32 (space) 64 @ 96
1 SOH 33 65 A 97 a
2 STX 34 66 B 98 b
3 ETX 35 # 67 C 99 c
4 EOT 36 $ 68 D 100 d
5 ENQ 37 % 69 E 101 e
6 ACK 38 & 70 F 102 f
7 BEL 39 , 71 G 103 g
8 BS 40 ( 72 H 104 h
9 HT 41 ) 73 I 105 i
10 LF 42 * 74 J 106 j
11 VT 43 + 75 K 107 k
12 FF 44 , 76 L 108 l
13 CR 45 - 77 M 109 m
14 SO 46 . 78 N 110 n
15 SI 47 / 79 O 111 o
16 DLE 48 0 80 P 112 p
17 DCI 49 1 81 Q 113 q
18 DC2 50 2 82 R 114 r
19 DC3 51 3 83 X 115 s
20 DC4 52 4 84 T 116 t
21 NAK 53 5 85 U 117 u
22 SYN 54 6 86 V 118 v
23 TB 55 7 87 W 119 w
24 CAN 56 8 88 X 120 x
25 EM 57 9 89 Y 121 y
26 SUB 58 : 90 Z 122 z
27 ESC 59 ; 91 [ 123 {
28 FS 60 < 92 \ 124 |
29 GS 61 = 93 ] 125 }
30 RS 62 > 94 ^ 126 ~
31 US 63 ? 95 127 DEL
ASCII值为十进制数,控制字符的含义如下表所示。

NUL 空
VT 垂直制表 SYN 空转同步
SOH 标题开始 FF 走纸控制 ETB 信息组传送结束
STX 正文开始 CR 回车 CAN 作废
ETX 正文结束 SO 移位输出 EM 纸尽
EOY 传输结束 SI 移位输入 SUB 换置
ENQ 询问字符 DLE 空格 ESC 换码
ACK 承认 DC1 设备控制1 FS 文字分隔符
BEL 报警 DC2 设备控制2 GS 组分隔符
BS 退一格 DC3 设备控制3 RS 记录分隔符
HT 横向列表 DC4 设备控制4 US 单元分隔符
LF 换行 NAK 否定 DEL 删除

posted @ 2011-06-07 10:28 十三郎 阅读(1815) | 评论 (0)编辑 收藏

2010年5月5日

显示属性里的桌面选项卡不见了的解决办法

首先看看是不是被禁用了
1、
打开gpedit.msc,展开用户配置/管理模板/控制面板/显示, 将"隐藏桌面选项"选择为未配置;

上面不行,可能为控件被破坏或未安装,常见于你卸载ie玩着
2、
regsvr32.exe/i shell32
regsvr32.exe/i MSHTML.DLL
regsvr32.exe/i SHIMGVW.DLL

posted @ 2010-05-05 15:00 十三郎 阅读(735) | 评论 (2)编辑 收藏

2010年4月19日

IE6、IE7、IE8之IE多版本共存的几种方法 (2009-02-27更新)

转载请标明出处: http://www.yaosansi.com

原 文:http://www.yaosansi.com/post/1370.html

一、 单独安装(相对繁琐,不推荐)

使用IE6 Green、IE7 Standalone 及IE8 安装文件,分别安装各自的浏览器。

安装顺序:1、IE6 Green  2、IE7 Standalone  3、IE8 beta2

相 关下载地址:

IE6 Green: http://skmode.ys168.com/ 由Everplus打包

IE7 Standalone:http://tredosoft.com/IE7_standalone

IE7 XP版本: IE7-WindowsXP-x86-enu.exe 

IE7 其它版本:Internet Explorer 7

相关参考:

IE6 和IE7共存方法(别人是别人的,我是我的)

IE6、 IE7、IE8共存方法

二、Multiple IE(不推荐)

实际上 Multiple IE只实现了IE6及以下版本的整合,对目前来说有些过时的感觉。

官方:http://tredosoft.com/multiple_IEs

下 载:Download IETester v0.2.2

截图:

Multiple_IE

安装

Multiple_IE_2

快捷方式

三、 IETester(推荐)

又一个整合的IE,不同的是,它创新式的以选项卡的方式显示不同的浏览器版本,并对IE8 Beta1进行了支持,尽管目前IE8 Beta2已经面世,不过我们仍可以坚信等IE8正式发布时,开发成员会及的对IETester进行更新。

官 方:http://www.my-debugbar.com/wiki/IETester/HomePage

下 载:Download IETester v0.2.2

截图:

IE_Tester

同时打开多个窗口

IE_Tester_2

标签菜单

四、 IECollection(推荐)

看名字便可以知道,又是一个整合版本的IE,可以说它就是Multiple IE的新兄弟,因为它们实在是太像了,只是Multiple IE有些更新的嫌疑,而IECollection的更新速度会让我们惊讶,刚出IE8 Beta 2,IECollection已经进行了整合。

Internet Explorer Collection contains the following versions of IE:
- Internet Explorer 1.0 (4.40.0.308)
- Internet Explorer 1.5 (0.1.0.10)
- Internet Explorer 2.01 (2.1.0.46)
- Internet Explorer 3.0 (3.0.1152)
- Internet Explorer 4.01 (4.72.3110.0)
- Internet Explorer 5.01 (5.00.3314.2100)
- Internet Explorer 5.5 (5.51.4807.2300)
- Internet Explorer 6.0 (6.00.2800.1106)
- Internet Explorer 7.0 (7.0.5730.13)
- Internet Explorer 8.0 (8.0.6001.18241)

Warning: Never use Internet Explorer as primary browser.

官方:http://finalbuilds.edskes.net/iecollection.htm

下 载:Internet Explorer Collection 1.1.0.0 (43.0 MB, 45.154.305 bytes)

截图:

IE_Collection

安装

IE_Collection_2 

快捷方式(其中和一个为IE6绿色版的图标)

IE_Collection_3

使用效果(IE6、IE7、IE8)

五、 Xenocode Browser Sandbox (推荐)

Xenocode Browser Sandbox 改变了基于 Windows 的浏览器兼容测试工具的游戏规则,只需点一下鼠标,就会直接打开一堆各式各样的浏览器窗口,你可以在不同版本的 IE, Firefox, Google Chrome, Safari 进行测试。是真正的测试,不是屏幕截图,该工具完全免费。唯一遗憾的是,目前不支持 Mac。
 

官方:http://www.xenocode.com/browsers/

下 载:

IE8: http://start.xenocode.com/Layers/IE8/8-0-0-0__0/IE8.exe

IE7: http://start.xenocode.com/Layers/IE7/7-0-0-0__0/IE7.exe

IE6: http://start.xenocode.com/Layers/IE6/6-0-0-0__1/IE6.exe

FF: http://start.xenocode.com/Layers/Firefox/3-0-3-0__1/Firefox.exe

Safari: http://start.xenocode.com/Layers/Safari/3-2-0-0__0/Safari.exe

Opera: http://start.xenocode.com/Layers/Opera/9-63-0-0__2/Opera.exe

Chrome: http://start.xenocode.com/Layers/Chrome/1-0-154-43__0/Chrome.exe

posted @ 2010-04-19 14:59 十三郎 阅读(473) | 评论 (0)编辑 收藏

2010年3月2日

ie firebug

1.源:http://getfirebug.com/lite.html

使用方法:
<script type='text/javascript' src='http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js'>
</script>

2.http://www.microsoft.com/downloads/details.aspx?FamilyID=e59c3964-672d-4511-bb3e-2d5e1db91038&DisplayLang=en

posted @ 2010-03-02 10:48 十三郎 阅读(322) | 评论 (0)编辑 收藏

仅列出标题  下一页

导航

常用链接

留言簿(5)

随笔分类

文章分类

积分与排名