Programming Leftovers
-
Andrew Kelley ☛ Zig's New CLI Progress Bar Explained
Sometimes, programming projects are too easy and boring. Sometimes, they're too hard, never ending or producing subpar results.
This past week I had the pleasure of completing a project that felt like maximum difficulty - only possible because I am at the top of my game, using a programming language designed for making perfect software. This problem threw everything it had at me, but I rose to the challenge and emerged victorious.
-
Rlang ☛ Run a specific code block in R
Run a specific code block in R, We will cover the basic syntax and definitions of the switch function, as well as two examples of how to apply it.
-
Python
-
University of Toronto ☛ PyPy has been quietly working for me for several years now
A number of years ago I switched to installing various Python programs through pipx so that each of them got their own automatically managed virtual environment, rather than me having to wrestle with various issues from alternate approaches. On our Ubuntu servers, it wound up being simpler to do this using my own version of PyPy instead of Ubuntu's CPython, for various reasons. I've been operating this way for long enough that I didn't really remember how long.
-
James G ☛ Announcing nanosearch, a Python package for making small search engines
In my notes, I wrote down an idea for "tiny search engines." I wish there were more search engines for small communities that index websites that matter to them. I wish I could make a small search engine of a handful of sites relevant to a particular topic that I can use and share with others.
To enable more search engines, it needs to be easier to make a search engine. I have spent a lot of time thinking about search in the past and have found many rabbit holes into which one can fall. You can spend weeks learning about crawling, indexing, ranking algorithms, data storage, link graphs, and more. There is so much to learn, but you don't need much to make a small search engine for a few websites.
-
James G ☛ Build a local web search engine with two commands
Nanosearch is a Python package for creating small search engines. Nanosearch can crawl a list of URLs you provide, or the URLs in a sitemap, and generates an index through which you can search with TF/IDF or BM25, two popular ranking algorithms.
In the Nanosearch introduction post, I noted that you can create a search engine with a few lines of code. I wanted to extend the idea of getting a search engine up quickly by adding a command line interface to Nanosearch. Now, you can run a single command to build a search engine using all of the URLs in a sitemap.
-