Tag Archives: ProgrammerAH

Vs compile VTK, only generate install error, stop, ask God how to solve?

VS2015 compiled VTK8.1, the previous was also successful, to the last step, only generate the install step error, error MSB3073 command “setlocal…
What is the meaning of this error and how to solve it?Thank you very much!
 
Attach an error message:
The severity code indicates that the project file line is prohibited from displaying status
Error MSB3073 command “setLocal
D:\cmake\ cmak.exe-dbuild_type = debug-p cmake_install. Cmake
%errorlevel% neq 0 goto :cmEnd
:>nd
endLoca>amp; call :cmErrorLevel %errorlevel% & Goto :cmDone
exit /b %1
cmdone
i>errorlevel % neq 0 goto :VCEnd
: vcend> INSTALL the C: \ Program Files \ MSBuild \ Microsoft (x86) Cpp \ v4.0 \ V140 \ Microsoft CppCommon. The targets 133

error lines of code:
& lt; Exec Command=”%(PostBuildEvent.Command)$(_BuildSuffix)” Condition=”‘%(PostBuildEvent.Command)’ ! = ””/>
 
———————————————–
The problem has been solved, the unified answer. I also stumbled upon the solution by accident.
Solution:
The versions of these software do not match, use:
VS2015 + VTK6.3.0 + cmake – 3.11.0 – win32 – x86
Just use these versions and follow the tutorial, and on my computer, VTK builds without any problems.
I computer Inspiron 7577, Windows7 system

QT interface refresh crash, exception

Qt program in the Haysi HI3531A development board, update() repeatedly after the refresh interface program abnormal crash

Hi3531a qt program after the operation, many times after the update program hang up at http://www.ebaina.com/bbs/forum.php?mod=viewthread& tid=23327& fromuid=19660

(Source: Ebna Forum)

[debug notes] pointer error when STD:: vector is used in VTK “access conflict when reading location XXX”

1. Build a vector tempActor;
2. Create Actor with VTKSmartPointer
3. Put the actor into tempActor using push_back;
4. Returns tempActor, as shown below.

std::vector<vtkActor*> tempActor;
vtkSmartPointer<vtkActor> actor = vtkSmartPointer<vtkActor>::New();
tempActor.push_back(actor);
return tempActor;

After the compilation was successful, the execution error occurred, and an access conflict occurred when reading location XXX. The reason should be a pointer problem.
Solution: Instead of using vtksmartPointer, replace it with

vtkActor* actor = vtkActor::New();

VTK beginner 1, configuration of pro file

1. Pro file configuration

TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
CONFIG += qt
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
SOURCES += main.cpp

include(deployment.pri)
qtcAddDeployment()

win32:CONFIG(release, debug|release){
INCLUDEPATH += D:/Qt/VTK6.3.0/MinGW/release/include/vtk-6.3
DEPENDPATH += D:/Qt//VTK6.3.0/MinGW/release/include/vtk-6.3
LIBS += -LD:/Qt/VTK6.3.0/MinGW/release/lib\
libvtkInteractionImage-6.3 \
libvtkRenderingCore-6.3 \
libvtkRenderingOpenGL-6.3 \
libvtkInteractionStyle-6.3 \
libvtkalglib-6.3\
libvtkCommonCore-6.3 \
libvtkCommonDataModel-6.3\
libvtkCommonExecutionModel-6.3\
libvtkCommonSystem-6.3\
libvtkIOCore-6.3\
libvtkIOImage-6.3 \
libvtkIOLegacy-6.3\
libvtkViewsQt-6.3\
libvtkFiltersSources-6.3\
libvtkGUISupportQt-6.3\
libvtkGUISupportQtOpenGL-6.3\
libvtkRenderingQt-6.3\
libvtkFiltersCore-6.3\
libvtkCommonMisc-6.3\
libvtkfreetype-6.3\
libvtkRenderingFreeType-6.3\
libvtkFiltersModeling-6.3\
libvtkInteractionWidgets-6.3\
libvtkRenderingAnnotation-6.3\
libvtkRenderingLOD-6.3\
libvtkIOXML-6.3\
libvtkFiltersGeometry-6.3
}


