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 csv | |
# input data is "plot.csv" file | |
## with first column as lable and (second, third) as (x, y) | |
"""sample | |
labels | x_label | y_label | |
-------------------------- | |
label_1| 1 | 2 | |
label_1| 2 | 3 | |
label_1| 3 | 4 | |
label_2| 1 | 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
from pydub import AudioSegment as As | |
import os | |
def change(p_af, p_maf, duer, fr= None) : | |
"""$p_af is path of input audio file | |
$p_maf is path for output audio file | |
$duer = output audio file duration (in seconds) | |
$fr = output audio file frame rate""" | |
with open(p_af, 'rb') as af : | |
sound = As.from_file(af) |
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
from gtts import gTTS | |
from io import BytesIO | |
import pygame; pygame.mixer.init() | |
def say(text): | |
tts = gTTS(text=text, lang='en') | |
fp = BytesIO() | |
tts.write_to_fp(fp) | |
fp.seek(0) | |
pygame.mixer.music.load(fp) |
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
from matplotlib import pyplot as plt | |
import librosa | |
#For specgram | |
NFFT = 1024 | |
noverlap = 900 | |
#For MFCC | |
n_mfcc = 40 |
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
ones = ['<0>',"one","two","three","four","five","six","seven","eight","nine"] | |
tens = ['','<Teenify>',"twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety"] | |
def Teenify(num): | |
num[1]='' | |
if num[0]=="<0>":num[0]="ten" | |
elif num[0]=="one":num[0]="eleven" | |
elif num[0]=="two":num[0]="twelve" | |
elif num[0]=="three":num[0]="thirteen" | |
elif num[0]=="five":num[0]="fifteen" |
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
var url = "url_of_another_js" | |
document.write('<script src="'.concat(url,'"></script>')) |
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
#nkpro REPLinJulia | |
println("Julia-v 1.0.0") | |
while true | |
print("\n>") | |
expr = readline() | |
if expr == "exit" | |
break | |
end | |
eval(Meta.parse(expr)) | |
end |
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 os, random, numpy | |
def getPathALables(p_TDS, p_VDS =None): | |
""" | |
$p_TDS = path of training data set | |
$p_VDS = path of validation data set | |
$return[0] = All_labels | |
$return[1][0] = paths of files in training data set | |
$return[1][1] = one hot encoded lables for $return[1][0] | |
$rerurn[2] is same as $return[1] for validation data set |
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
dockerd &>/dev/null & | |
echo -n "waiting for docker daemon to start ..." | |
o="$(sudo docker images 2>/dev/null)" | |
l=`expr length "$o"` | |
while [ $l -eq 0 ] | |
do | |
sleep 0.5 | |
echo -n '.' | |
o="$(sudo docker images 2>/dev/null)" | |
l=`expr length "$o"` |
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
# pyenv | |
git clone https://github.com/pyenv/pyenv.git ~/.pyenv | |
# pyenv-virtualenv | |
git clone https://github.com/pyenv/pyenv-virtualenv.git ~/.pyenv/plugins/pyenv-virtualenv | |
# pyenv-pip-migrate | |
git clone git://github.com/pyenv/pyenv-pip-migrate.git ~/.pyenv/plugins/pyenv-pip-migrate | |
# pyenv-update | |
git clone https://github.com/pyenv/pyenv-update.git ~/.pyenv/plugins/pyenv-update | |
# adding pyenv to environment | |
echo '#pyenv{' >> ~/.bashrc |
OlderNewer