Skip to content

Instantly share code, notes, and snippets.

@preprocessor
preprocessor / Tail recursion ex.lua
Last active December 25, 2015 02:58
Tail recursion in lua
function countdwn(n)
while n>0 do
print(n)
countdwn(n-1)
else
print("0")
end
end
--[[
@preprocessor
preprocessor / nth fib.lua
Last active December 25, 2015 12:49
nth Fibbonacci number in lua
function floor(n)
return math.floor(n)
end
function sqrt(n)
return math.sqrt(n)
end
Phi = (1+sqrt(5))/2
phi = (1-sqrt(5))/2
@preprocessor
preprocessor / colConj.lua
Created October 17, 2013 18:37
Collatz conjecture in lua
function colConj(n)
local t = {}
if n < 0 then
print("Try a positve number.")
elseif n == 0 then
print("Try a non-zero number.")
else
while n>1 do
if (n%2) == 0 then
n = n/2
@preprocessor
preprocessor / scar_tissue.md
Created June 1, 2023 15:53 — forked from gtallen1187/scar_tissue.md
talk given by John Ousterhout about sustaining relationships

"Scar Tissues Make Relationships Wear Out"

04/26/2013. From a lecture by Professor John Ousterhout at Stanford, class CS142.

This is my most touchy-feely thought for the weekend. Here’s the basic idea: It’s really hard to build relationships that last for a long time. If you haven’t discovered this, you will discover this sooner or later. And it's hard both for personal relationships and for business relationships. And to me, it's pretty amazing that two people can stay married for 25 years without killing each other.

[Laughter]

> But honestly, most professional relationships don't last anywhere near that long. The best bands always seem to break up after 2 or 3 years. And business partnerships fall apart, and there's all these problems in these relationships that just don't last. So, why is that? Well, in my view, it’s relationships don't fail because there some single catastrophic event to destroy them, although often there is a single catastrophic event around the the end of the relation