Skip to content

Instantly share code, notes, and snippets.

@Smerity
Created February 24, 2014 22:38
Show Gist options
  • Save Smerity/9198784 to your computer and use it in GitHub Desktop.
Save Smerity/9198784 to your computer and use it in GitHub Desktop.
Rage inducing code snippets from lectures and homework
# How many of these lines actually do something?
if (U < A):
x[i] = x_star
i = i + 1
x_prev = x_star
else:
x[i] = x_prev
x_prev = x[i]
i = i + 1
i=i-1
... later ...
if U < A:
y[i] = y_star
i = i + 1
y_prev = y_star
else:
y[i] = y_prev
y_prev = y[i];
i = i + 1
... or you could, y'know, just write ...
if (U < A):
x[i] = x_star
x_prev = x_star
else:
x[i] = x_prev
i += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment