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
#include <stdint.h> // UInt16_T | |
#include <stdlib.h> // AToF, MAlloc | |
#include <math.h> // PowF, SQRT, RoundF | |
#include <ctype.h> // IsAlpha | |
#include <string.h> // STRCPY, STRnCMP | |
#include <stdio.h> // PrintF | |
float focal_normal_calculate( float h/*eight_sensor*/, float w/*idth_sensor*/ ) | |
{ | |
float d/*iagonal_sensor*/; |
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
-- Copyright 2022, 2023 Karl Vincent Pierre Bertin | |
-- | |
-- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | |
-- | |
-- 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | |
-- | |
-- 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | |
-- | |
-- 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. | |
-- |
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
#!/usr/bin/env bash | |
#function scnclr | |
#{ | |
# printf "\033[2J\033[3J\033[1;1H" | |
#} | |
function g_G7ID | |
{ | |
declare -n a_G7ID=${1} |
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
#!/usr/bin/env zsh | |
if ! command -v gdate &> /dev/null || ! command -v bc &> /dev/null || ! command -v tput &> /dev/null || ! command -v osascript &> /dev/null | |
then | |
printf "%s\n" "Error: Software Incompatibility.\nThis ZSH script depends on ZSH, GDate, BC, TPUT and OSAScript." | |
exit 1 | |
fi | |
[ -n "${1}" ] && [ 0 -le ${1} -a ${1} -le 23 ] && h=${1} || h=0 #[ -n "${1}" -a 0 -le ${1} -a ${1} -le 24 ] obviously fails. | |
[ -n "${2}" ] && [ 0 -le ${2} -a ${2} -le 59 ] && m=${2} || m=0 |
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
#!/usr/bin/env bash | |
if [ -d "${symbolic_link_or_directory}" ]; # If symbolic_link_or_directory exists... | |
then | |
if [ -L "${symbolic_link_or_directory}" ]; # If symbolic_link_or_directory is a symbolic link... | |
then | |
rm "${symbolic_link_or_directory}"; # Remove symbolic_link_or_directory. | |
else # Else, i.e. if symbolic_link_or_directory is a directory... | |
if [ $(ls -A "${symbolic_link_or_directory}") ]; # If symbolic_link_or_directory is empty... | |
then |
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
#!/usr/bin/env bash | |
mkdir directory && cd directory | |
for i in {0..99} | |
do | |
> file${i} | |
printf "make file${i}\n" | |
done #for i in {0..0}{0..9}{0..9}; do > file${i}; echo file${i}; done |
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
#!/usr/bin/env bash | |
osascript -e 'tell application "System Preferences" to quit' # | |
defaults delete com.apple.universalaccess slowKey | |
defaults write com.apple.universalaccess slowKey -bool FALSE # Disable Slow Keys. (i) Required from macOS 10.12 Sierra onwards to set faster key repeat rates. | |
defaults delete com.apple.universalaccess slowKeyDelay | |
#defaults write com.apple.universalaccess slowKeyDelay -int 5 # | |
defaults delete NSGlobalDomain ApplePressAndHoldEnabled |
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
#!/usr/bin/env bash | |
var=( {0..9} ); #var=( $({0..$[RANDOM%+9]}) ); | |
printf "Set: {$(var2=$(printf ", %s" "${var[@]}") && var2=${var2:2} && printf "${var2}\n";)}"'\n'"Pairs: "'\n'; | |
for (( i = 0; i < ${#var[@]}; i++ )); | |
do | |
for (( j = i + 1; j < ${#var[@]}; j++ )); | |
do | |
# printf "(${i}, ${j}): "'%d\n'; #printf "(${!var[${i}]}, ${!var[${j}]}): "'%d\n'; # array element nummbers |
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
#!/usr/bin/env bash | |
var1=([0]="first" [1]="second" [2]="third" [5]="sixth" [10]="eleventh"); | |
n=([0]="0" [1]="1" [2]="2" [5]="5" [10]="10"); | |
var2=([0]="zero" [1]="one" [2]="two" [5]="five" [10]="ten"); | |
printf '\n`echo \"${var1[@]}\"` s output:\t'; echo "${var1[@]}"; | |
printf '`echo \"${!var1[@]}\"` s output:\t'; echo "${!var1[@]}"; | |
printf '\nWith `${var1[@]}`:\n'; |
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
#if !idppc | |
/* | |
** float q_rsqrt( float number ) | |
*/ | |
float Q_rsqrt( float number ) | |
{ | |
long i; | |
float x2, y; | |
const float threehalfs = 1.5F; |
NewerOlder