1:使用inline函数的时候,必须使函数体和inline说明结合一起,否则编译器将视他为普通函数处理: false: inline void Coord::setcoord(int a,int b); true: inline void Coord::setcoord(int a ,int b) ...
分类:
其他好文 时间:
2017-01-08 14:05:16
阅读次数:
168
1. HashSet与HashMap的联系与区别? 区别:前者是单列后者是双列,就是hashmap有键有值,hashset只有键; 联系:HashSet的底层就是HashMap,可以参考HashSet的类源码,默认构造方法为: public HashSet(){ map = new HashMap< ...
分类:
编程语言 时间:
2017-01-08 14:05:15
阅读次数:
216
1.程序模块化和可重用性是软件工程的中心目标之一.Java提供了很多有助于完成这一目标的有效结构.方法就是一个这样的结构.2.方法头指定方法的修饰符,返回值类型,方法名和参数.3.方法可以返回一个值.返回值类型是方法要返回的值的数据类型.如果方法不返回值,则返回值类型就是关键字void.4.参数列表 ...
分类:
编程语言 时间:
2017-01-08 13:00:46
阅读次数:
270
元组是一种长度固定的允许有不同类型元素的集合,根据元素的个数不同又分别称作一元组、二元组、三元组等。C++11中标准库增加了一个叫std::tuple的类模板,用于表示元组。 下面的代码演示了使用C++创建一个三元组。 auto tuple = std::make_tuple(1, 'A', "te ...
分类:
编程语言 时间:
2017-01-08 08:00:56
阅读次数:
369
1 package shiro; 2 3 import org.apache.shiro.SecurityUtils; 4 import org.apache.shiro.authc.UsernamePasswordToken; 5 import org.apache.shiro.config.In ...
分类:
其他好文 时间:
2017-01-08 07:41:29
阅读次数:
180
1. 目的: junit 单元测试,Cobertura 测试覆盖率报告 项目目录结构 2. maven 配置 4.0.0 com.dalong.demoapp junitdemo 0.0.1-SNAPSHOT org.springframework spring-test 4.3.5.release... ...
分类:
编程语言 时间:
2017-01-07 21:09:54
阅读次数:
534
#include "stdafx.h" #include #include #include #define N 2000001 using namespace std; inline void read_int(int &now_); class T_heap { private: int hea... ...
分类:
其他好文 时间:
2017-01-07 20:48:58
阅读次数:
219
public class ByteSub { public static void subString(String str, int a) { int bytes = 0; String result = ""; for (int x = 0; x a) { break; } ... ...
分类:
其他好文 时间:
2017-01-07 19:28:03
阅读次数:
192
1565: [NOI2009]植物大战僵尸 Description Input Output 仅包含一个整数,表示可以获得的最大能源收入。注意,你也可以选择不进行任何攻击,这样能源收入为0。 Sample Input 3 2 10 0 20 0 -10 0 -5 1 0 0 100 1 2 1 10 ...
分类:
其他好文 时间:
2017-01-07 16:58:37
阅读次数:
274
最近在写关于相机跟随的逻辑,其实最早接触相机跟随是在Unity官网的一个叫Roll-a-ball tutorial上,其中简单的涉及了关于相机如何跟随物体的移动而移动,如下代码: 1 using UnityEngine; 2 using System.Collections; 3 4 public ...
分类:
编程语言 时间:
2017-01-07 13:10:53
阅读次数:
334