http://www.cs.princeton.edu/academics/catalog
- COS314 - Introduction to Computer Music
- COS318 - Operating Systems
- COS320 - Compiling Techniques
- COS326 - Functional Programming
| #!/usr/bin/python | |
| import re, urllib, urllib2 | |
| class Spreadsheet(object): | |
| def __init__(self, key): | |
| super(Spreadsheet, self).__init__() | |
| self.key = key | |
| class Client(object): |
| <?php | |
| /** | |
| * @author James Morris <[email protected]> | |
| */ | |
| $html = <<<'EOF' | |
| <html> | |
| <body> | |
| <h1>Foo</h1> | |
| <div id="content"> |
http://www.cs.princeton.edu/academics/catalog
| // Ajax File upload with jQuery and XHR2 | |
| // Sean Clark http://square-bracket.com | |
| // xhr2 file upload | |
| $.fn.upload = function(remote, data, successFn, progressFn) { | |
| // if we dont have post data, move it along | |
| if (typeof data != "object") { | |
| progressFn = successFn; | |
| successFn = data; | |
| } |
A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)
| Download Google Drive files with WGET | |
| Example Google Drive download link: | |
| https://docs.google.com/open?id=[ID] | |
| To download the file with WGET you need to use this link: | |
| https://googledrive.com/host/[ID] | |
| Example WGET command: |
| """ | |
| A weighted version of categorical_crossentropy for keras (2.0.6). This lets you apply a weight to unbalanced classes. | |
| @url: https://gist.github.com/wassname/ce364fddfc8a025bfab4348cf5de852d | |
| @author: wassname | |
| """ | |
| from keras import backend as K | |
| def weighted_categorical_crossentropy(weights): | |
| """ | |
| A weighted version of keras.objectives.categorical_crossentropy | |
| import argparse | |
| import os | |
| import shutil | |
| import time | |
| import torch | |
| import torch.nn as nn | |
| import torch.nn.parallel | |
| import torch.backends.cudnn as cudnn | |
| import torch.optim |
| import torch | |
| import torch.nn as nn | |
| import numpy as np | |
| import torch.optim as optim | |
| from torch.autograd import Variable | |
| # (1, 0) => target labels 0+2 | |
| # (0, 1) => target labels 1 | |
| # (1, 1) => target labels 3 | |
| train = [] |