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
#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
#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
ARG centos=latest | |
FROM centos:$centos | |
RUN yum install -x openssl -x openssl-libs -y gcc libcap-devel perl \ | |
&& rm -rf /var/cache/yum/* \ | |
&& useradd -m guest \ | |
&& echo 'guest:guest' | chpasswd | |
WORKDIR /root/openssl | |
ARG openssl=https://www.openssl.org/source/old/1.0.2/openssl-1.0.2k.tar.gz | |
RUN curl $openssl | tar xfz - --strip=1 \ | |
&& ./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl \ |
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 <charconv> | |
#include <fstream> | |
#include <iostream> | |
#include <map> | |
#include <regex> | |
#include <set> | |
#include <string> | |
#include <string_view> | |
#include <cassert> | |
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
using System; | |
using System.Runtime.InteropServices; | |
using IMAPI2FS; // COM reference: Microsoft IMAPI2 File System Image Creator | |
using IStream = System.Runtime.InteropServices.ComTypes.IStream; | |
class IsoImage { | |
[DllImport("shlwapi.dll", CharSet = CharSet.Unicode, PreserveSig = true)] | |
static extern void SHCreateStreamOnFile(string pszFile, uint grfMode, out IStream ppstm); | |
static void Main(string[] args) { |
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
#define SECURITY_WIN32 | |
#include <iostream> | |
#include <tuple> | |
#include <Windows.h> | |
#include <security.h> | |
#include <schannel.h> | |
#pragma comment(lib, "Secur32.lib") | |
static std::tuple<int, const char*> protocols[] = { | |
{ SP_PROT_PCT1_CLIENT, "PCT 1.0" }, |
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 <locale> | |
#include <cpprest/http_client.h> | |
#include <cpprest/oauth1.h> | |
static constexpr auto | |
apikey = U(""), | |
apisecretkey = U(""), | |
accesstoken = U(""), | |
accesstokensecret = U(""); |
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; | |
static void Test(string columnName) => Console.WriteLine("{0,-3} => {1,4} => {2,-3}", columnName, columnName.ToColumnNumber(), columnName.ToColumnNumber().ToColumnName()); | |
Test("A"); | |
Test("Z"); | |
Test("AA"); | |
Test("ZZ"); | |
Test("AAA"); | |
Test("BBB"); |
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
namespace Sayuri.IO.Compression | |
open System.IO | |
open System.IO.Compression | |
module ZLib = | |
[<Literal>] | |
let private ModuloAdler = 65521u | |
let private adler32 (buffer : byte[]) = | |
let mutable a = 1u | |
let mutable b = 0u |
NewerOlder