This file contains 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
$ 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 |
This file contains 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
"""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. | |
""" |
This file contains 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
#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 |
This file contains 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 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) |
This file contains 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
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" |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 python | |
""" | |
Change the screen resolution and restart Nautilus. | |
You may need to provide your VNC server with a list of available | |
resolutions. See: | |
http://stackoverflow.com/questions/15816/changing-the-resolution-of-a-vnc-session-in-linux | |
""" | |
#----------------------------------------------------------------------------- |
This file contains 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 python | |
"""Calculate the minimal bounding box of a series of images. | |
Example usage:: | |
$ find_bounding_box.py *.jpg | |
836x680+64+0 | |
$ mogrify -crop 836x680+64+0 *.jpg | |
Requires the `identify` command which is part of ImageMagick. |
This file contains 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
#include <iostream> | |
// Emulate the for-else Python construct in C++. | |
// http://docs.python.org/2/tutorial/controlflow.html#break-and-continue-statements-and-else-clauses-on-loops | |
int main() { | |
for (int n = 2; n < 10; n++) { | |
bool success = true; | |
for (int x = 2; x < n || (success = false); x++) { | |
if (n % x == 0) { |
This file contains 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
""" | |
An Python re-implementation of hierarchical module import. | |
Function names and arguments have been chosen to mimic the C code in | |
`Python/import.c` whenever possible. | |
This code is intended to be read, not executed. However, it does work | |
-- all you need to do to enable it is "import knee". | |
(The name is a pun on the klunkier predecessor of this module, "ni".) |