• 2 Posts
  • 22 Comments
Joined 1 year ago
cake
Cake day: June 11th, 2023

help-circle


  • I’m assuming this is referring to JSO.

    https://en.m.wikipedia.org/wiki/Just_Stop_Oil

    Beginning on 1 April, they carried out England-wide blockades of ten critical oil facilities, intending to cut off the supply of petrol to South East England.[33][34][35]

    On 26 August, the group blocked seven petrol stations in Central London and vandalised fuel pumps. Forty-three people around London were arrested on suspicion of criminal damage.

    On 20 June, the protestors spray painted private jets at a private airfield at Stansted Airport. The group had been targeting a jet belonging to singer Taylor Swift, but could not locate it.[140]

    Yes, a lot of their protests are “awareness” stuff (basically none of which do actual damage. Unlike oil, actually!). No, it’s not just that. The UK isn’t an active warzone so bombing stuff is slightly more difficult to justify.








  • Having read a significant portion of the base WASM spec, it’s really quite a beautiful format. It’s well designed, clear, and very agnostic.

    I particularly like how sectioned it is, which allows different functions to be preloaded/parsed/whatever independently.

    It’s not perfect by any means; I personally find it has too many instructions, and the block-based control flow is… strange. But it fills a great niche as a standard low-level isolated programming layer.






  • I went with a completely different approach:

    ! iterate over our string. Whenever you hit a non-empty, check if the next N are also possible to be a # (N being the first element of our sequence) and that the N+1th isn’t a #. If they are, we can truncate the first N+1, the first element of our sequence, and recurse. If you hit a #, you know that the first element has to start here at the latest, so you can break. With this method, memoization is enough to get part 2 down to 25 ms. To make the memoization more efficient you can also truncate all the way up to the next non-empty when recursing. !<


    1. Setting up boilerplate beforehand, I only need to fill in the functions (and the return types)
    2. Really good parsing library (aoc_parse). Today my entire parsing code was parser!(lines(repeat_sep(i64, " ")))
    3. Iterators! Actually really ideal for AoC, where pipelines of data are really common. Today both the main part (sum of lines) and inner part (getting a vec of differences) can be done pretty easily through iterators

    Today was pretty ideal for my setup. In general I think Rust is really good for later days, because the safety and explicitness make small mistakes rarer (like if you get an element from a HashMap that doesn’t exist, you don’t get a None later down the road (unless you want it, in which case it’s explicit), you get an exception where it happened.

    I just really like Rust :3