摘要: 最近某程序需要迁移到另一个系统中运行,后台数据库由mysql改为oracle,在网上零碎查找了些资料,总算成功完成任务。记录下一点点心得,希望能帮到需要的朋友。1. oracle 环境配置先下载下面两个包(这里是64位,视实际情况而定) instantclient-basic-linux.x64-11.2.0.3.0.zip 和 instantclient-sdk-linux.x64-11.2.0.3.0.zip (oracle官方网站,注册后才能下载) 两个zip包在同一目录下解压,文件会放在instantclient_11_2中,再将此目录放到oracle期望的安装目录... 阅读全文
posted @ 2012-09-15 16:39 thomaslee 阅读(856) 评论(0) 推荐(0) 编辑
摘要: 需要注意两个地方:1.先取模得到各个周期第1次出现的天数。 2. X<=0时就继续加。在网上搜了一下,有人说这是中国剩余定理,参考链接。#include <stdio.h>int main(){ int p=0, e, i, d; int res[10000]; int k = 0; int X; while(scanf("%d %d %d %d", &p,&e,&i,&d), p!=-1){ int A, B, C; p %= 23; e %= 28; i %= 33; A = p - d; B = e - d; C = 阅读全文
posted @ 2011-09-24 21:52 thomaslee 阅读(119) 评论(0) 推荐(0) 编辑
摘要: POJ 1003比较简单,条件里给出了c的范围不超过5.20,方法类似于非递归求Fibonacci,我在代码中计算新的数前先判断能否在已经得到的结果中找到答案。不过我看别人的代码,貌似不用数组保存结果,每次都直接计算也不会超时,好吧,我想多了。。。POJ 1003 160K 0MS C++#include <stdio.h>#include <stdlib.h>#define MAX 300 //c at least 0.01 and at most 5.20int main(){ float *sum = (float *)malloc(MAX * sizeof(fl 阅读全文
posted @ 2011-09-24 13:48 thomaslee 阅读(388) 评论(0) 推荐(0) 编辑
摘要: POJ1002是个电话号码的问题两种思路:第一种:转换成整数数组,再进行排序,然后统计出现的次数。printf("%03d-%04d %d", head, tale, count) //格式输出,刚开始时用的是%3d,一直不行,需要用%03d将空位用0补齐。代码如下:方法1:524K 579MS C++#include <stdio.h>#include <string.h>#include <malloc.h>#include <stdlib.h>#define MAX 256int cmp(const void *a, c 阅读全文
posted @ 2011-09-24 11:17 thomaslee 阅读(604) 评论(0) 推荐(0) 编辑