design_model(7)bridge

1.Bridging mode Based on the minimal design principle of classes, different classes take on different responsibilities by using encapsulation, aggregation, and inheritance behaviors. Its main feature is to separate the abstraction from the implementation so that the parts remain independent.Sex and coping with their functional expansion. 2.Example public interface Brand { } public class Huasuo implements Brand{ } public interface Computer { } public class Desktop implements Computer{  private Brand brand;   public Desktop(Brand brand) { super(); this.br...

Wuhan University OJ 622. Symmetrical

Description          Cyy likes something symmetrical, and Han Move likes something circular. Han Move gave you a circular string whose length is N, i.e. the i-th character of the string is the neighbor of the ( (i-1) mod N )-th character and ( (i+1) mod N )-th character.            As Cyy likes something symmetrical, you want to find out whether this string can be symmetrical. There’s an operation for you to make the string symmetrical. This operation is called “disconnect”. You can use “disconnect” only once to break the link between any two neighbor characters, makin...

Summary of Python—10

Because I taught myself Python while I was at work, once I got busy, Python would put it away for two days, but I forgot what I learned two days later. Today, summarize the various startup methods of Python. My document path: ——-    1Open the CMD where the file is located and tap directly in the command line.python Filename.Py (with.Py file suffix),It can output results directly.      Note: this opens the path directly. The filename.Py is not found.   2Open the CMD where the file is, and on the command line, tap directly: python, first enter the python interaction mo...

Regular expression check amount

An arbitrary positive number, not exceeding two decimal places.  /^(([1-9][0-9]*)|(([0]\.\d{0,2}|[1-9][0-9]*\.\d{0,2})))$/ If you want to confirm integer numbers,Change the above * to {1, n}. When n is equal to 12, the above expression indicates that the integer digit cannot exceed 13. The above ensures that no spaces, no English and special characters are allowed.

Win install MySQL5.7.0+ services

0、Get installation package 1、Add the My.ini file to the bin directory. The contents are as follows [mysql] # Set MySQL client default character setdefault-character-set=utf8 [mysqld] #Set 3306 portsPort= 3306 # Set up MySQL installation directoryBasedir=D:\mysql-5.7.23-win32 # Storage directory for setting up MySQL databaseDataDir=D:\mysql-5.7.23-win32\data # Maximum number of connections allowedMax_connections=200 # The character set used by the server is defaults to the 8 bit coded Latin1 character set.Character-set-server=utf8 # Default storage engine that will be used when c...

design_model(10)facade

1.Appearance pattern To provide a consistent interface for a set of interfaces in a subsystem, this pattern defines a high-level interface that makes the subsystem easier to use. 2.Example public class Cookie { public void getBooks() { System.out.println("cookie"); } } public class Tea { public void apply() { System.out.println("tea"); } } public class Facade { public void doFacade(){ Tea tea = new Tea(); tea.apply(); Cookie cookie = new Cookie(); cookie.getBooks(); } } public class Client { public static...

Uploading files or pictures

Question: at present, the station has received the uploaded data. After entering the controller layer, it is empty!!! Solution: The name value of the tag uploaded, the value in requestParam (), the value in the corresponding parameter, the three names can not be the same. Submission mode post For beginners, which way of submission is: do not use get as long as you remember data changes.   

Class PooledDataSource

PooledDataSourceIt mainly involves two classes PooledConnection and PoolState. PooledConnection:PooledDataSourceThe actual realConnection and proxyConnection link objects can be obtained from the database connection created inA dynamic proxy interface used PoolState:Corresponding to the Pooled DataSource, the status of the connection pool corresponding to the data source is recorded, including idle, number of active links, and connection pool statistics. PooledConnectionProperty description below; Connection realConnection:The real connection for connecting to a database is the encapsulat...