Skip to content

Instantly share code, notes, and snippets.

Avatar

eduardoleon

View GitHub Profile
View session
pyon% sage
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 9.2, Release Date: 2020-10-24 │
│ Using Python 3.9.4. Type "help()" for help. │
└────────────────────────────────────────────────────────────────────┘
sage: P.<x,y,z,w> = PolynomialRing(CC)
sage: d = 4
sage: I = Ideal([w*y^d - x*x^d, w*z^d - y*x^d])
sage: J = Ideal([w*y^d - x*x^d, w*z^d - y*x^d, w*w^d - z*x^d])
sage: p = I.hilbert_polynomial()
@eduardoleon
eduardoleon / unoffice.py
Created May 3, 2020
This is crude, but it will do for now.
View unoffice.py
#!/usr/bin/python
import os
import subprocess
import sys
def extract_media(path):
args = ['unzip', path, '*media*']
subprocess.run(args)
def list_media(path):
@eduardoleon
eduardoleon / poly
Created Feb 6, 2020
Differences between ML and Lisp
View poly
pyon% poly
Poly/ML 5.8 Release
> datatype foo = Foo;
datatype foo = Foo
> val mine = Foo;
val mine = Foo: foo
> datatype foo = Foo;
datatype foo = Foo
> val yours = Foo;
val yours = Foo: foo
View balanced.c
#include <stdio.h>
#include <stdlib.h>
struct tree {
struct tree *left;
struct tree *right;
};
struct stack {
int state;
View merge.c
#include <stdio.h>
#include <stdlib.h>
struct tree {
int value;
struct tree *left;
struct tree *right;
};
struct stack {
View kosaraju.c
#include <stdio.h>
#include <stdlib.h>
struct stack {
int state;
void *current;
struct stack *next;
};
struct graph {
View paths.c
#include <stdio.h>
#include <stdlib.h>
struct tree {
int value;
struct tree *left;
struct tree *right;
};
struct stack {
View is_bst.c
#include <stdio.h>
#include <stdlib.h>
struct tree {
int value;
struct tree *left;
struct tree *right;
};
struct stack {
View uniquify.c
#include <stdio.h>
struct node {
int value;
struct node *next;
};
void uniquify_head(struct node *head)
{
struct node *node = head;
View .Renviron
R_LIBS=~/programs/rpkg