Skip to content

Instantly share code, notes, and snippets.

View GRGSIBERIA's full-sized avatar

Eiichi Takebuchi GRGSIBERIA

View GitHub Profile
@GRGSIBERIA
GRGSIBERIA / サーバント一覧.pro
Last active October 11, 2022 14:03
サーバントの関係性をPrologで表現する
クラス(アーチャー).
クラス(セイバー).
クラス(ランサー).
クラス(キャスター).
クラス(ライダー).
クラス(アサシン).
クラス(バーサーカー).
クラス(シールダー).
クラス(ルーラー).
クラス(ムーンキャンサー).
@GRGSIBERIA
GRGSIBERIA / trumpet.pl
Last active September 12, 2021 08:46
trumpet-prolog
note("C", 0).
note("Db", 1).
note("D", 2).
note("Eb", 3).
note("E", 4).
note("F", 5).
note("Gb", 6).
note("G", 7).
note("Ab", 8).
note("A", 9).
@GRGSIBERIA
GRGSIBERIA / simulation.py
Last active October 11, 2018 16:32
The field strength of magnetic monopole for Bz.
#-*- encoding: utf-8
"""
Author: Eiichi Takebuchi(GRGSIBERIA)
"""
import numpy as np
from scipy import integrate
class FieldStrengthOfMagneticMonopole:
"""
単極磁石の電界の強さを求める
@GRGSIBERIA
GRGSIBERIA / wavexport.hpp
Created May 9, 2017 13:18
intの配列からモノラルのwavを作る
#pragma once
#include <vector>
#include <iostream>
#include <fstream>
namespace wav
{
struct Header
{
char riff[4] = { 'R', 'I', 'F', 'F' };
@GRGSIBERIA
GRGSIBERIA / port-audio-test1.cpp
Created December 12, 2016 05:44
PortAudioの一部を抜粋
struct PaTestData {
int frameIndex;
int maxFrameIndex;
SAMPLE *recordedSamples;
};
int main() {
PaTestData data;
PaStreamParameters inputParameters, outputParameters;
PaStream *stream;
std::vector<Texture> pageTextures;
void benchmark() {
Stopwatch stopwatch;
Profiler::EnableWarning(false);
stopwatch.start();
for (int i = 0; i < 100; i++) {
const String filename = Format(L"パス/pages_", i + 1, L".png");
pageTextures.emplace_back(filename);
#pragma once
#include <Siv3D.hpp>
#include <TinyASIO.hpp>
namespace inst
{
class RecController : public asio::ControllerBase
{
static asio::InputBuffer *inbuf;
static asio::OutputBuffer *outbufR, *outbufL;
#include "TinyASIO.hpp"
using namespace asio;
// ControllerBaseを継承することで,オリジナルのコントローラを作れます
class OriginalController : public ControllerBase
{
// コールバック関数から呼び出せるようにstaticで宣言する
static InputBuffer* input;
static OutputBuffer* output;
@GRGSIBERIA
GRGSIBERIA / mimetype.py
Created September 1, 2015 10:22
for python 2.7.6
"""Guess the MIME type of a file.
This module defines two useful functions:
guess_type(url, strict=1) -- guess the MIME type and encoding of a URL.
guess_extension(type, strict=1) -- guess the extension for a given MIME type.
It also contains the following, for tuning the behavior:
@GRGSIBERIA
GRGSIBERIA / test.txt
Created August 14, 2015 07:06
自動生成したマップ
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0011110011111111111111110011100111111001110011110011111111110010011111111111111111111111111111111111
0011110011111111111111110011100111111001110011110011111111110010011111111111111111111111111111111111
0011110011111111111111110011100111111001110011110011111111110010011111111111111111111111111111111111
0011110011111111111111110011100111111001110011110011111111110010011111111111111111111111111111111111
0011110000000000000000000011100111111001110011110011111111110010011111111111111111111111111111111111
0011110000000000000000000011100111111001110011110011111111110010011111111111111111111111111111111111
0011110011111111111000010011100111111001110011110011111111110010000000000000000000000000000000000000
0011110011111111111000010011100111111001110011110000000000000010000000000000000000000000000000000000