set to nullable null=True) #对于测试models. Set_null, we need to understand, for the basic field settings of the database, like null,max_length These properties, we need to re-generate the data table, #对于on_delete等Django中的附属属性, we can dynamically modify, do not need to regenerate the data table , so if we start without setting null=True (False by default), we need to regenerate the data table #on_delete= models. Set_default, #删除关联数据后, set your own data to the default value, you need to set the Defa
Doe; Expires=thu, Dec 12:00:00 GMT; path=/"; Using this statement does not clear the current cookie, but instead directly adds the cookie above. The first semicolon precedes the cookie key-value pair, the second is the expiration time, and the third belongs to which address.The method for reading cookies is var x = Document.cookie; Gets the string type.The method for modifying cookies is document.cookie= "Username=john Smith; Expires=thu, Dec 12:00:00 GMT; path=/"; The old cookie will be overwr
context is how to obtain it?Flask.request is a localproxy instance that gets a stack top object named _request_ctx_stack: from Import Partial from Import Localproxy def _lookup_req_object (name): = _request_ctx_stack.top if is None: Raise RuntimeError ("xxxxx") return getattr (top, name)The above logic can be used normally, first to look at the process:1: User access generates request 2: When a request is made to _reqeust_ctx_stack the context object of the request, he becomes
Deep cloning articles a lot, here is recommended Java enhancement-object cloning (replication).The above article is clear-organized, at a glance, but recently encountered in the project of the actual problem is that the object is to be cloned with a total of 207 subclass parent, regardless of the above two ways, it is necessary to modify the class file, more cumbersome.So we try Spring's beanutils.copyproperties and prove that the Copyproperties method is not used for deep cloning. Finally holdi
Recently, younger brother in his own study of Swift, accustomed to writing while writing unit tests while writing logic, in the Xcode environment without unit testing, writing is not a real feeling.As to how to create unit test, how to write, not the subject of this article, because read a lot of Baidu to the swift unit test, has been very graphic introduction to tell you how to write unit test. But the big question is, whether you call the class in your project anyway in the test class and say
1 . Properties File configuration data source First step : Configure propertyplaceholderconfiguerStep two : use ${key}2. JNDI configuration data source First step : Import Driver Packages in TomcatStep two : Configure JNDI in the context.xml configuration fileStep three : Configure the data source3. scope of beans1) Singleton ( single Case ): default2) prototype ( multiple cases )3) Request: valid at one time4) session: valid for the same session5) Global session: Used only in Portlet web apps
The variable promotion only promotes the left side of the equals sign, and the value on the right is not declared in advance .
regardless of whether the condition is true or not, the Var and function will be promoted in the judging body . Variables declared by a function can only be declared in advance and cannot be defined
Where the code executes to the condition judgment
If the condition is not established, the variable or function declared before is still undefine.
Cond
a function to process the result, which is the callback function.
We can put the time-consuming (blocking) task into the process pool and then specify the callback function (the main process is responsible for executing) so that the main process eliminates the I/O process when executing the callback function, and the result of the task is directly obtained.
Only a single process is used to process the data after the callback.
For example, the crawler, after the crawl is finished usi
The supplement of sorting "median order cardinal method to achieve tree structure"
Due to a momentary negligence, the method "for the base digit segment of type int, there can only be 31 replies to the original post, the base number of the numeric type, and no more than 120 replies to the original paste (in fact, for the Int field, the original post reply to the 32nd tree structure shows the beginning of the disorder, For a numeric-type base digit se
operation. 2) backing up the Mysqla database mysqldump--uroot-p--single-transaction--opt--events--triggers--routine
s--flush-logs--master-data=2--databases db1 DB2 >db.sql--flush-logs: Option to generate a new binary log file (scrolls the binary file so that it starts in a full position) --mater-data : the option value equals 2, and the change master statement in the backed-up SQL file is commented. --single-transaction:innodb table when backing up, the option--single-transaction is usually
SELECT * FROM (select RowNum rn,e2.* from (select e1.* from EMP E1) E2 where rownumSELECT * FROM (select RowNum en,e.* from emp e)Select E.deptno,e.ename,d.dname,e.mgr,s.gradeFrom (select AVG (SAL) ea from emp) e1,emp E,salgrade s,dept Dwhere E.deptno=e.mgrand D.deptno=e.deptnoand e.sal>e1.ea;--Copy table dataCREATE TABLE Emps as SELECT * from EMP;--View Table contentsDESC EMP;Select table_name from all_tables where Owner=upper (' Legend ');--Copy table structureCREATE TABLE Empnew as SELECT * f
Tags: style yum str enter DIV inux BSP Body dbaThe linuxoracle of Evil and supplementary articlesLinux simultaneously Open two terminals:ctrl+shift+tLinux configuration Yum file:/etc/yum.repos.d/xx.repoLinux switch users:su-usernameOracle Connectivity:sqlplus/as sysdba;conn/as sysdba;Grid to view the status of the database, the target of the database ORCL is ofline How to start for online:Srvctl Enable database-d ORCLSrvctl Start database-d ORCL"Linuxoracle" linuxoracle the Evil
mytable from Database mydb to the E:\MySQL\mytable.sql file.
c:\> mysqldump-h localhost-u root-p mydb mytable>e:\mysql\mytable.sql
Example 3: Export the structure of the database mydb to a e:\MySQL\mydb_stru.sql file.
c:\> mysqldump-h localhost-u root-p mydb--add-drop-table >e:\mysql\mydb_stru.sql
Note :-h localhost can be omitted, it is generally used on the virtual host.3) Export data structure onlyformat : mysqldump-u [Database user name]-p-t [the name of the data
--range-> select * from TB1 where name Gt 'Alex'Special: If the primary key or index is an integer type, then the index select * from TB1 where nid > 123 select * from TB1 where num > 123- Order BY Select e-mail from tb1 order by name Desc; When sorting by index, the selected mappings are not indexed if they are not indexes: if the primary key is sorted, then the index: SELECT * from Tb1 ORDER by nid desc; -Combined index leftmost prefix if the combined index is: (name,email)
Multi-table query mysql support is SQL99 standard connection query, does not support Oracle Company's external connection query, but supports Oracle equivalent query, not equivalent query, self-connection query, subquery (as long as it is not an outer join ( + ) are supported) Oracle also supports SQL99 standard connection queries Internal Connection--equivalent QuerySelectE.empno,e.ename,e.sal,d.dname fromEMP Einner Join dept Don E.deptno=D.deptno;--To put it simply: replace the comma in the
Back to Catalogmultipleactiveresultsets can make the database connection reusable, but when you're on the Moebius cluster tool, this option doesn't turn on (false by default), and when you use an ORM tool like EF, This option will be added by default, it is to improve the performance of the program, the advantage is that the database connection resources are exhausted, the use of the method is simple, only need to add it to the data connection string.For example: server= (local); Integrated Secu
Label:Previously there was a replica set to build mongodb3.0, but the admin database that was used directly was the root of the user. Links: http://blog.csdn.net/tuzongxun/article/details/51723259Recently you want to move data to a non-admin database, and then re-create the user in the non-admin library, the process is roughly the same as before, but there are some problems when creating the user, mainly on the user roles and permissions. I built the process to refer to the following user rights
(sysdate, ' D ') from dual; 5 March 14, 2002 for Monday DY Week the first day abbreviation Select to_char (sysdate, ' DY ') from dual; SUN March 24, 2002 for Sunday HH or HH12 12 input hours Select to_char (sysdate, ' HH ') from dual; 02 Midnight 2 O'Clock 8 02 HH24 24-hour Select to_char (sysdate, ' HH24 ') from dual; 14 2:08 P.M. to 14 MI minutes (0~59) Select to_char (sysdate, ' MI ') from dual; 17 4:17 P.M. SS seconds (0~59) Select to_char (sysdate, ' SS ') from dual; 22 11 points 3 minutes
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.