-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
51f591f
commit 6661a13
Showing
11 changed files
with
131 additions
and
4 deletions.
There are no files selected for viewing
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
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
Binary file added
BIN
+4.57 MB
content/sports/nba/basketball-moments-ill-remember-forever/-V2FLa-nYVTeUrfn.mp4
Binary file not shown.
Binary file added
BIN
+312 KB
...basketball-moments-ill-remember-forever/Screenshot 2024-04-23 at 1.14.40 AM.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions
1
content/sports/nba/basketball-moments-ill-remember-forever/index.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
I watch a lot of basketball. This is an attempt to catalogue every moment that affected me on a personal level and possibly changed my life. |
17 changes: 17 additions & 0 deletions
17
...ts/nba/basketball-moments-ill-remember-forever/jamal-murray-game-winner-2024.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
title: Jamal Murray's game-winner against the Lakers, April 22nd, 2024 | ||
tags: | ||
- thoughts | ||
--- | ||
I'm a closeted fan of the Denver Nuggets. Nikola Jokic is my favorite player, ever, and I will confidently argue that he's currently in the greatest offensive peak ever. I love Denver and Colorado broadly, it's pretty much my ideal place to live. | ||
|
||
I hate the Lakers. I'm a Celtics fan, hating the Lakers is in my blood. People who act like sports is supposed to be some egalitarian kumbaya is a fucking liar. The only thing that brings me more pleasure than my team winning is seeing my enemies suffer. | ||
|
||
So, thank you Jamal Murray, for playing like dogshit for most of the game, letting the Lakers get a 20 point lead on you, then going 6/8 in the fourth quarter and hitting an incredible game winner on AD, who spent the prior morning whining about not being defensive player of the year. | ||
|
||
![[Screenshot 2024-04-23 at 1.14.40 AM.png]] | ||
This was my live reaction. The Nuggets have now beat the Lakers 10 times in a row. They're likely going to get swept again. | ||
|
||
I love basketball. | ||
|
||
![[-V2FLa-nYVTeUrfn.mp4]] |
10 changes: 10 additions & 0 deletions
10
content/technology/hardware/nvidia/installing-cuda-on-lxc.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
title: Installing CUDA/Nvidia Drivers on a host to be shared with Linux Container(s) | ||
tags: | ||
- observations | ||
--- | ||
I have a 4090 GPU. I want to share the GPU across multiple lightweight Linux Containers (LXCs), of which they might share them with Docker containers, which could theoretically share... whatever, you get it. I want access to `nvcc` on LXCs for development. | ||
|
||
This is a little bit more of a convoluted process than it may seem like. It involves messing with the kernel, building kernel modules, downloading multiple packages, but in the end, you get a GPU that can be used in multiple contexts avoiding the overhead of virtualization, with all the upside of containerization and isolation. | ||
|
||
I'm doing this on a fresh installation of proxmox. My server is using a 7950x3D + a RTX 4090 PNY. Yes, overkill, it's a dual gaming/workstation/ML server that's rack-mounted. |
30 changes: 30 additions & 0 deletions
30
content/technology/programming/cpp/things-i-hate-about-cpp/basic-fstream.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
tags: | ||
- thoughts | ||
title: "`basic_fstream` will sometimes fail. And it won't tell you." | ||
--- | ||
I have a file that I'm streaming from a gRPC endpoint as stream of bytes (that could be of arbitrary size, but I aligned to 1024kb). I want to replicate those bytes on the filesystem. | ||
|
||
Easy enough, we have to open our file with `std::ios::binary` to indicate that we're dealing with binary data, that we don't want our file to treat any characters like they mean anything. I'll give you a `std::vector` of some data, it holds its size, you throw it in the file via `fstream::write`. Easy enough, shouldn't be any footguns, right??? | ||
|
||
Since they are bytes, I don't want to use `char` (ie `int8_t`) and instead use the standard `uint8_t` (which in more modern c++ versions, would be `std::byte`, but I'm working with c++14). Easy enough, I simply specialize `fstream` with the underlying `basic_fstream` as `basic_fstream<std::uint8_t>`. Right, right??? | ||
|
||
Alright, before I get into this stupid footgun, I also want to point out that gRPC represents the protobuf datatype `bytes` as a `std::string`. I can understand why they did this, technically, since a `std::string` is just a `const char*` with a little bit of metadata so we can store `\O` characters inside of it. It should probably be an `std::vector<uint8_t>` (or `std::byte`) to represent that it isn't text content, but whatever. [Here's an issue for this](https://github.com/protocolbuffers/protobuf/issues/5431). Just means we have to use a lot of nasty `reinterpret_cast`s. | ||
|
||
Anyways, here's something cool. If you attempt to write to open a given file as an `basic_ifstream<std::uint8_t>`, it works. The error bit isn't flipped. Now, if you attempt to write to it, it will fail. | ||
|
||
```cpp | ||
using binary_fstream = std::basic_ifstream<std::uint8_t>; | ||
|
||
binary_fstream file("binary.dat", std::ios::out | std::ios::in | std::ios::binary); | ||
if(file.good()) { | ||
std::cout << "Our file is good, why are you asking?" << std::endl; | ||
} | ||
|
||
std::vector<std::uint8_t> buffer = { ... } | ||
file.write(buffer.data(), static_cast<long>(buffer.size())); | ||
if(file.good()) { | ||
std::cout << "Our write totally suceeded, right?" << std::endl; | ||
} | ||
``` | ||
49 changes: 49 additions & 0 deletions
49
content/technology/programming/cpp/things-i-hate-about-cpp/destructive-moves.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
--- | ||
title: C++ doesn't have destructive moves. | ||
tags: | ||
- thoughts | ||
--- | ||
C++'s greatest innovation is RAII, "Resource Acquisition is Initialization." Despite its name, RAII has little to do with initialization, but rather destruction. In a RAII paradigm, an objects lifetime is tied to its scope, and its destructor is called when the scope ends. This is immensely helpful, as anyone who has seriously written C can tell you that a solid 90% of C code is just cleanup. | ||
|
||
Unfortunately, C++'s ability to be wrong about everything means that it also suffers a big footgun with the lack of destructive moves. | ||
|
||
Now, I'm gonna tell you the reason this surprised me is that I'm really used to Rust these days. The concept of a "non-destructive" move doesn't really make sense to me, since I'm used to move semantics... moving data. | ||
|
||
Here's a toy example of the problem: | ||
|
||
```cpp | ||
class MyVeryCoolObject { | ||
public: | ||
MyVeryCoolObject() { | ||
std::cout << "I am initialized!" << std::endl; | ||
} | ||
~MyVeryCoolObject() { | ||
std::cout << "I have been destroyed :(" << std::endl; | ||
} | ||
}; | ||
|
||
int main() { | ||
auto verycoolobject = MyVeryCoolObject(); | ||
{ | ||
auto coolerobject = std::move(verycoolobject); | ||
} | ||
return 0; | ||
} | ||
``` | ||
You may think the answer to this question is obvious: | ||
```bash | ||
I am intialized! | ||
I have been destroyed :( | ||
``` | ||
|
||
Since we moved the data, our `verycoolobject` no longer exists, its "guts" have been moved into the `coolerobject`. Then, at the end of the scope we created, `coolerobject`, which had the guts of the original object, will call its destructor. Then, at the end of the main block, since `myverycoolobject` is, uh, nothing, it will simply never call its destructor because it doesn't exist. Right. Right? | ||
|
||
Here's what it actually outputs, compiled with `Apple clang version 15.0.0 (clang-1500.3.9.4)`. | ||
|
||
``` | ||
I am intialized! | ||
I have been destroyed :( | ||
I have been destroyed :( | ||
``` |
3 changes: 3 additions & 0 deletions
3
content/technology/programming/cpp/things-i-hate-about-cpp/index.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
I really don't like c++. It was the first language I ever learned, at the ripe age of 13. I nearly gave up programming because of it. cpp reminds me a lot of english. Powerful, expressive, but none of it makes sense and there are so many footguns that I'm glad I have a few toes remaining. | ||
|
||
This is a running list of all the times cpp's stupid behavior has burnt me. |
10 changes: 10 additions & 0 deletions
10
content/technology/programming/javascript/why-so-many-config-formats?.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
title: Why does Javascript have so many config formats? | ||
tags: | ||
- thoughts | ||
--- | ||
I've been learning Typescript recently. And I'm astonished at how many freaking configuration files I need. | ||
|
||
Vite needs its own config file. Eslint needs its own configuration file. The configuration file formats aren't unified. Some of them are actual Javascript files, some of them are JSON files, some of them are YAML files. | ||
|
||
Python may have its issues, but at least the community has agreed to let `pyproject.toml` be the source of truth. Flake8 tried to play games and has been taken over by `ruff`. |