Tag Archives: file

Exception from HRESULT: 0x80041FE2

Installation vs community version, new project appears:

Exception from HRESULT: 0x80041FE2

Reasons for the problem:
when installing, the Linux related environment was selected. When creating the project, the visual c + + project was created, because these components were not installed, an error was reported
Creating Linux related projects will not.

_ASSERTE((unsigned)(c + 1) <= 256);

_ Asserte ((unsigned) (c + 1) & lt; = 256);

when using VS2010 to write a program, it is a very simple program, but when inputting Chinese characters, the following error prompt appears.

at the beginning, I was obsessed with the “cannot find or open the pdb file” of the error prompt, but later found that it was not the problem there. I started to notice the following problems.

click Retry, and a breakpoint message will appear.

next, click interrupt, and the breakpoint information will appear.

it can be seen from the figure that this is one of the problems in isctype. C file.

the solution is to right-click on the project – properties – configuration properties – C/C + + – command line

and then enter “/ J”

in the input box on the lower right side to re-enter Chinese characters. It is found that the error has been solved.

reference: msdn.microsoft.com

note: for other editors, such as VS2005, 2008 and 2012, you can choose from the top of the above website. As shown in the figure below

Mysql start slave error 1201 (HY000)

After MySQL replication is configured, an error is reported when starting slave as follows:

mysql> start slave;
ERROR 1201 (HY000): Could not initialize master info structure; more error messages can be found in the MySQL error log
mysql>

Looking for it on the Internet, it turns out that there are two files to delete. It is estimated that it was generated yesterday when other people failed in the test.

/var/lib/mysql/ master.info
/var/lib/mysql/relay- log.info

Just delete it.

mysql> start slave;
Query OK, 0 rows affected (0.01 sec)

mysql>

Refer to the following documents:

http://blog.sina.com.cn/s/blog_ 51d3553f0100j5m2.html

In VS2010, the compiler cannot open the file “GL / glaux. H”: no such file or directory

 
We recently tested an example OpenGL program:
#include < GL/gl.h>
#include < GL/glaux.h>
#include “glos.h”
 
void main(void)
{
auxInitDisplayMode(AUX_SINGLE|AUX_RGBA);
,0,500,500 auxInitPosition (0);
auxInitWindow(“simple”);
 
GlClearColor (0.0, 0.0, 0.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT);
GlColor3f (1.0, 0.0, 0.0);
GlRectf (0.5, 0.5, 0.5, 0.5);
 
glFlush();
_sleep(1000);
}
 
It runs normally under VC6.0, but under VS2010 there is a compilation error as follows:
1> D :\elec\mymfctest\vs2010p\openglapps\opengltest\opengltest.cpp(4): fatal error C1083: Could not open included file: “GL/glaux.h” : No such file or directory
It seems that this error can be found in versions VS2008 and above.
Only two Files can be seen in the path C:\Program Files\Microsoft SDKS \Windows\ V7.0 A\Include\gl after VS2010 installation
Gl. h and glu. H instead of glaux. H,
C:\Program Files\Microsoft Visual Studio\VC98\Include\GL
The next one has three files
H, glu. H, and glaux. H, so the relevant header files are not found in VS2010.
The glaux.lib library file is not found in the VC6.0 installation path C:\Program Files\Microsoft SDKS \Windows\ V7.0 A\ lib, but in the VS2010 installation path C:\Program Files\Microsoft SDKS \Windows\ V7.0 A\ lib.
The solution is to copy the glaux. H and glaux. Lib files from their respective folders to the path referenced by default in VS2010 if you have VC6.0 installed. It is possible that the application will also need glaux. DLL support at runtime, which can also be downloaded.

The language of C__ FILE__ 、__ LINE__ And line

Original link:
 
http://hi.baidu.com/419836321/blog/item/fcf5ceec484681cfb31cb1f7.html
 
 
 
 

__FILE__ is used in C to indicate the filename of the source file in which the statement is written, for example (test.c) :

    #include < stdio.h> int main() { printf(“%s\n”,__FILE__); }

GCC compiler generates a.out. After execution, the output is:

test.c

Compiling results under Windows VC6.0 are as follows:

C :\ Documents and Settings \ Administrator \ Desktop \ Test.c

——————————————————————————————————————————————————————————————————– ————————————————————————–

__LINE__ in C is used to indicate the position of the statement in the source file. Examples are as follows:

    #include < stdio.h>

    main() { printf(“%d\n”,__LINE__); printf(“%d\n”,__LINE__); printf(“%d\n”,__LINE__); };

