Skip to content

Instantly share code, notes, and snippets.

View kevinherron's full-sized avatar

Kevin Herron kevinherron

View GitHub Profile
package com.kevinherron.campfire.playground;
import java.util.concurrent.Future;
import com.ning.http.client.AsyncCompletionHandler;
import com.ning.http.client.AsyncHttpClient;
import com.ning.http.client.Realm;
import com.ning.http.client.Request;
import com.ning.http.client.Response;
package com.kevinherron.campfire.streaming;
import java.util.concurrent.Future;
import org.json.JSONTokener;
import com.kevinherron.campfire.api.CampfireException;
import com.kevinherron.campfire.api.LoginCredentials;
import com.ning.http.client.AsyncHandler;
import com.ning.http.client.AsyncHttpClient;
package com.kevinherron.campfire.playground;
import com.ning.http.client.AsyncHandler;
import com.ning.http.client.AsyncHttpClient;
import com.ning.http.client.AsyncHttpClientConfig;
import com.ning.http.client.HttpResponseBodyPart;
import com.ning.http.client.HttpResponseHeaders;
import com.ning.http.client.HttpResponseStatus;
import com.ning.http.client.Realm;
import com.ning.http.client.Request;
def a():
print "a"
def b():
a()
b()
Traceback (most recent call last):
File "<script playground>", line 5, in b
public class WriteRequest extends AbstractWriteRequest<Integer> {
private static final int timeout = 1000;
private NodeMapDriver driver;
protected volatile int sequenceNumber;
public WriteRequest(NodeMapDriver driver, List<? extends WriteItem> items) {
super(items, timeout);
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x65344450, pid=2568, tid=5692
#
# JRE version: 6.0_26-b03
# Java VM: Java HotSpot(TM) Client VM (20.1-b02 mixed mode, sharing windows-x86 )
# Problematic frame:
# C 0x65344450
#
public class RandomFunction extends AbstractFunction {
private static final Random RANDOM = new Random();
@Override
public QualifiedValue execute(Expression[] args) throws ExpressionException {
QualifiedValue qv = args[0].execute();
int bound = TypeUtilities.toInteger(qv.getValue());
synchronized (RANDOM) {
@kevinherron
kevinherron / CompositeByteBufTest.java
Created May 20, 2016 16:46
CompositeByteBufTest.java
import java.nio.ByteOrder;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.PooledByteBufAllocator;
import io.netty.util.ReferenceCountUtil;
import org.testng.annotations.Test;
import static org.testng.Assert.assertEquals;
public class CompositeByteBufTest {
/*
* Copyright (c) 2016 Kevin Herron
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v1.0 which accompany this distribution.
*
* The Eclipse Public License is available at
* http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
@kevinherron
kevinherron / LoggerExtensions.kt
Last active May 22, 2017 13:12
Kotlin extensions to SLF4J Logger with MDC support
import org.slf4j.Logger
import org.slf4j.MDC
import org.slf4j.Marker
import org.slf4j.helpers.MessageFormatter
typealias LazyPair = () -> Pair<String, String>
// <editor-fold desc="Logger.trace Extensions">
inline fun Logger.trace(msg: () -> Any?) {
this.trace(msg.invoke().toString())