Tag Archives: ProgrammerAH

Provider: SQL network interfaces, error: 25 http://www.itsvse.com/thre


SQL 2008 R2 prompts for error (Provider: SQL Network Interfaces, Error: 25 – Connection string is invalid)

This is my first link string, so it doesn’t seem wrong

string strConn = “server=ip:1433; database=db; uid=sa; pwd=123456;”

Finally, I found that the port after IP is not separated by:, but separated by:, so the correct way to write it is:

string strConn = “server=ip,1433; database=db; uid=sa; pwd=123456;”

– this article from the architect, the original address: http://www.itsvse.com/thread-1732-1-1.html

About how to solve the 8050800c error when Windows Update updates the definition of Windows Defender

Description:
Under Windows 7 X64, when using Windows Update to Update the system, the relevant Update defined by Windows Defender malware could not be installed, and 8050800C error was always returned. At this point, when Windows Defender updates the definition, he will also report that the definition cannot be updated.
Solutions:
The following solution source: https://social.technet.microsoft.com/Forums/en-US/7b44be83-8a2e-4e3e-a851-cbc3076e4817/error-8050800c?forum=w7itprosecurity
1. Save the following as a batch file and run it in administrator mode:

@echo off

net stop bits
net stop wuauserv
net stop appidsvc
net stop cryptsvc

Del "%ALLUSERSPROFILE%\Application Data\Microsoft\Network\Downloader\qmgr*.dat"
Ren %systemroot%\SoftwareDistribution SoftwareDistribution.bak
Ren %systemroot%\system32\catroot2 catroot2.bak
sc.exe sdset bits D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)
sc.exe sdset wuauserv D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;AU)(A;;CCLCSWRPWPDTLOCRRC;;;PU)
cd /d %windir%\system32
regsvr32.exe atl.dll /s
regsvr32.exe urlmon.dll /s
regsvr32.exe mshtml.dll /s
regsvr32.exe shdocvw.dll /s
regsvr32.exe browseui.dll /s
regsvr32.exe jscript.dll /s
regsvr32.exe vbscript.dll /s
regsvr32.exe scrrun.dll /s
regsvr32.exe msxml.dll /s
regsvr32.exe msxml3.dll /s
regsvr32.exe msxml6.dll /s
regsvr32.exe actxprxy.dll /s
regsvr32.exe softpub.dll /s
regsvr32.exe wintrust.dll /s
regsvr32.exe dssenh.dll /s
regsvr32.exe rsaenh.dll /s
regsvr32.exe gpkcsp.dll /s
regsvr32.exe sccbase.dll /s
regsvr32.exe slbcsp.dll /s
regsvr32.exe cryptdlg.dll /s
regsvr32.exe oleaut32.dll /s
regsvr32.exe ole32.dll /s
regsvr32.exe shell32.dll /s
regsvr32.exe initpki.dll /s
regsvr32.exe wuapi.dll /s
regsvr32.exe wuaueng.dll /s
regsvr32.exe wuaueng1.dll /s
regsvr32.exe wucltui.dll /s
regsvr32.exe wups.dll /s
regsvr32.exe wups2.dll /s
regsvr32.exe wuweb.dll /s
regsvr32.exe qmgr.dll /s
regsvr32.exe qmgrprxy.dll /s
regsvr32.exe wucltux.dll /s
regsvr32.exe muweb.dll /s
regsvr32.exe wuwebv.dll /s


netsh winsock reset

netsh winhttp reset proxy

net start bits
net start wuauserv
net start appidsvc
net start cryptsvc



wuauclt /Updatenow

2. Manually download from here the latest definition library for the corresponding native system version of Windows Defender to install. Note: it is normal for downloaded files to run without any prompt.
3. Manually download the corresponding local system version of KB3177467 patch from here for installation.
4. Manually download the Windows Update troubleshooter from here and run it until it runs out.
5. After running all the above steps, restart the computer.
6. Open Windows Update in the control panel and repeatedly check for updates until no updates are available

