{{ message }}

Instantly share code, notes, and snippets.

Last active Jan 11, 2021 — forked from econchick/gist:4666413
Python implementation of Dijkstra's Algorithm using heapq
View dijkstra.py
 import heapq from collections import defaultdict class Graph: def __init__(self, n): self.nodes = set(range(n)) self.edges = defaultdict(list) self.distances = {}
Created Sep 4, 2014
patch to make GraspIt! 2.2 compilable in Ubuntu 14.04
View graspit.patch
 diff -rupN Graspit/graspit-lib-LINUX.pro GraspitNew/graspit-lib-LINUX.pro --- Graspit/graspit-lib-LINUX.pro 2012-04-21 01:03:59.000000000 +0700 +++ GraspitNew/graspit-lib-LINUX.pro 2014-09-04 12:06:38.646600227 +0700 @@ -21,7 +21,7 @@ LIBS += -lqhull LIBS += -lSoQt -lCoin #add utility libraries -LIBS += -lGL -lpthread +LIBS += -lGL -lpthread -ldl
Last active Nov 25, 2016
Check four 3D circular cones intersection
View conesIntersection.py
 import ecos import sys import os import numpy as np from scipy.sparse import csc_matrix _stdout = sys.stdout def perpendicular_vector(v):
Last active Aug 29, 2015
check positive span for 4 fingers using Qhull
View isPositiveSpan.cpp
 #include #include using namespace orgQhull; bool isPositiveSpan(const Point3d &n1,const Point3d &n2,const Point3d &n3,const Point3d &n4){ Qhull qhull; realT points[12]={n1.x,n1.y,n1.z,n2.x,n2.y,n2.z,n3.x,n3.y,n3.z,n4.x,n4.y,n4.z}; qhull.runQhull("",3,4,points,""); vector facets=qhull.facetList().toStdVector(); for(const QhullFacet &facet : qhull.facetList().toStdVector()) if(facet.getFacetT()->offset>=0) return false;
Last active Aug 29, 2015
Simple grader written in shell script