object) sequentially.
The code is as follows:
Import re P = re. compile (r' \ d + ')For m in p. finditer ('one1two2three3four4 '):Print m. group (), ### Output ####1 2 3 4
6. sub
Sub (repl, string [, count]) | re. sub (pattern, repl, string [, count]):Use repl to replace each matched substring in the string, and then return the replaced string.When
substring, no matching substring will be returned when none is present#using Match () in this example does not match successfullyMatch = Pattern.search ('Hello world!') ifmatch:#use match to get grouped information PrintMatch.group ()## # output # # ## World3, Split (String[,maxsplit]) |re.split (Pattern,string[,maxsplit])Divides the pattern as a delimiter, splits a string, and returns a list after splittingImport= re.compile (R'\d+')print p.split (' ONE1TWO2THREE3FOUR4 ' ## # # # # ## ['
string that returns an iterator that accesses each matching result (match object) sequentially.
Copy Code code as follows:
Import re
p = re.compile (R ' \d+ ')
For M in P.finditer (' One1two2three3four4 '):
Print M.group (),
### Output ###
# 1 2 3 4
6, Sub (REPL, string[, Count]) | Re.sub (Pattern, REPL, string[, Count]):
Returns the replaced string after each matching sub
= 1Character_set_server = UTF8Autocommit = OffInnodb_flush_log_at_trx_commit = 1Skip_name_resolve = OnInnodb_strict_mode = OnLog_bin = Mysql-binInnodb_data_home_dir =/usr/local/mysql/dataInnodb_log_group_home_dir =/usr/local/mysql/dataauto_increment_increment=2auto_increment_offset=22. Set 192.168.1.1 As the primary server for 192.168.1.2# Execute on the Server1Grant Replication Slave on * * to ' repl ' @ '% ' identified by '
file from the server parameter, you will find that the file has been changed, but when the service is restarted, the modified configuration is not executed, and you A list of MySQL folders will find a lot of. My.cnf.swp and other intermediate files. This is because MySQL did not read the my.cnf when it was started. At this time as long as the my.cnf file permissions to change to my_new.cnf the same permissions as OK, command: chmod 644 my.cnf OK (4) Ubuntu modified document content without VIM
modifies the my.cnf file from the server parameter, you will find that the file has been changed, but when the service is restarted, the modified configuration is not executed, and you A list of MySQL folders will find a lot of. My.cnf.swp and other intermediate files. This is because MySQL did not read the my.cnf when it was started. At this time as long as the my.cnf file permissions to change to my_new.cnf the same permissions as OK, command: chmod 644 my.cnf OK(4) Ubuntu modified document c
Tags: io ar os sp for on file data artMySQL master-Slave synchronization configuration under CentOSFirst, the environmentHost:Master Operating system: CentOS 5.3ip:192.168.1.222MySQL version: 5.0.77Slave machine:Slave operating system: CentOS 5.3ip:192.168.1.220MySQL version: 5.0.77Second, create a databaseLog in to master machine and slave machine separately mysql:mysql–u root–pCreating a database: Create databases Repl;Third, the Master machine and
database file. This will ensure that the application loads the most current data each time it is run. This method should be named Deletedb. This code should resemble the following code:
[C #]Copy Codeprivate void Deletedb (){if (System.IO.File.Exists (filename)){System.IO.File.Delete (filename);}}
Create a new method that performs synchronization named "Sync." To do this, you will use the code copied from the New Publication Wizard in the previous step. After you paste the code, you must perfor
execute under localhost without enabling authentication , and if BIN_IP is specified in the boot configuration file ,it can only be executed via bin_ip , where we cannot log in. LocalHost executes, only by means of kill. find the corresponding process number by viewing ps–ef|grep * * *using kill-2 (not the last resort to use kill to close a process instance, even if it is to be used, it should be closed in a milder way, Kill-2 {SIGINT} . Kill-2 The process of all queues in the instance is close
Tags: database java CentOS Server installationFirst, the host master and Salver both shut down the firewall iptables, execute the service iptables Stop command:To set the selinux=disabled of the SELinux file:Second, create a databaseLog in to master machine and slave machine separately mysql:mysql–u root–pCreating a database: Create databases Repl;Build the log profile for MySQL replication in the/usr/local/mysql directory/usr/local/mysql/mysql-bin.lo
First of all, what is REPL?A Read-eval-print-loop (REPL) is available both as a standalone program and easily includable in other programs. REPL provides a-interactively run JavaScript and see the results. It can be used to debugging, testing, or just trying things out.The interactive interpreter (REPL) can be run as a
Test Environment: Master server: CentOS5.2Mysql5.1.35 source code IP: 192.168.1.22 slave server: CentOS5.2Mysql5.1.35 source code IP: 192.168.1.33 configuration: 1. master server 1.1, create a copy user, with the replicationslave permission. Test environment:
Master server: CentOS 5.2 Mysql 5.1.35 source code IP: 192.168.1.22
Slave server: CentOS 5.2 Mysql 5.1.35 source code IP: 192.168.1.33
Configuration:
I. master server
1.1 Create a replication user with the replication slave permission.
synchronized. Therefore, when performing master-slave synchronization for versions earlier than 5.0, you must maintain the consistency of the master-slave database, some databases or tables on the master database must be available from the top. otherwise, errors may occur during synchronization.
III. configuration of Mysql master-slave synchronization
Master Database IP address: 192.168.1.2
Slave Database IP: 192.168.1.3
Add a user for master-slave synchronization:
Grant replication slave o
configuration replication, and generate a copy command, which is always running
3. the distribution agent is responsible for synchronizing the Copy command to the subscription server, which is still running.
4. In addition, there are also jobs that clear expired commands (REPL-clear distribution) and jobs that clear snapshots (REPL-clear snapshots ).
Bytes --------------------------------------------------
Glusterfsis a clustered file system that can be scaled to several petabytes of magnitude. It can converge several different types of storage blocks into a large parallel network file system via InfiniBand RDMA or TCP/IP.One, volume managementThe transport protocol for the data supports the TCP and InfiniBand RDMA protocols.1, three types of volumes:(1) Distributed volumeA distributed volume can store a file randomly in a brick within a volume, typically for extended storage capabilities, and doe
actual use case is as follows:
S = "Hello world from Lua"For W in string. gmatch (S, "% A +") DoPrint (W)End
Here is an example of capturing and saving the matching characters to different variables:
T = {}S = "from = World, to = Lua"For K, V in string. gmatch (S, "(% W +) = (% W +)") DoT [k] = VEndFor K, V in pairs (t) DoPrint (K, V)EndString. gsub (STR, pattern, REPL, n)
String. the gsub () function matches the source string 'str' Based on the give
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.