自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

  • 博客(39)
  • 资源 (2)
  • 收藏
  • 关注

原创 Tapestry5.4的layout组件引入JavaScript

Tapestry5.4的layout组件若要使用JavaScript,须在组件类文件中import相应的javascript模块,而不能使用JavascriptSupport.require的方式引入。后一种方法引入的js代码只能在工程根目录的页面中使用。

2016-07-20 14:11:12 278

原创 使用spool和sqlldr导表的shell脚本

脚本可以一次将一张表导出到另一个数据库中的同一张表中,表名作为shell脚本的输入参数,在使用前需配置两个数据库的相关参数。不过spool对大数据的表执行速度较慢。#!/bin/shif [[ $# -ne 1 ]]then echo "usage: $0 TABLENAME>/dev/null" exitfiDBSCHEMA=from_user DBPWD=pwd_of_f

2015-09-22 21:57:11 664

转载 动态库加载方法

IntroductionHave you ever got tired of loading Dynamic Link Libraries the long way, with the usual steps LoadLibrary, and GetProcAddress, then you have to check for each function address if they are N

2008-12-15 16:08:00 746

原创 C++Primer6.8节可执行console程序代码

#pragma   warning(disable:4786) #include  #include  #include   #include  using namespace std;typedef pairshort,short> location;typedef vector loc;typedef vector text;typedef pa

2008-12-09 11:49:00 353

原创 C++ Primer 练习6.14程序代码

//Analyze the Sentences lists //sentence.cpp //c++ primer test //for learning class string and vector  #pragma   warning(disable:4786) #include  #include  #include  using namespa

2008-12-08 21:33:00 351

原创 学习CString方法的测试代码

// yangyhui.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include "afxwin.h"int main(int argc, char* argv[]){ CString str; CString strTmp; int i=1; LPTSTR c; c =

2008-02-15 09:28:00 727 1

原创 CString格式化方法的测试例子

// yangyhui.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include "afxwin.h"int main(int argc, char* argv[]){ CString str; LPSTR c="1234"; str = c; str.Format("CS

2008-02-14 13:25:00 476

原创 Oracle 返回重复记录第一条

select f1, f2, f3 from (select f1,f2, f3, row_number() over(partition by f1 order by f2)rnumfrom (select f1, f2, f3 from tab_name ))where rnum = 1;816及以上版本适用

2007-02-02 17:13:00 1173

原创 分治法的典型例子 --- 二分搜索

分治法的基本思想是将一个规模为n的问题分解为k个规模较小的子问题,这些子问题互相独立且与原问题相同。递归的解这些子问题,然后将各个子问题的解合并得到原问题的解。下面有两种描述算法的代码,其中一种是用递归来实现的。二分搜索方法充分利用了元素间的次序关系,采用分治策略,可在最坏情况下用O(logn)时间完成搜索任务。1.根据问题思路的描述直接写得的代码:public class Binar

2007-01-31 18:15:00 1787

原创 整数划分的问题

递归分析照抄书上的,具体请参考《计算机算法设计与分析》 第9页。在正整数n的所有不同的划分中,将最大加数n1不大于m的划分个数记作q(n,m)。我们可以建立如下递归关系。(1) q(n,1)=1,n>=1;(2)q(n,m)=q(n,n),m>=n;(3)q(n,n)=1+q(n,n-1);(4)q(n,m)=q(n,m-1)+q(n-m,m), n>m>1;正整数n的最大

2007-01-30 18:30:00 452

原创 Another good start!

