Skip to content

Instantly share code, notes, and snippets.

View eqs's full-sized avatar
🎍
Focusing

eqs

🎍
Focusing
View GitHub Profile
@eqs
eqs / boids.rs
Created February 7, 2023 11:49
An implementation of Boids algorithm with Bevy 0.9.
use rand::{thread_rng, Rng};
use bevy::prelude::*;
use bevy::time::FixedTimestep;
const WIN_WIDTH: u32 = 640;
const WIN_HEIGHT: u32 = 640;
fn main() {
App::new()
.insert_resource(ClearColor(Color::rgb(0.04, 0.04, 0.04)))
@eqs
eqs / Turtle.m
Created December 27, 2022 15:01
Turtle
classdef Turtle < handle
% MATLABで簡易のTurtle Graphicsを行うためのクラス
%
% Turtle Properties:
% p - Turtleの位置を表す行ベクトル [x, y]
% penOnPaper - trueならTurtleの軌跡を描画する
%
% Turtle Methods:
% moveTo - Turtleを位置 pDst に移動させる
% penUp - Turtleが移動した軌跡を描画しない
@eqs
eqs / event_example.py
Created April 14, 2022 14:09
Example code for q5 v0.0.4
# -*- coding: utf-8 -*-
import q5
class App(q5.BaseApp):
def __init__(self):
self.x = 0.0
self.y = 0.0
def update(self):
@eqs
eqs / spam.py
Created February 17, 2022 15:36
q5 example
import math
import q5
class App(q5.BaseApp):
def __init__(self):
self.x = 0.0
self.y = 0.0
def update(self):
@eqs
eqs / sketch_211116b.pde
Created November 16, 2021 11:21
めも
final int N = 2048;
float[][] radii = new float[][] {
{0.3, 0.3}, {0.7, 0.3}, {0.7, 0.7}, {0.3, 0.7}
};
// offset用
float[][] signs = new float[][] {
{1.0, 1.0}, {-1.0, 1.0}, {-1.0, -1.0}, {1.0, -1.0}
};
@eqs
eqs / Tree.pde
Created February 21, 2021 07:01
sketch_210221a
// https://stackoverflow.com/questions/3522454/how-to-implement-a-tree-data-structure-in-java
// https://github.com/gt4dev/yet-another-tree-structure
class TreeNode<T extends AbstractShape> {
final int MAX_N = 8;
int N = 1;
T data;
TreeNode<T> parent;
ArrayList<TreeNode<T>> children;
@eqs
eqs / 20201210_Unnormalized_Spectral_Clustering.ipynb
Created December 10, 2020 11:10
Unnormalized Spectral Clustering
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@eqs
eqs / Zebrafish_Notebook.ipynb
Created June 10, 2020 13:44
Tracking Zebrafish by Tracktor
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@eqs
eqs / spam.py
Created September 27, 2019 15:48
Video Stream
# -*- coding: utf-8 -*-
"""
Created on 09/28/19 00:28:12
@author: Satoshi Murashige
"""
import time
import numpy as np
import cv2
@eqs
eqs / config
Created September 9, 2019 04:32
SSH port forwarding
Host example
HostName example.com
User example
Port 22$
IdentityFile ~/id_rsa
ServerAliveInterval 60$
LocalForward 9000 localhost:8888
LocalForward 9001 localhost:6006