Skip to content

Instantly share code, notes, and snippets.

Avatar

Max Nova max-nova

View GitHub Profile
@max-nova
max-nova / cardano.py
Created Jul 27, 2018
Cardano's solution for a depressed cubic
View cardano.py
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
View keybase.md

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:

View grass_demo.py
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 Oct 31, 2014
Code to replicate a bug in grass.pipe_command
View replicate_error.py
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