Skip to content

Instantly share code, notes, and snippets.

@dbrady
Created March 16, 2012 16:17
Show Gist options
  • Select an option

  • Save dbrady/2050805 to your computer and use it in GitHub Desktop.

Select an option

Save dbrady/2050805 to your computer and use it in GitHub Desktop.
Graph Splitter Complexity-o-Mat (Inspired by Jack Danger)
# Inspired by Jack "Best Name Ever" Danger Carty's talk at MWRC 2012
def cplx(n)
(n**2-n)/2
end
def dangeromat(n)
puts "Interconnection Complexity: #{cplx(n)}"
b=n/2; a=n-b
puts "If you split your project evenly an app and a service api, you get"
puts "THE DANGER-O-MATIC EFFECT!!!"
puts "And your new interconnection complexity is:"
puts "App: #{cplx a} Service: #{cplx b} Total: #{cplx(a) + cplx(b)}"
end
¯
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment