Tag Archives: abnormal

Inexplicable exception 007: git error: authentication failed for

It may be that your password to connect to git has been changed, but not the local configuration. However, Git doesn’t have pop-up boxes that prompt you to change your username and password.
Then you can do the following:
1. Open git bash here
Git config –system –unset credential. Helper
3. Then do anything like push, pull, or clone
4, You are prompted to enter the user name and password, change it
Git config –global credential. Helper store
6. Execute 3 again and enter the username and password
7, OK.

python: HTTP Error 505: HTTP Version Not Supported

The urlliB2 module of Python is used to obtain the data code as follows:

Try:
    data = urllib2.urlopen(url).read()
except Exception,e:
    print e
return data

Url parameter is:

http://sms.gildata.com:8080/sms/sendSms.do?content=Hello world&msisdns=18373239087&user=gildata2&key=804

The following problems occurred while executing the code:
HTTP Error 505: the HTTP Version Not Supported
online are urllib2 module does Not support http1.1 agreement, must carry on the processing of one sort or another, but I later found out that seems to be the url does Not support Spaces, I will Hello world this parameter Spaces take out, can successfully send text messages to come out, if it is in space can be used to add escape character % 20 instead of Spaces, you can also use % 0 a instead of a newline.

Oracle database file is damaged, Error:ORA-01033 :ORACLE initialization or shutdown in progress

Due to create your own table space, but want to rename, will directly to smash this table space, after the myeclipse deployment project under the service is just an error, pl/SQL or navicat is to open other existing connection, is all the database file is unusable, comprehensive look at a few other people’s blog last problem solved:
Attached to the blog: http://blog.csdn.net/liverliu/article/details/6410287
I’ll just stick to his summary:
First of all, the cause of the problem is that I created a bookspace table space in f:/ LLH/directory before, but I didn’t want the table space later, so I just deleted it. This error is caused by deleting several files such as F :/ LLH /bookspace.dbf by mistake.
Ora-01033: ora-01033: Oracle initialization or shutdown in progress
1. First, run CMD under Windows and enter the DOS environment. 2. Login as DBA user
(1) sqlplus /NOLOG
 
(2) Connect sys/change_on_install as sysdba
Tip: Successful
 
(3) Shutdown Normal
Tip: the database has been closed
has been uninstalled the database
the ORACLE routine has been closed
(4) Startup Mount
Tip: ORACLE routine has been started
Total System Global Area 118255568 bytes
Fixed Size 282576 bytes
Variable Size 82886080 bytes
Database Buffers 33554432 Bytes
Redo Buffers 532480 bytes
database finished loading
(5) the alter database open;
 

error on line 1 :
ora-01157: unable to identify/lock data file 19 – refer to DBWR trace file
ora-01110: data file 19: “” F:/LLH/ bookspace.dbf “; The
tip file section is slightly different for each individual.
Continue to input
(6) Alter Database Datafile 19 offline Drop;

hint: the database has changed.
 
Use the last two steps in the “database has changed” loop until alter Database Open. No more error, “Database has changed”.
 
Up to this point, I will follow the original blogger’s operation. Now I need to close the command line and click computer — > Management – & gt; After the service, find the Oracle-related service and stop it, and then restart it. Oracle services are closed and started in a certain order, specific query can be online.
You can also refer to the following website content for setting, I did not try, roughly the same.
http://www.linuxidc.com/Linux/2016-04/130111.htm
 
 
 

Python keyerror exception

If you don’t know if there’s a key value in dict, you’d better use it

dict.get(key)
If you read with dict[key] it will report a KeyError exception,

Dict. Get method mainly provides a function to return the default value if the value of corresponding key is not obtained.

And dict[key] actually calls the method with ___
D.get(key[, d]) -> D[K] if K in D, else D. defaults to None

[338] MySQL error: error 1205: lock wait timeout exceeded solution

Solutions:
Execute mysql command: Show Full ProcessList;

Then find the system ID of the query statement: kill the thread ID that is being locked

Select * from information_schema.innodb_trx; select * from information_schema.innodb_trx;

Refer to the article: http://my.oschina.net/quanzhong/blog/222091
http://blog.sina.com.cn/s/blog_53e68b3b0101bjxi.html

[Python] notimplemented and notimplemented error

NotImplemented is a non-exception object, and NotImplementedError is an exception object.

>>> NotImplemented
NotImplemented
>>> NotImplementedError
<type 'exceptions.NotImplementedError'>


>>> type(NotImplemented)
<type 'NotImplementedType'>
>>> type(NotImplementedError)
<type 'type'>

TypeError is obtained if NotImplemented is thrown, because it is not an exception. Throwing a NotImplementedError will normally catch the exception.

>>> raise NotImplemented

Traceback (most recent call last):
  File "<pyshell#10>", line 1, in <module>
    raise NotImplemented
TypeError: exceptions must be old-style classes or derived from BaseException, not NotImplementedType


>>> raise NotImplementedError

Traceback (most recent call last):
  File "<pyshell#11>", line 1, in <module>
    raise NotImplementedError
