This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.security.MessageDigest; | |
| import java.security.NoSuchAlgorithmException; | |
| /** | |
| * 【转】URL短地址压缩算法 微博短地址原理解析 | |
| * http://www.cnblogs.com/jinzhao/archive/2012/04/08/2437188.html | |
| * | |
| */ | |
| public class ShortUrl { | |
| public static String[] generateCode(String url) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.text.DecimalFormat; | |
| import java.text.NumberFormat; | |
| import java.text.SimpleDateFormat; | |
| import java.util.Calendar; | |
| public class MyEclipseCrack { | |
| public static final void main(String[] args) { | |
| String id = "binjoo";// 改为你的注册ID | |
| String num = "428";// 改为1-999的整数 | |
| String date = "-1404280";// 意思是2014年4月28日到期 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package net.binjoo.demo; | |
| import java.io.BufferedReader; | |
| import java.io.InputStreamReader; | |
| import java.util.List; | |
| import org.apache.oro.text.regex.MalformedPatternException; | |
| import org.apache.oro.text.regex.MatchResult; | |
| import org.apache.oro.text.regex.Pattern; | |
| import org.apache.oro.text.regex.PatternCompiler; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * 对Date的扩展,将 Date 转化为指定格式的String | |
| * 月(M)、日(d)、12小时(h)、24小时(H)、分(m)、秒(s)、周(E)、季度(q) 可以用 1-2 个占位符 | |
| * 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字) | |
| * eg: | |
| * (new Date()).pattern("yyyy-MM-dd hh:mm:ss.S") ==> 2007-07-02 08:09:04.423 | |
| * (new Date()).pattern("yyyy-MM-dd E HH:mm:ss") ==> 2007-03-10 二 20:09:04 | |
| * (new Date()).pattern("yyyy-MM-dd EE hh:mm:ss") ==> 2007-03-10 周二 08:09:04 | |
| * (new Date()).pattern("yyyy-MM-dd EEE hh:mm:ss") ==> 2007-03-10 星期二 08:09:04 | |
| * (new Date()).pattern("yyyy-M-d h:m:s.S") ==> 2007-7-2 8:9:4.18 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.utils; | |
| import java.io.File; | |
| import java.io.FileInputStream; | |
| import java.io.FileOutputStream; | |
| import java.io.InputStream; | |
| /*** | |
| * | |
| * @ClassName CopyUtils |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.io.BufferedInputStream; | |
| import java.io.File; | |
| import java.io.FileInputStream; | |
| import java.io.FileOutputStream; | |
| import java.util.zip.CRC32; | |
| import java.util.zip.CheckedOutputStream; | |
| import org.apache.tools.zip.ZipEntry; | |
| import org.apache.tools.zip.ZipOutputStream; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package net.binjoo.wechat; | |
| import java.io.IOException; | |
| import java.util.Arrays; | |
| import javax.servlet.ServletException; | |
| import javax.servlet.http.HttpServlet; | |
| import javax.servlet.http.HttpServletRequest; | |
| import javax.servlet.http.HttpServletResponse; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Windows Registry Editor Version 5.00 | |
| [-HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\Sublime Text 2] | |
| [-HKEY_CLASSES_ROOT\*\shell\Sublime Text 2] | |
| [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\Sublime Text 2] | |
| [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\Sublime Text 2\command] | |
| @="D:\\微云网盘\\105871875\\Soft\\SublimeText2\\sublime_text.exe \"%1\"" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * 生成随机字符串 | |
| * | |
| * @access public | |
| * @param integer $length 字符串长度 | |
| * @param string $specialChars 是否有特殊字符 | |
| * @return string | |
| */ | |
| public static function randString($length, $specialChars = false) { | |
| $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.regex.Matcher; | |
| import java.util.regex.Pattern; | |
| public class HTMLSpirit{ | |
| public static String delHTMLTag(String htmlStr){ | |
| String regEx_script="<script[^>]*?>[\\s\\S]*?<\\/script>"; //定义script的正则表达式 | |
| String regEx_style="<style[^>]*?>[\\s\\S]*?<\\/style>"; //定义style的正则表达式 | |
| String regEx_html="<[^>]+>"; //定义HTML标签的正则表达式 | |
| Pattern p_script=Pattern.compile(regEx_script,Pattern.CASE_INSENSITIVE); |