__isset(); When an undefined property calls isset, it is called.
__unset(); When an undefined property calls unset, it is called.
__get(); When calling an undefined property in a class, it is called.
__set(); When a value is assigned to an undefined attribute in a class, it is called.
class C{
function __set($p, $p1){ var_dump(__METHOD__); }
function __get($p){ var_dump(__METHOD__); }
function __isset($p){ var_dump(__METHOD__); }
function __unset($p){ var_dump(__METHOD__); }}
$c = new C;var_dump(isset($c->a));unset($c->a);var_dump($c->a);$c->a = 1;
====...
<!DOCTYPE html>
<html>
<head>
<meta charset=”utf-8″ />
<title></title>
<script>
//Print 99 multiplication table
for (var i = 1; i <= 9; i++) {
for (var j = 1; j <= i; j++) {
document.write(j + “×” + i + “=” + i * j + “\t”);
}
document.write(“<br />”);
}
</script>
</head>
<body>
</body>
</html>
socketRealization
serverend
import socket
import subprocess
import struct
import json
# Buy a mobile phone
phone = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# Insert phone card, port range 0-65535
# Look at the usage state of the port and enter netstat -an |findstr 8080 on the command line.
phone.bind(('127.0.0.1', 8081))
# Open the machine
phone.listen(3) # The number of semi connected pools is limited.
print('server start...')
# Waiting for phone connection request
while True: # Connection cycle
conn, clinet_address = phone.accept()
print(conn, clinet_address)
while ...
[BZOJ4242] kettle (Kruskal reconstruction tree, BFS)
surface”
BZOJHowever, it is a question of jurisdiction.
Description
JOIThe IOI city where you live is famous for its very hot season all year round.
IOIThe city is a rectangle divided into vertical H * horizontal W blocks, each of which is one of the buildings, fields, and walls. The area of the building is P, numbered 1… P.
JOIYou can only enter buildings and wilderness, and each time you can only walk to adjacent areas, and can not move outside the city.
JOIBecause of all kinds of things, he must travel between buildings. Al...
The title is direct.
Subject matter
I’ll give you a $n$string. Save it in a dictionary. Here’s another $m for each query, one string for each query, and in the dictionary, find out how many strings are prefixed with this string.
The idea of solving the problem
Template problem
Setting a variable of $sig $at each point indicates the number of words prefixed with strings of characters passing through the path.
$Trie$ Tree. In $insert$operation, add $sig$to the point passed through the path $1$.
$sig$is directly output when querying.
Attach the code
#include <iostream>
#in...
Subject matter
Given a string of $s$which is $n in length, you are asked to find the sum of the times each prefix of $s$appears in $s$. $n\le 200000$.
The idea of solving the problem
The violence prefix each prefix and match the number of occurrences.
That certainly won’t work. The complexity is $O (n\ times (m + n) $and we don’t have to worry about TLE, but let’s consider the nature of the $next $array in $KMP $for each prefix and the longest common substring for each prefix.
That doesn’t mean that if $next [i] = J $then the two substrings of $1 right arrow J $and ...
api.getxx({},(res)=>{
this.data1 = res
this.data2 = res
})
this.data1.splice(1,1) The value of data2 will also change.
Solution: cloning
api.getxx({},(res)=>{
this.data1 = res
this.data2 = res.slice(0)
})