Tag Archives: test

VS2010 debugging window flash solution

These days the development integration environment has been changed to VS2010, just started to use, some places are not very understand, by consulting the relevant documents, is now solved.
Take the VS2010 debugging window flash through the solution is as follows:
#include < iostream>
using namespace std;
void main()
int add(int,int,int);
float business (int);
int x, y, z, sum;
cout< < “Input x, y, z:”;
cin> > x> > y> > z;
the sum = add (x, y, z);
cout< <” sum=”< < sum< < endl;
cout< <” average=”< < average(sum)< < endl;
// system (” pause “);
}
}
Int add (int a, int b, int c)
{return (a+b+c); }
float business (int s)
{return (s/3.0); }
This is the test code.
The solution is as follows:
If you are compiling (F5), you can run the program (Ctrl+F5). If it is still flashing, use the following method to solve it.
method one:
1. If the c + + files, in the final to write a program before (return) add: system (” pause “);
= #include”stdlib.h”;
= #include”stdlib.h”; Then add: system(“pause”) at the end of the program (before the return).
Method 2:
. Right click on the current project – Properties
2> 3. Change the SUBSYSTEM configuration in System Options, select the first ‘/ CONSOLE’ in the drop-down menu and then select ‘Start Executing (Don’t Debug)’, that is Ctrl +F5;
This solves the flash window problem once and for all.
 

Common problems of shadow map in OpenGL

Shadow maps are a common technique in games,
The principle is to view the entire scene from the light space with the light viewing matrix (binding the depth cache with the frame cache), and the resulting scene is not rendered
The second drawing, the depth buffer into the shader, all point transformation to the light space, the z coordinates, and the depth of the original cache value contrast, if the resulting value is less than the value of the depth buffer is proved that the pixels in the most close to the rear of the light source location, so this point can’t render, reason for shadow covered place.
This is what I get, the light source is rotated around (0,0,0) with a radius of 50. In the middle is a physical model. The entire lighting system is the simplest (an improved version of Feng’s lighting).

Problem 1. Boundary problem: there is a plane in front of the light source, the space outside the plane is the area affected by light, and the area inside the plane is the area not affected by light.

The problem is very simple. In the light space analysis, the light space, like the view space, has a cone:

The areas outside the cone that are not located on the upper ledge are all clipped out of the light space.
To make the cone black outside the edge, since the second time the shader calls the depth cache, it will also call some areas in the depth cache, which will result in the wrong result on the boundary.
To solve this problem, when setting the depth cache, you need to set all colors outside the bounds to black :


And that will give you the right answer.
Problem 2. Texture error
Textures are rendered in striped red, blue and green colors.
This is because the texture is not formatted correctly, the image is formatted in RGBA format, but the texture is formatted in RGB format, which will result in the wrong result:

As shown in the figure above, setting the image format to GL_RGBA will solve this problem when reading the image from the library

Problem 3. Follow the tutorial, but there are no shadows, the whole scene is bright
If there is no compiler error in the shader, please check whether the two matrix Settings are consistent (that is, whether the matrix of optical space is directly passed into the second shader).
In the second shading, set the observation matrix to the light space matrix to see if the whole scene can be seen in the light space observation matrix.
If the whole scene is not visible in light space, the entire depth cache is infinite (i.e. 1.0F), and all the points are in front of the occlusion, so you will see the whole scene lit up.
Question 4. According to the tutorial to write, there is no shadow, the whole scene is dark
The problem may be that your light source is so close to the model that the whole scene is completely blocked by the model from the light space. Another possibility is that the first rendering of the depth cache was not written,
This also results in the equivalent of a large flat surface in front of you.
Question 5. Where there is shadow, there is light, and where there is light, there is shadow
The reason for this problem is that there is a logic error in the shader of the second rendering, and the shadow is 1, which means there is a shadow (for example in Learnopengl tutorial). Therefore, it is necessary to use (1-shadow) in the final calculation of Feng’s illumination.
Multiplied by stolid and ambient, not shadow
Problem six. A layer of gray, according to the tutorial to eliminate but not the effect
The gray is caused by the principle defect of Shadowmap. It is possible that multiple adjacent pixels of the rendered graph correspond to the depth value in the same depth cache, resulting in the wrong corresponding of the depth value, so there will be streaks.
If the tutorial minus the value of a fixed doesn’t work, minus the value can be more a little bit small. This means that you draw volume is very big, I draw when I was led to this situation, this is because the tutorial is a very small unit to draw, so it’s bigger than the offset, but I draw the unit is very big, (100.0 f) so I need to reduce the value of the more, you can test several times, each time reduce an order of magnitude, by the way, I use a value of 0.00001, this is a very small value, the results after the application of the this value is true.

