原来的版本是用fopen打开文件的,如果要从ANDROID的APK中取文件,直接就洗白了修改如下void CCCrypto::MD5File(const char* path, unsigned char* output){unsigned long len = 0;//to make sure w...
分类:
移动开发 时间:
2014-07-10 12:46:13
阅读次数:
316
此小程序实现了计算器的基本功能:import java.awt.*;import java.awt.event.*;import javax.swing.*;public class SimpleCalc extends JFrame{ private static final long se...
分类:
编程语言 时间:
2014-07-09 23:39:12
阅读次数:
295
java定时器的使用定时器类Timer在java.util包中。使用时,先实例化,然后使用实例的schedule(TimerTask task, long delay)方法,设定指定的任务task在指定的延迟delay后运行。定时器任务类TimerTask是抽象类,继承并重写其run()方法,可实....
分类:
编程语言 时间:
2014-07-07 21:34:44
阅读次数:
186
This post introduces Sandbox pattern to avoid the namespace drawbacks(1. Reliance on a single global variable to be the application’s global. 2. Long,...
分类:
数据库 时间:
2014-07-07 20:15:42
阅读次数:
262
/*看一下部分的HashSet源码....public class HashSet extends AbstractSet implements Set, Cloneable, java.io.Serializable{ static final long serialVersio...
分类:
其他好文 时间:
2014-07-07 15:23:29
阅读次数:
253
int s = 5;int? s_null;long t;long? t_null;t = s; //隐式转换 S -> Ts = (int)t; //显示转换 T -> Ss_null = s; //隐式转换 S -> S?s = (int)s_null; //显示转换 S? -> Tt_null...
分类:
其他好文 时间:
2014-07-02 00:29:58
阅读次数:
287
==:1、比较的是操作符两端的操作数是否是同一个对象2、两边的操作数必须是同一类型的(可以是父子类之间)才能编译通过。3、比较的是地址,如果是具体的阿拉伯数字的比较,值相等则为TRUE,如:int a=10 与 long b=10L 与 double c=10.0都是相同的(为true),因为他们都...
分类:
其他好文 时间:
2014-06-30 13:04:40
阅读次数:
191
题目链接:http://poj.org/problem?id=2299
题目大意:求出排序过程中的最小交换次数
利用归并排序的分治算法解决此题。
代码:
#include
#include
#include
#define N 500001
using namespace std;
int a[N];
int temp[N];
long long ans;
void merge(in...
分类:
其他好文 时间:
2014-06-30 08:18:11
阅读次数:
230
已知圆心(0,0)圆周上的一点,求圆周上另外两点使得三点构成等边三角形。
懒得推公式,直接用模板2圆(r1=dist,r2=sqrt(3)*dist)相交水过
#include
#include
#include
#include
#include
using namespace std;
#define eps 1e-6
typedef long long ll;
inline double...
分类:
其他好文 时间:
2014-06-30 08:11:07
阅读次数:
310
java中的4种整数类型:byte,short,int,long均采用补码表示。
如下图右边所示
在java中对二进制数没有“字面”表示方法。十六进制可以用OX或者Ox指示,八进制可以用O指示。
下面的代码可以输出byte类型的数据的2进制表示形式:
public class Test {
public static void main(String[] args...
分类:
编程语言 时间:
2014-06-29 23:24:27
阅读次数:
288