import numpy as np
import timeit
def measure(s):
ts = timeit.repeat(s, globals=globals())
print(f'{s:>20}: {min(ts):>6.3f}s ({ts})')
x = 2
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
| from __future__ import print_function | |
| import objgraph | |
| import numpy as np | |
| print('--------------------------------------------------') | |
| print('Numpy info:') | |
| print() | |
| print(np.__version__) | |
| print() | |
| np.show_config() |
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
| $ cabal test | |
| Preprocessing library arithmoi-0.5.0.1... | |
| Preprocessing test suite 'spec' for arithmoi-0.5.0.1... | |
| Linking dist/build/spec/spec ... | |
| /usr/bin/ld: cannot find -lHStagged-0.8.5-DG0qxw3gXxx4NfDcDx4Iai | |
| /usr/bin/ld: cannot find -lHSregex-tdfa-1.2.2-JFeutuWiS2vGBM4qXQlqio | |
| /usr/bin/ld: cannot find -lHSregex-base-0.93.2-AYjYAsBidAc8f5XNm9b2Aa | |
| /usr/bin/ld: cannot find -lHSparsec-3.1.11-1CA7c0vSU7tJHGhveOjoXR | |
| /usr/bin/ld: cannot find -lHStext-1.2.2.2-3ENqlljngKa6xj1Go2fVWq | |
| /usr/bin/ld: cannot find -lHSbinary-0.8.3.0 |
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
| module Main where | |
| import Math.NumberTheory.Primes.Factorisation | |
| import Data.Word | |
| import Text.Printf | |
| import System.CPUTime | |
| data P = P { unP :: !Word64 } | |
| oldWay :: FactorSieve -> Integer -> Integer |
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 | |
| import os | |
| import sys | |
| # Prints cargo deps (each name-version pair), gathered recursively. | |
| # I couldn't find anything that does this in cargo. | |
| def main(): | |
| import argparse |
Luckily for us, powerpc64-unknown-linux-gnu is a supported target triple, and we can download the toolchain through rustup.
If a firewall prevents the use of rustup on the remote machine, you can download the toolchain on your own your own machine:
$ rustup toolchain add 1.20.0-powerpc64-unknown-linux-gnu
$ cd ~/.rustup/toolchains/1.20.0-powerpc64-unknown-linux-gnu/
$ tree -d -L 2Luckily for us, powerpc64-unknown-linux-gnu is a supported target triple, and we can download the toolchain through rustup.
If a firewall prevents the use of rustup on the remote machine, you can download the toolchain on your own machine
[ lampam@arch-t430s ] ~
$ rustup toolchain add 1.20.0-powerpc64-unknown-linux-gnu
$ cd ~/.rustup/toolchains/1.20.0-powerpc64-unknown-linux-gnu/
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
| //! Shim around the `tempdir` crate which doesn't delete the | |
| //! directories on unwind, in order to facilitate debugging. | |
| extern crate tempdir; | |
| pub use tempdir::TempDir as ActualTempDir; | |
| use ::std::io::Result; | |
| use ::std::path::{Path, PathBuf}; | |
| /// Wrapper around `tempdir::TempDir` that does not destroy the directory on unwind. | |
| #[derive(Debug)] |