There are some other problems, such as the resolution is not enough to lead to the edge is not clear and so on, this kind of problem can find some anti-aliasing method to solve, is to take the average edge.
If you have a problem can leave a message at the bottom, you can also find me to source.
(to be continued….)

The corresponding solutions to the problems of various external symbols that cannot be resolved

When using a VS2008 debugger, it is common to have problems with external symbols that cannot be resolved. There are many possible reasons. Here are some of the things I have learned over the past year.
For reference only.
 
Consider possible reasons:
[0] can’t parse may be because the.lib file is not correct, such as a 64 – bit compiler configuration, the results using the 32-bit lib package.
[1] is only to write a class declaration, but I haven’t write the implementation class, causing a call cannot resolve
[2] declaration and definition is not regulated, cause inconsistent links, cannot resolve
[3] is not in the project properties page of the linker command line options to join the corresponding class package.
[4] in the c + + contains, to join the corresponding class package repository directory path
[5] file directory to be tested in test engineering of measured classes may need to include the CPP definition file
[6] ICE interface test, cannot resolve may be because the file is not being measured include relevant CPP file, in addition, in TestSuite_ProjectRun. H file needs to contain IProjectRun. H header file, and the relevant header files (for example).
[7]import related contents cannot be resolved, the solution is to add the corresponding dynamic library in the linker dependencies
[8] The following error is usually caused by the fact that the dynamic library does not have a package. __imp
ProjectRun. Obj: error LNK2019: cannot resolve __imp__StartHistoryLocalModule external symbols, the symbol in the function “protected: virtual int __thiscall HiRTDB: : CProjectRun: : DoStart (void)” (?DoStart@CProjectRun @hirtdb @@maehxz)
[9] ERROR LNK2001: __imp___CrtDbgReportW
project properties, C/C++, code generation, runtime library select MDD,
[9] cannot resolve the external symbol “__declspec (dllimport) public: int __thiscall HiRTDB: : CTagTree: : GetObjectA (int, struct HiRTDB: : SBaseReadProps const & amp; ,struct HiRTDB::SBaseReadValues &) ” (__imp_?Public: int __thiscall hirtDB :: cStringImpl ::Get(int,struct hirtDB :: sStringReadprops const & ,struct HiRTDB::SStringReadValues &) “(?Get @cStringImpl @hirtdb @@qaehhabusStringReadProps @2 @aausStringReadValues @2@@Z
The reason may be that there are extra options in the project configuration file, please refer to the configuration options of other modules, do not have extra configuration.

Http Error 12057 (Bug Fix Note)

A Bug has been reported in the product that only occurs for a specific platform, Windows Server 2003 Standard Edition.
Check the Trace Log and find that the wrapper class of Wininet call returns Error 12057, with the specific Error contents as follows:

ERROR_WINHTTP_SECURE_CERT_REV_FAILED

12057

Indicates that revocation cannot be checked because the revocation server was offline (equivalent to CRYPT_E_REVOCATION_OFFLINE).
Open the
IE-> Tools-> Internet Options-> Advanced Tab-> Security Options – & gt;” Check for server certificate revocation(Requires Restart) “

This option is currently selected. Remove this option and the Bug symptoms disappear. Only IE with Windows Server 2003 Standard Edition is checked by default, and Error 12057 (Microsoft’s Bug?) does not occur when this option is checked on other platforms. or with other options?) . Decided to code the problem.
The code to solve this problem is quite simple. Add the following code after HttpOpenRequest to set the current Http connection options to cancel this check
DWORD dwFlags = 0;

DWORD dwError = 0;

DWORD dwBuffLen = sizeof(dwFlags);
InternetQueryOption(m_hRequest, INTERNET_OPTION_SECURITY_FLAGS,

(LPVOID)& dwFlags, & dwBuffLen);

dwFlags |= SECURITY_FLAG_IGNORE_REVOCATION;

InternetSetOption(m_hRequest, INTERNET_OPTION_SECURITY_FLAGS, (LPVOID)& dwFlags, sizeof(dwFlags)) ;

Solution to PCL XL error of HP p2055d laser printer

Recently, HP P2055d laser printer (produced in November 2009) has been installed at the customer’s office. The hardware environment is as follows: PC: Dell OptiPlex 360, and another Fujitsu DPK 8600E ticket printer. P2055d is connected to PC via USB data cable. Software environment: The operating system, Windows XP SP2, USES the driver disk attached. After the installation of the operating system and the driver, the HP P2055d printer will be installed. After the installation of the driver, the test page will be printed, OK; Then, the Fujitsu DPK8600E was installed. After the installation was completed, everything worked fine. As a result, the P2055d hung up.
— — — — — — — — — — — — — — — — — — — — — — — — — — — error message started the author add (visit) — — — — — — — — — — — — — — — — — — — — — — — — — — — —
PCL XL error
Subsystem: KERNEL
Error: IllegalOperatorSequence
Operator: EndSession
Position: 7
— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — –// error message end I (visit)
Using the built-in test function of the machine, the printer can work normally, but it cannot communicate with the PC normally. Uninstall and reinstall the driver and all associated software, and the problem remains. Helpless, call HP customer service, customer service staff told the problem cannot be determined, can only use the following methods to try. Because the telephone is far from the machine, it is not convenient to operate. After two calls to customer service, the P2055d can finally be printed. The operation method is listed here for later use.
1. Change the advanced options for the first time
1) Right-click the printer and select “Print Preference…” in the window that pops up. , as shown in Figure 1.

