Author Archives: Robins

TypeError: unsupported operand type(s) for *: ‘range‘ and ‘int‘

This is an error caused by the python2 and python3 versions
in python2, range() returns a list, and you can directly operate range and int
in python3, range() becomes a class. You can’t directly operate on range. You need to add a list first, such as list (range (5))
in order to save memory, range() in python3 only stores the start, stop and step elements of range(), and the rest of the values are calculated one by one, which is actually an iterator. In addition, list() lets range() calculate all the values, and then it can be added.

Zend studio HTML error prompt close, PHP “error prompt” open and close the correct way

When we first developed the project, we needed error prompts very much, but after the project went online, we certainly didn’t want to display these error prompts, right?This is about to do some settings, often a lot of PHP novice, do not know how to set?Or the setting method is wrong.

1、 The setting method of the project under development:

1. Open php.ini

2. Set error_ reporting = E_ ALL

3. Set display_ errors = On

2、 The setting method after the project is really online:

1. Open php.ini

2. Set error_ reporting = E_ ALL & ~ E_ DEPRECATED & ~ E_ STRICT

3. Set display_ errors = Off

3、 If you don’t have permission to modify php.ini, you can add the following two lines of code directly to the PHP file:

1、ini_ set(“display_ errors”, “On”);

2、error_ reporting(E_ ALL | E_ STRICT);

be careful:

First, after modifying the configuration file php.ini, be sure to restart the service.

Second, error_ The value of reporting can be modified at will. It is suggested to modify it according to your project development situation: is it under development?Or is it online?error_ What are the specific values of reporting?I’ll talk about it in the following expanded knowledge.

Expand knowledge:

Maybe some of them don’t understand the above settings. Let’s talk about it in detail: error_ Reporting represents the error level, display_ Errors represents whether error prompts are displayed.

error_ Reporting error levels include the following:

E_ All – all errors and warnings (including E_ STRICT)

E_ Error – fatal runtime error

E_ RECOVERABLE_ Error – a nearly fatal runtime error

E_ Warning – runtime warning (non fatal error)

E_ Parse – compile time parsing error

E_ Note – runtime notifications (these are usually warnings from errors in your code, but it may be intentional (for example, using uninitialized variables and relying on it to automatically initialize to a fact empty string)

E_ Strict – runtime notification that allows PHP to suggest changes to your code will ensure optimal interoperability and forward code compatibility

E_ CORE_ Error – fatal error during initial PHP startup

E_ CORE_ Warning – a warning (non fatal error) that occurs during PHP, initial startup

E_ COMPILE_ Error – fatal compile time error

E_ COMPILE_ Warning – compile time warning (non fatal error)

E_ USER_ Error – user generated error message

E_ USER_ Warning – user generated warning message

E_ USER_ Note – user generated notification message

E_ Suppressed – warning code will not work in future versions of PHP

E_ USER_ Suppressed – user generated discard warning

error_ The most common settings of reporting are as follows:

E_ All (displays all errors, warnings and notifications, including coding standards.)

E_ ALL & ~ E_ Note (show all errors except notification)

E_ ALL & ~ E_ NOTICE & ~ E_ Strict displays all errors except notification and coding standard warnings.)

E_ COMPILE_ ERROR|E_ RECOVERABLE_ ERROR|E_ ERROR|E_ CORE_ Error (display error only)

PHP read ini configuration error syntax error, unexpected ‘=’In

Error information

Warning: syntax error, unexpected '=' in src/web/../conf/config.ini on line 12

reason

[start_url]
site1=https://baidu.net/home.php?mod=space&uid=0000&do=thread&view=333333
site2=https://google.com/forum.php?mo=111

Because start_ The URL contains the URL, which must be quoted before PHP will report an error. However, it is not a problem to read it in Python.

terms of settlement

Add the parameter ini when reading_ SCANNER_ RAW

$file = __DIR__ . "/../conf/config.ini";
$config = parse_ini_file($file, true, INI_SCANNER_RAW);

The transaction log for database ‘xxxx’ is full due to AVAILABILITY_REPLICA error message in SQL Ser…

reason:

The log has reached the maximum space on the primary copy or the disk is full.

analysis

The log block of the primary replica can only be reused after it is fixed and redo on other replicas.

So if

1. Transmission delay, due to network delay or bandwidth delay.

2. Copy redo is slow due to delay, blocking or insufficient resources.

Causes the log to grow and cannot be backed up.

log_ send_ queue_ Size: a log block that has not been received by the replica. More than one log block means delivery delay.

redo_ queue_ Size: there is no redo log block on the replica. If there is more, it means redo delay.

SELECT ag.name AS [availability_group_name]
, d.name AS [database_name]
, ar.replica_server_name AS [replica_instance_name]
, drs.truncation_lsn , drs.log_send_queue_size
, drs.redo_queue_size
FROM sys.availability_groups ag
INNER JOIN sys.availability_replicas ar
    ON ar.group_id = ag.group_id
INNER JOIN sys.dm_hadr_database_replica_states drs
    ON drs.replica_id = ar.replica_id
INNER JOIN sys.databases d
    ON d.database_id = drs.database_id
WHERE drs.is_local=0
ORDER BY ag.name ASC, d.name ASC, drs.truncation_lsn ASC, ar.replica_server_name ASC

resolvent:

1. Remove the DB from the most delayed replica and join it later.

