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
""" | |
Example adapted from https://github.com/aamini/introtodeeplearning lab2 part2 | |
© MIT Introduction to Deep Learning | |
http://introtodeeplearning.com | |
""" | |
import tensorflow as tf | |
import matplotlib.pyplot as plt | |
import functools | |
import numpy as np |
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
""" | |
Simple Gantt chart implementation | |
""" | |
from datetime import datetime as dt | |
import matplotlib | |
import matplotlib.pyplot as plt | |
from matplotlib.dates import date2num | |
import matplotlib.dates as mdates | |
import numpy |
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 | |
# generate mp4 animation from still images with ffmpeg. | |
if [ $# != 2 ]; then | |
echo "Usage: $(basename "$0") \"image/file/pattern_*.png\" output.mp4" | |
exit -1 | |
fi | |
pattern=$1 | |
outputfile=$2 |
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 | |
# loop through days of month given the first day | |
startdate="2019-06-01" | |
enddate=$(date -d "$startdate + 1 month" +"%Y-%m-%d") | |
ndays=$(( ($(date -d "$enddate" +%s) - $(date -d "$startdate" +%s) )/(60*60*24) )) | |
for i in $(seq 0 $(($ndays - 1)) ); do |
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
""" | |
Python argparse example demonstrating the most common usage options. | |
""" | |
import argparse | |
parser = argparse.ArgumentParser( | |
description='Description of the routine', | |
# includes default values in help entries | |
formatter_class=argparse.ArgumentDefaultsHelpFormatter, | |
) |
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 | |
# Install SLIM on rigilk cluster | |
source ~/bin/activate_gcc6.4 | |
source ~/bin/activate_cmake-3.11.4 | |
source ~/bin/activate_openmpi.sh | |
export BASEDIR=/home/karnat/sources/slim/install-script | |
mkdir -p $BASEDIR |
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
from thetis import * | |
""" | |
Computes a "strong" vertical integral of a field with pyop2 | |
by integrating along the vertical 1D edges of the prism. | |
""" | |
def strong_integral_2d(source, output_2d, z_coords): | |
"""Computes strong integral of a P1DGxP1DG field onto P1DG 2D field""" |
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
lc = 1.0/25.0; | |
Point(1) = {0, 0, 0, lc}; | |
Point(2) = {1, 0, 0, lc}; | |
Point(3) = {1, 1, 0, lc}; | |
Point(4) = {0, 1, 0, lc}; | |
Line(1) = {4, 3}; | |
Line(2) = {3, 2}; | |
Line(3) = {2, 1}; | |
Line(4) = {1, 4}; | |
Line Loop(5) = {1, 2, 3, 4}; |
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
""" | |
Draws Golden Spriral | |
Adapted from | |
http://junilyd.github.io/blog/2014/08/13/fibonacci-mystery-pythonified/ | |
Tuomas Karna | |
2016-05-14 | |
""" | |
import matplotlib.pyplot as plt |