This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If you need to, install R by visiting CRAN (https://cran.r-project.org/) and | |
# downloading the appropriate version for your operating system. | |
# Create a project folder `delphi_project` and open it. | |
# Open an R terminal and install the renv, pak, and rspm packages by running the | |
# commands below. | |
# * The pak package is the modern installer for R packages. Learn more at | |
# https://pak.r-lib.org/. | |
# * The rspm package is a package manager for R that allows you to install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[build-system] | |
requires = ["setuptools"] | |
build-backend = "setuptools.build_meta" | |
[project] | |
name = "package_name" | |
version = "0.1.0" | |
description = "Useful utilities" | |
readme = "README.md" | |
requires-python = ">=3.10" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Mac Setup Helper | |
# | |
# This my helper script for setting up a new Mac. It's not meant to be run | |
# as-is, but rather to be used as a reference for setting up a new Mac. | |
# | |
# Some resources I used: | |
# - An in-depth setup guide https://sourabhbajaj.com/mac-setup/ | |
# Install xcode, many basics for Mac dev | |
xcode-select --install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* Part 1 *) | |
a = 273025; b = 767253; | |
t = Flatten[Table[FromDigits[{i, j, k, l, m, n}], | |
{i, 1, 9}, {j, i, 9}, {k, j, 9}, | |
{l, k, 9}, {m, l, 9}, {n, m, 9}]]; | |
Length@Select[t, MemberQ[Differences@IntegerDigits[#], 0] && a <= # <= b &] | |
(* Part 2 *) | |
f[n_] := Differences@IntegerDigits[n] /. Thread[Range[2, 9] -> 1] | |
g[n_] := f[n][[1 ;; 2]] == {0, 1} || f[n][[-2 ;; -1]] == {1, 0} || |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import speedtest | |
st = speedtest.Speedtest() | |
st.get_servers() | |
st.get_best_server() | |
st.download() | |
st.upload() | |
res = st.results | |
with open('stats.json', 'a+') as f: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(**First we make a function to obtain every spiral corner, then we interpolate between each corner to get the sides, sum together, and finally convert the bijection to an integer sequence.*)) | |
up = {0, 1}; | |
right = {1, 0}; | |
down = -up; | |
left = -right; | |
directions = {up, right, down, left}; | |
start = {0, 0}; | |
length = 100; |