stonecharioteer
around the webs.

stonecharioteer
around the webs.
TLDR Protobufs are a mainstay of microservice development. You can use them in lieu of JSONs when interacting with a webservice. They’re much faster than JSON when you’re deserializing or serializing them. They’re designed mostly for applications that talk to each other. They’d make excellent choices for MCP-centric applications as well. Introduction I first heard about protobufs from a friend working at Gojek in 2017. I didn’t know what they were used for and even when I looked them up, I didn’t understand what I needed them for....
If you want to create an iterable of fixed length in Python, use collections.deque with the maxlen parameter. 1 2 3 4 5 6 7 8 9 10 import collections fixed_list = collections.deque(5*[None], 10) # this is now a fixed list of 10 items. # by appending more items, you'd be # dropping items from the beginning fixed_list.append(1) print(fixed_list) This is a short article, mostly to record something I see a lot of junior developers try to implement themselves....
There are a couple of ways to reverse a list in python: 1 2 3 4 5 my_list = [1,2,3,"apples","banana","fish","chicken"] reverse_list_one = my_list[::-1] reverse_list_one = reversed(my_list) reverse_list_zero = my_list reverse_list_zero.reverse() Of these three ways, I prefer using reversed because it is readable and there’s no ambiguity about whether it does it in place or not. It should be obvious to most people that .reverse() reverses a list in place, but I prefer the verbosity of the method that returns a reversed list....
I’m splitting my website into different subdomains. This one, https://tech.stonecharioteer.com will host all my posts on software and technology. I want separate themes for each portion of my website, and I figured subdomains will suit me best (for now). Housekeeping I’m using Hugo this time around. I’m still interested in using ReStructeredText over Markdown, but I’m trying to put out more content in the least-resistance possible, so for now, this works for me....