import java.security.MessageDigest;/** * Md5 工具 */public class Md5Util { private static MessageDigest md5 = null; static { try { ...
分类:
编程语言 时间:
2015-04-05 14:32:12
阅读次数:
113
/**
* 获取本地IP地址
* @author YOLANDA
* @return
*/
public static String getLocalIPAddress() {
String ipAddress = "";
try {
Enumeration netfaces = NetworkInterface.getNetworkInterfaces();...
分类:
移动开发 时间:
2015-04-05 13:25:44
阅读次数:
469
JDBC操作步骤/*
* JDBC操作步骤
*
*/
public class Test01 {
public static void main(String[] args) {
try {
//1.加载并注册驱动
Class.forName("com.mysql.jdbc.Driver");...
分类:
数据库 时间:
2015-04-05 09:08:04
阅读次数:
229
getActionBar().setTitle(); Java.lang.NullPoint异常解决方案,是由于低版本不支持直接获取的缘故,修改方案:try changing your theme to thisand not the AppCompat Version 另外一种情况,如果是低版本....
分类:
编程语言 时间:
2015-04-05 01:05:44
阅读次数:
366
#!/usr/bin/python
#coding:utf-8
importos
importstring
importsys,getopt
defGrep_start_char(Mpath,char):
ifos.path.exists(Mpath):
GrepFile=file(Mpath)
else:
return"Nosuchfileordirectory"
try:
forlineinhosts:
ifline.startswith(char)orline.strip()==‘‘:
conti..
分类:
编程语言 时间:
2015-04-04 16:55:52
阅读次数:
144
修改环境变量.bashrc或.zshrc:PYTHONSTARTUP='/home/users/xx/.pythonstartup'export PYTHONSTARTUP写入.pythonstartup文件try: import readlineexcept ImportError: print ...
分类:
编程语言 时间:
2015-04-04 12:06:59
阅读次数:
130
1 # coding: utf-8 # 使用Windows系统,首行'#!/usr/bin/env Pyton'无用,全部改为'# coding: utf-8' 2 3 'readtextfile.py -- read and display text file' 4 5 # get file...
分类:
编程语言 时间:
2015-04-04 11:52:42
阅读次数:
193
访问hdfs上的文件并写出到输出台 /** * 访问hdfs上的文件并写出到输出台 * @param args */ public static void main(String[] args) { try { //将hdfs格式...
分类:
编程语言 时间:
2015-04-04 09:05:37
阅读次数:
143
最近有一项目要求修改系统时间try{Processprocess=Runtime.getRuntime().exec("su");DataOutputStreamos=newDataOutputStream(process.getOutputStream());os.writeBytes("date-s20150319.024012;\n");os.writeBytes(lastTime);}catch(Exceptione){e.printStackTrace();}
分类:
其他好文 时间:
2015-04-04 01:24:41
阅读次数:
151
转载:http://www.cnblogs.com/averey/p/4379646.html今天去逛论坛 时发现了一个很有趣的问题:谁能给我我解释一下这段程序的结果为什么是:2.而不是:3代码如下:class Test { public int aaa() { int x = 1; try {.....
分类:
其他好文 时间:
2015-04-03 22:29:03
阅读次数:
154