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 Map<String, String> parseQueryParameters(String uri, String encoding) { | |
URI url = toURI(uri); | |
if (url == null) return null; | |
List<NameValuePair> nvps = URLEncodedUtils.parse(url, encoding); | |
LinkedHashMap<String, String> m = new LinkedHashMap<String, String>(); | |
for (NameValuePair nvp : nvps) { | |
m.put(nvp.getName(), nvp.getValue()); | |
} | |
return m; | |
} |
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 toAscii(String str) { | |
if (str == null) return null; | |
return Normalizer.normalize(str, Normalizer.Form.NFD).replaceAll("[^\\p{ASCII}]",""); | |
} |
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
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" | |
xmlns:c="http://java.sun.com/jsp/jstl/core"> | |
<jsp:output omit-xml-declaration="yes"/> | |
<jsp:directive.attribute name="name" type="java.lang.String" required="true" rtexprvalue="true" description="Name"/> | |
<jsp:directive.attribute name="value" type="java.lang.String" required="true" rtexprvalue="true" description="Value"/> | |
<jsp:scriptlet> | |
//<![CDATA[ | |
String name = (String) jspContext.getAttribute("name"); | |
String value = (String) jspContext.getAttribute("value"); | |
out.write(" " + name + "=" + "\"" + value + "\""); |
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
<!--[if lt IE 8 ]> | |
<script src="//ajax.googleapis.com/ajax/libs/chrome-frame/1.0.3/CFInstall.min.js">/* */</script> | |
<script>window.attachEvent('onload',function(){CFInstall.check({mode:'overlay'})})</script> | |
<![endif]--> |
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.snaphop.spring; | |
import java.lang.reflect.InvocationTargetException; | |
import javax.servlet.ServletConfig; | |
import org.atmosphere.cpr.AtmosphereServlet; | |
import org.atmosphere.cpr.Broadcaster; | |
import org.atmosphere.cpr.BroadcasterFactory; | |
import org.atmosphere.handler.ReflectorServletProcessor; |
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
<repositories> | |
<repository> | |
<id>mvn-adamgent</id> | |
<url>http://mvn-adamgent.googlecode.com/svn/maven/release</url> | |
<name>Adam Gent Maven Repository</name> | |
</repository> | |
</repositories> | |
<dependencies> | |
<dependency> |
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 ServletUtils { | |
/** | |
* Checks if a Throwable is Tomcat ClientAbortException. | |
* A ClientAbortException is caused usually by a client (browser) that closes the socket to early. | |
* This method is used to determine whether to ignore these exceptions for logging purposes. | |
* http://tomcat.apache.org/tomcat-6.0-doc/api/org/apache/catalina/connector/ClientAbortException.html | |
* @param t maybe <code>null</code> | |
* @return <code>true</code> if the exception chain contains a ClientAbort Exception, false otherwise and on null. | |
*/ | |
public static boolean isClientAbortException(Throwable t) { |
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
#!/usr/bin/env python | |
import sys | |
import csv | |
from optparse import OptionParser | |
parser = OptionParser() | |
parser.add_option("-d", "--delimiter", | |
action="store", dest="delim", default='\t', | |
help="delimter") |
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
You redirect the deep elf demonologist's attack! | |
The deep elf demonologist gestures wildly while chanting. | |
The deep elf demonologist is devoured by a tear in reality. |
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
<repositories> | |
<repository> | |
<id>mvn-adamgent</id> | |
<url>http://mvn-adamgent.googlecode.com/svn/maven/release</url> | |
<name>Adam Gent Maven Repository</name> | |
</repository> | |
</repositories> | |
<dependencies> | |
<dependency> |