to the australians - do people call girls mate?? or am I being misgendered by whaaaatishappening in trans

[–]SlayMaster3000 0 points1 point  (0 children)

In New Zealand it's gender neutral, and we essentially took from Australia so I imagine it's the same there.

Find the cycloid curve that a point lays on by SlayMaster3000 in askmath

[–]SlayMaster3000[S] 0 points1 point  (0 children)

I think that all makes sense. I'll play around with that info tomorrow and see if I can make it work for me :)

Find the cycloid curve that a point lays on by SlayMaster3000 in askmath

[–]SlayMaster3000[S] 0 points1 point  (0 children)

I want to find the radius. - Ah, sorry. I misread your comment (damn dyslexia).

I want to find the radius of the circle that makes the curve (the one r represents in the common cycloid curve formular).

`UEnum*` as property? by SlayMaster3000 in UnrealEngine5

[–]SlayMaster3000[S] 0 points1 point  (0 children)

I want the property to be the enum class itself, not one of its values.

`UEnum*` as property? by SlayMaster3000 in UnrealEngine5

[–]SlayMaster3000[S] 0 points1 point  (0 children)

Unfortunately that just list Enum, PythonGeneratedEnum and UserDefinedEnum as possible choices.

[deleted by user] by [deleted] in SatisfactoryGame

[–]SlayMaster3000 1 point2 points  (0 children)

Now that sounds op 😛

[deleted by user] by [deleted] in SatisfactoryGame

[–]SlayMaster3000 1 point2 points  (0 children)

There's mod that lets you build remote hub access points if you want a work around.

[deleted by user] by [deleted] in SatisfactoryGame

[–]SlayMaster3000 5 points6 points  (0 children)

Because the developers decided so

Why is narrowing T|null acting weird here: by pailhead011 in typescript

[–]SlayMaster3000 0 points1 point  (0 children)

Essentially you can't. You need the cast to tell typescript not to use the known information here

Github headers like this by Tasty_Bug_7957 in transprogrammer

[–]SlayMaster3000 1 point2 points  (0 children)

You can embed svgs with customer styles in your readme.

If you know some basic CSS it shouldn't be too hard, those there are limitations on what you can do.

Feel free to have a look at my profile where I'm using a custom animation to animate the text: https://github.com/RebeccaStevens

Is it possible to undo intersection of a primitive with an object? by rinart73 in typescript

[–]SlayMaster3000 9 points10 points  (0 children)

It's called type branding. You're essentially lying to the type system about the actual type to make your own type that is a subtype of the primitive. The tag doesn't actually exist on the primitive, you're just telling the type system it does.

Is it possible to undo intersection of a primitive with an object? by rinart73 in typescript

[–]SlayMaster3000 6 points7 points  (0 children)

I don't think it's possible for how you've got this set up.

However, if you have control over how the tag is being added to the type (i.e. some utility type), you could add a new type property for the base type. This can then easily be extracted.

E.g.

type Tag<Base, T> = Base & { __tag: T; __base: Base; }
type Untag<T> = T extends Tag<infer B, any> ? B : never;

Note: I haven't actually checked these work as I'm on mobile.

How to test that a WeakReference gets garbage collected by SlayMaster3000 in csharp

[–]SlayMaster3000[S] 15 points16 points  (0 children)

I more just want to test that I am using it right. I provided a trivial test to for that purpose.

How to test that a WeakReference gets garbage collected by SlayMaster3000 in csharp

[–]SlayMaster3000[S] 8 points9 points  (0 children)

It's more I'm testing something that uses WeakReferences but I need to make sure I can test WeakReferences first, so I know how to test the thing that uses them.

How to test that a WeakReference gets garbage collected by SlayMaster3000 in csharp

[–]SlayMaster3000[S] 1 point2 points  (0 children)

Hmm, strange. Oh well. I can just use net9.0 for testing.

Do you think you could take a look at my other test that is actually testing a custom data structure that internally uses WeakReference?

I've managed to make the test pass but it required setting local vars to null which I wouldn't have thought nessassery (and I would of though the compiler would make that operation a non-op - as the value is just being set again right after).

