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 | |
#ifndef __cplusplus_cli | |
# error "Not for use in native C++ compilations" | |
#endif | |
namespace NativeMemory { | |
template <class T> | |
value struct DefaultDeleter { | |
auto operator()(T *t) { |
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
#ifdef __cplusplus | |
extern "C" | |
{ | |
#endif | |
#include <stdio.h> | |
#include <stdlib.h> | |
#define VECTOR_INIT_CAPACITY 4 | |
// Macro for non-pointer types. |
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.Collections.Generic; | |
public static class SelectWhereExtension { | |
delegate bool SelectWherePredicate<T, U>(T input, out U output); | |
public static IEnumerable<U> SelectWhere<T, U>(this IEnumerable<T> iter, SelectWherePredicate<T, U> predicate) { | |
var enumerator = iter.GetEnumerator(); | |
while (enumerator.MoveNext()) { | |
if (predicate(enumerator.Current, out U product)) { | |
yield return product; |
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
#!/usr/bin/env bash | |
function error() { | |
# $1 err code | |
# $2 err msg | |
echo -e "error: $1: $2" | |
} | |
function tgz() { | |
local longopts="help,output:,force" |
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
global using static Results.Result; | |
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Runtime.CompilerServices; | |
namespace Results; | |
/// <summary> |
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
GREEN="" | |
RED="" | |
NO_COLOR="" | |
BLUE="" | |
if [ "$color_prompt" = yes ]; then | |
GREEN='\033[01;32m' | |
RED='\033[01;31m' | |
NO_COLOR='\033[00m' | |
BLUE='\033[34m' |
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
from typing import ( | |
Sequence, | |
Iterable, | |
Callable | |
) | |
type Predicate[ T ] = Callable[ [ T ] , bool ] | |
type Converter[ TIn , TOut ] = Callable[ [ TIn ] , TOut ] | |
class QueryException( Exception ): |