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
@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 };
package main
import (
"fmt"
"os"
"runtime"
"strconv"
)
type node struct {
#ifdef _WIN32
# include <ws2tcpip.h>
# include <io.h>
#else
# include <sys/fcntl.h>
# include <sys/types.h>
# include <sys/socket.h>
# include <netinet/in.h>
# include <netdb.h>
# define closesocket(fd) close(fd)
package main
import (
"fmt"
"strconv"
"github.com/mitchellh/go-z3"
)
func main() {
package main
import (
"flag"
"fmt"
"image/png"
"io/ioutil"
"log"
"math"
"os"
@mattn
mattn / conda.cmd
Created March 15, 2019 02:59
Windows だと conda activate tensorflow が動かないのでそれっぽく動く様にする為のバッチファイル
@echo off
if "%1" equ "activate" (
call %LOCALAPPDATA%\Continuum\miniconda3\Scripts\%1.bat %2 %3 %4 %5 %6 %7 %8 %9
) else (
call %LOCALAPPDATA%\Continuum\miniconda3\Scripts\conda.exe %*
)
@mattn
mattn / Makefile
Last active April 7, 2019 16:19
Using libfacedetection with video capture
SRCS = \
libfacedetectcnn-example.cpp \
../src/facedetectcnn.cpp \
../src/facedetectcnn-floatdata.cpp \
../src/facedetectcnn-int8data.cpp \
../src/facedetectcnn-model.cpp
OBJS = $(subst .cc,.o,$(subst .cxx,.o,$(subst .cpp,.o,$(SRCS))))
@mattn
mattn / extend-blob.diff
Created February 28, 2019 03:48
extend for blob
diff --git a/src/evalfunc.c b/src/evalfunc.c
index 0ad8d84cf..e3093649d 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -3607,6 +3607,51 @@ f_extend(typval_T *argvars, typval_T *rettv)
copy_tv(&argvars[0], rettv);
}
}
+ else if (argvars[0].v_type == VAR_LIST && argvars[1].v_type == VAR_BLOB)
+ {
package main
import (
"flag"
"os"
"time"
)
func main() {
var n int
package main
import (
"flag"
"os"
"time"
)
func main() {
var n int