This file contains hidden or 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 requests | |
from bs4 import BeautifulSoup | |
import os | |
import time | |
import zipfile | |
from urllib.parse import urljoin, urlparse | |
import urllib.request | |
import sys | |
BASE_URL = "https://www.abandonware-magazines.org/affiche_mag.php?mag={}&page={}" |
This file contains hidden or 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 fitz #pip install PyMuPDF | |
import sys | |
import os | |
import zipfile | |
def extract_jpg_images_from_pdf(pdf_path): | |
doc = fitz.open(pdf_path) | |
images = [] | |
for page_number in range(len(doc)): | |
page = doc[page_number] |
This file contains hidden or 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 struct | |
#copy TEX data into TRS | |
track_face_format = '4H 3h 2B I' | |
track_texture_format = '2B' | |
track_face_size = struct.calcsize(track_face_format) | |
track_texture_size = struct.calcsize(track_texture_format) | |
def update_track_face(track_face_file, track_texture_file, output_file): |
This file contains hidden or 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 cv2 | |
import numpy | |
import math | |
import srt | |
import datetime | |
vidA = cv2.VideoCapture('movieA.mkv') #reference | |
vidB = cv2.VideoCapture('movieB.mkv') #to synchronize | |
with open('subtitles.srt', 'r') as f: #from fileA.mkv |
This file contains hidden or 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
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Linq; | |
namespace Test | |
{ | |
class Program | |
{ | |
static Random rand = new Random(); |
This file contains hidden or 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
function sort(a) { | |
var n = a.length; | |
for (var j = 0; j < n - 2; j++) { | |
for (var i = j + 1; i < n; i++) { | |
if (a[i] == a[j]) { | |
//swap | |
if (a[i] != a[j + 1]) { | |
var tmp = a[j + 1]; | |
a[j + 1] = a[i]; | |
a[i] = tmp; |