Skip to content

Instantly share code, notes, and snippets.

@ajfriend
ajfriend / gist:6372098
Created August 28, 2013 22:19
homebrew: openblas failed to build on 10.8.4
the main error seems to be:
make: *** [getarch_2nd] Error 1
Makefile:129: *** OpenBLAS: Detecting CPU failed. Please set TARGET explicitly, e.g. make TARGET=your_cpu_target. Please read README for the detail.. Stop.
$ brew doctor
Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import cvxpy.utilities as u
import cvxpy.lin_ops.lin_utils as lu
from cvxpy.atoms.atom import Atom
from cvxpy.constraints import SOC
import math
class gm_constr(Atom):
""" Geometric mean of two scalars; :math:`(x_1, \cdots, x_n)^{1/n}`. """
def __init__(self, t, x, y):
super(gm_constr, self).__init__(t, x, y)
import numpy as np
import matplotlib.pyplot as plt
def cos_sim(x1,x2):
"Compute cosine similarity"
n1 = np.linalg.norm(x1)
n2 = np.linalg.norm(x2)
if n1 <= 0 or n2 <= 0:
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ajfriend
ajfriend / out.sh
Last active April 30, 2019 05:04
H3-py cython install errors
--------------------------------------------------------------------------------
-- Trying "Ninja" generator
--------------------------------
---------------------------
----------------------
-----------------
------------
-------
--
Not searching for unused variables given on the command line.
--------------------------------------------------------------------------------
-- Trying "Ninja" generator
--------------------------------
---------------------------
----------------------
-----------------
------------
-------
--
Not searching for unused variables given on the command line.
@ajfriend
ajfriend / data.py
Created March 22, 2020 20:50
H3 kRing timing benchmarks
s_new_1 = """
-- kRing10: 13.645000 microseconds per iteration (10000 iterations)
-- kRing20: 50.505400 microseconds per iteration (10000 iterations)
-- kRing30: 110.635500 microseconds per iteration (10000 iterations)
-- kRing40: 193.416000 microseconds per iteration (10000 iterations)
-- kRing100: 1171.804000 microseconds per iteration (1000 iterations)
-- kRing400: 17707.125000 microseconds per iteration (1000 iterations)
-- kRingPentagon10: 384.726000 microseconds per iteration (500 iterations)
-- kRingPentagon20: 3135.216000 microseconds per iteration (500 iterations)
-- kRingPentagon30: 10355.700000 microseconds per iteration (50 iterations)
# flake8: noqa
from ..api.basic_str import (
compact as
compact,
edge_length as
hex_edge_length_avg,
geo_to_h3 as
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.