Category Archives: How to Fix

Error: your local changes to the following files would be rewritten by merge solution

The background,
Other members of the team have modified a file and submitted it for storage. You modified the local file before pull. When you modify the code and pull again, the following error will be reported:
error: Your local changes to the following files would be overwritten by merge
Ii. Solutions
Depending on whether you want to save local changes, there are two solutions
2.1 Reserved modification
Execute the following three commands

git stash
git pull origin master 
git stash pop 

Note:
Git Stash: Back up the current workspace, read from the last commit, and make sure the workspace is the same as the last commit. At the same time, save the contents of the current workspace in Git stack. Git Pull: Pull the current branch code on the server. Git Stash pop: read the last saved contents from Git stack and restore relevant contents of the workspace. At the same time, users may perform stASH operations for many times, and need to ensure that the first stash is fetched after, so the stack (in and out) is used for management. Pop the top of the stack and restore the Git Stash List: Shows all the backups in the Git stack, and you can use this list to decide where to restore. Git Stash Clear: Clears the Git stack
2.2 Scrap modification
The core idea is to roll back the version, as follows

git reset --hard 
git pull origin master

Note: The second type is not recommended. Unless you’re sure you don’t need a local change.

【PTA:】 Error: class X is public should be declared in a file named X.java

(?: can not come out on the PTA error without looking at the _ (: з) <) _) I have been making this mistake in writing the topic on PTA today.
Error: class X is public should be declared in a file named X.java

Searched a lot of solutions, it is said that the class name and file name to change the same, obviously I changed is really the same duck. I also asked the strong brother big sister, how to change is reported this wrong (; ‘⌒ `)
.
Later, a classmate told me that it was the problem of PTA platform:

http://www.cnblogs.com/zhrb/p/6347738.html



The name of the class is the Main file names, at last it redone success.
a simple grinding by me so long, all want to broken head didn’t expect to be the problem (; ´ д `) ゞ
it is a good habit to look at the instructions

cifs mount error(13): Permission denied

In operation and maintenance, I created a Shared disk on Windows (192.168.2.212), set the share permissions to be readable and writable for the local account test, then created mount point /share on Linux side, then mount -t cifs //192.168.2.212/test/share-o username=test,password=Pass1234, but prompted the following information:
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
According to the description of security mode in Man mount. Cifs, kernel 3.8 USES NTLMSSP by default, and the rest USES NTLM. Here I query kernel 3.10.0-327.el7.x86_64 (uname-a can be viewed), and NTLM is selected. The final statement is mount -t cifs //10.15.2.212/test/share-o username=test,password=Pass1234, SEC = NTLM, executed successfully.
SEC =
Security mode. Allowed values are:
· None-attempt to connection as a null user (no name)
· KRB5-use Kerberos Version 5 Authentication
· Krb5i-use Kerberos authentication and Establish enable Packet Signing
· NTLM-use NTLM password Hashing
· NTLMI-use NTLM password hashing and force packet Signing
· NTLMv2-use NTLMv2 password Hashing
· NTLMV2I-use NTLMv2 password hashing and force packet Signing
· NtlMSSP-use NTLMv2 password hashing Encapsulated in Raw NTLMSSP message
· NtlMSspi – Use NTLMv2 password hashing. Additionally, encapsulated in Raw NTLMSSP message, and Force packet Signing
The default in mainline kernel versions prior to V3.8 was SEC = ntlm.in v3.8, The default was changed to SEC = NTLMSSP.
If the server requires Signing during protocol negotiation, Then it may be enabled automatically. The Packet signing may also be enabled
automatically if it ‘s enabled in/proc/fs/cifs/SecurityFlags.

FDI server error

When installing ice3.5.1.msi file on Windows10, FDI server error is always prompted, and clicking ignore is not effective. You can only click cancel and then exit the installation, which is obviously not feasible.
baidu search, there are a lot of people in China have encountered similar problems, but it is of no use, they just put forward questions and no one answers them or make up eight gibberish, Google, find a question and answer, probably understand, also solved my problem.

specific operation is to put ice3.5.1.msi file in the root directory D disk, click to install, this is normal
, similar problems that cannot be installed should also be solved this way

python keyerror(0)


It’s not the key of the keyboard, it’s the key of the dict
When dict is evaluated, the key does not exist in the key() of dict, and an error is reported

When python reads key and value, if key does not exist, it will trigger KeyError error, as follows:

Python

t = {
    'a': '1',
    'b': '2',
    'c': '3',
}
print(t['d'])

