`
chinrui
  • 浏览: 94139 次
  • 性别: Icon_minigender_1
社区版块
存档分类
最新评论
文章列表
#include <iostream> #include <stdlib.h> #define INIT_SIZE 3 #define INCREASE_SIZE 1 using namespace std; typedef int Elemtype; typedef struct { Elemtype *base; Elemtype *top; int iStackSize; } myStack; //函数声明 void initStack(myStack &); void showStack(m ...
#include <iostream> #include <stdlib.h> using namespace std; typedef int Elemtype; typedef struct lNode { Elemtype data; struct lNode *prior; struct lNode *next; } *LinkedList; //函数声明 LinkedList initNode(); void showNodesInClockwise(LinkedList); void showNode ...
#include <iostream> #include <stdlib.h> using namespace std; typedef struct lNode { lNode *lNext; int data; } lNode , *LinkedList; //函数声明 LinkedList initNode(); void showNodes(LinkedList head); int getLength(LinkedList); int main() { //初始化头结点 LinkedLi ...
#include <iostream> #include <stdlib.h> #include <conio.h> using namespace std; #define INIT_SIZE 5 #define INCREASE_SIZE 10 typedef int ElemType; /* * 声明此程序中的地址值与数组想象 * 即首位为0,其余的依次递增 * 若要使得首位为0,只需稍做修改即可 */ //自定义一个类型 typedef struct { ElemType *eList; ...
Javascript是一种弱类型的语言 在网页中嵌入javascript脚本的基本格式: <script type="text/javascript> var y = 3; alert(y); </script> 在网页上打印结果,并用html设置文字的属性: var sum = ""; for(var x=0; x<4; x++) { if(x==3 ...
使用XMLHttpRequest对象进行异步的操作 效果:输入时,进行同步的用户名检验 第一步:静态的html页面,作为进行检验的对象,当光标离开输入框的时候,触发validate()方法,查找数据库进行检验 <td>用户名:</td> <td> <input type=text name=username id=userid onblur="validate()" /> <div id=usermsg ></div> </td> 第二步:编写validate()方法 &l ...
HQL的简单使用2 1、 Category类 package com.edu.hpu; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; @Entity public class Category { private int id; private String name; @Id @GeneratedValue public int getId() { return id; } ...
Annotation使用两个foreign key做联合主键 1、 数据库里面的表结构 学生:(Id , Name) 课程:(Id , Name) 选课表:(Student_ID , Course_ID , Score) 2、 Student类 package com.edu.hpu; import java.util.HashSet; import java.util.Set; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.I ...
Hibernate中的HQL使用 1、 建立相应的关系表 Category类: package com.edu.hpu; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; @Entity public class Category { private int id; private String name; @Id @GeneratedValue public int getId() { ...
使用commons-fileupload与commons-io进行文件上传 第一步:相关组件的下载 1、 commons-fileupload下载:http://commons.apache.org/fileupload/download_fileupload.cgi 2、 commons-io下载:http://commons.apache.org/io/download_io.cgi 第二步:解压到相应的位置 1、 commons-fileupload的目录: F:\Program Files\commons-fileupload-1.2.2\lib\commons-fileupload- ...
单例设计模式 单例设计模式原理(保证对象唯一性): 1、 为了避免其他程序过多建立该对象,铁饭碗禁止其他程序建立该类对象 2、 还为了让其他程序可以访问到该类对象,只好在本类中自定义一个对象 3、 为了方便其他程序对自定义对象的访问,可以对外提供一些访问方式 对应的设计步骤: 1、 将构造方法私有化 2、 在类中创建一个本类对象 3、 提供一个方法可以获取到该对象 事例: public class SimpleDemo { public static void main(String[] args) { Student st1 = Student.getInstance(); ...
Thread笔记 一、 简单的多线程例子 class Ticket extends Thread { private int tickets = 100; public void run() { while(true) { if(tickets > 0) { System.out.println(Thread.currentThread().getName() + "...sales_" + tickets--); } } } } public class ThreadDemo_1 { public s ...
Structs学习笔记 一、建立structs项目的时候需要配置structs.xml以及web.xml文件 web.xml的简单配置(配置filter) <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class> </filter> <filter-mapping> <f ...
Junit笔记 1、 单元测试 package edu.hpu.junit; public class T { public int plus(int x , int y) { return x + y; } } //测试用 package edu.hpu.junit.test; //静态引入,引入相应的方法,而不用再写类名 import static org.junit.Assert.*; import org.junit.Test; import edu.hpu.junit.T; public class TTest { @Test ...
使用commons-email进行邮件传递 第一步:相关组件的下载 commons-email的下载:http://commons.apache.org/email/download_email.cgi 第二步:解压到相应的目录     F:\Program Files\commons-email-1.2\ commons-email-1.2.jar 第三步:引入相关的jar包     WEB-INF ...
Global site tag (gtag.js) - Google Analytics