Author Archives: Robins

How to Fix Ubuntu(Linux) mount error(22)

error log
execute an order

sudo mount -t cifs //ip/sharename /tmp/1 -o username=11,password=tmp

error log

mount error(22): Invalid argument
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

solution
View root cause:

tail -f /var/log/kern.log

Note:

No dialect specified on mount. Default has changed to a more secure dialect, SMB2.1 or later (e.g. SMB3), from CIFS (SMB1). To use the less secure SMB1 dialect to access old servers which do not support SMB3 (or SMB2.1) specify vers=1.0 on mount.

The solution has been specified in the prompt, and the version of cifs shared is not specified, cifs is divided into smb1.0/2.0/3.0/3.1.
Solution

sudo mount -t cifs //ip/sharename /tmp/1 -o username=11,password=tmm,vers=1.0

Solve the Java “syntax error on token enum” problem

Reference:
http://stackoverflow.com/questions/8598661/eclipse-chokes-on-enum-even-though-compiler-compliance-level-is-1-6
http://ywj852752270.blog.51cto.com/4105805/1248526

“Why”
Enum is a Java reserved keyword, and in Java 1.4 and prior versions, warninig may be prompted at compile time to indicate that enum is a keyword and is not recommended. However, since Java version 1.5 an error will be reported: Syntax Error on token enum

“Address”
You can rename a variable named enum.
If it is inconvenient to modify, such as the old code can not work, this can be solved as follows.

The project is then rebuilt. If the syntax error on token enum error is also reported, the project is deleted from the workspace, then re-imported and rebuilt.

Django debug = false internal server error 500

Add the following in Setting.py

# AMDIN CONFIGURATION
#-------------------------------------------------------------------------------
ADMINS = [('hiveme', '[email protected]')]

# EMAIL CONFIGURATION
#-------------------------------------------------------------------------------
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'

When set from this, if the server generates 500 errors it prints the error message to the log/screen. You can also set up other EMAIL_BACKEND so that it will email errors to your email.

Ubuntu 16.04 Samba shared folder

Ubuntu 16.04 comes with Samba, so you can use it directly.
right click on the folder you want to share -> Local Network Share, all points can be determined, and it can be done.
if the following error occurs:

'net usershare' returned error 255: net usershare: cannot open usershare directory /var/lib/samba/usershares. Error Permission denied 
You do not have permission to create a usershare. Ask your administrator to grant you permissions to create a share

Perform the following steps to resolve:
Add your username to sambashare.

sudo adduser yourname sambashare

Log out, Log in again, and execute Local Network Share.

Find malloc_error_Root cause method of break error

malloc_error_break error:1、You’ll find out what the object is when you break in the debugger. Just look up the call stack and you will find where you free it. That will tell you which object it is.

The easiest way to set the breakpoint is to:

    1. Goto Run -> Show -> Breakpoints (Alt-Command-B)Scroll to the bottom of the list and add the symbol

malloc_error_break2、Open up the debugger console by pressing Cmd+Shift+R. There, type

break malloc_error_break

to set a breakpoint at the beginning of the malloc_error_break function.

If you want to find out what object is located at address 0x1068310, you can type the following into the debugger console:

print-object 0x1068310

Of course, you have to do this while the object is still alive — if the object has already been freed by the time you do this, then this will not work.

Solutions to error c2143: syntax error: missing ‘;’ before ‘type’ in C + + program compilation

People make the rules. Why didn’t I know about QAQ?(> The man & lt; ). ~ Purr…
In pure C, variable declarations must come first in a block of code

    found a problem when running the program, VC 6.0 compiler C language is always prompted with an error: error C2143: syntax error: missing ‘; ‘before’ type ‘. The solution is to put the declaration of all variables before the executable code. The problem occurs because the file is saved in.c format. It will compile normally if it is in CPP format. If you change it to.cpP, it will work, regardless of where your variable is declared. * Generally in ANSI C or C++, it is allowed to define variables at any time in executable code, but in K& It’s not allowed in R C, and that’s why we have this error. VC6.0, VS2008 are used K& R C to implement the C language, so the compilation process will report errors. No such File or Directory appears about C free 5. Wait for a few mistakes to appear together. Solution: If the name of the installation directory has Spaces, the system may not find the path.
    we can try to change the name of the installation directory to simple, no Spaces.

I am so happy that the problem that has been bothering me has been solved. Only in the process of solving the problem can I feel that kind of happiness. I hope it will be helpful to those who have the same problem.
Wrote by markpain 20160908

error LNK2038: mismatch detected for ‘RuntimeLibrary’: value ‘MTd_StaticDebug’ doesn’t match value ‘

