Skip to content

Instantly share code, notes, and snippets.

View dwcullop's full-sized avatar
💭
01010011 01101111 01101101 01100101 01110100 01101000 01101001 01101110 01100111

Darrin W. Cullop dwcullop

💭
01010011 01101111 01101101 01100101 01110100 01101000 01101001 01101110 01100111
View GitHub Profile
@dwcullop
dwcullop / Bitset.cs
Created August 2, 2026 18:03
DynamicData: Bitset.cs + BitsetFixture.cs, archived before removal. Superseded by the arrival-order queue in SharedDeliveryQueue.
// Copyright (c) 2011-2025 Roland Pheasant. All rights reserved.
// Roland Pheasant licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.
#if NETCOREAPP3_0_OR_GREATER
using System.Numerics;
#endif
using System.Runtime.CompilerServices;
namespace DynamicData.Internal;
@dwcullop
dwcullop / App__App.xaml.cs
Last active July 29, 2026 03:38
Repro: IBackgroundTaskInstance.TriggerDetails loses its payload when a WinAppSDK background task is forwarded to an out-of-process COM server (DeviceWatcherTrigger, Windows 11 26100)
using Microsoft.UI.Dispatching;
using Microsoft.UI.Xaml;
namespace TriggerDetailsRepro;
public partial class App : Application
{
/// <summary>
/// Matches Package.appxmanifest -&gt; com:ExeServer Arguments.
/// </summary>
@dwcullop
dwcullop / CrossCacheDeadlock.cs
Last active June 22, 2026 19:26
DynamicData cross-cache deadlock — minimal self-contained reproduction (deadlocks on published 9.4.31)
#:package DynamicData@9.4.31
// ---------------------------------------------------------------------------
// DynamicData cross-cache deadlock: minimal reproduction
//
// Run with .NET 10+ SDK: dotnet run CrossCacheDeadlock.cs
//
// Two SourceCaches feed each other. Two threads edit them at the same time.
// On the current published DynamicData (9.4.31 and earlier) a SourceCache holds
// its internal lock for the *entire* synchronous downstream delivery of a
@dwcullop
dwcullop / Program.cs
Created June 14, 2026 09:04
ReactiveUI.Binding PropertyObservable<T>.Subscription constructor races its initial emit against PropertyChanged, producing duplicate emissions under distinctUntilChanged=true (verified vs 3.4.0)
using System.ComponentModel;
using System.Globalization;
using ReactiveUI.Binding.Observables;
const int iterations = 5_000;
const int mutationsPerIteration = 32;
var firstFailure = -1;
List<string?>? firstFailureSequence = null;
string? firstFailurePropertyAtEnd = null;
@dwcullop
dwcullop / Program.cs
Last active June 13, 2026 23:07
ReactiveUI WhenAnyValue silently drops PropertyChanged events between initial read and handler attach (verified vs 23.2.28)
using System.ComponentModel;
using ReactiveUI;
using ReactiveUI.Builder;
// ReactiveUI 23.x requires explicit builder initialization before its mixins are usable.
// For a console-only repro we only need the core services -- WithPlatformServices() lives
// in platform packages (WPF, WinUI, Maui, ...) and is not needed here.
RxAppBuilder.CreateReactiveUIBuilder()
.WithCoreServices()
.BuildApp();
@dwcullop
dwcullop / FileSystemObservable.cs
Created January 3, 2024 01:18
Represent the file system as an Observable ChangeSet
using System.Reactive.Disposables;
using System.Reactive.Linq;
using DynamicData;
namespace DareWare.Utils;
public static class FileSystemObservable
{
public static IObservable<IChangeSet<FileSystemInfo, string>> Create(string path, string filter, bool includeSubDirectories, bool includeError = true) =>
Observable.Create<IChangeSet<FileSystemInfo, string>>(observer =>
@dwcullop
dwcullop / FormatString.h
Created August 2, 2021 23:00
Easy, Old School Printf-Style Formatting for std::string and std::wstring
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// FormatString.h : Standard String Formatting Support
//
// Author Name :
// Darrin W. Cullop (darrin.cullop@outlook.com)
//
// License :
// CC-BY 4.0 (https://creativecommons.org/licenses/by/4.0/)
//
// Abstract :
@dwcullop
dwcullop / DebuggingHelpers.h
Last active August 2, 2021 21:05
Debug Logging on Windows in Modern C++
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// DebuggingHelpers.h : Debug Logging on Windows in Modern C++
//
// Author Name :
// Darrin W. Cullop (darrin.cullop@outlook.com)
//
// License :
// CC-BY 4.0 (https://creativecommons.org/licenses/by/4.0/)
//
// Abstract :
@dwcullop
dwcullop / SwgohHelpApi.Program.cs
Last active July 27, 2018 20:38
Helper Classes for using the Star Wars Galaxy of Heroes API provided by www.swgoh.help and a simple example of how to use it. The API requires a login but you can get one by joining their discord server: https://discord.gg/6SbH8kE The helper classes and AllyCode classes are files copied verbatim from another project (that's why the odd namespace…
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace SwgohHelpApi
{
@dwcullop
dwcullop / HiResTimer.cs
Last active May 15, 2019 23:05
Simple High Resolution Timer for C# - Uses Win32 APIs to give you microsecond accuracy timer (dependent on CPU frequency)
using System;
using System.Runtime.InteropServices;
namespace DareWare.Utils
{
/// <summary>
/// High Resolution Timer Class. Uses the Win32 API to create a timer
/// that is as accurate as the system clock, down to microseconds
/// </summary>
public class HiResTimer : IComparable<HiResTimer>, IEquatable<HiResTimer>