算法学习从此开始,主要参考书籍为《计算机算法设计与分析》,为了同时恢复Java的基础,将以java语言并采用尽量简单的代码描述书中的算法,至于课后习题,因为有相关配套的参考答案的书籍已出版,暂不关注!第一段代码实践了递归的算法,输出一个集合的全排列:public class Permutations{ static void swap(int L[],int i,int k) {  int

2007-01-30 15:18:00 681

原创 组合公式(拿递归实现了一下,连这个都发,很无耻吧,哈哈!)

package com.yatium;/** *      combination */public class Combination{    public static int comb(int n,int m){        if(m        else if(m==n||n==0) return 1;        else if(n==1) return m;        els

2005-12-01 17:02:00 722

原创 求数组的众数(TestArray类应新的需求添加了一个功能)

/* output most times of occurence */    public static void timesTopN(int[] arr){        int l=arr.length;        int[] times=new int[l];        Arrays.fill(times,1);        for(int i=0;i            fo

2005-12-01 15:22:00 885 1

原创 n人围成一圈报数,数到m的人出圈(据软件设计师教程上的思想编写)

package com.yatium;class Node{    int no;    Node next;    Node(int no){        this.no=no;        next=null;    }}class Circle{    int length;    Node head;    Circle(int length){        this.length=

2005-11-15 10:55:00 1036 1

原创 n人围成一圈报数,数到m的人出圈(据评论所写,谢谢zf)

package com.yatium;public class RePlay{    int key;    int[] circle;    public RePlay(int key,int size){        this.key=key;        circle=new int[size];        for(int i=0;i    }    public void game

2005-11-15 09:56:00 877

原创 n天以后的日期

public static String afterNDay(int n){        Calendar c=Calendar.getInstance();        DateFormat df=new SimpleDateFormat("yyyy-MM-dd");        c.setTime(new Date());        c.add(Calendar.DAY_OF_MON

2005-11-15 08:55:00 663

原创 二叉排序树的另一种原型实现

#includetypedef struct node{    int data;    struct node *left;    struct node *right;}treeNode,*biTree;void insert(biTree *root,biTree *node){    biTree p=*root;    biTree parent;    int key=(*node)-

2005-11-15 08:43:00 711

原创 两个双向链表,删除data成员值相同的节点。

#include #include "size.h"/* define node type */typedef struct node{    int data;    struct node *front,*next;}node,*linkHead;/* creat a list ,the argument n is the length of the list*/void creatList(

2005-11-11 12:45:00 1341

原创 查找

1.折半查找int binarySearch(int a[],const int x,int n){int left = 0;int right = n-1;while(left{int middle=(left+right)/2;if(x == a[middle]) return middle;if(x > a[middle]) left = middle+1;else right = midd

2005-11-10 13:52:00 669

原创 排序

1.头文件 size.h#define MAX_SIZE 102.冒泡排序void bubbleSort(int a[MAX_SIZE]){int i = 0;int j = 0;int tag = 1;int temp = 0;for(i=0; i{    tag=0;    for(j=0; j        if(a[j]>a[j+1])        {            temp=a

2005-11-09 16:23:00 628

转载 排列组合公式

排列组合计算公式0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}"/>

2005-11-02 17:02:00 1492

原创 求数组的top n的下标,有缺点

/**  * an fault : topN(int[],int) method will  * change the value of the argument int[]  *  */package com.yatium;import java.util.*;public class TestArray{    /* exchange two element with given indexe

2005-11-02 16:03:00 826

转载 一种N*N矩阵的打印方法

void main(){ int N; int buf[20][20]; printf("n(1~20)="); scanf("%d",&N); if(N20) { printf("N is not a valid number!/n"); return; } int i,j,index=1; int min=0,max=N-1; int tag=0; i=min; j=min; whi

2005-11-01 10:52:00 971

转载 c语言中的串模式匹配,用java实现了一下

public class TestMatch{    public static boolean stringPatternMatch(String s,String t,int pos){        char[] s1=s.toCharArray();        char[] t1=t.toCharArray();        int i=pos ,j=0;        while(

2005-11-01 10:50:00 827

原创 一个偶数等于两个素数之和

public class Test40{    public static boolean primeNum(int i){        for(int j=2;j            if(i%j==0) return false;        return true;    }    public static void main(String[] args) throws Except

2005-10-31 12:31:00 1252

原创 水仙花数

public class DaffodilNum{    private int n;    public DaffodilNum(int n){        this.n=n;    }    public boolean IsOrNot(){        int a=n%10;        int b=(n%100-a)/10;        int c=(n-b*10-a)/100; 

2005-10-28 12:15:00 705 1

转载 用六大代码问题检验你的Java知识能力

你觉得自己是一个Java专家吗?是否肯定自己已经全面掌握了Java的异常处理机制?在下面这段代码中,你能够迅速找出异常处理的六个问题吗?      1 OutputStreamWriter out = ...  2 java.sql.Connection conn = ...  3 try { // ⑸  4 Statement stat = conn.createStatement();  5

2005-10-26 13:54:00 615

原创 订单程序

public class UsesOrder{public static void main(String[] args){    Goods c1=new Coffee(2,4),c2=new Coffee(4,8),c3=new Cake(3,6),c4=new Cake(5,10);    Order o1=new Order(c1,c3),o2=new Order(c2,c4);    S

2005-10-26 11:22:00 599

原创 随机两位数

import java.util.*;public class Test28{        public static void main(String[] args){        int[] arr1=new int[10];        for(int i=0;i        {            int temp=(int)(Math.random()*100);       

2005-10-26 11:19:00 902

原创 一个字符串在另一个字符串中匹配的次数

int MatchTimes(String sub,String s){    int len=sub.length(),count=0,offset=0;    while(true)    {        int temp=s.indexOf(sub,offset);        if(temp!=-1)         {            offset=temp+len;     

2005-10-21 09:11:00 696

转载 I/O流的典型使用方式

import java.io.*;public class IOStreamDemo{    public static void main(String[] args) throws IOException{        BufferedReader in=new BufferedReader(new FileReader("IOStreamDemo.java"));        Strin

2005-10-20 11:14:00 913 1

转载 二叉树的java实现

// BinaryNode class; stores a node in a tree.//// CONSTRUCTION: with (a) no parameters, or (b) an Object,// or (c) an Object, left child, and right child.//// *******************PUBLIC OPERATIONS*****

2005-10-19 10:18:00 985

转载 注重实效的程序员应具备的特征

在《程序员修炼之道》这本好书中列出了注重实效的程序员应具备的特征,你能对号入座吗?1 早期的采纳者/快速的改编者    你具有技术和技巧上的直觉,你喜欢试验各种事物。给你一样新东西,你很快就能把握它,并把它与你的知识的其它部分结合在一起。你的自信出自经验。2 好奇    你喜欢提问。那很漂亮——你是怎么做的?你用那个库的时候有什么问题吗?我听说的这个BeOS是什么东东?符号链接是怎么实现的?你是收

2005-10-18 13:29:00 693

转载 IT人为什么有的难以拿到高薪?

      最近在论坛里看到很多人发牢骚,说薪水少,可在我看来,你们这样的人拿得到高薪才怪!   我先问一句:这里有多少人是本科的?有多少人是正规本科的(不算自考,成考和专升本)?有多少人是有学位的?有多少有学位的是拿着网大排名前50所大学的学位的?恐怕是少之又少吧!在中国,薪水和学位的关系对于应届生来说是绝对的,即使对于以后的发展,学位也很重要,要不那些低学历的人评职称为什么吃亏呢?你可

2005-10-18 13:28:00 647

转载 程序员的七种武器

信息技术的发展时间虽然不长,但其爆炸式的发展速度使信息技术迅速覆盖社会和人类生活的各个角落。程序员们是这场信息化浪潮的见证者之一,更是其中的主要参与者,这是时代赋予每个程序员的机会和责任。 信息技术的更新速度是惊人的,程序员的职业生涯则是一个要求不断学习的过程,永远不能固步自封。本人在工作期间曾看见过很多程序员只要有闲暇时间就浏览一些没有太大作用的网页,在网上聊天,打游戏,浪费了大量的时间

2005-10-18 13:26:00 653

转载 谈谈我对攻读计算机研究生的看法

      如果你有实际开发工作经验,感觉自己的水平和实力进入了一个高原期,迫切 需要从理论上提高,那么计算机学院是唯一选择。因为计算机学院才能让你在理论 上更上一层楼。软件学院从教学计划上就没有把你往这方面带。当然能不能更上一 层楼最终还是完全取决于你自己。需要特别说明的是,工作经验并不一定等于开发 经验,我见过很多工作2-3年的人,但是没有一点开发经验。      你说:“他们都有很强的开发能

2005-10-18 13:24:00 636

转载 七个习惯可使你成功 你有吗?

       “我曾为自己定下许多目标,也都一一达成。我的事业十分成功,但却牺牲了个人与家庭的幸福,这值得吗?……”;“我要做的事太多了,时间总是不够用,每天都觉得很紧张,匆匆忙忙。我无法过着理想中既充实又自在的生活,而且别无选择……”;“我拥有财富和成就感,可失去了内心的平静……”这无疑是诸多成功人士的生活写照。   《高效能人士的7个习惯》告诉我们:仅有事业成功只能算成功了一半,唯有兼

2005-10-18 13:15:00 703

原创 构造链表

import java.io.*;class StudentNode{    String name;    int age;    StudentNode next;    public StudentNode(String name,int age){        this.name=name;        this.age=age;        next=null;    }}publ

2005-10-14 16:27:00 559

原创 100个人报数,数到10的人出圈

import java.io.*;class Person{    public int id;    public boolean status=false;    Person next;    Person(int id){this.id=id;}    void setStatus(){ status=true; }    public void numAction(){ Game.M--

2005-09-30 16:53:00 2031 1

附件上传下载类方法,主要是用ftp上传下载功能

主要是用ftp上传下载功能,主要是用ftp上传下载功能,主要是用ftp上传下载功能,主要是用ftp上传下载功能

2009-10-26

附件上传下载类方法,主要是用ftp上传下载功能

主要是用ftp上传下载功能,其中根据相应的包,可以定制开发相应的功能

2009-10-26

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除