Skip to content

Instantly share code, notes, and snippets.

View jcrvz's full-sized avatar
⛱️
Where am I?

Jorge Mario Cruz-Duarte jcrvz

⛱️
Where am I?
View GitHub Profile
@jcrvz
jcrvz / altRoots.m
Created July 30, 2020 18:04
Loh's method for quadratic formula
% https://www.poshenloh.com/quadratic/
function rts = altRoots(p2)
if p2(1) ~= 1
p2 = p2 / p2(1);
end
average_value = p2(2) / 2;
product_value = p2(3);
distance = sqrt(average_value^2 - product_value);
@jcrvz
jcrvz / printmsk.py
Last active March 18, 2020 00:55
Print the type skeleton of a variable with nested variables.
def printmsk(var, level=1, name=None):
"""
Print the meta-skeleton of a variable with nested variables.
:param var: any, variable to inspect.
:param level: int (optional), level of the variable to inspect. Default: 1.
:param name: name (optional), name of the variable to inspect. Default: None.
:return: None
Example: