Skip to content

Instantly share code, notes, and snippets.

@8q
8q / complexmapping.py
Last active February 6, 2017 08:38
Numpy+matplotlib
import numpy as np
import matplotlib.pyplot as plt
fig = plt.figure(figsize=(11, 5))
ax1 = fig.add_subplot(1,2,1)
ax2 = fig.add_subplot(1,2,2)
#反転の円円対応
theta = np.linspace(0, 2*np.pi, 100)
r = 10
@8q
8q / mandelbrot.R
Created February 15, 2017 17:22
R lang test
xmin <- -2
xmax <- 2
ymin <- -2
ymax <- 2
size <- 1000 #点の数はsize*size
n <- 100 #発散判定の試行回数
X <- matrix(rep(seq(xmin, xmax, length=size), times=size), nrow=size)
Y <- matrix(rep(seq(xmin, xmax, length=size), times=size), nrow=size, byrow=TRUE)
C <- X + 1i * Y
Z <- matrix(rep(numeric(size), times=size), nrow = size)
@8q
8q / fav2slack.java
Last active November 11, 2017 14:44
ツイッターのリストに流れてくる画像をひたすら集めるやつ nohup ./start.sh &
package fav2slack;
import java.io.IOException;
import com.ullink.slack.simpleslackapi.SlackChannel;
import com.ullink.slack.simpleslackapi.SlackSession;
import com.ullink.slack.simpleslackapi.impl.SlackSessionFactory;
import twitter4j.Status;
import twitter4j.TwitterStream;
@8q
8q / iris.py
Created February 7, 2018 08:17
import keras
import sklearn
import numpy as np
from sklearn import datasets
from sklearn.model_selection import train_test_split
from sklearn import preprocessing
from sklearn.metrics import f1_score
from keras.utils import to_categorical
from keras.layers import Dense, Activation
from keras.models import Sequential, Model
function kiri_test(from, to, interval)
cmd = "アニメ登録 anim1 2 "
for i=from, to, 1
do
cmd = cmd..string.format("kiri\\kiri_%05d.png %d ", i, interval)
end
lvCmd(cmd)
end
name: "AnimeFace"
layer {
name: "train-data"
type: "Data"
top: "data"
top: "label"
data_param {
batch_size: 30
}
@8q
8q / genetic_algorithm.pde
Created April 8, 2018 15:33
mischan.png[83x100], takagiya.png[80x80]
import java.util.List;
import java.util.Iterator;
import java.util.Arrays;
Stage stage;
Population population;
int LIFE_TIME = 400;
float MUTATION_RATE = 0.025;
int POPULATION_NUM = 20;
import ddf.minim.spi.*;
import ddf.minim.signals.*;
import ddf.minim.*;
import ddf.minim.analysis.*;
import ddf.minim.ugens.*;
import ddf.minim.effects.*;
Minim minim;
AudioPlayer player;
FFT fft;
@8q
8q / copy.gs
Created May 17, 2018 06:43
トリガーで値の変更に設定しておく
function onChange(){
var ss = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('シート1');
var endRow = 0;
for(var i = 1; i <= ss.getLastRow(); i++) {
if(ss.getRange(i, 2).getValue() == "") break;
endRow++;
}
ss.getRange(endRow, 3).setValue(ss.getRange(endRow, 2).getValue())
}
@8q
8q / Dockerfile
Last active May 21, 2018 08:00
Dockerfile(python + jupyter+ tf + keras) from https://github.com/ufoym/deepo
# MIT License
# Copyright (c) 2017 Ming
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions: