Skip to content

Instantly share code, notes, and snippets.

Avatar
🐼

OldPanda

🐼
View GitHub Profile
View is_odd.ml
let rec is_odd_pos(num: int): bool =
if num = 0 then false
else is_even_pos(num - 1)
and is_even_pos(num: int): bool =
if num = 0 then true
else is_odd_pos(num - 1);;
let rec is_odd_neg(num: int): bool =
if num = 0 then false
else is_even_neg(num + 1)
View MAKE MASTER GREAT AGAIN.md
git branch master
git checkout master
git branch -D main
git push origin master
git push origin :main
View my_dict.py
class MyDict(object):
def __init__(self, size=99999):
self.hash_list = [list() for _ in range(size)]
self.size = size
self.length = 0
def __setitem__(self, key, value):
hashed_key = hash(key) % self.size
for item in self.hash_list[hashed_key]:
if item[0] == key:
View leetcode_spider.py
import json
import logging
import psycopg2
from lxml import html
from requests import session
DB_CONN = {
"host": "<your-db-host>",
View sh600004.csv
name date suffix_col
test 2014-12-31 1234