Category Archives: How to Fix

Phpcms development problems and Solutions

Problem: the foreground user cannot register or log in, and the backstage member management function also fails.
Customer demand: the database is only for internal use of the school and not open to the outside world. Therefore, it is necessary to set permissions so that users can browse and use the database after logging in. Users can add the database uniformly in the background.
Solution: first solve the background can not add operation user problem, and then solve the foreground can not login problem. Find the corresponding controller method, the template output via var_dump(), and pinpoint which function and which line failed. The front page reviews the elements, looking at network and console.
Error: Missing the \phpsso_server module file and the \ PHPCMS \templates\default\content\message.html file in the root directory.
Error reason analysis: the controller to add membership and login registration will refer to the function in PHPSSO to make judgment, because the file was deleted, so the missing method led to error judgment, and the operation failed.
from my copy the file on the server came in and found still fails, and in my project running on the server, there are doubts still lack of a file or the server configuration problem, the last row of fault detection is phpsso there are database configuration, as well as the domain name configuration, problem solving after the change.
at this time there was a problem again, log in at the front desk, it found that there will be a 500 error, then there is no any other error message, at this point the server error log (\ HwsApacheMaster \ Apache \ logs \ the error log) found errors for * * “Premature end of script headers (script head early end)” * *, received at this time a bit, so online on baidu, found that writing is a bit complicated to see different, said the reasons are not enough file permissions, CGI permissions: I searched how to configure and start CGI. I first changed the configuration on my server according to the operation (that is, changed the PHP configuration) and found that it still works normally, indicating that it is not a CGI problem. File permissions also changed to find or report error.
here is a little collapsed and no more errors, didn’t also found online to effective solutions.
later still use old way: by var_dump () and die, fault line by line. \ PHPCMS \libs\functions\global.func. PHP \ PHPCMS \libs\functions\global.func. PHP \ PHPCMS \libs\functions\global.func
function showMessage (MSG,url_forward = ‘goback’, ms=1250,dialog = ‘ ‘, $returnJS = ‘) {
(defined(‘ IN_ADMIN ‘)) {
i>de (admin::admin_tpl(‘ showMessage ‘, ‘admin’));
} else {
clude (template(‘ content ‘, ‘message’));
}
exit;
>
>
>
>
>
>
>
>
>
>
>
> 2. When there is no obvious error, the most important thing to solve the problem is patience, calm down analysis will always solve. The solution is simple, use var_dump and die background output, foreground view, line by line positioning;
3. The first step can solve most problems independently, and the second step can improve the time efficiency of solving problems.
Note: the
add background user controller:/PHPCMS/modules/member/templates/member_add TPL. PHP
analysis of related documents: /phpcms/languages/zh-cn/member.lang.php
/phpcms/modules/member/member.php
/phpcms/modules/member/classes/client.class.php
/phpcms/phpcms_server/phpcms/modules/phpsso/index.php
/phpcms/templates/default/member/mini.html
/phpcms/modules/member/index.php

Failed to push some refs to

error: failed to push some refs to
error: failed to push some refs to... error: failed to push some refs to...
Summarize the causes and solutions
No code submitted
You can use git status to see if you forgot to commit your code. If you forget, just submit it.

  git add .
  git commit -m "This is a new commit"
  git push origin master

Conflicts arise between local and remote

    strong coverage

      git push -f origin master
    
      first back to pull
      git pull –-rebase origin maste
      git push origin master
    

    record

Package summary of installing python with CONDA

Install Python with Conda package summary ## title
If you want to find which package, go to the official website and download it directly to this directory (my directory location)

CD C:\ProgramData\Anaconda3\Lib
\ ProgramData\Anaconda3\Lib
\
PIP install torchvision-0.1.8-py2.py3-none-any.whl
p install torchvision-0.1.8-py2.py3-none-any.whl
PIP install torchvision-0.1.8-py2.py3-none-any.whl
PIP install torchvision-0.1.8-py2.py3-none-any.whl . (here torchvision 0.1.8 – py2 py3 – none – any. WHL, is my at https://pypi.org/project/torchvision/0.1.8/#files to download python library)
this time in the CMD import torchvision went wrong, but in the anaconda in the prompt is correct.
Everything will be all right!

These dependencies were not found

ERROR Failed to compile with 2 errors
These dependencies were not found:
@/views/enterprise_users/enterprise_verify.vue in ./src/router/index.js
@/views/enterprise_users/index.vue in ./ SRC /router/index.js
Vue :
br>
Vue :
Vue :
Vue :
>

>

Solve the problem that data cannot be input in idea console

IDEA console cannot be entered
If you are using IDEA and you find that you cannot input from the console while testing with JUnit, you need to make the following changes to make the configuration successful
Step 1: Help –Edit Constom VM Options…

Step 2: open the configuration, add – Deditable. Java. Test. The console = true

If the configuration is successful, restart IDEA and the problem will be solved

Invalid host header error in Vue using peanut shell agent

In the root directory of the project of the package. The json file “dev” : “webpack dev – server – the content – base./- open – the inline – hot — compress – history – API – fallback – config build/webpack dev. Config. Js” add – behind the host 192.168.1.5 (fill in your own IP address). This is because the new version of webpack-dev-server checks the hostname by default for security reasons, and breaks access if the hostname is not in the configuration. You can add the following webpack-dev-server configuration to webpack.base.config.js in the build directory: devServer: {disableHostCheck: true,},

How to handle when select single is not allowed in loop

What happens when select single is not allowed in the LOOP
Examples: Materials are available at a variety of prices and have expiry dates

    this part of the first I contact processing, was conducted in DSO itself in a transformation:
    first result_package according to the actual delivery date to heavy, and then for the first and the last one, make sure the date range of package
    based on the above date range to need to get the data in the table
    then LOOP itself, try to reduce data after
    LOOP itself, split the date range a a

    This approach requires setting up semantic groups
    Note: this article is my daily record of learning, do not carry out any commercial so do not support reprint please understand

When react dynamically prunes components by operating arrays, the state of the remaining components is not preserved. Solution to the problem (method of dynamically setting unique key value)

Problem: There is A public component A whose parent component B renders A by iterating through the array. Dynamic addition or deletion of an array is the same as dynamic addition or deletion of component A. The problem is that the user is responsible for adding and deleting, so there is no way to give a fixed key at the beginning. In the beginning, index is used as the key value, but adding or deleting components will refresh the key value of previous components, resulting in the state cannot be preserved.
solution:
br> a>

>

Python uses the priority queue to get the maximum k elements

Use PriorityQueue to get the maximum K elements
In order to sort slightly larger numbers, sometimes you don’t want all of the data, you just want the maximum k numbers up front, if you use sorted numbers ([…]). )[::-1][:k] Implementation efficiency is much lower. In order to optimize the execution speed, PriorityQueue can be used to achieve the maximum k elements. At the same time, the space can also be significantly optimized

import queue
import random

K = 12
q = queue.PriorityQueue()
tlist = []

for ith in range(100):
    q.put((ith, ith + random.randrange(100)))
    if q.qsize() > K: q.get() # pop least item
        
while not q.empty():
    tnum = q.get()
    tlist.append(tnum)

tlist.sort(reverse=True)
print(tlist)

The effect

[(99, 187), (98, 152), (97, 184), (96, 136), 
(95, 105), (94, 119), (93, 109), (92, 169), 
(91, 149), (90, 143), (89, 91), (88, 92)]

Priorityqueue are in queue bag and priorityqueue implementation in the queue is called headq inside the top of the heap, so did not provide key parameters change priority queue sorting rules, only from small to large, ascending order so, in order to get top K elements, need to queue size is greater than K pop team first element, maintain the biggest K in queue, and then use a list to undertake the element in the queue, and then descending sort results for the target at a time.

Mybatis error “field ‘ID’ doesn’t have a default value”

SelectKey = SelectKey; SelectKey = SelectKey; SelectKey = SelectKey; SelectKey = SelectKey; SelectKey = SelectKey; SelectKey = SelectKey; SelectKey = SelectKey

   @Insert({"insert into song(name,singer,category,writer,language,issudate)values(#{name},#{singer},#{category},#{writer},#{language},#{issudate})"
    })
    @SelectKey(statement = "select last_insert_id()",before = false, resultType = Integer.class,keyProperty = "id")
    public int insert(Songs songs);
}