Posts

Showing posts with the label til

Headless Mac mini home setup

     Recently I got myself a new Macbook which is a lot more capable than my previous daily driver - an M2 Mac mini. But I didn't want to retire the old fellow, it's a very capable personal computer still and I don't think it's a bad idea to have a backup in case I lose the Macbook or have it damaged. Besides, there are some applications that I use which are mostly local and even though migrating the related files would be trivial, if I then lost the Macbook I'd lose them, or I'd have to setup a backup strategy. So I decided to keep them in the Mac mini and just use it whenever I needed them - a good excuse to have it turned it on, headless, instead of storing it away in a drawer, unused.      I hadn't done this before so I was a little concerned I might need to install dedicated software (which I'd have to trust with unrestricted access to my home computer) or fiddle with weird settings. I was wrong, fortunately, and modern MacOS makes this a breeze. Bu...

Signal boost: Voronoi diagrams with SciPy

Image
[Link] Voronoi diagrams with SciPy  I was a bit confused by SciPy's documentation for its Voronoi class and wondering how I could easily draw the "infinite" regions from the output. After getting a somewhat verbose answer from ChatGPT, I decided to Google the question and found Voronoi diagrams with SciPy , by Martin McBride , which solved my problem. The solution is not different in spirit to ChatGPT's but it's simpler in my mind, so I went with it. The idea is to add the points of a very far off bounding box, then simply ignore regions with -1 vertices.

JIT and GIL removal are not even my most anticipated Python 3.13 features

     Fun story: I came to Python through data analysis - so I wasn't a "python/programming expert" - and for an unreasonably long time used exclusively csv, parquet (thanks to pandas) and later JSON to persist data from my projects (local projects, of course. Mongo, RDS and Athena were always there). At work this was 100% enough (mostly parquet), but it always felt a little clunky to use JSON for a quick cache, especially when said cache grew larger for longer running processes or longer projects. Opening, parsing then serializing back again becomes slow surprisingly fast.      Then after a few years I decided to start using SQLite. I knew it existed, but always felt like it was a bit of a hassle to define a schema and "get" and "set" functions in all projects just to have a basic persistent k-v functionality. It was OK and had the extra benefit of allowing me to safely check this cache on a different jupyter notebook process when running longer proce...

Today I Learned: arsinh(x)

A few weeks ago I was looking for a function that would squeeze variables with large magnitude, but behaved like the identity function close to zero. After a couple of days without finding something that suited me, I gave up. Luckily for me, however, Kaiser Fung blogged a couple days ago about a weird scale used on an article and one of the commenters pointed out that arsinh(x) (that is, the inverse of the sinh(x) function) works like a "pseudo-log" (the poster themselves use this name for a different function described on the same comment), and best of all, fits my need for something close to the identity around zero. Talk about coincidences. Well, this post makes it public to the world that even after a whole Engineering degree and nearing 10 years in Statistics/ML, I had never studied nor used hyperbolic functions before. One day I'll find out why and where I should use sinh and cosh, but for today, adding arsinh(x) to my data visualization toolkit is enough. Click ...

Today I Learned - 2022-11-06

 Following the great advice I just read on https://simonwillison.net/2022/Nov/6/what-to-blog-about/ (thanks Hacker News for the pointer), I'll try to start posting TILs So, Today I Learned how to use tags on git