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 socket | |
| import random | |
| import argparse | |
| import sys | |
| from io import BytesIO | |
| # Referrer: https://github.com/wuyunfeng/Python-FastCGI-Client | |
| PY2 = True if sys.version_info.major == 2 else False |
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
| ; Allow the linker to find the _start symbol. The linker will begin program execution | |
| ; there. | |
| global _start | |
| ; Start the .data section of the executable, which stores constants (read-only data) | |
| ; It doesn't matter which order your sections are in, I just like putting .data first | |
| section .rodata | |
| ; Declare some bytes at a symbol called error_msg. NASM's db pseudo-instruction | |
| ; allows either a single byte value, a constant string, or a combination of the two | |
| ; as seen here. 0xA = new line, and 0x0 = string-terminating null |
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
| public string run_cmd(string cmd, string args) | |
| { | |
| ProcessStartInfo start = new ProcessStartInfo(); | |
| start.FileName = "PATH_TO_PYTHON_EXE"; | |
| start.Arguments = string.Format("\"{0}\" \"{1}\"", cmd, args); | |
| start.UseShellExecute = false;// Do not use OS shell | |
| start.CreateNoWindow = true; // We don't need new window | |
| start.RedirectStandardOutput = true;// Any output, generated by application will be redirected back | |
| start.RedirectStandardError = true; // Any error in standard output will be redirected back (for example exceptions) | |
| using (Process process = Process.Start(start)) |
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
| @echo off & python -x "%~f0" %* & goto :eof | |
| # ========================================================== | |
| # one way to place python script in a batch file | |
| # place python code below (no need for .py file) | |
| # ========================================================== | |
| import sys | |
| print "Hello World!" | |
| for i,a in enumerate(sys.argv): |
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 <opencv/cv.h> | |
| #include <opencv/highgui.h> | |
| #include <iostream> | |
| using namespace std; | |
| using namespace cv; | |
| // quality-metric | |
| namespace qm | |
| { |
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
| # The following command works for downloading when using Git for Windows: | |
| # curl -LOf https://gist.githubusercontent.com/kmorcinek/2710267/raw/.gitignore | |
| # | |
| # Download this file using PowerShell v3 under Windows with the following comand: | |
| # Invoke-WebRequest https://gist.githubusercontent.com/kmorcinek/2710267/raw/ -OutFile .gitignore | |
| # | |
| # or wget: | |
| # wget --no-check-certificate https://gist.githubusercontent.com/kmorcinek/2710267/raw/.gitignore | |
| # User-specific files |