Skip to content

Instantly share code, notes, and snippets.

View girving's full-sized avatar

Geoffrey Irving girving

View GitHub Profile
@girving
girving / self.crc
Created March 24, 2024 21:28
Program to recognize its own CRC-32
#!/usr/bin/env python3
import sys
import zlib
if len(sys.argv) == 2:
print(('Not me', 'Me.')[zlib.crc32(open(sys.argv[1], 'rb').read()) == 1441602037])
@girving
girving / gist:db40b34fea355efbd0e6db19355683d5
Created March 13, 2024 10:44
Optimal game (assuming no bugs) for rock-paper-scissors with tokens
P0 222: 0.333r→s, 0.333p→r, 0.333s→p ... r→s
P1 222: 0.333r→s, 0.333p→r, 0.333s→p ... s→p
P1 wins
P0 123: 0.393r→p, 0.283p→r, 0.324s→r ... s→r
P1 231: 0.313r→s, 0.469p→s, 0.219s→r ... p→s
P1 wins
P0 222: 0.333r→s, 0.333p→r, 0.333s→p ... p→r
P1 222: 0.333r→s, 0.333p→r, 0.333s→p ... r→s

Keybase proof

I hereby claim:

  • I am girving on github.
  • I am girving (https://keybase.io/girving) on keybase.
  • I have a public key ASDIQ_qtyeWP3-kFjlfENYlT4Fv2TtT3O_hgLz2m8XjXSwo

To claim this, I am signing this object:

This file has been truncated, but you can view the full file.
000000000024e0e4 s GCC_except_table0
0000000000256bb4 s GCC_except_table0
0000000000256fd0 s GCC_except_table0
0000000000257c30 s GCC_except_table0
000000000025975c s GCC_except_table0
00000000002597f8 s GCC_except_table0
000000000025bf98 s GCC_except_table0
000000000025c118 s GCC_except_table0
000000000025dd8c s GCC_except_table0
000000000025df1c s GCC_except_table0
The complete works of Shakespeare in binary have length
s = 8 * 5.3M = 8 * 5458199 = 43665592
Let S be the set of numbers that contain the complete works of Shakespeare in binary.
If N is the number of occurrences of the complete works of Shakespeare, N is approximately
Poisson distributed with mean
E(N) = (lg n - s) 2^-s = mu
"""Print ops that have float but not double definitions."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from google3.net.proto2.python.public import text_format
from google3.pyglib import app
from google3.pyglib import flags
from google3.third_party.tensorflow.core.framework import op_def_pb2
2015-11-15 16:43:49 -0800
cmake
..
-DCMAKE_C_FLAGS_RELEASE=
-DCMAKE_CXX_FLAGS_RELEASE=
-DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/cubicsdr/HEAD
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_FIND_FRAMEWORK=LAST
-DCMAKE_VERBOSE_MAKEFILE=ON
2015-11-15 14:05:33 -0800
cmake
..
-DCMAKE_C_FLAGS_RELEASE=
-DCMAKE_CXX_FLAGS_RELEASE=
-DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/cubicsdr/HEAD
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_FIND_FRAMEWORK=LAST
-DCMAKE_VERBOSE_MAKEFILE=ON
2015-11-15 14:09:03 -0800
cmake
..
-DCMAKE_SHARED_LINKER_FLAGS='-Wl,-undefined,dynamic_lookup'
-DPYTHON_LIBRARY='/usr/local/lib/libgnuradio-runtime.dylib'
-DCMAKE_C_FLAGS_RELEASE=
-DCMAKE_CXX_FLAGS_RELEASE=
-DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/soapysdr/HEAD
-DCMAKE_BUILD_TYPE=Release
2015-11-15 14:05:33 -0800
cmake
..
-DCMAKE_C_FLAGS_RELEASE=
-DCMAKE_CXX_FLAGS_RELEASE=
-DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/cubicsdr/HEAD
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_FIND_FRAMEWORK=LAST
-DCMAKE_VERBOSE_MAKEFILE=ON