Saturday, May 28, 2016
Hadoop 基本指令
format the namenode:
hdfs namenode -format
$ sbin/start-dfs.sh
$ sbin/stop-dfs.sh
主要配置文件
core-site.xml
hdfs-site.xml
Wednesday, December 17, 2014
[Python] Class间大小比较(达到全序)
在Python 2.x中, 可以方便的使用 __cmp__ 方法来实现class object之间的大小比较.
在Python 3以后, __cmp__ 方法被移除了. 实现Foo object间的大小比较, 需要用functools.total_ordering修饰这个class以后, 实现__eq__方法以及__lt__(或者__lt__, __le__, __gt__, __ge__中的任意一个).
class Foo:
def __init__(self, key):
self.key = key
def __cmp__(self, other):
return cmp(self.key, other.key)
如此Foo类型的object间的大小比较就可以用key这个域的值来实现.在Python 3以后, __cmp__ 方法被移除了. 实现Foo object间的大小比较, 需要用functools.total_ordering修饰这个class以后, 实现__eq__方法以及__lt__(或者__lt__, __le__, __gt__, __ge__中的任意一个).
import functools
@functools.total_ordering
class Foo:
def __init__(self, key):
self.key = key
def __eq__(self, other):
return self.key == other.key
def __lt__(self, other):
return self.key < other.key
Monday, August 11, 2014
[iOS] Apple的Push Notification Service: APNS
官方介绍
实现Push功能的例子
实现Push功能的例子
- Server端Php代码的例子: Learn PHP by Example - Working with Apple Push Notification
- 一步一步实现iOS应用PUSH功能
- Apple Push Notification Services in iOS 6 Tutorial: Part 1(APNS的设置), Part 2(iOS App的编程)
- Provider Communication with Apple Push Notification Service
- Changes in the APNS Binary Interface and Notification Format
PHP中二进制数据的处理
Saturday, August 09, 2014
Base64 Encoding
base64 encode是一种编码方式. 这种编码方式用来将一段二进制数据变换成为"方便传输"的文本数据. 它的核心思想是把二进制数据按每3个字节划分为一段, 然后每一段里每6个bit映射为一个文本字符来表示. 6个bit最多只有64种可能, 所以可以用a-zA-Z0-9+/ 这64个大多数字符集里都有的文本来对应.
在Objective C中, 使用如下的方法可以在二进制数据(NSDate类型)和based64 encoded数据(保存在NSString中)相互转换.
在Objective C中, 使用如下的方法可以在二进制数据(NSDate类型)和based64 encoded数据(保存在NSString中)相互转换.
// From binary data to base64 encoded string
NSString string;
if ([data respondsToSelector:@selector(base64EncodedStringWithOptions:)]) {
string = [data base64EncodedStringWithOptions:kNilOptions]; // iOS 7+
} else {
string = [data base64Encoding]; // pre iOS7
}
// From base64 encoded string to binary data
NSData *data;
if ([NSData instancesRespondToSelector:@selector(initWithBase64EncodedString:options:)]) {
data = [[NSData alloc] initWithBase64EncodedString:string options:kNilOptions]; // iOS 7+
} else {
data = [[NSData alloc] initWithBase64Encoding:string]; // pre iOS7
}
Tuesday, August 05, 2014
[iOS] iOS开发涉及到的Certificate, Provisioning Profile
iOS development/distribution
iOS开发最基本的证书. 其实是一个private key, Xcode使用该private key对App的code签名.- iOS Development Certificate: 该证书用来在Xcode上开发一个iOS app
- iOS Distribution Certificate: 该证书用来将一个iOS使用App Store或者AdHoc方式来分发给用户
iOS Push service
一个经过Apple授权的SSL Certificate, 使得App后端的notification server可以连接到Apple的APNS服务.- APNS Development SSL Certificate: 在开发测试期使用该证书. APNS的sandbox 服务器:gateway.sandbox.push.apple.com:2195
- APNS Production SSL Certificate: 在App运行期使用该证书. 并连接APNS production 服务器:gateway.push.apple.com:2195
什么是Provisioning Profile
一个被Apple使用PKCS#7标准签名过的plist文件. 这个plist文件里以key-value pair的形式保存了关于这个App的一些基本属性. 比如AppIDName,证书创建和过期日期等等. 每一个Provisioning Profile需要对应- 一个AppID
- 一个development/distribution certificate
验证一个Provisioning Profile
$ openssl smime -in /path/to/your/foo.mobileprovision -inform der -verify这个命令会输出该plist文件的文本内容, 以及"Verification successful" 如果验证成功
参考
Thursday, July 17, 2014
SSL certificate
记点笔记
什么是SSL? https协议如运作:
http://www.tldp.org/HOWTO/SSL-Certificates-HOWTO/x64.html
检查你的server上的SSL certificate是否有效:
http://www.digicert.com/help/
创立一个self-signed ssl certificate:
http://www.akadia.com/services/ssh_test_certificate.html
什么是SSL? https协议如运作:
http://www.tldp.org/HOWTO/SSL-Certificates-HOWTO/x64.html
检查你的server上的SSL certificate是否有效:
http://www.digicert.com/help/
创立一个self-signed ssl certificate:
http://www.akadia.com/services/ssh_test_certificate.html
Wednesday, May 21, 2014
[git] 建立以及使用Git的bare repo
git repo分为bare和non-bare两种. non-bare repo最最常见, 它包括一个working tree(你提交到这个git repo里的文件和目录结构)以及一个.git文件夹(其中有各种git系统文件). 而bare repo仅仅有系统文件. 一般在git server上,所有的repo都是以bare形式存在的. 通常除了admin以外,大家是不需要和bare repo打交道的.
不过事事无绝对, 我就在工作中遇到这样的一个问题需要和bare repo打交道: 我的所有源代码都放在一个远端的git的repo(比如放在github上), 可是由于某些缘故我或者不能或者不愿意在我工作环境里直接和github上的repo同步. 一个折衷的方案就是在一台自己的server上建立这个github上的repo, 然后在我的工作环境中首先和server上得 repo同步, 然后再登陆到server上把server里地repo和github上的repo同步.
这样造成的问题就是server上的repo必须得是bare. 如果它含有working tree, 那么就算将server上的repo里的.git目录作为upstream加入, pull的时候没有问题, 但push的时候也会有问题
不过事事无绝对, 我就在工作中遇到这样的一个问题需要和bare repo打交道: 我的所有源代码都放在一个远端的git的repo(比如放在github上), 可是由于某些缘故我或者不能或者不愿意在我工作环境里直接和github上的repo同步. 一个折衷的方案就是在一台自己的server上建立这个github上的repo, 然后在我的工作环境中首先和server上得 repo同步, 然后再登陆到server上把server里地repo和github上的repo同步.
这样造成的问题就是server上的repo必须得是bare. 如果它含有working tree, 那么就算将server上的repo里的.git目录作为upstream加入, pull的时候没有问题, 但push的时候也会有问题
$ git remote add some_remote_name ssh://apc999@myhost/home/apc999/some-repo/.git $ git pull some_remote_name master .. works file ... $ git push --set-upstream ssh://apc999@myhost/home/apc999/some-repo/.git master ... ! [remote rejected] master -> master (branch is currently checked out) error: failed to push some refs to '/home/apc999/some-repo'
如何使用bare repo
1 建立一个bare的git repo
$ git clone --bare my_project_on_github my-project.git注意上面命令和普通git clone不一样的地方在于参数--bare. 普通的git clone命令会生成一个working tree和.git文件夹, 而--bare这样复制出来的bare repo就不包括working tree.
2 bare和 non-bare repo的转换
比如你的/home/apc999/my-project是一个git working tree$ cd /home/apc999/my-project $ git config --bool core.bare true
3 更新bare repo
注意, 在一个bare repo里, 不能使用git pull来更新这个repo. 而需要使用git fetchSunday, April 20, 2014
小米盒子使用记录
新拿到小米盒子, 记录并分享一下装机和使用心得.
简朴的可回收硬纸壳包装, 电源, 连接电视的HDMI, 遥控器. 小米盒子说白了其实就是一个跑Android的小电脑, 只是它需要使用电视作为显示器.
这里是些常用的App:
开箱照
简朴的可回收硬纸壳包装, 电源, 连接电视的HDMI, 遥控器. 小米盒子说白了其实就是一个跑Android的小电脑, 只是它需要使用电视作为显示器.
推荐App
小米盒子有一个micro-USB接口. 所以接上U盘后, 就可以直接读取并安装U盘里存储的apk文件. 如下图所示:这里是些常用的App:
参考
Saturday, April 19, 2014
[MacOS] MacOS 10.9(Mavericks)上clang对未知参数报错的问题
在MacOS 10.9上用pip安装一个库的时候发现clang报错
在运行安装命令的时候先修改CFLAGS和CPPFLAGS
$ sudo pip install mysql-python cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/local/Cellar/mysql/5.6.16/include/mysql -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.9-intel-2.7/_mysql.o -Os -g -fno-strict-aliasing clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future] clang: note: this will be a hard error (cannot be downgraded to a warning) in the future error: command 'cc' failed with exit status 1
原因
XCode 5.1 以后, XCode的默认编译器clang会对所有它不认识的命令行flag报错 http://kaspermunck.github.io/2014/03/fixing-clang-error/解决方法
参照这里给出的方案: http://stackoverflow.com/questions/22313407/clang-error-unknown-argument-mno-fused-madd-python-package-installation-fa在运行安装命令的时候先修改CFLAGS和CPPFLAGS
$ export CFLAGS=-Qunused-arguments $ export CPPFLAGS=-Qunused-arguments $ sudo -E pip install mysql-python注意由于安装过程中需要sudo, 所以为了让环境变量传递过去, 需要加上-E选项
[MacOS] 在MacOS 10.9(Mavericks)设置Apache/PHP
本来想自己写的. 但这篇实在写的太详实太好了.
http://www.coolestguidesontheplanet.com/downtown/get-apache-mysql-php-and-phpmyadmin-working-osx-109-mavericks
就捡几个重点的供我自己查询吧:
http://www.coolestguidesontheplanet.com/downtown/get-apache-mysql-php-and-phpmyadmin-working-osx-109-mavericks
就捡几个重点的供我自己查询吧:
启动/关闭/重启apache server
$ sudo apachectl start $ sudo apachectl stop $ sudo apachectl restart
几个重要的文件和路径
- 设置文件
- httpd的全局设置文件:/etc/apache2/httpd.conf
- 用户apc999的设置文件:/etc/apache2/users/apc999.conf
-
apache的日志
- /var/log/apache2/error_log
- /var/log/apache2/access_log
- web路径对应的本地路径
- http://localhost/ 对应的本地路径 /Library/WebServer/Documents/
- http://localhost/~apc999 对应本地路径 /Users/apc999/Sites
Monday, February 17, 2014
[Emacs] Mac OS Terminal中设置Emacs热键
由于工作条件的一些限制,我不能在MacOS中之间使用单独的Emacs App而必须要在Terminal里运行Emacs.所以我花时间设置了一下我的Emacs,使的它在Terminal中也可以像在App里一样完美运行.
在Terminal里设置按键(单独的按键以及组合按键)所激发的xterm key code. 下面这张图是我的设置:
主要是关于方向键加上ctrl/shift/alt的组合.
关于更多的xterm key code的简介可以从这里获得:
更加完整的的关于xterm code的reference:
总而言之, 你需要把你需要用到的组合按键设置在Terminal中, 使得Emacs可以收到
Emacs的key mapping系统无比的复杂. 我使用了一种笨办法: 把每一个我关心的热键组合的xterm key code都在input-decode-map里定义成对应的组合键. 比如下面的设置. 这里"\e"相当于"\033"
这样Emacs才能在key stream里识别出来传进来的meta/shift/ctrl等热键. 然后再使用Emacs里的global-set-key来绑定组合到特定的function上, 比如我设置meta加up为backward-paragraph:
最大的障碍来自于Terminal里对于热键的设置
在Terminal里设置按键(单独的按键以及组合按键)所激发的xterm key code. 下面这张图是我的设置:
主要是关于方向键加上ctrl/shift/alt的组合.
关于xterm key Code:
Terminal将按键事件转换成一个xterm key code并发送给当前窗口中运行的shell. 比如Shift加上方向键up被记录成一个code "\033[1;2A". 这里"\033"其实对应的是Esc键.关于更多的xterm key code的简介可以从这里获得:
更加完整的的关于xterm code的reference:
总而言之, 你需要把你需要用到的组合按键设置在Terminal中, 使得Emacs可以收到
剩下的就是对于Emacs里热键的设置
Emacs的key mapping系统无比的复杂. 我使用了一种笨办法: 把每一个我关心的热键组合的xterm key code都在input-decode-map里定义成对应的组合键. 比如下面的设置. 这里"\e"相当于"\033"
(define-key input-decode-map "\e[9A" [(meta up)]) (define-key input-decode-map "\e[9B" [(meta down)]) (define-key input-decode-map "\e[9C" [(meta right)]) (define-key input-decode-map "\e[9D" [(meta left)]) (define-key input-decode-map "\e[2A" [(shift up)]) (define-key input-decode-map "\e[2B" [(shift down)]) (define-key input-decode-map "\e[2C" [(shift right)]) (define-key input-decode-map "\e[2D" [(shift left)]) (define-key input-decode-map "\e[10A" [(shift meta up)]) (define-key input-decode-map "\e[10B" [(shift meta down)]) (define-key input-decode-map "\e[10C" [(shift meta right)]) (define-key input-decode-map "\e[10D" [(shift meta left)])
这样Emacs才能在key stream里识别出来传进来的meta/shift/ctrl等热键. 然后再使用Emacs里的global-set-key来绑定组合到特定的function上, 比如我设置meta加up为backward-paragraph:
(global-set-key [(meta up)] 'backward-paragraph) (global-set-key [(meta down)] 'forward-paragraph) (global-set-key [(meta left)] 'backward-word) (global-set-key [(meta right)] 'forward-word)
Tuesday, February 04, 2014
[Linux/Mac] Terminal收到的Control Code和Escape Sequence Code
在Linux和Mac里使用Terminal的时候常常会出现按下一个组合键出来一堆奇怪字符的情况. 这通常是由于这个按键组合未被Terminal识别成功. 现在操作系统的Terminal通常已经足够强大, 比如MacOS自带的Terminal以及iTerm等都可以自己设置从按键组合到Control Code或者Escape Sequence Code的映射来传给Shell. 由于我常常被这个问题困扰, 所以写下这篇笔记.
在MacOS的terminal里可以很方便的
或者使用sed命令
这是我写的一篇笔记Mac OS Terminal中设置Emacs热键
http://blog.csdn.net/joans123/article/details/7562212
Mastering Key Bindings In Emacs
何为Ctrol Code和Escape sequence code?
这里有几篇很不错的讲解Text-Terminals on Linux以及Linux Console Codes
基本这是一套沿用多年, 对按键组合编码的方案. 简单说来, Escape Sequence Code就是讲一个按键组合变成以\033(键盘上得Esc键)打头的一串字符. 比如up \033[A down \033[B right \033[C left \033[D shift+up \033[1;2A shift+down \033[1;2B shift+right \033[1;2C shift+left \033[1;2D meta+up \033[1;4A meta+down \033[1;4B meta+right \033[1;4C meta+left \033[1;4D ctrl+up \033[1;5A ctrl+down \033[1;5B ctrl+right \033[1;5C ctrl+left \033[1;5D不难看出其中的一些个规律 (Alt: 1, Ctrl: 2, Shift: 4, ...). 更多的code可以参考: Key Codes以及 xterm code:
如何得到一个按键(或者按键组合)当前对应的Escape Sequence Code
在MacOS的terminal里可以很方便的
Keystroke to Type Expected Output (for VT220 mapping) ctrl-V backspace ^? ctrl-V delete ^[[3~ ctrl-V ctrl-H ^H
或者使用sed命令
$ sed -n l在Linux的terminal下, 运行xev, 桌面角落里会出现一个小对话框。 同时terminal里会输出当前的事件, 比如按下了哪个键,松开了哪个键, 进而可以获得这些键的code
在Emacs里如何使用键映射(keymap)
这是我写的一篇笔记Mac OS Terminal中设置Emacs热键http://blog.csdn.net/joans123/article/details/7562212
Mastering Key Bindings In Emacs
Thursday, January 02, 2014
[Linux] aptitude vs. apt-get
功能上的区别:
http://www.debian.org/doc/manuals/debian-faq/ch-pkgtools.en.html#s-aptitude彩蛋上的区别:
$ apt-get moo
(__)
(oo)
/------\/
/ | ||
* /\---/\
~~ ~~
...."Have you mooed today?"...
$ aptitude moo There are no Easter Eggs in this program.
Tuesday, December 10, 2013
[C++] 纳秒(ns)级精度的计时
在调试以及优化高性能的程序中,常需要对一小段程序计时. 普通的clock函数精度达不到ns级别.这里记录一下几种可以得到ns级高精度的计时方法.
C++ 中可以使用clock_gettime, 得到
如果想得到更高精度的计时, 比如以CPU的时钟周期为单位, 对于比较新的Intel CPU, 可以使用rdtscp指令来获得当前CPU时钟周期读数.比较前后两次读数就可以得到以时钟周期为单位的逝去时间.
使用clock_gettime
C++ 中可以使用clock_gettime, 得到
clock_gettime(CLOCK_REALTIME, &time1);
... your code to profile ...
clock_gettime(CLOCK_REALTIME, &time2);
使用rdtscp
如果想得到更高精度的计时, 比如以CPU的时钟周期为单位, 对于比较新的Intel CPU, 可以使用rdtscp指令来获得当前CPU时钟周期读数.比较前后两次读数就可以得到以时钟周期为单位的逝去时间.
// rdtscp ensure serialization, supported by newer CPUs
static __inline__ uint64_t rdtscp(void)
{
uint32_t hi, lo;
__asm__ __volatile__ ("rdtscp" : "=a"(lo), "=d"(hi));
return ((uint64_t)lo | ((uint64_t)hi << 32);
}
Wednesday, October 30, 2013
Sublime Text 3 插件开发 (未完)
Sublime Text (以下简称ST)提供了一个python的API接口. 在这个接口之上,用户可以开发自己的插件.
完整的ST3 API可以参见这里
如果你想仔细研究这些API的定义以及ST自带Python模块的细节, 可以在ST下找到这个python API的文件. MacOS上, 在/Applications/Sublime Text.app/Contents/MacOS/目录底下, 有2个文件 sublime.py和sublime_plugin.py.
如果你想仔细研究这些API的定义以及ST自带Python模块的细节, 可以在ST下找到这个python API的文件. MacOS上, 在/Applications/Sublime Text.app/Contents/MacOS/目录底下, 有2个文件 sublime.py和sublime_plugin.py.
从一个最简单的plugin开始
import sublime, sublime_plugin
class HelloWorldCommand(sublime_plugin.TextCommand):
def run(self, edit):
self.view.insert(edit, 0, "Hello, World!")
将其命名为"hello_world.py"以后, 存在Packages/User底下. 这个plugin就只干一件事儿, 当你在ST3自带的python console里(可以通过Ctrl+`呼出)运行
view.run_command("hello_world")
就会在你正在编辑的文件里添加一段"Hellow, World!". 这里注意ST的命名习惯. 这个类的名字叫HellowWorld, console中ST会将其命名为hellow_world, 从而使用run_command("hello_world")来运行之.
Sunday, October 13, 2013
在Sublime Text 3 中使用emacs键位
我的目标很简单: 就是把sublime text的操作折腾的和emacs 一样
参见这里: https://github.com/grundprinzip/sublemacspro
基本上最基本的emacs操作比如ctrl-w, alt-w, ctrl-k, ctrl-y 等就有了.
http://www.sublimetext.com/docs/commands
如何写一个plugin
http://sublimetext.info/docs/en/extensibility/plugins.html
st3的api
http://www.sublimetext.com/docs/3/api_reference.html
第一步, 安装sublemacspro.
参见这里: https://github.com/grundprinzip/sublemacspro
基本上最基本的emacs操作比如ctrl-w, alt-w, ctrl-k, ctrl-y 等就有了.
第二步, 增加一些我自己管用的keybinding
我是通过定制PreferencesKey->Binding->User来增加以下我自己习惯的键位:[
{ "keys": ["ctrl+f"], "command": "move", "args": {"by": "pages", "forward": true} },
{ "keys": ["ctrl+b"], "command": "move", "args": {"by": "pages", "forward": false} },
{ "keys": ["shift+ctrl+f"], "command": "move", "args": {"by": "pages", "forward": true, "extend": true} },
{ "keys": ["shift+ctrl+b"], "command": "move", "args": {"by": "pages", "forward": false, "extend": true} },
{ "keys": ["alt+down"], "command": "move", "args": {"by": "stops", "empty_line": true, "forward": true} },
{ "keys": ["alt+up"], "command": "move", "args": {"by": "stops", "empty_line": true, "forward": false} },
{ "keys": ["shift+alt+down"], "command": "move", "args": {"by": "stops", "empty_line": true, "forward": true, "extend": true} },
{ "keys": ["shift+alt+up"], "command": "move", "args": {"by": "stops", "empty_line": true, "forward": false, "extend": true} },
{ "keys": ["ctrl+c", "ctrl+c"], "command": "build"},
]
参考:
关于key binding 的commandshttp://www.sublimetext.com/docs/commands
如何写一个plugin
http://sublimetext.info/docs/en/extensibility/plugins.html
st3的api
http://www.sublimetext.com/docs/3/api_reference.html
Wednesday, September 25, 2013
[Math] 有趣的无穷数列求和
1 + 2 + 3 + 4 + ... = -1/12
所有自然数之和为-1/12
这个在量子物理和弦论里有应用, 据说12个维度就是这么来的
1 - 2 + 3 - 4 + ... = 1/4
1 + 2 + 4 + 8 + ... = -1
或者等价于: 所有偶数和为-2
其实这个可以自己推出来
高斯他老人家就推了一堆这种神奇的结论
所有自然数之和为-1/12
这个在量子物理和弦论里有应用, 据说12个维度就是这么来的
1 - 2 + 3 - 4 + ... = 1/4
1 + 2 + 4 + 8 + ... = -1
或者等价于: 所有偶数和为-2
其实这个可以自己推出来
高斯他老人家就推了一堆这种神奇的结论
Friday, July 12, 2013
[git] 一些git的使用小技巧
记录一下我在平时使用git时候的一些小技巧. 关于git更全面的使用介绍(比如整个工作的流程 ), 参见我之前写的的"git 笔记".
- 查看my_file和之前版本的区别
$ git diff HEAD my_file #latest version checked-in $ git diff HEAD~1 my_file #previous of the latest version $ git diff HEAD~2 my_file #previous ^ 2 of the latest
-
跳过git add而直接commit当前修改过的文件中那些被track的
$ git commit . -m "foo"
-
把track的文件中所有被修改的都加入index
$ git add -u
-
和HEAD比较, 当前工作目录下有那些具体的修改(可能跨几个文件)
$ git diff HEAD
-
查看每次commit都改动了哪些文件
$ git log --stat
查看上一次commit有哪些文件被改动
$ git log -n 1 --stat
-
将当前branch rebase到本地的master branch上. 也就是当前branch的local commit会出现在commit log的最后
$ git rebase master
-
指定从origin/master 来更新
$ git rebase origin master
-
设置gitignore_global
建立~/.gitignore_global, 然后执行
$ git config --global core.excludesfile ~/.gitignore_global
-
查看当前git的config
$ git config -l
-
设定当前git repository的email
$ git config user.email "apc999@youremail.com"
查看当前git repository的email$ git config user.email
Wednesday, May 22, 2013
查看gcc预定义的macro
在Linux或者MacOS的terminal里运行:
$ cpp -dM /dev/null #define __DBL_MIN_EXP__ (-1021) #define __UINT_LEAST16_MAX__ 65535 #define __FLT_MIN__ 1.17549435082228750797e-38F #define __UINT_LEAST8_TYPE__ unsigned char #define __INTMAX_C(c) c ## L #define __CHAR_BIT__ 8 #define __UINT8_MAX__ 255 #define __WINT_MAX__ 4294967295U #define __ORDER_LITTLE_ENDIAN__ 1234 #define __SIZE_MAX__ 18446744073709551615UL #define __WCHAR_MAX__ 2147483647 #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1 #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1 #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1 #define __DBL_DENORM_MIN__ ((double)4.94065645841246544177e-324L) #define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1 #define __FLT_EVAL_METHOD__ 0 #define __unix__ 1 ...一般说来Linux平台上会预定义__linux__, 而MacOS会预定义__APPLE__
Subscribe to:
Posts (Atom)