Could not find appears when JDK is configured java.dll Could not find Java se runtime environment problems

Error: could not find java.dll
Error: could not find Java Runtime Environment after installing the JDK before and after installing the new version.
There are two ways to do it

    rename C:\Program Files (x86)\Common Files\Oracle\Java\javapath java.exe put the system variable in the Path of %JAVA_HOME%\bin; Put in front of C:\Program Files (x86)\Common Files\Oracle\Java\javapath

I saw some bloggers who said that 1 didn’t work and 2 worked, but I used 1 and 2 didn’t work, so I could try both

Apache [error] server reached MaxClients setting, consider raising the MaxClients setting

Recently, a company customer reported a problem with an error message in the Apache log /var/log/ HTTPD /error_log file after running for a while

[Fri Jul 29 15:45:37 2016] [error] server reached MaxClients setting, consider raising the MaxClients setting

I checked that this was due to the number of concurrent links. Later, I checked the Apache documentation and found that I could modify the Apache configuration file
The/etc/HTTPD/conf/HTTPD. Conf the MaxClients parameter to adjust.
In adjusting the first thing to check before running apache is a kind of mode is prefork or worker, use “/ usr/sbin/HTTPD -l” command to check, after checking out what kind of pattern, you can find the/etc/HTTPD/conf/HTTPD. Corresponding to the configuration of the part to modify the conf.

# httpd -l
Compiled in modules:
  core.c
  prefork.c
  http_core.c
  mod_so.c

Change the parameters and put them in

<IfModule prefork.c>  
StartServers       8  
MinSpareServers    5  
MaxSpareServers   20  
ServerLimit      256  
MaxClients       256  
MaxRequestsPerChild  4000  
</IfModule> 

Modified to

<IfModule prefork.c>  
StartServers     8  
MinSpareServers  5  
MaxSpareServers  20  
ServerLimit     1024  
MaxClients      1024  
MaxRequestsPerChild  50  
</IfModule>

Then restart Apache “Service HTTPD Restart”.
The meaning of parameters is explained in detail in the Apache configuration, as follows:

# prefork MPM  
# StartServers: number of server processes to start  
# MinSpareServers: minimum number of server processes which are kept spare  
# MaxSpareServers: maximum number of server processes which are kept spare  
# ServerLimit: maximum value for MaxClients for the lifetime of the server  
# MaxClients: maximum number of server processes allowed to start  
# MaxRequestsPerChild: maximum number of requests a server process serves  
# worker MPM  
# StartServers: initial number of server processes to start  
# MaxClients: maximum number of simultaneous client connections  
# MinSpareThreads: minimum number of worker threads which are kept spare  
# MaxSpareThreads: maximum number of worker threads which are kept spare  
# ThreadsPerChild: constant number of worker threads in each server process  
# MaxRequestsPerChild: maximum number of requests a server process serves  

bad index file sha1 signature fatal

Sometimes sourceTree prompts a “Bad Index File Sha1 Signature fatal: index file corrupt” error while performing operations such as Commit or REVERT, causing the operation to fail. This is due to an error in Git’s index file. You need to delete the.git/index file and then run Git Reset in the repository directory to regenerate the index file. Git Reset can also delete information that is committed but not pushed.
$ git status
Error: bad index File sha1 signature fatal:
index file corrupt
First delete the index file $
Rm – f. git/index
$ git reset

Ctypes loading DLL error oserror: [winerror 126] the specified module could not be found

Python calls BaiduFaceApi. DLL

import ctypes
dllBaiduFaceApi = ctypes.cdll.LoadLibrary("../x64/BaiduFaceApi.dll")

Error message:

Traceback (most recent call last):

  File "<ipython-input-12-6f7ace0c1603>", line 1, in <module>
    runfile('xxx/main.py', wdir='xxx')

  File "x:\ProgramData\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 704, in runfile
    execfile(filename, namespace)

  File "x:\ProgramData\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 108, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

  File "xxx/main.py", line 15, in <module>
    dllBaiduFaceApi = ctypes.CDLL("../x64/BaiduFaceApi.dll")

  File "x:\ProgramData\Anaconda3\lib\ctypes\__init__.py", line 356, in __init__
    self._handle = _dlopen(self._name, mode)

