public class test{ public static void main(String [] args) { Data [] tempValue = new Data[3]; for(int temp=0;temp<tempValue.length;temp++) ...
分类:
编程语言 时间:
2015-01-21 21:53:46
阅读次数:
228
1 void CreateDir(const string& strPath) 2 { 3 if (PathFileExists(strPath.c_str())) 4 { 5 return; 6 } 7 8 size_t sPrePos = 0...
分类:
其他好文 时间:
2015-01-21 21:47:28
阅读次数:
207
http框架:实现异步访问网络;使用方法:(1)创建HttpUtilpublicclassHttpUtil{
privatestaticAsyncHttpClientclient=newAsyncHttpClient();//实例话对象
static{
client.setTimeout(11000);//设置链接超时,如果不设置,默认为10s
}
/**
*url不带参数返回String
..
分类:
移动开发 时间:
2015-01-21 20:25:58
阅读次数:
235
对于一些大文件,有时会需要计算部分内容的Hash,下面的函数计算了文件头尾各1M,中间跳跃100M取10K 以及文件大小的Hash值public static String CalHash(String path) throws IOException { File file ...
分类:
编程语言 时间:
2015-01-21 19:53:33
阅读次数:
252
mt_rand() 使用 Mersenne Twister 算法返回随机整数。语法mt_rand(min,max)定义和用法str_shuffle() 函数随机地打乱字符串中的所有字符。语法str_shuffle(string)array_merge() 函数把两个或多个数组合并为一个数组。定义和用...
分类:
其他好文 时间:
2015-01-21 19:49:16
阅读次数:
251
private static int getRandom(int count) { return (int) Math.round(Math.random() * (count)); } private static String string = "abcde...
分类:
编程语言 时间:
2015-01-21 19:35:26
阅读次数:
184
HashMap
如果有重复的key,则将旧数据进行替换,允许设置key和value为null,key存放是乱序的,线程非同步,访问速度快,因为它根据key的HashCode 值来存储数据
public static void main(String[] args) {
System.out.println("************************* HashMap ********...
分类:
其他好文 时间:
2015-01-21 18:18:43
阅读次数:
216
应用宝、360应用、豌豆荚等等都有一个比较好的功能就是下载应用自行安装,不用弹出安装应用对话框,他是怎么做到的呢?
这边采用在应用内部使用shell实现,但前提必须root,代码很简单:
public static void InstallAPK(String filename){
File file = new File(filename);
if(file.exi...
分类:
移动开发 时间:
2015-01-21 18:16:19
阅读次数:
149
//File.separator 斜杠使用 这个参数代替,解决java移植 到其其它平台兼容问题
String fsr=String.format("D:%sceshi", File.separator);//需要复制的文件夹 不包括ceshi
String tsr=String.format("D:%sDownload...
分类:
编程语言 时间:
2015-01-21 18:14:06
阅读次数:
173
题意 输出所有输入单词中可以由另两个单词的组成的词
STL set的应用 枚举每个单词的所有可能拆分情况 看拆开的两个单词是否都存在 都存在的就可以输出了
#include
using namespace std;
string a, b;
set s;
set::iterator i;
int main()
{
int l;
while(cin >> a) s.i...
分类:
其他好文 时间:
2015-01-21 18:13:27
阅读次数:
210