Today, John Tromp - creator of the Binary λ-Calculus, and one of the smartest functional wizards alive - ported his famous prime number generator (first published 12 years ago!) to HVM:
// This is a very simple "overengineered" version of FizzBuzz written in Delphi | |
// See also | |
// https://github.com/jongeorge1/FizzBuzzEnterpriseEdition-CSharp | |
// https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition | |
program FizzBuzzEnterpriseEdition; | |
{$APPTYPE CONSOLE} | |
uses |
// Tested on Windows, MacOS, Linux, and Android. From what I've read /dev/urandom works on iOS too. | |
unit MultiPlatformCryptoRando; | |
interface | |
uses System.Classes, System.SysUtils; | |
function CryptoRandoCardinal: Cardinal; | |
function CryptoRandoFloat: Single; |
(**************************************************************************** | |
___ _ _ _ ___ _ _ ___ ___ _____ | |
| \ ___ | | _ __ | |_ (_) / __|| |_ __ _ | |_ / __|| _ \|_ _| | |
| |) |/ -_)| || '_ \| ' \ | || (__ | ' \ / _` || _|| (_ || _/ | | | |
|___/ \___||_|| .__/|_||_||_| \___||_||_|\__,_| \__| \___||_| |_| | |
|_| | |
Copyright © 2022-present tinyBigGAMES™ LLC | |
All Rights Reserved. |
program AutoFreeTest; | |
{$APPTYPE CONSOLE} | |
{$R *.res} | |
uses | |
System.SysUtils, | |
System.Classes; | |
type | |
IAutoFree = interface |
// morseCodes[asciiCode - 32] | |
// Non-existend codes are represented by "" | |
String morseCodes[65] = { | |
" ", // 32 - [SPACE] | |
"-.-.--", // 33 - ! | |
".-..-.", // 34 - " | |
"", // 35 - # | |
"...-..-",// 36 - $ | |
"", // 37 - % |
In this video we come across about 50 online resources for category theory:
I quickly comment on about 20 major ones. I link to the university sites, arXiv sites or Amazon page - most of the mentioned books are online available.
Here's another category theory list on github
type | |
StringList = TArray<string>; | |
StringListHelper = record helper for StringList | |
public | |
procedure Add(const AValue: string); | |
end; | |
{ StringListHelper } |
/* | |
* Solution of the Jon Bentley's k most frequent words problem using a prefix tree and | |
* a heap of size k. Worst case time complexity is O(N log k), where N is the total | |
* number of words. | |
* | |
* The problem is formulated in the Communications of the ACM 29,5 (May 1986), 364-369: | |
* "Given a text file and an integer k, you are to print the k | |
* most common words in the file (and the number of their | |
* occurrences) in decreasing frequency." | |
* |
by Bruce Pascoe - 1 May, 2019
"A monad is just a monoid in the category of endofunctors. What's the problem?" ~James Iry[^1]
The problem... is that there are several problems.
It's been said that monads bear a dreadful curse. Once you finally understand what they are, you begin to see them everywhere--but somehow become completely incapable of explaining them to anyone else. Many tutorial writers have tried to break the Great Curse--the Web is lousy with bold attempts and half successes that attest to this--and just as many have failed. Well, I'm here to address the elephant in the room[^2] and tell you that I intend to break the Great Curse once and for all.
There are basically two ways a monad tutorial tends to go. One is a paragraph or two of minimal descriptions of one or two common monads (Haskell's Maybe
in particular is very popular), followed by a lot of intimidating Haskell syntax trying to explain--precisely--how it all fits together. This is well