08 2009 档案

摘要:一、将SWT添加到工程的类路径中 首先建立一个java工程。在开始使用SWT之前,需要将SWT库文件添加到工程的类路径中。步骤如下: 1. 下载SWT。在Eclipse SDK的下载页面中,提供了独立版本的SWT下载。找到标有SWT Binary and Source 的栏目。下载适合你操作系统的版本,不用解压,直接保存到硬盘中。2. 在Eclipse菜单栏,选择File-〉Import...打... 阅读全文
posted @ 2009-08-27 19:03 莫忆往西 阅读(450) 评论(0) 推荐(0)
摘要:1 新建》》项目》》Java项目,名称为“Sample1”,注意最好选中“创建单独的源文件夹与输出文件夹”,这样会eclipse会生成src、bin两个目录2 项目》》右键》》构建路径》》配置构建路径》》库标签页》》添加外部JAR,选择mysql-connector-java-5.1.6-bin.jar(此jar文件可以从MySql官方网站上下载。该操作类似于.NET开发中的“添加引用”)3 s... 阅读全文
posted @ 2009-08-27 07:49 莫忆往西 阅读(443) 评论(0) 推荐(0)
摘要:问题的根源还是在于老生常谈的所谓class path,不信的话你在系统环境变量里的ClassPath加上你的jar文件,这下你就看得到你的图片了!但单独发布jar的话不可能指望每次都让用户为你的jar而专门修改classpath。那么有没有什么办法一劳永逸地搞定它呢?我们需要从类的装载入手。先扯远一点,在开发JSP之类的Web应用程序的时候要用到第三方的库怎么办?通常的做法是把这些库(可以是... 阅读全文
posted @ 2009-08-26 19:27 莫忆往西 阅读(227) 评论(0) 推荐(0)
摘要:使用jar命令创建可执行的jar包1、创建可执行的jar包。手工写manifest.mf文件(jar命令自动生成的MANIFEST.MF文件中不会包含Main-Class属性),举例说明:目录结构:mymanifest.mf //该文件可以随意放置,只要在执行jar命令时指定mymanifest.mf文件所在位置. - src - test Test. class test.Tes... 阅读全文
posted @ 2009-08-26 18:06 莫忆往西 阅读(267) 评论(0) 推荐(0)
摘要:-d〈dir〉的作用时在dir目录下自动生成package的包目录。 javac -d . HelloWorld.java在java中有public、protected、private三种显示的修饰符用于控制可见性,package不是显示的修饰符,它是隐含的,即如果在类、变量等前没加显示的可见性修饰符,那它就是package级别的。如果在类的定义中没有指定package,那么java会把它放在缺... 阅读全文
posted @ 2009-08-26 17:39 莫忆往西 阅读(310) 评论(0) 推荐(0)
摘要:#include #include #include #include #include #include #include #include using namespace std;ifstream in( "data.txt");ofstream out("out.txt");typedef struct Phone {string phoneno;int count;}Phone;vect... 阅读全文
posted @ 2009-08-14 08:33 莫忆往西 阅读(133) 评论(0) 推荐(0)
摘要:/*-------------------------------------------------*//* This program generates a summary report from a data file that does not have a header record or a trailer record. The data file has two ... 阅读全文
posted @ 2009-08-14 08:28 莫忆往西 阅读(131) 评论(0) 推荐(0)
摘要:/*-------------------------------------------------*//* 这个程序实现计算高度和臭氧含量的线性模型,使用最小二乘法,对于拟合直线 y=mx+b 有: m=[sum(x)*sum(y)-n*sum(x*y)]/[(sum(x))^2-n*sum(x^2)] b=[sum(x)*sum(x*y)-sum(x^2)*sum(y)]/[(sum(x... 阅读全文
posted @ 2009-08-14 08:23 莫忆往西 阅读(431) 评论(0) 推荐(0)
摘要:/*----------------------------------------------------*//*显示当前系统的位数限制,如整形,浮点型等 *//*By Edison Wang DATE:2009-07-22 */#include #include #include using namespace std;int ... 阅读全文
posted @ 2009-08-12 06:11 莫忆往西 阅读(139) 评论(0) 推荐(0)
摘要:1.download the gnuplot program form www.gnuplot.info2.unzip the gnuplot.zip to a directory, try to use wgnuplot.exe3.set the system environment variables to make sure that wgnuplot.exe could be use u... 阅读全文
posted @ 2009-08-12 06:07 莫忆往西 阅读(403) 评论(0) 推荐(0)
摘要:#include #include #include main(){char file1[15];char file2[16]=" ";//一个空格char copycmd[50]="copy ";char plotcmd[80]="wgnuplot.exe C:\\mytest\\diagram.txt";// printf("input first name\n");// ... 阅读全文
posted @ 2009-08-12 06:01 莫忆往西 阅读(663) 评论(0) 推荐(0)
摘要:/*---------------------------------------------------------*//*生成[a,b]之间的随机整数和浮点数 *//*By Edison Wang Date: 2009-7-25 */#include #include using names... 阅读全文
posted @ 2009-08-12 05:57 莫忆往西 阅读(299) 评论(0) 推荐(0)
摘要:#include #include #include #include #include using namespace std;//学生信息的类:包含姓名和成绩class Student{public:char* name;int score;Student(){};Student(char* n,int s){name=n;score = s;}~Student(){}};//按姓名查找时用... 阅读全文
posted @ 2009-08-12 05:52 莫忆往西 阅读(337) 评论(0) 推荐(0)
摘要:/*--------------------------------------------------------*//* This program looks at a character string and determines*//* if the string is a palindrome */#include #include #... 阅读全文
posted @ 2009-08-12 05:31 莫忆往西 阅读(170) 评论(0) 推荐(0)
摘要:/*-----------------------------------------------------*//* This program reads an html file, and writes the text without the tags to a new file. By Edison Wang Date: 2009-07-22*/#include... 阅读全文
posted @ 2009-08-12 05:16 莫忆往西 阅读(152) 评论(0) 推荐(0)
摘要:#include using namespace std;/*//注意,该函数是以最后一个元素p[end]为pivot。QuickSort(int p[], int start, int end){ if (start >= end) //(1)此时无需排序,所以返回。(2).1 这还保证了,如果只有2个元素时,j=end-1 =1>0 return; int i = ... 阅读全文
posted @ 2009-08-12 05:12 莫忆往西 阅读(201) 评论(0) 推荐(0)
摘要:/*--------------------------------------------------------------*//*读取一个ASCII数字图像并对其进行平滑处理,保存到另个文件中。图 *//*像文件的格式为PPM,可以使用pic2pic pro这个软件实现转化,文件头*//*包括P3,图像的宽度和高度,颜色的最大值,如: P3 176 220 255 148 164 ... 阅读全文
posted @ 2009-08-12 01:32 莫忆往西 阅读(189) 评论(0) 推荐(0)
摘要:/*---------------------------------------------------*//*Implement of pixel class *//*File name: pixel.cpp */#include "pixel.h"//三个构造函数的实现pixel... 阅读全文
posted @ 2009-08-12 01:30 莫忆往西 阅读(223) 评论(0) 推荐(0)
摘要:/*-----------------------------------------------*//* 像素类表示一个图片,一个像素由RGB组成 *//*Pixel class declaration. *//*File name : pixel.h */#ifndef PIXE... 阅读全文
posted @ 2009-08-12 01:28 莫忆往西 阅读(569) 评论(0) 推荐(0)
摘要:运算符重载 fatal error C1001: INTERNAL COMPILER ERROR相关代码:class PrimeFieldElem{public:friend PrimeFieldElem operator+( const PrimeFieldElem ,const PrimeFieldElem );}解决方法:http://topic.csdn.net/t/20051219/0... 阅读全文
posted @ 2009-08-11 01:51 莫忆往西 阅读(224) 评论(0) 推荐(0)
摘要:/*----------------------------------------------------------*/ /*在c++中如何使用stl中的stack */#include #include using namespace std;int main(){stack astack; //declare a objecti... 阅读全文
posted @ 2009-08-10 19:19 莫忆往西 阅读(196) 评论(0) 推荐(0)
摘要:#pragma warning(disable:4786)#include #include #include #include #include #include #include #include using namespace std;void get_word(istream& in_stream,string& w);void insert_word(string word,list&... 阅读全文
posted @ 2009-08-10 19:05 莫忆往西 阅读(408) 评论(0) 推荐(0)