Skip to content

Instantly share code, notes, and snippets.

View dongdongdeng's full-sized avatar

MallocFree dongdongdeng

View GitHub Profile
@binjoo
binjoo / Arith.java
Created October 27, 2012 09:59
JAVA:BigDecimal加减乘除运算
import java.math.BigDecimal;
/**
* 由于Java的简单类型不能够精确的对浮点数进行运算,这个工具类提供精确的浮点数运算,包括加减乘除和四舍五入。
*/
public class Arith { // 默认除法运算精度
private static final int DEF_DIV_SCALE = 10; // 这个类不能实例化
private Arith() {
}
@rajeshsegu
rajeshsegu / BrowserDetectProtocol.js
Created September 13, 2012 19:26
Detect Browser Custom Protocols
<html>
<head>
<title>Detect Custome Protocol</title>
<script type="text/javascript" src="/public/unittest/jasmine/jquery.js"></script>
</head>
<body>
<input id="protocol" value="" placeholder="custom protocol"/>
<button id="launch">Launch</button>
<!-- Mozilla Only -->
<iframe id="hiddenIframe" src="about:blank"></iframe>