这个函数改的深入理解程序设计 使用linux汇编语言里的例子。 相比书中的例子,主要改变为: 对底数为1。指数为1都进行特殊处理。 可以在64为平台编译通过,原书pushl %ebp 在64位平台编译不过,改为push %rbp。 ...
分类:
其他好文 时间:
2015-07-19 20:17:41
阅读次数:
155
描述:
假设你有一个各位数字互不相同的四位数,把所有的数字从大到小排序后得到a,从小到大后得到b,然后用a-b替换原来这个数,并且继续操作。例如,从1234出发,依次可以得到4321-1234=3087、8730-378=8352、8532-2358=6174,又回到了它自己!现在要你写一个程序来判断一个四位数经过多少次这样的操作能出现循环,并且求出操作的次数,比如输入1234执行顺序是1234...
分类:
其他好文 时间:
2015-07-19 20:16:24
阅读次数:
104
题目描述
链接地址
解法
算法解释题目描述Given 2*n + 1 numbers, every numbers occurs twice except one, find it. ExampleGiven [1,2,2,1,3,4,3], return 4链接地址http://www.lintcode.com/en/problem/single-number/解法 int singleNu...
分类:
其他好文 时间:
2015-07-19 20:14:13
阅读次数:
137
#创建树,让树的每一个节点都变成度数为2的树
通过先序遍历124###3##可以唯一确定一棵树。
// nonrecursion.cpp
// 对树的操作
#define _CRT_SECURE_NO_WARNINGS
#include
#include
#include
using namespace std;
// 二叉树表示法
typedef struct BiTNode...
分类:
其他好文 时间:
2015-07-19 20:14:03
阅读次数:
169
#include
#include
using namespace std;
/**
* return:
* -1:can not find;
* positive:find the first position;
*/
int findPosition(vector v,int size, int requestHalfSum){
int sum=0;
for(int i=...
分类:
其他好文 时间:
2015-07-19 20:13:58
阅读次数:
111
四个角色:
Receiver:命令最终传到这里,执行命令的,但可以执行多种命令
Command:拥有Receiver的指针,通过需要执行某种命令
Invoker:记录和触发命令
Client:应用
/*Command pattern*/
/* Author hugewave*/
#include
#include
#include
using namespace std;...
分类:
其他好文 时间:
2015-07-19 20:13:44
阅读次数:
111
ECMAScript 6中新增了一个全局构造函数:Proxy。该构造函数可以接收两个参数:一个目标对象,一个处理对象。
代码示例:
var target = {};
var handler = {};
var proxy = new Proxy(target, handler);
proxy将具有与target类似的内部属性/方法;handler可以作为proxy方法的拦截器。...
分类:
其他好文 时间:
2015-07-19 20:14:33
阅读次数:
129
之前我们制定了一个很简单的RPC消息 的格式,但没有实现相应的encode和decode方法,下面我们处理掉这个编解码问题。这里我还是简单原则,重点在于晓义嘛。利用python里的两个运算。 str 和eval,实现编解码。...
分类:
其他好文 时间:
2015-07-19 20:14:06
阅读次数:
171
每个好架构师都是一位出色的程序员(卓越的程序员)驾驭概念的技能是最高潜力(抽象思维)站在技术的山顶向前眺望(技术的前瞻性)架构师修炼课程:透过问题看本质(问题解决大师)架构师:要成为百科全书式的智者(多领域知识)架构师:一群善于沟通的技术领袖(沟通能力)由“实”及“虚”的架构师学习之旅(内力)架构师...
分类:
其他好文 时间:
2015-07-19 20:11:37
阅读次数:
200
4.0.0 asia.banseon banseon-maven2 jar 1.0-SNAPSHOT banseon-maven http://www.baidu.com/banseon A maven project to study maven. jira http://jira.b...
分类:
其他好文 时间:
2015-07-19 20:09:36
阅读次数:
223
NSAttributedString(富文本)的基本用法
分类:
其他好文 时间:
2015-07-19 20:12:12
阅读次数:
27268
常见问题1、sudo gem install cocoapods 如下所示报错ERROR: Could not find a valid gem 'cocoapods' (>= 0), here is why: Unable to download data from https://rub...
分类:
其他好文 时间:
2015-07-19 20:09:51
阅读次数:
529
1305: [CQOI2009]dance跳舞Time Limit:5 SecMemory Limit:162 MBSubmit:1877Solved:799[Submit][Status][Discuss]Description一次舞会有n个男孩和n个女孩。每首曲子开始时,所有男孩和女孩恰好配成n...
分类:
其他好文 时间:
2015-07-19 20:07:51
阅读次数:
117
POJ1700Time Limit:1000MSMemory Limit:10000KB64bit IO Format:%I64d & %I64uDescriptionA group of N people wishes to go across a river with on...
分类:
其他好文 时间:
2015-07-19 20:03:32
阅读次数:
146
Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists:A: a...
分类:
其他好文 时间:
2015-07-19 20:03:04
阅读次数:
99
根据官方在Git上的描述https://github.com/AFNetworking/AFNetworking/wiki/Getting-Started-with-AFNetworking1、在所用的工程里面创建pod file 命令行操作示$ cd /Users/UserName/Documen...
分类:
其他好文 时间:
2015-07-19 20:03:32
阅读次数:
111