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
Last active September 12, 2020 23:45
project euler problem 8
const DIGITS: &str = "\
73167176531330624919225119674426574742355349194934\
96983520312774506326239578318016984801869478851843\
85861560789112949495459501737958331952853208805511\
12540698747158523863050715693290963295227443043557\
66896648950445244523161731856403098711121722383113\
62229893423380308135336276614282806444486645238749\
30358907296290491560440772390713810515859307960866\
70172427121883998797908792274921901699720888093776\
65727333001053367881220235421809751254540594752243\
@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