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
;; emacs startup file. | |
;; uncomment next line to disable loading of "default.el" at startup | |
;; (setq inhibit-default-init t) | |
;; add personal load path | |
(push "~/.emacs.d/lisp" load-path) | |
;; set up MELPA package archive | |
(require 'package) |
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
library(sp) | |
library(rgdal) | |
library(raster) | |
library(ncdf) | |
##aez map | |
## extract data from shape file | |
GIS_DIR <- "./cropdata" | |
GIS_FILE <- "GCAM_region_AEZ" |
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 | |
""" | |
Calculates total, nonblank and net lines of code for Python scripts. | |
""" | |
import os | |
import re | |
def get_line_count(blob): |
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
country | two-letter | ISO | numerical | |
---|---|---|---|---|
Afghanistan | AF | AFG | 4 | |
Aland Islands | AX | ALA | 248 | |
Albania | AL | ALB | 8 | |
Algeria | DZ | DZA | 12 | |
American Samoa | AS | ASM | 16 | |
Andorra | AD | AND | 20 | |
Angola | AO | AGO | 24 | |
Anguilla | AI | AIA | 660 | |
Antarctica | AQ | ATA | 10 |
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
## a batch of 3 4x4x2 images as input. We will upsample these to 8x8 | |
input_data = np.ones([3, 4, 4, 2]) | |
filter_shape = [3,3,4,2] # width, height, channels-out, channels-in | |
tconv_filter = np.ones(filter_shape) # make the filter all ones so that we can manually calculate the output | |
# obviously, having all the filter channels have the same coefficients defeats | |
# the purpose of having multiple channels, but this is just an example | |
output_shape = [8, 8, 4] # width, height, channels-out (notice we don't have the batch size dimension -- more on that later) | |
## set up the slots for the data |
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
--- | |
title: "R Notebook" | |
output: html_notebook | |
--- | |
```{r setup} | |
library(hector) | |
library(assertthat) | |
library(ggplot2) | |
library(ggthemes) |
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
savepkgs <- function(saveloc) | |
{ | |
instpkg <- installed.packages() | |
cranpkg <- available.packages() | |
iscran <- instpkg[,'Package'] %in% cranpkg[,'Package'] | |
pkgdata <- data.frame(package=instpkg[,'Package'], iscran=iscran, instvers=instpkg[,'Version']) | |
write.csv(pkgdata, saveloc) | |
} | |
restore_pkgs <- function(pkglistfile) |