Skip to content

Instantly share code, notes, and snippets.

@xiupos
xiupos / 0gentoo.md
Last active March 28, 2024 12:15
Gentoo Linux インストールメモ

Keybase proof

I hereby claim:

  • I am ha2zakura on github.
  • I am ha2zakura (https://keybase.io/ha2zakura) on keybase.
  • I have a public key ASBXf14_VgJlobfkmwHznpVO3hqwpDWbRjPrySpIy9ti4Qo

To claim this, I am signing this object:

@xiupos
xiupos / example.nim
Created April 29, 2020 06:54
Feedforward neural network on Nim
import math, random, sugar
type
Matrix[T; M, N: static[int]] = array[1..M, array[1..N, T]]
# 加法
proc `+`[T, I, J](a: Matrix[T, I, J], b: T): Matrix[T, I, J] =
var c: Matrix[T, I, J]
for i in 1..I:
for j in 1..J:
@xiupos
xiupos / code.ts
Created July 15, 2019 07:32
ユニット会計用
const ADMIN_USER_ID = {製作者のLINE ID};
const CHROSTE_GROUP_ID = {ユニットのLINEグループID};
const CHANNEL_ACCESS_TOKEN = {LINE Messaging APIのアクセストークン};
// 毎週日曜日のトリガー
function weekly() {
post_differs(CHROSTE_GROUP_ID);
}
// 毎夜のトリガー
@xiupos
xiupos / main.c
Created February 9, 2019 10:28
EEPROM読み出し機 by PIC18F14K50
// I2Cのテスト(AQM0802A)
// ha2zakura
#include <xc.h> // PIC のハードウエア定義
#define _XTAL_FREQ 48000000
#define true 1
#define false 0
#define int8_t signed char
@xiupos
xiupos / mtys.ino
Created December 30, 2018 23:07
MIDI to YMZ294(SPI)
#include <SPI.h>
#include <MIDI.h> // http://playground.arduino.cc/Main/MIDILibrary
#define SS 10
#define A0 9
int tone1Interval = 0;
int tone2Interval = 0;
int tone3Interval = 0;
@xiupos
xiupos / main.asm
Created November 4, 2018 00:08
YMZ294のSPI化
LIST P=12f683
#INCLUDE <p12f683.inc>
__CONFIG _CP_OFF & _CPD_OFF & _WDT_OFF & _BOD_ON & _IESO_OFF& _PWRTE_ON & _INTOSCIO & _MCLRE_OFF
w_temp EQU 0x20 ; Wレジスタ保存用
status_temp EQU 0x21 ; STATUSレジスタ保存用
stand EQU 0x22 ; 立ち上がりフラグ
;**********************************************************************
@xiupos
xiupos / main0.c
Last active April 29, 2018 23:25
PIC18F14K50 Blink(2)
// Timer0(16bit!)のテスト
// ha2zakura
#include <xc.h> // PIC のハードウエア定義
#define _XTAL_FREQ 48000000
#define true 1
#define false 0
#define int8_t signed char
@xiupos
xiupos / main.c
Last active April 8, 2018 11:02
PIC18F14K50 Blink(1)
// とりあえずLチカ
// ha2zakura
#include <xc.h> // PIC のハードウエア定義
#define _XTAL_FREQ 48000000
#pragma config FOSC = HS, PLLEN = ON, FCMEN = OFF
#pragma config IESO = OFF, USBDIV = OFF, CPUDIV = NOCLKDIV
#pragma config PWRTEN = OFF, BOREN = OFF, WDTEN = OFF
@xiupos
xiupos / main1.asm
Last active March 21, 2018 05:56
16F84A+Matrix LED
; マトリクスLED
; ha2zakura
list p=16F84A ; 使用するPICの種類の定義
#include <p16F84A.inc> ; 設定ファイルの指定
__CONFIG _CP_OFF & _WDT_OFF & _PWRTE_ON & _HS_OSC
; _CP_OFF プログラムコードプロテクト無効
; _WDT_OFF ウォッチドドック・タイマ無効