This file contains hidden or 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 | |
apt update | |
apt install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \ | |
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \ | |
xz-utils tk-dev libffi-dev liblzma-dev python-openssl git | |
curl https://pyenv.run | bash | |
# Load pyenv automatically by adding |
This file contains hidden or 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
with open('/tmp/sylviabeach-card-images.txt') as found_images: | |
urls = found_images.read().split('\n') | |
identifiers = {} | |
for u in urls: | |
identifier = '/'.join(u.split('/')[-3:]) | |
identifiers[identifier] = '' | |
with open('/tmp/pudl0123-825298-noboxes-sorted.txt') as image_list: |
This file contains hidden or 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
# use env to set django settings module | |
# env DJANGO_SETTINGS_MODULE=mep.settings python mep_cardholders.py | |
import csv | |
import codecs | |
import django | |
from django.db import models |
This file contains hidden or 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
library(tidyr) | |
library(dplyr) | |
library(UpSetR) | |
# read in the data | |
ppa <- read.csv("ppa-digitizedworks-20190419T18_24_42.csv") | |
# subset to only needed rows and split Collection into multiple rows | |
new_df <- ppa %>% select("Title", "Source.ID", "Collection") %>% separate_rows("Collection", sep=";") | |
# give a truth column value to map on spread |
This file contains hidden or 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
year | count | |
---|---|---|
1972-1974 | 1 | |
1973 | 1 | |
1975-1977 | 1 | |
1980-1990 | 1 | |
1981 | 1 | |
1985 | 1 | |
1985-1990 | 1 | |
1986 | 1 | |
1988 | 3 |
This file contains hidden or 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
// path and webpack | |
const path = require('path') | |
const webpack = require('webpack') | |
// webpack plugins | |
const BundleTracker = require('webpack-bundle-tracker') | |
const VueLoaderPlugin = require('vue-loader/lib/plugin') | |
const MiniCssExtractPlugin = require('mini-css-extract-plugin') | |
// configure dev mode because of absurdly misleading webpack documentation |
This file contains hidden or 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
const webpackConf = require('./webpack.config.js') | |
const merge = require('webpack-merge') | |
module.exports = function (config) { | |
config.set({ | |
browsers: [ 'ChromeHeadless' ], //run in Chrome | |
browserNoActivityTimeout: 60000, | |
frameworks: [ 'mocha', 'sinon-chai' ], //use the mocha test framework | |
files: [ | |
//'src/**/*.{jsx,js}', |
This file contains hidden or 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 | |
#SBATCH --gres=gpu:1 | |
#one GPU, asking for only one CPU core since we're offloading to GPU | |
#SBATCH -t 00:05:00 | |
#SBATCH --mail-type=begin | |
#SBATCH --mail-type=end | |
#SBATCH [email protected] | |
module load anaconda3 | |
# assumes you have a conda environment named tf with tensorflow and matplotlib, i.e. |
This file contains hidden or 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
import pickle | |
from tensorflow import keras | |
# Compute nodes don't have internet, so download in advance and pickle the | |
# image training data | |
# adapted from https://www.tensorflow.org/tutorials/keras/basic_classification | |
# see notes there for how to actually work things | |
fashion_mnist = keras.datasets.fashion_mnist |
This file contains hidden or 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
import pickle | |
import tensorflow as tf | |
from tensorflow import keras | |
import numpy as np | |
import matplotlib.pyplot as plt | |
# reload pickled data |
NewerOlder