之前就保留过简陋的几个用外部数组变量实现的简单大数模板,也没有怎么用过,今天就想着整合封装一下,封装成C++的类,以后需要调用的时候也方便得多。

实现了基本的加减乘除和取模运算的操作符重载,大数除以大数难度太大就没实现,另外还实现了比较运算符,方便实际使用贴近内置类型的体验。

话不多说,贴代码。

/*BigInt.h*/

 #include <stdio.h>
 #include <string.h>
 #include <ctype.h>

 #define MAXBIT 1007
 #define BITTYPE int

 class BigInt {
 private:
     BITTYPE bit[MAXBIT];
     bool negative;//负数标志

 public:
     BigInt();                //默认构造函数,值为0
     BigInt(const int);        //构造函数
     BigInt(const char *);    //构造函数
     BigInt(const BigInt &);    //复制构造函数

     /*重载赋值运算符*/
     BigInt& operator=(const BigInt&);
     BigInt& operator=(const int        );

     /*重载算数运算符*/
     BigInt operator+(const BigInt&    )const;
     BigInt operator+(const int        )const;
     BigInt operator-(const BigInt&    )const;
     BigInt operator-(const int        )const;
     BigInt operator*(const BigInt&    )const;
     BigInt operator*(const int        )const;
     BigInt operator/(const int        )const;
     int    operator%(const int        )const;

     /*重载比较运算符*/
     bool operator>(const BigInt&    )const;
     bool operator>(const int        )const;
     bool operator>=(const BigInt&    )const;
     bool operator>=(const int        )const;
     bool operator<(const BigInt&    )const;
     bool operator<(const int        )const;
     bool operator<=(const BigInt&    )const;
     bool operator<=(const int        )const;
     bool operator==(const BigInt&    )const;
     bool operator==(const int        )const;
     bool operator!=(const BigInt&    )const;
     bool operator!=(const int        )const;

     void print()        const;//输出数值
     bool isZero()        const;//是否为0
     bool isPositive()    const;//是否为正数
     bool isNegative()    const;//是否为负数
     bool nonNegative()    const;//是否为非负数

 private:
     BigInt opposite()const;//取相反数
     BigInt absoluteAdd(const BigInt&)const;//加上绝对值
     BigInt absoluteMinus(const BigInt&)const;//减去绝对值小于自身的数的绝对值
     bool   absoluteEqual(const BigInt&)const;//绝对值等于
     bool   absoluteGreater(const BigInt&)const;//绝对值大于
     bool   absoluteEqualGreater(const BigInt&)const;//绝对值大于等于
 };

 BigInt::BigInt()
 {
     memset(bit,,sizeof(bit));
     negative = false;
 }

 BigInt::BigInt(const int n)
 {
     memset(bit,,sizeof(bit));
     int nn = n;
     ) negative = false;
     else {
         negative = true;
         nn = -nn;
     }
     ;
     while (nn) {
         bit[pos++] = nn % ;
         nn /= ;
     }
 }

 BigInt::BigInt(const char *s)
 {
     int len = strlen(s);
     bool valid = true;//符合数字格式
     ) {
         ]!=]!=])) valid = false;
         ; i<len; ++i) {
             if (!isdigit(s[i])) valid = false;
         }
     }
     ) {
         ])) valid = false;
     }
      || !valid) {
         memset(bit,,sizeof(bit));
         negative = false;
         return;
     }
     , end = len-;
     ] == '+') {
         negative = false;
         ++beg;
     }
     ] == '-') {
         bool zeroFlag = true;
         ; i<len; ++i) {
             ') {
                 zeroFlag = false;
                 break;
             }
         }
         if (zeroFlag) negative = false;
         else negative = true;
         ++beg;
     }
     else negative = false;
     memset(bit,,sizeof(bit));
     for (int i=beg; i<=end; ++i) {
         bit[len--i] = s[i] - ';
     }
 }

 BigInt::BigInt(const BigInt& n)
 {
     memcpy(bit,n.bit,sizeof(bit));
     negative = n.negative;
 }

 BigInt& BigInt::operator=(const BigInt& n)
 {
     memcpy(bit,n.bit,sizeof(bit));
     negative = n.negative;
     return *this;
 }

 BigInt& BigInt::operator=(const int n)
 {
     return *this = BigInt(n);
 }

 BigInt BigInt::operator+(const BigInt& n)const
 {
     if ((!negative && !n.negative) || (negative && n.negative)) {
         return this->absoluteAdd(n);
     }
     else {
         if (absoluteEqual(n)) return BigInt();
         else if (absoluteEqualGreater(n)) return this->absoluteMinus(n);
         else return n.absoluteMinus(*this);
     }
 }

 BigInt BigInt::operator+(const int n)const
 {
     return *this + BigInt(n);
 }

 BigInt BigInt::operator-(const BigInt& n)const
 {
     return *this + n.opposite();
 }

 BigInt BigInt::operator-(const int n)const
 {
     return *this - BigInt(n);
 }

 BigInt BigInt::operator*(const BigInt& n)const
 {
     if (isZero() || n.isZero()) return BigInt();
     BigInt bi = BigInt();
     if ((!negative && !n.negative) || (negative && n.negative)) {
         bi.negative = false;
     }
     else bi.negative = true;
     ; i<MAXBIT; ++i) ; j<MAXBIT-i; ++j) {
         bi.bit[i+j] += bit[i] * n.bit[j];
     }
     ; i<MAXBIT-; ++i) {//进位
         bi.bit[i+] += bi.bit[i] / ;
         bi.bit[i] %= ;
     }
     return bi;
 }

 BigInt BigInt::operator*(const int n)const
 {
     return *this * BigInt(n);
 }

 BigInt BigInt::operator/(const int n)const
 {//除以0直接返回0
     ) return BigInt();
     BigInt bi = BigInt();
     ) || (negative && n<)) {
         bi.negative = false;
     }
     else bi.negative = true;
     ;//累计除数
     ; i>=; --i) {
         div = div *  + bit[i];
         bi.bit[i] = div / n;
         div %= n;
     }
     return bi;
 }

 int BigInt::operator%(const int n)const
 {
     ;//累计余数
     ; i>=; --i) {
         //mod = ((mod*(MAXBIT+1/*??*/)) + bit[i]) % n;
         mod = ((mod*) + bit[i]) % n;
     }
     return mod;
 }

 bool BigInt::operator>(const BigInt& n)const
 {
     if (!negative && n.negative) return true;
     else if (negative && !n.negative) return false;
     else if (!negative && !n.negative) return absoluteGreater(n);
     else return n.absoluteGreater(*this);
 }

 bool BigInt::operator>(const int n)const
 {
     return *this > BigInt(n);
 }

 bool BigInt::operator>=(const BigInt& n)const
 {
     if (!negative && n.negative) return true;
     else if (negative && !n.negative) return false;
     else if (!negative && !n.negative) return absoluteEqualGreater(n);
     else return n.absoluteEqualGreater(*this);
 }

 bool BigInt::operator>=(const int n)const
 {
     return *this >= BigInt(n);
 }

 bool BigInt::operator<(const BigInt& n)const
 {
     return n > *this;
 }

 bool BigInt::operator<(const int n)const
 {
     return *this < BigInt(n);
 }

 bool BigInt::operator<=(const BigInt& n)const
 {
     return n >= *this;
 }

 bool BigInt::operator<=(const int n)const
 {
     return *this <= BigInt(n);
 }

 bool BigInt::operator==(const BigInt& n)const
 {
     if (negative != n.negative) return false;
     ; i<MAXBIT; ++i) {
         if (bit[i] != n.bit[i]) return false;
     }
     return true;
 }

 bool BigInt::operator==(const int n)const
 {
     return *this == BigInt(n);
 }

 bool BigInt::operator!=(const BigInt& n)const
 {
     if (negative != n.negative) return true;
     ; i<MAXBIT; ++i) {
         if (bit[i] != n.bit[i]) return true;
     }
     return false;
 }

 bool BigInt::operator!=(const int n)const
 {
     return *this != BigInt(n);
 }

 void BigInt::print()const
 {
     if (negative) printf("-");
     ;
     ; --pos) {
         if (bit[pos]) break;
     }
     ; --i) printf("%d",bit[i]);
 }

 bool BigInt::isZero()const
 {
     bool zeroFlag = true;
     ; i<MAXBIT; ++i) {
         ) {
             zeroFlag = false;
             break;
         }
     }
     return zeroFlag;
 }

 bool BigInt::isPositive()const
 {
     return !negative && !isZero();
 }

 bool BigInt::isNegative()const
 {
     return negative;
 }

 bool BigInt::nonNegative()const
 {
     return !negative;
 }

 BigInt BigInt::opposite()const
 {
     BigInt n(*this);
     if (!n.isZero()) n.negative = !n.negative;
     return n;
 }

 BigInt BigInt::absoluteAdd(const BigInt& n)const
 {
     BigInt bi(*this);
     ;//进位
     ; i<MAXBIT; ++i) {
         bi.bit[i] = (bit[i] + n.bit[i] + next) % ;
         next   = (bit[i] + n.bit[i] + next) / ;
     }
     return bi;
 }

 BigInt BigInt::absoluteMinus(const BigInt& n)const
 {
     BigInt bi(*this);
     ; i>=; --i) {
         if (bi.bit[i]>=n.bit[i]) bi.bit[i] -= n.bit[i];
         else {//借位
             ;//借位位
             ) ++borrow;
             --bi.bit[borrow];
             ; j<borrow; ++j) bi.bit[j] = ;
             bi.bit[i] = bi.bit[i] +  - n.bit[i];
         }
     }
     return bi;
 }

 bool BigInt::absoluteEqual(const BigInt& n)const
 {
     ; i<MAXBIT; ++i) {
         if (bit[i] != n.bit[i]) return false;
     }
     return true;
 }

 bool BigInt::absoluteGreater(const BigInt& n)const
 {
     ; i>=; --i) {
         if (bit[i]>n.bit[i]) return true;
         else if (bit[i]<n.bit[i]) return false;
     }
     return false;
 }

 bool BigInt::absoluteEqualGreater(const BigInt& n)const
 {
     ; i>=; --i) {
         if (bit[i]>n.bit[i]) return true;
         else if (bit[i]<n.bit[i]) return false;
     }
     return true;
 }

