This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <array> | |
#include <type_traits> | |
#include <Windows.h> | |
#include <windowsx.h> | |
template<int... controls> | |
struct Controls; | |
template<class RightAnchoredControls, class BottomAnchoredControls, class StretchingControls> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Sayuri.Drawing.Png | |
open FSharp.NativeInterop | |
open System | |
open System.Buffers | |
open System.Buffers.Binary | |
open System.Drawing | |
open System.Drawing.Imaging | |
open System.IO | |
open System.IO.Compression | |
open System.IO.Hashing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open System | |
open System.Collections.Generic | |
type State<'Key, 'Value when 'Key : equality> = | |
| Dict of Dictionary<'Key, 'Value> | |
| Item of 'Key * 'Value | |
| Empty | |
type DictBuilder<'Key, 'Value when 'Key : equality> (equalityComparer : _ IEqualityComparer) = | |
let create () = Dictionary<'Key, 'Value> equalityComparer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Program = | |
let rec Main args = | |
let numbers : obj[] = | |
[| 0b1; 0b10; ([| 0b100; 0b1000 |] : obj[]); // binary literals | |
0b10000; 0b100000 |] // digit separators: not supported | |
let sum, count = Tally(numbers) // deconstruction | |
printfn "Sum: %d, Count: %d" sum count | |
and Tally (values : obj[]) = // tuple types | |
let mutable r = 0, 0 // tuple literals |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module tinyBase64Decoder | |
open System | |
open System.Collections.Generic | |
// Declare fundamental functions | |
// Generate n length Integer List (0 upto n - 1) | |
let iota n = [0..n-1] | |
// Generate n length List of x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <future> | |
#ifdef USE_AWAIT | |
#include <experimental/resumable> | |
#include <boost/asio/use_future.hpp> | |
#else | |
#include <exception> | |
#include <memory> | |
#include <type_traits> | |
#include <utility> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cmath> | |
#include <thread> | |
#include <Windows.h> | |
#include <MMSystem.h> | |
#pragma comment(lib, "winmm") | |
struct MultiMediaTimer { | |
static const wchar_t* name; | |
static LARGE_INTEGER elapsed[10000]; | |
static int idx; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Diagnostics; | |
using System.IO; | |
using System.Linq; | |
using System.Runtime.InteropServices; | |
using System.Runtime.InteropServices.ComTypes; | |
using System.Windows.Forms; | |
using Sayuri.IO; | |
using FILETIME = System.Runtime.InteropServices.ComTypes.FILETIME; | |
using IDataObject = System.Runtime.InteropServices.ComTypes.IDataObject; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string_view> | |
#include <wrl/client.h> | |
#include <mfapi.h> | |
#include <mftransform.h> | |
#include <wincodec.h> | |
#pragma comment(lib, "mfplat.lib") | |
#pragma comment(lib, "mfuuid.lib") | |
#pragma comment(lib, "Windowscodecs.lib") | |
using namespace std::literals; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Sayuri.Net.SocketExtensions | |
open System | |
open System.Net | |
open System.Net.Sockets | |
#if NET4 | |
type private ConcurrentBag<'T> = System.Collections.Concurrent.ConcurrentBag<'T> | |
#else | |
type private ConcurrentBag<'T>() = | |
let bag = System.Collections.Generic.Stack<'T>() |