Tag Archives: Programming

[Solved] Uncaught Error: Highcharts error #16

Highcharts error #16 is due to duplicate Highcharts definitions. The reason for this error is that the namespace of Highcharts is duplicated.

The namespace of Highcharts actually exists in the Highcharts.js file that we refer to when we use Highcharts.

Solution
Remove the Highcharts.js from the nested subpages and leave only the reference to the main page, and the error will not be reported.

Conclusion
Referencing Highcharts.js on the main page and referencing Highcharts.js on the sub-page nested in it will cause duplicate Highcharts definitions whenever the sub-page is loaded.

unhandled system error, NCCL version 2.7.8 [How to Solve]

There is no problem running the DDP based pytorch training program on the host computer,

After entering docker and running, the error “unhandled system error, NCCL version 2.7.8” appears.

Solution:

Add NCCL_DEBUG=INFO before the python -m torch.distributed.launch --nproc_per_node=4

You can see:

s215:623:649 [3] include/shm.h:48 NCCL WARN Error while creating shared memory segment nccl-shm-send-404da1ec128dc62d-0-3-2 (size 4104)

When entering docker, just add --ipc=host.

Error building SqlSession. ### Cause: org.apache.ibatis.builder.BuilderException: Error creating d

Debug:
I reported this error when I was a beginner of mybatis

Error building SqlSession.

Cause: org.apache.ibatis.builder.BuilderException: Error creating do

Caused by: org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 6; Processing instruction targets matching ‘[XX] [mm] [ll]’ are not allowed.

Finally, it is found that one line is left blank at the beginning of the SQL mapping file, but it is required that one line cannot be left blank. Just remove the blank line

error MSB8011: Failed to register output [How to Solve]

error MSB8011: Failed to register output. Please try enabling Per-user Redirection or register the component from a command prompt with elevated permissions.

Cause of formation: in versions above win7, only administrator privileges can run regsvr32.exe program, that is, only administrator privileges can register controls or DLLs.

Solution:

1. When running vs, right-click to run with administrator privileges. Do not open vs directly.

2. Engineering – > Propertier–> Linker–> General–> Register Output–> NO。

Unity2019.1.02f error cs0104: ‘minattribute’ is an ambiguous reference between

Error importing information downloaded from resource store: postprocessing/Editor/propertydrawers\ MinDrawer.cs (6,34):error CS0104: ‘MinAttribute’ is an ambiguous reference between ‘ UnityEngine.PostProcessing.MinAttribute ‘ and ‘ UnityEngine.MinAttribute ‘。

The solution: to MinDrawer.cs Replace all minattributes in with UnityEngine.PostProcessing.MinAttribute .

 

Unity Component.isActiveAndEnabled Analysis of exact meaning

The following results are the test conclusions.

Isactive in hierachy is equivalent to whether a GameObject is active or not, which is the same as a simple understanding.

Isactive andenabled requires three conditions:

The isactiveinheerachy of

    GameObject is true, and onenable
is being or has been called

So:

    in onenable of a script, isactive andenabled is always true. In ondisable of a script, isactive andenabled is always false

 

Test example: place a GameObject in the scene and two scripts below. Set GameObject and scripts to be active. In the process of running the scenario, in the script that calls onenable first, you can find that your isactive andenabled is true, but another script’s isactive andenabled is false.

So: there is no script to call onenable, though gameObject.isActiveInHierachy Is true, and enabled is true, but isactive andenabled is false.

 

ERROR: pygame-1.9.2-cp35-cp35m-win32.whl is not a supported wheel on this platform.

Why?

The downloaded pyGame is not compatible with the python version.

How do you do it?

Go to the website and download the pyGame installation related to your Python version.
(check your Python version: if you enter Python in CMD, you will be prompted for the python version.)

Process:

When installing pyGame last night, I went to the website: link according to the process in the textbook “Python Programming: from introduction to practice”, and downloaded the corresponding pyGame. However, the above errors occurred during the installation.
Looking all over the network, there is no suitable solution for me.
Then I look at the error report carefully:
pygame-1.9.2-cp35-cp35m-win32.whl is not supported by this platform (wheel, please point out what it is). The previous file is used to install pyGame.
1.9.2 refers to PIP version.
Cp35 refers to Python version 3.5, while mine is 3.7.
So far, the event is clear. Each pyGame corresponds to a different version of Python. The version is incompatible and an error is reported.
After downloading, the installation is successful!
(no screenshots here: I forgot to cut them last night)

OpenGL programming error analysis


C :\ Program Files (x86)\ Microsoft Visual Studio 11.0\ VC \ Include \ GL \glew.h 84 1 consoleApplication8
Solution:
#if defined(__gl_h_) || defined(__GL_H__) || defined(__X_GL_H)
#error gl.h included before glew.h

