Author Archives: Robins

An error occurred when running ROCR: Failed to load the package ‘caTools’, package or namespace load failed

If it helps, thank thumb up for the encouragement
The environment is win10+R3.6.3
, the problem has been solved, and the Error is reported as follows:
loading required package: gplot Error: package or namespace load failed for 'gplot' in loadNamespace(j < -i [[1L]], c(lib.loc,.libpaths (), versionCheck = vI[[j]): there is no package error called 'caTools' : failed to load the package' gpaths '
There has been a problem this morning, which is strange. CaTools could not be installed in Rstudio and I have already packed the plots, so I guess it’s caTools’ problem.

    USES general method one, not ok:
    directly click Rstudio, click install and then enter caTools is not ok. Use method 2, no:
install.packages("caTools")
    use method three, first download the resources and then local installation, successfully solved.

First find caTools resource location, address is as follows:
https://cran.r-project.org/web/packages/caTools/
and then on the page, right click to get the resource bundle links, return to Rstudio, enter the following two lines of code, run successfully solve the problem of caTools installation.

packageurl <- "https://cran.r-project.org/bin/windows/contrib/4.0/caTools_1.18.0.zip"

install.packages(packageurl, repos=NULL, type="source")

It should be added that if a package has not been installed, baidu searches for the package, such as "R installs caTools". We then see if our dependent packages are configured so that we can have a second way to look at them, in addition to the ones that the console output lacks.
Refer to the blog:
https://blog.csdn.net/ARPOSPF/article/details/84997200 https://blog.csdn.net/zdx1996/article/details/86629965

Maven compilation error Checksum validation failed, error in opening zip file

Problem: Error reporting MVN compile time
1) Checksum Validation Failed, expected < ! DOCTYPE but is c53aeb6e9e798502f6e4d9283b4747c24ceba6f5.
2) read/Users/m2/repository/com/alibaba/druid/1.0.20/druid – 1.0.20. An error occurred when the jar; error in opening zip file

[INFO] --------------------------------[ jar ]---------------------------------
Downloading from codelds: https://code.lds.org/nexus/content/groups/main-repo/org/springframework/spring-core/4.2.6.RELEASE/spring-core-4.2.6.RELEASE.pom
Downloaded from codelds: https://code.lds.org/nexus/content/groups/main-repo/org/springframework/spring-core/4.2.6.RELEASE/spring-core-4.2.6.RELEASE.pom (0 B at 0 B/s)
[WARNING] The POM for org.springframework:spring-core:jar:4.2.6.RELEASE is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
Downloading from codelds: https://code.lds.org/nexus/content/groups/main-repo/org/springframework/spring-core/4.2.6.RELEASE/spring-core-4.2.6.RELEASE.jar
[WARNING] Checksum validation failed, expected <!DOCTYPE but is c53aeb6e9e798502f6e4d9283b4747c24ceba6f5 from codelds for https://code.lds.org/nexus/content/groups/main-repo/org/springframework/spring-core/4.2.6.RELEASE/spring-core-4.2.6.RELEASE.jar
[WARNING] Could not validate integrity of download from https://code.lds.org/nexus/content/groups/main-repo/org/springframework/spring-core/4.2.6.RELEASE/spring-core-4.2.6.RELEASE.jar: Checksum validation failed, expected <!DOCTYPE but is c53aeb6e9e798502f6e4d9283b4747c24ceba6f5
[WARNING] Checksum validation failed, expected <!DOCTYPE but is c53aeb6e9e798502f6e4d9283b4747c24ceba6f5 from codelds for https://code.lds.org/nexus/content/groups/main-repo/org/springframework/spring-core/4.2.6.RELEASE/spring-core-4.2.6.RELEASE.jar
Downloaded from codelds: https://code.lds.org/nexus/content/groups/main-repo/org/springframework/spring-core/4.2.6.RELEASE/spring-core-4.2.6.RELEASE.jar (7.5 kB at 1.9 kB/s)