OSError: [WinError 126] The specified module could not be found

The reason for the error is that baidufaceapi.dll relies on other DLLS in the X64 folder, but the Python process could not find it.
Solutions:

    modify the current working path:
os.chdir("../x64")

This approach is available in the Base environment of Anaconda, but not in the virtual environment.

    modify the system environment variable PATH, in which absolute PATH “(XXX /x64) “

is added

“Fatal error: Unable to find local grunt.” when running “grunt” command

Download locally
> npm install grunt
> grunt
Command line run: Grunt, the following problem occurs:

 
 
These are referenced in Gruntfile.js and installed in turn:
npm install grunt-contrib-copy
npm install grunt-contrib-concat
NPM install grunt – contrib – uglify
NPM install grunt – CSS
 

Reproduced in: https://www.cnblogs.com/holy-amy/p/6882540.html

RESTORE detected an error on page (0:0) in database

The following error was encountered while the test server was restoring a database on the production server:
System. The Data. SqlClient. SqlError: RESTORE detected an error on the page (0-0) in database “XXXX” as read from the backup set. (Microsoft) is essentially) SmoExtended)
To validate the database Backup (Verfify Backup Media), submitted to the following error:
Backup Media verification failed: XXXXX (Microsoft. Essentially. Management RelationalEngineTasks)
Since the backup file was uploaded from HK with FileConnect, it is possible that intermediate network problems or other factors may cause the backup file to be corrupted, because FileConnect has been used to extract files and find corrupt files. The system administrator has given me a way to verify whether the files obtained from FileConnect are corrupted. First, compress the database backup files, then upload to FileConnect, and then get the compressed files from the database backup from above. If the unzips are normal, the files are not corrupted. During the test, the file was found to be corrupted.

 

Reproduced in: https://www.cnblogs.com/kerrycode/p/4346636.html

HTTP error code compact version

IIS status code editing under HTTP
1XX – Information prompt
These status codes represent temporary responses. The client should be prepared to receive one or more 1XX responses before receiving the general response.
100 – Go ahead.
101 – Switch protocol.
2 xx – success
This type of status code indicates that the server has successfully accepted the client request.
200 – Ok. The client request has been successful.
201 – Created.
202 – Accepted.
203 – Non-authoritative information.
204 – No content.
205 – Reset content.
206 – Part content.
3XX – Redirection
The client browser must do more to implement the request. For example, a browser might have to request a different page on the server or repeat the request through a proxy server.
301 – The object has been permanently removed, that is, permanently redirected.
302 – The object has been temporarily moved.
304 – Not modified.
307 – Temporary redirection.
4XX – Client error
An error has occurred and there seems to be a problem with the client. For example, if the client requests a page that does not exist, the client does not provide valid authentication information. 400 – Wrong request.
401 – Access denied. IIS defines a number of different 401 errors that point to a more specific reason for the error. These specific error codes are displayed in the browser but not in the IIS log:
401.1 – Login failed.
401.2 – Server configuration causes logon failure.
401.3 – not authorized due to ACL restrictions on resources.
401.4 – Filter authorization failed.
401.5 – ISAPICGI application authorization failed.
401.7 – Access is denied by the URL authorization policy on the Web server. This error code is dedicated to IIS 6.0.
403 – Access disabled: IIS defines a number of different 403 errors that point to a more specific reason for the error:
403.1 – Execute access is prohibited.
403.2 – Read access is prohibited.
403.3 – Write access is prohibited.
403.4 – SSL is required.
403.5 – SSL 128 is required.
403.6 – IP address rejected.
403.7 – Client certificates are required.
403.8 – Site access denied.
403.9 – Too many users.
403.10 – Invalid configuration.
403.11 – Password change.
403.12 – Denied access to the mapping table.
403.13 – Client certificate revoked.
403.14 – Reject directory listing.
403.15 – Client access permission is exceeded.
403.16 – The client certificate is untrusted or invalid.
403.17 – Client certificate has expired or is not in effect.
403.18 – The requested URL cannot be executed in the current application pool. This error code is dedicated to IIS 6.0.
403.19 – CANNOT perform CGI for clients in this application pool. This error code is dedicated to IIS 6.0.
403.20 – Passport login failed. This error code is dedicated to IIS 6.0.
404 – Not found.
404.0 – (none) – No files or directories were found.
404.1 – The Web site cannot be accessed on the requested port.
404.2 – The Web services Extension locking policy blocks this request.
404.3-MIME mapping policy blocks this request.
405 – HTTP predicates used to access this page are not allowed (methods are not allowed)
406 – The client browser does not accept the MIME type of the requested page.
407 – Proxy authentication is required.
412 – Prerequisites failed.
413 – The requesting entity is too large.
414 – Request URI is too long.
415 – Unsupported media type.
416 – The requested scope cannot be satisfied.
417 – Execution failed.
423 – Locking error.
5XX – Server error
The server was unable to complete the request due to an error.
500 – Internal server error.
500.12 – The application is busy restarting on the Web server.
500.13 – The Web server is too busy.
500.15 – Direct requests to Global.asa are not allowed.
500.16 — The UNC authorization credentials are incorrect. This error code is dedicated to IIS 6.0.
500.18 – THE URL authorization store cannot be opened. This error code is dedicated to IIS 6.0.
500.100 – Internal ASP error.
501 – The header value specifies an unimplemented configuration.
502 – The Web server received an invalid response while using it as a gateway or proxy server.
502.1 – CGI application timeout.
502.2 – CGI application error. application.
503 – Service unavailable. This error code is dedicated to IIS 6.0.
504 – Gateway timeout.
The 505-HTTP version is not supported.