Figure 1
2) Open the print preferences window as shown in Figure 2

Figure 2
3) Expand “Graph” and select “Download as Soft Font” from the drop-down list of “True Type Font” below (Figure 3)

Figure 3
4) Expand Document Options a Printer Functions and change the drop-down list of Send True Type as bitmap to Enabled (Figure 4).

Figure 4.
5) Then, change the “Print Data Optimization” drop-down list to “Optimize for Text and Vector,” apply “–” Optimize “(Figure 5).

Figure 5
To be on the safe side, I restarted the machine and printer (actually shutting down the computer and then shutting down the printer).
2. Try again and change the driver
As the problem was not solved, the author turned to HP customer service again (every time I played HP customer service, I had to wait, I didn’t know whether HP service was too good or HP product quality was wrong). The author was told to replace it with a 2200 driver, so I tried again.
1) Open the “Printer and Fax” window (start A to set A printer and fax), and click “File” A to “Add Printer” in turn, as shown in Figure 6.

Figure 6.
2) Open the “Add Printer Wizard” window as shown in Figure 7, and click “Next”.

Figure 7.
3) Remove the selection of “Automatic Detection and Installation of plug and play Printer” in the window shown in Figure 8, and click “Next”.

Figure 8.
4) In the “Select Printer Ports” window, select “USB001” (Figure 9) from the following port drop-down list and click “Next”.

Figure 9.
5) In the “Install Printer Software” window, select “HP” from the list of manufacturers, and the printer select “HP LaserJet 2200 Series PCL”, and click “Next” to add the printer.

Figure 10.
After adding this printer, print the document and test page OK. The original 2055D printer system will be installed automatically. It is recommended to set this 2200 printer as the default printer. At this point, the “PCL XL error” problem is resolved.
When the operating system was reinstalled, the printer was installed directly in accordance with Plan 2, and everything was fine.

Utraiso recording DVD application area failed power calibration area error