. . . .
[ERROR] Error while reading /Users/.m2/repository/com/alibaba/druid/1.0.20/druid-1.0.20.jar; error in opening zip file
[ERROR] Error reading /Users/.m2/repository/org/hibernate/hibernate-core/4.3.11.Final/hibernate-core-4.3.11.Final.jar; error in opening zip file
[ERROR] Error reading /Users/.m2/repository/org/hibernate/hibernate-ehcache/4.3.11.Final/hibernate-ehcache-4.3.11.Final.jar; error in opening zip file
[ERROR] Error reading /Users/.m2/repository/org/quartz-scheduler/quartz/2.2.2/quartz-2.2.2.jar; error in opening zip file
[ERROR] Error when reading /Users/.m2/repository/com/oracle/ojdbc6/11.2.0.3/ojdbc6-11.2.0.3.jar; error in opening zip file
[ERROR] Error reading /Users/.m2/repository/com/alibaba/druid/1.0.20/druid-1.0.20.jar; error in opening zip file
[ERROR] Error reading /Users/.m2/repository/org/hibernate/hibernate-core/4.3.11.Final/hibernate-core-4.3.11.Final.jar; error in opening zip file
[ERROR] Error reading /Users/.m2/repository/org/hibernate/hibernate-ehcache/4.3.11.Final/hibernate-ehcache-4.3.11.Final.jar; error in opening zip file
[ERROR] Error reading /Users/.m2/repository/org/quartz-scheduler/quartz/2.2.2/quartz-2.2.2.jar; error in opening zip file
[ERROR] Error when reading /Users/.m2/repository/com/oracle/ojdbc6/11.2.0.3/ojdbc6-11.2.0.3.jar; error in opening zip file

Analysis:
Asked under Baidu, said the JAR package download problem, may be the permission of what the problem, Blah blah blah…
Solution:
Watch the pom project, refers to the remote warehouse, https://code.lds.org/nexus/content/groups/main-repo,
Browser view found that the site is being maintained, so changed the address of the remote warehouse, with the central warehouse to download the compilation can be;

Mobile development: prompt ‘Task failed with exit 1 signal 0 {…’ error

Task failed with exit 1 signal 0 {… ‘
This is a problem caused by the failure of key string verification. Follow the following steps to deal with it
1. Close Xcode
2, open the ‘key string access’ program
3. Drag your developer credentials from the Login page to the Systems page.
4. After dragging, the key string and key will be prompted. The selection is always allowed
5. Recompile the APP, and the problem will be solved
 
https://stackoverflow.com/questions/41205250/swift-sdtlib-tool-error-task-failed-with-exit-code-1

ssh port forwarding

Haihan Zhou July 2, 2010

Goddady’s Linux virtual host is used to provide SSH. However, when using SSH-D port XXX @server, I encountered the following error of SSH printing:

channel 3: open failed: administratively prohibited: open failed

When the Firefox browser is configured with SOCKS5 pointing to a local port, browsing any web page appears blank.
What is the reason for this?
SSH, open sSHd_config and have a look.

cat /etc/ssh/sshd_config

There was a row:

AllowTcpForwarding no

The original host set the TCP port forwarding for SSH to be disabled. That wants to use SSH as agent to carry out port forwarding is certainly unsuccessful.
Look at the system configuration again, also prohibit IP forwarding;

cat /etc/sysctl.conf | grep ip_forward
net.ipv4.ip_forward = 0

Therefore, the virtual host prompt port forwarding is prohibited, normal.

TNS-12545: Connect failed because target host or object does not exist

TNS-12545: Connect failed because target host or object does not exist

Scenario: Change the Linux host name, restart the machine, and start listening for errors
$ lsnrctl start
LSNRCTL for Linux: Version 12.1.0.2.0-production on 26-jul-2017 09:53:42
Copyright (c) 1991, 2014,
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP))(PORT=1521)))
nss-12545: Connect failed because target host or object does not exist
tns-12560: TNS:protocol adapter error
tns-00515: Connect failed because target host or object does not exist
Linux error: 111: Connection container to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
……

solution:
because only the hostname of the machine is changed, but the host and listlisteners. Ora files are not changed. Ora
modify the host file
$vi /etc/hosts
#127.0.0.1 localhost localhost4 localhost4. Localdomain4
#::1 localhost localhost.localdomain Localhost6 localhost6. Localdomain6
127.0.0.1 localhost MWDS
192.168.78.17 meng

modify the listener.
$vi ora file/u01/app/oracle/product/12.1/db1/network/admin/listener. Ora.
# listener ora Network Configuration File:/u01/app/oracle/product/12.1/db1/network/admin/listener. Ora
# Generated by oracle configuration tools.

the listener =
(DESCRIPTION_LIST =
(the DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = meng)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)

restart the machine
# reboot

The HOST for tnsnames.ora on the machine also needs to be changed, but the IP address is recommended for this file.

SFINAE of C++ idioms

