Skip to content

Instantly share code, notes, and snippets.

bisco(or nbisco) bisco

Block or report user

Report or block bisco

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
@bisco
bisco / knn_test.py
Created Jan 14, 2019
simple outlier detection using kNN
View knn_test.py
#!/usr/bin/env python3
from sklearn.neighbors import NearestNeighbors
import numpy as np
import sys
th_pi = 20
th_ep = 5.0
def main():
@bisco
bisco / 2.json
Created Dec 8, 2018
zaimtool説明用json(2)
View 2.json
{
"CONSUMER_KEY" : "ここにConsumer Keyを入れる",
"CONSUMER_SECRET" : "ここにConsumer Secretを入れる",
"ACCESS_TOKEN" : "さっきのoauth_token",
"ACCESS_TOKEN_SECRET" : "さっきのoauth_verifier"
}
@bisco
bisco / 1.json
Created Dec 8, 2018
zaimtoolの説明用json(1)
View 1.json
{
"CONSUMER_KEY" : "ここにConsumer Keyを入れる",
"CONSUMER_SECRET" : "ここにConsumer Secretを入れる",
"ACCESS_TOKEN" : "まだ空欄でよい",
"ACCESS_TOKEN_SECRET" : "まだ空欄でよい"
}
@bisco
bisco / formatter.py
Last active Aug 24, 2018
perf formatter
View formatter.py
#!/usr/bin/env python [31/1804]
#fileencoding: utf-8
from __future__ import print_function
import sys
MASK_32BIT = 0xFFFFFFFF
class BranchEntry:
def __init__(self, line):
@bisco
bisco / gspread.py
Created Dec 20, 2017
Google Spreadsheet APIの薄いwrapper
View gspread.py
import httplib2
import os
from apiclient import discovery
from oauth2client import client
from oauth2client import tools
from oauth2client.file import Storage
SCOPES = 'https://www.googleapis.com/auth/spreadsheets'
CLIENT_SECRET_FILE = ''
@bisco
bisco / termbox-color.go
Created Dec 14, 2017
termbox-goの色見本を見るツール
View termbox-color.go
package main
import (
"fmt"
"github.com/nsf/termbox-go"
"time"
)
func drawLine(x, y int, str string) {
color := termbox.ColorDefault
@bisco
bisco / usb.stp
Last active May 21, 2017
systemtap test
View usb.stp
#!/usr/bin/stap -gv
probe begin {
printf("force stop warning short TX\n")
}
probe end {
printf("stop probe\n")
}
@bisco
bisco / Makefile
Last active May 17, 2017
C用Makefileのテンプレート
View Makefile
SRCDIR = $(realpath .)
INCDIR = $(SRCDIR)
OBJDIR = $(SRCDIR)
IGNORE = $(SRCDIR)/ignore_file.c
SRCS = $(filter-out $(IGNORE),$(wildcard $(SRCDIR)/*.c))
OBJS = $(subst $(SRCDIR),$(OBJDIR),$(SRCS:.c=.o))
EXE = a.out
CC = gcc
MAKE = make
@bisco
bisco / perf-script-sample.py
Created Dec 11, 2016
perf scriptでオレオレスクリプトを走らせるサンプル
View perf-script-sample.py
# perf script event handlers, generated by perf script -g python
# Licensed under the terms of the GNU GPL License version 2
# The common_* event handler fields are the most useful fields common to
# all events. They don't necessarily correspond to the 'common_*' fields
# in the format files. Those fields not available as handler params can
# be retrieved using Python functions of the form common_*(context).
# See the perf-trace-python Documentation for the list of available functions.
import os
@bisco
bisco / signal_test.c
Created Jul 7, 2016
シグナルハンドラのテスト
View signal_test.c
#include <stdio.h>
#include <signal.h>
#include <sched.h>
int go_printf = 0;
void handler(int signum, siginfo_t* si_val, void* ctx) {
go_printf = 1;
}
You can’t perform that action at this time.