Skip to content

Instantly share code, notes, and snippets.

View retokromer's full-sized avatar
💭
My research assistant was raped to death during the October pogrom.

רטו\רעטאָ\רֵיטוֹ • Reto retokromer

💭
My research assistant was raped to death during the October pogrom.
View GitHub Profile
@retokromer
retokromer / Unsigned_Binary_to_Gray.c
Last active December 11, 2015 10:05
Unsigned Binary to Gray
unsigned int Bin_to_Gray(unsigned int b) {
return b ^ (b >> 1);
}
@retokromer
retokromer / HELLOMARS.CBL
Last active December 26, 2015 13:59
«Hello, Mars!» in COBOL
IDENTIFICATION DIVISION.
PROGRAM-ID. HELLOMARS.
PROCEDURE DIVISION.
DISPLAY 'HELLO, MARS!'.
STOP RUN.
@retokromer
retokromer / Gray_to_Binary.c
Created December 11, 2015 20:00
Gray to Binary for 64-bit Processors
unsigned int Gray_To_Bin(unsigned int g) {
num = g ^ (g >> 32);
num = g ^ (g >> 16);
num = g ^ (g >> 8);
num = g ^ (g >> 4);
num = g ^ (g >> 2);
num = g ^ (g >> 1);
return g;
}
@retokromer
retokromer / Lazy_Fibonacci.p6
Created December 20, 2015 10:43
Testing Perl 6
use v6;
print 'Fibonacci number: ';
for $*IN.get {
my @fib = 1, 1, *+* ... *;
say "Fibonacci number #$_ is @fib[$_-1]";
}
@retokromer
retokromer / Ackermann.p6
Created December 20, 2015 11:01
Some more Perl 6 testing.
use v6;
say 'Ackermann function: A(m,n)';
print 'Enter m = ';
my $M = $*IN.get;
print 'Enter n = ';
my $N = $*IN.get;
sub A($m, $n) {
$m == 0 ?? $n + 1 !!
@retokromer
retokromer / signature.p6
Created January 15, 2016 13:39
Testing signature
use v6;
my @array = (0, 1, 1, 2, 3, 5, 8, 13);
for @array -> $x {
say $x;
}
@retokromer
retokromer / Привет_Марс
Created November 26, 2016 16:45
«Hello, Mars!» in Рапира, a procedural programming language from the USSR (implemented e.g. on Агат-9, an Apple II clone).
ПРОЦ СТАРТ()
ВЫВОД: 'Привет, Марс!'
КОН ПРОЦ
@retokromer
retokromer / txt_output.asm
Created January 3, 2017 11:41
Display the byte in A (8-bit value) in hex form. AF will be corrupt at exit.
.txt_output equ &bb5a
.print_hex_byte
push af
rrca
rrca
rrca
rrca
call print_byte_digit
pop af
@retokromer
retokromer / Kodak2383.cube
Last active February 17, 2018 14:15
3D log LUT for Kodak 2383 film stock
TITLE "Generate by Resolve"
LUT_3D_SIZE 33
0.0000000000 0.0000000000 0.0000000000
0.0039220000 0.0000000000 0.0039220000
0.0117650000 0.0000000000 0.0039220000
0.0196080000 0.0039220000 0.0078430000
0.0274510000 0.0078430000 0.0078430000
0.0352940000 0.0156860000 0.0078430000
0.0431370000 0.0196080000 0.0117650000
@retokromer
retokromer / Fuji3513.cube
Last active February 17, 2018 14:16
3D log LUT for Fuji 3513 film stock
TITLE "Generate by Resolve"
LUT_3D_SIZE 33
0.0000000000 0.0000000000 0.0117650000
0.0039220000 0.0000000000 0.0117650000
0.0078430000 0.0000000000 0.0117650000
0.0156860000 0.0039220000 0.0156860000
0.0196080000 0.0078430000 0.0156860000
0.0274510000 0.0117650000 0.0156860000
0.0352940000 0.0156860000 0.0156860000