Oracle number解析
转了,记录下出自 http://www.itpub.net/thread-467565-1-1.html by Toms_zhangOracle的NUMBER类型最多由三个部分构成,这三个部分分别是最高位表示位、数据部分、符号位。其中负数包含符号位,正数不会包括符号位。另外,数值0比较特殊,它只包含一个数值最高位表示位80,没有数据部分。&nbs...
mysql号段问题
create table t (a int primary key);insert into t values (0);insert into t values (1);insert into t values (2);insert into t values (10);insert into t values (11);insert into t values (12);insert into ...
Python模拟抽象类
Python中没有abstract关键字定义抽象类,但是可以通过NotImplementedError类模拟抽象类def abstract (): raise NotImplementedError("Abstract")class Person: def __init__ (self): if se...
二叉排序树
#include <stdio.h>#include <malloc.h>typedef struct BiTNode{int data;struct BiTNode *lchild, *rchild;}BiTNode, *BiTree;bool SearchBST (BiTree T, int key, BiTree f, BiTree *p){if (!T){*p = f;re...
快速排序
#include <stdio.h>typedef struct{int r[11];int length;}SqList;void swap (SqList * L, int i, int j){int temp = L->r[i];L->r[i] = L->r[j];L->r[j] = temp;}int Partition (SqList *l, int low, int high...
堆排序
#include <stdio.h>typedef struct{int r[11];int length;}SqList;void swap (SqList * L, int i, int j){int temp = L->r[i];L->r[i] = L->r[j];L->r[j] = temp;}void HeapAdjust (SqList *l, int s, int m){...
图的深度优先遍历
#include <stdio.h>#define MAXVEX 100#define INFINITY 65535typedef int Boolean;Boolean visited[MAXVEX];typedef struct{char vexs[MAXVEX];int arc[MAXVEX][MAXVEX];int numVertexes, numEdges;}MGraph;void...
二叉树遍历
#include <stdio.h>#include <malloc.h>typedef struct BiNode{char data;struct BiNode *lchild, *rchild;}BiNode, *Btree;/*ǰDò±éàú*/void PreOrderTraverse(Btree T){if (T == NULL)return;pri...
KMP字符串匹配
#include <iostream>using namespace std;void Get_Next(char* T,int* next); void Get_Nextval(char* T,int* next); int Index_KMP(char* S,char* T,int* N); int main(){ch...
冒泡排序
#include <stdio.h>typedef struct{int r[10];int length;}SqList;void swap (SqList * L, int i, int j){int temp = L->r[i];L->r[i] = L->r[j];L->r[j] = temp;}void BubbleSort2(SqList *L){int i, j;for ...
插入排序
#include <stdio.h>typedef struct{int r[11];int length;}SqList;void InsertSort (SqList *L){int i, j;for (i = 2; i < L->length; i++){if (L->r[i] < L->r[i - 1]){L->r[0] = L->r[i];for (j = ...
选择排序
#include <stdio.h>typedef struct{int r[10];int length;}SqList;void swap (SqList * L, int i, int j){int temp = L->r[i];L->r[i] = L->r[j];L->r[j] = temp;}void SelectSort(SqList *l){int i, j, min;...
希尔排序
#include <stdio.h>typedef struct{int r[11];int length;}SqList;void ShellSort (SqList *L){int i, j;int increment = L->length;while (increment > 1){increment = increment/3 + 1;for (i = increment...
策略模式
abstract class Strategy{ public abstract void AlgorithmInterface();}class StrategyA extends Strategy{ public void AlgorithmInterface() { Sys...
简单工厂模式---四则运算
根据不同的运算符实例化不同的对象class Operation{ protected double numA = 0; protected double numB = 0; public double GetResult() { double result = 0; &...
python中string的操作函数 (转)
在python有各种各样的string操作函数。在历史上string类在python中经历了一段轮回的历史。在最开始的时候,python有一个专门的string的module,要使用string的方法要先import,但后来由于众多的python使用者的建议,...
python 文件合并
#!/usr/bin/env python# -*- coding: utf-8 -*-'mergeTextFile--用于合并两个文本文件'import os#输入两个文件名while True: file1 = raw_input('输入要合并的第一个文件名:') ...
python随机数
这些方法位于random模块中random.random(),同javascript的Math.random(),返回[0.0,1)之间的浮点数random.uniform(a, b),返回[a,b]之间的浮点数print random.uniform(10, 20) print random.uniform(20, 10...
Hash join (转)
hash join是oracle里面一个非常强悍的功能,当做hash join时,oracle会选择一个表作为驱动表,先根据过滤条件排除不必要的数据,然后将结果集做成hash表,放入进程的hash area,接着扫描第二张表,将行的键值...
java数组传入oracle
数据库的环境 1* create table t (b varchar2(90))SQL> /表已创建。SQL> create or replace procedure insert_t(a varray_list) 2 is 3 begin 4 for i in 1 .. a.count l...