else:win32:CONFIG(debug, debug|release){
INCLUDEPATH += D:/Qt/VTK6.3.0/MinGW/Debug/include/vtk-6.3
DEPENDPATH += D:/Qt//VTK6.3.0/MinGW/Debug/include/vtk-6.3
LIBS += -LD:/Qt/VTK6.3.0/MinGW/debug/lib\
libvtkInteractionImage-6.3d \
libvtkRenderingCore-6.3d \
libvtkRenderingOpenGL-6.3d \
libvtkInteractionStyle-6.3d \
libvtkalglib-6.3d\
libvtkCommonCore-6.3d \
libvtkCommonDataModel-6.3d\
libvtkCommonExecutionModel-6.3d\
libvtkCommonSystem-6.3d\
libvtkIOCore-6.3d\
libvtkIOImage-6.3d \
libvtkIOLegacy-6.3d\
libvtkViewsQt-6.3d\
libvtkFiltersSources-6.3d\
libvtkGUISupportQt-6.3d\
libvtkFiltersCore-6.3d\
libvtkCommonMisc-6.3d\
libvtkfreetype-6.3d\
libvtkRenderingFreeType-6.3d\
libvtkFiltersModeling-6.3d\
libvtkInteractionWidgets-6.3d\
libvtkRenderingAnnotation-6.3d\
libvtkRenderingLOD-6.3d\
libvtkIOXML-6.3d\
libvtkFiltersGeometry-6.3d
}


HEADERS += \
    animateactors.h

 

Reproduced in: https://www.cnblogs.com/phoenixdsg/p/6117375.html

Problems encountered in PCL configuration environment

Error C1083 cannot open include file: “Eigen/StdVector” : No such file or directory
The library directory
should be D:\Program Files\PCL 1.9.1\3rdParty\Eigen\eigen3\Eigen
\ Program Files\PCL 1.9.1\3rdParty\Eigen\eigen3\Eigen
:\Program Files\PCL 1.9.1\3rdParty\Eigen\ Eigen
Error C1083 cannot open include file: “vtksmartPointer. H” : No such file or directory
D:\Program Files\PCL 1.9.1\ 3RDParty \VTK\include\vtk-8.1
and check whether the environment variable type PCL_ROOT exists and is C:\Program Files\PCL 1.6.0
Can’t find openni2. DLL
After configuring the property sheet, you also need to configure the DLL. There are four ways to configure a DLL. The first way is to copy the DLL to System32, the second way is to copy the DLL to the compiled program file, and the third way is to add the path of the DLL to the system. This article chooses the fourth way, which is directly configured to the project. The specific methods are as follows:
In Solution Explorer, right-click on Properties and select Debug to set the value of the environment variable. The rules are as follows:
PATH=; $(PATH)
Add all PCL and third party library DLL paths after the equal sign with the English “;” Add a $(PATH) at the end. For example,
PATH = KaTeX parse error: Expected ‘EOF’ got ‘\ bin at the position 11: (PCL_ROOT) b \ ̲ ̲ ̲ ̲ I n; (PCL_ROOT)\3rdParty\FLANN\bin; KaTeX parse error: Expected ‘EOF’ got ‘\ 3 at the position 11: (PCL_ROOT) \ ̲ ̲ 3 rdParty \ VTK \ bin… (PCL_ROOT)\Qhull\bin; KaTeX parse error: Expected ‘EOF’ got ‘\ 3 at the position 11: (PCL_ROOT) \ ̲ ̲ 3 rdParty \ OpenNI2… (PATH)

Programmers encounter real wonderful interview experience! Did you win? |Programmers have something to say


Click on the picture, enter the coupon code “CODEBOOK” to place an order, and you can immediately discount 40 yuan
 

The author | heavens Jing

This article is reprinted with authorization from Grass Eaters (ID: kidd_wyl).

