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
import java.util.ArrayList; | |
import java.util.UUID; | |
import java.util.WeakHashMap; | |
import org.junit.Test; | |
public class BadCache { | |
@Test | |
public void test() { |
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
import java.io.IOException; | |
import java.io.UnsupportedEncodingException; | |
import java.net.URL; | |
import java.security.GeneralSecurityException; | |
import java.security.Key; | |
import java.util.UUID; | |
import javax.crypto.Mac; | |
import javax.crypto.spec.SecretKeySpec; | |
import javax.servlet.RequestDispatcher; |
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.unit8.starborn.hotpepper; | |
import java.io.File; | |
import org.apache.catalina.core.AprLifecycleListener; | |
import org.apache.catalina.core.StandardServer; | |
import org.apache.catalina.startup.Tomcat; | |
public class EmbeddedServer { | |
public static void main(String[] args) throws Exception { |
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
import java.util.Collection; | |
import net.sourceforge.cobertura.coveragedata.ClassData; | |
import net.sourceforge.cobertura.coveragedata.ProjectData; | |
import net.sourceforge.cobertura.instrument.FirstPassMethodInstrumenter; | |
import org.apache.log4j.Logger; | |
import org.objectweb.asm.ClassAdapter; | |
import org.objectweb.asm.ClassVisitor; | |
import org.objectweb.asm.MethodVisitor; |
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
import java.io.IOException; | |
import javax.servlet.ServletException; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; | |
import org.apache.struts.action.ActionServlet; | |
@SuppressWarnings("serial") | |
public class RestfulActionServlet extends ActionServlet { |
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
Handlebars.TemplateLoader.load(["index", "list", "detail"], { | |
complete: function() { | |
var router = new Router(); | |
Backbone.history.start(); | |
} | |
}); | |
//---- | |
Handlebars.TemplateLoader.config({prefix: "/hbs/"}); |
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
(import [org.apache.poi.ss.usermodel Cell DateUtil FormulaError])) | |
(defmulti cell-value (fn [cell] | |
(let [type (.getCellType cell)] | |
(if (= type Cell/CELL_TYPE_FORMULA) | |
(.getCachedFormulaResultType cell) | |
type)))) | |
(defmethod cell-value Cell/CELL_TYPE_STRING [cell] | |
(.getStringCellValue cell)) |
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
(ns example.print-sink | |
(:import [org.apache.flume Sink Sink$Status] | |
[org.apache.flume.event EventHelper]) | |
(:gen-class :name example.PrintSink | |
:extends org.apache.flume.sink.AbstractSink | |
:exposes-methods {getChannel parentGetChannel})) | |
(defn -configure [this context]) | |
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
(require '[langohr.queue :as lq] | |
'[langohr.core :as rmq] | |
'[langohr.channel :as lch] | |
'[langohr.basic :as lb] | |
'[langohr.consumers :as lc] | |
'[clojure.data.fressian :as fress]) | |
;; Publish clojure values | |
(let [conn (rmq/connect {:uri "amqp://localhost"}) | |
ch (lch/open conn)] |
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
(import [com.sun.management HotSpotDiagnosticMXBean] | |
[java.lang.management ManagementFactory] | |
[java.io DataInputStream EOFException] | |
[java.nio ByteBuffer]) | |
(require '[clojure.java.io :as io]) | |
(declare ^:dynamic read-id) | |
(declare ^:dynamic idsize) | |
(def names (atom {})) |
OlderNewer