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 | |
""" | |
Demonstrate how to pass IPC handles to GPU data between processes in Python. | |
""" | |
import ctypes | |
import numpy as np | |
import multiprocessing as mp | |
import zmq |
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 | |
""" | |
Serialize/unserialize a class with a pandas data structure attribute using msgpack. | |
""" | |
import msgpack | |
import numpy as np | |
import pandas as pd |
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 | |
""" | |
Retrieve intraday stock data from Google Finance. | |
""" | |
import csv | |
import datetime | |
import re | |
import pandas as pd |
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 | |
""" | |
Python functions for finding open files and PIDs that have opened a file. | |
""" | |
import numbers | |
import subprocess | |
try: |
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
#!/bin/bash | |
# Demonstrates how to create a headless display using xvfb. | |
# Create the display: | |
Xvfb :100 -ac & | |
PID1=$! | |
export DISPLAY=:100.0 | |
# Run the application that needs the display: |
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 | |
""" | |
Routines for scaling biomedical image data by window level and width. | |
""" | |
import numpy as np | |
win_dict = {'abdomen': | |
{'wl': 60, 'ww': 400}, |
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
// How to "wrap" a CUDA kernel with a C++ class; the kernel must be defined outside of | |
// the class and launched from within a class instance's method. | |
#include <iostream> | |
#include <cuda.h> | |
#include <cuda_runtime.h> | |
#define LEN 10 | |
__global__ void kernel(int *a, int *b, unsigned int N); |
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 python3 | |
""" | |
How to use pdfbox's PDFTextStripper class in Python. | |
""" | |
import pathlib | |
import pkg_resources | |
import re | |
import urllib.request |
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 python3 | |
""" | |
How to call pdfbox's API with JPype. | |
""" | |
import pathlib | |
import pkg_resources | |
import re | |
import urllib.request |
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 | |
""" | |
Farm out processing to multiple processes via zmq. | |
""" | |
import re, pickle, time, threading | |
import multiprocessing as mp | |
import zmq | |
from zmq.eventloop.ioloop import IOLoop |
NewerOlder