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
# convert ulysses markdown to bbcode | |
class Main | |
$code_buffer = [] | |
$is_code_sec = false | |
def flush_code_buffer | |
$code_buffer.each do |line| | |
puts line | |
end | |
puts '[/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
# convert markdown to bbcode | |
class Main | |
$code_buffer = [] | |
$quote_buffer = [] | |
$is_code_sec = false | |
$is_quote_sec = false | |
def flush_buffer(buf, flag, close_tag) | |
eval "$#{buf}.each { |line| puts line }" | |
puts close_tag |
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.Scanner; | |
import java.util.Stack; | |
/** | |
* @author <a href="mailto:l.weinan@gmail.com">Weinan Li</a> | |
*/ | |
public class Rpn { | |
static int TOK_NUM = -2; | |
static int TOK_OP = -3; |
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
diff --git a/jaxrs/security/resteasy-crypto/pom.xml b/jaxrs/security/resteasy-crypto/pom.xml | |
index 2f36cc4..a78637e 100755 | |
--- a/jaxrs/security/resteasy-crypto/pom.xml | |
+++ b/jaxrs/security/resteasy-crypto/pom.xml | |
@@ -52,15 +52,16 @@ |
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 bc; | |
import org.bouncycastle.jce.provider.BouncyCastleProvider; | |
import java.security.Provider; | |
import java.security.Security; | |
import java.util.Iterator; | |
/** | |
* @author <a href="mailto:l.weinan@gmail.com">Weinan Li</a> |
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
power:resteasy-jsapi-testing weinanli$ mvn -q jetty:run | |
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0 | |
Aug 18, 2015 12:43:48 AM org.jboss.resteasy.plugins.server.servlet.ConfigurationBootstrap | |
WARNING: The use of javax.ws.rs.core.Application is deprecated, please use javax.ws.rs.Application as a context-param instead | |
Aug 18, 2015 12:43:48 AM org.jboss.resteasy.spi.ResteasyDeployment | |
INFO: Deploying javax.ws.rs.core.Application: class org.jboss.resteasy.jsapi.testing.TestApplication | |
Aug 18, 2015 12:43:48 AM org.jboss.resteasy.spi.ResteasyDeployment | |
INFO: Adding singleton resource org.jboss.resteasy.jsapi.testing.AddImpl from Application class org.jboss.resteasy.jsapi.testing.TestApplication | |
Aug 18, 2015 12:43:48 AM org.jboss.resteasy.spi.ResteasyDeployment | |
INFO: Adding singleton resource org.jboss.resteasy.jsapi.testing.MinusImpl from Application class org.jboss.resteasy.jsapi.testing.TestApplication |
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
for (Method method : clazz.getDeclaredMethods()) { | |
if (method != null) { | |
try { | |
clazz.getMethod(method.getName(), method.getParameterTypes()); | |
} catch (NoSuchMethodException e) { | |
logger.warn("non-public method: " + method.getDeclaringClass().getName() + "." + method.getName() + "()"); | |
} | |
} | |
} |
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
git diff | |
diff --git a/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/core/ResourceMethodRegistry.java b/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/core/ResourceMethodRegistry.java | |
index 2106862..6ab27a8 100644 | |
--- a/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/core/ResourceMethodRegistry.java | |
+++ b/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/core/ResourceMethodRegistry.java | |
@@ -5,16 +5,14 @@ import org.jboss.resteasy.plugins.server.resourcefactory.JndiResourceFactory; | |
import org.jboss.resteasy.plugins.server.resourcefactory.POJOResourceFactory; | |
import org.jboss.resteasy.plugins.server.resourcefactory.SingletonResource; | |
import org.jboss.resteasy.specimpl.UriBuilderImpl; | |
-import org.jboss.resteasy.spi.HttpRequest; |
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
diff --git a/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/core/ResourceMethodRegistry.java b/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/core/ResourceMethodRegistry.java | |
index 2106862..bf32ea0 100644 | |
--- a/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/core/ResourceMethodRegistry.java | |
+++ b/jaxrs/resteasy-jaxrs/src/main/java/org/jboss/resteasy/core/ResourceMethodRegistry.java | |
@@ -1,20 +1,19 @@ | |
package org.jboss.resteasy.core; | |
import org.jboss.resteasy.core.registry.RootSegment; | |
+import org.jboss.resteasy.logging.Logger; | |
import org.jboss.resteasy.plugins.server.resourcefactory.JndiResourceFactory; |
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
/* 方法 1: 使用 .class */ | |
Class c = String[].class; | |
/* 方法 2: 使用实例的getClass()方法 */ | |
c = new String[1].getClass(); | |
/* 方法 3: 使用 Class.forName */ | |
c = Class.forName("[Ljava.lang.String;"); |