Skip to content

Instantly share code, notes, and snippets.

<?php
// Your code here!
touch('test.text');
mkdir('test/hoge/fuga');
mkdir('test');
touch('test/test2.text');
mkdir('test/test');
touch('test/test/test3.hoge');
mkdir('test/test2');
touch('test/test2/test2-2.text');
@juner
juner / SimultaneousExtensions.cs
Last active January 17, 2019 08:04
SimultaneousExtensions
using System.Collections;
using System.Collections.Generic;
namespace System.Linq
{
/// <summary>
/// LINQ用 Simultaneous 拡張関数の定義
/// 複数のIEnumerableを並行に合成する
/// </summary>
public static class SimultaneousExtensions
@juner
juner / Program.cs
Created May 30, 2018 01:48
Code that works in .net frameworks 4.5, but not in Theraot.Core in .net frameworks 3.5
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
@juner
juner / Program.cs
Created May 9, 2018 02:20
Win32_Group の Administratos から Associators of を使わずに Win32_UserAccount を取得する……のをワンライナーで。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Management;
namespace ManagementObjectSample
{
class Program
{
static void Main(string[] args)
@juner
juner / Program.cs
Created March 16, 2018 10:04
DirectShowのFilter情報をレジストリから取得するテスト
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Win32;
namespace ExampleProject
{
class Program
{
static void Main(string[] args)
@juner
juner / ControlExtensions.c
Created March 15, 2018 04:59
WinForms ControlExtensions Parents() AndParents()
using System.Windows.Forms;
using System.Collections.Generic;
namespace System.Windows.Forms.Extensions
{
/// <summary>
/// コントロールの拡張関数クラス
/// </summary>
public static class ControlExtension
{
@juner
juner / RunSyncForWinForm.cs
Created March 2, 2018 08:27
Application.DoEvent() 使ってるので負けな気持ちだけど、memoしとく。Application.DoEvent() 使わない為にはどーすればええんだろか。
/// <summary>
/// 非同期 -> 固まらない同期
/// </summary>
/// <typeparam name="T">非同期処理の戻りの型</typeparam>
/// <param name="RunAsync">非同期処理</param>
/// <param name="Factory">スレッドを選択するファクトリー</param>
/// <param name="Waiter">待つ為の関数</param>
/// <returns></returns>
private static T RunSync<T>(Func<Task<T>> RunAsync, TaskFactory Factory = null, Action Waiter = null)
{
@juner
juner / GroupPolicyControl.cs
Created February 4, 2018 23:33
GroupPolicyControl
using Microsoft.Win32;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
@juner
juner / Program.cs
Created February 3, 2018 23:35
じゃんけんげーむ
using System;
using System.Collections.Generic;
namespace じゃんけんげーむ
{
/// <summary>
/// じゃんけんの手
/// </summary>
enum じゃんけんの手
{
@juner
juner / Program.cs
Last active September 27, 2017 05:07
配列に入ったbyte要素が全て0でないことを比較するループの最速解を求める為にコーディングして速度比較していたときのコードのメモ ref: http://qiita.com/juner/items/1a80eb0e320fe30fd6b7
using System;
using System.Collections.Generic;
using System.Linq;
namespace ArrayTest
{
class Program
{
static void Main(string[] args)
{