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
// function BoolToStr(B: Boolean; UseBoolStrs: Boolean = False): string; | |
Writeln('BoolToStr(??, True)'); // BoolToStr(??, True) | |
WriteLn('True = ' + BoolToStr(True, True)); // True = True | |
WriteLn('False = ' + BoolToStr(False, True)); // False = False | |
Writeln('BoolToStr(??, False)'); // BoolToStr(??, False) | |
WriteLn('True = ' + BoolToStr(True, False)); // True = -1 | |
WriteLn('False = ' + BoolToStr(False, False)); // False = 0 | |
// class function ToString(const Value: Boolean; UseBoolStrs: | |
// TUseBoolStrs = TUseBoolStrs.False): string; |
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
// 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 |
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
// 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; |
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
// I created an updated blog post with new code, more accuracy, and digits: | |
// https://blogs.embarcadero.com/getting-big-with-pi-in-delphi/ | |
unit PiDay2023; | |
interface | |
uses | |
Velthuis.BigIntegers, | |
Velthuis.BigDecimals; | |
// Use your favorite fork of https://github.com/TurboPack/RudysBigNumbers |
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
@echo off | |
REM Call from Delphi/RAD Studio IDE with the following parameters | |
REM $PATH($EXENAME) $NAMEONLY($PROJECT) | |
echo ============================================================= | |
echo Be sure you Compile Android 64 and Deploy [Shift-Ctrl-Alt-F9] | |
echo. | |
echo Also set <application android:resizeableActivity="true"> in AndroidManifest.template.xml | |
echo ============================================================= | |
echo Path: %1 | |
set apk=%2\bin\%2.apk |
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
#!/bin/bash | |
# | |
# Download and execute with the following: | |
# curl -L https://embt.co/SetupRedHat4Delphi22sh | bash | |
# | |
echo "updating installed package" | |
sudo yum upgrade -y | |
echo "installing development tools" | |
sudo yum groupinstall 'Development Tools' -y | |
sudo yum install wget gtk3 mesa-libGL gtk3-devel -y |
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
#!/bin/bash | |
# | |
# Download and execute with the following: | |
# curl -L https://embt.co/SetupUbuntu4Delphi22 | bash | |
# | |
echo "Updating the local package directory" | |
sudo apt update | |
echo "Upgrading any outdated pacakges" | |
sudo apt full-upgrade -y | |
echo "Install new packages necessary for Delphi & FMXLinux" |
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
#!/bin/bash | |
echo "Updating the local package directory" | |
sudo apt update | |
echo "Upgrade any outdated pacakges" | |
sudo apt full-upgrade -y | |
echo "Install new packages necessary for Delphi" | |
sudo apt install joe wget p7zip-full curl openssh-server build-essential zlib1g-dev libcurl4-gnutls-dev libncurses5 xorg libgl1-mesa-dev libosmesa-dev libgtk-3-bin -y | |
echo "Clean-up unused packages" | |
sudo apt autoremove -y | |
cd ~ |
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
unit IgnoreEditChanges; | |
// https://blogs.embarcadero.com/ignore-changes-with-custom-managed-records/ | |
// Custom Managed Records are a new feature introduced in 10.4 Sydney | |
interface | |
uses | |
System.Classes; | |
type |
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
uses Math; | |
function ROT47(UnRot: string): string; | |
// More information https://en.wikipedia.org/wiki/ROT13#Variants | |
begin | |
Result := UnRot; | |
for var I := 1 to Length(Result) do | |
begin | |
var o := ord(Result[i]); | |
case o of |
NewerOlder