Since 2011, I have been doing technical training and consulting work for some enterprises in my spare time, including some training institutions.
As for knowledge output, there is a big difference between enterprise and training institutions.
Say, first in my contact with most of the scene, some companies spend money for You to come over, look from the surface because of technology to promote encountered resistance, but are in fact and the inappropriate, “organization shape/structure is not reasonable, and my role as the core, is based on previous experience to put the facts of the reasonable, and conform to the objective environment adjustment scheme is given, or to replace the boss directly say that” You are fired!”
And training institutions, the vast majority are lured by interests, regardless of all massive investment in advertising, to fool students not hesitate to make a variety of commitments. The vast majority of the institutions I have contacted recruit students under the banner of “looking for a job.”
As a result, as instructors, in addition to teaching them skills, are more or less forced to add interview techniques and DOS and don ‘ts to the curriculum.
For example, I often remind them that even though the decision on employment is made by the technical leadership, the professionalism of HR is also a prerequisite for the leadership’s decision on employment. In many companies, HR even has the right to veto. Not only are their personalities less straightforward than those of straight techies, but many of their behaviors are considered weird by straight techies.
In one of my courses, I’ve mentioned three weird examples from the tech world.
 

A culture of bureaucracy and corruption

 

Ten years ago, a programmer went to a foreign company for an interview. After filling in the basic information, HR first brought four or five pages of psychological test questions to answer. There were multiple choice questions, fill-in-the-blank questions, and drawing questions.
The candidate asks, I am here to apply for the technical position, what is the purpose of doing these questions?According to these answers, we will grade the candidates and then decide whether the candidates’ psychological endurance meets the requirements of the company.
All right, patiently finish these questions, HR looked at it and nodded: “It seems that your mental endurance is quite good, let me briefly introduce some administrative regulations of our company.”
Rule 1: if the general manager comes to work, all employees should stand up to speak to show respect. If the leader’s QQ question, you must immediately reply, otherwise deduct money.
Rule two: before work, must ask the company leadership, whether there are other arrangements, nothing can go away.
Rule three: if the general manager is not off duty, everyone has no right to leave, otherwise immediately fired.
At that time, is in the financial crisis period, the job is not easy to find, this young man patient work for a month, really can not bear such a love of leadership and very strange management style, can only take the initiative to resign.
On the day of his resignation, his immediate leader called him to the office and said that the reason for leaving should be “personal reasons” instead of anything else. He was quite funny and wrote a sentence: “I can’t adapt to the bizarre company regulations, so I have to find a better job”.
 

It’s not an interview, it’s an empty hand.
 

An architect went to interview with a startup team, and the conversation began to go well with each other. Both sides said they had a high degree of commitment.
Finally, the interviewer took out a piece of A4 paper and said, “In order to test your ability to control the overall project and also to give you a chance to show your depth of internal expertise, please come up with a solution based on your previous experience according to the requirements on the paper within one week, and if you have a basic problem, you can be hired.”
After listening to this sentence, the first reaction in my mind is “empty handed white Wolf”, how to understand?
First, at the company’s current size, there was no need for such a complex solution, and second, the solution closely resembled one of the future plans the interviewer described. Therefore, it is likely that because the team cost is limited, we can not hire a special person to do it, and others are not professional, so we have to ask the person to come to the interview to write the plan under the banner of recruitment, and then tell the plan is not feasible and can not be hired.
In fact, the plan had already been stolen and modified to become the team’s own work.
In addition, I have also heard of many companies using headhunters to spy on their competitors in the name of recruitment.

 

You’re dressed too formally. It doesn’t suit us

 