The program is compiled in Linux with GCC, in Windows VC6.0 under the compilation can pass, the execution results are:

7

8

9

__LINE__ can also be reset with the #line statement, for example:

    #include < stdio.h>

    # line 200 // specify the next row __LINE__ for 200 main () { printf (” % d \ n “, __LINE__); printf(“%d\n”,__LINE__); printf(“%d\n”,__LINE__); };

After compilation and execution, the output is:

202

203

204

——————————————————————————————————————————————————————————————————– —————————————————————————

GCC also supports __func__, which indicates the function, but this keyword is not supported in VC 6.0 under Windows, for example:

    #include < stdio.h> void main() { printf(“this is print by function %s\n”,__func__); }

The output result after compilation is

this is print by function main

Note # “line”, “__LINE__”, “a __FILE__” and “__func__” are case sensitive.

 

Python: Understanding__ str__

The following is my understanding if there is anything wrong with me. Please do tell me. Thank you very much!
In The Python language, successie __str__ is usually formatted this way.
class A:

def __str__(self):

return “this is in str”

Literally, ___ is called by the print function, usually return something. This thing should be in the form of a string. If you don’t want to use the STR () function. If you print a class, print first calls each ___ by str__, such as STR. Py

#!/usr/bin/env python
                                                                                                                                                                                 
class strtest:
    def __init__(self):
        print "init: this is only test"
    def __str__(self):
        return "str: this is only test"

if __name__ == "__main__":
    st=strtest()
    print st

$./str.pyinit: this is only test

str: this is only test
As you can see from the above example, the function with ___ is called when you print an instance of STRtest st.
By default, the python objects almost always have the __str__ function used by print. S the dictionary with ___, see the red part:
> > > dir({})
[‘__class__’, ‘__cmp__’, ‘__contains__’, ‘__delattr__’, ‘__delitem__’, ‘__doc__’, ‘__eq__’, ‘__format__’, ‘__ge__’, ‘__getattribute__’, ‘__getitem__’, ‘__gt__’, ‘__hash__’, ‘__init__’, ‘__iter__’, ‘__le__’, ‘__len__’, ‘__lt__’, ‘__ne__’, ‘__new__’, ‘__reduce__’, ‘__reduce_ex__’, ‘__repr__’, ‘__setattr__’, ‘__setitem__’, ‘__sizeof__’, ‘__str__’, ‘__subclasshook__’, ‘clear’, ‘copy’, ‘fromkeys’, ‘get’, ‘has_key’, ‘items’, ‘iteritems’, ‘iterkeys’, ‘itervalues’, ‘keys’, ‘pop’, ‘popitem’, ‘setdefault’, ‘update’, ‘values’]
> > > t={}
> > > t[‘1’] = “hello”
> > > t[‘2’] = “world”

> > > t
# is equal to print t

{‘1’: ‘hello’, ‘2’: ‘world’}

> > > t.__str__()

“{‘1’: ‘hello’, ‘2’: ‘world’}”

You can see a dictionary, print t and t. str__() are the same. Simply output the contents of the dictionary as a string.
If it’s not a string returned in the function ___, see str1.py

#!/us/bin/env/python                                                                                                                                                                                        
#__metaclass__ = type
#if __name__ == "__main__":
class strtest:
    def __init__(self):
        self.val = 1
    def __str__(self):
        return self.val

if __name__ == "__main__":
    st=strtest()
    print st

$./str1.py

Traceback (most recent call last):
File “./ STR. Py “, line 12, in < module>
print st
TypeError: ___, returned non-string (type int)
Error message with: ___ returned a non-string. Here’s what we should do: see str2. Py

#!/usr/bin/env python                                                                                                                                                                                        
#__metaclass__ = type
#if __name__ == "__main__":
class strtest:
    def __init__(self):
        self.val = 1
    def __str__(self):
        return str(self.val)

if __name__ == "__main__":
    st=strtest()
    print st

$./str2.py

1
We used STR () to change the integer to a character.

TFTP: server says: file not found solution

