This file contains hidden or 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
| nvidia-smi | awk ' | |
| BEGIN { FS=OFS="|" } | |
| $0 ~ /MiB/ && $0 !~ /GPU Memory/ { | |
| split($3, arr, /MiB *\//); | |
| gsub(/[0-9.]+MiB *\//, sprintf("%2.2fGiB /", arr[1] / 1024), $3); | |
| gsub(/[0-9.]+MiB/, sprintf("%2.2fGiB", arr[2] / 1024), $3); | |
| print $1, $2, $3, $4; | |
| next; | |
| } | |
| { print }' |
This file contains hidden or 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
| def plt_gen(cols, nrows=1, figsize=[20,5]): | |
| plt.clf() | |
| fig, ax = plt.subplots(nrows=nrows, ncols=cols, figsize=figsize) | |
| for i, axi in enumerate(ax.flat): | |
| axi.set_title(i) | |
| yield i, axi, lambda img: axi.imshow(img, cmap='gray', vmin=0, vmax=1) | |
| plt.show() |
This file contains hidden or 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
| # source for names https://www.sec.gov/rules/other/4-460list.htm | |
| from collections import Counter | |
| import cPickle as pickle | |
| import random | |
| import itertools | |
| import string | |
| def words(entry): | |
| return [word.lower().decode('ascii', 'ignore') for word in entry.split()] |
This file contains hidden or 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
| //----------------------------------------------- | |
| // SPARK CORE CUSTOM PWM FREQUENCY EXAMPLE | |
| //=============================================== | |
| // Define your own frequency below! | |
| // PWM Glitch issue fixed, only sets up PWM once, | |
| // ... thereafter sets duty cycle. | |
| // This allows true 0 - 100% PWM. | |
| // Copy this into a new application at: | |
| // https://www.spark.io/build and go nuts! | |
| //----------------------------------------------- |