Preconditions:
- POSIX or Windows system
- Install Docker
- A GitHub repo that already builds on Travis
Postcondition:
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 io.github.ncruces.utils; | |
import java.io.OutputStream; | |
import java.nio.ByteBuffer; | |
public final class ByteBufferOutputStream extends OutputStream { | |
private static final int MAX_ARRAY_SIZE = Integer.MAX_VALUE - 8; | |
private ByteBuffer buf; | |
public ByteBufferOutputStream() { buf = ByteBuffer.allocate(32); } |
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.io.File; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.nio.channels.FileLock; | |
// The class demonstrates how to get an exclusive file lock that prevents other threads and processes / JVMs from | |
// obtaining a lock on the same file. To do this, you need to synchronize a block on a file and acquire FileLock. See | |
// comments below for more details. Run this class in multiple JVMs and see each thread of each JVM acquires a lock in | |
// an orderly fasion. | |
public class FileLocking extends Thread |
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 example; | |
import io.netty.channel.ChannelHandler; | |
import io.netty.channel.ChannelInitializer; | |
import io.netty.channel.socket.SocketChannel; | |
import io.netty.handler.codec.LengthFieldBasedFrameDecoder; | |
import io.netty.handler.codec.LengthFieldPrepender; | |
import io.netty.handler.codec.string.StringDecoder; | |
import io.netty.handler.codec.string.StringEncoder; | |
import io.netty.util.CharsetUtil; |
As configured in my dotfiles.
start new:
tmux
start new with session name:
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
#include <rdma/fabric.h> | |
#include <rdma/fabric.h> | |
#include <rdma/fi_endpoint.h> | |
#include <rdma/fi_cm.h> | |
#include <rdma/fi_errno.h> | |
#include <rdma/fi_rma.h> | |
#include <pthread.h> | |
#include <stdio.h> | |
#include <stdlib.h> |