Skip to content

Instantly share code, notes, and snippets.

View seagoj's full-sized avatar

Jeremy Seago seagoj

View GitHub Profile
@startuml
skinparam dpi 300
!if (%not(%variable_exists("$FONTNAME")))
!$FONTNAME = "Verdana"
!endif
!if (%not(%variable_exists("$FONTSIZE")))
!$FONTSIZE = 11
@seagoj
seagoj / sql.puml
Last active August 13, 2020 00:46
@startuml
' extend class for Table'
!define Table(name,desc) class name as "desc" << (T,#FFAAAA) >>
' primary key: bold
!define primary_key(x) <b>x</b>
' unique key: grren text'
!define unique_key(x) <color:green>x</color>
' not null underlined
!define not_null(x) <u>x</u>
' default: italic``'
@seagoj
seagoj / readme.txt
Last active April 10, 2021 21:07
solution_3.py
# Lovely Lucky LAMBs
# ==================
# Being a henchman isn't all drudgery. Occasionally, when feeling generous, Commander Lambda hand out Lucky LAMBs (Lambda's All-purpose Money Bucks). Henchmen can use Lucky LAMBs to buy things like a second pair of socks, a pillow for their bunks, or even a third daily meal!
# However, actually passing out LAMBs isn't easy. Each henchman squad has a strict seniority ranking which must be respected -- or else the henchmen will revolt and you'll all get demoted back to minions again!
# There are 4 key rules which you must follow in order to avoid a revolt:
# 1. The most junior henchman (with the least seniority) gets exactly 1 LAMB. (There will always be at least 1 henchman on a team.)
# 2. A henchman will revolt if the person who ranks immediately above them gets more than double the number of LAMBs they do.
-- matches in A and B
SELECT count(A.*)
FROM A
JOIN B ON DATE(A.date) = DATE(B.date), A.id = B.id, A.phone_number = B.phone_number;