# Delete all containers
docker rm $(docker ps -aq)
# Delete all images
docker rmi $(docker images -q)
# Delete all untagged images
docker rmi $(docker images -q --filter "dangling=true")
References:
import streamlit as st | |
from persist import persist, load_widget_state | |
def main(): | |
if "page" not in st.session_state: | |
# Initialize session state. | |
st.session_state.update({ | |
# Default page. | |
"page": "home", |
import os | |
import signal | |
import subprocess | |
import sys | |
# Parse command-line arguments. | |
if len(sys.argv) > 1: | |
folder = os.path.abspath(sys.argv[1]) | |
else: | |
folder = os.path.abspath(os.getcwd()) |
# Delete all containers
docker rm $(docker ps -aq)
# Delete all images
docker rmi $(docker images -q)
# Delete all untagged images
docker rmi $(docker images -q --filter "dangling=true")
References:
def list_to_tree(input, none_and_holes=True, source=[0]): | |
"""Transforms nestings of lists or tuples to a Grasshopper DataTree""" | |
from Grasshopper import DataTree as Tree | |
from Grasshopper.Kernel.Data import GH_Path as Path | |
from System import Array | |
def proc(input,tree,track): | |
path = Path(Array[int](track)) | |
if len(input) == 0 and none_and_holes: tree.EnsurePath(path); return | |
for i,item in enumerate(input): | |
if hasattr(item, '__iter__'): #if list or tuple |
This is a simple demonstration of the use of a constraint-based force layout to represent the dependency hierarchy. Subgraphs are not repeated as they are in the console rendering. As a result, we don't have to make any special provision for dependency cycles.
The Floyd-Warshall algorithm is used to display relative path distances. Floyd-Warshall has been extended with path reconstruction as well to show the shortest path solutions between nodes.
It is possible the display could be improved further through hierarchical grouping to highlight the commonly repeated subgraphs (e.g. the subgraph including the path L->I->O->P->Q).
import urllib2 | |
import threading | |
from Queue import Queue | |
import sys, os, re | |
class ThreadedDownload(object): | |
REGEX = { | |
'hostname_strip':re.compile('.*\..*?/', re.I) | |
} |