最近发现要恶补的东西实在是太多了,DX还没学完,现在发现还要用Lua脚本语言,于是,我的笔记又加了一个系列,Lua学习笔记。
一.简介
Lua是一门小巧的脚本语言,其设计目的是为了嵌入应用程序中,从而为应用程序提供灵活的扩展和定制功能。Lua由标准C编写而成,几乎在所有操作系统和平台上都可以编译,运行。Lua并没有提供强大的库,这是由它的定位决定的。所以Lua不适合作为开发独立应用程序...
分类:
其他好文 时间:
2015-08-15 11:57:17
阅读次数:
155
Description
Have you heard the fact “The base of every normal number system is 10” ? Of course, I am not talking about number systems like Stern Brockot Number System. This problem has nothing to do w...
分类:
其他好文 时间:
2015-08-15 11:57:34
阅读次数:
143
初始化方法的标准结构是这样子的:
- (instancetype)init
{
self = [super init]; // call the designated initializer
if (self) {
// Custom initialization
}
return self;
}
我们主要来看看,这一句:
self...
分类:
其他好文 时间:
2015-08-15 11:57:24
阅读次数:
122
今天写了一个System V消息队列的小例子,定义了一个如下的结构体:#define MSG_SIZE 8192struct request
{
long mtype;
int client_id;
char pathname[MSG_SIZE];
};
接着我调用msgsnd想把这个结构体发送给server,但是发现报错了:
msgsnd error, Invalid...
分类:
其他好文 时间:
2015-08-15 11:59:20
阅读次数:
436
Billboard
Time Limit: 20000/8000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 15625 Accepted Submission(s): 6580
Problem Description
At the entranc...
分类:
其他好文 时间:
2015-08-15 11:56:52
阅读次数:
178
Description 反正切函数可展开成无穷级数,有如下公式 (其中0 <= x <= 1) 公式(1) 使用反正切函数计算PI是一种常用的方法。例如,最简单的计算PI的方法: PI=4arctan(1)=4(1-1/3+1/5-1/7+1/9-1/11+...) 公式(2) 然而,这种方法的效率很低,但我们可以根据角度和的正切函数公式: tan(a+...
分类:
其他好文 时间:
2015-08-15 11:56:37
阅读次数:
131
题目链接:hdu 5380 Travel with candy
保持油箱一直处于满的状态,维护一个队列,记录当前C的油量中分别可以以多少价格退货,以及可以推货的量。每到一个位置,可以该商店的sell值更新队列中所有价格小于sell的(还没有卖)。用buy值更新队列中大于buy(卖掉了)。移动所消耗的油从价格最低的开始。
#include
#include
#include ...
分类:
其他好文 时间:
2015-08-15 11:56:37
阅读次数:
202
Power Strings
Time Limit: 3000MS
Memory Limit: 65536K
Total Submissions: 37817
Accepted: 15653
Description
Given two strings a and b we define a*b to be their concate...
分类:
其他好文 时间:
2015-08-15 11:58:34
阅读次数:
111
题目链接:hdu 5381 The sum of gcd
将查询离线处理,按照r排序,然后从左向右处理每个A[i],碰到查询时处理。用线段树维护,每个节点表示从[l,i]中以l为起始的区间gcd总和。所以每次修改时需要处理[1,i-1]与i的gcd值,但是因为gcd值是递减的,成log级,对于每个gcd值记录其区间即可。然后用线段树段修改,但是是修改一个等差数列。
#inclu...
分类:
其他好文 时间:
2015-08-15 11:56:05
阅读次数:
125
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1251
题意:先给出字典。每次查询一个单词,求以该单词为前缀的个数。
思路:裸字典树
代码
#include
#include
#include
#include
#include
#include
using namespace std;
#define...
分类:
其他好文 时间:
2015-08-15 11:56:34
阅读次数:
118
分布式文件系统
[hadoop]
KFS-Kosmos File System
fasthdf
介绍:http://www.programmer.com.cn/4380/
参考:
HDFS和KFS 比较分布式数据库
HBASE
hypertable
参考:
Hypertable 简介 (一个 C++ 的Bigtable开源实现) 开源云系统
OpenStack
参考:
云存储系统设计...
分类:
其他好文 时间:
2015-08-15 11:55:48
阅读次数:
137
题目链接:hdu 5384 Danganronpa
把B集合串建立自动机,然后A集合串一一去匹配即可。
#include
#include
#include
#include
#include
#include
#include
using namespace std;
typedef long long ll;
const int maxn = 1e5 + 5...
分类:
其他好文 时间:
2015-08-15 11:56:23
阅读次数:
131
DescriptionThere are several ancient Greek texts that contain descriptions of the fabled island Atlantis. Some of these texts even include maps of par...
分类:
其他好文 时间:
2015-08-15 11:56:26
阅读次数:
161
操作系统:win7VS2010编写WebService与在IIS的发布中我已经说了IIS安装与使用,不明白的可以跳过去看。1.添加FTP站点2.3.4.5.zqz上的小黑点代表未启动,记得要启动!6.打开浏览器7.添加虚拟目录8.9.qq添加成功10.11.再次添加一个虚拟目录:aa12.13.14...
分类:
其他好文 时间:
2015-08-15 11:53:48
阅读次数:
96
Since we are not allowed to rob two adjacent houses, we keep two variablespreandcur. During thei-th loop,prerecords the maximum profit that we do not ...
分类:
其他好文 时间:
2015-08-15 11:54:05
阅读次数:
114
有购买视频教程的朋友给我反应qq兴趣部落发帖被秒删,该怎么解决?其实按照我现在的操作情况来看,一般是不会被秒删的,我也很少碰到被秒删的情况。当然我也会分析下,大概在什么情况下会被秒删,以及我们的对策。
分类:
其他好文 时间:
2015-08-15 11:55:23
阅读次数:
294
hadoop2.0已经发布了稳定版本了,增加了很多特性,比如HDFS HA、YARN等。注意:apache提供的hadoop-2.2.0的安装包是在32位操作系统编译的,因为hadoop依赖一些C++的本地库, 所以如果在64位的操作上安装hadoop-2.2.0就需要重新在64操作系统上重新编译 ...
分类:
其他好文 时间:
2015-08-15 11:54:01
阅读次数:
142