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
import torch | |
import torch.backends.cudnn as cudnn | |
import torch.utils.data | |
import resnet | |
model_names = sorted(name for name in resnet.__dict__ | |
if name.islower() and not name.startswith("__") | |
and name.startswith("resnet") | |
and callable(resnet.__dict__[name])) |
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 | |
# -*- coding: UTF-8 -*- | |
# File: cifar10-resnet.py | |
# Author: Yuxin Wu <ppwwyyxxc@gmail.com> | |
import numpy as np | |
import argparse | |
import os | |
from tensorpack.models.common import layer_register, VariableHolder, rename_get_variable |
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
# "Internal policy header for TR1 unordered_set and unordered_map" | |
# A VERY approximate adaptation to Python by 6.006 staff. Original file at: | |
# https://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-html-USERS-4.3/a01895.html | |
# If you want something tricky to gnaw on, take a look at the original C++ implementation | |
# Among other things, we stripped out code that does caching, error handling, and more. | |
# This library is free software; you can redistribute it and/or modify it under the | |
# terms of the GNU General Public License as published by the | |
# Free Software Foundation; either version 2, or any later version. |
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
// This file is was adapted from the GNU ISO C++ Library, | |
// by the 6.006 staff. If you're interested you can find a mirror | |
// of the original file at https://goo.gl/dgO3KR | |
// This library is free | |
// software; you can redistribute it and/or modify it under the terms | |
// of the GNU General Public License as published by the Free Software | |
// Foundation; either version 3, or (at your option) any later | |
// version. |
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
import json | |
import string | |
import pytz | |
import operator | |
from datetime import datetime | |
from nltk.corpus import stopwords | |
from collections import defaultdict | |
def sort_dict(dictionary): | |
return sorted(dictionary.items(), key=operator.itemgetter(1), reverse=True) |
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
import sys | |
import json | |
import base64 | |
import tweepy | |
import time | |
def is_valid_handle(handle): | |
#checks if given handle matches olivia handle specs | |
return True if re.compile("^[a-z]{10,}$").match(handle) else False |
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
0 * * * * cd /homes/skoppula/random-image && python /homes/skoppula/random-image/random-image.py > /homes/skoppula/random-image/random-image.log 2>&1 |
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
# Entirely from http://linguisticmystic.com/2015/03/04/how-to-write-a-dissertation-in-latex-using-markdown/ | |
# Captures the date for later use | |
date=`date +"%m-%d-%y"` | |
# Archives a copy of the plaintext by date, leaving a trail of prior drafts outside Dropbox | |
cp ~/Dropbox/plaintext/prospectus.md ~/Documents/prospectus/build/backups/prospectus-$date.txt | |
# Run Pandoc to turn the markdown file with the bulk of the document into a .TeX file |
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 | |
sass blog.scss blog.css | |
find posts/haml/ -name "*.haml" | while IFS= read -r pathname; do | |
haml_file="$pathname" | |
temp_path=${haml_file%".haml"} | |
html_path=${temp_path/haml/html} | |
echo "Compiling .haml of "${haml_file} | |
haml ${haml_file} ${html_path} |
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 'twitter' | |
require 'json' | |
require 'time' | |
def is_valid_handle(handle) | |
handle =~ /^[a-z]{11,}$/ and handle.include?('e') ? true : false | |
end | |
def is_valid_user(user) | |
has_good_handle = is_valid_handle(user.screen_name) |
NewerOlder