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
| #include <iostream> | |
| #include <exception> | |
| #include <fstream> | |
| #include <string> | |
| using namespace std; | |
| int main(int argc, char const *argv[]) { | |
| if (argc < 2) { | |
| cout << "Usage: " << argv[0] << " filename.txt" << endl; | |
| return 0; |
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
| %% f2d.m | |
| function f2d(A) | |
| x=0:0.05:3*pi; | |
| [X, Y]=meshgrid(x); | |
| F=zeros(size(X)); | |
| min_val = inf; | |
| min_coord = [0 0]; | |
| max_val = -inf; | |
| max_coord = [0 0]; |
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
| %% copy from ocw.mit.edu | |
| %% random matrix theory | |
| %n=20; s=30000; d=.05; %matrix size, samples, sample dist | |
| n=10; s=1000; d=.05; % s=30000 is too slow | |
| e=[]; %gather up eigenvalues | |
| im=1; %imaginary(1) or real(0) | |
| for i=1:s, | |
| a=randn(n)+im*sqrt(-1)*randn(n);a=(a+a')/(2*sqrt(2*n*(im+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
| <ServerManagerConfiguration> | |
| <ProxyGroup name="filters"> | |
| <!-- ================================================================== --> | |
| <SourceProxy name="DistancePolyDataFilter" class="vtkDistancePolyDataFilter" label="DistancePolyDataFilter"> | |
| <Documentation | |
| long_help="Computes the signed distance from one vtkPolyData to another." | |
| short_help="vtkDistancePolyDataFilter."> | |
| </Documentation> | |
| <InputProperty |
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 | |
| # config parser | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument("mesh") | |
| parser.add_argument("-f", "--framefield", default="") | |
| parser.add_argument("-n", "--quadnum", type=int, default=500) |
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 ffmpeg | |
| ( | |
| ffmpeg | |
| .input('D:\\P\\ffmpeg-20190702-231d0c8-win64-static\\bin\\xiaoice_360p.mp4', re=None) | |
| .audio | |
| .filter('aderivative') | |
| .output('rtmp://localhost/live/test', f='flv') | |
| .run() | |
| ) |
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 threading | |
| import time | |
| def test(x): | |
| def task(): | |
| while 1: | |
| print(x) | |
| time.sleep(x) | |
| y = threading.Thread(target=task) |
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
| #include <stdio.h> | |
| #include <pthread.h> | |
| void *busy(void *ptr) { | |
| puts("hello"); | |
| return NULL; | |
| } | |
| int main() { | |
| pthread_t id; | |
| pthread_create(&id, NULL, busy, "hi"); | |
| while (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
| using System; | |
| using System.Net; | |
| using System.Text; | |
| using System.Threading; | |
| namespace SimpleHttp | |
| { | |
| // reference: https://www.codehosting.net/blog/BlogEngine/post/Simple-C-Web-Server | |
| class SimpleHttpServer | |
| { |