代码调用也挺方便,如下例子:

 #include "BigInt.h"

 int main()
 {
     BigInt m = ;
     BigInt n("-32143542");
     if (m >= n) puts("m >= n");
     n = m + n;
     n = n * ;
     n.print();
     ;
 }

模板写成后特地去poj刷了大数相加和大数相乘两道水题,一次ac的满足感可是杠杠的~

欢迎大家参考,测试,批评指正bug和不足之处,感谢~

---------------------------------------------------------------------------------------------

2014/10/15更新

添加了重载负号,+=,-=,*=,/=,%=,还有string()函数返回值的字符串功能

/*BigInt.h*/

 #include <stdio.h>
 #include <string.h>
 #include <ctype.h>

 #define MAXBIT 1007
 #define BITTYPE int

 class BigInt {
 private:
     BITTYPE bit[MAXBIT];
     bool negative;//负数标志

 public:
     BigInt();                //默认构造函数,值为0
     BigInt(const int);        //构造函数
     BigInt(const char *);    //构造函数
     BigInt(const BigInt &);    //复制构造函数

     /*重载赋值运算符*/
     BigInt& operator=(const BigInt&);
     BigInt& operator=(const int        );

     /*重载算数运算符*/
     BigInt operator+(const BigInt&    )const;
     BigInt operator+(const int        )const;
     BigInt operator+=(const BigInt&    );
     BigInt operator+=(const int        );
     BigInt operator-(const BigInt&    )const;
     BigInt operator-(const int        )const;
     BigInt operator-=(const BigInt&    );
     BigInt operator-=(const int        );
     BigInt operator-(                )const;
     BigInt operator*(const BigInt&    )const;
     BigInt operator*(const int        )const;
     BigInt operator*=(const BigInt&    );
     BigInt operator*=(const int        );
     BigInt operator/(const int        )const;
     BigInt operator/=(const int        );
     int    operator%(const int        )const;
     BigInt operator%=(const int        );

     /*重载比较运算符*/
     bool operator>(const BigInt&    )const;
     bool operator>(const int        )const;
     bool operator>=(const BigInt&    )const;
     bool operator>=(const int        )const;
     bool operator<(const BigInt&    )const;
     bool operator<(const int        )const;
     bool operator<=(const BigInt&    )const;
     bool operator<=(const int        )const;
     bool operator==(const BigInt&    )const;
     bool operator==(const int        )const;
     bool operator!=(const BigInt&    )const;
     bool operator!=(const int        )const;

     void print()        const;//输出数值
     char *string()        const;//返回数值字符串
     bool isZero()        const;//是否为0
     bool isPositive()    const;//是否为正数
     bool isNegative()    const;//是否为负数
     bool nonNegative()    const;//是否为非负数

 private:
     BigInt opposite()const;//取相反数
     BigInt absoluteAdd(const BigInt&)const;//加上绝对值
     BigInt absoluteMinus(const BigInt&)const;//减去绝对值小于自身的数的绝对值
     bool   absoluteEqual(const BigInt&)const;//绝对值等于
     bool   absoluteGreater(const BigInt&)const;//绝对值大于
     bool   absoluteEqualGreater(const BigInt&)const;//绝对值大于等于
 };

 BigInt::BigInt()
 {
     memset(bit,,sizeof(bit));
     negative = false;
 }

 BigInt::BigInt(const int n)
 {
     memset(bit,,sizeof(bit));
     int nn = n;
     ) negative = false;
     else {
         negative = true;
         nn = -nn;
     }
     ;
     while (nn) {
         bit[pos++] = nn % ;
         nn /= ;
     }
 }

 BigInt::BigInt(const char *s)
 {
     int len = strlen(s);
     bool valid = true;//符合数字格式
     ) {
         ]!=]!=])) valid = false;
         ; i<len; ++i) {
             if (!isdigit(s[i])) valid = false;
         }
     }
     ) {
         ])) valid = false;
     }
      || !valid) {
         memset(bit,,sizeof(bit));
         negative = false;
         return;
     }
     , end = len-;
     ] == '+') {
         negative = false;
         ++beg;
     }
     ] == '-') {
         bool zeroFlag = true;
         ; i<len; ++i) {
             ') {
                 zeroFlag = false;
                 break;
             }
         }
         if (zeroFlag) negative = false;
         else negative = true;
         ++beg;
     }
     else negative = false;
     memset(bit,,sizeof(bit));
     for (int i=beg; i<=end; ++i) {
         bit[len--i] = s[i] - ';
     }
 }

 BigInt::BigInt(const BigInt& n)
 {
     memcpy(bit,n.bit,sizeof(bit));
     negative = n.negative;
 }

 BigInt& BigInt::operator=(const BigInt& n)
 {
     memcpy(bit,n.bit,sizeof(bit));
     negative = n.negative;
     return *this;
 }

 BigInt& BigInt::operator=(const int n)
 {
     return *this = BigInt(n);
 }

 BigInt BigInt::operator+(const BigInt& n)const
 {
     if ((!negative && !n.negative) || (negative && n.negative)) {
         return this->absoluteAdd(n);
     }
     else {
         if (absoluteEqual(n)) return BigInt();
         else if (absoluteEqualGreater(n)) return this->absoluteMinus(n);
         else return n.absoluteMinus(*this);
     }
 }

 BigInt BigInt::operator+(const int n)const
 {
     return *this + BigInt(n);
 }

 BigInt BigInt::operator+=(const BigInt& n)
 {
     return *this = *this + n;
 }

 BigInt BigInt::operator+=(const int n)
 {
     return *this = *this + n;
 }

 BigInt BigInt::operator-(const BigInt& n)const
 {
     return *this + n.opposite();
 }

 BigInt BigInt::operator-(const int n)const
 {
     return *this - BigInt(n);
 }

 BigInt BigInt::operator-=(const BigInt& n)
 {
     return *this = *this - n;
 }

 BigInt BigInt::operator-=(const int n)
 {
     return *this = *this - n;
 }

 BigInt BigInt::operator-()const
 {
     BigInt bi(*this);
     if (!this->isZero()) bi.negative = !bi.negative;
     return bi;
 }

 BigInt BigInt::operator*(const BigInt& n)const
 {
     if (isZero() || n.isZero()) return BigInt();
     BigInt bi = BigInt();
     if ((!negative && !n.negative) || (negative && n.negative)) {
         bi.negative = false;
     }
     else bi.negative = true;
     ; i<MAXBIT; ++i) ; j<MAXBIT-i; ++j) {
         bi.bit[i+j] += bit[i] * n.bit[j];
     }
     ; i<MAXBIT-; ++i) {//进位
         bi.bit[i+] += bi.bit[i] / ;
         bi.bit[i] %= ;
     }
     return bi;
 }

 BigInt BigInt::operator*(const int n)const
 {
     return *this * BigInt(n);
 }

 BigInt BigInt::operator*=(const BigInt& n)
 {
     return *this = *this - n;
 }

 BigInt BigInt::operator*=(const int n)
 {
     return *this = *this * n;
 }

 BigInt BigInt::operator/(const int n)const
 {//除以0直接返回0
     ) return BigInt();
     BigInt bi = BigInt();
     ) || (negative && n<)) {
         bi.negative = false;
     }
     else bi.negative = true;
     ;//累计除数
     ; i>=; --i) {
         div = div *  + bit[i];
         bi.bit[i] = div / n;
         div %= n;
     }
     return bi;
 }

 BigInt BigInt::operator/=(const int n)
 {//除以0直接返回0
     ) return BigInt();
     else return *this = *this / n;
 }

 int BigInt::operator%(const int n)const
 {
     ;//累计余数
     ; i>=; --i) {
         //mod = ((mod*(MAXBIT+1/*??*/)) + bit[i]) % n;
         mod = ((mod*) + bit[i]) % n;
     }
     return mod;
 }

 BigInt BigInt::operator%=(const int n)
 {
     ;//累计余数
     ; i>=; --i) {
         //mod = ((mod*(MAXBIT+1/*??*/)) + bit[i]) % n;
         mod = ((mod*) + bit[i]) % n;
     }
     return *this = BigInt(mod);
 }

 bool BigInt::operator>(const BigInt& n)const
 {
     if (!negative && n.negative) return true;
     else if (negative && !n.negative) return false;
     else if (!negative && !n.negative) return absoluteGreater(n);
     else return n.absoluteGreater(*this);
 }

 bool BigInt::operator>(const int n)const
 {
     return *this > BigInt(n);
 }

 bool BigInt::operator>=(const BigInt& n)const
 {
     if (!negative && n.negative) return true;
     else if (negative && !n.negative) return false;
     else if (!negative && !n.negative) return absoluteEqualGreater(n);
     else return n.absoluteEqualGreater(*this);
 }

 bool BigInt::operator>=(const int n)const
 {
     return *this >= BigInt(n);
 }

 bool BigInt::operator<(const BigInt& n)const
 {
     return n > *this;
 }

 bool BigInt::operator<(const int n)const
 {
     return *this < BigInt(n);
 }

 bool BigInt::operator<=(const BigInt& n)const
 {
     return n >= *this;
 }

 bool BigInt::operator<=(const int n)const
 {
     return *this <= BigInt(n);
 }

 bool BigInt::operator==(const BigInt& n)const
 {
     if (negative != n.negative) return false;
     ; i<MAXBIT; ++i) {
         if (bit[i] != n.bit[i]) return false;
     }
     return true;
 }

 bool BigInt::operator==(const int n)const
 {
     return *this == BigInt(n);
 }

 bool BigInt::operator!=(const BigInt& n)const
 {
     if (negative != n.negative) return true;
     ; i<MAXBIT; ++i) {
         if (bit[i] != n.bit[i]) return true;
     }
     return false;
 }

 bool BigInt::operator!=(const int n)const
 {
     return *this != BigInt(n);
 }

 void BigInt::print()const
 {
     if (negative) printf("-");
     ;
     ; --pos) {
         if (bit[pos]) break;
     }
     ; --i) printf("%d",bit[i]);
 }

 char *BigInt::string()const
 {
     ];
     ;
     if (negative) content[posi++] = '-';
     ;
     ; --pos) {
         if (bit[pos]) break;
     }
     //printf("pos = %d\n",pos);
     ; --i) {
         content[posi++] = bit[i] + ';
         //printf("bit[%d] = %d\n",i,bit[i]);
     }
     content[posi] = '\0';
     return content;
 }

 bool BigInt::isZero()const
 {
     bool zeroFlag = true;
     ; i<MAXBIT; ++i) {
         ) {
             zeroFlag = false;
             break;
         }
     }
     return zeroFlag;
 }

 bool BigInt::isPositive()const
 {
     return !negative && !isZero();
 }

 bool BigInt::isNegative()const
 {
     return negative;
 }

 bool BigInt::nonNegative()const
 {
     return !negative;
 }

 BigInt BigInt::opposite()const
 {
     BigInt n(*this);
     if (!n.isZero()) n.negative = !n.negative;
     return n;
 }

 BigInt BigInt::absoluteAdd(const BigInt& n)const
 {
     BigInt bi(*this);
     ;//进位
     ; i<MAXBIT; ++i) {
         bi.bit[i] = (bit[i] + n.bit[i] + next) % ;
         next   = (bit[i] + n.bit[i] + next) / ;
     }
     return bi;
 }

 BigInt BigInt::absoluteMinus(const BigInt& n)const
 {
     BigInt bi(*this);
     ; i>=; --i) {
         if (bi.bit[i]>=n.bit[i]) bi.bit[i] -= n.bit[i];
         else {//借位
             ;//借位位
             ) ++borrow;
             --bi.bit[borrow];
             ; j<borrow; ++j) bi.bit[j] = ;
             bi.bit[i] = bi.bit[i] +  - n.bit[i];
         }
     }
     return bi;
 }

 bool BigInt::absoluteEqual(const BigInt& n)const
 {
     ; i<MAXBIT; ++i) {
         if (bit[i] != n.bit[i]) return false;
     }
     return true;
 }

 bool BigInt::absoluteGreater(const BigInt& n)const
 {
     ; i>=; --i) {
         if (bit[i]>n.bit[i]) return true;
         else if (bit[i]<n.bit[i]) return false;
     }
     return false;
 }

 bool BigInt::absoluteEqualGreater(const BigInt& n)const
 {
     ; i>=; --i) {
         if (bit[i]>n.bit[i]) return true;
         else if (bit[i]<n.bit[i]) return false;
     }
     return true;
 }

