Skip to content

Instantly share code, notes, and snippets.

View runceel's full-sized avatar

Kazuki Ota runceel

View GitHub Profile
<Window
x:Class="WpfApp3.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:WpfApp3"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Title="MainWindow"
Width="800"
Height="450"
@runceel
runceel / Program.cs
Last active April 21, 2022 12:53
Redux パターンのなるべくタイプセーフな雰囲気実装
// ライブラリ使う側のコード
using ReduxDemo;
using Microsoft.Extensions.DependencyInjection;
using Reactive.Bindings;
var services = new ServiceCollection();
// アプリの初期ステータスの設定と必須サービスの登録
services.AddRedux<AppStore>(new AppStore());
// Action と Reducer の登録
services.AddActions<Actions>();
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Forms;
using Reactive.Bindings;
using Reactive.Bindings.Extensions;
using System.Reactive.Disposables;
using System.Reflection.Metadata;
namespace BlazorApp1.Shared;
public class ReactivePropertyValidator : ComponentBase, IDisposable
using System;
using System.Threading;
class Test
{
// Create a new Mutex. The creating thread owns the Mutex.
private static Mutex mut = Create();
private const int numIterations = 1;
private const int numThreads = 3;
@runceel
runceel / Worker.cs
Last active September 23, 2021 06:31
var dataService = new DataService();
dataService.AddWorker(new Worker(1));
dataService.AddWorker(new Worker(2));
dataService.AddWorker(new Worker(3));
dataService.AddWorker(new Worker(4));
var frontend1 = new FrontendInfo("tsushi01", "FE1");
var frontend2 = new FrontendInfo("tsushi02", "FE2");
// 適当に空いてるワーカーを返してもらう
using System;
using System.Threading.Tasks;
namespace ArgTest
{
class Program
{
static void Main(string[] args)
{
var h = new Humidifier();
{
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"size": "Medium",
"weight": "Bolder",
"text": "${title}"
},
{
// step1 以下のようなインターフェースを定義しておく
public interface IActivityLifecycle
{
// 引数は適時足す
void OnActivityResult();
}
using CsvHelper;
using CsvHelper.Configuration;
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Globalization;
using System.IO;
using System.Linq;
namespace ConsoleApp8
using Reactive.Bindings;
using Reactive.Bindings.Extensions;
using System;
using System.Linq;
using System.Reactive;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Reactive.Subjects;
namespace ConsoleApp5