NotImplementedError

Why is there a NotImplemented and a NotImplementedError?
Sorting a list in Python often USES a comparison operation such as ___ ().
Sometimes Python’s internal algorithms choose another way to determine the comparison result, or simply choose a default result. If an exception is thrown, the sorting operation will be broken. Therefore, it will not be thrown if NotImplemented is used, thus Python can try other methods.
The NotImplemented object sends a signal to the runtime environment to tell it that if the current operation fails, it should check out other feasible methods. For example, in the expression a == b, if a. ___, eq__(b) returns NotImplemented, Python will try B. ___ (a). If the call to the method of B/eq__ can return True or False, the expression is successful. If b.__eq__(a) also fails, Python continues to try other methods, such as using! = to compare.

ref:http://www.cnblogs.com/ifantastic/p/3682268.html

[Python] urlerror: < urlopen error timed out > error

These days when I do crawler with Python, I always encounter Python URLError: < urlopen error timed out> The more threads open, the more frequently they occur. Later proved that the program did not have a problem, checked the information on the Internet, the network is blocked, more than a few times to try it.  
For example, the original code looks like this:

if headers:
		req=urllib2.Request(url,headers=headers)
	else :
		req=urllib2.Request(url)
	opener=urllib2.build_opener(cookieproc)
	urllib2.install_opener(opener)
	page=urllib2.urlopen(req,timeout=5).read()

can be changed after adding a loop:

if headers:
		req=urllib2.Request(url,headers=headers)
	else :
		req=urllib2.Request(url)
	opener=urllib2.build_opener(cookieproc)
	urllib2.install_opener(opener)
	global Max_Num
	Max_Num=6
	for i in range(Max_Num):
		try:
			page=urllib2.urlopen(req,timeout=5).read()
			break
		except:
			if i < Max_Num-1:
				continue
			else :
				print 'URLError: <urlopen error timed out> All times is failed '

This exception can generally be resolved

Android Development notes — mediaplayer error (1, – 2147483648)

Today, I recorded a pit. When I used MediaPlayer to play the video, the screen went black. Then, I saw that the system log output by the console contained a “MediaPlayer Error (1, -2147483648)”.
Then I went to the source code and found this

public interface OnErrorListener
    {
        /**
         * Called to indicate an error.
         *
         * @param mp      the MediaPlayer the error pertains to
         * @param what    the type of error that has occurred:
         * <ul>
         * <li>{@link #MEDIA_ERROR_UNKNOWN}
         * <li>{@link #MEDIA_ERROR_SERVER_DIED}
         * </ul>
         * @param extra an extra code, specific to the error. Typically
         * implementation dependent.
         * <ul>
         * <li>{@link #MEDIA_ERROR_IO}
         * <li>{@link #MEDIA_ERROR_MALFORMED}
         * <li>{@link #MEDIA_ERROR_UNSUPPORTED}
         * <li>{@link #MEDIA_ERROR_TIMED_OUT}
         * <li><code>MEDIA_ERROR_SYSTEM (-2147483648)</code> - low-level system error.
         * </ul>
         * @return True if the method handled the error, false if it didn't.
         * Returning false, or not having an OnErrorListener at all, will
         * cause the OnCompletionListener to be called.
         */
        boolean onError(MediaPlayer mp, int what, int extra);
    }

So the problem I have is the error “MEDIA_ERROR_SYSTEM”, the reason is “system version is too low error”… Then I looked it up on the Internet and found that video files are usually in MP4, AVI, etc., but even if they are in the same file format, they may have different encoding formats. For example, common coding formats are: H.264, H.263 and so on. However, many Andorid devices can only support partial encoding, which results in some videos that cannot be played on Andorid devices. If you have to play these videos, it involves the complicated operation of video transcoding… I haven’t learned this skill yet, so I’ll dig a hole and fill it up later

JAVA lambda Syntax error on tokens, Expression expected instead

Lambda is a new feature after JDK1.8, and I note that there was a problem when I first used lambda
The author USES versions: MyEclipse8.5, JDK1.8.0, and IDEA2018.2.5
When I run the following lambda code on MyEclipse, an error message appears:

package com.text;

public class Lambda {
	public static void main(String[] args) {
		Lambda lambda = new Lambda();
		lambda.oldRunable();
		lambda.runable();
	}

	public void oldRunable() {
		new Thread(new Runnable() {
			public void run() {
				System.out.println("The old runable now is using!");
			}
		}).start();
	}
	
	public void runable() {
        new Thread(()->System.out.println("It's a lambda function!")).start();
    }
}

Code line 19 reports an error:

Multiple markers at this line
    - Syntax error on tokens, Expression expected instead
    - Syntax error on token(s), misplaced construct (s)

After a search on the Internet, there was no explanation for this anomaly, and then I decided to run IDEA for a try. It turned out that the same code IDEA was not wrong, so this is for record
The author estimates that it may be because the version of MyEclipse8.5 is too low, but the author has not changed the version of MyEclipse, and I will try it again in the future. You are welcome to comment on the upgraded version, thank you