It was an experience that happened to me and I remember it very well because it was so weird.
2005, at that time I do JAVA development in the east shopping, because some time happened with the leadership a few unpleasant, in a rage cast a few resumes, the plan to walk it, Lao Tze do not wait on.
A few days after sending out my resume, I got called for an interview with a software company in India, so I dressed up and went.
The interviewer first asked me to draw the execution process of some existing businesses and explain it in combination with the technical implementation. I was then asked about the use of Oracle databases to address performance concurrency in the project, and was asked to name one of my favorite optimizations, followed by questions about transactions, indexing, and high availability.
Finally, the interviewer asked questions about concurrent flow limiting, the JVM model, the JMM model, the garbage collection mechanism, the garbage collector, etc. It also includes some design patterns used, which design patterns are used in the project and so on.
Objectively speaking, my basic knowledge is quite solid, and I have a thorough study of Oracle database. Except for some business details, I can answer all the basic questions smoothly.
As the morning passed, it was clear that the technical interviewer was quite satisfied with me.
I was also very happy, the thought of being able to leave those idiots immediately, in the heart of the happy, so I went to Hong Kong Square for lunch to eat a good meal.
In the afternoon, I returned to the interview site and continued to chat with HR. HR began to ask some questions about “reasons for leaving, company situation, team size, whether I had led a team” and so on. Finally, after negotiating salary, benefits and reporting hours, I was sent home.
Said to give me feedback within a week, I did not ask much, directly went home.
After a week of waiting, no response, and then a week of waiting, no response, I was a little bit hairy. To be honest, I liked both the environment of the company and the technical environment described by the interviewer. Besides, I think the Offer is in the bag.
So the technologically straight nature starts to take over, picking up the phone and asking.
After several twists and turns, I finally got in touch with the HR person who interviewed me that day. I got straight to the point: “Two weeks have passed, why haven’t I received the Offer from your company?Is there any problem?”
“I’m sorry, Mr. Wang, but you were not accepted by our company.”
I don’t understand, busy ask: “ah?It can’t be. Why?”
“Although your abilities and experience are highly regarded by us, your formal dress on the day of the interview was spotted by our boss in India, who felt that you were too formal for a technical person and did not suit our philosophy of seeking technological innovation, so… I’m sorry.”
Nima, what kind of excuse is that?I’ve heard of techies being rejected for being sloppy or casual, and it’s the first time I’ve heard of “being turned down for being too formal”.
Well, there is no excuse for beating a stick in the mouth. I have heard that Indian Asan has bad brains and this time it seems to be proved. To tell the truth, although the IT industry talent demand is large, the employment scope is relatively wide, but in the technical interview, in addition to the technical ability, there are still many problems, if not careful, IT is easy to inexplicable trample.

Finally, let me say a few things that technical people should not do in an interview:
Pay attention to dress appropriately, clean (remember to wash hair), generally OK, don’t wear a suit and tie very formal. No matter in the morning or afternoon, remember to eat breakfast before you go, so as not to starve the brain hypoxia, slow reaction. If you encounter malicious difficulties or “an empty hand for a white Wolf”, don’t fight each other, don’t resist, just stand up and leave when you face the stupid force with a pure smile. Whether it’s technology or the Internet, trust and mutual reliance are the key, and the main theme is sharing and win-win. To hell with the bureaucracy. Don’t care too much about the size of the business, also don’t care too much about the development of the industry, “do the right company, as the right boss” is more important than anything.

Well, I hope you will keep the above stories in mind in future interviews, stay away from strange things and cherish your career prospects.

Life is short. It’s Python or Java. Which one do you choose?
https://edu.csdn.net/topic/python115?utm_source=cxrs_bw

Commend on heat

12 days after the programmer was dismissed by the company, the former leader asked to go back to the company to explain the code clearly, but he was confused

In general, if an employee has left the company, it means he or she is no longer affiliated with the company. Before the employee leaves, the thing to do is to complete the handover of work, after the resignation of the company’s anything, basically has nothing to do with the employee.
Recently I saw such a post on the workplace forum: the programmer was fired by the company for 12 days, the former leader asked the company to explain the code clearly, the employee replied: yes, but charge! What’s going on here?

It turned out that the programmer had been working in the previous company for more than 4 years. Later, the company fired many employees for various reasons, including the programmer. Twelve days after the programmer left, he suddenly received a call from his former boss, who asked the employee to come back to the company and explain the code clearly. And the former leader is not very polite, but in a way of command. The programmer was stunned when he received this call. It is unreasonable to ask for such a long time since he left his job.

The employee later directly refused the leader’s request, and also said such a sentence: I will be clear back to the company code is no problem, but to charge, the leader was angry, also said that the code is not clear, is his problem, otherwise will be investigated for responsibility!
So, what did the netizens say?

