Skip to content

Instantly share code, notes, and snippets.

@twobob
twobob / wpm.py
Last active June 26, 2022 23:53
A version that processes multiple vtt formatted subtitles from YouTube and performs a rough mean wpm
import youtube_dl
import time
import re
import requests
import os
import sys
# Get the arguments from the command-line except the filename
argv = sys.argv[1:]
Url = ""
@twobob
twobob / FasterRoughMeanWPM.py
Last active June 23, 2022 00:43
Fast and rough mean WPM approx using vtt files and meta info for approximation
import youtube_dl
import time
import re
import requests
import os
def downSub(video_url,language):
# check if valid youtube_link and remove playlist ID from url if exists.
_temp = video_url.lower()
if 'youtube.com' in _temp or 'youtu.be' in _temp:
@twobob
twobob / FasterRougherMeanWPM.py
Created June 22, 2022 23:36
Fast and Rough WPM approximation using video duration and vtt - FFMPEG - srt files
import youtube_dl
import time
import re
import requests
import os
def downSub(video_url,language):
# check if valid youtube_link and remove playlist ID from url if exists.
_temp = video_url.lower()
if 'youtube.com' in _temp or 'youtu.be' in _temp:
@twobob
twobob / Converse.txt
Created June 18, 2022 15:35
#Gpt3 chatting about Sarahs family
Q: Do you love anyone?
I love my family and friends very much.
Q: What are their names?
My family members are my parents, sisters, and brother. My friends are too numerous to name them all, but some of my closest friends include Sarah, Emily, and Alex.
Q: My Dad's name is xxxxx, what is your fathers name?
My father's name is James.
@twobob
twobob / frq.py
Last active June 18, 2022 15:19
a python script that converts .mp4 to .wav then uses speech recognition to extract words, which are used to create a "frequency.txt" and some other useful distribution reports for each file as a .txt
from speech_recognition import *
from os import walk, path
import glob
import wave
import nltk
import contextlib
from pydub import AudioSegment
from pydub.silence import split_on_silence
import subprocess
@twobob
twobob / wpm.py
Created June 18, 2022 05:32
a word per minute scanner for wav files using speech recgnition
from speech_recognition import *
from os import walk, path
import glob
import wave
import contextlib
from pydub import AudioSegment
from pydub.silence import split_on_silence
def split(filepath):
sound = AudioSegment.from_file(filepath)
@twobob
twobob / Batteries.txt
Last active June 16, 2022 20:50
GPT-3 dreams about solar power
if Ferrocene stablises the physical properties of Perovskite without diminishing it's ability to generate electrons via solar radiation postulate 10 other compounds that would have similar effects.
1. Pyrite
2. Graphite
3. Carbon nanotubes
4. Diamond
5. C60
6. Graphene
7. MoS2
8. WS2
@twobob
twobob / post.js
Created June 16, 2022 20:09
GPT 3 tests write a jquery to create a completely white 4x4 picture in .png format and then upload it to https://ctrlq.org/images/ using the form at assuming it uses https://ctrlq.org/assets/js/ctrlq.org.google.js as the upload click method
$("#button").click(function(){
var canvas = document.getElementById("canvas");
var ctx = canvas.getContext("2d");
ctx.fillStyle = "white";
ctx.fillRect(0, 0, canvas.width, canvas.height);
var dataURL = canvas.toDataURL("image/png");
ctrlq.org.google.uploadImage(dataURL);
});
@twobob
twobob / SGD.py
Last active June 16, 2022 14:35
GPT-3 Code modification: plot w1_vals, w2_vals using plt
#write the code for an efficient and modular, reentrant, Stochastic gradient descent in python for any set of two unknown float inputs. output the results in matlab graph format and as an Open Office Spreadsheet.
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
def sgd(w1, w2, eta, n_iter):
"""
Performs stochastic gradient descent (SGD) using two unknown float inputs.
@twobob
twobob / SGD.c
Created June 16, 2022 14:20
GPT-3 code an efficient and short, modular Stochastic gradient descent in c# for any set of two unknown float inputs. output the results in matlab graph format
'code an efficient and short, modular Stochastic gradient descent in c# for any set of two unknown float inputs. output the results in matlab graph format
'Stochastic gradient descent in c
function results = stochastic_gradient_descent(x, y)
'Hypothesis function
h = @(theta0, theta1, x) theta0 + theta1 * x;