Originally was to burn a RHEL 6.0 system disk, did not expect out of this problem.
As shown in figure:
(UtraISO version 9.5)


Asked the teacher, Google’s answer is as follows: I test \ to describe the following
1, the DVD drive a, how can not burn function, DVD all don’t know how do
2, incompatible, as stated in a b
3, burner is broken c, obviously is normal
4, do not support high-speed write, reduce the speed try D, no
5, head aging e, impossible
— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — I explore solutions — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —
Solutions:
1, select the ISO file to be burned –& GT; 2, right – button –& GT; 3. Opening mode –& GT; 4, UltraISO Premium — — — — — — — — — — – & gt; 5. Always open the file using a selected program –& GT; 6. Yes.
Note: In step 5, always check the box before “Always use the selected program to open such files.”


Start burning normally… Drops drops…


Ok, burn successfully.

The author’s blog: http://blog.csdn.net/yytry8

— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — – but — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — line — — — — — — — — — — — — — — — — — — — — — — — — — — —

Drupal Internal Server Error 500

After the completion of the local test site, I uploaded it to the space and found an Internal Server Error 500. In this way, I had to close the Clean URL before. Htaccess could work and the 301 jump could be realized. But when I open clean URL, if you’re using drupal’s default.htaccess, you won’t find the page. Now I’ve simply rewritten.htaccess, because All I need is a 301 jump.
The original source: http://suyou.info/node/32

    < IfModule mod_rewrite.c>

    RewriteEngine on

    RewriteBase /

    RewriteCond %{HTTP_HOST} ^www.(.+)$ [NC]

    RewriteRule ^ http://%1%{REQUEST_URI} [L,R=301]

    RewriteCond %{REQUEST_FILENAME} ! -f

    RewriteCond %{REQUEST_FILENAME} ! -d

    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

    < /IfModule>

OpenGL runtime returned 1283 (stack overflow) error

During the test, it was found that some models would cause OpengL to report 1283 error. The code is as follows:

// check for errors
	m_glErrorCode=glGetError();
	if(m_glErrorCode != GL_NO_ERROR)
	{
		const GLubyte *estring;
		CString mexstr;
// get the error descritption from OGL
		estring = gluErrorString(m_glErrorCode);
// prepare and show a message box
		mexstr.Format(L"GLEnabledView:\n\tAn OpenGL error occurred: %s\n", estring);
		AfxMessageBox(mexstr,MB_OK | MB_ICONEXCLAMATION);
	}

The value of m_glErrorCode for debugging is 1283 and eString is a stack overflow
After talking to friends and Googling, I came to the following conclusion:
The push and POP classes in OpengL don’t match.
The reason for the problem is that after a push, an opengL function made an error running, and then the return dropped, causing the subsequent POP not to run, reporting the error.

After the problem is solved, I find that the previous code will make a judgment on the return value of some OpengL functions. Let’s learn. This will help you find out quickly what the problem is.

	if(!gluUnProject(winx,winy,winz,modelMatrix,projMatrix,viewport,&objx1,&objy1,&objz1))
		return FALSE;

If you want to discuss it, please email me.

Solutions to flex4 error ා 2032 stream error

Recently, I was working on a project, and found no problems in the initial release of the program, but some users reported that they could not see the site, and screenshot Error#2032 error. But it worked in the r&d center, and was later tested and luckily found on a test machine. While the other 9 machines were tested at the same time, and found that they could display normally. Then I searched the Internet. No results. Set Cache, compile Settings, try a bunch of them. No response. Weird question! I was even thinking about going back to Flex3, because I stumbled upon a Flex3 project that made sense here. But then I came across a foreigner’s website:
Salesforce Flex: “Error #2032: Stream Error. URL: “
Give it a try, re-select the frame join and merge into the code.
Oh, my God, it worked.
This setting can be found in the Flex build path library path for project properties.
Originally, the first default in Flash Builder4 was to use the SDK default. This is exactly the difference from Flex3.
But it’s not clear what the difference is between the first option, the SDK default. But from the results of the release. It’s a lot smaller when you merge it into code.

