第一个:
pass “String” return MD5 “String”
import java.io.FileInputStream;
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class MD5 {
public static String getMD5(String input) {
try {
MessageDigest md = MessageDigest.getInstance("MD5");
byte[] messageDigest = md.digest(input.getBytes());
BigInteger number = new BigInteger(1, messageDigest);
String hashtext = number.toString(16);
// Now we need to zero pad it if you actually want the full 32 chars.
while (hashtext.length() < 32) {
hashtext = "0" + hashtext;
}
return hashtext;
}
catch (NoSuchAlgorithmException e) {
throw new RuntimeException(e);
}
}
public static void main(String[] args) throws NoSuchAlgorithmException {
System.out.println(getMD5("Javarmi.com"));
}
}
第二个,同样效果,算法稍有不同:
import java.io.FileInputStream;
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class MD5 {
public static String getMD5(String input) {
byte[] source;
try {
//Get byte according by specified coding.
source = input.getBytes("UTF-8");
} catch (UnsupportedEncodingException e) {
source = input.getBytes();
}
String result = null;
char hexDigits[] = {'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
try {
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(source);
//The result should be one 128 integer
byte temp[] = md.digest();
char str[] = new char[16 * 2];
int k = 0;
for (int i = 0; i < 16; i++) {
byte byte0 = temp[i];
str[k++] = hexDigits[byte0 >>> 4 & 0xf];
str[k++] = hexDigits[byte0 & 0xf];
}
result = new String(str);
} catch (Exception e) {
e.printStackTrace();
}
return result;
}
public static void main(String[] args) throws NoSuchAlgorithmException {
System.out.println(getMD5("Javarmi.com"));
}
}
最后是一个用MD5生成File checksum的例子:
public static void main(String[] args) throws Exception {
MessageDigest md = MessageDigest.getInstance("MD5");
FileInputStream fis = new FileInputStream("c:\\apache\\cxf.jar");
byte[] dataBytes = new byte[1024];
int nread = 0;
while ((nread = fis.read(dataBytes)) != -1) {
md.update(dataBytes, 0, nread);
};
byte[] mdbytes = md.digest();
StringBuffer sb = new StringBuffer();
for (int i = 0; i < mdbytes.length; i++) {
sb.append(Integer.toString((mdbytes[i] & 0xff) + 0x100, 16).substring(1));
}
System.out.println("Digest(in hex format):: " + sb.toString());
}
无论新的surf怎么好,起码现在还仍然不太成熟,老的Alfresco Explorer虽然技术较为落后,但是功能和各方面仍然比新的UI成熟很多。
如果你经常使用alfresco explorer来进行文档和记录管理和编辑,你会发现当你在同一个页面中有多个form的时候,每次form提交该页面都会自动回到首页,如果你的页面很长,这个问题很是烦人。(其实在使用ajax list or space or whatever picker等UI的时候都会有同样的问题,增加和删除项后form提交会导致页面回到顶端)
在alfresco.war的web.xml中有一个项可以修复该问题。编辑web.xml,找到:
<context-param>
<param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
<param-value>true</param-value>
<description>
If true, a javascript function will be rendered that is able to restore the
former vertical scroll on every request. Convenient feature if you have pages
with long lists and you do not want the browser page to always jump to the top
if you trigger a link or button action that stays on the same page.
Default: "false"
</description>
</context-param>
3.2r2中没编辑过的话在56-66行,将其中的param-value 由 false改为ture就可以了。
修改后使用myface auto scrolling功能记录你上次的位置,方便了许多。
David Binning
3 August 2010
The more useful information you know about your customers, the better you can understand and address their needs.
Chosen carefully and implemented intelligently, a customer relationship management (CRM) system can help you gain powerful insights into what makes your customers tick.
The key to getting customer relationship management right is in deciding the best questions to ask and then figuring out what to do with the answers. Before you begin asking your customers questions though, ask yourself some:
* Who are your customers?
* What are the main subgroups?
* How do you currently interact with them, and how would you like to interact with them?
* What do they currently buy from you, and what do you think they might buy in the future?
* How long have they been customers, and what do you know about why they chose to do business with you?
CRM systems provide a framework to collect and process all of the information about the people who buy, or should be buying from you, so that you can develop smarter and more effective strategies for targeting them, while tracking your success beyond the mere fact of a sale. Continue reading →
Posted in 商业金融
|
Tagged CRM
|
18th-Aug-2010: 新的3.2.2出来了,暂时不能越狱,大家注意如果你越狱了,iTune叫你升级新版注意点“否”,在iTunes的功能设置选项中有禁止自动更新的选项,注意调整。
10th-Aug-2010: 这年头的电子相框还能“越狱”,昨晚上越狱成功,中途出现白苹果,不过现已修复。还有这个相框是基于Unix操作系统的,怪不得还挺贵 lolz
越狱后装了IPA补丁,很可能会白苹果,不过可以重新刷回来,
步骤如下: 1。进入刷机模式:按HOME+电源 10秒,然后放开电源继续按HOME,直到ITUNES连接界面出现
2。打开ITUNES会有显示一个IPAD需要恢复。
3。按提示确认恢复。
4。下载恢复固件后,自己手动关机
5。把ITUNES的帐号换成美国帐号,不然下面就进不去恢复的服务器。
6。再重复1~3,之后会出现连接服务器,连上后恢复,成功。
一般下载是30分钟(400M)恢复是15分钟。
以上是昨天恢复出厂设置的经过,请大家参考。
1,下载iPad 3.2固件;http:/ /appldnld.apple.com.edgesuite.net/content.info.apple.com/iPad/061-7987.20100403.mjiTr/iPad1,1_3.2_7B367_Restore.ipsw 文件大小:456.8mb
2,将开机就只能显示一个大白苹果的IPAD用数据线链接到安装有iTunes的电脑,这时候的显示还是卡在一个白苹果的界面。
3,同时按住圆点+开/关机键直到IPAD黑屏,松开开/关机键大约7秒左右直到Itunes检测到连接为止即进入DFU模式,
4,此时看到iTunes会显示有一个等待恢复的ipad。
5,按住键盘shift后点击iTunes恢复按钮,会出现一个对话框,此时请选择之前下载的固件文件进行恢复。
6,恢复进程约5分钟。耐心等待。。。您心爱的ipad马上就要回到您身边了。
9th-Aug-2010: 买了个多功能电子相框,好像叫做iPad啊? 还不错。