Skip to content

Instantly share code, notes, and snippets.

View max-nova's full-sized avatar

Max Nova max-nova

View GitHub Profile
@max-nova
max-nova / cardano.py
Created July 27, 2018 21:36
Cardano's solution for a depressed cubic
import numpy as np
from numpy.lib.scimath import sqrt as csqrt
def get_roots(A, B, C):
"""
Given a depressed cubic of the form:A(x^3) + Bx + C
returns all the roots.
Note that inputs need to be floats

Keybase proof

I hereby claim:

  • I am max-nova on github.
  • I am maxnova (https://keybase.io/maxnova) on keybase.
  • I have a public key ASC_RVW1rdcSoQbFnJgsdaDn5lL0RtgzgABOJaLayXh84wo

To claim this, I am signing this object:

import os
import tempfile
import shutil
import grass.script as grass
# first do:
# mkdir /tmp/grasstest
# wget http://grass.osgeo.org/sampledata/north_carolina/nc_spm_latest.zip
# unzip *.zip
@max-nova
max-nova / replicate_error.py
Created October 31, 2014 20:24
Code to replicate a bug in grass.pipe_command
import os
import tempfile
import shutil
import grass.script as grass
import grass.script.setup as gsetup
# first do:
# mkdir /tmp/grasstest
# wget http://grass.osgeo.org/sampledata/north_carolina/nc_spm_latest.zip