Author Archives: Robins

PHP:Fatal error: Class ‘COM’ not found in … How to deal with the problem

PHP: Fatal error: Class ‘COM’ not found in… 1. First check if the COM service has been started in Windows’ Services’. If not, start it. Windows Management Instrumentation 2, PHP directory ext directory PHP_COM_DOTNET.DLL exists. (Ext, by the way, is often used as an extension directory for PHP programs, and is usually set up when PHP is installed. Otherwise, it’s not just the subject that’s wrong.) 3. If not, add the following to php.ini: PHP_COM_DOTNET = “allow_dcom”;// PHP_COM_DOTNET = “allow_dcom”;// PHP_COM_DOTNET = “allow_dcom”;// PHP_COM_DOTNET: “allow_dcom” = “true”; So you need to in PHP. Add a line to expand the extension = php_com_dotnet ini. DLL, is to add a line, is not open, no this line in the default configuration file, and then restart the IIS and Apache, running as normal again!

In thinkphp5, we encountered the problem of class’ phpoffice / phpspredsheet / spreadsheet ‘not found

 
When you’re using Excel import and export and you’re using PHPSpreadsheet you’re going to use Composer,

 composer require phpoffice/phpspreadsheet

In fact, when you compose your PHPSpreadsheet, you should never move it. This will cause problems with your paths and everything
Composer down you don’t move and don’t copy the file, can appear otherwise Class ‘PhpOffice \ PhpSpreadsheet \ Spreadsheet’ not found this problem

Anything circled in red should not be moved or copied

Class ‘PHPWord_Writer_Word2003‘ not found

Question:
Error in using PHPword to generate word:
Fatal error: Uncaught error: Class ‘PHPWord_Writer_Word2003’ not found in D:\ phpStudy_Pro \WWW\newword\ phpWord \ phpWord \ iofactory.php :110 Stack trace: #0 D:\ phpStudy_Pro \WWW\newword\ DEMO (132): PHPWord_IOFactory::createWriter(Object(PHPWord), ‘Word2003’) #1 {main} Thrown in D:\ phpStudy_Pro \WWW\newword\ PHPWord\ PHPWord\ PHPWord\ iofactory.php on line 110

Solutions:
The word version that should be used with you is concerned, I change Word2003 here 2007 can be used normally!

— — the END — —

CONDA creating virtual environment and common CONDA commands

Conda creates a virtual environment
1, what is a virtual environment
it is a virtualization, independent from computer hacked out of the environment. Commonly speaking, virtual environment is to use virtual machine Docker to independent part of the content, we call this part of independent things “container”, in this container, we can only install the dependent packages we need, each container is isolated from each other, do not affect each other.
2, why want to use a virtual environment
in the actual project development, we usually according to their own requirements to download all sorts of corresponding framework library, such as Scrapy, Beautiful Soup, etc., but may each project USES the framework of library is not the same, or using a framework version is different, so we need to according to the demand constantly update, or uninstall the corresponding libraries. Working directly with our Python environment can cause a lot of unnecessary hassle for our development environment and project, and can be quite confusing to manage. Like the following scene:
Scenario 1: Project A requires version 1.0 of A framework, and project B requires version 2.0 of the library. If the virtual environment is not installed, then when you use the two projects, you will have to uninstall back and forth, which can easily cause errors in your project.
Scenario 2: Your company’s previous projects need to run in Python 2.7, and your project needs to run in Python 3. If you do not use the virtual environment, you may not be able to use both projects at the same time. If you use Python 3, your company’s previous projects may not be able to run, and your new projects may have trouble running. If the virtual environment can configure different runtimes for the two projects, then both projects can run at the same time.
Second, conda common commands
in the Anaconda conda can be understood as a tool, is also an executable commands, its core function is package management and environmental management. Therefore, the virtual environment to create, delete and other operations need to use the conda command.
1. Create a virtual environment

conda create-n env_name numpy matplotlib python=2.7 # Conda create -n env_name numpy matplotlib python=2.7 #
2. Activate the virtual environment
Linux: source activate your_env_name
Windows: activate your_env_name
tivate root
p>n –version Check if the current Python version is the one you want.
3. Exit the virtual environment
Linux: Conda deactivate your_env_name
Windows: deactivate env_name
4. Remove the virtual environment
Conda remove-n your_env_name(virtual environment name) — ALL
Delete packages from virtual environment:
Conda remove –name $your_env_name $package_name
6. Share the environment
conda env export > environment.yml
7. Create the environment from the YML file
conda env create -f environment.yml
Conda install package_name
(4). Conda install package_name
(4). Conda install package_name
(4). Conda install package_name
(4).
(5). Conda update conda: Check to update the current conda.
(5)

Could not launch “” Domain: IDEDebugSessionErrorDomain Code: 3 Failure Rea

