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
#!/usr/bin/env python3 | |
import time | |
import socket | |
import random | |
verbose = True | |
def print_objects_grid(data): | |
items = data.split('\n') |
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 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() |
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
#!/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) |
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
// 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)` |
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
{- | |
How to use: | |
runghc test.hs | |
-} | |
import System.Environment (getArgs) | |
import System.Exit (exitFailure) | |
import Test.HUnit | |
import Text.Read (readMaybe) |