Skip to content

Instantly share code, notes, and snippets.

View pmcgee69's full-sized avatar

Paul McGee pmcgee69

  • Perth, Western Australia
View GitHub Profile
unit AsyncThread;
interface
uses
{Delphi}
System.SysUtils
{Project}
;
@an01f01
an01f01 / delphi_python_parsing.pas
Last active March 13, 2025 09:34
Method parses function arguments from Python to Delphi
function TFrmMain.ConsoleModule_Print( pself, args : PPyObject ) : PPyObject; cdecl;
var
pprint: NativeInt;
val1: Integer;
val2: Single;
val3: PAnsiChar;
begin
with GetPythonEngine do
begin
if (PyErr_Occurred() = nil) and
@jimmckeeth
jimmckeeth / FizzBuzzEnterpriseEdition.dpr
Last active June 5, 2024 17:05
FizzBuzzEnterpriseEdition in Delphi
// 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
@VictorTaelin
VictorTaelin / simple_fast_functional_sieve.md
Last active July 2, 2024 19:15
Can a simple functional sieve be fast? Optimizing Tromp's algorithm on HVM.

Can a simple functional sieve be fast? Optimizing Tromp's algorithm on HVM.

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:

@jimmckeeth
jimmckeeth / MultiPlatformCryptoRando.pas
Last active September 10, 2024 08:22
Delphi Cryptographically Secure Random Number Generator that works on all paltforms
// 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;
@jarroddavis68
jarroddavis68 / DelphiChatGPT.pas
Last active April 24, 2025 15:57
Use ChatGPT from Delphi
(****************************************************************************
___ _ _ _ ___ _ _ ___ ___ _____
| \ ___ | | _ __ | |_ (_) / __|| |_ __ _ | |_ / __|| _ \|_ _|
| |) |/ -_)| || '_ \| ' \ | || (__ | ' \ / _` || _|| (_ || _/ | |
|___/ \___||_|| .__/|_||_||_| \___||_||_|\__,_| \__| \___||_| |_|
|_|
Copyright © 2022-present tinyBigGAMES™ LLC
All Rights Reserved.
@ericniebler
ericniebler / toy_senders.hpp
Last active November 12, 2024 21:00
A toy implementation of P2300, the std::execution proposal, for teaching purposes
/*
* Copyright 2022-2024 NVIDIA Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@Pasquina
Pasquina / Simplified Auto Ref Counting.txt
Created September 27, 2020 22:30
A Delphi Console Application to illustrate Automatic Reference Counting (Simplified)
program AutoFreeTest;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.SysUtils,
System.Classes;
type
IAutoFree = interface
@fboes
fboes / morse_code.ino
Last active March 13, 2025 23:26
Arduino Morse Code Table for ASCII
// morseCodes[asciiCode - 32]
// Non-existend codes are represented by ""
String morseCodes[65] = {
" ", // 32 - [SPACE]
"-.-.--", // 33 - !
".-..-.", // 34 - "
"", // 35 - #
"...-..-",// 36 - $
"", // 37 - %
@Nikolaj-K
Nikolaj-K / category_theory_literature.md
Last active September 16, 2024 10:26
Recomended reading for the undergrad category theorist