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 akka.actor.ActorSystem | |
import akka.stream.ActorMaterializer | |
import akka.stream.scaladsl._ | |
object Main { | |
implicit val system = ActorSystem() | |
implicit val materializer = ActorMaterializer() | |
def tid(): String = f"${Thread.currentThread().getId()}%02d" | |
def main(args: Array[String]) { |
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
function exekill() { | |
if [ "$1" = "" ]; then | |
echo "exekill: specify exe name (without .exe)" | |
return | |
fi | |
local exe=$1.exe | |
taskkill /f /im $exe | |
} |
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
#!/bin/sh | |
repo_name=$1 | |
if [ $repo_name = "" ]; then | |
echo "Specify repo name." | |
exit -1 | |
fi | |
dir_name=${repo_name}.git | |
mkdir $dir_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 "stdafx.h" | |
#include "DxOpenNIMouse.h" | |
bool DxOpenNIMouse::Init(HWND hWnd, bool EngFlag, LPDIRECT3DDEVICE9 lpDevice, WCHAR *f_path) { | |
int i; | |
for (i = 0; i < 15; i++) { | |
BP_Vector[i].x = 0; | |
BP_Vector[i].y = DxOpenNIBase::LostVertexY; | |
BP_Vector[i].z = 0; | |
} |
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
<match influx.**> | |
type forest | |
remove_prefix influx | |
subtype influxdb | |
<case **> | |
host 192.168.1.11 | |
port 8086 | |
dbname test | |
</case> | |
</match> |
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
function mvln() { | |
function __mvln() { | |
local opts=$1 | |
local src=$2 | |
local dst=$3 | |
if [ -d $dst ]; then | |
# When dst is dir, dst_file must be dir/filename | |
local file=${src##*/} | |
mv $opts -- $src $dst && ln -s -- ${dst}/${file} $src | |
else |
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
#!/bin/sh | |
EXT=csv | |
FILES=`find *.$EXT -name "*_.$EXT" -prune -o -print` | |
SUFFIX=_ | |
OPTS= | |
for FILE in $FILES; do | |
NAME=${FILE%.*} | |
echo processing $NAME | |
nkf $OPTS < $FILE > $NAME${SUFFIX}.$EXT |
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 <stdio.h> | |
#include <string.h> | |
#include <memory> | |
#include <boost/asio.hpp> | |
static const int PORT = 23455; | |
static const int BUF_SIZE = 1024 * 4; | |
static const int UNIT_SIZE = 8; | |
using namespace boost::asio; |
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 <uv.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <algorithm> | |
static const int PORT = 12344; | |
void alloc_cb(uv_handle_t* handle, size_t suggested_size, uv_buf_t* buf) { | |
*buf = uv_buf_init((char*)malloc(suggested_size), suggested_size); | |
} |
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
/* | |
This exmple program provides a trivial server program that listens for TCP | |
connections on port 9995. When they arrive, it writes a short message to | |
each client connection, and closes each connection once it is flushed. | |
Where possible, it exits cleanly in response to a SIGINT (ctrl-c). | |
*/ | |
#include <string.h> | |
#include <errno.h> |