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 | |
# Intel MKL is now freely available even for commercial use. This script | |
# attempts to install the MKL package automatically from Intel's repository. | |
# | |
# For manual repository setup instructions, see: | |
# https://software.intel.com/articles/installing-intel-free-libs-and-python-yum-repo | |
# https://software.intel.com/articles/installing-intel-free-libs-and-python-apt-repo | |
# | |
# For other package managers, or non-Linux platforms, see: |
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 torch | |
from torch.optim.optimizer import Optimizer, required | |
class SGD_MC(Optimizer): | |
r"""Implements stochastic gradient descent (optionally with momentum). | |
Nesterov momentum is based on the formula from | |
`On the importance of initialization and momentum in deep learning`__. | |
Args: | |
params (iterable): iterable of parameters to optimize or dicts defining |
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/env python3 | |
import lilcom | |
import numpy as np | |
a = np.empty((0)) | |
b = lilcom.compress(a) | |
assert b[0] == 76 |
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 sys | |
import Adafruit_DHT | |
import json | |
import time | |
from datetime import datetime | |
def update(hum, temp, t): | |
with open('/var/www/html/data.json', 'r+') as f: | |
data = json.load(f) |
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/env python | |
import RPi.GPIO as GPIO | |
import time | |
import requests | |
import os | |
RED=22 | |
YELLOW=27 | |
GREEN=17 |
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
with open("/mnt/dev/lexicon.txt", "r") as file1, open("/mnt/dev/l.txt", "w") as file2: | |
for line in file1: | |
items = line.split("\t") | |
if items[3].startswith("nn"): | |
items[3] = "1" | |
elif items[3].startswith("vv"): | |
items[3] = "2" | |
elif items[3].startswith("jj"): | |
items[3] = "3" | |
elif items[3].startswith("rr"): |
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/sh | |
touch /run/tmp | |
vcgencmd measure_temp | cut -d"=" -f2 > /run/temp |
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 | |
scp aadps.net:/tmp/db.zip /home/cathiabi/dbback/$(date +%y%m%d).zip | |
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
[Definition] | |
failregex = ^<HOST> - - \[\] ".*" 30[12] \d+ ".*" "[^-].*".*$ | |
ignoreregex = | |
datepattern = ^[^\[]*\[({DATE}) | |
{^LN-BEG} |
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 | |
m3u="/www/1.m3u" | |
dvrpath="/mnt/media/" | |
echo -n "频道名:" | |
read chan | |
while [ -z $(cat /www/1.m3u | grep ${chan} -A 1 | head -2 | tail -1) ]; do | |
echo -n "无此频道,请重新输入:" | |
read chan | |
done |