I see all kinds of solutions on the web, but my reason is to add extra libraries.
Removing the following libraries from the configuration solves the problem. In fact, opencV3.0 configuration becomes as simple as adding these two libraries
opencv_ts300d.lib
opencv_world300d.lib

These libraries do not have to be added.
IlmImfd.lib libjasperd.lib

libjpegd.lib

libpngd.lib

libtiffd.lib

libwebpd.lib

opencv_calib3d300d.lib

opencv_core300d.lib

opencv_features2d300d.lib

opencv_flann300d.lib

opencv_highgui300d.lib

opencv_imgcodecs300d.lib

opencv_imgproc300d.lib

opencv_ml300d.lib

opencv_objdetect300d.lib

opencv_photo300d.lib

opencv_shape300d.lib

opencv_stitching300d.lib

opencv_superres300d.lib

opencv_video300d.lib

opencv_videoio300d.lib

opencv_videostab300d.lib

zlibd.lib

How to Fix MySQL error 1005: can’t create table (errno: 150)

Mysql ERROR 1005: Can’t create Table (errno: 150) when creating a reference constraint in mysql results in an ERROR message that cannot create a reference constraint.
A rough picture of what went wrong
1, foreign key reference type is different, such as the primary key is int foreign key is char
2. The column referenced in the main table could not be found
3, the primary key and foreign key character encoding is not consistent, may also be different storage engineThe problem I ran into was that none of the above was true, but it did succeed after removing a foreign key constraint. One thing is for sure, this error was caused by a foreign key constraint.

To summarize the experience:

In fact, in a MySQL database, if there are more than one database, it is better to write SQL with the name of the database, such as:

CREATE TABLE  `testdb`.`user_visitor_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` varchar(45) COLLATE utf8_bin DEFAULT NULL COMMENT 'id',
  `user_ip` varchar(15) COLLATE utf8_bin DEFAULT NULL COMMENT 'ip',
  `refer_url` varchar(45) COLLATE utf8_bin DEFAULT NULL COMMENT 'source',
  `visit_time` timestamp NULL DEFAULT NULL COMMENT 'time',
  `leave_time` timestamp NULL DEFAULT NULL COMMENT 'leave time',
  `module_name` varchar(45) COLLATE utf8_bin DEFAULT NULL COMMENT 'moudle name',
  `news_id` int(11) DEFAULT NULL COMMENT 'Access to information on the information page id',
  PRIMARY KEY (`id`),
  UNIQUE KEY `id_UNIQUE` (`id`),
  KEY `seoID_idx` (`seo_id`),
  CONSTRAINT `seo_msg_id` FOREIGN KEY (`seo_id`) REFERENCES `college_seo_msg` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='User access log';

 

Linux GCC compilation error: “collect2: LD returned 1 exit status”

bmeta_info.cpp:4280: undefined reference to ‘crypt’
collect2: ld returned 1 exit status
Information found online shows:

Undefined reference to error: this type of error is in the process of connection, there may be two reasons: one is the user to define a function or global variable in a source code file that is not compile, link, or simply has not been defined, it requires the user to modify source program according to the practical situation, presents the definition of a global variable or function body; The second is that the undefined symbol is a standard library function, which is used in the source program, and the corresponding library name is not given during the connection process, or the directory name of the archive has a problem

Use the Man crypt command to find the following information:

GNU EXTENSION
       The glibc2 version of this function has the following additional features.  If salt is a character string starting with the three characters "$1$" followed by at most eight characters, and optionally terminated by "$", then instead of using  the  DES  machine, the  glibc crypt function uses an MD5-based algorithm, and outputs up to 34 bytes, namely "$1$<string>$", where "<string>" stands for the up to 8 characters following "$1$" in the salt, followed by 22 bytes chosen from the set [a–zA–Z0–9./].  The entire key is significant here (instead of only the first 8 bytes).
       Programs using this function must be linked with -lcrypt.

Program using this function must be linked with -lcrypt. The program must be linked with -lcrypt
Reference: [http://blog.sina.com.cn/s/blog_64c238860100wzoo.html]

Error parsing XML: error after document element

Many developers may be warning about errors like Error parsing XML: junk after document element, where Android123 hints that usually legal XML files have only one parsing node, such as the parsing node

< android123>
& lt; item1/>
& lt; item2/>
& lt; item3/>
< /android123>
If you make a mistake like an Error parsing XML: junk after document element, your focus may be to have multiple nodes at the root, such as Parsing XML
& lt; android123>
& lt; item1/>
< /android123>
< android123>
& lt; item2/>
& lt; item3/>
< /android123>
 
 

XML cannot be parsed, because it may not be written in the correct XML format, considering that the root node is not correct.

From:
the Error parsing XML: junk after the document element such mistakes – CSDN blog
https://blog.csdn.net/sunmoon631/article/details/6438617