: This article mainly introduces the SPL data structure of the php Standard Library ----- spldoublyshortlist (two-way linked list). For more information about PHP tutorials, see.
$ Spl = new SplDoublyLinkedList (); // instantiate the object of the two-way linked list $ spl-> push ("sdfsaf"); // add it to the top (top) (tail) of the linked list) $ spl-> push (111); $ spl-> push ('1'); $ spl-> unshift ("100 "); // the value before the bottom header is added to the bottom of the linked list. The va
PHP iterators, PHP converters
Implements Iterator, realizing the current of Iterator (); Next (); key (); Valid (); Rewind ();
1
Php2 /*3 * Define an array first4 * Define the first position $position = 05 * Then return key and value,6 * point to Next location + + $position7 */ 8 classMyiteratorImplementsiterator{9 //define a location firstTen Private $position= 0; One Private $array; A - Public function__constru
Php iterator and php generator. Php Iterator and php generator implementsIterator to implement current (); next (); key (); valid (); rewind (); 1? Php2 * 3 * first defines an array 4 * defines the first position $ position php iterator, php generator
Implements Iterator to implement the current (); next ();Key ();Valid (); rewind ();
1
Array = $ array; 15} 16/** 17 * iterator with the first element inver
Perform file read and write operations
FileSize--Get file size
Copy CodeThe code is as follows:
$file _size = filesize (' file1.txt ');
echo $file _size;
?>
Output
33
Unlink--Deleting files
Copy CodeThe code is as follows:
$isDeleted = unlink (' File3.txt ');
Echo $isDeleted;
?>
Output
1
Rewind--Rewind the position of the file pointer
Ftell--Returns the position of the file pointer read/write
Fseek
position.
Seek_set-Sets the position equal to the beginning of the file. (default value)
Seek_end-Set the location to the end of the file.
Rewind ()--Rewind the position of the file pointer, that is, move the file pointer to the beginning of the file.
Syntax structure: Rewind (file pointer)
Note: If you open the file in append ("a" or "A +") mode, any data wri
.
Seek_set-Sets the position equal to the beginning of the file. (default value)
Seek_end-Set the location to the end of the file.
Rewind ()--Rewind the position of the file pointer, that is, move the file pointer to the beginning of the file.
Syntax structure: Rewind (file pointer)
Note: If you open the file in append ("a" or "A +") mode, any data written to the
); Move the pointer echo "Use the fseek () function after the pointer position:". Ftell ($fopen). ""; The position of the pointer after the output is moved echo "outputs the contents after the current pointer:". fgets ($fopen). ""; Outputs the contents from the current pointer to the end of the line if (feof ($fopen)) //Determines whether the pointer points to the end of the file { echo "the current pointer points to the end of the file:". Ftell ($fopen)
Positioning
10.5.1 rewind Function
The file has a pointer pointing to the current read/write location. If you read and write a file sequentially and each time you read and write a character, after you write a character, the pointer automatically moves to the next character position. If you want to change this rule and force the position pointer to another specified position, you can use related functions.
The re
the specified character in the stream
Fputs () writes a string to a stream
Fgets () reads a row or a specified character from the stream.
Fprintf () Outputs Data to the stream in the format
Fscanf () reads data from the stream in the format
Returns the true value when feof () reaches the end of a file.
Returns the value of ferror () When an error occurs.
Rewind () resets the file locator to the beginning of the file
Remove () delete an object
Fread (
, return Truedirectoryiterator: : isreadable If the file is readable, return truedirectoryiterator::iswritable if the file is writable, return TruediRectoryiterator::key returns the current directory entry Directoryiterator::next moves to the next item Directoryiterator::rewind returns the directory pointer to the start position Directoryiterator :: Valid Check if the directory contains more items $it = new Directoryiterator (".. /"); foreach ($it
environments, dump is more comfortable to use personally.If there is a condition, dump can also store the backup on tape. Linux typically uses/DEV/ST0 to represent a rewind device, while a/dev/nst0 represents a non-rewind device that, when used with a rewind device, is automatically rewind and then stored when the tap
).
Seven, in the machine without the power button
The Ctrl-Rewind button "Rewind" button is located in the upper-right corner of the new USB keyboard, usually used to exit the disc. Press this combination to display a dialog box on the screen that includes a shutdown, sleep, and reboot button (see the next section).
cmd-ctrl-The rewind button forces a reboot,
. Some of the most important attributes and their use are shown in the following table:
MediaPlayer Component Method In addition to the 9-button method mentioned earlier, Delphi also provides some important methods for MediaPlayer components, such as open, save, rewind, resume, pauseonly, and close. Details of their use are as follows:
1. Open method:
The Open method opens a multimedia device. Before calling this method, you must ensure that the co
after starting Mpxplay
-XR:TSR mode (for CDW audio files only) (for example, ' Mpxplay.exe-bl-xr-xs-pre1 Song.mp3 ' will play continuously in the background)
-xas: Enable the soft shutdown feature of the ATX/APM power supply (when exiting)
Keyboard control (the partial key is case-sensitive (that is, only lowercase!)
(Recommended: Set the keyboard rate in BIOS to 30 characters/sec):
ESC-Exit
F10-Exit
Ctrl-c-Exit
Gray-'-'-rewind one song from the pl
The file read and write functions described earlier are sequential read and write, that is, read and write files can only start from scratch, read and write the data in turn. But in the actual development of the need to read and write the middle part of the file, to solve this problem, you have to move the file inside the position pointer, and then read and write. This method of reading and writing is called Random Read and write, that is, start from anywhere in the file.
The key to realizing r
SPL is a collection of interfaces and classes that are used to troubleshoot a typical problem (standard problems).
1. Spldoublylinkedlist prototype:
SplDoublyLinkedList Implements iterator, arrayaccess, countable {/* Method/Public __construct (void) public void Add (mixed $index, mix Ed $newval) public mixed Bottom (void) public int count (void) public mixed current (void) public int Getiteratormo De (void) public bool IsEmpty (void) public mixed key (void) public void next (void) public bool
This article introduces a self-made ffplay transplant to VC under the Open Source project: Ffplayfor MFC. This project will ffmpeg the Ffplay player (FFPLAY.C) in the project to the VC environment. And using MFC to do a simple set of interfaces. It can complete a player's basic flow of video playback: Solution protocol, unpacking, video/audio decoding, AV synchronization, AV output. There are also some control functions: play, pause/resume, forward, rewind
operations must be performed through the pointer of this structure. Common functions for such file operations are as follows:
Function
Fopen () Open stream
Fclose () Close the stream
Fputc () writes a character to the stream
Fgetc () reads a character from the stream
Fseek () locates the specified character in the stream
Fputs () writes a string to a stream
Fgets () reads a row or a specified character from the stream.
Fprintf () Outputs Data to the stream in the format
Fscanf () reads data fro
operation cannot exceed the frame of the video. That is to say, the pan operation in one direction can reach the maximum degree of alignment between the edge of the video and the control.Example: The control translates 5 pixels from the left to the right of the video (when the control does not move, the video is translated to the right ):
6. PlaySyntax: Play ()Starts to play a video.Example:Movie. Play
7. RewindSyntax: rewind ()Note:
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.