Last Update: 02.05.2017
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 base64 | |
import requests | |
import os | |
from io import StringIO | |
output_path = "output" | |
default_url = "https://www.scanofthemonth.com/scans/game-boy-compendium" | |
source = requests.get(default_url) | |
ujson = set([x.strip().replace('"', "").split("=")[-1] for x in source.text.split("\n") if "data-src=" in x]) |
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 netCDF4 | |
import xarray as xr | |
import numpy as np | |
from glob import glob | |
params = ["U10", "V10", "PSFC", "lon", "lat", "time"] | |
def xrreaddumb(fpathpattern, ilatdim="lati", ilondim="long", | |
ilatcoord="latitude", iloncoord="longitude", |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 pyugrid | |
import netCDF4 | |
# Default ADCIRC output (from OWI) | |
adcirc = "fort.63.nc" | |
nc = netCDF4.Dataset(adcirc) | |
ugobj = pyugrid.UGrid.from_nc_dataset(nc) | |
pyugrid.read_netcdf.is_valid_mesh(nc, "adcirc_mesh") | |
# SELFE sample |
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 numpy as np | |
import struct | |
def read_stl(filename): | |
with open(filename) as f: | |
Header = f.read(80) | |
nn = f.read(4) | |
Numtri = struct.unpack('i', nn)[0] | |
record_dtype = np.dtype([ |
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/python | |
import subprocess, sys, shlex | |
#command = shlex.split(sys.argv[1]) | |
command = "optirun " + sys.argv[1] | |
test = True | |
c = 0 | |
while test: |
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 location is "~/.pudb-bp" in older versions of pudb | |
(setq pudb-bp-file (expand-file-name "~/.config/pudb/saved-breakpoints")) | |
(defun pudb-add-breakpoint () | |
(interactive) | |
(append-to-file | |
(concat "b " buffer-file-name ":" | |
(nth 1 (split-string (what-line))) "\n") | |
nil pudb-bp-file)) | |
(define-key py-mode-map (kbd "C-c C-t") 'pudb-add-breakpoint) |
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
# Install spatialindex 1.7.0+ | |
wget http://download.osgeo.org/libspatialindex/spatialindex-src-1.7.1.tar.gz | |
tar zxvf spatialindex-src-1.7.1.tar.gz | |
cd spatialindex-src-1.7.1 | |
./configure | |
make -j 2 | |
sudo make install | |
sudo ldconfig |
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
sudo apt-get install dpkg-dev libcurl4-gnutls-dev | |
# Download netCDF4 source unpack and cd to directory | |
wget ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4.2.1.1.zip | |
unzip netcdf-4.2.1.1.zip | |
cd netcdf-4.2.1.1 | |
LDFLAGS=-L/usr/local/lib CPPFLAGS=-I/usr/local/include ./configure --enable-netcdf-4 --enable-dap --enable-shared --prefix=/usr/local --disable-doxygen | |
make -j 2 | |
sudo make install | |
cd .. |
NewerOlder