#C语言学习 ##union ##__declspec
- 用于指定所给定类型的实例的与Microsoft相关的存储方式
##memset
- 主要用于批量初始化数组的每个元素
##memcpy
- 从源src所指的内存地址的起始位置开始拷贝n个字节到目标dest所指的内存地址的起始位置中
var multiple = function(a){ | |
return function(b){ | |
return +b*a + '' | |
} | |
} | |
var plus = function(a){ | |
return function(b){ | |
return (+b)+a + '' | |
} |
Multipler.prototype.multiple = function(numbers){ | |
return numbers.map((number) => number*this.inc); | |
}; | |
console.log(new Multipler(2).multiple([1,2,3,4]));// => [ 2, 4, 6, 8 ] |
#C语言学习 ##union ##__declspec
##memset
##memcpy
#Zend引擎分析 ##基础变量类型(zend_value)
typedef int64_t zend_long;
64位有符号整型
typedef unsigned char zend_uchar;
无符号字符型
#Mysql Join
SELECT * FROM table_a, table_b WHERE table_a.id = table_b.id
##左右外部连接(内连)SELECT * FROM table_a LEFT OUTER JOIN table_b ON table_a.id = table_b.id
SELECT * FROM table_a RIGHT OUTER JOIN table_b ON table_a.id = table_b.id
##左右外部连接不内连#定义的宏
function verify_app_store_in_app($receipt, $is_sandbox) | |
{ | |
//$sandbox should be TRUE if you want to test against itunes sandbox servers | |
if ($is_sandbox) | |
$verify_host = "ssl://sandbox.itunes.apple.com"; | |
else | |
$verify_host = "ssl://buy.itunes.apple.com"; | |
$json='{"receipt-data" : "'.$receipt.'" }'; | |
//opening socket to itunes |
session.gc_probability = 1 | |
session.gc_divisor = 100 | |
session.gc_maxlifetime = 1440 | |
这三个配置组合构建服务端session的垃圾回收机制 | |
session.gc_probability与session.gc_divisor构成执行session清理的概率,理论上的解释为服务端定期有一定的概率调用gc函数来对session进行清理,清理的概率为: | |
gc_probability/gc_divisor 比如:1/100 表示每一个新会话初始化时(session_start),有1%的概率会启动垃圾回收程序,清理的标准为session.gc_maxlifetime定义的时间。 |
listNode *listIndex(list *list, long index) { | |
listNode *n; | |
if (index < 0) { | |
index = (-index)-1; | |
n = list->tail; | |
while(index-- && n) n = n->prev; | |
} else { | |
n = list->head; | |
while(index-- && n) n = n->next; |
If you're writing web applications with Ruby there comes a time when you might need something a lot simpler, or even faster, than Ruby on Rails or the Sinatra micro-framework. Enter Rack.
Rack describes itself as follows:
Rack provides a minimal interface between webservers supporting Ruby and Ruby frameworks.
Before Rack came along Ruby web frameworks all implemented their own interfaces, which made it incredibly difficult to write web servers for them, or to share code between two different frameworks. Now almost all Ruby web frameworks implement Rack, including Rails and Sinatra, meaning that these applications can now behave in a similar fashion to one another.
At it's core Rack provides a great set of tools to allow you to build the most simple web application or interface you can. Rack applications can be written in a single line of code. But we're getting ahead of ourselves a bit.