RagingHungryPanda

joined 2 years ago
[–] RagingHungryPanda@lemm.ee 3 points 1 month ago

site blocked for work, but are they actually thrilled or "fucking thrilled"? haha

[–] RagingHungryPanda@lemm.ee 1 points 1 month ago* (last edited 1 month ago)

I've got a "smart" solution and a really dumb one. I'll start with the smart one (incomplete but you can infer). I did four different ways to try to get it faster, less memory, etc.

// this is from a nuget package. My Mathy roommate told me this was a topological sort.
// It's also my preferred, since it'd perform better on larger data sets.
return lines
    .AsParallel()
    .Where(line => !IsInOrder(GetSoonestOccurrences(line), aggregateRules))
    .Sum(line => line.StableOrderTopologicallyBy(
            getDependencies: page =>
                aggregateRules.TryGetValue(page, out var mustPreceed) ? mustPreceed.Intersect(line) : Enumerable.Empty<Page>())
        .Middle()
    );

The dumb solution. These comparisons aren't fully transitive. I can't believe it works.

public static SortedSet<Page> Sort3(Page[] line,
    Dictionary<Page, System.Collections.Generic.HashSet<Page>> rules)
{
    // how the hell is this working?
    var sorted = new SortedSet<Page>(new Sort3Comparer(rules));
    foreach (var page in line)
        sorted.Add(page);
    return sorted;
}

public static Page[] OrderBy(Page[] line, Dictionary<Page, System.Collections.Generic.HashSet<Page>> rules)
{
    return line.OrderBy(identity, new Sort3Comparer(rules)).ToArray();
}

sealed class Sort3Comparer : IComparer<Page>
{
    private readonly Dictionary<Page, System.Collections.Generic.HashSet<Page>> _rules;

    public Sort3Comparer(Dictionary<Page, System.Collections.Generic.HashSet<Page>> rules) => _rules = rules;

    public int Compare(Page x, Page y)
    {
        if (_rules.TryGetValue(x, out var xrules))
        {
            if (xrules.Contains(y))
                return -1;
        }

        if (_rules.TryGetValue(y, out var yrules))
        {
            if (yrules.Contains(x))
                return 1;
        }

        return 0;
    }
}
Method Mean Error StdDev Gen0 Gen1 Allocated
Part2_UsingList (literally just Insert) 660.3 us 12.87 us 23.20 us 187.5000 35.1563 1144.86 KB
Part2_TrackLinkedList (wrong now) 1,559.7 us 6.91 us 6.46 us 128.9063 21.4844 795.03 KB
Part2_TopologicalSort 732.3 us 13.97 us 16.09 us 285.1563 61.5234 1718.36 KB
Part2_SortedSet 309.1 us 4.13 us 3.45 us 54.1992 10.2539 328.97 KB
Part2_OrderBy 304.5 us 6.09 us 9.11 us 48.8281 7.8125 301.29 KB
[–] RagingHungryPanda@lemm.ee 2 points 1 month ago

I'm trying F#. I normally work in C# with LanguageExt to make C# more functional.

[–] RagingHungryPanda@lemm.ee 5 points 2 months ago

another option is to have an epub version of it that you can load into a reader. you should be able to add bookmarks etc. It might not be as feature-rich as an app, but if you want privacy, it's about as close to reading a book as you're going to get.

[–] RagingHungryPanda@lemm.ee 9 points 2 months ago

CVS's is still there

Care Source, BCBS redirects you to the home screen

Molina it's under the corporate governance. I don't know if they took it off the leadership page or not since the page is there and the site is pretty bad overall.

[–] RagingHungryPanda@lemm.ee 29 points 2 months ago (8 children)

Dear gen Z, raw dog means to fuck without a condom

[–] RagingHungryPanda@lemm.ee 35 points 2 months ago (1 children)

I recently started reading the Left Hand of Darkness by Ursula K. le Guin and the main feature is a people who regularly change gender or have none at all. The MC is human and they call him a pervert because he never changes.

[–] RagingHungryPanda@lemm.ee 2 points 2 months ago* (last edited 2 months ago)

This never became a real language, but years ago Microsoft Research work on Project Midori, an attempt to make a managed programming language suitable for an operating, and the operating system to go with it. It was based off of C# and heavily modified. Joe Duffy at Microsoft Research wrote some good blogs on it, about approaches they took and why, problems they ran in to, etc.

https://joeduffyblog.com/2015/11/03/blogging-about-midori/

[–] RagingHungryPanda@lemm.ee 2 points 2 months ago

Niiiiiiiiiice! 👍 I think the satisfactory posts have been my favorites

[–] RagingHungryPanda@lemm.ee 15 points 2 months ago

Taxes are usually taken out using the monthly amount like a yearly amount. You'll probably get a lot of it back when you pay taxes for the year.

view more: ‹ prev next ›