It will appear:

KeyError: 'd'

The first solution
First, test whether the key exists, and then proceed to the next operation, such as:

Python

t = {
    'a': '1',
    'b': '2',
    'c': '3',
}
if 'd' in t:
    print(t['d'])
else:
    print('not exist')

There will be:

not exist

The second solution
Use the built-in get(key[,default]) method dict; if key exists, return its value; otherwise return default; Using this method will never trigger KeyError, as follows:

Python

t = {
    'a': '1',
    'b': '2',
    'c': '3',
}
print(t.get('d'))

There will be:

None

Add default parameter:

Python

t = {
    'a': '1',
    'b': '2',
    'c': '3',
}
print(t.get('d', 'not exist'))
print(t)

There will be:

not exist
{'a': '1', 'c': '3', 'b': '2'}

The third solution
Using dict built-in setdefault(key[,default]) method, if key exists, return its value; Otherwise insert this key, its value is default, and return default; Using this method will never trigger KeyError, as follows:

Python

t = {
    'a': '1',
    'b': '2',
    'c': '3',
}
print(t.setdefault('d'))
print(t)

There will be:

None
{'b': '2', 'd': None, 'a': '1', 'c': '3'}

Add default parameter:

Python

t = {
    'a': '1',
    'b': '2',
    'c': '3',
}
print(t.setdefault('d', 'not exist'))
print(t)

There will be:

not exist
{'c': '3', 'd': 'not exist', 'a': '1', 'b': '2'}

The fourth solution
Add the /___ b> method to the class dict. If key does not exist, it goes to the missing__() method without firing KeyError, e.g.

Python

t = {
    'a': '1',
    'b': '2',
    'c': '3',
}


class Counter(dict):

    def __missing__(self, key):
        return None
c = Counter(t)
print(c['d'])

There will be:

None

Change return value:

Python

t = {
    'a': '1',
    'b': '2',
    'c': '3',
}


class Counter(dict):

    def __missing__(self, key):
        return key
c = Counter(t)
print(c['d'])
print(c)

There will be:

d
{'c': '3', 'a': '1', 'b': '2'}

The fifth solution
Using the collections.defaultdict([default_factory[...]]) object, which is actually inherited from the dict and is actually used with the missing__ __() method, its default_factory argument is passed to the missing__() method,
if default_factory is None, it will be the same as dict, it will trigger KeyError error, as follows:

Python

import collections
t = {
    'a': '1',
    'b': '2',
    'c': '3',
}
t = collections.defaultdict(None, t)
print(t['d'])

There will be:

KeyError: 'd'

But if you really want to return None is not out of the question:

Python

import collections
t = {
    'a': '1',
    'b': '2',
    'c': '3',
}

def handle():
    return None
t = collections.defaultdict(handle, t)
print(t['d'])

There will be:

None

If the default_factory parameter is a data type, it will return its default value, such as:

Python

import collections
t = {
    'a': '1',
    'b': '2',
    'c': '3',
}
t = collections.defaultdict(int, t)
print(t['d'])

There will be:

0

Such as:

Python

import collections
t = {
    'a': '1',
    'b': '2',
    'c': '3',
}
t = collections.defaultdict(list, t)
print(t['d'])

There will be:

[]

Note:
if dict contains dict, key nested to get value, if a middle key0 does not exist, then all the above methods are invalid, and 1 KeyError2 will be triggered:

Python

import collections
t = {
    'a': '1',
    'b': '2',
    'c': '3',
}
t = collections.defaultdict(dict, t)
print(t['d']['y'])

There will be:

KeyError: 'y'

ERP failure: Error when opening an RFC connection

Created by Jerry Wang, last modified on May 20, 2015 Created by Jerry Wang, when opening an Opportunity, the following error was encountered: this error message could only be seen when entering the Opportunity overview page for the first time. Root cause: An RFC ping operation within the ERP Component CLASS_CONSTRUCTOR(will only be executed together) : if Sy-Subrc is not 0, the error message will be displayed on the UI.

.

Solution to MySQL workbench error 1148 unable to load local data

Windows10 workbench 8.0 error code:1148 temporary solution is as follows :
1. In the Workbench, type Show Global variables like ‘local_infile’;
result should be :on. This problem has nothing to do with whether localinfile =1, which is a bug of workbench. 2. Continue to enter show variables like ‘secure_file_priv’;
the result should be C:\ProgramData\MySQL\MySQL Server 5.7\Uploads file; 3. Put the files that need to be imported into the file in step 2;
4. Load data local infile command to remove the local, and combined with step 2 folder path, for example, is as follows:
the load data infile ‘C:/ProgramData/MySQL/MySQL Server 5.7/Uploads/a.c sv into table a’;
Ps: resources: https://bugs.mysql.com/bug.php?Id =91891 Post Catherine S reply, like one!

