Recent submissions

Comment · 1 year ago
It's been a long time since I've programmed Prolog so I'm not sure if these ideas are even relevant (global state might be more than enough!) ; but at first impressions from the readme this really reminds me of ETS

https://www.erlang.org/doc/apps/stdlib/ets.html

Essentially system-global state under named tables.

Have/did you consider having named `env` instances? This would allow for say, feature flags to be kept in a `features` set of relations.

You could also draw from Erlang's 'match specs' and query with a predicate over the keys.

Comment · 1 year ago
Comment · 1 year ago
They're probably using some features of LiveView; I'm not too familiar with how HTMX works, but with LiveView you can define all of your logic and state handling on the _backend_, with page diffs pushed to the client over a websocket channel (all handled out of the box).

It comes with some tradeoffs compared to fully client-side state, but it's a really comfortable paradigm to program in, especially if you're not from a frontend background, and really clicks with the wider Elixir/Erlang problem solving approach.

https://hexdocs.pm/phoenix_live_view/js-interop.html#handlin...

Hooks let you do things like have your DOM update live, but then layer on some JS in response.

For example you could define a custom `<chart>` component, which is inserted into the DOM with `data-points=[...]`, and have a hook then 'hydrate' it with e.g. a D3 or VegaLite plot.

Since Phoenix/LiveView is handling the state, your JS needs only be concerned about that last-mile JS integration; no need to pair it with another virtual DOM / state management system.

https://hexdocs.pm/phoenix_live_view/js-interop.html#client-...

Comment · 1 year ago
Comment · 1 year ago
I've heard of domain fronting, where you host something on a subdomain of a large provider like Azure or Amazon. Is this what you're talking about when you say

> - Host on a piece of infrastructure that's so big that you can't effectively block it without causing a major internet outage (think: S3, Cloudflare R2, etc).

How can one bounce VPN traffic through S3? Or are you just talking about hosting client software, ingress IP address lists, etc?

Comment · 1 year ago
Comment · 1 year ago
Agreed - updated with colour again
Comment · 1 year ago
It’s not the most accessible colour scheme - I’ll have a look and tweak it so dark mode is more readable.

I’d definitely be really grateful for help with that! I’m not planning to publish to the Mac App Store, but it would be great to have the build step a bit more compliant with current practises.

Comment · 1 year ago
Since going down this rabbit hole, I gave Anki another fair shot and actually RTFM :) the blog post warrants an update

https://docs.ankiweb.net/deck-options.html#learning-steps Details what _actually happens_ when you pick again/hard/good etc. I much prefer understanding this to the vibes-based approach of “did you pause before answering”.

Secondly turns out you can indeed very easily set up type-to-answer in a deck by editing the front template and adding

{type:Field}

where field is the answer part of the card’s data.

So… I’m actually using Anki again. I’m still very happy I did this, it was a fun little journey!

Comment · 1 year ago
I have been bedroom DJing, and wanting to expand what I can do with the hardware I already have.

Using `midiex` for Elixir I’ve written a fully fledged driver for Ableton Push, letting me use it as essentially a 4-deck version of Pioneer’s DDJ-XP2 sub controller with Rekordbox.

It implements basic statefulness so that the rotary encoders can be used, as well as a paging system so the 64 performance pads can be mapped to different functions. It also supports track browsing and loading, which is helpful if you want to use say DVS with an external mixer and don’t want to be hunched over a laptop dragging tracks around.

It’s also got some additional capabilities which I’ve not seen on other hardware like dedicated faders for stem separation levels.

It’s been a great exercise in combing two hobbies, learning about MIDI as well as being able to personalise my setup for my own use. I haven’t open sourced any of it just yet whilst I’m still tweaking things but I’d be interested in collaborating with anyone who also has one of these devices and has programmed it. I’m looking to use the display on it next, whose protocol Ableton have some (albeit scant) documentation for.

Comment · 1 year ago
This isn’t exactly the case. The camera has an actuating mirror on the end of the rotating arm that allows it to point at arbitrary angles.

https://youtu.be/aXfTgCCsRSg (T=4:30)

The emulating different lenses part is that with this setup you can parametrically collect specific rays bouncing off the object (presumably the angle of the mirror with respect to radius), and the resulting image will be the same as you’d get from a lens with those parameters.

Comment · 1 year ago

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton