Skip to content

Instantly share code, notes, and snippets.

View kinoshita-lab's full-sized avatar
🌐
middle of nowhere

kaz saita kinoshita-lab

🌐
middle of nowhere
View GitHub Profile
@kinoshita-lab
kinoshita-lab / main.rs
Created September 12, 2020 07:27
project euler problem 7
fn is_prime(val: u64) -> bool {
let end = |current_val: u64| -> bool { current_val * current_val > val };
let mut i = 2;
loop {
if (val % i) == 0 {
return false;
}
if end(i) {
return true;
@kinoshita-lab
kinoshita-lab / main.rs
Created September 12, 2020 07:22
project euler problem 6
fn main() {
let upper = 100;
let sum_of_squares = (0..upper).fold(0, |acc, i| acc + (i * i));
let sum = (0..upper).fold(0, |acc, i| acc + i);
let square_of_sum = sum * sum;
let difference = square_of_sum - sum_of_squares;
println!("{:?}", difference);
}
@kinoshita-lab
kinoshita-lab / main.rs
Last active September 8, 2020 07:29
project euler problem 5
// Yutani-san(@yutannihilation) adviced me much simpler implementation. Thanks!!
fn main() {
let upper = 20;
let mut i = 0;
loop {
i += 1;
if !(2..upper).any(|j| i % j != 0) {
println!("{:?}", i);
@kinoshita-lab
kinoshita-lab / Cargo.toml
Created August 12, 2020 03:02
learning rust: bubblesort in main
[package]
name = "bubblesort"
version = "0.1.0"
authors = ["kinoshita-lab"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
rand ="*"
[kazbo@kinobori src (dev)]$ ./mimium ../examples/demo.mmm
Info: Opening ../examples/demo.mmm
Info: Audio Device : Built-in Audio Analog Stereo, Sampling Rate : 44100, Output Channels : 2
Segmentation fault (core dumped)
Standard: Cpp11
BasedOnStyle: LLVM
IndentWidth: 4
ColumnLimit: 0
AccessModifierOffset: -4
NamespaceIndentation: None
BreakBeforeBraces: Custom
PointerAlignment: Left
BraceWrapping:
AfterEnum: true
@kinoshita-lab
kinoshita-lab / tasks.json
Created February 11, 2020 02:45
vscode task config example for logue sdk/nutekt/waves
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"command": "make",
"problemMatcher": [
@kinoshita-lab
kinoshita-lab / gist:9984b2d8a94809001eaf26e39ac8e398
Created February 11, 2020 02:38
dumpbin result of msys64 logue-cli.exe
dumpbin /DEPENDENTS ./logue-cli.exe
Microsoft (R) COFF/PE Dumper Version 14.24.28316.0
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file .\logue-cli.exe
File Type: EXECUTABLE IMAGE
Image has the following dependencies:
@kinoshita-lab
kinoshita-lab / Potentiometer_Alps_RK09K_Horizontal_CORRECTED.kicad_mod
Created September 25, 2019 06:37
Kicad Footprint for Alps RK09K Potentiometer(Horizontal)
(module Potentiometer_Alps_RK09K_Horizontal_CORRECTED (layer F.Cu) (tedit 5D8B0A1C)
(descr "Potentiometer, horizontally mounted, Omeg PC16PU, Omeg PC16PU, Omeg PC16PU, Vishay/Spectrol 248GJ/249GJ Single, Vishay/Spectrol 248GJ/249GJ Single, Vishay/Spectrol 248GJ/249GJ Single, Vishay/Spectrol 248GH/249GH Single, Vishay/Spectrol 148/149 Single, Vishay/Spectrol 148/149 Single, Vishay/Spectrol 148/149 Single, Vishay/Spectrol 148A/149A Single with mounting plates, Vishay/Spectrol 148/149 Double, Vishay/Spectrol 148A/149A Double with mounting plates, Piher PC-16 Single, Piher PC-16 Single, Piher PC-16 Single, Piher PC-16SV Single, Piher PC-16 Double, Piher PC-16 Triple, Piher T16H Single, Piher T16L Single, Piher T16H Double, Alps RK163 Single, Alps RK163 Double, Alps RK097 Single, Alps RK097 Double, Bourns PTV09A-2 Single with mounting sleve Single, Bourns PTV09A-1 with mounting sleve Single, Bourns PRS11S Single, Alps RK09K Single with mounting sleve Single, Alps RK09K with mounting sleve Single, http://www.alps
@kinoshita-lab
kinoshita-lab / .config
Created June 22, 2019 03:08
.config with make tinyconfig with ramfs, serial console, and debug features (with alsa)
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 5.1.12 Kernel Configuration
#
#
# Compiler: gcc (GCC) 8.3.0
#
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=80300