ACM大数模板(支持正负整数)的更多相关文章

  1. 【集训笔记】【大数模板】特殊的数 【Catalan数】【HDOJ1133【HDOJ1134【HDOJ1130

    http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3324 http://blog.csdn.net/xymscau/artic ...

  2. hdu1042(大数模板)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1042 在网上找了个大数模板方便以后用得到. #include<iostream> #inc ...

  3. HDU 1134 Game of Connections(卡特兰数+大数模板)

    题目代号:HDU 1134 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1134 Game of Connections Time Limit: 20 ...

  4. bignum 大数模板

    今天无意间看到一个很好的大数模板,能算加.减.乘.除等基本运算,但操作减法的时候只能大数减小数,也不支持负数,如果是两个负数的话去掉符号相加之后再取反就可以了,一正一负比较绝对值大小,然后相减.我借用 ...

  5. c++大数模板

    自己写的大数模板,参考了小白书上的写法,只是实现了加减乘法,不支持负数,浮点数.. 除法还没写o(╯□╰)o以后再慢慢更吧.. 其实除法我用(xie)的(bu)少(lai),乘法写过fft,这模板还是 ...

  6. 大数模板 poj3982

    1. 这个模板不是自己写的,转载的别人转载的,还没学完c++的我,想写也没有那能力. 这个模板我用在了POJ的一道题上,传送门--POJ3982 一般大数的题,都可用这个模板解决,仅仅须要改动主函数就 ...

  7. Hdu 4762 网络赛 高精度大数模板+概率

    注意题目中的这句话he put the strawberries on the cake randomly one by one,第一次选择草莓其实有N个可能,以某一个草莓为开头,然后顺序的随机摆放, ...

  8. vijos - P1447开关灯泡 (大数模板 + 找规律 + 全然数 + python)

    P1447开关灯泡 Accepted 标签:CSC WorkGroup III[显示标签] 描写叙述 一个房间里有n盏灯泡.一開始都是熄着的,有1到n个时刻.每一个时刻i,我们会将i的倍数的灯泡改变状 ...

  9. 让ecshop模板支持php运算

    让ecshop模板支持php运算在 cls_template.php 底部加入函数: /** * 处理if标签 * * @access public * @param string $tag_args ...

随机推荐

  1. HTML——JAVASCRIPT练习题——图片轮播

    方法一: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3 ...

  2. Oracle触发器Trigger2行级

    create table trigger_t2( id int, name ), age int ); /* --创建一个before update的触发器-控制每一行,行级 --只有行级的才会有:n ...

  3. 新炬学院OCM讲师《Oracle核心技术》译作面世

    对于数据库爱好者来讲,Oracle是最值得研究的数据库.学习Oracle数据库时,一本好书的引导和启发是非常必要的,毫无疑问,<Oracle核心技术>就是这样一本好书. <Oracl ...

  4. html css float left与 float right的使用说明

    点评: CSS中很多时候会用到浮动来布局,也就是经常见到的float:left或者float:right,简单点来说,前者是左浮动(往左侧向前边的非浮动元素飘,全是飘得元素的话,就按照流式来浮动从左到 ...

  5. MapReduce编程小结

    (1)key-value到map端比较容易,每个分片都会交由一个MapTask,而每个分片由InputFormat(一般是FileInputFormat)决定(一般是64M),  每个MapTask会 ...

  6. baidu-fex 精彩文章

    7 天打造前端性能监控系统 http://fex.baidu.com/blog/2014/05/build-performance-monitor-in-7-days/ 前端自动化测试探索 http: ...

  7. Thinkphp3.2使用scws中文分词 提取关键词

    SCWS 是 Simple Chinese Word Segmentation 的首字母缩写(即:简易中文分词系统).1.下载scws官方提供的类(这里使用的是pscws第四版的)http://www ...

  8. php 生成唯一的订单

    /** * 生成唯一的订单号 20110809111259232312 * 2011-年日期 * 08-月份 * 09-日期 * 11-小时 * 12-分 * 59-秒 * 2323-微秒 * 12- ...

  9. centos下python的pymssql模块安装及简单使用

    1.安装pymssq模块 1-1.环境准备: 1-1-1.unixODBC安装 yum install unixODBC unixODBC-devel -y 1-1-2.freetds安装 下载 fr ...

  10. C语言程序设计(翁恺)--第二周课件中的两个遗留点

    看完课件,发现其中有几个点是老师上课没点破的,或者是留到讨论区的,自己想了想答案,总结一下这些问题 第二周:计算 1.关于const的描述中提到:“如果试图对常量做修改,把它放在赋值运算符的左边,就会 ...