succeed.The preceding example shows that some SOCKS5 servers and SOCKS5 clients do not have a thorough understanding of the SOCKS5 protocol. Even if SOCKS5 is used, communication will be poor when interworking with iptables.In another example, the SOCKS5 server is located on the public network. The intranet client first performs Nat through iptables and then connects to the SOCKS5 server.Reference the following text in the SOCKS5 protocol (rfc1928:The UDP associate request is used to establish
returns the current directory ('.'Os.mkdir (path) creates a directory Os.makedirs (path) recursively creating the directory Os.chdir (dirname) changes the working directory to dirname Os.path.getsize (name Get the file size, if name is directory return 0los.path.abspath (name) get absolute path Os.path.normpath (PATH) specification path string Form Os.path.splitext () detach The file name and extension Os.path.join (path,name) connection directory with the file name or directory Os.path.basenam
like this:0.299=299/1000=1224/4096So D = (R * 1224)/4096Y= (r*1224)/4096+ (g*2404)/4096+ (b*467)/4096Then simplify to:y= (r*1224+g*2404+b*467)/4096Here the /4096 division, because it is 2 of the N-square , so can be replaced with a shift operation, to the right shift 12bit is to divide a number divided by 4096.void Calc_lum (){int i;for (i = 0; i {int r,g,b,y;R = 1224 * IN[I].R;g = 2404 * IN[I].G;b =
A single-chain structure is a fairly common structure. It is not only widely used to realize the data structure of single-linked list, stack, queue and so on, but also is the only data structures introduced in the C program design of Mr. Rectification, which fully embodies the universality and practicability of this data structure . Our structure is this:1 template class value>2struct node {3 value Val; 4 Node *next = nullptr; 5 };It then defines and initializes a single-linked list of List1
. The net/IPv4/Netfilter/ipt_iprange.c module is provided in the kernel to match the address segment. We can modify the module and add the address "hole. First, you must define the data structure to be matched to describe the matching conditions. modify it to/* include/Linux/netfilter_ipv4/ipt_iprangehole.h */# ifndef _ ipt_iprangehole_h Based on the ipt_iprange.h header file
# DEFINE _ ipt_iprangehole_h # define iprange_src 0x01/* match source IP address */
# Define iprange_dst 0x02/* match des
For specific algorithm principles, referPS layer hybrid algorithm 3 (filter color, overlay, soft light, strong light)
// Ps_algorithm.h
# Ifndef ps_algorithm_h_included
# Define ps_algorithm_h_included# Include # Include # Include "cv. H"
# Include "highgui. H"
# Include "cxmat. HPP"
# Include "cxcore. HPP"Using namespace STD;
Using namespace CV;
# Endif // ps_algorithm_h_marshded
// Main Function
# Include "ps_algorithm.h"
Void screen (MAT src1, mat src2, mat
In Linux, there are many backup methods in Linux. Some time ago, I carefully studied the backup methods in Linux. I 'd like to share it with you here and hope it will be useful to you.
You can use the following methods to back up data in Linux: 1. Use a USB flash drive or a mobile hard disk to prepare important data for the computer;2. Use a burner to compress important data into a cd;3. Save data outside the system partition to avoid data loss caused by system reinstallation or system damage;4.
coordinate of the target image. if x and y are both 0, they start from the upper left corner.Src_x copy image start x coordinateSrc_y: Copy the y coordinate of the image. if x and y are both 0, copy the image from the upper left corner.Src_w (starting from src_x) copy widthSrc_h (starting from src_y) copying heightPct image merging degree. The value ranges from 0 to 100. when pct is set to 0, nothing is actually done, and vice versa.
This function is identical to imagecopy () for the color pale
file name of a path.The OS. path. isfile () and OS. path. isdir () functions verify whether the given path is a file or a directory.The OS. path. exists () function is used to check whether the given path actually exists.OS. curdir: returns the current directory ('.')OS. mkdir (path) to create a directoryOS. makedirs (path) Recursive directory creationOS. chdir (dirname) changes the working directory to dirnameOS. path. getsize (name) to get the file size. if the name is a directory, return 0LO
current directory ('. ') Os.mkdir (path) creates a directory Os.makedirs (path) recursive creation directory Os.chdir (dirname) changes working directory to dirname Os.path.getsize (name) Get the file size, if name is directory return 0los.path.abspath (name) get absolute path Os.path.normpath (PATH) specification path string Form Os.path.splitext () detach file name with extension The name Os.path.join (path,name) connection directory with the file name or directory Os.path.basename (path)
used to set a filter.
From skimage import data, colorimport matplotlib. pyplot as pltfrom skimage. morphology import diskimport skimage. filters. rank as sfrimg = color. rgb2gray (data. lena () dst = sfr. entropy (img, disk (5) # plt, a circular filter with a radius of 5. figure ('filters ', figsize = (8, 8) plt. subplot (121) plt. title ('origin image') plt. imshow (img, plt. cm. gray) plt. subplot (122) plt. title ('filted image') plt. imshow (
existsOs.curdir returns the current directory ('. ')Os.mkdir (path) Create a directoryOs.makedirs (path) to create a directory recursivelyOs.chdir (dirname) Change working directory to DirNameOs.path.getsize (name) Gets the file size if name is directory returned 0LOs.path.abspath (name) gets the absolute pathOs.path.normpath (path) canonical path string formOs.path.splitext () detach file name and extensionOs.path.join (path,name) connection directory with file name or directoryOs.path.basenam
;} /* Watermark string $DST $water watermark Small image $save not filled, the default replaces the original figure $alpha Transparency $pos watermark position 1234, clockwise */public static funct Ion Water ($DST, $water, $save =null, $pos =2, $alpha =50) {//Ensure that two images exist if (!file_exists ($DST) | |!file_exists ($water)) { return false;} 1. Ensure
, and if the files are empty, points to the console for input, and if file is '-', also to the console for input.
By default, files are opened in text mode and need to be specified if other formats are required.
2.2 Fileinput.filename () #只有当读入第一行之后 the value is assigned
2.3 Fileinput.fileno ()
2.4 Fileinput.lineno ()
2.5 Fileinput.filelineno ()
2.6 Fileinput.isfirstline ()
2.7 Fileinput.isstdin ()
2.8 Fileinput.nextfile ()
2.9 Fileinput.close ()
3) Glob
You can use simple methods to match all
console for input, and if file is '-', turn to console for input.
By default, the file opens in text mode and needs to be specified if additional formatting is required.
2.2 Fileinput.filename () #只有当读入第一行之后, the value is assigned
2.3 Fileinput.fileno ()
2.4 Fileinput.lineno ()
2.5 Fileinput.filelineno ()
2.6 Fileinput.isfirstline ()
2.7 Fileinput.isstdin ()
2.8 Fileinput.nextfile ()
2.9 Fileinput.close ()
3) Glob
You can use simple methods to match all subdirectories or files in a directory,
not convert the network address into a name;-T no timestamp is printed on each output line;-V outputs a slightly detailed information. for example, the IP package can contain ttl and service type information;-Vv: output detailed message information;-C. after receiving the specified number of packages, tcpdump stops;-F read the expression from the specified file and ignore other expressions;-I indicates the network interface of the listener;-R reads packets from a specified file (these packets a
--to see the authority of the source codeMemset is primarily used to initialize newly requested memory, which is the quickest way to clear 0 operations on large structures and arrays.Function Prototypes: void *memset(void *s, int ch, size_t n);Function Explanation: Fill the first n bytes in s with ch and return S.For these most basic functions, there is always an impulse to know how it is implemented.Here is the memset implementation according to the source code:void* memset(void*
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.