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.fasterxml.jackson.databind.ObjectMapper; | |
| import io.netty.buffer.ByteBuf; | |
| import io.netty.buffer.ByteBufInputStream; | |
| import io.netty.buffer.ByteBufOutputStream; | |
| import io.netty.channel.ChannelHandlerContext; | |
| import io.netty.handler.codec.ByteToMessageCodec; | |
| import java.util.List; | |
| public class BasicJacksonCodec<T> extends ByteToMessageCodec<T> { |
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
| // Sample usage: | |
| // ./socp -p 10000 -i ~/Downloads/ubuntu-14.04-desktop-amd64.iso -o ~/Desktop/ubuntu.iso | |
| package main | |
| import ( | |
| "bufio" | |
| "flag" | |
| "fmt" | |
| "io" | |
| "net" |
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 main | |
| import "fmt" | |
| func main() { | |
| c := make(chan string) | |
| go func() { | |
| n := <-c | |
| c <- "Hello " + n | |
| }() |
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
| // Test Code | |
| int[] pArray = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; | |
| measurePrint("int Array", pArray); | |
| Integer[] oArray = new Integer[10]; | |
| for (int i = 0; i < 10; i++) | |
| { | |
| oArray[i] = new Integer(i + 1); | |
| } |
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 boxingtest; | |
| import java.util.Scanner; | |
| public class BoxingTest | |
| { | |
| public static void main(String[] args) | |
| { | |
| Integer[] ints = new Integer[100000]; | |
| for (int i = 0; i < ints.length; i++) |
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 functionaljavademo; | |
| import com.google.common.base.Function; | |
| import static com.google.common.collect.DiscreteDomains.integers; | |
| import static com.google.common.collect.Iterables.transform; | |
| import static com.google.common.collect.Ranges.closed; | |
| public class FunctionalJavaDemo | |
| { | |
| public static final Function<Integer, Integer> squareOf = new Function<Integer, Integer>() |