I hereby claim:
- I am kiranshila on github.
- I am kiranshila (https://keybase.io/kiranshila) on keybase.
- I have a public key whose fingerprint is 3543 5D6C 3513 E5F6 E4DB A128 91B5 B58D 98E0 3214
To claim this, I am signing this object:
| (ns aoc2019.core) | |
| ;; Part 1 | |
| (defn fuel [mass] | |
| (- (int (Math/floor (/ mass 3))) 2)) | |
| ;; Read File | |
| (def input | |
| (->> (slurp "1.txt") | |
| clojure.string/split-lines |
| program = [parse(Int64,i) for i in split(readline("2.txt"),',')] | |
| program[2] = 12 | |
| program[3] = 2 | |
| function runIntcode!(program,offset=1) | |
| # Step 1 - Get opcode | |
| opcode = program[offset] | |
| if opcode == 1 | |
| # Add routine |
| (defmacro comprehension [binding & body] | |
| `(lazy-seq (map (fn [~(first binding)] ~@body) ~(second binding)))) |
I hereby claim:
To claim this, I am signing this object:
Recently, I have been playing around with the Esprit project which is an attempt to run ClojureScript on microcontrollers using the Espruino microcontroller-based JS interpreter. As per Mike's talk here, the real trick is to setup Espruino such that it has enough space to hold cljs.core and all your program code. This ends up at least around 900KB.
Now for those unfamiliar, the ESP32 is configured with a partition table - allocating different sections of memory to the program code, non-volatile storage, the bootloader, etc. These partitions can be arbitrarily resized. Additionally, one can make partitions that don't mean anything to the ESP32, but can yield pointers in the C code that help manage the separate parts of memory.
As modern ESP32s ship with TONS of flash, we want to make the partition that Espruino calls js_code as large as possible to take full advant
| using DifferentialEquations | |
| using BoundaryValueDiffEq | |
| using DiffEqCallbacks | |
| using ForwardDiff | |
| using Plots | |
| struct Material | |
| k_coefs::Vector | |
| end |
| Temperature | k | |
|---|---|---|
| 4 | 0.00288 | |
| 7 | 0.00531 | |
| 10 | 0.00796 | |
| 15 | 0.0129 | |
| 20 | 0.0183 | |
| 25 | 0.0241 | |
| 30 | 0.0304 | |
| 40 | 0.0438 | |
| 50 | 0.0566 |
| Temperature | k | |
|---|---|---|
| 15.11301551884327 | 0.07465345102636006 | |
| 16.325628243123717 | 0.07884802260357432 | |
| 20.076097262888098 | 0.08268964562569214 | |
| 23.494475529653513 | 0.08662403517098391 | |
| 27.634850794789116 | 0.08985372781740777 | |
| 32.15806896327027 | 0.09409680300788886 | |
| 37.2771158187594 | 0.09912418088410396 | |
| 45.66492795653713 | 0.10343154243428185 | |
| 50.89389884139038 | 0.10772070911868079 |
| Temperature | rho | |
|---|---|---|
| 1 | 12.4e-6 | |
| 4 | 12.4e-6 | |
| 7 | 12.4e-6 | |
| 10 | 12.4e-6 | |
| 15 | 12.4e-6 | |
| 20 | 12.4e-6 | |
| 30 | 12.5e-6 | |
| 40 | 12.6e-6 | |
| 50 | 12.8e-6 |
| .PHONY : clean | |
| CFLAGS = -fPIC -O2 | |
| LDFLAGS = -shared | |
| TARGET = novas.so | |
| SOURCES = solsys1.c readeph0.c eph_manager.c nutation.c novascon.c novas.c | |
| OBJECTS = $(SOURCES:.c=.o) | |
| all: $(TARGET) |