Skip to content

Instantly share code, notes, and snippets.

$ hexdump ./test.db
0000000 5153 694c 6574 6620 726f 616d 2074 0033
0000010 0010 0101 4000 2020 0000 0200 0000 0200
0000020 0000 0000 0000 0000 0000 0100 0000 0400
0000030 0000 0000 0000 0000 0000 0100 0000 0000
0000040 0000 0000 0000 0000 0000 0000 0000 0000
0000050 0000 0000 0000 0000 0000 0000 0000 0200
0000060 2e00 1d5f 000d 0000 0f01 00cb cb0f 0000
0000070 0000 0000 0000 0000 0000 0000 0000 0000
*
#![feature(test)]
const CHAR_DIGIT: u8 = 0x03;
#[rustfmt::skip]
static CHAR_LOOKUP_TABLE: [u8; 256] = [
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, b' ', b' ', 0xFF, b' ', b' ', 0xFF, 0xFF, 0xFF, // 0x00 - 0x0F
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, // 0x10 - 0x1F
b' ', b'!', 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, b'(', b')', b'*', 0xFF, b',', 0xFF, b'.', 0xFF, // 0x20 - 0x2F
0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0xFF, b';', b'<', b'=', b'>', 0xFF, // 0x30 - 0x3F
package main
import (
"context"
"fmt"
"log"
"net/http"
"os"
"os/signal"
"sync"
property
w int
r int
mu sync.Mutex
rwmu sync.RWMutex
rlock
mu.lock
r++
@kawasin73
kawasin73 / tanuki_gzip.go
Last active February 2, 2020 11:01
SECCON 2019 tanuki
package main
import (
"compress/gzip"
"crypto/sha1"
"encoding/base64"
"hash"
"hash/crc32"
"io"
"log"
@kawasin73
kawasin73 / converter-bench.py
Last active September 21, 2019 10:55
video metadata parse benchmark of cv2, VideoConverter, Imageio
"""
$ pipenv install git+https://github.com/senko/python-video-converter.git#egg=VideoConverter
"""
import converter
def get_meta(path):
c = converter.Converter()
return c.probe(path)
"""
This file is based on https://github.com/foresmac/django-binaryuuidfield/tree/initial-setup
"""
import uuid
from django import forms
from django.core import exceptions
from django.db import models
from django.utils.translation import ugettext_lazy as _
@kawasin73
kawasin73 / ipsock.go
Created August 9, 2019 05:47
ipsock を試した
package main
import (
"log"
"net"
"sync"
"time"
)
func main() {
@kawasin73
kawasin73 / file_lock_with_timeout.go
Last active May 21, 2022 11:38
FileLock with timeout using Fcntl in Golang
package main
import (
"errors"
"io"
"log"
"os"
"os/signal"
"syscall"
"time"
@kawasin73
kawasin73 / sample.ino
Created March 17, 2018 08:41
sample.ino がArduinoのコード、sample.rbがRubyのコード
#include <Servo.h>
Servo myservo; //initiareze a servo for the connected servo: servoに名付ける
/*HS-5070MH Servo
Voltage=const:6.0-7.4V
Torque:3.1-3.8kg・cm*/
int Angle = 0; //the set point of the angle to zero: Servoへのcommand値
int myangle[3]={10,20,30}; //variable to control