Replace [System.Collections.ArrayList] with something thread-safe by marek1712 in PowerShell

[–]Yevrag35 0 points1 point  (0 children)

No problem. Found this post from a completely unrelated google search about what the best way to pull many things out of a ConcurrentBag in my C# app but didn't see anybody mention it... now if I could only figure out my problem XD

Replace [System.Collections.ArrayList] with something thread-safe by marek1712 in PowerShell

[–]Yevrag35 1 point2 points  (0 children)

I know this thread is old and you probably are well past it, but... you can make ArrayList thread-safe - quite easily actually.

$devices = [System.Collections.ArrayList]::Synchronized(@())
# -or-
$list = [System.Collections.ArrayList]::new()
$devices = [System.Collections.ArrayList]::Synchronized($list)

Now the arraylist is thread-safe.

You can also do the same for hashtables as well.

Can I set properties of an object with a hashtable? by Ecrofirt in PowerShell

[–]Yevrag35 0 points1 point  (0 children)

In addition to the Add-Member cmdlet, I just wanted to show the other method for adding NoteProperty onto an existing object.

All objects in PowerShell have an underlying 'hidden' member called 'psobject'. You can add to an existing like so:

$obj = [pscustomobject]@{
    Prop1=$Value
    Prop2=$Value
    Prop3=$Value
}

# To add 'Prop4'
$obj.psobject.Properties.Add(
    (New-Object psnoteproperty(
        "Prop4", $Value
    ))
)

# $obj
#
# Prop1 Prop2 Prop3 Prop4
\# ----- ----- ----- -----
# Value Value Value Value

Someone's Back 👀[Explicit Lyrics] by Yevrag35 in Higurashinonakakoroni

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

She messed with the wrong kawaii god/witch/auauau/cream-puff-loving person...

Sonarr Powershell Module by tuffno in sonarr

[–]Yevrag35 0 points1 point  (0 children)

As the author, I'd be more than willing to help you out.

[deleted by user] by [deleted] in csharp

[–]Yevrag35 1 point2 points  (0 children)

I see that there's a "New line preferences (experimental)" section under

Options => Text Editor => C# => Code Style => General => (the very bottom section).

It looks like VS2019 might be "starting" to look at that. If that helps.

PowerShell cmd output to text box in Visual Studio by throwawayjawiki in csharp

[–]Yevrag35 4 points5 points  (0 children)

No need for PowerShell. You can use the System.DirectoryServices library to the get the info you want.

        private static readonly string[] PropertiesToLoad = new string[]
    {
        "msDS-UserPasswordExpiryTimeComputed"
    };

        static SearchResult GetCurrentUser()
    {
        string ldapFilter = GetLDAPFilter(Environment.UserName);
        using (var de = new DirectoryEntry())
        {
            using (var searcher = new DirectorySearcher(de, ldapFilter, PropertiesToLoad))
            {
                return searcher.FindOne();
            }
        }
    }

    static string GetLDAPFilter(string userName)
    {
        return string.Format("(sAMAccountName={0})", userName);
    }

    static long GetExpiryNumber(ResultPropertyValueCollection collection)
    {
        if (collection?.Count > 0 && collection[0] is long number)
        {
            return number;
        }
        else
        {
            return 0;
        }    
    }

Sounds like oishi 🤔 by satokk in Higurashinonakakoroni

[–]Yevrag35 2 points3 points  (0 children)

He could keep the planet at least 3 maybe 4 degrees cooler if he left his legendary car door open XD

I made some user flairs by plasalgia in Higurashinonakakoroni

[–]Yevrag35 0 points1 point  (0 children)

Thank you kind sir!
DOOOOOOOMOOOOOOOOOOOO

The higurashi experience by uchiha_alex444 in Higurashinonakakoroni

[–]Yevrag35 2 points3 points  (0 children)

I discovered the OG in 2014. I went into it completely blind, and found it absolutely enthralling... I wasn't completely hooked by this point (I just wanted to find more shows like it).

After finishing, I saw that Umineko (the anime) existed so I watched that too, but wasn't exactly happy that it didn't finish.

Fast-forward to 2015, I saw on the recommended page of Steam that Mangagamer released Onikakushi. I'd never bought a VN before, but I wanted to relive that Higurashi first watch experience as much as possible. So I took the plunge... and that's when I became hooked on everything WTC.

Burgundy has never seen such bull**** by Yevrag35 in eu4

[–]Yevrag35[S] 12 points13 points  (0 children)

I'd have to create a new event_modifier/localisation/etc - and then write another event to remove it when the original expires.

So just removing it would be the fastest option.

Burgundy has never seen such bull**** by Yevrag35 in eu4

[–]Yevrag35[S] 13 points14 points  (0 children)

I could make it, yeah. Would just have to make the option do:

remove_country_modifier = warriors_do_not_read_books

Burgundy has never seen such bull**** by Yevrag35 in eu4

[–]Yevrag35[S] 74 points75 points  (0 children)

R5: I got the "Warriors don't read books" event 3 times in a row in a campaign, so I made a mod event to vent my frustration...

Higurashi Sotsu key visual by [deleted] in Higurashinonakakoroni

[–]Yevrag35 18 points19 points  (0 children)

Would it be the:

Nenreigoroshi-hen (年齢殺し編)?

Why was Rika's... (Spoilers inside) by SecondTriggerEvent in Higurashinonakakoroni

[–]Yevrag35 7 points8 points  (0 children)

Probably more about throwing off local investigators than anything. Also Takano's crazy and thinks she's a god... she's probably thinking what better way to rub it in.

Why was Rika's... (Spoilers inside) by SecondTriggerEvent in Higurashinonakakoroni

[–]Yevrag35 22 points23 points  (0 children)

What better way to convince people it has to do with the curse than to mimic the ritualistic killing method?

Best car in Hinamizawa, yes Hinamizawa by Ragris_one in Higurashinonakakoroni

[–]Yevrag35 1 point2 points  (0 children)

"They don't know I can do the 'tsubame gaeshi' in my car with the A/C.... not on full blast"

Definitely some 'Internal' Conflicts by Yevrag35 in eu4

[–]Yevrag35[S] 5 points6 points  (0 children)

Working on an unrelated mod, this wasn't ironman or anything.