我用字符串哈希(bkdhash)写的,C++代码如下:
#include
using namespace std;
typedef unsigned long long ull;
char arr[1000001];
ull nbase[1000001];
ull Hash[1000001];
int base = 31;
void main()
{
nbase[0] = 1;
for...
分类:
其他好文 时间:
2016-05-12 22:36:17
阅读次数:
553
字符设备的控制
1. 字符设备控制理论
1.1 作用
大部分驱动程序除了需要提供读写设备的能力外,还需要具备控制设备的能力。比如:改变波特率
1.2 应用程序接口
在用户空间,使用ioctl系统调用来控制设备,原型如下:
int ioctl(int fd, unsigned long cmd, ...)
...
分类:
其他好文 时间:
2016-05-12 18:46:21
阅读次数:
195
接着上一篇博客,这一次我们初步了解一些MySQL数据库中的约束。
六自动编号
AUTO_INCREMENT
自动编号的字段,必须与主键组合使用。默认情况下,起始值为1,每次的增量为1。
例子:
CREATE TABLE tb3(
id SMALLINT UNSIGNED AUTO_INCREM...
分类:
数据库 时间:
2016-05-12 18:33:50
阅读次数:
202
#include //程序是基于KEIL-C51编写,引入8051头文件
sbit P10=P1^0;
sbit P11=P1^1;
unsigned int scale; //占空比控制变量
void main(void)
{ unsigned int n; //延时循环变量
TMOD=0x02; //定时器0,工作模式2(...
分类:
其他好文 时间:
2016-05-12 17:19:46
阅读次数:
144
创建NSObject的类目,引入runtime
#import
.m文件
/**
* 获取所有属性及对应的值
*
*/
-(NSDictionary *)getAllPropertiesAndValues{
NSMutableDictionary *props = [NSMutableDictionary dictionary];
unsigned int ...
分类:
其他好文 时间:
2016-05-12 17:05:29
阅读次数:
106
// Test.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include
#include
#include
typedef unsigned (__stdcall*LP_THREAD_FUN)(void*);
class Thread{
public:
Thread(){
m_fun = NULL;
m_param = NUL...
分类:
编程语言 时间:
2016-05-12 17:01:18
阅读次数:
186
题目坑爹,行列是从0开始算的,所以样例中是指最中间那个1为棋子
f[i][S]表示考虑到第i行,第i行状态为S的方案数
矩乘优化即可
开内存小了1,蛋疼。
#include
#include
#include
#include
#include
#include
#define ll unsigned int
using namespace std;
struct yts
...
分类:
其他好文 时间:
2016-05-12 16:21:14
阅读次数:
160
51单片机定时器中断函数中变量初始化的问题 #include//调用头文件 #define uint unsigned int //宏定义
#define uchar unsigned char uint n=0; //查表变量
uchar temp[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f...
分类:
其他好文 时间:
2016-05-12 15:35:58
阅读次数:
148
【项目-Time类中的运算符重载】
实现Time类中的运算符重载。class CTime
{
private:
unsigned short int hour; // 时
unsigned short int minute; // 分
unsigned short int second; // 秒
public:
CTime(int h=0,int m...
分类:
编程语言 时间:
2016-05-12 12:57:19
阅读次数:
313
我们在代码编程中,经常用到各种小方法
下面是一些总结:(不定时增加)16进制设置颜色- (instancetype)colorFromHexString:(NSString *)hexString Alpha:(CGFloat)alpha
{
unsigned rgbValue = 0;
hexString = [hexString stringByReplacingOccurre...
分类:
移动开发 时间:
2016-05-12 11:56:07
阅读次数:
234