Skip to content

Instantly share code, notes, and snippets.

View berceanu's full-sized avatar
:octocat:
long long ago; /* in a galaxy far far away */

Andrei Berceanu berceanu

:octocat:
long long ago; /* in a galaxy far far away */
View GitHub Profile
@berceanu
berceanu / hi.py
Created November 23, 2016 15:44
Convoluted hi in Python
y = "y"
h = y
def y(y):
h = "h"
if y == h:
return y + "i"
y = lambda y: y(h)
return lambda h: y(h)

Keybase proof

I hereby claim:

  • I am berceanu on github.
  • I am b3rc3anu (https://keybase.io/b3rc3anu) on keybase.
  • I have a public key ASAMfQIwOZA4Kp6rp0o6QLZX5U0N5-eSZ25esiGZ7dX9Pgo

To claim this, I am signing this object:

@berceanu
berceanu / imshow_slices.py
Created February 18, 2018 17:01 — forked from afvincent/imshow_slices.py
Display slices of a picture
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.gridspec import GridSpec # only for Method 2
# A lot of information about GridSpec can be found here:
# https://matplotlib.org/tutorials/intermediate/gridspec.html
# Dummy data
uu = np.linspace(0, np.pi, 128)
data = np.cos(uu - 0.5) * np.cos(uu.reshape((-1, 1)) - 1.0)
@berceanu
berceanu / extract_emails_from_text.py
Created February 18, 2018 17:09 — forked from dideler/example.md
A python script for extracting email addresses from text files. You can pass it multiple files. It prints the email addresses to stdout, one address per line. For ease of use, remove the .py extension and place it in your $PATH (e.g. /usr/local/bin/) to run it like a built-in command.
#!/usr/bin/env python
#
# Extracts email addresses from one or more plain text files.
#
# Notes:
# - Does not save to file (pipe the output to a file if you want it saved).
# - Does not check for duplicates (which can easily be done in the terminal).
#
# (c) 2013 Dennis Ideler <ideler.dennis@gmail.com>
@berceanu
berceanu / YT.ipynb
Created February 18, 2018 17:11 — forked from C0nsultant/YT.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@berceanu
berceanu / spack-build.out
Created August 26, 2018 20:34
spack build log for gcc@5.4.0
This file has been truncated, but you can view the full file.
==> Executing phase: 'autoreconf'
==> Executing phase: 'configure'
==> '/home/berceanu/src/spack/var/spack/stage/gcc-5.4.0-brso6pbjatc5acbfjczk2ysfps3xc2gz/gcc-5.4.0/configure' '--prefix=/home/berceanu/src/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.3.0/gcc-5.4.0-brso6pbjatc5acbfjczk2ysfps3xc2gz' '--disable-multilib' '--enable-languages=c,c++,fortran' '--with-mpfr=/home/berceanu/src/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.3.0/mpfr-4.0.1-5njnqnxw4edj5uvw52x2cxs4a2qxxxrm' '--with-gmp=/home/berceanu/src/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.3.0/gmp-6.1.2-qtpajf64xicepymcwmp7nasehc6v4x67' '--enable-lto' '--with-quad' '--with-mpc=/home/berceanu/src/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.3.0/mpc-1.1.0-yy5yxxhon54jidokqqufhmeimpe73rgi' '--with-isl=/home/berceanu/src/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.3.0/isl-0.14-gme6ms37n5p56vobi5c3gxmh2zq4vksh'
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system t
@berceanu
berceanu / specs.txt
Created August 26, 2018 20:40
Laptop specs
##### release ###########################
Distributor ID: Ubuntu
Description: Ubuntu 18.04.1 LTS
Release: 18.04
Codename: bionic
##### kernel ############################
Linux 4.15.0-33-generic #36-Ubuntu SMP Wed Aug 15 16:00:05 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by configure, which was
generated by GNU Autoconf 2.64. Invocation command line was
$ /home/berceanu/src/spack/var/spack/stage/gcc-5.4.0-brso6pbjatc5acbfjczk2ysfps3xc2gz/gcc-5.4.0/configure --prefix=/home/berceanu/src/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.3.0/gcc-5.4.0-brso6pbjatc5acbfjczk2ysfps3xc2gz --disable-multilib --enable-languages=c,c++,fortran --with-mpfr=/home/berceanu/src/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.3.0/mpfr-4.0.1-5njnqnxw4edj5uvw52x2cxs4a2qxxxrm --with-gmp=/home/berceanu/src/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.3.0/gmp-6.1.2-qtpajf64xicepymcwmp7nasehc6v4x67 --enable-lto --with-quad --with-mpc=/home/berceanu/src/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.3.0/mpc-1.1.0-yy5yxxhon54jidokqqufhmeimpe73rgi --with-isl=/home/berceanu/src/spack/opt/spack/linux-ubuntu18.04-x86_64/gcc-7.3.0/isl-0.14-gme6ms37n5p56vobi5c3gxmh2
@berceanu
berceanu / dependencies.md
Last active October 26, 2018 09:24
packages installed by spack following instructions on https://picongpu.readthedocs.io/en/0.4.0/install/instructions/spack.html
$ spack find

==> 33 installed packages.
-- linux-ubuntu18.04-x86_64 / gcc@7.3.0 -------------------------
autoconf@2.69               hwloc@1.11.9         openssl@1.0.2o
automake@1.16.1             libpciaccess@0.13.5  perl@5.26.2
boost@1.65.1                libpng@1.6.34        picongpu@0.4.0
bzip2@1.0.6                 libsigsegv@2.11      pkgconf@1.4.2
cmake@3.12.3 libsplash@1.7.0 pngwriter@0.7.0
@berceanu
berceanu / package.py
Last active October 25, 2018 15:40
GCC install prerequisites for spack
# ./src/spack/var/spack/repos/builtin/packages/gcc/package.py
# https://gcc.gnu.org/install/prerequisites.html
depends_on('gmp@4.3.2:')
#depends_on('mpfr@2.4.2:')
depends_on('mpfr@2.4.2:3.1.6')
depends_on('mpc@0.8.1:', when='@4.5:')
#depends_on('isl@0.14', when='@5:5.9')
depends_on('isl@0.15', when='@5:5.9')
#depends_on('isl@0.15:', when='@6:')