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
| /* | |
| * Amount2RMB.java 2008-6-15 | |
| */ | |
| package test; | |
| import java.util.regex.Matcher; | |
| import java.util.regex.Pattern; | |
| public class Amount2RMB { | |
| private static final Pattern AMOUNT_PATTERN = |
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; | |
| import java.io.File; | |
| public class UpdateMp3Name { | |
| public static void main(String[] args) { | |
| String oldPath = "E:\\BaiduMusic\\Songs"; | |
| File file = new File(oldPath); | |
| File[] files = file.listFiles(); |
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
| /** | |
| * CODETANK | |
| * Copyright (c) 2012, Tencent AlloyTeam, All rights reserved. | |
| * http://CodeTank.AlloyTeam.com/ | |
| * | |
| * @version 1.0 | |
| * @author AlloyTeam | |
| * | |
| * .d8888b. 888 88888888888 888 TM | |
| * d88P Y88b 888 ''''888'''' 888 |
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
| declare | |
| i int; | |
| now date; | |
| date1 date; | |
| week int; | |
| begin | |
| now := trunc(sysdate); | |
| for i in 0..2000 loop | |
| date1 := now + i; | |
| week := to_number(to_char(date1 - 1, 'd')); |
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
| @echo off | |
| pushd "%~dp0" | |
| dir /b C:\Windows\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientExtensions-Package~3*.mum >List.txt | |
| dir /b C:\Windows\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientTools-Package~3*.mum >>List.txt | |
| for /f %%i in ('findstr /i . List.txt 2^>nul') do dism /online /norestart /add-package:"C:\Windows\servicing\Packages\%%i" | |
| pause |
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
| $("html,body").click(function(e) { | |
| var gcd = new Array("富强", "民主", "文明", "和谐", "自由", "平等", "公正", "法治", "爱国", "敬业", "诚信", "友善"); | |
| var n = Math.floor(Math.random() * gcd.length); | |
| var $i = $("<b/>").text(gcd[n]); | |
| var x = e.pageX, | |
| y = e.pageY; | |
| $i.css({ | |
| "z-index": 99999, | |
| "top": y - 20, | |
| "left": x, |
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
| # 这里是举例监控httpd服务端口状态,根据端口判断服务器是否启动, | |
| # 如果没有启动则脚本自动拉起服务,如果服务正在运行则退出脚本程序; | |
| # 如果换成别的服务端口也可以,但是脚本程序需要做调整。 | |
| #!/bin/bash | |
| #实时每隔3秒监控HTTP服务状态,服务异常输出报警信息,并尝试启动,服务正常时提示正常运行。 | |
| web=`netstat -ant | grep 80 | awk '{print $4}' | awk -F : '{print $4}'` | |
| apachelog=/var/log/httpd/service.log | |
| if [ '$web' = '80' ] | |
| then |
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
| export default function BrowserType () { | |
| // 权重:系统 + 系统版本 > 平台 > 内核 + 载体 + 内核版本 + 载体版本 > 外壳 + 外壳版本 | |
| const ua = navigator.userAgent.toLowerCase(); | |
| const testUa = regexp => regexp.test(ua); | |
| const testVs = regexp => ua.match(regexp) | |
| .toString() | |
| .replace(/[^0-9|_.]/g, "") | |
| .replace(/_/g, "."); | |
| // 系统 | |
| let system = "unknow"; |
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
| public class TrendsJava { | |
| public static void main(String[] args) { | |
| int i = 10; | |
| String code = "System.out.println(\"Hello World!\"+(13+2*5/3));"; | |
| code += "for(int i=0;i<" + i + ";i++){"; | |
| code += " System.out.println(Math.pow(i,2));"; | |
| code += "}"; | |
| try { | |
| run(code); |