This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import cv2 | |
| cap = cv2.VideoCapture('rtmp://localhost/live/stream') | |
| while(True): | |
| # Capture frame-by-frame | |
| ret, frame = cap.read() | |
| # Our operations on the frame come here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from __future__ import print_function | |
| import sys | |
| if(len(sys.argv) != 3): | |
| print('Usage: ', sys.argv[0], 'input.obj output.vtk') | |
| sys.exit() | |
| import vtk | |
| reader = vtk.vtkOBJReader() | |
| reader.SetFileName(sys.argv[1]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import argparse | |
| p = argparse.ArgumentParser(description='off to obj.') | |
| p.add_argument('input') | |
| p.add_argument('out') | |
| args = p.parse_args() | |
| with open(args.input) as f: | |
| lines = f.readlines() | |
| meta = lines[1].split() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| from matplotlib import cm | |
| n = 25 | |
| q = n * n | |
| A = np.eye(q) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def partition(n): | |
| # x: current coin, y: remain value | |
| def helper(x, y): | |
| if y <= 0: | |
| return int(y == 0) | |
| # use x and not use x | |
| z = helper(x, y-x) | |
| if x < y: | |
| z += helper(x+1, y) | |
| return z |
OlderNewer