What is SFINAE’s usage?
Before we get to SFINAE, let’s look at a piece of code, and it all starts with this piece of code.

template <typename T>
void show(typename T::iterator x, typename T::iterator y) {
    for (; x != y; ++x) cout << *x << endl;
}
int main() {
    show<int>(16, 18);
}

When you compile the above code, you will find that it fails to compile and you will get the following error.

sfinae.cc:13:21: error: no matching function for call to ‘show(int, int)’
     show<int>(16, 18);
                     ^
sfinae.cc:6:6: note: candidate: template<class T> void show(typename T::iterator, typename T::iterator)
 void show(typename T::iterator x, typename T::iterator y)
      ^
sfinae.cc:6:6: note:   template argument deduction/substitution failed:
sfinae.cc: In substitution of ‘template<class T> void show(typename T::iterator, typename T::iterator) [with T = int]’:
.................

To be clear, this error means that your template parameter type cannot be found; the template parameter is required to be a class type, and has an iterator class internal type. And then int doesn’t satisfy this requirement. No matching declaration was found so the following error was reported. It is easy to fix this error by adding an overload to the template as follows:

template <typename T>
void show(T a, T b) {
    cout << a << "; " << b << endl;
}

At this point the above code can run normally. This Is the so-called SFINAE solution, full name Is “Substitution Failure Is Not An Error,” this Is a feature of the compiler, for example when the compiler tries to according to the show (16, 18) , T to find: : iterator , this type of template matching found themselves unable to replace, it cause the compiler to sell the wrong then abruptly, but the compiler chose to ignore this Error and continue to find, Throw an error if you can't find anything by the end of all searches. This is called the SFINAE method. So the question is, what are the USES of SFINAE?", listen to the following analysis.
An example of SFINAE
SFINAE can be used to determine whether a type has an Iterator during compilation, as follows:

template <typename T>
struct has_iterator {
    template <typename U>
    static char test(typename U::iterator* x);
    template <typename U>
    static long test(U* x);
    static const bool value = sizeof(test<T>(0)) == 1;
};

In the above code, there are two test function templates, when the first one is matched, the char type is returned, so the size is 1, the value is true, when the second one is matched, the value is long, so the size is definitely not 1, and the value is false. This is a neat way to determine at compile time whether a type supports Iterator or not. Here is the test code:

int main() {
   has_iterator<vector<int> > test;
   if( test.value )
       cout << "vector have iterator" << endl;
   else
       cout << "vector not have iterator";
   has_iterator<int> test2;
   if( test2.value )
       cout << "int have iterator" << endl;
   else
       cout << "int not have iterator" << endl;

}

SFINAE in Boost/Standard library
SFINAE features are heavily used in boost and standard libraries, typically such as STD ::enable_if, STD ::is_class, STD ::void_t, etc. A large number of type traits are also heavily used in C++11. The following is the specific implementation of is_class :

template<typename T>
class is_class {
    typedef char yes[1];
    typedef char no [2];
    template<typename C> static yes& test(int C::*); // selected if C is a class type
    template<typename C> static no&  test(...);      // selected otherwise
  public:
    static bool const value = sizeof(test<T>(0)) == sizeof(yes);
};

If it's a class, it matches the function that returns yes, and then value is true. This example is basically the same as the example above.

Failed to decrypt protected XML node “DTS:Password” with error 0x8009000B “Key not valid for use in …

Solutions:

    using the configuration file, put the information such as password in a configuration file, run the package when read from the configuration file (the configuration file is best stored in a safe place) to replace the ProtectionLevel that package EncryptSensitiveWithPassword and set the password, open CommandLines after deployment, will be prompted for a password, after input, run the package successfully. After deployment, enter DataSource, check the required DataSource, and then enter CommandLines. The previously selected DataSource will be automatically generated in it, and Password will be edited into it.

The first is a formal approach, good security, but more troublesome, because to deploy to a remote server, but do not have the authority to put configuration files into this server, so temporarily unable to adopt this approach.
The latter two are gradually tried out by myself. They are simple and not safe (especially the third one).

Reproduced in: https://www.cnblogs.com/Muller/archive/2012/02/16/2354377.html

Git push “fatal: Authentication failed ”

Git pushed “Fatal: Authentication failed”
Question why
You set up two-step validation earlier

 If you enabled two-factor authentication in your Github account you won't be able to push via HTTPS using your accounts password. Instead you need to generate a personal access token. This can be done in the application settings of your Github account. Using this token as your password should allow you to push to your remote repository via HTTPS. Use your username as usual.

