//MD5加密private static string GetMd5Hash(string emailAddress) { byte[] data = MD5.Create().ComputeHash(Encoding.UTF8.GetBytes(emailAd...
分类:
其他好文 时间:
2015-03-30 16:10:32
阅读次数:
136
class ConSum{ private: static int n; static int sum; public: ConSum(){++n;sum+n} static int getSum(){return sum;} }; int ConSum::n=0; int ConSum::sum=...
分类:
其他好文 时间:
2015-03-29 23:35:43
阅读次数:
137
像之前基于映射文件 .hbm.xml 的SessionFactory类的写法是这样的
private static SessionFactory sessionFactory ;
static
{
sessionFactory = new Configuration().configure().buildSessionFactory();
}
自动生成数据库Schema的类...
分类:
Web程序 时间:
2015-03-29 16:38:39
阅读次数:
158
初次接触设计模式,看到了第一个模式--单例模式,
这是一个使类仅有一个对象的模式,其要点是防止类的外部new出新的对象,所以就把类的构造函数设计成私有,这样类的外部就不能访问该构造函数,也就不能new出的新的对象。
单例模式的最简单的构造方法
class TaskManager{
private static TaskManager tm = NULL;
...
分类:
其他好文 时间:
2015-03-28 20:27:22
阅读次数:
130
要实现Android两端对齐的文字排版效果,我们当然可以继承原有的TextView来实现,但一个更简单的方式就是使用WebView,利用HTML样式来实现。首先定义一个String常量,我们可以将它视为一个HTML模板:private static final String WEBVIEW_CONT...
分类:
移动开发 时间:
2015-03-28 11:24:31
阅读次数:
129
//config.properties中配置了数据库配置的相关信息,通过这个单例模式设计来实现解耦。public class PathConfig { private static PathConfig instance = null; private String dataPath = null....
分类:
其他好文 时间:
2015-03-21 16:53:36
阅读次数:
95
喜欢手写学习,记忆深刻(字丑勿喷!)。计算过程的代码如下:public class PageRank{ private static double m[][]={ { 0 , 0.5 , 1 , 0 }, {0.333333333 , 0 , 0 , 0.5}, {0....
分类:
其他好文 时间:
2015-03-21 16:47:10
阅读次数:
185
1:通过反射解析这个类的构造函数public class person { public String name="jack"; private int password=123; private static int age; public person() { System.out.print....
分类:
编程语言 时间:
2015-03-21 11:01:41
阅读次数:
180
public class TestJava { //定义获取资源文件 private static final ResourceBundle bundle = initBundle(); private static ResourceBundle initBundle(){...
分类:
数据库 时间:
2015-03-20 16:11:36
阅读次数:
209
public class CommUtils {
private static Toast toast = null;
public static void showToast(int text) {
if (toast == null) {
toast = Toast.makeText(NetApplication.getInstance()
.getApplica...
分类:
其他好文 时间:
2015-03-20 14:26:36
阅读次数:
139