Skip to content

Instantly share code, notes, and snippets.

def divides(k, n):
return n/k == n//k
def corresponds(l1, l2):
assert len(l1) == len(l2)
if not l1:
return True
for j in range(len(l2)):
for i in range(len(l1)):
if divides(l1[i], l2[j]):
@asmeurer
asmeurer / Riemann Hypothesis notes.pdf
Last active April 1, 2020 20:41
Verifying the Riemann Hypothesis with SymPy and mpmath
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@asmeurer
asmeurer / ndindex.md
Last active March 6, 2020 19:45
Idea for a ndindex manipulation library

I would like to have a library that makes it easier to manipulate indices to ndarrays. This primarily means slices and tuples of slices, but could also apply to fancy indexing.

Here are some of the pain points of working with the Python slice objects directly

  • slice is not hashable, so you have to convert it to a tuple to use it as a dictionary key.
@asmeurer
asmeurer / crash.txt
Created January 9, 2020 20:30
./runtests.py -v numba/tests/test_parallel_backend.py crash
Process: python3.7 [9619]
Path: /Users/USER/*/python3.7
Identifier: python3.7
Version: ???
Code Type: X86-64 (Native)
Parent Process: ??? [7597]
User ID: 501
Date/Time: 2020-01-09 13:28:23.538 -0700
OS Version: Mac OS X 10.15.2 (19C57)
@asmeurer
asmeurer / fix-dropbox-symlinks.py
Last active December 28, 2019 00:31
Fix Dropbox Symlinks
from numba import njit
from numba.npyufunc.parallel import _set_num_threads_jit, _launch_threads
import numpy as np
_launch_threads()
# Set this to something less than your number of cores
N_THREADS = 4
$ python -m removestar --max 80 numba/
--- original/numba/ctypes_support.py
+++ fixed/numba/ctypes_support.py
@@ -4,7 +4,7 @@
from __future__ import absolute_import
from numba.config import PYVERSION
-from ctypes import *
+from ctypes import c_int32, c_int64, c_size_t, sizeof
@asmeurer
asmeurer / hosts
Last active August 18, 2019 00:36 — forked from joielechong/hosts
Disable Skype ads: 1.) Add hosts to your hosts file 2.) Flush DNS resolver cache (ipconfig /flushdns)
# On Windows 7, 8, 10 Hosts file is in c:\windows\system32\drivers\etc\hosts
#
# Block Skype ads
127.0.0.1 secure-sin.adnxs.com # On skype 7.*
127.0.0.1 *.adnxs.com # On skype 7.*
127.0.0.1 logi10.xiti.com # On skype 7.*
127.0.0.1 *.everesttech.net # On skype 7.*
127.0.0.1 pixel.everesttech.net # On skype 7.*
127.0.0.1 d.adroll.com # On skype 7.*
@asmeurer
asmeurer / SymPy Webinar Examples.ipynb
Created September 27, 2018 20:14
SymPy Webinar Examples (2018-09-28)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@asmeurer
asmeurer / .gitignore
Last active November 14, 2023 01:34
SymPy Contribution Stats
.ipynb_checkpoints/