Skip to content

Instantly share code, notes, and snippets.

View mattn's full-sized avatar
🍛
I love curry 🍛

mattn mattn

🍛
I love curry 🍛
View GitHub Profile
package main
import (
"log"
"net"
)
func main() {
addr, err := net.ResolveUnixAddr("unix", "./foo.sock")
if err != nil {
TENSORFLOW_DIR = c:/dev/tensorflow
CFLAGS = \
-shared \
-Ic:/msys64/mingw64/include/python3.8 \
-I${TENSORFLOW_DIR}/tensorflow/lite/tools/make/downloads/flatbuffers/include \
-I${TENSORFLOW_DIR}/tensorflow/lite/tools/make/downloads/absl
INSTALL_DIR = c:/msys64/mingw64/lib/python3.8/site-packages/tflite_runtime
OS_ARCH=windows_x86_64
function! s:fuzzy(lhs, rhs) abort
return a:lhs =~ join(map(split(a:rhs, '\zs'), "printf('[\\x%02x].*', char2nr(v:val))"), '')
endfunction
let g:asyncomplete_preprocessor =
\ [function('asyncomplete#preprocessor#ezfilter#filter')]
let g:asyncomplete#preprocessor#ezfilter#config = {}
let g:asyncomplete#preprocessor#ezfilter#config['*'] =
\ {ctx, items -> filter(items, 's:fuzzy(v:val.word, ctx.base) != 0')}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
name old req/s new req/s delta
Exec 329k ± 0% 324k ± 0% ~ (p=1.000 n=1+1)
Query 120k ± 0% 122k ± 0% ~ (p=1.000 n=1+1)
Params 109k ± 0% 109k ± 0% ~ (p=1.000 n=1+1)
Stmt 171k ± 0% 165k ± 0% ~ (p=1.000 n=1+1)
Rows 0.00 0.00 ~ (all equal)
StmtRows 3.09k ± 0% 2.99k ± 0% ~ (p=1.000 n=1+1)
name old time/op new time/op delta
CustomFunctions-4 8.60µs ± 0% 8.00µs ± 0% ~ (p=1.000 n=1+1)
#include <windows.h>
#include <stdio.h>
int
main(int argc, char* argv[]) {
HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE);
CHAR_INFO ci[6] = {};
COORD buffer_size = { 6, 1 };
COORD start_coord = { 0, 0 };
SMALL_RECT sr = { 0, 0, 80, 25 };
@mattn
mattn / wc.c
Created August 17, 2019 12:45
WriteConsoleOutputW is broken on Windows 10
#include <windows.h>
#include <stdio.h>
int
main(int argc, char* argv[]) {
HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE);
CHAR_INFO ci[3] = {};
COORD buffer_size = { 3, 1 };
COORD start_coord = { 0, 0 };
SMALL_RECT sr = { 0, 0, 80, 25 };