JAVA初级学习笔记
西祠梧桐
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
简单Hash算法一台机器宕掉的情况下出现的错误率
假设有四台服务器,分别为A,B,C,D.请求有7个,分别为1,2,3,4,5,6,7根据负载均衡策略,请求应该均匀分布在服务器上,按照简单Hash算法,服务器ip=总的请求%服务器个数,则A上的请求有:1,5 B有:2,6 C有3,7 D有4当服务器D宕掉的情况, 则服务器对应的请求为: A有:1 4 7 B有:2,5 C有:3,6 错误率为:4/7=57% 很显然错误率很大,原创 2016-06-04 15:59:55 · 321 阅读 · 0 评论 -
用JAVA hex字符串转出字符串
/** * hex字符串转出字符串 *TODO *@param s *@return * @throws UnsupportedEncodingException */ public static String hexToString(String s) throws UnsupportedEncodingExce原创 2016-06-15 08:43:14 · 606 阅读 · 0 评论 -
用JAVA 字符串转hex字符串
/** * 字符串转hex字符串 * @throws UnsupportedEncodingException */ public static String strToHex(String str) throws UnsupportedEncodingException { return String.format("%x原创 2016-06-15 08:47:52 · 3766 阅读 · 0 评论 -
用JAVA实现 hex字符串转出字符串
/** * hex字符串转出字符串 *TODO *@param s *@return * @throws UnsupportedEncodingException */ public static String hexToString(String s) { byte[] bytes =原创 2016-06-15 08:50:09 · 1745 阅读 · 0 评论 -
在AIX8.0下实现ftp上传指定文件到ftp服务器
#!/bin/kshDATE="$(date +"%Y-%m-%d")"ftp -i -n 192.10.10.19 user bst bstcd /u01/bstmkdir $DATEcd /u01/bst/$DATEmkdir server1mkdir server2bincd /u01/bst/$DATE/server1lcd /usr_bst/I原创 2016-06-15 09:00:34 · 4074 阅读 · 0 评论 -
在WebSphere下实现F5下获取客户端真实IP
反编译出WebShpere下的package com.ibm.ws.webcontainer.channel;下的WCCRequestImpl类中的public String getRemoteAddr(){} 方法在方法开头加入此语句 String ip = this.request.getHeaderAsString("X-Forwarded-For"); if ((i原创 2016-06-15 09:12:44 · 1632 阅读 · 1 评论
分享