Skip to content

Instantly share code, notes, and snippets.

View caseploeg's full-sized avatar
🎯
Focusing

Case Ploeg caseploeg

🎯
Focusing
View GitHub Profile
#!/usr/bin/env python3
import time
import socket
import random
verbose = True
def print_objects_grid(data):
items = data.split('\n')
import sys
import heapq
from collections import defaultdict
v,e = sys.stdin.readline().strip().split()
adj = defaultdict(list)
d = dict()
for _ in range(int(e)):
u, v, w = sys.stdin.readline().strip().split()
@caseploeg
caseploeg / bin.py
Created February 8, 2024 22:02
binsearch()
#!/usr/bin/env python3
nums = sorted([int(x) for x in input().split()])
def search(x):
# low <= i < high
def binsearch(i, low, high):
if i == low or nums[i] == x:
return i
return binsearch((low + i)//2, low, i) if x <nums[i] else binsearch((i+high)//2, i, high)
@caseploeg
caseploeg / get_pb.js
Created October 21, 2020 02:35
JIRA pb.md
// this script is used for generating a PB.md file by exporting from JIRA
// STEP 1: Make a search in JIRA for the LUK project `project = LUK`
// STEP 2: Export the search result as HTML (All fields)
// reference: https://confluence.atlassian.com/jiracoreserver073/working-with-search-results-861257284.html#Workingwithsearchresults-Exportingyoursearchresults
// STEP 3: Open the html file you should have downloaded from jira and open the chrome console (inspect element)
// STEP 4: Paste this code into your console and run the generate function with the current sprint number, ie sprint number is 2, run `generate(2)`
{-
How to use:
runghc test.hs
-}
import System.Environment (getArgs)
import System.Exit (exitFailure)
import Test.HUnit
import Text.Read (readMaybe)