Skip to content

Instantly share code, notes, and snippets.

@jnory
jnory / 省メモリにrinna_modelパラメータ変換してredpajama_cppを動かす.ipynb
Last active July 6, 2023 08:43
無料版colabのGPUなしランタイムでrinna modelを動かす
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jnory
jnory / wf_text_counter.js
Last active November 4, 2019 14:56 — forked from takasek/wf_text_counter.js
Text counter for WorkFlowy を2019年でも使えるように修正したもの
(function() {
var g = window.textCounter_g;
if (g) {
$("#textCountDart, #textCounter").remove();
clearInterval(g.textCounting);
window.textCounter_g = null;
return;
}
g = window.textCounter_g = {};
var countText = function() {
@jnory
jnory / midi.py
Created June 29, 2018 12:42
pygameでmidiを操作する
import time
import pygame
import pygame.midi
def main(args):
pygame.midi.init()
if args.list:
@jnory
jnory / swap.py
Created June 9, 2018 14:31
XOR交換アルゴリズム
def swap(a, b):
a = a ^ b
b = a ^ b
a = a ^ b
return a, b
def main(args):
print(swap(args.a, args.b))
@jnory
jnory / circle_ratio.py
Last active June 2, 2018 12:50
円周率
import numpy as np
import pandas as pd
def main(args):
np.random.seed(args.seed)
index = []
history = []
n_within_circle = 0
@jnory
jnory / mandelbrot.py
Created April 27, 2018 14:52
マンデルブロ集合
import numpy as np
from PIL import Image
from tqdm import tqdm
class Mandelbrot(object):
def __init__(self, r1, r2, i1, i2, k, l):
self.r1 = min(r1, r2)
self.r2 = max(r1, r2)
self.i1 = min(i1, i2)