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
public class StackTest { | |
private Stack<Character> oprStack = new Stack<Character>(); | |
private Stack<Integer> numStack = new Stack<Integer>(); | |
public static void main(String[] args) { | |
StackTest st = new StackTest(); | |
System.out.println(st.calc("3+4*((4*10-10/2)+5)#")); | |
} | |
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
public static String getCharset(byte[] bytes) { | |
if(bytes == null || bytes.length < 2) return "GBK"; | |
if(bytes[0] == (byte)0xFF && bytes[1] == (byte)0xFE) { | |
return "UTF-16LE"; | |
} else if (bytes[0] == (byte)0xFE && bytes[1] == (byte)0xFF) { | |
return "UTF-16BE"; | |
} else if (bytes[0] == (byte)0xEF && bytes[1] == (byte)0xBB && bytes[2] == (byte)0xBF) { | |
return "UTF-8"; | |
} |
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
public class StringTemplate { | |
private List<Element> list = new ArrayList<Element>(); | |
private StringTemplate(List<Element> list) { | |
this.list = list; | |
} | |
/** | |
* @param src 例:尊敬的${who}用户,您该月话费为${amount}元,谢谢${2}!! | |
* @return 解析生成的模版,调用 <code>replace</code> 方法即可生成结果 |
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
Stevey's Google Platforms Rant | |
I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it. | |
I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't really have SREs and they make engi |
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
#!/bin/bash | |
shelldir=$(cd $(dirname $BASH_SOURCE); pwd) | |
prjhome="$shelldir/web" | |
tomcathome="/var/apache-tomcat-7.0.54-8080" | |
webinfdir="$prjhome/WebContent/WEB-INF" | |
srcdir=("$prjhome/src" "$prjhome/conf") | |
libdir=("$webinfdir/lib/*.jar" "$tomcathome/lib/*.jar") | |
dstdir="$webinfdir/classes/" |
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
\u0070\u0075\u0062\u006c\u0069\u0063\u0020\u0020\u0020\u0020 | |
\u0063\u006c\u0061\u0073\u0073\u0020\u0055\u0067\u006c\u0079 | |
\u007b\u0070\u0075\u0062\u006c\u0069\u0063\u0020\u0020\u0020 | |
\u0020\u0020\u0020\u0020\u0073\u0074\u0061\u0074\u0069\u0063 | |
\u0076\u006f\u0069\u0064\u0020\u006d\u0061\u0069\u006e\u0028 | |
\u0053\u0074\u0072\u0069\u006e\u0067\u005b\u005d\u0020\u0020 | |
\u0020\u0020\u0020\u0020\u0061\u0072\u0067\u0073\u0029\u007b | |
\u0053\u0079\u0073\u0074\u0065\u006d\u002e\u006f\u0075\u0074 | |
\u002e\u0070\u0072\u0069\u006e\u0074\u006c\u006e\u0028\u0020 | |
\u0022\u0048\u0065\u006c\u006c\u006f\u0020\u0077\u0022\u002b |
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
// | |
// _oo0oo_ | |
// o8888888o | |
// 88" . "88 | |
// (| -_- |) | |
// 0\ = /0 | |
// ___/`---'\___ | |
// .' \\| |// '. | |
// / \\||| : |||// \ | |
// / _||||| -:- |||||- \ |
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
import java.util.Enumeration; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpSession; | |
import org.apache.commons.io.FileUtils; | |
import org.nutz.lang.Mirror; | |
import org.nutz.lang.Strings; | |
import org.nutz.mvc.upload.TempFile; |
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.bj58.ecat.emc.diywebsite.message.utils; | |
import java.util.concurrent.Executors; | |
import java.util.concurrent.LinkedBlockingQueue; | |
import java.util.concurrent.Semaphore; | |
import java.util.concurrent.atomic.AtomicInteger; | |
import org.apache.log4j.Logger; | |
import com.bj58.ecat.redis.utils.StringUtils; |
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 org.apache.velocity.runtime.parser.node; | |
import org.apache.commons.lang.StringEscapeUtils; | |
import org.apache.velocity.app.event.EventHandlerUtil; | |
import org.apache.velocity.context.Context; | |
import org.apache.velocity.context.InternalContextAdapter; | |
import org.apache.velocity.exception.MethodInvocationException; | |
import org.apache.velocity.exception.TemplateInitException; | |
import org.apache.velocity.exception.VelocityException; | |
import org.apache.velocity.runtime.Renderable; |
OlderNewer