This file contains hidden or 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 python3 | |
| """Permutation-preserving solver for balanced abnormal magic hexagons. | |
| This solver works in the half-turn antisymmetric branch H(-c)=-H(c), H(0)=0. | |
| It never leaves the consecutive shell: the state is always a signed permutation | |
| of 1..m on antipodal cell pairs. The only objective is the 3(n-1) positive-line | |
| residual vector. | |
| The model is equivalent to three signed triangular arrays A,B,C indexed by | |
| 0 <= a < b <= R=n-1. See the accompanying research note for the formulas. |
This file contains hidden or 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
| import os | |
| import timeit | |
| import argparse | |
| import statistics | |
| def fill_env(count=1000): | |
| for i in range(count): | |
| os.environ[f'KEY{i}'] = f'VALUE{i}' |
This file contains hidden or 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
| In case you get such an error: | |
| dyld: Library not loaded: /usr/local/opt/x264/lib/libx264.148.dylib | |
| Referenced from: /usr/local/Cellar/ffmpeg/3.3.2/bin/ffmpeg | |
| Reason: image not found | |
| Abort trap: 6 | |
| 1. Run `brew reinstall x264` | |
| 2. Locate the missing library in a new place. For example, mine was at /usr/local/Cellar/x264/r2748/lib/libx264.148.dylib | |
| 3. Link the library to the needed place: `link -s /usr/local/Cellar/x264/r2748/lib/libx264.148.dylib /usr/local/opt/x264/lib/libx264.148.dylib` |