- 浏览: 70416 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (74)
- core Java (14)
- html (2)
- javascript (5)
- database (6)
- Design Patterns (4)
- spring (6)
- XML (0)
- other (1)
- application (1)
- Linux (Fedora 14) (1)
- Hibernate (6)
- tools (5)
- JBoss7 (1)
- J2EE (1)
- Concurrency (5)
- Linux (5)
- CSS (1)
- English (1)
- Python/Go/Shell (1)
- Container (1)
- Cloud (0)
- Kubernetes (1)
- Mac (1)
- Golang (1)
最新评论
-
MySSH:
但是我是用的eclipse-SDK-3.5.2的,里面没有or ...
jQuery 工具安装-jqueryWTP -
2022228:
废话,浪费资源
Runnable and Thread
程序需求:http://joezxy.iteye.com/blog/366794
import java.math.BigDecimal; public class Algorithm { public static void main(String[] args) { powerWrapper(95.123,12); powerWrapper(0.4321,20); powerWrapper(5.1234,15); powerWrapper(6.7592,9); powerWrapper(98.999,10); powerWrapper(1.0100,12); } public static void powerWrapper(double x, int y){ String result = power(x,y); System.out.println(format(result)); } public static String power(double x, int y){ BigDecimal b1 = new BigDecimal(String.valueOf(x)); return b1.pow(y).toPlainString(); } public static String format(Object x){ String regex1 = "^0\\..*$"; String regex2 = "^.*\\.0*$"; String regex3 = "^0\\.0*$"; String result = String.valueOf(x); if(result.matches(regex3)){ result = "0"; } else if(result.matches(regex1)){ result = result.replace("0.", "."); } else if(result.matches(regex2)){ int index = result.indexOf('.'); result = result.substring(0, index); } return result; } }
- Algorithm.zip (550 Bytes)
- 下载次数: 0
发表评论
-
Security / SSL
2016-08-30 17:31 446https://www.ssllabs.com/ssltest ... -
Java Shift Operator (signedLeftShift, signedRightShift, unsignedRightShift)
2015-03-11 11:33 455Java Shift Operator ( << ... -
File.separator vs File.pathSeparator
2014-02-24 16:51 745See: http://stackoverflow.com/ ... -
InheritableThreadLocal & ThreadLocal
2014-01-07 12:11 2553InheritableThreadLocal比Thread ... -
Java Concurrency In Practice Contents
2013-12-24 17:35 0Chapter 1 - Introduction 1 1. ... -
[转] Explain Java Encapsulation & Polymorphism & Inheritance
2013-11-01 15:02 1173Encapsulation - Hiding the i ... -
Java Create Instance Method
2013-10-22 19:04 646Java Create Instance Method ... -
Object Methodes: equals and hashCode
2013-09-10 17:31 669今天看了Object的equals() and hashC ... -
coreJava: serialVersionUID
2011-12-09 19:25 779Eclipse会检查serialVersionUI ... -
StringBuffer And StringBuilder
2011-12-08 12:00 641StringBuilder是在1.5版本时出现的,是Strin ... -
Eclipse Tools
2011-10-13 22:55 4501. Eclipse New 菜单配置 Window --& ... -
笔试题笔记
2011-07-27 23:50 3381. 请说出DOM和SAX的技术异同点 DOM先要生成DOM ... -
转载:Java程序员需要注意的十项
2010-11-07 16:03 0From: 10 Commandments for Java ... -
temp
2010-05-30 01:40 0Dojo -------------------------- ... -
fillter in web.xml
2009-09-14 18:48 0参考文献: http://javaworld.com.tw/ ... -
Java Collections
2009-09-06 11:00 0资料来源于网上。 结构图: -
Java Collections(一): Set/List/Map
2009-09-05 20:24 0Collection: public interfac ... -
JSTL 版本选择 2.4&2.3
2009-08-25 12:01 3495JSTL与Servlet版本对映 整 ... -
java note from web
2007-08-11 15:55 6291.什么是模式?什么是框架? 模式,即pattern。其实就 ... -
Runnable and Thread
2009-07-29 15:30 5575今天看了源码,总算多少理解一点,对Runnable 和 Thr ...
相关推荐
GNU Regex 程式库是 GNU 发展,提供操作比对 Regular Expression 文字字串的程式库,也就是使用 GNU Regex 程式库,可以作到以下的功能: 比对一字串是否完全与 Regular Expression 相幅合。 在一字串中寻找与 ...
eclipse regular expression 插件
Regular Expression Pocket Reference
Regular Expression 简介.pdf 正则表达式
Regular Expression Quick Reference
grep (global search regular expression(RE) and print out the line,全面搜索正则表达式并把行打印出来)是一种强大的文本搜索工具,它能使用正则表达式搜索文本,并把匹配的行打印出来。Unix的grep家族包括grep...
正则表达式资料全集.rar Regular Expression Syntax Reference
mastering regular expression
Regular Expression Recipes for Windows Developers.pdf
Oracle offcial regular expression book
如果你曾经用过Perl或任何其他内建正则表达式支持的语言,你一定知道用正则表达式...如果你不熟悉这个术语,那么“正则表达式”(Regular Expression)就是一个字符构成的串,它定义了一个用来搜索匹配字符串的模式。
A Regular Expression Wrapper Using ATL in C++Src.zip
regular expression processor, 将正则表达式转换成NFA,接着讲NFA转换成DFA,并输出DFA。同时可以生成DOT文件,以提供给graphviz生成图形界面。
介绍正则表达式的英文slide 使用Python和Java实现相应的功能 文件已加密,可在下载后与我联系,免费获得解锁密码
a tool which is used to design the regular expression a tool which is used to design the regular expression a tool which is used to design the regular expression a tool which is used to design the ...
正则表达式(regular expression) 原著:笑容 创作于:2004年05月03日 最后更新:2004年05月04日 21:12 引用地址:正则表达式(regular expression) 版权声明:使用创作公用版权协议 ...
regular expression NFA Thompson 十分优良的代码,老外写的。。。。
本文实例源码 博文链接:https://gmf.iteye.com/blog/89077
简要介绍了正则表达式的常见语法和使用,简体中文