Skip to content

Instantly share code, notes, and snippets.

🍛
I love curry 🍛

mattn mattn

🍛
I love curry 🍛
Block or report user

Report or block mattn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View wc.c
#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 Aug 17, 2019
WriteConsoleOutputW is broken on Windows 10
View wc.c
#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 };
View main.go
package main
import (
"fmt"
"os"
"runtime"
"strconv"
)
type node struct {
View client.c
#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)
View main.go
package main
import (
"fmt"
"strconv"
"github.com/mitchellh/go-z3"
)
func main() {
View main.go
package main
import (
"flag"
"fmt"
"image/png"
"io/ioutil"
"log"
"math"
"os"
@mattn
mattn / conda.cmd
Created Mar 15, 2019
Windows だと conda activate tensorflow が動かないのでそれっぽく動く様にする為のバッチファイル
View conda.cmd
@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 Apr 7, 2019
Using libfacedetection with video capture
View Makefile
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))))
View extend-blob.diff
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)
+ {
View slow.go
package main
import (
"flag"
"os"
"time"
)
func main() {
var n int
You can’t perform that action at this time.