Some netizen said that the company dismissed me when early why to go, now the problem can not be solved, but also the bashful request back. More critical is the leadership of EQ is really very low, you are his leadership in the past is right, but now are not in a company, still use this tone to speak, not everyone can be used to you. If it’s me, hang up.
Some netizen said: you can promise to go back to the code, about the time after not to go, and so on the leadership to call you, you say now very busy, anyway is to drag, the leadership also take you have no way.

 
Of course, there are netizens said: if the salary is almost the same, choose Baidu is actually a good. I am now a Java programmer, now quit doing their own online tutoring services to private study guide, if you now also are learning Java, in the introduction of the process of learning Java meet any industry, technical issues, or where you are now in the introduction to the process of learning Java lacks a complete tutorial system and a communication network, you can join my Java learning communication group: https://jq.qq.com/?_wv=1027& K = 5RXJVIC, which contains the latest video tutorials I recorded from last year to now according to the market technology stack requirements. In the group files, there are learning manuals, interview questions, development tools and PDF document tutorials that I organized by myself. If necessary, you can download them by yourself.
If you were the employee, what would you do?Comments are welcome.

The problem that the normal of the model is no longer perpendicular to the surface after unequal scaling

If the model matrix performs unequal scaling, the vertex changes will cause the normal vector to no longer be perpendicular to the surface. Therefore, we cannot transform the normal vector with this model matrix. The following figure shows the effect of the model matrix with unequal scaling applied on the normal vector:

Whenever we apply an unequal scaling (note: equal scaling does not break the normals because the direction of the normals is not changed, just the length of the normals, which is easily fixed by normalization), the normal vector is no longer perpendicular to the corresponding surface, and the light is broken.
 
The trick to fixing this behavior is to use a model matrix that is customized for the normal vector. This Matrix is called the Normal Matrix, and it uses some manipulation of linear algebra to remove the effect of the incorrect scaling of the Normal vector.
The normal matrix is defined as “the transpose of the inverse matrix in the upper left corner of the model matrix”.
 
The specific derivation process is as follows:
VertexEyespace = ModelViewMatrix * vertex;
modelEyeSpace = modelViewMatrix * vec4(normal, 0);
 
We know that the line segment T is equal to P2-P1; P2 and P1 are the positions of two vertices.
T’ = T * modelViewMatrix = (p2 – p1) * modelview;
= p2 * modelview – p1 * modelview;
So this is the same thing as p’ 2 – p’1
Assumptions:
N = Q2-Q1;
Because the dot product of the line segment and the normal has to be equal to 0
dot(T,N) = 0;
So the dot product of the converted line segment with the normal line has to be equal to 0 for that to happen
dot(T’,N’) = 0;
 
Let’s say the top left submatrix of the view is M
And then let’s assume that G is the correct matrix to transform the normal vector
To:
dot(G*N, M*T) = 0;
According to the dot product formula dot (t, n) = | t | | | * n * cosine alpha.
To:
Dot (T’, N’) = dot(G*N, M*T) = inverse(GN) * MT;
 
We know that the product of the matrix Gn and the inverse of Gn is the element matrix.
inverse(GN)*GN = I
And transpose(GN)*GN = I of the orthogonal matrix
When I multiply both sides by my transformation matrix
transpose(GN)*inverse(GN) * GN = inverse(GN)
Have to
transpose(GN) = inverse(GN)
 
so
dot(T’, N’) = transpose(GN) * MT;
After disassembly:
dot(T’, N’) = transpose(G) * transpose(N) * M*T;
 
Assume that transpose(G) * M = I
dot(N’, T’) = dot(N, T) = 0;
So that gives us what we want
G = transpose(inverse(M))
 
That’s the whole derivation of the inverse transpose of the upper left corner of the model matrix.
 
Also: the normal vector is only a directional vector and cannot represent a specific position in space. Also, the normal vector has no homogeneous coordinates (the w component in the vertex positions). That means that the displacement should not affect the normal vector. Therefore, if we were to multiply the normal vector by a model matrix, we would remove the displacement part from the matrix and only select the 3 by 3 matrix in the upper left corner of the model matrix (note that we could also set the w component of the normal vector to 0 and multiply it by a 4 by 4 matrix; This also removes the displacement). For the normal vector, we just want to scale and rotate it.
 
The final approach is:
Normal = mat3(transpose(inverse(model))) * aNormal;

