Add obsidian stuff

This commit is contained in:
Maciej Jur 2023-04-21 23:47:54 +02:00
parent 760daac730
commit a2707fa942
6 changed files with 37 additions and 35 deletions

3
.gitignore vendored
View file

@ -24,3 +24,6 @@ pnpm-debug.log*
public/**/*.jpg
public/**/*.png
public/**/*.webp
# obsidian
.obsidian/

View file

@ -3,7 +3,7 @@ lockfileVersion: '6.0'
dependencies:
'@astrojs/mdx':
specifier: ^0.19.0
version: 0.19.0(astro@2.3.0)(rollup@3.20.6)
version: 0.19.0(astro@2.3.0)(rollup@3.20.7)
'@astrojs/solid-js':
specifier: ^2.1.0
version: 2.1.0(@babel/core@7.21.4)(solid-js@1.7.3)
@ -138,14 +138,14 @@ packages:
- supports-color
dev: false
/@astrojs/mdx@0.19.0(astro@2.3.0)(rollup@3.20.6):
/@astrojs/mdx@0.19.0(astro@2.3.0)(rollup@3.20.7):
resolution: {integrity: sha512-McFpMV+npinIEKnY5t9hsdzLd76g78GgIRUPxem2OeXPNB8xr2pNS28GeU0+6Pn5STnB+sgcyyeqXLgzauOlMQ==}
engines: {node: '>=16.12.0'}
dependencies:
'@astrojs/markdown-remark': 2.1.4(astro@2.3.0)
'@astrojs/prism': 2.1.1
'@mdx-js/mdx': 2.3.0
'@mdx-js/rollup': 2.3.0(rollup@3.20.6)
'@mdx-js/rollup': 2.3.0(rollup@3.20.7)
acorn: 8.8.2
es-module-lexer: 1.2.1
estree-util-visit: 1.2.1
@ -181,7 +181,7 @@ packages:
dependencies:
babel-preset-solid: 1.7.3(@babel/core@7.21.4)
solid-js: 1.7.3
vitefu: 0.2.4(vite@4.2.2)
vitefu: 0.2.4(vite@4.3.1)
transitivePeerDependencies:
- '@babel/core'
- vite
@ -197,7 +197,7 @@ packages:
dset: 3.1.2
is-docker: 3.0.0
is-wsl: 2.2.0
undici: 5.21.2
undici: 5.22.0
which-pm-runs: 1.1.0
transitivePeerDependencies:
- supports-color
@ -723,14 +723,14 @@ packages:
- supports-color
dev: false
/@mdx-js/rollup@2.3.0(rollup@3.20.6):
/@mdx-js/rollup@2.3.0(rollup@3.20.7):
resolution: {integrity: sha512-wLvRfJS/M4UmdqTd+WoaySEE7q4BIejYf1xAHXYvtT1du/1Tl/z2450Gg2+Hu7fh05KwRRiehiTP9Yc/Dtn0fA==}
peerDependencies:
rollup: '>=2'
dependencies:
'@mdx-js/mdx': 2.3.0
'@rollup/pluginutils': 5.0.2(rollup@3.20.6)
rollup: 3.20.6
'@rollup/pluginutils': 5.0.2(rollup@3.20.7)
rollup: 3.20.7
source-map: 0.7.4
vfile: 5.3.7
transitivePeerDependencies:
@ -770,7 +770,7 @@ packages:
tslib: 2.5.0
dev: false
/@rollup/pluginutils@5.0.2(rollup@3.20.6):
/@rollup/pluginutils@5.0.2(rollup@3.20.7):
resolution: {integrity: sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==}
engines: {node: '>=14.0.0'}
peerDependencies:
@ -782,7 +782,7 @@ packages:
'@types/estree': 1.0.1
estree-walker: 2.0.2
picomatch: 2.3.1
rollup: 3.20.6
rollup: 3.20.7
dev: false
/@types/acorn@4.0.6:
@ -1057,8 +1057,8 @@ packages:
typescript: 5.0.4
unist-util-visit: 4.1.2
vfile: 5.3.7
vite: 4.2.2(sass@1.62.0)
vitefu: 0.2.4(vite@4.2.2)
vite: 4.3.1(sass@1.62.0)
vitefu: 0.2.4(vite@4.3.1)
yargs-parser: 21.1.1
zod: 3.21.4
transitivePeerDependencies:
@ -1138,8 +1138,8 @@ packages:
engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
hasBin: true
dependencies:
caniuse-lite: 1.0.30001480
electron-to-chromium: 1.4.368
caniuse-lite: 1.0.30001481
electron-to-chromium: 1.4.369
node-releases: 2.0.10
update-browserslist-db: 1.0.11(browserslist@4.21.5)
dev: false
@ -1163,8 +1163,8 @@ packages:
engines: {node: '>=10'}
dev: false
/caniuse-lite@1.0.30001480:
resolution: {integrity: sha512-q7cpoPPvZYgtyC4VaBSN0Bt+PJ4c4EYRf0DrduInOz2SkFpHD5p3LnvEpqBp7UnJn+8x1Ogl1s38saUxe+ihQQ==}
/caniuse-lite@1.0.30001481:
resolution: {integrity: sha512-KCqHwRnaa1InZBtqXzP98LPg0ajCVujMKjqKDhZEthIpAsJl/YEIa3YvXjGXPVqzZVguccuu7ga9KOE1J9rKPQ==}
dev: false
/ccount@2.0.1:
@ -1371,8 +1371,8 @@ packages:
resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==}
dev: false
/electron-to-chromium@1.4.368:
resolution: {integrity: sha512-e2aeCAixCj9M7nJxdB/wDjO6mbYX+lJJxSJCXDzlr5YPGYVofuJwGN9nKg2o6wWInjX6XmxRinn3AeJMK81ltw==}
/electron-to-chromium@1.4.369:
resolution: {integrity: sha512-LfxbHXdA/S+qyoTEA4EbhxGjrxx7WK2h6yb5K2v0UCOufUKX+VZaHbl3svlzZfv9sGseym/g3Ne4DpsgRULmqg==}
dev: false
/emmet@2.4.2:
@ -3101,8 +3101,8 @@ packages:
engines: {node: '>=10.0.0'}
dev: false
/rollup@3.20.6:
resolution: {integrity: sha512-2yEB3nQXp/tBQDN0hJScJQheXdvU2wFhh6ld7K/aiZ1vYcak6N/BKjY1QrU6BvO2JWYS8bEs14FRaxXosxy2zw==}
/rollup@3.20.7:
resolution: {integrity: sha512-P7E2zezKSLhWnTz46XxjSmInrbOCiul1yf+kJccMxT56vxjHwCbDfoLbiqFgu+WQoo9ij2PkraYaBstgB2prBA==}
engines: {node: '>=14.18.0', npm: '>=8.0.0'}
hasBin: true
optionalDependencies:
@ -3418,9 +3418,9 @@ packages:
busboy: 1.6.0
dev: false
/undici@5.21.2:
resolution: {integrity: sha512-f6pTQ9RF4DQtwoWSaC42P/NKlUjvezVvd9r155ohqkwFNRyBKM3f3pcty3ouusefNRyM25XhIQEbeQ46sZDJfQ==}
engines: {node: '>=12.18'}
/undici@5.22.0:
resolution: {integrity: sha512-fR9RXCc+6Dxav4P9VV/sp5w3eFiSdOjJYsbtWfd4s5L5C4ogyuVpdKIVHeW0vV1MloM65/f7W45nR9ZxwVdyiA==}
engines: {node: '>=14.0'}
dependencies:
busboy: 1.6.0
dev: false
@ -3564,8 +3564,8 @@ packages:
vfile-message: 3.1.4
dev: false
/vite@4.2.2(sass@1.62.0):
resolution: {integrity: sha512-PcNtT5HeDxb3QaSqFYkEum8f5sCVe0R3WK20qxgIvNBZPXU/Obxs/+ubBMeE7nLWeCo2LDzv+8hRYSlcaSehig==}
/vite@4.3.1(sass@1.62.0):
resolution: {integrity: sha512-EPmfPLAI79Z/RofuMvkIS0Yr091T2ReUoXQqc5ppBX/sjFRhHKiPPF/R46cTdoci/XgeQpB23diiJxq5w30vdg==}
engines: {node: ^14.18.0 || >=16.0.0}
hasBin: true
peerDependencies:
@ -3591,14 +3591,13 @@ packages:
dependencies:
esbuild: 0.17.17
postcss: 8.4.23
resolve: 1.22.2
rollup: 3.20.6
rollup: 3.20.7
sass: 1.62.0
optionalDependencies:
fsevents: 2.3.2
dev: false
/vitefu@0.2.4(vite@4.2.2):
/vitefu@0.2.4(vite@4.3.1):
resolution: {integrity: sha512-fanAXjSaf9xXtOOeno8wZXIhgia+CZury481LsDaV++lSvcU2R9Ch2bPh3PYFyoHW+w9LqAeYRISVQjUIew14g==}
peerDependencies:
vite: ^3.0.0 || ^4.0.0
@ -3606,7 +3605,7 @@ packages:
vite:
optional: true
dependencies:
vite: 4.2.2(sass@1.62.0)
vite: 4.3.1(sass@1.62.0)
dev: false
/vscode-css-languageservice@6.2.4:

