Skip to content

Instantly share code, notes, and snippets.

package pl.codewise.amazon.client;
import io.netty.bootstrap.Bootstrap;
import io.netty.bootstrap.ServerBootstrap;
import io.netty.channel.Channel;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.pool.AbstractChannelPoolHandler;
@tkowalcz
tkowalcz / DateFormattingBug.java
Created June 10, 2015 11:05
Java 1.8u60 will brake time zone formatting?
import org.joda.time.DateTimeZone;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
import org.joda.time.tz.FixedDateTimeZone;
import java.util.Date;
import java.util.Locale;
public class DateFormattingBug {
@tkowalcz
tkowalcz / DateFormattingBug.java
Created June 10, 2015 11:05
Java 1.8u60 will brake time zone formatting?
package pl.codewise.voluum.api;
import org.joda.time.DateTimeZone;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
import org.joda.time.tz.FixedDateTimeZone;
import java.util.Date;
import java.util.Locale;
@tkowalcz
tkowalcz / results.clean-checkout
Created May 28, 2015 09:56
Results from running JMH tests on Amazon EC2 instance (c4.xlarge)
openjdk version "1.9.0-internal"
OpenJDK Runtime Environment (build 1.9.0-internal-root_2015_05_28_09_08-b00)
OpenJDK 64-Bit Server VM (build 1.9.0-internal-root_2015_05_28_09_08-b00, mixed mode)
# Run complete. Total time: 00:06:05
Benchmark (searchString) Mode Cnt Score Error Units
StringContainsMicrobenchmark.longStringContainsCharSequence cannabis avgt 10 1230.703 ? 2.519 ns/op
StringContainsMicrobenchmark.longStringContainsCharSequence xyz avgt 10 1172.886 ? 0.900 ns/op
StringContainsMicrobenchmark.longStringContainsCharSequence Cheesecake powder caramels cupcake tiramisu jelly avgt 10 1226.292 ? 2.004 ns/op
@tkowalcz
tkowalcz / ReactivePull.java
Created April 18, 2015 19:15
Reactive pull backpressure example
package pl.tkowalcz.examples.streaming;
import com.google.common.util.concurrent.Uninterruptibles;
import com.lmax.disruptor.dsl.Disruptor;
import rx.Observable;
import rx.Subscriber;
import rx.Subscription;
import rx.schedulers.Schedulers;
import java.io.IOException;
@tkowalcz
tkowalcz / JDK.sh
Created November 30, 2011 09:57
JDK
#!/bin/bash
unset JAVA_HOME
export C_INCLUDE_PATH=/opt/atse/jdk/alsa/driver/include:/opt/atse/jdk/alsa/lib/include
export LIBRARY_PATH=/opt/atse/jdk/alsa/lib/lib:/usr/lib/:/opt/atseintl/3rdParty/jdk1.6.0_21/jre/lib/amd64/server
export LD_LIBRARY_PATH=/opt/atse/jdk/alsa/lib/lib:/usr/lib/:/opt/atseintl/3rdParty/jdk1.6.0_21/jre/lib/amd64/server
export ANT_HOME=/opt/atseintl/3rdParty/apache-ant-1.7.0
export ANT_OPTS=-Dallow.downloads=true