1,当只要一行数据时使用 LIMIT 1如果明确只取一条数据,要加上limit 1;2,避免 SELECT *,根据需要获取字段应该养成一个需要什么就取什么的好的习惯。3,使用 ENUM 而不是 VARCHARENUM 类型是非常快和紧凑的。在实际上,其保存的是 TINYINT,但其外表上显示为字符...
分类:
数据库 时间:
2015-05-22 14:49:14
阅读次数:
134
#include using namespace std;typedef enum Color
{
RED,
BLACK,
}Color;
template
struct RbNode
{
Color color;
Type data;
RbNode *parent;
RbNode<Type...
分类:
编程语言 时间:
2015-05-22 13:32:05
阅读次数:
180
工作中有一个点击button更新button上文案的需求,用自定义了button可以很简单的实现的这个需求首先写个自定义的buttonCustomButton.h#import typedef NS_ENUM(NSUInteger, CustomButtonStatus){ CustomBut...
分类:
移动开发 时间:
2015-05-21 19:24:40
阅读次数:
173
1 1.segmentedControlStyle 2 设置segment的显示样式。 3 typedef NS_ENUM(NSInteger, UISegmentedControlStyle) { 4 UISegmentedControlStylePlain, // large plai...
分类:
其他好文 时间:
2015-05-21 19:14:38
阅读次数:
135
1 #include 2 #include 3 using namespace std; 4 enum Rank{i3,i5,i7}; 5 class CPU{ 6 public: 7 CPU(){} 8 int Getv(){ 9 return v;10 }...
分类:
其他好文 时间:
2015-05-21 18:50:27
阅读次数:
103
基本上使用预处理指令#define的地方都可以使用const,enum或者inline来替换掉它。主要的原因有两个:
#define ASPECT_RATIO 1.653
1.预处理指令是在编译前就进行预处理的(gcc -E进行预处理,它的输出文件作为gcc -S进行编译的输入),所以编译器是看不到#define定义的符号ASPECT_RATIO ,故它不会出现在符号表中,这样如果编译期间出现...
分类:
编程语言 时间:
2015-05-21 17:27:24
阅读次数:
148
using System;using System.Collections.Generic;using System.Text;using System.IO;using System.Net;namespace BaseInfo{ public enum Ftpud { ...
分类:
其他好文 时间:
2015-05-21 10:31:48
阅读次数:
147
1. 创建一个文本输入框
UITextField*textField=[[UITextField alloc]initWithFrame:CGRectMake(10, 30, 300, 30)];
2. 设置边框样式
textField.borderStyle = UITextBorderStyleRoundedRect;//圆角
typedef enum {...
分类:
其他好文 时间:
2015-05-20 18:28:02
阅读次数:
106
//初始化textfield并设置位置及大小UITextField *text = [[UITextField alloc] initWithFrame:CGRectMake(20, 20, 130, 30)];//设置边框样式,只有设置了才会显示边框样式typedef enum { UIText....
分类:
其他好文 时间:
2015-05-20 18:17:40
阅读次数:
129
用法一:常量 在JDK1.5 之前,我们定义常量都是: public static fianl.... 。现在好了,有了枚举,可以把相关的常量分组到一个枚举类型里,而且枚举提供了比常量更多的方法。 public?enum?Color?{??
??R...
分类:
编程语言 时间:
2015-05-20 15:11:34
阅读次数:
182