Securityerror: error ᦇ 2148: SWF file (SWF file cannot access local resources)

SecurityError: Error # 2148: SWF file file:///F:/work2010/tiger/rmpublisher.air/bin-debug/index.swf file:///F:/work2010/tiger/rmpublisher.air/bin-debug/plugins/plugins.xml cannot access the local resources. Only file system-limited SWF files and trusted local SWF files can access local resources.
at flash.net: : URLStream/load ()
at flash.net: : the URLLoader/load ()
the at com. Edlt. Utils: : Settings/loadSettings () [D:
Solutions:
The first:
Right click on flex project –& GT; properties–> ActionscriptCompiler–> Additional compiler arguments
plus “-use-network=false” is OK
SWF will not be able to access network resources such as socket communications.
So it’s better not to use it that way.
The second:
I have found a lot of articles on security sandbox on the Internet, most of which are about how to solve the problem of network resource access, which is different from what I want in this article. Although these articles do not address the issue of local resource access. The solution to this problem should be similar, with the network adding a trusted domain name in a cross or something file to allow access, then the local resource should also be able to add a local resource path somewhere to allow access.
The details are as follows: find system32\Macromed\Flash\FlashPlayerTrust in the Windows installation directory, create a text file in this directory, enter the detailed path of Flash to access local resources in the file, and save. Execute SWF, no more errors. OK
For example: in C:\WINDOWS\ System32 \Flash\FlashPlayerTrust directory to add a file, such as: 1. TXT (file name can be arbitrarily started), the file content is: “D:\demo\test\” that is the project path, of course, can also be set to “D:\”

Error c2259 cannot instance abstract class due to following members

Error description:
E:/mywork/1.7 sp1/ginfo/client/SRC/skdesigner/dsgquerydlg. H. (295) : error C2259: ‘CDsgFormatDataMgrDlg’ : Always instantiate the abstract class due to the following members:
e:/mywork/1.7 sp1/ginfo/client/SRC/skdesigner/dsgformatdatamgrdlg. H (14) : see declaration of ‘CDsgFormatDataMgrDlg’
 
Reason for error:
An implementation class inherits an abstract base class, but does not implement all the methods in the abstract base class.
 
Can be similarly implemented:
Virtual Void EnableControl(PSKOPEROBJECT Lpoo, BOOL bEnable) {}//
 
Code example:
 
class CDsgFormatDataMgrDlg : public CDialogImpl< CDsgFormatDataMgrDlg> ,
public ISkBusinessEngineSink// abstract base class
{
public:
enum {IDD = IDD_FORMATDATAMGR_DLG};

CDsgFormatDataMgrDlg ();
virtual ~ CDsgFormatDataMgrDlg ();
virtual BOOL PreTranslateMessage(MSG* pMsg);

}
 
The class ISkBusinessEngineSink
{
public:
virtual void HandleOneCSObject (LPCTSTR lpszName) {}
virtual BOOL HandleUpdateCalendarResult (int nType, PCALENDAREVENT lpce,
DWORD dwClientTmpId, BOOL bRet, DWORD dwErrorCode) {return FALSE; }
virtual BOOL HandleUpdateDesktopResult (int nType, PDESKTOPITEM lpdi,
DWORD dwClientTmpId, BOOL bRet, dwords dwErrorCode) = 0.

virtual void HandleHotBUList(PHOTBU LPHB, int nCount) {}
virtual void OnDBFuncReady(BOOL bReady) = 0;
virtual void OnDBViewReady(BOOL bReady) = 0;
virtual void OnSNReady(BOOL bReady) = 0;
virtual void OnTableReady(BOOL bReady) = 0;

}
 
Methods in the abstract base class must fully implement…
Appendix:
The choice of http://www.cnblogs.com/shenfx318/archive/2007/01/25/630760.html (abstract base classes and interfaces) and the difference between
http://www.cnblogs.com/TravelingLight/archive/2010/06/02/1750073.html (abstract base class for some of the problems)
http://www-numi.fnal.gov/offline_software/srt_public_context/WebDocs/Companion/cxx_crib/interfaces.html
(OO concepts and abstract classes and interfaces)