Skip to content

Instantly share code, notes, and snippets.

View sotoseattle's full-sized avatar

Javier Soto sotoseattle

  • Seattle, WA
View GitHub Profile
@sotoseattle
sotoseattle / is_it_true.md
Last active August 31, 2026 22:14
You would need an extra full percentage point of additional total factor productivity growth every year for the next 10 years just to stabilize debt-to-GDP.

"One extra point of TFP growth for 10 years just to stabilize debt-to-GDP"

F1 — The gap to close

CBO's February 2026 baseline: debt held by the public goes from 101% of GDP in 2026 to 120% in 2036. Primary deficit 2.6% of GDP now, 2.1% in 2036. Net interest 3.3% -> 4.6%. Total deficit 5.8% -> 6.7%.

F2 — The debt-stabilizing condition

Delta d = d*(i-g)/(1+g) - pb. Effective interest rate on the debt is 3.3/101 = 3.3% in 2026 and 4.6/120 = 3.8% in 2036, against nominal GDP growth of ~3.8-3.9% (1.8% real + 2.0% inflation). So i-g is approximately zero and the debt-stabilizing primary balance is approximately zero.

The gap to close is therefore the primary deficit itself: 2.0-2.5% of GDP. The US does not have an r>g problem over this window. It has a primary deficit problem.

@sotoseattle
sotoseattle / gol2.rb
Last active December 24, 2015 20:56
#!/usr/bin/ruby -w
require "graphics"
require "set"
class ZenspiderGol
delta = [-1, 0, 1]
same = [0, 0]
DELTAS = (delta.product(delta) - [same]).sort

Ping Pang Pong!

You are back to the future. It is 1972. You, freshly out of high school and after a whole night of BBS and root beer have had an epiphany, a great idea that will make you rich: a video game console called Ataxy, and a game of tabble tennis you will call Ping Pang Pong! The goal of this exercise is to write the video game's software.

Using the graphics gem create a canvas in which a single ball/point bounces against the walls.

Requirements:

  • Minimum: the ball hits the wall and shows up in the opposite wall (like Asteroids)
  • Intermediate: the ball hits the wall and it deflects with the right angle.
  • Advanced: Add a paddle (a horizontal movable wall) that you can control, and play Ping Pang Pong!!
require 'primo'
ASS = %w(FF Ff ff)
module Probe
def puffreduce(probs, rango)
negos = probs.map{|p| 1-p}
ixes = (0..(probs.size-1)).to_a
sol = 0
rango.each do |i|
@sotoseattle
sotoseattle / keybase.md
Last active January 2, 2021 19:41
Not to be deleted

Keybase proof

I hereby claim:

  • I am sotoseattle on github.
  • I am sotoseattle (https://keybase.io/sotoseattle) on keybase.
  • I have a public key ASAK-TgRq1RpxsIJdy2K0dMLb8jMNFS68AKZgSOCKo0mvwo

To claim this, I am signing this object:

@sotoseattle
sotoseattle / gist:5123da60acda8cb98582
Last active August 29, 2015 14:09
Reverse a Linked List (should be refactored)
class Node
attr_accessor :val, :next
def initialize(val)
@val = val
@next = nil
end
end
class List
attr_accessor :head