VC + + OpenGL is used as the development platform to design the program, which can generate any pixel on the screen, and use the pixel to draw the basic graphics

#include < GL/glut.h>
#include< Windows.h>
void init (void)
{
glClearColor (1.0, 1.0, 1.0, 0.0);
glMatrixMode (GL_PROJECTION); //
gluOrtho2D (-5.0, 5.0, 5.0, 5.0); X:-5.0~5.0, Y:-5.0~5.0
{
begin (GL_POLYGON);
glBegin (GL_POLYGON);
glVertex2f (0.0f,-2.5f); //
glVertex2f (0.0f,-2.5f);
glVertex2f (1.0f,0.0f);
glVertex2f (1.0f,0.0f); //
glVertex2f (0.0f, 2.5f);
glVertex2f (-1.0f,0.0f);
glVertex2f (-1.0f,0.0f);
glEnd ();
}
Void myDisplay(void)
{
Clear (GL_COLOR_BUFFER_BIT);// to empty
GlLoadIdentity (); // Set the current matrix to the identity matrix
glRotatef(45,0.0,0.0,1.0);
glTranslatRef (0.0,2.5,0.0);
glColor3f (0.0, 1.0, 0.0);
drawDiamond ();
GlLoadIdentity (); // Set the current matrix to the identity matrix
glRotatef(135,0.0,0.0,1.0);
glTranslatRef (0.0,2.5,0.0);
glColor3f (0.0, 1.0, 0.0);
drawDiamond ();
GlLoadIdentity (); // Set the current matrix to the identity matrix
glRotatef(-45,0.0,0.0,1.0);
glTranslatRef (0.0,2.5,0.0);
glColor3f (0.0, 1.0, 0.0);
drawDiamond ();
GlLoadIdentity (); // Set the current matrix to the identity matrix
glRotatef(-135,0.0,0.0,1.0);
glTranslatRef (0.0,2.5,0.0);
glColor3f (0.0, 1.0, 0.0);
drawDiamond ();

glLoadIdentity (); // Set the current matrix to the identity matrix
glColor3f(1.0,0.0,0.0);
glTranslatef (0.0, 2.5, 0.0);
drawDiamond ();
GlLoadIdentity (); // Set the current matrix to the identity matrix
glColor3f(1.0,0.0,0.0);
glRotatef (90, 0.0, 1.0);
glTranslatef (0.0, 2.5, 0.0);
drawDiamond ();
GlLoadIdentity (); // Set the current matrix to the identity matrix
glColor3f(1.0,0.0,0.0);
glRotatef (- 90, 0.0, 1.0);
glTranslatef (0.0, 2.5, 0.0);
drawDiamond ();
GlLoadIdentity (); // Set the current matrix to the identity matrix
glColor3f(1.0,0.0,0.0);
glTranslatef (0.0, 2.5, 0.0);
drawDiamond ();
glFlush ();
}
Int main (int argc, char *argv[])
{
utinit (& argc, argv);
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
glutInitWindowPosition (0, 0);
glutInitWindowSize (600, 600);
glutCreateWindow (” Hello Opengl!” );
init ();
glutDisplayFunc (& amp; myDisplay);
glutMainLoop ();
return 0;

}

Problems and solutions in learning opengl

1. After opening the back and cutting, the visible face will not be displayed?

When initializing the vertex coordinates, the three coordinates of the triangle are defined in clockwise order and must be counterclockwise; Where x heads to the right, y heads up, and z heads forward.

Matters needing attention in the process of using Aidl

1. Avoid the client UI thread to access the remote server method, because if the remote server method is a time-consuming operation, it can be operated many times, and the UI thread will report an error.
2. For the robustness of the program, it is necessary to reconnect the client to prevent the server from accidentally hanging down. There are two ways to do it
The first method: Set the DeathRecipient listener to Binder, and when Binder dies, receive the BinderDied method callback and reconnect the server in the method.
The second method: Reconnect the remote service in OnServiceDisconnected.
3. To improve the security of the server.
First: Use Permission in the AndroidMenifest file in the following way
& lt; uses-permission android:name=”xxxxxxxxxx”/>
Second approach: Permission validation is performed in the onTransact method on the server side