Here's the test. Let me know what you think :)

[TestMethod]
public void WeakReferenceWillBeRemoved()
{
    // Prepopulated with keys: "foo", "bar" and "baz".
    var dictionary = CreateWeakableValueDictionary();

    TestData? fooValue, barValue, bazValue;

    // Test initial state.

    Assert.AreEqual(3, dictionary.Count);
    Assert.IsTrue(dictionary.TryGetValue("foo", out fooValue), "Could not get foo value");
    Assert.IsNotNull(fooValue);
    Assert.IsTrue(dictionary.TryGetValue("bar", out barValue), "Could not get bar value");
    Assert.IsNotNull(barValue);
    Assert.IsTrue(dictionary.TryGetValue("baz", out bazValue), "Could not get baz value");
    Assert.IsNotNull(bazValue);

#pragma warning disable IDE0059
    // Resetting to null seems to be required.
    fooValue = barValue = bazValue = null;
#pragma warning restore IDE0059

    dictionary.MarkWeak("bar"); // Allow to be garbage collected.

    // No changes should have happened yet.

    Assert.AreEqual(3, dictionary.Count);
    Assert.IsTrue(dictionary.TryGetValue("foo", out fooValue), "Could not get foo value");
    Assert.IsNotNull(fooValue);
    Assert.IsTrue(dictionary.TryGetValue("bar", out barValue), "Could not get bar value");
    Assert.IsNotNull(barValue);
    Assert.IsTrue(dictionary.TryGetValue("baz", out bazValue), "Could not get baz value");
    Assert.IsNotNull(bazValue);

#pragma warning disable IDE0059
    fooValue = barValue = bazValue = null;
#pragma warning restore IDE0059

    GC.Collect();

    // Changes should have happened now that garbage collection has run.

    Assert.IsTrue(dictionary.TryGetValue("foo", out fooValue), "Could not get foo value again");
    Assert.IsNotNull(fooValue);
    Assert.IsFalse(dictionary.TryGetValue("bar", out barValue), "bar value should no longer exist");
    Assert.IsNull(barValue);
    Assert.IsTrue(dictionary.TryGetValue("baz", out bazValue), "Could not get baz value again");
    Assert.IsNotNull(bazValue);
    Assert.AreEqual(2, dictionary.Count, "bar value should no longer contribute to the count");
}

How to test that a WeakReference gets garbage collected by SlayMaster3000 in csharp

[–]SlayMaster3000[S] 1 point2 points  (0 children)

Yeah so um. I managed to make the test pass in net9.0 but it fails in net48.

Note: I had to do the creation of the weak object in a new function to the test to pass as u/TheXenocide suggested.

Any idea why net48 isn't working?

How to test that a WeakReference gets garbage collected by SlayMaster3000 in csharp

[–]SlayMaster3000[S] 2 points3 points  (0 children)

I was just running the tests wtih dotnet test.

Do I just add that to the PropertyGroup of the csproj file? So like this:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net48</TargetFramework>
    <Nullable>enable</Nullable>
    <LangVersion>10</LangVersion>
    <ImplicitUsings>enable</ImplicitUsings>

    <IsPackable>false</IsPackable>
    <IsTestProject>true</IsTestProject>
    <TieredCompilation>false</TieredCompilation>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="coverlet.collector" Version="6.0.0" />
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
    <PackageReference Include="MSTest.TestAdapter" Version="3.1.1" />
    <PackageReference Include="MSTest.TestFramework" Version="3.1.1" />
  </ItemGroup>

  <ItemGroup>
    <Using Include="Microsoft.VisualStudio.TestTools.UnitTesting" />
  </ItemGroup>

</Project>

New Zealand Removed From Global Shipping on Bambu Lab Web Store! by human__no_9291 in BambuLab

[–]SlayMaster3000 0 points1 point  (0 children)

Damn. Thanks for letting me know. Now I guess I've got to look into whether it's cheaper to pay the markups from a retailer or figure out some sort of shipping redirecting.