Electronics
I’m working on a CPU/GPU readout for my PC. So far it’s been a week of on-and-off soldering and handwiring and tinkering with this Arduino Nano clone, seven segment displays, and shift registers, for something one could probably find on Aliexpress for less than $10.
I mean, that’s not the point though. Neither is the coding part or the learning how electronics work, really. On paper this is pretty much a waste of time and money. I enjoy it though. It’s a great intersection between my love of technology and my love of craft. A successful solder joint gives me the same feeling as a good plane shaving. In this case though, it’s an additive process as opposed to subtractive. Instead of carving material off, you’re adding metal and silicon to your project, and you can feel the board getting physically heavier as you go along.
The handwiring bit is a carryover from my time spent building keyboards from scratch. For some reason I’ve come to enjoy working with magnet wire, thanks to my custom tool, which is actually just an Xacto knife with half the blade snapped off. I use it to carefully scrape off the enamel insulation. I find this better than working with plastic/rubber insulated wire, which tends to melt, shrink, crumble, etc. Also, the negligible thickness of the insulation means the wires take up way less space, so I can cross wires over a lot more before having to resort to creative wire routing.
Mostly, the shiny red wire is pretty and reminds me of a nervous system.
The hardware is all set up and appears to be working OK (with no magical smoke), but the digits are not showing up in order.
Raytracing
I was lamenting on Discord about having never found an on-ramp for linear algebra despite learning it several times over, and someone recommended The Ray Tracer Challenge by Jamis Buck.
It starts all the way from the bottom, from tuples to points and vectors and matrices, but doesn’t really get bogged down in the math a whole lot, which was what the entirety of linear algebra was like for me through high school and college. I even somehow slogged my way through a computer graphics class in college that probably followed the same curriculum in this book. By the time we got to any actual graphics work in that class, I was already mentally checked out having had to hand-compute matrix products and determinants. Not to mention, the class was held in C for a program that was taught primarily in Java.
However, Buck moves with a quick “let’s just go through this once and move on” pace and doesn’t take his time getting to why all these concepts are useful. This time around, I’ll be writing in Python. In addition, rather than implementing all the transformations by the book, I’m just going to take advantage of the power of NumPy, another thing I hadn’t really gotten too deeply into for lack of practical applications.
I swear, once I make it all the way through this book, I’ll come back and do a few more of these by hand, but for now this stuff is actually pretty exciting and I have made my first computer-generated image file since college:
def projectiles():
height = 400
width = 400
canvas = np.zeros((height, width, 3))
for magnitude in range(4,100):
start = np.array((0,1,0))
velocity = np.array((1,1.8,0))
velocity = (velocity / np.linalg.norm(velocity)) * magnitude* .2
p_pos = start
p_vel = velocity
env_grav = np.array((0,-0.1,0))
env_wind = np.array((-0.04, 0, 0))
while p_pos[0] >= 0:
#tick
p_pos = p_pos + p_vel
p_vel = p_vel + env_grav + env_wind
#print(p_pos)
ppm.write_pixel(canvas, int(p_pos[0]), height - int(p_pos[1]), ppm.RED)
ppm.write_ppm(canvas, "projectile.ppm")
Anyway, that was just for outputting 2D files. I’m still working my way through 4x4 matrices before I get to the fun 3D stuff.
Also I did write the file output myself. The book works in PPM files, which are just plain text files, and quite handy for debugging.
Learning 2
Hello, I have come to collect my six figures, please.
Learning
So I decided it’s finally time to learn what machine learning is all about. If my eGPU isn’t going to be any good for games, I might as well put it to use for something, and here we are.
I came across Google’s intro to ML stuff and got started on that. Turns out, according to Google all you need are:
- A solid knowledge of Python
- Basic programming skils
I’m not sure how you’d have the former without the latter, but I guess I consider myself close enough to both. I always imagined the requirements being more along the lines of:
- Access to a bunch of noisy hot things in a data center
- Strong programming skills
- A solid grasp of linear algebra, maybe some sort of degree.
I have none of these, but at this point I’ve decided I usually have the most fun diving into something without any actual research, and hope to find out along the way.
It’s already paying off because I’ve finally installed and used Conda for the first time. At first I installed Anaconda, and learned that Anaconda is a whole suite of stuff I probably won’t be using any time soon, so I removed it and installed Miniconda instead. So far, as a single user with a very small development footprint, it hasn’t proven to be any different from my usual Python usage, except it’s conda install
instead of pip install
.
Nothing
Another span of time has elapsed between “TGIF” and “Well, I guess it’s time to get ready for work tomorrow.”
I was a little bummed because it felt like I hadn’t moved my life in any particular direction. That’s not to say that nothing happened, but let’s just say it was a weekend about nothing.
The supermarket was out of bread so I made some bread. I finally got to use the batard banneton I got in Copenhagen over the summer.
I rebuilt this corner of this hunk of piano so that eventually I can make a bench out of it. Now I need to do the other corner and it feels like this project hasn’t even started yet in spite of the hours I’ve put in so far.
We made some weird cupcakes. I accidentally overfilled the pan for a few of these and they had these funny duckbill shapes on top and we decided that just made more surface area for frosting and sprinkles.
I jumped into the retro console emulation scene. It started as a hankering to play Metal Gear Acid again, and turned into learning how to use VirtualBox to spin up a VM just to run this Windows-only flash utility to shoehorn Chrono Trigger into this SNES Classic I bought on impulse a while back and never really touched afterwards.
This is actually great because I’d never really touched hardware virtualization before for lack of necessity. I totally skipped straight to Kubernetes and Docker, and kind of felt like I was floating around without a foundation for a while until now. Now I have a true appreciation for not having to create an entire operating system in a bottle just to run a single stubborn program.
Till now it had been just another case of a how without a why.
In any case, this is a great opportunity to remind myself of why my resolution for this year was to write more. I’ve been feeling very adrift and directionless lately. I go to bed on Sunday nights in a panic that I hadn’t made good enough use of my weekend. I worry because I don’t feel any closer to anything for all the free time that had passed – time that I alone am responsible for and could use to maximum effect if I so pleased, and in the end I feel like I’ve gone nowhere, when in fact I’ve gone everywhere and back.
Writing is documenting, and I’m better with fact than fiction. I need to write more just so that I can show myself that, actually, things are different than they were on Friday.