SteveDinn

joined 2 years ago
[–] SteveDinn@lemmy.ca 46 points 1 day ago (1 children)

I'm no international law expert but I don't think that follows the Geneva convention.

[–] SteveDinn@lemmy.ca 5 points 1 week ago

Exactly my feelings when I heard "Smells Like Teen Spirit" called "classic rock" a few years ago.

[–] SteveDinn@lemmy.ca 5 points 3 weeks ago

Create a docker container without explicitly naming it. Job done.

[–] SteveDinn@lemmy.ca 7 points 3 weeks ago

Has anyone here installed friendica? I tried to give it a go yesterday with the the docker image. The login page is showing up, but it is giving me HTTP 500 errors when I click sign up I also get no errors in any logs.

 

[copied from Deluan's Reddit post]

This is a call for general testing of the next version of Navidrome. Don't do it if you don't feel like trying cutting edge software, things may break. Here are the steps to upgrade.

First things first: CREATE A BACKUP OF YOUR DATABASE (navidrome.db*).

Upgrade to the BFR version:

Docker: use the label ghcr.io/navidrome/navidrome:pr-2709

Binaries for non-docker installations are available here - NOTE: Windows versions are not working at the moment.

Start Navidrome. It will automatically upgrade your database schema, and run a full scan. This may take a while, wait until it finishes.

Profit! If you find any issues, please report them here.

[–] SteveDinn@lemmy.ca 9 points 3 weeks ago* (last edited 3 weeks ago)
[–] SteveDinn@lemmy.ca 1 points 4 weeks ago* (last edited 4 weeks ago) (1 children)

A person's state becomes the name of the zone when they're in them.

In the current version of Home Assistant, if a person is in two overlapping zones, what happens? It's possible to be in that state today.

I suppose it doesn't really matter though. I've named all my home zones similarly: home1, home2, etc. It would be easy enough to check for a zone where the object_id starts with "home"

[–] SteveDinn@lemmy.ca 1 points 4 weeks ago (1 children)

I...honestly thought I just did that. I want to have an irregularly-shaped zone. I don't see why they couldn't logically be grouped, you just aren't able to do it right now.

Anyway, thanks for reading what I typed.

[–] SteveDinn@lemmy.ca 2 points 4 weeks ago (3 children)

I am pretty sure I'm not confused. I want to group zones together so they can be used in automation triggers and I can change the group's membership and not have to change every automation trigger. The group's state should indicate the number of person entities that were in any zone in the group.

I'm not talking about areas at all.

Just to be clear, I don't believe grouping zones is currently possible. It's just a want I have.

[–] SteveDinn@lemmy.ca 1 points 4 weeks ago (1 children)

You don't get the choice to use more than one zone as your official "home" zone though, do you?

[–] SteveDinn@lemmy.ca 2 points 4 weeks ago* (last edited 4 weeks ago) (5 children)

Like when you create a zone, it's a circle. It has a radius. I want a zone that is an arbitrary shape, so I compose it out of several smaller zones. I want to formally make it a single zone in Home Assistant by grouping them. Currently you can't add zones to groups or create a zone with type: group or anything like that.

 

Is there any way to group zones together? I would like to define zones that are not necessarily circular in shape. I can accomplish what I want by overlapping several of them, but I really want to group them together and treat them as one zone. Is this possible?

I suppose I could probably script up a template trigger...

[–] SteveDinn@lemmy.ca 2 points 1 month ago

This is the way. Web client to MPV Shim for local playback.

[–] SteveDinn@lemmy.ca 2 points 2 months ago

C#

Part 2 was pretty much the same as Part 2 except we can't short-circuit when we find the first match. So, implement a cache of each sub-pattern and the number of ways to form it from the towels, and things get much faster.

using System.Collections.Immutable;
using System.Diagnostics;
using Common;

namespace Day19;

static class Program
{
    static void Main()
    {
        var start = Stopwatch.GetTimestamp();

        var sampleInput = ReceiveInput("sample.txt");
        var programInput = ReceiveInput("input.txt");

        Console.WriteLine($"Part 1 sample: {Part1(sampleInput)}");
        Console.WriteLine($"Part 1 input: {Part1(programInput)}");

        Console.WriteLine($"Part 2 sample: {Part2(sampleInput)}");
        Console.WriteLine($"Part 2 input: {Part2(programInput)}");

        Console.WriteLine($"That took about {Stopwatch.GetElapsedTime(start)}");
    }

    static object Part1(Input input)
    {
        return input.Patterns
            .Select(p => AnyTowelMatches(p, input.Towels) ? 1 : 0)
            .Sum();
    }

    static object Part2(Input input)
    {
        var matchCache = new Dictionary<string, long>();
        return input.Patterns
            .Select(p => CountTowelMatches(p, input.Towels, matchCache))
            .Sum();
    }

    private static bool AnyTowelMatches(
        string pattern,
        ImmutableArray<string> towels)
    {
        return towels
            .Where(t => t.Length <= pattern.Length)
            .Select(t =>
                !pattern.StartsWith(t) ? false :
                (pattern.Length == t.Length) ? true :
                AnyTowelMatches(pattern.Substring(t.Length), towels))
            .Any(r => r);
    }

    private static long CountTowelMatches(
        string pattern,
        ImmutableArray<string> towels,
        Dictionary<string, long> matchCache)
    {
        if (matchCache.TryGetValue(pattern, out var count)) return count;

        count = towels
            .Where(t => t.Length <= pattern.Length)
            .Select(t => 
                !pattern.StartsWith(t) ? 0 :
                (pattern.Length == t.Length) ? 1 :
                CountTowelMatches(pattern.Substring(t.Length), towels, matchCache))
            .Sum();

        matchCache[pattern] = count;
        return count;
    }

    static Input ReceiveInput(string file)
    {
        using var reader = new StreamReader(file);

        var towels = reader.ReadLine()!.SplitAndTrim(',').ToImmutableArray();
        var patterns = new List<string>();
        reader.ReadLine();
        var line = reader.ReadLine();
        while (line is not null)
        {
            patterns.Add(line);
            line = reader.ReadLine();
        }

        return new Input()
        {
            Towels = towels,
            Patterns = [..patterns],
        };
    }

    public class Input
    {
        public required ImmutableArray<string> Towels { get; init; }
        public required ImmutableArray<string> Patterns { get; init; }
    }
}
 

I recently added some files to my Jellyfin instance, and some of them had their metadata scraped incorrectly. This was no big deal, they weren't named very well. These files ended up being displayed in a "Season Unknown" season of the show. So I fixed the names, and the files' metadata was corrected automatically. However, the "Season Unknown" remained, with no media displaying in it. I can't figure out how to get rid of it. Anyone have any ideas?

view more: next ›