Reproduced in: https://blog.51cto.com/cold2076goddess/1432464

Difference between isempty method and isblank method in stringutils

preface
When we say a string is empty, it’s just an empty array with no characters. Such as:

String a = "";

A can be called an empty string. Since String is stored as a char array underneath Java, the null String is represented as a char array

private final char value[] = new char[0];

But in actual work, we need to do some validation on the string, such as: whether null, whether null, whether to remove Spaces, line breaks, TAB characters and so on is not empty. We usually make these judgments through the framework’s utility classes, such as the Apache Commons JAR package. Here are two common string validation methods and their differences.
PS: in the process of writing project, recently found that a lot of places to be sentenced to empty operation, then can sometimes be invocation chain is longer, if use the if the else come to empty, empty code will be more light, this is not good for later maintenance, and we found empty may not consider a scene, this will result in a null pointer. I now strongly recommend using the third party JAR’s utility classes to do this. For example, take the value of a key from a Map, you can use MapUtils class; Use the StringUtils class for nulling strings; Nulling a collection using CollectionUtils and so on. These classes are available through the introduction of apache’s Commons package family.
isEmpty()

public static boolean isEmpty(String str) {        
    return str == null || str.length() == 0;
}

isBlank()

public static boolean isBlank(String str) {
        int strLen;
        if (str != null && (strLen = str.length()) != 0) {
            for(int i = 0; i < strLen; ++i) {
                if (!Character.isWhitespace(str.charAt(i))) {    
                    return false;
                }
            }
            return true;
        } else {
            return true;
        }
    }

conclusion
Through the comparison of the above codes, we can see:
1. IsEmpty does not ignore the space parameter, based on whether it isEmpty and whether it exists.

2. IsBlank is a judgment on isEmpty (strings are Spaces, tabs, TAB) based on isEmpty. (more commonly used)

you can look at the following example to feel.

StringUtils.isEmpty("yyy") = false
StringUtils.isEmpty("") = true
StringUtils.isEmpty("   ") = false
 
StringUtils.isBlank("yyy") = false
StringUtils.isBlank("") = true
StringUtils.isBlank("   ") = true