Experience of using on error resume next in VBScript

In Vbscript, error handling is done using on Error Resume Next. If you add this sentence to your code, and if any errors occur in other code after this sentence, the system will ignore them and run the rest of the code. In the meantime, we can use the following code to catch errors.

this catches the error code and the description of the error and writes to the log file. However, the problem is that the code after we caught the error, if the error occurs again and you don’t catch it, the code will still ignore the error and continue to run. Ignoring errors is an undesirable result and can make debugging difficult. At this point, the sentence “On Error GoTo 0” can be used to terminate the previous Error handling, that is, it can be paired with “On Error Resume Next”. This will not affect the rest of the code.

has several characteristics to understand,

, 1 on error resume Next if defined in the global, the effect is global, you use this phrase in the main program, the back if the call a function, so if there is an error in the function, also will be ignored, behind the function call statements in your main program can also capture the error, this can be through the following simple code validation:

The result of executing the above code:

13 – type が consistent し ま せ ん.
main ….
As you can see, aaaaaaaaaaa was a deliberate error in the function, followed by wscript.echo “Funcb OK” and the following code were not executed. However, wscript.echo “main…” in the main program The statement is executed. That is, if a statement in a function is wrong, none of the subsequent statements in the function are executed, and the statement following the call to the function is executed directly.
2, On Error Resume Next If defined in the function, see the following code execution

execution results are as follows:
funcb ok
13 – type が consistent し ま せ ん.
13 – type が consistent し ま せ ん.
main ….
It can be seen that this error can be caught in the Err object inside the function and in the main program that calls it. This indicates that the Err object is global, so it should be understood that the scope of err is valid between an On Error Resume Next statement and an On Error Goto 0. If we add an invalid statement after the funcb call statement, the error MSG box will pop up, indicating that the On Error Resume Next in the function body cannot be applied outside of the function.
These are some of the experiences of using On Error Resume Next. If you understand the above two points, you can better use the error handling functions.
http://blog.csdn.net/zmxj/archive/2009/02/24/3932065.aspx
Reference: http://www.meizi.cn/article.asp?id=4
 

socket error 10035

The server got stuck when I was doing the test yesterday. I found that the server did not return the message when it called the send function. As a result, the thread of message processing was stuck there.
Based on the online data, I can probably tell that either the sender is out of cache or the receiver is out of cache.
And my socket is not set to non-blocking mode, so it’s stuck here with no return.
 
The solution is to change the socket to non-blocking mode

 
In this way, if the send fails, it can return immediately, and the server won’t be stuck there.
At this time, if the send is unsuccessful, the return value of the send is error 10035.
 
Then I checked the test client and realized that my client did not receive at all.
That’s weird.

res://ieframe.dll/acr_ error.htm Error resolution | IE8 website restore error real feasible solution

Ie8 website restore error real feasible solution, this morning to open the computer, prompted to update the system patch, so the recommended three most important patches installed. On QQ, open the IE8 browser page of QQ space and suddenly switch quickly, and then the website restore error immediately appears, url header res:// IEframe. DLL /acr_error. HTM, after testing QQ space and other interactive websites will appear this problem.

use IE repair, but still not, looked up on the Internet there is no solution, only to see an article that reinstall IE8 can solve this problem. But since it’s a reinstallation of IE, I don’t think this is the solution. At first glance, I suspect the problem was caused by the morning update patch, and the most likely patch is JSON interoperability of Internet Explorer 8.
The real solution to the IE8 web restoration error is to check out the patch on Microsoft’s website: Install this update to improve JSON interoperability with Internet Explorer 8 according to the new ECMAScript (5th edition standard). You may have to restart your computer after installing this update.

solution: remove the JSON interoperability patch for Internet Explorer 8, the patch number KB976662. First go to the control panel – Add/remove program – display update – find the number KB976662 – delete.

ie8 website restore error really feasible solution, delete need to restart, after the test QQ space and other interactive website open normal. Above method is original, in WIN2003+IE8 under the test is feasible.