码迷,mamicode.com
首页 > 其他好文
Aerospike C客户端手册———键-值存储—删除记录
删除记录 Aerospike C客户端API提供一个简单的操作来删除数据库中的数据。 数据删除示例代码被所有示例使用。下面的代码引用自示例目录【examples/basic_examples/put】,由Aerospike C客户端安装包自带。 请先阅读【创建连接】章节内容,理解如何建立与集群的连接。 初始化键(KEY) 删除记录时,数据库需要通过键(ke...
分类:其他好文   时间:2015-04-23 11:01:53    阅读次数:174
Objective-C - autorelease详解
autorelease详解/* 1.autorelease的基本用法 1> 会将对象放到一个自动释放池中 2> 当自动释放池被销毁时,会对池子里面的所有对象做一次release操作 3> 会返回对象本身 4> 调用完autorelease方法后,对象的计数器不变 2.autorelease的好处 1> 不用再关心对象释放的时间 2> 不用再关心什么时候调用release 3.autor...
分类:其他好文   时间:2015-04-23 11:02:03    阅读次数:140
Aerospike C客户端手册———键-值存储—批量读取记录
批量读取记录 除了每次读取单条记录外,还可以在一个事务中从集群中读取多条记录。相关的客户Aerospike C客户端API调用是: aerospike_batch_get() — 返回所需记录所有bin数据。aerospike_batch_exists() — 返回所需记录元数据(生存时间, 分代编号)。 后面的代码引用自示例目录【examples/basic...
分类:其他好文   时间:2015-04-23 11:01:21    阅读次数:301
二叉树重建 - (先序遍历、中序遍历、后序遍历)
对于一棵二叉树T,我们可以递归定义它的先序遍历,中序遍历,后序遍历: ??        1、先序遍历  ( PreOrder(T) = T的根节点 + PreOrder(T的左子树) + PreOrder(T的右子树) )        2、中序遍历  ( InOrder(T) = InOrder(T的左子树) + T的根节点 +  InOrder(T的右子树) )        3、后...
分类:其他好文   时间:2015-04-23 11:02:56    阅读次数:120
Objective-C - ARC(Automatic Reference Counting)自动引用技术详解
ARC特点与判断准则/* ARC的判断准则:只要没有强指针指向对象,就会释放对象 1.ARC特点 1> 不允许调用release、retain、retainCount 2> 允许重写dealloc,但是不允许调用[super dealloc] 3> @property的参数 * strong :成员变量是强指针(适用于OC对象类型) * weak :成员变量是弱指针(适用于OC对象...
分类:其他好文   时间:2015-04-23 11:02:35    阅读次数:162
Objective-C - 代码块block
代码块block /* block要掌握的东西 1> 如何定义block变量 int (^sumBlock)(int, int); void (^myBlock)(); 2> 如何利用block封装代码 ^(int a, int b) { return a - b; }; ^() { NSLog(@"----------"); }; ^ { NSLog(@"--...
分类:其他好文   时间:2015-04-23 11:02:24    阅读次数:121
intel毫无眼光,迟早死翘
好几年前,我就在期待什么时候用手机办公,或者用平板办公,作为一个程序员,我的要求很低,主要做后台开发,日常用最普通笔记本,8g内存,500g硬盘,i3-3210 cpu,这个笔记本算低端了,但跑几个vs,运行几十个应用进程绰绰有余了,一直期待哪天能有款笔记本,达到这个需求,那样就不用每天带个笔记本上下班,只需要带个手机,到公司(或家)接上鼠标键盘显示器就办公了,可看看我们的intel,Z3xxx系...
分类:其他好文   时间:2015-04-23 10:59:24    阅读次数:120
POJ 2154 Color (ploya欧拉函数)
ploya定理,然后公式利用欧拉函数优化,gcd必然是因子,这样只要枚举因子,每个因子利用欧拉函数计算出现次数 代码: #include #include #include using namespace std; int t, n, p; int pow_mod(int x, int k) { x %= p; int ans = 1; while (k) {...
分类:其他好文   时间:2015-04-23 10:59:24    阅读次数:115
leetcode || 108、Convert Sorted Array to Binary Search Tree
problem: Given an array where elements are sorted in ascending order, convert it to a height balanced BST. Hide Tags  Tree Depth-first Search 题意:将一个递增的序列 转换成一棵 平衡查找二叉树 ...
分类:其他好文   时间:2015-04-23 10:59:34    阅读次数:201
Don’t Nail Your Program into the Upright Position
Don’t Nail Your Program into the Upright PositionVerity Stobi ONCE WROTE A SPOOF C++ qUiz, in which I satirically suggested the fol- lowing strategy for exception handling: By dint of plentiful try…ca...
分类:其他好文   时间:2015-04-23 11:01:10    阅读次数:131
Don’t Repeat Yourself
Don’t Repeat YourselfSteve SmithOF ALL THE PRiNCiPLES OF PROGRAMMiNG, Don’t Repeat Yourself (DRY) is perhaps one of the most fundamental. The principle was formulated by Andy Hunt and Dave Thomas in Th...
分类:其他好文   时间:2015-04-23 10:59:27    阅读次数:123
全球五大顶级域名总量跌至1.35亿:4月第1周净减8.6万
IDC评述网(idcps.com)04月23日报道:根据WebHosting.info公布的最新数据显示,在4月第1周,全球五大顶级域名总量持续降至135,815,136个,共净减86,689个,环比降幅减少39.7%。其中,域名.COM净减27,859个,是五大顶级域名中唯一一个降幅环比缩小的。...
分类:其他好文   时间:2015-04-23 10:57:59    阅读次数:140
关于JLable列表的自动滚动条的显示:当JLable列表的内容超出JPanel面板所规定的高度时,自动显示滚动条的方法
关于JLable列表的自动滚动条的显示:当JLable列表的内容超出JPanel面板所规定的高度时,自动显示滚动条的方法; 通过下面的方式把JLable表的宽度和高度锁死,不能根据列表内容的增加而自动出现滚动条; 列表会显示不出全部内容,所以必须采用自动获取列表高度的方法; 这样列表的滚动条出来了,但是列表的标题却没显示出来,经过分析发现是只获取列表的高度,会把标题占用的高度覆盖,所以才显示不出来....
分类:其他好文   时间:2015-04-23 10:59:34    阅读次数:159
Leetcode16: Number of 1 Bits
Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight). For example, the 32-bit integer ’11' has binary representation 000000...
分类:其他好文   时间:2015-04-23 10:59:45    阅读次数:206
最长共同子序列 --- DP(动态规划)
题目,就是首先输入两个串的长度, 接着输入两个串  n = 4 m = 4 s = "abcd" t = "bcde" 输出: 3 (“bcd”) 就是公共的最长子序列。 解题分析: 对于这种题目,首先要推倒转移方程,那么这里可以先定义二维数组dp[ i ] [ j ] 然后根据串 s  和 t 的长度 i , j来定义方程 s1....si...
分类:其他好文   时间:2015-04-23 10:56:28    阅读次数:126
leetcode || 109、Convert Sorted List to Binary Search Tree
problem: Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. Hide Tags  Depth-first Search Linked List 题意:给定一个递增的单链表,将其转...
分类:其他好文   时间:2015-04-23 10:58:24    阅读次数:165
LeetCode --- 110. Balanced Binary Tree
题目链接:Balanced Binary Tree Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees ...
分类:其他好文   时间:2015-04-23 10:58:02    阅读次数:153
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!