Skip to content

Instantly share code, notes, and snippets.

View bradphelan's full-sized avatar

Brad Phelan bradphelan

View GitHub Profile
// CLI11: Version 2.4.1
// Originally designed by Henry Schreiner
// https://github.com/CLIUtils/CLI11
//
// This is a standalone header file generated by MakeSingleHeader.py in CLI11/scripts
// from: v2.4.1
//
// CLI11 2.4.1 Copyright (c) 2017-2024 University of Cincinnati, developed by Henry
// Schreiner under NSF AWARD 1414736. All rights reserved.
//
@bradphelan
bradphelan / app.fs
Created December 1, 2015 12:51
problem with websharper suave integration
namespace bookman
open WebSharper
open WebSharper.Sitelets
open WebSharper.UI.Next
open WebSharper.UI.Next.Server
type EndPoint =
| [<EndPoint "/">] Home
| [<EndPoint "/about">] About
namespace Foo
open Elmish
module Elmish =
/// A function that maps a value to a value of the same type
type Update<'State> = ('State->'State)
/// A message to with instruction to
type Message<'State> = Message of (Update<'State>*Cmd<Message<'State>>)
TEST(RANGE, LVALUE){
auto vector = IRange(3,5) | ToVector();
auto mvector = vector | Map([](int i){return i+1;}) | ToVector();
// Check the vector has not been moved
ASSERT_EQ(2,vector.size());
ASSERT_EQ(3,vector[0]);
ASSERT_EQ(4,vector[1]);
// Check the result has what it needs
ASSERT_EQ(2,mvector.size());
#include "boost/type_traits/declval.hpp"
#include "boost/foreach.hpp"
#include <vector>
template <int N, typename T>
struct NVector{
typedef std::vector<typename NVector<N-1,T>::type> type;
};
template <typename T> struct NVector<1,T> {
typedef std::vector<T> type;
namespace XoaDotNet
open Avalonia.Controls
open Avalonia.Media
open Avalonia.FuncUI.Types
open Avalonia.FuncUI
open Avalonia.Layout
open FSharpx.Collections
open Bogus
namespace XoaDotNet
open Avalonia.Controls
open Avalonia.Media
open Avalonia.FuncUI.Types
open Avalonia.FuncUI
open Avalonia.Layout
open FSharpx.Collections
open Bogus
/// Handle lvalue sequence reference.
/// This means the lifetime of the input sequence should be longer than
/// the lifetime of the output sequence
template <typename Enumerable,typename Combinator>
auto
operator|(Enumerable & enumerable, Combinator c) ->
typename boost::enable_if_c
< MW_LINQ_IS_ENUMERABLE(Enumerable) && MW_LINQ_IS_LAZY_COMBINATOR(Combinator)
, EnumerableOp
< Combinator
# Trigger fuzzy search
Set-PSReadlineKeyHandler `
-Chord 'Ctrl+s' `
-BriefDescription "InsertHeatseekerPathInCommandLine" `
-LongDescription "Run Heatseeker in the PWD, appending any selected paths to the current command" `
-ScriptBlock {
$choices = [IO.File]::ReadAllText($(Resolve-Path .hscache)) | hs
$ps::Insert($choices -join " ")
}