The following code is my recent collation of the common code part, and I will release more practical code, please put your own code back, while I tidy up, thank you!
qq:393356
' Determine if the file name is legitimate
Function Isfilename (Afilename)
Dim Serrorstr,inamelength,i
Isfilename=true
Serrorstr=array ("/", "", ":", "*", "?", "" "", "Inamelength=len (Afilename)
If inamelengthIsfilename=false
Else
For I=0 to 8
If InStr (Afilename,serrorstr (i)) Then
Isfilename=false
End If
Next
End If
End
Copy Code code as follows:
' Get rid of consecutive carriage returns and spaces at the ends of a string
function Trimvbcrlf (str)
TRIMVBCRLF=RTRIMVBCRLF (Ltrimvbcrlf (str))
End Function
' Remove successive carriage returns and spaces at the beginning of the string
function Ltrimvbcrlf (str)
Dim Pos,isblankchar
Pos=1
Isblankchar=true
While Isblankchar
If mid (str,
list_head *entry) {struct List_head *list_next
= entry->next;
struct List_head *list_prev = entry->prev;
List_next->prev = List_prev;
List_prev->next = List_next;
}
List_entry: Remove Node
/**
* List_entry-get The struct for this entry
* @ptr: The struct list_head.
* @type: the TyPE of the struct this are embedded in.
* @member: The name of the list_struct within the struct.
*/
#define LIST_ENTRY (PTR, type, member) \
container_of (PTR, type, member)
/**
* Container_of-ca
Cbytesreader class
Using System; namespace Common {///
Application
The following Bitconverterext class, where you can see the implementation
var one = false;
var two = true;
var three = true;
var four = false;
var arrbool = new Bool[3] {true, false, true};
var bytes = new byte[200];
var pos = 0;
Bitconverterext.getbytes (bytes, one, 0);
B
function | String ' Removes successive carriage returns and spaces from the ends of the string
function Trimvbcrlf (str)
TRIMVBCRLF=RTRIMVBCRLF (Ltrimvbcrlf (str))
End Function
' Remove successive carriage returns and spaces at the beginning of the string
function Ltrimvbcrlf (str)
Dim Pos,isblankchar
Pos=1
Isblankchar=true
While Isblankchar
If mid (str,pos,1)
bytes], used as a common buffer for read/write.2. 2. Read Buffering is implemented first.Fundamentals of Read buffer logic:A a byte to read the file pos position.B check buf in existence? If so, read directly from the BUF and return the character byte.If not, buf repositions to the POS location and fills buffer with the file contents of the BufSize byte near the location, returning B.The following is a key
from:http://www.cnblogs.com/wandererzj/archive/2012/04/16/2452209.html
kernel read process for seq_file files
1 questionsSeq_file simply adds the kernel buffering function to the normal file read, allowing sequential traversal to read the simple interface of large data volumes. Seq_file generally only provides read-only interface, in the use of seq_file operation, mainly by the following four operations to complete the kernel custom buffer traversal output operation, where the
.**************************************** **************************************** **/Void clearlist (struct list * l){If (L-> list! = NULL ){Free (L-> list);/* release the bucket */L-> List = 0;L-> size = L-> maxsize = 0;}}
/*************************************** **************************************** ***3. returns the length of the linear table L. If l is null, 0 is returned.**************************************** **************************************** **/Int sizelist (struct list * l){R
here. the callers don't delete things they can't find. */assert (* before! = 0);} // search for items. Returns the h_next Member Address of the first node. If the search fails, the h_next Member Address of the last node in the conflict chain is returned. Because the h_next value of the last node is NULL. You can check whether the search is successful by using the * operator on the return value. Static item ** _ hashitem_before (const char * key, const size_t nkey, const uint32_t hv) {item **
never actually get here. The callers don ' t delete things they can ' t find. */assert (*before! = 0);} Find Item. Returns the H_next member address of the predecessor node and returns the H_next member address of the last//node in the conflict chain if a lookup fails. Because the value of the last node's h_next is null. You can know if a lookup succeeds by using the * operator on the return value//. Static item** _hashitem_before (const char *key, const size_t nkey, const uint32_t HV) {Item
The previous article introduced the comparison operation of large integers, today to talk about and bit-related operations. ★ Intro The representation of large integers and related definitions This article describes how large integers are represented. To facilitate the following explanation, here is an example of a large integer given in the previous definition (32-bit system, each digit length is 32 bits):Assuming that there is a bignum x, the decimal value is 1134924633606254832, the correspon
1. Use of the ScrollBar control bar
First, suppose you add a horizontal scroll bar and associate a control variable m_hscroll to the scroll bar control;
Set the scroll bar range M_hscroll in the initialization dialog function. SetScrollRange (0,100);
Maximum minimum setting, and setting the position of the scroll bar slider at the beginning of the M_hscroll. SetScrollPos (5);
Then, the message Response command wm_hscroll that adds a scroll bar automatically adds void Ccolordlg::onhscroll (UINT n
Huawei Router Access is still one of the access technologies worth learning. Here we mainly analyze the practical application of Huawei Router Access. With the rapid development of IP technology in recent years, financial IP networks have been spread all over the world, establishing a unified and open network platform has become an important measure for the financial industry to improve efficiency and reduce operating costs, how to seamlessly integrate the P
variable to assist the operation):c*view* PView;POSITION pos=getfirstviewposition ();Pview=getnextview (POS);The pointer to the C*view class is then pview. After executing a few sentences, the variable pos=null, because there is no next view class, naturally there is no next view class POSITION. However, the few statements are too simple to have too much commona
Big integer algorithm [04] bit operation, integer algorithm 04 operation
The previous article introduced the comparison of big integers. Today we will talk about bit-related operations.
★Introduction
This article describes how big integers are represented by big integers. In order to facilitate the subsequent explanation, we first give an example of a large integer according to the previous definition (in a 32-bit system, each digit is 32 bits in length ):
Assume that there is a bignum x, the d
;Dif_iframemousedowntop [name] = 0;Dif_pagemousedownleft [name] = 0;Dif_pagemousedowntop [name] = 0;}Dif_handles [name] [dif_handles [name]. Length] = O;}
// generalized function to get position of an event (like mousedown, mousemove, etc) function dif_geteventposition (EVT) { var Pos = new object (); POS. X = 0; POS. y = 0; If (! EVT) { EVT = Window. event;
When I regard a "struct" as an attribute in the class, I can directly read the struct members in practice, but cannot write them directly...
The following is a small exercise:
Unit unit1; interfaceuses winapi. windows, winapi. messages, system. sysutils, system. variants, system. classes, VCL. graphics, VCL. controls, VCL. forms, VCL. dialogs, VCL. struct; Type tform1 = Class (tform) button1: tbutton; button2: tbutton; button3: tbutton; button4: tbutton; button5: tbutton; Procedure bu
k.Dp [pos] [ac] [limit] [zero] is used to represent the status. pos indicates the number of digits, and ac indicates the location on the ac automatic machine, limit = 0 indicates that there is no upper limit. limit = 1 indicates that the upper limit is digit [pos], and zero indicates that the upper limit is non-leading 0, in this case, you need to determine whet
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.