在Hadoop的MR程序开发中,经常需要统计一些map/reduce的运行状态信息,这个时候我们可以通过自定义Counter来实现,这个实现的方式是不是通过配置信息完成的,而是通过代码运行时检查完成的。 1、创建一个自己的Counter枚举类。enum PROCESS_COUNTER { ...
分类:
其他好文 时间:
2015-09-22 18:51:35
阅读次数:
244
create table join_teacher(id int primary key auto_increment,t_name varchar(10) not null,gender enum('male','female','secret') not null)engine innodb c...
分类:
数据库 时间:
2015-09-21 23:40:11
阅读次数:
258
引用高级、引用高级增加
#include
#include
// int a[10]
// int (&ra)[10]
// int a[2][5]
// int (&ra)[2][5]
void main1()
{
int a[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
int(&ra)[10](a);//引用就是给原来的变量有一个别名同一个...
分类:
编程语言 时间:
2015-09-21 14:15:17
阅读次数:
268
枚举,类似于数据库中的表。难点:实例值和原始值。import Foundationenum Sex{ case Male(Int,Int) case Female(String)}var barrySex=Sex.Male(3,5)barrySex = .Female("刀冲")enum Cou.....
分类:
编程语言 时间:
2015-09-21 14:06:51
阅读次数:
190
using System;using System.Collections.Generic;using System.Text;namespace ConsoleApplication1{ class Program { enum xingqi { ...
分类:
其他好文 时间:
2015-09-21 10:19:45
阅读次数:
105
条款2:尽量以const, enum, inline替换#define 1.条款中有这个一句话“ 这个条款或许改为“宁可以编译器替换预处理器”比较好 ”,因为#define在预处理阶段就直接被替换了宏实际定义的具体内容,按着书上定义的宏来举例#define APSECT_RATIO 1.653 .....
分类:
编程语言 时间:
2015-09-20 13:16:48
阅读次数:
235
空结构体占用的内存多大? 1 struct d 2 { 3 4 }; 5 6 int main() 7 8 { 9 10 struct d d1;11 12 struct d d2;13 14 printf("%d,%0x\n",size...
分类:
编程语言 时间:
2015-09-19 15:06:18
阅读次数:
155
enum enum 全称(Enumeration),即一种由一组称为枚举数列表的命名常量组成的独特类型。 通常情况下,最好是在命名空间內直接定义 enum,以便该命名空间中所有的类都能够同样方便地访问它。 当然,也可以把enum嵌套在类或结构体中。 默认情况下,第一个枚举数的值为 0,后面每个枚举数...
分类:
编程语言 时间:
2015-09-19 12:27:00
阅读次数:
151
C#中枚举是一个非常好用的类型,用会了之后确实方便了很多。项目中一个枚举类型:public enum Version_Type : byte{ [Description("1997版")] 版本1997 = 0 , [Description("2007版")] 版本200...
enum season{ spring = 1, summer, autumn, winter //没有, };//; //变量类型是 enum season 变量名是 currentSeason 变量初始值为spring enum season currentSeas...
分类:
编程语言 时间:
2015-09-18 17:58:56
阅读次数:
247