#include <GL/glew.h>
#include <GL/glut.h>

Glew.h is written in front of GLUT.

error
1> ConsoleApplication8.obj: error LNK2019: Cannot resolve external symbol __imp__glewInit@0, which is found in the function “void __cdecl init(void)” (?
1> init @@yaxxz)
1>; ConsoleApplication8.obj: error LNK2019: Cannot resolve external symbol __imp__glewGetErrorString@4, which is found in the function “void __cdecl init(void)” (?
1> init @@yaxxz)
1>; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____glewBindBuffer
1>; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____ glewbufferData
1>; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____glewGenBuffers
1>; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____glewAttachShader
1>; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____ glewcompileShader
1>; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____glewCreateProgram
1>; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____glewCreateShader
1>; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____glewDeleteShader
1>; ConsoleApplication8. Obj: error LNK2001: cannot resolve the external symbol of __imp____glewEnableVertexAttribArray
1 & gt; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____glewGetProgramInfoLog
; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____glewGetProgramiv
1>; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____ glewgetShaderInfolog
1>; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____glewGetShaderiv
1>; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____glewLinkProgram
1>; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____glewShaderSource
1>; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____glewUseProgram
1>; ConsoleApplication8.obj: error LNK2001: Unable to parse external symbol __imp____ glewvertexattribute
; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____ glewbindVertexArray
1>; ConsoleApplication8.obj: error LNK2001: Unable to resolve external symbol __imp____ glewGenvertexArrays
Solution:

#pragma comment(lib,"glew32.lib")

Error:

1> ConsoleApplication8.obj: error LNK2019: Cannot resolve external symbol _glutInit@8, which is referenced in function _main

1> ConsoleApplication8.obj: error LNK2019: Cannot resolve external symbol _glutInitDisplayMode@4, which is referenced in function _main

1> ConsoleApplication8.obj: error LNK2019: Cannot resolve external symbol _glutInitWindowPosition@8, which is referenced in function _main

1> ConsoleApplication8.obj: error LNK2019: Cannot resolve external symbol _glutInitWindowSize@8, which is referenced in function _main

1> ConsoleApplication8.obj: error LNK2019: Cannot resolve external symbol _glutMainLoop@0, which is referenced in function _main

1> ConsoleApplication8.obj: error LNK2019: Cannot resolve external symbol _glutCreateWindow@4, which is referenced in function _main

1> ConsoleApplication8.obj: error LNK2019: Cannot resolve external symbol _glutSwapBuffers@0, which is displayed in the function “void __cdecl display(void)” (?Display @@yaxxz)

1> ConsoleApplication8.obj: error LNK2019: Cannot resolve external symbol _glutDisplayFunc@4, which is referenced in function _main

1> ConsoleApplication8.obj: error LNK2019: Cannot resolve external symbol _glutKeyboardFunc@4, which is referenced in function _main

Solution:

#pragma comment(lib,"glut32.lib")

error:

1> ConsoleApplication8.obj: error LNK2019: Cannot resolve external symbol __imp__glClear@4, which is displayed in the function “void __cdecl display(void)” (?Display @@yaxxz) is referenced in
1> init @@yaxxz)
1>; ConsoleApplication8.obj: error LNK2019: Cannot resolve external symbol __imp__glDrawArrays@12, which is displayed in the function “void __cdecl display(void)” (?Display @@yaxxz) is referenced in
1>; ConsoleApplication8.obj: error LNK2019: Unable to resolve external symbol __imp__glGetString@4, which is used in the function “void __cdecl initShader(char const *,char const *)” (?InitShader@@YAXPBD0@Z) is referenced
Solution:

#pragma comment(lib,"OpenGL32.lib")

VC + + COM programming error of 0xc0000005: access conflict when reading location 0xfeefef6

Calling COM+ gives you the desired result and returns an error after the last return 0 sentence.

error location in comip.h

void _Release() throw()

{

if (m_pInterface! = NULL) {

m_pInterface – & gt; Release(); // Error reported here

}

}
When I encounter this problem myself, I use m_pInterface->; Release(); Comment out the program no longer reports an error.
Some other ways online:
1.m_pInterface-> Release () into m_pInterface = NULL from http://topic.csdn.net/u/20091120/16/8a9c8d91-9a39-416b-8d8d-8c2cd2a71d3e.html
2. In the program implementation: PTR ->; Release(); To PTR. Release (); From http://topic.csdn.net/u/20091120/16/8a9c8d91-9a39-416b-8d8d-8c2cd2a71d3e.html
3. One statement is that it is a matter of scope. I don’t know much about it. See: http://stackoverflow.com/questions/2653797/why-does-couninitialize-cause-an-error-on-exit
This method has been tried, but it also works. See the following instructions for details.

