JS checks whether the form input is empty
This article mainly introduces the sample code for determining whether the form input is empty in JS. If you need it, you can refer to it for help.
The Code is as follows:
// Remove the spaces on both sides of the input string
Function trim (s ){
Var count = s. length;
Var st = 0; // start
Var end = count-1; // end
If (s = "") return s;
While (st
If (s. charAt (st) = "")
St ++;
Else
Break;
}
While (end> st
Js checks whether a simple instance of a specified control exists on the page
This article mainly introduces a simple example of determining whether a specific control exists on the js page. If you need a simple example, you can refer to it for help.
If (document. getElementById ('show _ pic ')! = Null) {document. getElementById ('show _ pic '). src = this. value ;}
Show_pic is an image control in the page. We must first ensure that this control e
Hi.baidu.com/p3rlish
It is an important task for the system administrator to regularly check for accounts with a user ID equal to 0 in the password file! However, checking at any time is impractical! Let the system do the work!1. Edit/usr/local/bin/checkhacker and write:#! /Bin/bashFor id in awk FS = ":" {if ($3 = 0 $1! = "Root") print $1}/etc/passwdDoMail-s "Hacker Alert" root @ localhost
************************************ ALERT! Login ID echo $ {id} has uid 0* Date "+ Detacted On: % D Ti
[Algorithm C ++] checks whether the sum of two numbers in an array is equal to a certain number.
Problem:Checks whether the sum of two numbers in the array is equal to a certain number.
Solution 1: first sort the array and then traverse from the two endsAfter the array is sorted, the minimum value is obtained from the left end and the maximum value is obtained from the right end,Determine the sum of the two and the size of the target:1. If it is equal
Html checks whether the current page is in an iframe instance. The current iframe
When making HTML pages, we often encounter "if the current page is displayed in iframe, we will handle it accordingly"
The judgment method is as follows:
// Determine whether the iframe contains if (self! = Top) {parent. window. location. replace (window. location. href );}
The above html judges whether the current page is in iframe. It is all the content shared by A
JavaScript checks whether the browser supports multiple methods for CSS3 attributes. javascriptcss3
Preface
The emergence of CSS3 makes the browser's performance more colorful, and the biggest impact of performance is animation. During daily animation writing, it is necessary to determine whether the browser supports it in advance, especially when writing a CSS3 animation library. For exampletransitionOfanimation-play-stateOnly some browsers support t
Jquery checks whether the check box is selected. jquery is selected.
Jquery judges whether the check box is selected and how to select it.Enter the subject, or when there is a set of check boxes on the page:
You can use Jquery to obtain the value of a set of check boxes with name = fruit as follows:
Var checkVal = ''; $ (" input [name = 'fruit']: checkbox "). each (function () {if ($ (this ). attr ('checked') {checkVal + = $ (this ). val () + ','
14.04 how to solve serious errors when Qilin checks disks/ Temporarily change the boot parameters to the System
When you enter the Ubuntu Startup menu, select * Ubuntu with the cursor, and press the e key on the disk to enter the startup Item editing mode:
Use the cursor to locate the position shown in. After you change Ro to RW, press the F10 key to guide the system according to the modified parameters:
Modify startup Ite
JS checks whether it is a number, whether it is an integer, and whether it is a floating point number
Regular Expression Method
Function checkrate (input){VaR Re =/^ [0-9] + .? [0-9] * $/; // determines whether the string is a number. // determines a positive integer./^ [1-9] + [0-9] * $/If (! Re. Test (input. rate. Value )){Alert ("enter a number (for example, 0.02 )");Input. rate. Focus ();Return false;}}
The following describes how to write c
#!/bin/bash while:do neterror=$ (/bin/netstat-a | GREP-CW "close_wait") echo "Get TCP netstate ' LISTEN ' num ber cuccessful! " echo "Neterror" $neterror if [$neterror-gt "]; then echo" too much net Error,system would reboot now! " Sleep 2 /sbin/reboot-f fi freememory=$ (free-m | grep Mem | awk ' {print $4} ') echo "Freesize:" $freememo Ry if [$freememory-lt "]; then echo" The free memory size was less then 100m,sy
is uneven, most of the time I/O is idle.14.29% of the time in a second I/O queue is requested, that is, 85.71% of the time I/O system has nothing to do, all 29 I/O requests are processed within 142 milliseconds.Delta (ruse+wuse)/delta (IO) = await = 78.21 = Delta (ruse+wuse)/s=78.21 * Delta (IO)/s = 78.21*28.57 = 2232.8, indicating I/O requests per second You need to wait 2232.8ms in total. So the average queue length should be 2232.8ms/1000ms = 2.23, while the average queue Length (Avgqu-sz) g
This article is reproduced, reproduced in the original address: http://blog.sina.com.cn/s/blog_637112040100vl53.html 1. Check processThe PS command finds the PID number associated with the process:PS A shows all programs under the current terminal, including other users ' programs.Ps-a Show All Programs.PS C shows the actual instruction name of each program when the program is listed, not including the path, parameter, or indication of the resident service.Ps-e the effect of this parameter is th
will be garbled. #specifically, the basename here is Unicode encoded, so you can use Basename.encode (' gb2312 ') #If basename is utf-8 encoded, use Basename.decode (' Utf-8 '). Encode (' gb2312 ')att["content-disposition"] ='attachment; filename=%s'% Basename.encode ('gb2312') Msg.attach (ATT)Try: #SMTP = SmtplibSMTP =Smtplib. SMTP ()#connecting to a serverSmtp.connect ('smtp.163.com',' -') #LoginSmtp.login (username, Usepassword)#Send mailSmtp.sendmail (fromaddress,
127.0.0. 1 represents the main principle of the machine is: socket socket = new socket (address,port); #address代表主机的IP地址, Port for port number if a socket is established for a specific port number for the host, the port of that host is in use. New Socket (address,port); #address代表主机的IP地址, port represents the port number if a socket is created for a specific port number for the host, Indicates that the port of the host is in use.Importjava.io.IOException; Importjava.net.InetAddress; ImportJava
; B+a[jk-3] > ... > b+a[ik+1] >b+a[ik] > X nbsp; that is, a cannot be any of the elements in A[ik...jk-1], and the premise: A[IK...JK] contains A and b contradictions, so falseWrong settingError, so A[JK] is not B.Because A[IK...JK] contains a and b, and has proved that A[JK] is not a or B, and ik+1 = ik,jk+1 = jk-1 , so, in the section K +Before 1-round iterations begin, a[ik+1...jk+1] must contain A and B.(3) ifA[IK]+A[JK] 3, from 1, and 2, know, each iteration before the beginning
#!/bin/bashRead-t 30-p "Please enter the partition you want to find (format Sda1~sda3):" AAAnumber=$ (df-h | grep $aaa | awk ' {print $} ' | cut-d "%"-F 1)If [$number-ge "70"]Thenecho "is not working properly, the message has been sent to your mailbox"echo "Be careful, your partition has exceeded the threshold, please clean up" |mutt-s "alarm" [email protected]Elseecho "The situation is normal, please don't worry."FiThis article is from "Life is waiting for Gordo" blog, please make sure to keep
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.