[6 / 4 = 1 = 1.5]: Type Coercion and Precision in SQL

An overview of what’s to come: I was originally writing this as a high-level introduction to send people when they encounter things like 6/4 returning 1 instead of 1.5 in some Database Management Systems (DBMS)… overtime its sprawled far beyond that. The points below serve as a TLDR, with a sprawling discussion expanding afterward. Operations like division in SQL can be confusing for novices or anyone without a programming background
Read more →

NY Times Connections Solver PT. 1

Olive Oil: During my daily morning ritual of waking up at 4:30 AM and immediately ingesting a ½ cup of [Trader Joes Extra Virgin Spanish Olive Oil] (Sponsored link), I decided I’d like to try and solve the NY Time’s Connections. So, with greasy fingers, lets begin. This is part one, where I: Review the rules of Connections Gather historical Connections games into a structured dataset Come up with some strategy for a program that’s somewhat capable of playing the game well In part two, I’ll try and generate a solver for the game.
Read more →

Temporary Tables

The database management system (DBMS) I’ll reference today is Redshift (AWS Cloud Datawarehouse offering) which is based on Postgres. I’ll dive into some of the anti-patterns around Temporary Tables I’ve seen abused during my work experience, why they don’t make sense, and how to fix them. Lets get it out of the way… Temporary Tables are not “better” than Common Table Expressions (CTEs) and CTEs are not “better” than temporary tables.
Read more →

Blindness and a Chess Puzzle

A Chess Puzzle I recently encountered a chess puzzle that revolved around capturing my opponents material due to a forced mate in one threat. While exploring various permutations of moves, I struggled to choose the right piece (between the bishop and the knight) to simultaneously block my opponent’s mate in one threat while allowing me to freely capture a few of his minor pieces. After a brief though I played Knight C3 -> D5, blocking my opponents mate threat on g2 and adding an additional attacker to the black knight on F6.
Read more →

Redlining

For some people, not red lining all the time is a skill in and of itself. Why wait until you have an injury or a mental health crisis to take a breath? Reflection I was brushing my teeth recently, paused, turned to my girlfriend and proclaimed that I wasted all four years of college on two degrees that were not challenging. I said that I should’ve majored in something “more difficult” like Engineering, Math or Computer Science because “I could have” and people wouldn’t “default to questioning my abilities”.
Read more →