Skip to content

Instantly share code, notes, and snippets.

@notLiria
notLiria / pins_arduino.h
Created August 14, 2020 06:31
Modified pins_arduino.h allowing for extra pin usage
/*
pins_arduino.h - Pin definition functions for Arduino
Part of Arduino - http://www.arduino.cc/
Copyright (c) 2007 David A. Mellis
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
@notLiria
notLiria / Configuration.h
Created June 2, 2020 18:40
Micromake D1 Marlin Config on SKR Mini E3 2.0 - Working as of 14:40, 2020/06/02
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@notLiria
notLiria / Configuration.h
Created June 1, 2020 19:24
Marlin Configuration - Micromake Delta
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@notLiria
notLiria / unambigous.clj
Created March 1, 2020 21:10
Check if expression AB is unambigous (Goes on inside)
(mapcat (fn [x] (map #(str x %) b)) a)
@notLiria
notLiria / johnson.py
Created February 25, 2020 03:26
Enumerator for maximal independent subset of a Johnson graph of J(n, n/2). Assumes that the graph is "Symmetrical"
import itertools
import networkx as nx
import matplotlib.pyplot as plt
def generate_johnson_vertices(n):
return list(itertools.combinations(range(1, n + 1), n//2))
def enumerate_johnson_neighbours(node, set):
#Node is a set, set is a list
@notLiria
notLiria / polynomial.clj
Last active February 7, 2020 01:35
Example for Xetera of Rational Root Theorem
(defn enumerate-divisors
[n]
(filter #(zero? (rem (Math/abs n) %)) (range 1 (+ 1 (Math/abs n)))))
(defn enumerate-possible-roots
[poly]
(let [q (enumerate-divisors (last poly))
p (enumerate-divisors (first poly))]
(distinct
(mapcat #(vector % (* -1 %))
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
1.500000000000000000e+01 3.275625000000000000e+02 2.053250000000000000e+03
0.000000000000000000e+00 6.429687500000000000e+01 0.000000000000000000e+00
0.000000000000000000e+00 6.546875000000000000e+01 0.000000000000000000e+00
0.000000000000000000e+00 6.657812500000000000e+01 0.000000000000000000e+00
1.200000000000000000e+01 6.801562500000000000e+01 1.510000000000000000e+02
1.200000000000000000e+01 6.918750000000000000e+01 1.447500000000000000e+02
1.000000000000000000e+01 7.034375000000000000e+01 1.362500000000000000e+02
1.200000000000000000e+01 7.176562500000000000e+01 1.322500000000000000e+02
1.000000000000000000e+01 7.448437500000000000e+01 1.307500000000000000e+02
0.000000000000000000e+00 7.357812500000000000e+01 0.000000000000000000e+00
False 15 327.5625 2053.25
False 0 64.296875 0.0
False 0 65.46875 0.0
False 0 66.578125 0.0
False 12 68.015625 151.0
False 12 69.1875 144.75
False 10 70.34375 136.25
False 12 71.765625 132.25
False 10 74.484375 130.75
False 0 73.578125 0.0
82pi@raspberrypi:~/clojure/image-to-sound$ lein run
83OpenJDK Client VM warning: TieredCompilation is disabled in this release.
84OpenJDK Client VM warning: TieredCompilation is disabled in this release.
85Exception in thread "main" java.lang.IllegalArgumentException: No implementation of method: :as-image of protocol: #'mikera.image.protocols/ImageResource found for class: nil, compiling:(core.clj:6:10)
86 at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3657)
87 at clojure.lang.Compiler$DefExpr.eval(Compiler.java:451)
88 at clojure.lang.Compiler.eval(Compiler.java:6932)
89 at clojure.lang.Compiler.load(Compiler.java:7379)
90 at clojure.lang.RT.loadResourceScript(RT.java:372)
(defproject image-to-sound "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.8.0"]
[overtone "0.10.3"]
[net.mikera/imagez "0.12.0"]
[org.craigandera/dynne "0.4.1"]
]