Skip to content

Instantly share code, notes, and snippets.

View bfroehle's full-sized avatar

Bradley M. Froehle bfroehle

View GitHub Profile
@bfroehle
bfroehle / scalapack.rb
Created March 3, 2013 00:19
ScaLAPACK Homebrew Formula
require 'formula'
class Scalapack < Formula
homepage 'http://www.netlib.org/scalapack/'
url 'http://www.netlib.org/scalapack/scalapack-2.0.2.tgz'
sha1 'ff9532120c2cffa79aef5e4c2f38777c6a1f3e6a'
option 'test', 'Verify the build with make test'
option 'with-openblas', "Use openblas instead of Apple's Accelerate.framework"
#!/usr/bin/env python
import re
import requests
html = requests.get('http://wiki.ipython.org/Special:AllPages')
all_pages_table = re.search('<table class="mw-allpages-table-chunk">(.*)</table>',
html.content, re.DOTALL).group()
titles = re.findall(r'title="([^"]*?)"', all_pages_table)
@bfroehle
bfroehle / umfpack.cpp
Created December 6, 2012 22:55
UMFPACK Numeric/Symbolic Smart Pointer in C++
#include "umfpack.h"
/**
* Smart pointer versions of the typical "void *Numeric" and
* "void *Symbolic" defintions.
*
* For example:
* umfpack_dl_numeric_ptr Numeric;
* umfpack_dl_numeric(..., &Numeric, ...);
* // No call to umfpack_dl_free_numeric required, as it is
@bfroehle
bfroehle / docstring_property.py
Created November 8, 2012 19:35
Property decorator for the `__doc__` attribute.
"""Property decorator for the `__doc__` attribute.
Useful for when you want a custom docstring for class instances
while still showing a generic docstring for the class itself.
A naive attempt using `@property` generally breaks Sphinx as
`cls.__doc__` returns the property object itself, and not a string.
See the documentation for `docstring_property` for an example.
"""
$ LLVM_CONFIG_PATH=llvm-config-3.1 python setup.py build
LLVM version = 3.1
Generate intrinsic IDs
Using PTX
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/llvm
copying llvm/__init__.py -> build/lib.linux-x86_64-2.7/llvm
@bfroehle
bfroehle / ipython-stripped.html
Created August 17, 2012 22:35
ipython/ipython #2314
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head><body>
<p>Python 2.7.3 (default, Aug 1 2012, 05:14:39) </p>
<p>Type &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.</p>
<p><br /></p>
<p>IPython 0.14.dev -- An enhanced Interactive Python.</p>
<p>? -&gt; Introduction and overview of IPython's features.</p>
<p>%quickref -&gt; Quick reference.</p>
@bfroehle
bfroehle / Cython Magic.ipynb
Created August 14, 2012 00:31
Cython Magic
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bfroehle
bfroehle / results.log
Created July 31, 2012 19:00
IPython test log
..............................................
----------------------------------------------------------------------
Ran 46 tests in 0.060s
OK
....................................................E.....................................................................................................................................................................................................................................................................................................................................................................................................................................K.........
======================================================================
ERROR: test format constraint, and validity of jpeg and png
----------------------------------------------------------------------
Traceback (most recent call last):
@bfroehle
bfroehle / gist:3153959
Created July 21, 2012 00:11
IPython #2179 Failure
..............................................
----------------------------------------------------------------------
Ran 46 tests in 0.066s
OK
..................................................................................................................................................................................................................S....................................................................................................................................K.........
----------------------------------------------------------------------
Ran 353 tests in 23.375s
OK (KNOWNFAIL=1, SKIP=1)
@bfroehle
bfroehle / 00README.rst
Created June 13, 2012 16:01 — forked from GaelVaroquaux/00README.rst
Copy-less bindings of C-generated arrays with Cython

Cython example of exposing C-computed arrays in Python without data copies

The goal of this example is to show how an existing C codebase for numerical computing (here c_code.c) can be wrapped in Cython to be exposed in Python.

The meat of the example is that the data is allocated in C, but exposed in Python without a copy using the PyArray_SimpleNewFromData numpy