Xcode error:
Could not launch “” Domain: IDEDebugSessionErrorDomain Code: 3 Failure Rea
before test has been on the iPhone, after changed the error as above.
Reason:
did not trust its own description management account when debugging a new device for the first time.
The solution:
in the description of the management and trust his account.

Python judge perfect square number

— coding: utf-8 —
# # Integer-coding:
+ 100 + 268 is a perfect square
# + coding: utf-8 —
#
from math import sqrt
def f(number):
for x in range(0,number):
m=sqrt(x+100)
n=sqrt(x+268)
if mint(m) and nint(n):
print x
If name = = “main” :
f (1000).
Running results:
21
261

[Python] error syntax error: summary of solutions to invalid syntax

Today, I learned Python, but I had a problem at the beginning. The code was perfectly fine, but every time I ran it, it showed “SyntaxError: Invalid Syntax”.

“SyntaxError: invalid syntax” means “mark> syntax error ;
after query solved the problem, so concluded a solution to this question:

    version problem:
    because python2 and python3 are incompatible, so some can run on python2 code can not run on python3; You can try to change versions; path problem:
    remember to take a closer look at your own path is correct; careless problem: br> f>t to add colon (:) at the end of if, elif, else, for, while, class,def declarations;
    used = instead of ==; When installing third-party modules :
    when installing third-party modules is also likely to be “SyntaxError: invalid syntax” this problem, then need to check some is installed under the CMD window, at the same time, to the python installation directory, find PIP installation directory inside;

How to save big data in Oracle to CLOB

If the data is too large to be assigned directly to a CLOB variable, then we can read and write to the CLOB variable in stages using the DBMS_LOB.read and DBMS_LOB.write methods. But at this point we should cache CLOB variables, as shown in the first sentence below. Here is an example program that can not only write big data but also read it by switching the order DBMS_LOB.read and DBMS_LOB.write.

dbms_lob.createtemporary(lob_loc => x_clob,
                             cache   => TRUE);
PROCEDURE load_clob(p_clob_in IN CLOB,
                      x_clob    IN OUT NOCOPY CLOB) IS
    
    l_clob_len NUMBER := dbms_lob.getlength(p_clob_in);
    l_data VARCHAR2(32756);
    l_buf_len_std NUMBER := 4000;
    l_buf_len_cur NUMBER;
    l_seg_count   NUMBER;
    l_write_offset NUMBER;
  BEGIN
    IF p_clob_in IS NOT NULL THEN
      l_seg_count := floor(l_clob_len/l_buf_len_std);
      FOR i IN 0 .. l_seg_count
      LOOP
        
        IF i = l_seg_count THEN
          l_buf_len_cur := l_clob_len - i * l_buf_len_std;
        ELSE
          l_buf_len_cur := l_buf_len_std;
        END IF;
        
        IF l_buf_len_cur > 0 THEN
          dbms_lob.read(lob_loc => p_clob_in,
                        amount  => l_buf_len_cur,
                        offset  => i * l_buf_len_std + 1,
                        buffer  => l_data);
          l_write_offset := nvl(dbms_lob.getlength(lob_loc => x_clob),
                                0) + 1;
          dbms_lob.write(lob_loc => x_clob,
                         amount  => l_buf_len_cur,
                         offset  => l_write_offset,
                         buffer  => l_data);
        END IF;
      END LOOP;
    END IF;
  END load_clob;

Reproduced in: https://blog.51cto.com/snans/1353672

Wechat applet animate animation does not implement animation effect for the first time

The main problem is that your.wxss file does not set the appropriate properties; For example, if use Animation. Left (number | string value) element to the left, the Animation is a specific execution of Animation from the time of the elements of the left value to the left you new set value; So if you don’t have an attribute in your original element style you’re not going to get the initial value, you’re not going to be able to animate it, so you’re going to do a left assignment and you’re not going to animate it.

Vscode cnpm: unable to load file, but open console with CMD without error

Question:
Install CNPM on the new computer. When running CNPM-V in VSCODE terminal, the following error will be reported:

CNPM: Unable to load file
C:\Users\Administrator\AppData\ NPM \cnpm.ps1 because script is not allowed to run on this system. For more information, please refer to the
https:/go.microsoft.com/fwlink/?
about_Execution_Policies in LinkID=135170. Position line :1 character :1
cnpm -v

  + CategoryInfo          : SecurityError: (:) [],PSSecurityException
  + FullyQualifiedErrorId : UnauthorizedAccess

Solution:
(1) Run VS Code as an administrator and open a terminal in VS Code
(2) Execute Get-ExecutionPolicy at the terminal, displaying Restricted
(3) Update the PowerShell policy and execute it on the terminal: set-executionpolicy RemoteSigned
(4) Examine the status of the policy again and execute: GET-EXECUTIONPOLICY at the terminal to show the RemoteSigned igned
(5) Re-input CNPM-V problem successfully solved
Just taking notes.