View file

@ -42,7 +42,7 @@ def solve1() -> int:
```
## Task 2
In this task we have to find the optimal point for all crabs to move to on a single axis, similar to task 1. The difference is that the way fuel expenditure is caluculated is a sequence: 1, 1+2, 1+2+3, 1+2+3+4, ...
In this task we have to find the optimal point for all crabs to move to on a single axis, similar to task 1. The difference is that the way fuel expenditure is calculated is a sequence: 1, 1+2, 1+2+3, 1+2+3+4, ...
The way I solved this is I looked up the formula for the function that calculates the value for the n-th element in the sequence on the Internet. It happens to be:
@ -67,7 +67,7 @@ $$
\begin{bmatrix} |0 - c_1| & |0 - c_2| & |0 - c_3| & \cdots & |0 - c_i| \\\\ |1 - c_1| & |1 - c_2| & |1 - c_3| & \cdots & |1 - c_i| \\\\ |2 - c_1| & |2 - c_2| & |2 - c_3| & \cdots & |2 - c_i| \\\\ \vdots & \vdots & \vdots & \ddots & \vdots \\\\ |n - c_1| & |n - c_2| & |n - c_3| & \cdots & |n - c_i| \end{bmatrix}
$$
We then apply the formula for the n-th element in the sequence to the matrix. The result is a matrix with the fuel expenditure to all other points. When we sum the values in rows of the matrix we get the total fuel expenditure to all points for the crabs.
We then apply the formula for the $n$-th element in the sequence to the matrix. The result is a matrix with the fuel expenditure to all other points. When we sum the values in rows of the matrix we get the total fuel expenditure to all points for the crabs.
$$
\min \sum_{c \in C} f(|x - c|)

View file

@ -8,7 +8,7 @@ stars: 2
Today's challenge is available [here](https://adventofcode.com/2021/day/11).
Octopuses flash when their energy levels reach above 9 and it causes their neignbours to increase their levels by 1 too? This sounds like a perfect job for some kind of a matrix operation...
Octopuses flash when their energy levels reach above 9 and it causes their neighbors to increase their levels by 1 too? This sounds like a perfect job for some kind of a matrix operation...
Loading data:
@ -19,7 +19,7 @@ def load():
return np.array([int(num) for line in lines for num in line]).reshape((-1, len(lines)))
```
In this chanllenge I decided to try my hand at using convolution matrix to solve this problem. First I had to create a function that would return an array containing octopuses and their neighbours. For this I used the following code:
In this challenge I decided to try my hand at using convolution matrix to solve this problem. First I had to create a function that would return an array containing octopuses and their neighbors. For this I used the following code:
```py
from numpy.lib.stride_tricks import as_strided

View file

@ -13,4 +13,4 @@ This year was a pretty good year, I am especially happy that I managed to learn
- Japanese - I would like to focus on Japanese, because it's something that's been dragging on forever by now. It would be cool to finally reach a point where I can comfortably read books, newspapers etc. in Japanese. This isn't really the most important part of my studies, so I have to squeeze it in whenever.
- Koko - I would like to write a programming language, which I named Koko. It doesn't actually exist yet, but I think that it will be a very fun experience if I do end up creating it.
- Haskell - I've been thinking about learning this programming language for a while now, and it seems like one of these languages that are just way too iconic and cool :sunglasses: to pass on. I feel like learning Haskell will be a one of a kind adventure.
- Drawing - I would like to learn to draw, but I already know this will be an extremely time consuming endeavour, so it has to go on the back burner. Unless, somehow, I do find enough time to do it.
- Drawing - I would like to learn to draw, but I already know this will be an extremely time consuming endeavor, so it has to go on the back burner. Unless, somehow, I do find enough time to do it.

View file

@ -17,7 +17,7 @@ If you don't have any direction in life, then that means you just haven't imagin
Following others and sticking to others is fine, as long as this doesn't mean you're giving up your own goals in the process. Just think about it, if you don't do what you should be doing to accomplish what you think is worthwhile, will you be proud of yourself in a couple of years? Or a decade? Of course, this doesn't mean you should only ever think about just yourself. Spending time with others is good too :slight_smile:
Time is precious, in fact it is a single most presious thing in our possession. Each single possible moment and day in your life is unique. It's like a set of unique moments which you can use up to accomplish things you think are worthwhile - or not. Sometimes you should stop and think whether the way you are spending your time is worthwhile.
Time is precious, in fact it is a single most precious thing in our possession. Each single possible moment and day in your life is unique. It's like a set of unique moments which you can use up to accomplish things you think are worthwhile - or not. Sometimes you should stop and think whether the way you are spending your time is worthwhile.
## Finishing thoughts