The solution
Update the branch

git remote -v 
git remote remove origin 
git remote add origin [email protected]:user/repo.git  

## Resources
[1].Git push results in “Authentication Failed”

Reproduced in: https://www.cnblogs.com/OneFri/p/11123584.html

An idea to solve Warning move_uploaded_file, failed to open stream in the process of php uploading files

Warning Move_uploaded_file failed to open stream
Problem description:
Do not know to have people with PHP upload files and encounter this kind of situation, when faced with this situation, I checked the Internet all kinds of information folder permissions are said not to, need to chmod 757, but not this command in the Windows, also have said need to change tmp_dir, but the answers are not change warning, so I carefully observed the tip mistakes, find a solution.

Solutions:
No such file or directory in… I can’t find the file or folder, so I go back to the directory where the project is located. There is no directory created after the move, so there is an error. So the way to fix it is to create a folder.
The core code is as follows:

move_uploaded_file($_FILES["file"]["tmp_name"], "./uploads/" . $_FILES["file"]["name"]);

ORA-12631 / TNS-12631: Username retrieval failed

From Metalink:
Problem Description:
==================== ====== if
If you want to check the TNS-12631 error, check “sqlnet”. “You will find a TNS-12631 error.
ora-12570/TNS-12570: TNS:Package Reader Failure
ora – 12631/TNS – 12631: username retrieval failed

Problem Statement:
= = = = = = = = = = = = = = = = = = = = = = = =
These errors are related to remote authentication in NT NT (NT Transport Services).
In fact, the following parameter is set in “SQLNET. ora”:
SQLNET. AUTHENTICATION_SERVICES = (nt)
As a result, if you are logged in as a domain user and you do not have a network connection (network cable temporarily removed or laptop booted independently), you will not be able to connect to the database because authentication will attempt to reach the domain user database (primary domain controller) or BDC (backup domain controller) on the PDC.

Solution Description:
===================== ====== You can log in as an NT local user. You can disable NTS in sqlnet. by setting the following parameters:
SQLNET.AUTHENTICATION_SERVICES = (none).

Explanation:
= = = = = = = = = = = =
1. when you log in as a local user, you will be exposed to the local user database, not the remote domain user database. When NTS is disabled, you will not access the domain user database even if you are logged in as a domain user.

Translated with www.DeepL.com/Translator (free version)

How to mine Bitcoin using Alibaba Cloud and Tencent Cloud servers (ubuntu)

How to use cloud server to mine Bitcoin
Create a path to save the mining tool using the weget command. Download the mining tool and enter the command. The password is passed in as a parameter to start mining

wget http://downloads.sourceforge.net/project/cpuminer/pooler-cpuminer-2.3.2-linux-x86.tar.gz
 

1
Unzip after downloading

tar xzf pooler-cpuminer-2.3.2-linux-x86.tar.gz
 

1
The Nohup command runs in the background all the time

nohup ./minerd -a scrypt -o stratum+tcp://stratum.f2pool.com:3333 --userpass=矿池账号:密码 &
 

1
Open the default log output file in the current directory to see the mining information

[2017-06-01 18:37:37] thread 0: 260516 hashes, 4.39 khash/s
[2017-06-01 18:38:38] thread 0: 263180 hashes, 4.31 khash/s
[2017-06-01 18:39:38] thread 0: 258540 hashes, 4.32 khash/s
[2017-06-01 18:40:38] thread 0: 259468 hashes, 4.31 khash/s
[2017-06-01 18:41:39] thread 0: 258716 hashes, 4.27 khash/s
[2017-06-01 18:41:48] stratum_recv_line failed
[2017-06-01 18:41:48] Stratum connection interrupted
[2017-06-01 18:41:48] thread 0: 36928 hashes, 4.33 khash/s
[2017-06-01 18:41:48] Stratum detected new block
[2017-06-01 18:42:48] thread 0: 259920 hashes, 4.37 khash/s
[2017-06-01 18:43:48] thread 0: 262404 hashes, 4.34 khash/s
[2017-06-01 18:44:49] thread 0: 260260 hashes, 4.30 khash/s
[2017-06-01 18:45:48] thread 0: 258192 hashes, 4.35 khash/s
[2017-06-01 18:46:49] thread 0: 260880 hashes, 4.32 khash/s
[2017-06-01 18:47:48] thread 0: 259304 hashes, 4.39 khash/s