This file contains 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
// all functions below accepts input and provide output in big-endian. | |
var bit_mask = [0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80]; | |
var ip_table = | |
[ | |
[[7,1],[6,1],[5,1],[4,1],[3,1],[2,1],[1,1],[0,1]], | |
[[7,3],[6,3],[5,3],[4,3],[3,3],[2,3],[1,3],[0,3]], | |
[[7,5],[6,5],[5,5],[4,5],[3,5],[2,5],[1,5],[0,5]], | |
[[7,7],[6,7],[5,7],[4,7],[3,7],[2,7],[1,7],[0,7]], |
This file contains 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
var utf8_scope = [0x0, 0x7f, 0x7ff, 0xffff, 0x10000]; | |
var utf8_prefix = [0x80, 0x00, 0xc0, 0xe0, 0xf0]; | |
var utf8_valid_bits = [6, 7, 5, 4, 3]; | |
var utf8_valid_mask = [0x3f, 0x7f, 0x1f, 0x0f, 0x07]; | |
function str2utf(str) | |
{ | |
//if (!(str instanceof String)) | |
//return; |
This file contains 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.github.cuter44.util.servlet; | |
import java.nio.ByteBuffer; | |
/* util */ | |
import java.util.List; | |
import java.util.ArrayList; | |
import java.util.StringTokenizer; | |
/* http */ | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpSession; |
This file contains 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
javascript:void( | |
function() | |
{ | |
var to=prompt("收件人","442030700@qq.com"), | |
d=document, | |
e=encodeURIComponent, | |
s1=window.getSelection, | |
s2=d.getSelection, | |
s3=d.selection, | |
s=s1?s1():s2?s2():s3?s3.createRange().text:'', |
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<!-- | |
Default build.xml file for JavaWeb Project | |
========================================== | |
@depend ant-1.9.2+ (tested, actually more below this) | |
@author "galin"<cuter44@qq.com> | |
@version 1.3.1 build 2014/2/15 | |
========================================== | |
You can do whatever to this file as you wish. | |
This file and other attachement is provided as-if, and no warranty. |
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<!-- | |
Default build.xml file for local Java Project | |
========================================== | |
@depend ant-1.9.2+ (tested, actually more below this) | |
@author "galin"<cuter44@qq.com> | |
@version 1.0.0 build 2014/2/25 | |
========================================== | |
You can do whatever to this file as you wish. | |
This file and other attachement is provided as-if, and no warranty. |
This file contains 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
/** user-script baidu map Lat/Long -> geohash.org adapter | |
* attach to http://api.map.baidu.com/lbsapi/getpoint/index.html | |
* for non-IE | |
*/ | |
function toGeohash() | |
{ | |
var loc = document.getElementById("pointInput").value.split(","); | |
var body = document.getElementsByTagName("body")[0]; | |
var oldf = document.getElementById("geohash"); |
This file contains 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
var zfbot = { | |
interval:5000, | |
data:null, | |
count:null, | |
started:false, | |
load_jq:function() | |
{ | |
var jq = document.createElement("script"); | |
jq.type = "text/javascript"; | |
jq.src = "http://libs.baidu.com/jquery/1.10.2/jquery.min.js"; |
This file contains 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.github.cuter44.photomerge; | |
import java.io.*; | |
import java.awt.*; | |
import java.awt.image.*; | |
import javax.imageio.*; | |
import java.util.logging.*; | |
public class PhotoMerge | |
{ |
This file contains 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
/** ISBN-13 decoder | |
* author by galin<cuter44@foxmail.com> | |
* free to use if reserve the author info. | |
*/ | |
function ISBN13Parser(){ | |
this.sResult = null; | |
this.iaResult = null; | |
this.baResult = null; | |
this.thresold = 80; |
OlderNewer