A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)
| # /usr/bin/env python | |
| # | |
| # Author: Red5d | |
| # | |
| # Description: Extract and run OCR on subtitles from a PGS-format .sup file. | |
| # | |
| # Example Usage: python sup2srt.py bd_subtitles.sup bd_subtitles.srt | |
| # | |
| # Dependencies: | |
| # - pytesseract |
| import numpy as np | |
| def los_to_earth(position, pointing): | |
| """Find the intersection of a pointing vector with the Earth | |
| Finds the intersection of a pointing vector u and starting point s with the WGS-84 geoid | |
| Args: | |
| position (np.array): length 3 array defining the starting point location(s) in meters |
| --- a/target/linux/ipq806x/base-files/etc/board.d/01_leds | |
| +++ b/target/linux/ipq806x/base-files/etc/board.d/01_leds | |
| @@ -50,6 +50,15 @@ zyxel,nbg6817) | |
| ;; | |
| esac | |
| +case "$board" in | |
| +netgear,r7800) | |
| + ucidef_set_led_wlan "wlan2g" "WLAN 2G" "ath10k-phy1" "phy1tpt" | |
| + ucidef_set_led_wlan "wlan5g" "WLAN 5G" "ath10k-phy0" "phy0tpt" |
| """ | |
| A minimal web server that runs shell commands, powered by Tornado and its | |
| Subprocess module. It does non-blocking IO and streams the response. | |
| To start the server: | |
| $ python tornado_subprocess.py | |
| To send a shell command using httpie: |
A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)
| #! /bin/sh | |
| set -e | |
| # Save the $timeout and $timeout_style values set by /etc/grub.d/00_header | |
| # before /etc/grub.d/30_os-prober messes them up. | |
| cat << EOF | |
| set timeout_bak=\${timeout} | |
| set timeout_style_bak=\${timeout_style} | |
| EOF |
| import java.util.Iterator; | |
| import java.util.Map; | |
| import java.util.TreeMap; | |
| import javax.net.ssl.SSLServerSocketFactory; | |
| /* | |
| * Source from Christopher Schultz | |
| * @see http://markmail.org/message/zn4namfhypyxum23 | |
| */ | |
| public class SSLInfo |
| import javax.net.ssl.SSLParameters; | |
| import javax.net.ssl.SSLSocket; | |
| import javax.net.ssl.SSLSocketFactory; | |
| import java.io.*; | |
| /** Establish a SSL connection to a host and port, writes a byte and | |
| * prints the response. See | |
| * http://confluence.atlassian.com/display/JIRA/Connecting+to+SSL+services | |
| */ | |
| public class SSLPoke { |
| ########################### GTEST | |
| # Enable ExternalProject CMake module | |
| INCLUDE(ExternalProject) | |
| # Set default ExternalProject root directory | |
| SET_DIRECTORY_PROPERTIES(PROPERTIES EP_PREFIX ${CMAKE_BINARY_DIR}/third_party) | |
| # Add gtest | |
| # http://stackoverflow.com/questions/9689183/cmake-googletest | |
| ExternalProject_Add( |