public class disi{ public static void main(String arg[]){ int shuzu[]={1,3,4,5,6,6,5,4,7,6,7,5}; he(shuzu); sort(shuzu); } public static void he(int t ...
分类:
编程语言 时间:
2016-03-31 20:14:37
阅读次数:
202
使用两种方法将稀疏矩阵快速转置#include<iostream>
#include<vector>
usingnamespacestd;
template<classT>
structTriple//三元组
{
size_trow;
size_tcol;
T_value;
};
template<classT>
classSparseMatrix
{
public:
SparseMatrix(T*arr,size..
分类:
其他好文 时间:
2016-03-31 19:04:45
阅读次数:
175
打印九九乘法口诀表。程序:packagemyclass;publicclassmyclass{ publicstaticvoidmain(String[]args){ for(inti=1;i<=9;i++){ for(intj=1;j<=9;j++){ if(j>i){ break; } System.out.printf("%d*%d=%d",i,j,i*j); } System.out.println(..
分类:
编程语言 时间:
2016-03-31 19:04:18
阅读次数:
186
//智能指针可以自动销毁,用引用计数技术实现
#include<iostream>
usingnamespacestd;
template<classT>
classSmartPtr
{
protected:
T*_ptr;
size_t*_cout;
voidclear()
{
if(--*_cout==0)
{
delete_ptr;
delete_cout;
}
}
public:
SmartPtr(T*ptr=0)
:_ptr(pt..
分类:
其他好文 时间:
2016-03-31 19:02:34
阅读次数:
167
#pragma once#ifndef FIFO_H#define FIFO_H#include"simulator.h" class fifo : public simulator{public: fifo(int second_per_page); virtual void simulate(s ...
分类:
编程语言 时间:
2016-03-31 18:55:57
阅读次数:
186
Java时间格式转换大全 import java.text.*; import java.util.Calendar; public class VeDate { /** * 获取现在时间 * * @return 返回时间类型 yyyy-MM-dd HH:mm:ss */ public static ...
分类:
编程语言 时间:
2016-03-31 18:52:32
阅读次数:
389
服务端: 首先是编写一个aidl文件,注意AIDL只支持方法,不能定义静态成员,并且方法也不能有类似public等的修饰符;AIDL运行方法有任何类型的参数和返回值,在java的类型中,以下的类型使用时不需要导入包(import),基本数据类型、String、Map、List.当然为了避免出错,建议 ...
分类:
移动开发 时间:
2016-03-31 18:39:04
阅读次数:
174
模型验证是在模型绑定时检查从HTTP请求接收的数据是否合规以保证数据的有效性,在收到无效数据时给出提示帮助用户纠正错误的数据。 显式模型验证 验证数据最直接的方式就是在action方法中对接收的数据验证,以下面的Model为例: public class Appointment { public s ...
分类:
Web程序 时间:
2016-03-31 18:29:56
阅读次数:
303
1. 一、绑定请求参数到指定对象 Java代码 public String test1(@ModelAttribute("user") UserModel user) Java代码 Java代码 只是此处多了一个注解@ModelAttribute("user"),它的作用是将该绑定的命令对象以“us ...
分类:
编程语言 时间:
2016-03-31 18:27:20
阅读次数:
375
#include<iostream>
#include<vector>
#include<string>
usingnamespacestd;
//三元组
template<classT>
structTriple
{
size_t_row;
size_t_col;
T_value;
};
template<classT>
classSparseMatrix
{
public:
SparseMatrix();
SparseMatrix..
分类:
其他好文 时间:
2016-03-31 17:07:25
阅读次数:
254