最近发现要恶补的东西实在是太多了,DX还没学完,现在发现还要用Lua脚本语言,于是,我的笔记又加了一个系列,Lua学习笔记。
一.简介
Lua是一门小巧的脚本语言,其设计目的是为了嵌入应用程序中,从而为应用程序提供灵活的扩展和定制功能。Lua由标准C编写而成,几乎在所有操作系统和平台上都可以编译,运行。Lua并没有提供强大的库,这是由它的定位决定的。所以Lua不适合作为开发独立应用程序...
分类:
其他好文 时间:
2015-08-15 11:57:17
阅读次数:
155
function [F, maxf, V, S] = Ford_Fulkerson(C, src, sink)
n = size(C, 1);
F = zeros(n);
maxf = 0;
V = [];
S = [];
while true
% in: ResNet.
ResNet = C - F + F'; % residual network.
% ou...
分类:
编程语言 时间:
2015-08-15 11:59:02
阅读次数:
293
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
一、 链接属性
C语言中链接属性决定如何处理在不同文件中出现的标示符。标示符的作用域与它的链接属性有关,但这两个属性并不相同。
链接属性有3种: external(外部),internal(内部) 和 none(无)。
1. none: 没有链接的标示符,总是被当做单独的个体,也就是说改标示符的多个声明被当做不同的实体。
2. internal: 在同一个源文件内的所有声明中都指同一个实体...
分类:
编程语言 时间:
2015-08-15 11:58:20
阅读次数:
171
溢出文本显示省略号的效果:
white-space:nowrap; 强制文本在一行显示
overflow:hidden; 溢出内容为隐藏
text-overflow:ellipsis; 当对象内文本溢出时显示省略标记(...)...
分类:
Web程序 时间:
2015-08-15 11:58:31
阅读次数:
149
统计函数主要实现的是较为复杂的统计函数如countif、sumif、frequency,也是,直接上代码/**
* 项目名称:
* 文件说明:
* 主要特点:文件说明:EXCEL函数类型:统计函数
* 简单的函数如sum,average等等就不实现了
* 版本号:1.0
* 制作人:刘晨曦
* 创建时间:2013-12-3
**/
package EXCEL;
im...
分类:
编程语言 时间:
2015-08-15 11:57:31
阅读次数:
196
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