I’m working on a C++ application to read some data from an Excel file. I’ve got it working, but I’m confused about one part. Here’s the code (simplified to read only the first cell).

//Mostly copied from http://www.codeproject.com/KB/wtl/WTLExcel.aspx 
 
#import "c:\Program Files\Common Files\Microsoft Shared\OFFICE11\MSO.DLL" 
#import "c:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\VBE6EXT.OLB" 
#import "C:\Program Files\Microsoft Office\Office11\excel.exe" rename ("DialogBox","ExcelDialogBox") rename("RGB","ExcelRGB") rename("CopyFile", "ExcelCopyFile") rename("ReplaceText", "ExcelReplaceText") exclude("IFont", "IPicture") 
 
_variant_t varOption((long) DISP_E_PARAMNOTFOUND, VT_ERROR); 
 
int _tmain(int argc, _TCHAR* argv[]) 
{ 
    DWORD dwCoInit = 0; 
    CoInitializeEx(NULL, dwCoInit); 
    Excel::_ApplicationPtr pExcel;     
    pExcel.CreateInstance(_T("Excel.Application")); 
    Excel::_WorkbookPtr pBook; 
    pBook = pExcel->Workbooks->Open("c:\\test.xls", varOption, varOption, varOption, varOption, varOption, varOption, varOption, varOption, varOption, varOption, varOption, varOption); 
    Excel::_WorksheetPtr pSheet = pBook->Sheets->Item[1]; 
    Excel::RangePtr pRange = pSheet->GetRange(_bstr_t(_T("A1"))); 
    _variant_t vItem = pRange->Value2; 
    printf(_bstr_t(vItem.bstrVal));     
    pBook->Close(VARIANT_FALSE); 
    pExcel->Quit(); 
    //CoUninitialize(); 
    return 0; 
} 

I had to comment out the call to CoUninitialize for the program to work. When CoUninitialize is uncommented, I get an access violation in the _Release function in comip.h on program exit.
Here’s the code from comip. h, for what it’s worth.

void _Release() throw() 
{ 
    if (m_pInterface != NULL) { 
        m_pInterface->Release(); 
    } 
} 

I’m not very experienced with COM programming, so there’s probably something obvious I’m missing.

    Why does the call to CoUninitialize cause an exception? What are the consequences of not calling CoUninitialize? Am I doing something completely wrong here?

ANSWER!

The problem you are having is one of scope. The short answer is to move the CoInit and CoUninit into an outer scope from the Ptrs. For example:

//Mostly copied from http://www.codeproject.com/KB/wtl/WTLExcel.aspx 
 
#import "c:\Program Files\Common Files\Microsoft Shared\OFFICE11\MSO.DLL" 
#import "c:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\VBE6EXT.OLB" 
#import "C:\Program Files\Microsoft Office\Office11\excel.exe" rename ("DialogBox","ExcelDialogBox") rename("RGB","ExcelRGB") rename("CopyFile", "ExcelCopyFile") rename("ReplaceText", "ExcelReplaceText") exclude("IFont", "IPicture") 
 
_variant_t varOption((long) DISP_E_PARAMNOTFOUND, VT_ERROR); 
 
int _tmain(int argc, _TCHAR* argv[]) 
{ 
    DWORD dwCoInit = 0; 
    CoInitializeEx(NULL, dwCoInit); 
    { 
        Excel::_ApplicationPtr pExcel;     
        pExcel.CreateInstance(_T("Excel.Application")); 
        Excel::_WorkbookPtr pBook; 
        pBook = pExcel->Workbooks->Open("c:\\test.xls", varOption, varOption, varOption, varOption, varOption, varOption, varOption, varOption, varOption, varOption, varOption, varOption); 
        Excel::_WorksheetPtr pSheet = pBook->Sheets->Item[1]; 
        Excel::RangePtr pRange = pSheet->GetRange(_bstr_t(_T("A1"))); 
        _variant_t vItem = pRange->Value2; 
        printf(_bstr_t(vItem.bstrVal));     
        pBook->Close(VARIANT_FALSE); 
        pExcel->Quit(); 
    } 
    CoUninitialize(); 
    return 0; 
} 

The longer answer is that the Ptrs destructors (which calls Release) are being called on exit from main. This is after CoUnit which, basically, shuts down the communication channel between your app and the COM object.
What are the consequences of not calling CoUnit?For short lived in-process COM servers, there really isn’t any negative consequence.