interference lines, making it difficult for other programs to detect the authentication codes in the image.G. setcolor (color. Gray );For (INT I = 0; I {Int x = random. nextint (width );Int y = random. nextint (height );Int XL = random. nextint (12 );Int yl = random. nextint (12 );G. drawline (X, Y, x + XL, Y + yl );}// Randomcode is used to save the randomly generated verification code so that the user ca
= (xForXInRange (4 ))
Generator expressions are a simple way to compile generators. For more information, see.
4. List Comprehension)
Table derivation is a quick way to generate tables. Suppose we generate table L:
L =[]ForXInRange (10): L. append (x** 2)
The preceding table L is generated, but there is actually a quick writing method, that isTable DerivationMethod:
L = [x ** 2ForXInRange (10)]
This is similar to the generator expression, except thatBrackets.
(The mechanism of
much! The Internet is powerful.
Http://web-snippets.blogspot.com/2008/03/unpacking-zip-files-in-silverlight-2.html
I will also provide a download here, so that the space of the original author cannot be opened. Slsharpziplib_solution.zip
Here is a wiki site for the unzip ziplib sample. You can study what this class library can do.
Http://wiki.sharpdevelop.net/SharpZipLib_Updating.ashx#Updating_a_zip_file_in_memory_1
Let's look at an example of practical application.
/// /// Form
source code leakage, ASP pages can be encrypted. There are two methods to encrypt ASP pages. One is to use component technology to encapsulate programming logic into DLL; The other is to use Microsoft Script encoder to encrypt ASP pages. However, the main problem with the use of group component technology is that each segment of code must be componentized, so the operation is cumbersome and the workload is heavy ; the script encoder is used to encrypt ASP pages, which is simple and effective.
a generator:
def gen(): a = 2 yield a a = a * 2 yield a yield 1024The generator has three yield instances. If it is used as a loop generator, it performs three cycles.
for i in gen(): print i
Let's look at another generator:
def gen(): for i in range(4): yield iIt can be written as a generator expression:
G = (x for x in range(4))Generator expressions are a simple way to compile generators.
Iv. Table Derivation
List comprehension is a quick way to generate tabl
case, this is the case. For each training sample X, some sampling method is used to extract a corresponding sample that conforms to the molar distribution represented by the RBM Network (which means that the sample that complies with the parameter-determined molar distribution p (x), for example, Y; for the entire training set {x1, x2 ,... For XL}, we obtain a set of samples {y1, Y2 ,..., YL}, and then use this group of samples to estimate the second
seen that even if the database name gets weird, the hidden directory goes deeper, and the ASP source code is easily downloaded after the password is lost. If you use an ODBC data source, the following issues will not occur:
Conn. Open ODBC-DSN name"
2. Encrypt ASP pages
To effectively prevent ASP source code leakage, You can encrypt ASP pages. We used two methods to encrypt ASP pages. One is to use component technology to encapsulate programming logic into DLL; the other is to use Microsoft Scr
. setcolor (getrandcolor (color_fc_bg, color_bc_bg ));IMG. fillrect (0, 0, width, height );
// Set the fontIMG. setfont (new font ("Times New Roman", Font. Plain, 18 ));
// Draw a border// G. setcolor (new color ());// G. drawrect (0, 0, width-1, height-1 );
// Generates 155 random interference lines, making the authentication code in the image hard to be detected by other programs.IMG. setcolor (getrandcolor (color_fc_line, color_bc_line ));For (INT I = 0; I Int x = random. nextint (width );Int
("a" => "green", "red ");
See also array_diff ().
//************************************** *****Array_diff (PHP4> = 4.0.1)
Array array_diff (array array1, array array2 [, array...])
Opposite to the previous function, this is the difference set of multiple arrays.
Example:$ Array1 = array ("a" => "green", "red", "blue ");$ Array2 = array ("B" => "green", "yellow", "red ");$ Result = array_diff ($ array1, $ array2 );
// This makes $ result have array ("blue ");
See also array_intersect ().
//****
I = 0; I {
Int x = random. nextInt (width );
Int y = random. nextInt (height );
Int xl = random. nextInt (12 );
Int yl = random. nextInt (12 );
G. drawLine (x, y, x + xl, y + yl );
}
String sRand = "";
For (int I = 0; I String rand = String. valueOf (random. nextInt (10 ));
SRand + = rand;
G. setColor (new Color (20 + random. nextInt (110), 20 + random. nextInt (110), 20 + random. nextInt (110 )));
G. draw
Leetcode question | Integer to Roman
Problem:
Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.
Converts an integer from 1 to 3999 to a Roman number.
Thinking:
(1)
ExampleSingle digit exampleI, 1] II, 2] III, 3] IV, 4] V, 5] vi, 6] VII, 7] VIII, 8] IX, 9]Ten-digit exampleX, 10] average, 11] average, 12] XIII, 13] XIV, 14] XV, 15] XVI, 16] XVII, 17] XVIII, 18] XIX, 19] XX, 20] XXI, 21] XXII, 22] XXIX, 29] XXX, 30] XXXIV, 34] XXXV, 35] XX
, the operation is simple and the results are good.The Script Encoder method has many advantages:1. HTML is still editable. Script Encoder only encrypts the ASP code embedded in the HTML page, and the rest remains unchanged, this makes it possible to use common webpage editing tools such as FrontPage or Dreamweaver to modify and improve the HTML part, but not to modify the ASP encrypted part. Otherwise, the file will become invalid.2. Easy to operate. Just master several command line parameters.
Problem:Given an integer, convert it to a Roman numeral. Input is guaranteed to being within the range from 1 to 3999.Converts an integer of 1-3999 to Roman numeralsThinking:(1)comparison exampleSingle Digit Exampleⅰ,1 "Ⅱ. 2 "ⅲ,3" ⅳ,4 "Ⅴ. 5 "ⅵ,6" Ⅶ. 7 "ⅷ,8" Ⅸ. 9 "Example of 10 digitsⅩ. 10 "ⅺ,11" ⅻ,12 "xiii,13" xiv,14 "xv,15" xvi,16 "xvii,17" xviii,18 "xix,19" xx,20 "xxi,21" xxii,22 "xxix,29" XXX,30 "XXXIV, 34 "xxxv,35" xxxix,39 "xl,40" l,50 "li,51" lv
Preface numbering
A certain book ' s prefaces is numbered in upper case Roman numerals. Traditional Roman numeral values use a single letter to represent a certain subset of decimal numbers. Here are the standard set: I 1 L M 5 C X 500 DAs many as three of the same marks that represent 10n could be placed consecutively to form other numbers:
III is 3
CCC is 300
Marks that has the value 5x10n is never used consecutively.Generally (with the exce
I. Title DescriptionGiven a Roman numeral, convert it to an integer.Input is guaranteed to being within the range from 1 to 3999.Two. Topic analysisRoman Numerals Summary:1~9: {"I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX"};10~90: {"X", "XX", "XXX", "XL", "L", "LX", "LXX", "LXXX", "XC"};100~900: {"C", "CC", "CCC", "CD", "D", "DC", "DCC", "DCCC", "CM"};1000~3000: {"M", "MM", "MMM"}.Reference to the Roman numeral: http://baike.baidu.com/view/12
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.