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 | |
# find . -type f ! -name "*.[mM][pP]3" | |
# find . -type f ! -name "*.[mM][pP]3" -delete | |
for f in */; | |
do | |
# echo $f | |
cd "$f" && echo $f && for audio in ./*.[mM][pP]3; do echo "file '$audio'" >> list.txt; done && ffmpeg -f concat -safe 0 -i list.txt -c copy ../out_f.mp3 && rm *.[mM][pP]3 list.txt && mv ../out_f.mp3 out.mp3 && cd .. | |
# cd "$f" && ffmpeg -i out.mp3 2>&1 | awk -F: '/Duration:/{print $2+$3/60+$4/3600}'; cd .. |
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 serial, socket | |
TCP_IP = '192.168.1.100' | |
TCP_PORT = 49780 | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
s.bind((TCP_IP, TCP_PORT)) | |
s.listen(1) |
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
pip2 list -o | cut -d ' ' -f1 | xargs -n1 sudo pip2 install -U |
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
# $Id$ | |
# | |
# Locate all standard modules available in this build. | |
# | |
# This script is designed to run on Python 1.5.2 and newer. | |
# | |
# Written by Fredrik Lundh, January 2005 | |
# | |
import imp, sys, os, re, time |
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 random, datetime, Adafruit_DHT, time | |
import numpy as np | |
def am2302_data(): | |
humidity, temperature = Adafruit_DHT.read_retry(Adafruit_DHT.AM2302, '16') | |
if humidity is not None and temperature is not None: | |
print 'Temp={0:0.1f}*C Humidity={1:0.1f}%'.format(temperature, humidity) | |
if (humidity > 100) or (humidity < 0): |
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
#include <stdio.h> | |
#include <cuda.h> | |
__global__ void mult_vect(float * x, float * y, float * z, int n) | |
{ | |
int idx= blockIdx.x * blockDim.x + threadIdx.x; | |
if(idx < n) | |
{ | |
z[idx] = x[idx] * y[idx]; | |
} |
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 urllib, datetime, re, os | |
from time import sleep | |
import matplotlib.pyplot as plt | |
from timeit import default_timer | |
import numpy as np | |
from dateutil.relativedelta import relativedelta | |
import scipy.interpolate as inter | |
maxResult = 100 | |
pub_dates = [] |
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 itertools, glob, os, re, difflib | |
import timeit as ti | |
# srts = os.listdir(os.path.dirname(os.path.abspath(__file__))) | |
srts = glob.glob(os.path.dirname(os.path.abspath(__file__))+'/*.srt') | |
srtsComb = list(itertools.combinations(srts, 2)) | |
print len(srtsComb) | |
i = 0 | |
repls = (',', ''),('</i>', ''),('<i>', ''),('\n', ''),('-', ''),(' ', ''),(':', ''),('#', '') |