This file contains hidden or 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.IO; | |
using System.Diagnostics; | |
using static System.Console; | |
var sw = Stopwatch.StartNew(); | |
var alf = get_alf(); | |
do_it(2_000_000); | |
sw.Stop(); | |
WriteLine(sw.Elapsed); // <= 00:00:13.4216229 it is very fast! fantasctic! | |
char[] get_alf() |
This file contains hidden or 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.IO | |
let num () = Random.Shared.Next(0, 10_000) | |
let alf = | |
[| ' ' |] | |
|> Array.append [| 'A' .. 'Z' |] | |
|> Array.append [| 'a' .. 'z' |] |
This file contains hidden or 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.Console; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
def skip_loop(counter, skip, max, idx, lst) { | |
if (idx > max) lst | |
else | |
if ( counter >= skip ) | |
skip_loop(1, skip, max, idx + 1, idx :: lst) |
This file contains hidden or 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.Console; | |
def skip_loop(counter, skip, max, idx, lst) { | |
if (idx >= max) lst | |
else | |
if ( counter >= skip ) | |
skip_loop(1, skip, max, idx + 1, idx :: lst) | |
else | |
skip_loop(counter + 1, skip, max, idx + 1, lst) | |
} |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<NoStdLib>True</NoStdLib> | |
<OutputType>exe</OutputType> | |
<OutputPath>bin</OutputPath> | |
<TargetFrameworkIdentifier>.NETCoreApp</TargetFrameworkIdentifier> | |
<TargetFrameworkVersion>6.0</TargetFrameworkVersion> | |
<TargetFramework>net6.0</TargetFramework> | |
</PropertyGroup> |
This file contains hidden or 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
let color col = | |
let old = System.Console.ForegroundColor | |
System.Console.ForegroundColor <- col | |
{ new System.IDisposable with | |
member it.Dispose() = System.Console.ForegroundColor <- old } | |
let red () = color System.ConsoleColor.Red | |
let cyan () = color System.ConsoleColor.Cyan | |
let green () = color System.ConsoleColor.Green |
This file contains hidden or 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
type State = | |
| Ping | |
| Pong | |
type Command = | Send | |
type Event = | Received | |
let apply item = | |
function |
This file contains hidden or 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 static System.Console; | |
using System.Threading.Tasks; | |
using System.Threading.Tasks.Dataflow; | |
using System.Threading; | |
using System.Collections.Generic; | |
namespace CSharpMailBoxProcessor | |
{ | |
public class Reply |
This file contains hidden or 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
const page = "syncSystems"; | |
// "index"; | |
export default { | |
input: `src/${page}.ts`, | |
output: { | |
sourcemap: true, | |
exports : 'named', | |
format: 'iife', |
This file contains hidden or 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
(defmacro writeln (&rest args) | |
`(progn | |
(loop for e in '(,@args) | |
do | |
(format t "~A" e)) | |
(format t "~%"))) | |
(defstruct person name) | |
(defgeneric hello (obj) |