Skip to content

Instantly share code, notes, and snippets.

View sovietscout's full-sized avatar
🦦

Ritobhash Daw sovietscout

🦦
View GitHub Profile
@sovietscout
sovietscout / AsyncCSVStreamWriter.py
Created July 2, 2025 17:14
An asynchronous csv streamer with file rotation
import csv
import asyncio
import logging
from pathlib import Path
from typing import List, Optional
from concurrent.futures import ThreadPoolExecutor
log = logging.getLogger("FileStream")
class AsyncFileStreamer:
@sovietscout
sovietscout / README.md
Last active April 27, 2025 11:04
Calculates expected CUET scores by comparing student responses to the provisional master answer key

CUET Score Checker

Requirements:

  • Python 3.8+
  • pandas, lxml, requests (install via pip install -r pandas lxml requests)
  • master.csv (provisional answer key for the subject; must be in the same folder)

Usage:

  1. Place your response sheet URL in response_url variable.
  2. Run python cuet-score-checker.py.
@sovietscout
sovietscout / solutions.R
Last active March 13, 2025 22:00
R solutions for practice set, PT (UG2, 2023)
# ----- Question 1 -----
x <- 1
# `x` is also a vector. Check with `is.vector(x)`
# ----- Question 2 -----
y <- 1:5
# ----- Question 3 -----
z <- rep(1:5, times = 10)
import re
import string
from enum import Enum
from typing import List, Union
class Cases(Enum): # Reference: https://stackoverflow.com/a/54330161
Camel = 1
Snake = 2
Kebab = 3
Flat = 4
@sovietscout
sovietscout / FTServer.py
Last active March 13, 2025 23:15
Barebones File Transfer Server in Python
import sys
import socket
from tkinter import Tk, filedialog
from http.server import HTTPServer, SimpleHTTPRequestHandler
print('[Press Ctrl+C to stop]')
# Gets directory to serve
print('Select folder to serve')