Fully understand shallow copy and deep copy in JS
1. Brief introduction of shallow copy and deep copy
Shallow copy: although two objects have the same properties after being copied, they all point to the same memory space
let a = {x: 123}
let b = a
b.x = 234
console.log(b) // {x: 234}
console.log(a) // {x: 234}
. operation will cause reference and change of variables ...
Posted by dtyson2000 on Sat, 04 Jan 2020 05:08:10 -0800
swift network request URLRequest
Swift network request data
viewController
import UIKit
class ViewController: UIViewController,UITableViewDataSource,MJRefreshBaseViewDelegate {
//Table attribute
var table:UITableView?
var tableDataArr:[News]?
var mjHeaderView:MJRefreshHeaderView?
var mjFooterView:MJRefreshFooterView?
var st ...
Posted by nickadeemus2002 on Sat, 04 Jan 2020 04:34:15 -0800
Java parsing json string
Today, I saw a music interface on the Internet. It happened that some music needed copyright to be heard, so I was ready to toss
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.util.Scanner;
import org.json.JSONArray;
import org.json.JSONObject;
pub ...
Posted by Scabby on Fri, 03 Jan 2020 23:47:34 -0800
PHP Socket server building and testing
1.socket server building ideas
1) Objective: to understand the working mechanism of socket server
2) Idea: create socket - > Add socket to connection pool - > process receiving information - > handshake action - > send information
2.socket server code
Note: copy to php file, direct command line can run, no other support is requi ...
Posted by jdiver on Fri, 03 Jan 2020 23:13:03 -0800
After ajax validation, the form is submitted
After ajax validation, the form is submitted.
Be careful:
(1) The form in html cannot use submit, but button,
(2) At the same time, the id and name of the button cannot be "submit", otherwise it will fail.
(3) Form needs an ID (for example, id = "formid") to find the corresponding form in ajax.
Code in ...
Posted by mnewbegin on Fri, 03 Jan 2020 22:47:35 -0800
spring boot2 configuration FastJsonHttpMessageConverter does not work
Project uses custom FastJsonHttpMessageConverter for API data response JSON converter
In the original version of springboot1.X, it can take effect. The configuration is as follows:
/**
* Instead of using FastJson to parse the returned results
*/
@Override
public void configureMessageConverters(List<HttpMessageConver ...
Posted by psymonic on Fri, 03 Jan 2020 17:42:08 -0800
Using API interface to view, create and delete monitoring host in zabbix monitoring system
What is API:
API (Application Programming Interface) is a pre-defined function, which aims to provide the ability of application program and developers to access a set of routines based on a certain software or hardware without accessing the source code or understanding the details of internal working mechanism. In short, API ...
Posted by richo89 on Fri, 03 Jan 2020 17:28:46 -0800
Daniel will take you 5 minutes to create a Flask project!
Get ready
Install: pip install flaskFlask
Quick start: http://docs.jinkan.org/docs/flash/quickstart.html "QuickStart"
Rapid construction
Build in the project root directory:
webapp package directory, where the flash code is stored. There is a "init. Py" file in the package
templates directory to store template files
Stati ...
Posted by blueman on Fri, 03 Jan 2020 12:51:48 -0800
Vue.js+axios get service
First of all, what Xiaguan said on the Internet
Execute GET request
// Make a request for a user with a given ID
axios.get('/user?ID=12345')
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});
// Optionally the request above could also be done as
axios.get( ...
Posted by nickholas on Fri, 03 Jan 2020 06:45:51 -0800
Wechat applet comprehensive case practice
1. User login
Knowledge points:
Configuration page (page,window,tabBar)
Life cycle (judge whether the user exists in onLoad)
Event binding (login button, input input input box)
Data transfer
Step 1: prepare the basic page (index user login). wxml
//login.wxml
<text>User name</text>
<input bindinput='user ...
Posted by Jas on Thu, 02 Jan 2020 11:20:49 -0800