java copy file

java copy file http://www.oschina.net/question/565065_58510 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 private static void nioTransferCopy(File source, File target) { FileChannel in = null; FileChannel out = null; FileInputStream inStream = null; FileOutputStream outStream = null; try { inStream = new FileInputStream(source); outStream = new FileOutputStream(target); in = inStream.

Java Callable, Future 和 FutureTask

Java Callable, Future 和 FutureTask 创建线程有两种方式,一种是直接继承 Thread,另外一种就是实现 Runnable 接口。 这两种方式都有一个缺陷就是: 在执行完任务之后无法获取执行结

Java assert

Java assert http://lavasoft.blog.51cto.com/62575/43735 一、概述 在C和C++语言中都有assert关键,表示断言。 在Java中,同样也有assert关键字,表示断言,用法和含义都差不多。 二、

duration ,interval

duration ,interval 隔一分钟打一次雷,每次雷持续响半分钟。 一分钟就是interval,半分钟就是duratioin http://zhidao.baidu.com/question/174688836.html

mutex, 锁

mutex, 锁 Mutual exclusion (或者锁) 的实现有硬件实现和软件实现, 软件实现是通过一些特别的算法譬如 Peterson’s algorithm,这类软件实现通常比硬件实现需要更多的内存

java 对象

java 对象 http://www.jianshu.com/p/ebaa1a03c594 Java程序执行时,第一步系统创建虚拟机进程,然后虚拟器用类加载器Class Loader加载java程序类文件到方法区。 方法区放哪些

DMA

DMA DMA的基本定义 DMA,全称Direct Memory Access,即直接存储器访问。 DMA传输将数据从一个地址空间复制到另一个地址空间,提供在外设和

Google Guava

Google Guava Guava 是一个 Google 的基于java1.6的类库集合的扩展项目,包括 collections, caching, primitives support, concurrency libraries, common annotations, string processing, I/O, 等等. 这些高质量的 API 可以使你的JAVa代码更加优雅,更加简

Google Guava

Google Guava Guava 是一个 Google 的基于java1.6的类库集合的扩展项目,包括 collections, caching, primitives support, concurrency libraries, common annotations, string processing, I/O, 等等. 这些高质量的 API 可以使你的JAVa代码更加优雅,更加简

spring @value

spring @value 在spring 3.0中,可以通过使用@value,对一些如xxx.properties文件 中的文件,进行键值对的注入,例子如下: 1 首先在

spring quartz

spring quartz http://www.oschina.net/question/8676_9032 <ref bean="testTrigger"/> </list> </property> <property name="autoStartup" value="true"/> 说明: Scheduler包含一个Trigger列表,每个Trigger表示一个作业。 2、Trigger的配置 说明: Cro

semaphore/信号量, mutex/互斥锁

信号量 Semaphore 信号量是 Edsger Dijkstra 发明的数据结构,在解决多种同步问题时很有用。其本质是一个整数,并关联两个操作: 申请 acquire(也称为 wait、dec

apktool APK解压、打包

apktool APK解压、打包 1 2 3 4 5 keytool -genkey -alias JFrench.keystore -keyalg RSA -validity 1000000 -keystore JFrench.keystore jarsigner -verbose -keystore E:\projects\keystore\JFrench.keystore -s ignedjar JFrench_signed.apk foo.apk JFrench.keystore http://showlike.iteye.com/blog/1686103 http://blog.csdn.net/jesusjzp/article/details/7922451 apktool之APK解压、打包 http://blog.csdn.net/caszhao/article/details/6030425 博客分类: java apktoolandroidjava 简介: Android apktool

BSc, BA

BSc, BA BA,全称:Bachelor of Arts,文学学士 BSc,全称:Bachelor of Science,理学学士 MA,全称:Master of Arts, 文学

which, command, type

which, command, type 避免使用which, 用shell内置的 command -v, hash, type替代 command -v 相当于 type type type是bash内置命令,语法: type [-afptP] [name ...] type工具用于显示命

java openjdk JMH

java openjdk JMH create test project with maven 1 2 3 4 5 6 7 mvn archetype:generate \ -DinteractiveMode=false \ -DarchetypeGroupId=org.openjdk.jmh \ -DarchetypeArtifactId=jmh-java-benchmark-archetype \ -DgroupId=org.sample \ -DartifactId=test \ -Dversion=1.0 JMH 是一个由 OpenJDK/Oracle 里面那群开发了 Java 编译器的大牛们所开发的 Micro Benchmark Framework 。何谓 Micro Benchmark 呢?简单地说就是

startActivityForResult()

startActivityForResult() 举例说我想要做的一个事情是,在一个主界面(主Activity)上能连接往许多不同子功能模块(子Activity上去),当子模块的事情做完之

javascript unit test

javascript unit test http://blog.sina.com.cn/s/blog_6768f2290100ubw5.html 最近由于工作和个人兴趣的关系,有幸研究了一下javascript的unit test,市面上常见且比较易用的javascript的un