Under Linux, regardless of which super-Server, inetd, or xinetd is used, the TFTP service is disabled by default, so modify the file to open the service.
According to the installation method of (1), the file /etc/xinetd.d/ TFTP can be modified. It is mainly to set the root directory of the TFTP server and start the service. The modified file is as follows:
service tftp
{socket_type = dgram
Protocol = udp
Wait = yes
User = root
Server =/usr/sbin/in TFTPD
Server_args = -s/home/LQM/tftpboot – c
Disable = no
Per_source = 11
The CPS = 100 2
Flags = IPv4
}
Server_args = -s < server_args= -s < path> -c, where < path> Change to the root directory of your TFTP-server. The parameter -s specifies chroot and -c specifies that files can be created.
3. Create TFTP root directory and start TFTP-Server.
#mkdir /home/lqm/tftpboot
# chmod o + w/home/LQM/tftpboot
#service xinetd restart
Stop xinetd: [sure]
start xinetd: [sure]
At this point, TFTP-Server is started. You can log in to test the following commands:
# TFTP & lt; your-ip-address>
tftp> get < download file>
tftp> put < upload file>
tftp> q
#

installation process problems and causes
phenomenon 1:
tftp> Log
Transfer timed out.
reason:
TFTPD service doesn’t start
Phenomenon.
tftp> put test2
Error code 0: Permission denied

run the command, check the system log
# tail /var/log/messages
found the following text:
Mar 24 19:05:26 localhost set: SELinux is preventing /usr/sbin/in. TFTPD (tftpd_t) \”write\” to tftpboot (tftpdir_t). For complete SELinux messages.run sealert-l 40a5a6bf-8ded-4bfa-ab6e-fa669a25fc6c
know this is caused by SELinux, in FC3 and FC versions after FC3 SELinux is turned on by default, now close it, modify the file /etc/sysconfig/ SELinux, set which
SELINUX=disabled
Then restart the computer
Or execute the system-config-SecurityLevel command to open the Security-Level Configuration dialog box and change “forced” to “allowed” in the SELinux (S) option.
Phenomenon 3:
tftp> Log
Error code 1: File not found
reason:
specified File does not exist; Or the -c option is not specified in the TFTPD boot parameter, allowing the file to be uploaded
Phenomenon 4:
tftp> Get test.log
Error code 2: Only absolute filenames allowed
reason:
server_args set in /etc/xinetd.d/ tftpd-hpa
cat /etc/defaul/tftpd-hpa
#Defaults for tftpd-hpa
#Defaults for tftpd-hpa
RUN_DAEMON=\”no\”
OPTIONS=\”-s /home/tftpd-c-p-u 077-u To set TFTPD \”
, simply change server_args = to your server folder

Unable to open the physical file “d:\***.mdf”. Operating system error 5: “5(Access is denied.)”.

SQL SERVER2008 is installed under Windows 7. An error occurred trying to attach an existing database MDF file,
Unable to open the physical file “d:\***.mdf”. Operating system error 5: “5(Access is denied.)”.
Is to set the SQL Server related account access to the file
Let Management Studio run as an administrator
 

How to solve fatal error C1010!

 

in compiled VC++6.0 is, appears

fatal error C1010: unexpected end of file while looking for precompiled header directive

problem explanation in detail:

fatal error C1010, the file did not end as expected while looking for a precompiled indication header file. The header file where the precompiled indication information was not found.

problems generally occur in:

adds some CPP files to an MFC program by adding files, but the CPP file is not MFC, is standard C++.

solution 1:

, right-click the CPP file in the Project Project and set it to the first item: Not using preheaders, from the C++ Header on the Project Settings page.

solution 2:
Add the include file stdafx.h at the beginning of the.cpp file.

# include “stdafx. H”

from: MSDN

Visual C++ Concepts: Building A C/C++ Program

Fatal Error C1070

mismatched #if/#endif pair in file ‘filename
An #if, #ifdef, or #ifndef directive has no corresponding #endif. The following sample generates C1070:

// C1070.cpp
#define TEST

#ifdef TEST
// use the line below to resolve the error
// #endif

#ifdef TEST

#endif

int main() {
}
// C1070

dvips Error:-no default destination available

# dvips work-summary.dvi

This is dvips(k) 5.95a Copyright 2005 Radical Eye Software (www.radicaleye.com)

‘ TeX output 2008.09.16:1816’ -> work-summary-08_09.ps

<tex.pro><texps.pro>. <cmti10.pfb><cmti12.pfb><cmmi10.pfb><cmr7.pfb> lpr: Error – no default destination available.

lpr is about printer or print file

Because I have no printer connected to my PC, so I did below:

#texconfig

Then:

->choose dvips,

->choose Dest,

->press enter (so that dvips destination can be a file, instead of a printer).