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
# Here’s the URL to a journal’s search results page for papers from the Geostationary Lightning Mapper that | |
# were published from 2018-2021. There are several pages of results; below is an example of the third and final URL | |
# Download the webpage. Do this for each page of the search results, changing the URL and output filename: | |
curl "https://journals.ametsoc.org/search?access_0=all&fromDate=2018&page=3&pageSize=50&q1=geostationary+lightning+mapper&sort=relevance&toDate=2021" > page3dois.txt | |
# Then concatenate all three files, and save out just the DOIs linked on each page. | |
cat page[1-3]dois.txt | grep -Eoi '<a [^>]+>' | |
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
%%----------------------------------------------------------------------- | |
%% Make your own quadrille, graph, hex, etc paper! | |
%% Uses the pgf/TikZ package for LaTeX, which should be part of | |
%% any modern TeX installation. | |
%% Email: mcnees@gmail.com | |
%% Twitter: @mcnees | |
%%----------------------------------------------------------------------- | |
\documentclass[11pt]{article} |
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 | |
def array_for_sliding_window(x, wshape): | |
"""Build a sliding-window representation of x. | |
The last dimension(s) of the output array contain the data of | |
the specific window. The number of dimensions in the output is | |
twice that of the input. | |
Parameters |
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
""" | |
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
BSD License | |
""" | |
import numpy as np | |
# data I/O | |
data = open('input.txt', 'r').read() # should be simple plain text file | |
chars = list(set(data)) | |
data_size, vocab_size = len(data), len(chars) |
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
#ifndef PY_H | |
#define PY_H | |
#include <Python.h> | |
#include <type_traits> | |
#include <utility> | |
#include <string> | |
template<typename R, typename...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 json | |
from pprint import pprint as pp | |
import numpy as np | |
from numba import autojit, typeof, int32 | |
INF = float('inf') | |
@autojit | |
def jenks_matrics_init(data, n_classes, ): |
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
# Author: Vlad Niculae <vlad@vene.ro> | |
# Makes use of memory_profiler from Fabian Pedregosa | |
# available at https://github.com/fabianp/memory_profiler | |
from IPython.core.magic import Magics, line_magic, magics_class | |
class MemMagics(Magics): | |
@line_magic | |
def memit(self, line='', setup='pass'): |
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
""" Play an audio file with pyaudio while concurrently showing audio playhead | |
on a matplotlib plot of the audio time series and spectrogram. | |
Adjust duration and filename in the script below to reflect your audio file. | |
v. 0.1 | |
21 Mar 2012 | |
Eric Bruning | |
""" |
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
So, provided you have some image files of form "_tmp0000.png", you can run generate_movies.sh to create a "result.txt" file which contains a list of the files successfully generated. | |
Additional columns are used to indicate testing status: '1' (failed), '0' (successful), '0.5' (works, but serious artifacts), '?' (couldn't try). | |
The script will provide the first column by testing if the movie plays using ffplay. Note, no movie gets displayed to the screen, so this is fairly quick. I have included my "result.txt" file which contains testing results for additional platforms. Platforms are: | |
* LibreOffice Impress on Linux | |
* QuickTime on Mac | |
* MS Office PowerPoint on Mac | |
* OpenOffice Impress on Mac |
NewerOlder