SimpleDateFormat Thread Security

background As we all know, SimpleDateFormat in Java is not thread-safe and can cause unexpected problems under multiple threads.This article will explore the specific reasons why SimpleDateFormat threads are insecure to gain a deeper understanding of thread security. Example Simple test code that can cause problems when multiple threads call th ...

Posted by Deany on Sun, 08 Dec 2019 08:22:33 -0800

[four Twirl template engine] 3. Common templates

Now let's look at the typical usage of templates. layout Now declare a view / main.scala.html template as the main template: @(title: String)(content: Html) <!DOCTYPE html> <html> <head> <title>@title</title> </head> <body> <section class="content">@content</section> ...

Posted by Tryweryn on Sun, 08 Dec 2019 07:13:13 -0800

PHP MySQL series functions

How to connect a mysql database with mysqli series functions? 1. PHP mysqli connect() function: mysqli connect() function opens a new connection to MySQL server. Syntax: mysqli connect (host (specify host name or IP address), username(mysql user name), password(mysql password), dbname (default database)) Open a new connection to the MySQL se ...

Posted by healthnut on Sun, 08 Dec 2019 04:30:37 -0800

Remote call - getting started with HttpClient

Introduction: HttpClient is a subproject under Apache Jakarta Common, which is used to provide an efficient, up-to-date and feature rich client programming toolkit supporting HTTP protocol, and it supports the latest version and suggestions of HTTP protocol. usage method: 1. Create a client CloseableHttpClient 2. Create an instance of the r ...

Posted by Calvin770D on Sun, 08 Dec 2019 02:02:18 -0800

python3 django page addition, deletion, modification and query

Previous articles Python3 Django admin initialization background management project (mysql) Python3 Django admin add business module, multi field search Based on the blog module in the django project of the above article, make a custom crud page for the article Page template Create a new directory templates in the root directory of the projec ...

Posted by cjdesign on Sun, 08 Dec 2019 00:32:22 -0800

Tips for using Apache commons IO

Commons IO is a utility library that helps develop IO functions. It mainly includes six aspects: Utility class - perform common tasks using static methods input - useful input stream and reader implementation output - useful output stream and writer implementation Filter Various implementations of file filter c ...

Posted by melsi on Sat, 07 Dec 2019 23:35:13 -0800

vue-day2 of front end and mobile development

Global filter // Define a global filter Vue.filter('dataFormat', function (input, pattern = '') { var dt = new Date(input); // Date of acquisition var y = dt.getFullYear(); var m = (dt.getMonth() + 1).toString().padStart(2, '0'); var d = dt.getDate().toString().padStart(2, '0'); // If the string type passed in is equal to yy ...

Posted by xjake88x on Sat, 07 Dec 2019 22:16:08 -0800

Memo mode of design mode

scene Protect the integrity of the saved state of these objects and the internal implementation from being exposed You need to store the state externally on the premise of getting the state. So that at some point, you can restore your previous state. role There are three conventional roles: Originator: primitive state class Memo: a specific ...

Posted by omelin on Sat, 07 Dec 2019 19:08:52 -0800

Variables and function return values in Python functions

1. Variable of function Local and global variables: Any variable in Python has a specific scope Variables defined in a function can only be used inside the function, and those variables that can only be used in specific parts of the program are called local variables Variables defined at the top of a file can be called by any function in the fi ...

Posted by cactus on Sat, 07 Dec 2019 18:27:45 -0800

[C + +] 35 μ function object analysis

customer demand Write a function Function to get the value of each term of Fibonacci series Return one value per call Functions can be reused as needed Programming experiment: the first solution #include <iostream> using namespace std; int fib() { static int a0 = 0; static int a1 = 1; int ret = a1; a1 = a0 ...

Posted by garry27 on Sat, 07 Dec 2019 17:35:05 -0800