If you ever find yourself wondering whether your design is good enough, remember that because the Golang developers opposed generics so adamantly the Kubernetes community ended up with a code generation script (which has the templates defined as string literals and only seems to run in $GOPATH) that is being used to provide type safe client objects for every single API resource. Yikes!
I almost gave up on #adventofcode but day 20 was actually pretty fun. I'll have to give day 19 another try.
There are also other APIs that PyPI provides that pip probably uses. The problem is that you might not always be using PyPI. That's the case for me and my package index supports none of the fancy APIs. PEP 503 is the lowest common denominator and that's kind of what we're stuck with.
It's also worth mentioning that IIRC PyPI's APIs don't have full coverage of all packages. So with some, you might get complete information in an easily digestible format, with others some stuff might be missing.
I forgot PEP 503 does actually provide two kinds of metadata. One is a Python version constraint provided in the `data-requires-python` attribute of the HTML `a` element pointing to a specific file. There are also checksums of the files. Where? Of course in the fragment part of the URL pointing to the file (the part after `#`). That's it.
I imagine the only "standard" is what pip does for which you'd have to go digging through its sources and copy their implementation because they don't expose a function for parsing file names (or anything else for that matter).
Or you can try to guess how it works on your own. Because that's definitely how one should tackle this problem. By figuring out the pattern and parsing it with a half-assed regex, right? I mean, how else would you figure out which file to download?
Oh, and did I mention that the API is so bare that it doesn't even contain *any* metadata? Yes, really. It not only doesn't provide information about dependencies (you have to download the package for that) but also lacks version, format, and platform data! You have to extract that all from the file names and I've yet to see where that's standardized (there's https://www.python.org/dev/peps/pep-0625/ but it's just a draft and nobody follows it).
Try to make sense of this:
All that to download somewhere between a few KB and MB of data. So I need to do that manually but the package index API, while technically "simple" (it's in the name) requires me to parse HTML, which is slow and is really uncomfortable to do using the stdlib parser (or any other popular parser that I've seen).
Python's packaging is still a mess.
I need to download source distributions to later build them on a remote system. Python's package manager "pip" turns out to be useless for this. It has no programmatic API and can't solve this simple task even as a subprocess. Even when I request no dependencies of a package to be downloaded, its metadata will be collected which for source distributions means executing setup.py, which means installing build dependencies which means wasting a ton of time.
It's funny but #adventofcode is making me fix my sleeping schedule by having me wake up consistently at 6 am.
Anyway, it's the 7th time I'm participating, it's still the same old fun winter event. All my solutions eventually get posted on GitHub. I wonder how long I'll stick with it this time around (guessing about 15 days).
I found this some time ago and it's one of the few articles I've seen that look both at the good and bad parts of Go. It's a good read whether you like the language or not because it probably highlights some stuff you rarely think about.
It's a little outdated but it would be a shame not to link because it's rare to see something so objective.
I love reading about stuff like this. hackmud is mostly dead at this point and other similarly complex games (think EVE Online) are huge time sinks but I would love to one day experience a virtual world with such a breadth of human interaction.
I didn't realize there were so many alternative frontends for popular websites.
I love this approach. If you're not working with tools that make your job easier, then what are you doing?
Fascinating for two reasons - the bug is pretty unexpected but it also shows how essential it is to be able to modify systems you don't have physical access to.
I always thought variadic arguments in C were the weirdest thing and it turns out it's that way for a good reason:
(it's trying to preserve historic hacks if you haven't guessed it)
@michał at Hackerspace Pomorze (@hspsh)
Spokojna przystań dla hakerów, mejkerów, i wszelkiej maści kreatywnych i technicznych osób z okolic trójmiasta. Celem 0x3c.pl jest łączyć osoby zaangażowane w różne społeczności na terenie trójmiasta i pozwalać na wymianę wspólnych zainteresowań.