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
class SyncFIFO<T> { | |
var buf = Array<T>() | |
let lock = DispatchSemaphore(value: 1) | |
let sem = DispatchSemaphore(value: 0) | |
func push(_ val: T) { | |
self.lock.wait() | |
defer { self.lock.signal() } | |
self.buf.append(val) | |
self.sem.signal() |
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
func ==<Element: Equatable>(lhs: [Element]?, rhs: [Element]?) -> Bool { | |
return lhs.map { l in rhs.map { l == $0 } ?? false } | |
?? rhs.map { r in lhs.map { $0 == r } ?? false } | |
?? true | |
} |
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 <fstream> | |
using namespace std; | |
#include "monster_generated.h" | |
using namespace MyGame::Sample; | |
int main() { | |
// ファイル読み込み |
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
[core] | |
sshCommand = C:/Windows/System32/OpenSSH/ssh.exe |
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
Param([String] $file) | |
$lfs = git lfs ls-files | |
Get-ChildItem -Recurse -Filter $file | | |
?{ ![regex]::IsMatch((Get-Content -Encoding Ascii -TotalCount 1 -ReadCount 1 $_.Target), '^%YAML') } | | |
%{ Resolve-Path -Relative $_.FullName } | | |
%{ $_ -replace '^\.\\', '' -replace '\\', '/' } | | |
?{ ($lfs -match $_).Count -eq 0 } | | |
?{ (git status --ignored -s -- $_).Count -eq 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
[alias] | |
ls-binary = !"func() { git ls-files --eol \"$@\" | grep -v \"attr/-text\" | grep \"[iw]/-text\"; }; func" |
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 <tuple> | |
//#include <boost/multiprecision/cpp_int.hpp> | |
#include <boost/multiprecision/gmp.hpp> | |
namespace mp = boost::multiprecision; | |
//typedef mp::cpp_int mpint; | |
typedef mp::mpz_int mpint; |
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.Collections.Generic; | |
using System.Collections.Immutable; | |
using System.Linq; | |
namespace tropical | |
{ | |
class Program | |
{ | |
enum NODE |
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
// プリコンパイル済みヘッダー | |
// https://gcc.gnu.org/onlinedocs/gcc/Precompiled-Headers.html | |
// https://ezoeryou.github.io/cpp-intro/#%E3%82%B3%E3%83%B3%E3%83%91%E3%82%A4%E3%83%AB%E6%B8%88%E3%81%BF%E3%83%98%E3%83%83%E3%83%80%E3%83%BCprecompiled-header | |
// standard library | |
// https://cpprefjp.github.io/reference.html | |
// 言語サポート | |
#include <limits> | |
// #include <version> // C++20 |
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 | |
// C++20 統一コンテナ削除 | |
// https://ja.cppreference.com/w/cpp/experimental/lib_extensions_2#Uniform_container_erasure | |
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1209r0.html | |
#include <utility> | |
#include <iterator> | |
#include <algorithm> | |
#include <type_traits> |
OlderNewer