2. If the redo thread on the replica is blocked by frequent read operations, set the replica as unreadable and change it back later.

3. If there is still space on the disk, the log file will grow automatically.

4. If the maximum space limit is reached and the disk still has space, increase the maximum space limit.

5. If the log file reaches the maximum value of 2T system and there are idle disks, add the log file.

reference material

https://docs.microsoft.com/en-US/troubleshoot/sql/availability-groups/error-9002-transaction-log-large

react Error: Unable to resolve module mobx-react

Mobx needs to be used in the development process. After installing and running according to the instructions on the official website, an error is always reported: error: unable to resolve module mobx react from E: (uploadcode, update, test, app, app. JS: mobx react could not be found within the project or in these directions:
node_ modules
…\ node_ Modules
at the beginning, I thought that the network was not good when I downloaded it. I didn’t download it completely, so I uninstalled what I just installed and installed it again, but there was still this error finally, I can only look at the error information to see if there is a solution. Finally, this sentence attracted my attention: mobx react could not be found within the project or in these directions:
node_ modules
…\ node_ modules

On node_ Modules and_ I can’t find mobx react in the modules folder, so I went into these two folders and found that… – node_ Modules folder contains the content I just downloaded, but node_ There is no module, so I enter the node from the terminal_ In the modules folder, download and install the dependency again
after downloading, rerun the project and no error will be reported
summary: if there is no dependency for you to download in any folder, go to the corresponding folder and download it again, so that all the folders mentioned in the error message have the dependency for you to download

Flutter SocketException: OS Error: No route to host, errno = 113, address = XXX

Or flutter   WebSocketChannelException: SocketException: OS Error: No route to host, errno = 113, address = XX

This type of access problem,

1. First of all, whether the port on the server side is open or not, MacOS or windows, please do it yourself

2. The problems encountered here, I will explain my situation. First of all, the test I did belongs to the type of LAN, and I know that my server IP and real mobile phone, including web page test, are all in the same network segment. For example, 192.168.1.xx to 192.168.1.250. There is no problem with the access of the extension computer, but the mobile phone has this problem, The IP of the mobile phone is also in the same segment with the server we tested, but why is the problem of not finding the host mentioned above?

Finally, we found that the mobile phone is linked in the 5g band of the router, which may be due to the IP isolation between 5g band and other IP when the router is set up, resulting in mutual inaccessibility

It’s OK to enter 2.4G

Error c2059: syntax error: constant solution

Scene

      Add the header file and library file of Haikang and Yushi SDKs. Error c2059: syntax error: “constant”. The macro definition in netdevsdk. H header file of UTV SDK is abnormal
displayed   typedef enum tagNETDEV_ PASSIVEDECODE_ CMD
 {
   PASSIVE_ DEC_ PAUSE = 1,    /* Passive decoding pause (file stream only valid) */
0    PASSIVE_ DEC_ RESUME = 2,    /* Recover passive decoding (only valid for file stream) */
0    PASSIVE_ DEC_ FAST = 3,    /* Fast passive decoding (only valid for file stream) */
1    PASSIVE_ DEC_ SLOW = 4,    /* Slow passive decoding (file stream only valid) */
1    PASSIVE_ DEC_ NORMAL = 5,    /* Normal passive decoding (file stream only valid) */
0    PASSIVE_ DEC_ ONEBYONE = 6,    /* Passive decoding single frame playback (reserved) */
1    PASSIVE_ DEC_ AUDIO_ ON = 7,    /* Audio on */
1    PASSIVE_ DEC_ AUDIO_ OFF = 8,    /* Audio off */
1    PASSIVE_ DEC_ RESETBUFFER = 9     /* Clear buffer */
0  } NETDEV_ PASSIVEDECODE_ CMD_ E;

Netdevsdk. H (5082): error c2059: syntax error: “constant”
netdevsdk. H (5091): error c2143: syntax error: missing “;”( Before “}”

Mouse on passive_ DEC_ Pause, see the error prompt: # define         PASSIVE_ DEC_ PAUSE             one

Investigation process               Macro definition search for the whole project directory in Notepad + +_ DEC_ Pause, found that hcnetsdk. H
?Define has been defined in the header file of Haikang         PASSIVE_ DEC_ PAUSE             one     /* Passive decoding pause (file stream only valid) */
?Define         PASSIVE_ DEC_ RESUME             two     /* Recover passive decoding (only valid for file stream) */
?Define      PASSIVE_ DEC_ FAST               three    /* Fast passive decoding (file stream only) */
?Define      PASSIVE_ DEC_ SLOW             four    /* Slow passive decoding (file stream only valid) */
?Define      PASSIVE_ DEC_ NORMAL           five    /* Normal passive decoding (file stream only valid) */
?Define      PASSIVE_ DEC_ ONEBYONE           six   /* Passive decoding single frame playback (reserved) */
?Define      PASSIVE_ DEC_ AUDIO_ ON          seven    /* Audio on */
?Define      PASSIVE_ DEC_ AUDIO_ OFF         eight        /* Audio off */
?Define         PASSIVE_ DEC_ RESETBUFFER         nine     /* Clear the buffer */
so the above prompt error appears

Solution

             Netdev is not found in the header file of UTV SDK_ PASSIVEDECODE_ CMD_ E macro definition, therefore, the entire macro definition is annotated directly to solve the problem