Tag Archives: git

Git error: unlink of file ‘xxx’ failed.Should I try again?

git error: Unlink of ‘XXX’ failed.Should I try again?

as shown in the figure:

occurs when git switches code branches, indicating that a file has been modified and needs to be committed, but there is no modification.

because git maintenance management code is used by other programs, such as IDE (Android Studio, etc.). The solution is to close the program IDE or use the application of the program code.

Remote: http basic: access denied, fatal: authentication failed for error resolution: wrong password

encountered a problem with git denied, fatal: remote: HTTP Basic: Access denied, fatal: Authentication failed for.

searches for a number of solutions that don’t work, including deleting credentials and retyping the git account name password.

later, I tried to log in git with the git password I filled in when I clone git, but the result gave an error, saying that the password was incorrect.

then I analyzed and found that the git drop code gave an error, because when I was creating git, I did not notice that the capital lock was opened. The password I entered was A123456, but I thought it was A123456. Then when logging into git account, I chose “remember account name and password” and did not enter it manually. Then, the Git password I entered when Git Clone pulled the code was a123456.

this caused me to fail to pull the code, and I never found the problem. The question puzzled me for two days. (I only noticed this when I had a brainwave and chose to enter my password manually to log into Git accounts.)

therefore, if all other possibilities have been ruled out, check your git account and password to see if they are correct.

, I hope that helps you.

How to Fix com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed

2019 unicorn enterprise to recruit Python engineer standard > > >

record import Google android case error solution is as follows: the android. Builder. Internal. The aapt. V2. Aapt2Exception: android resource linking failed

is as follows:

Android resource linking failed
Output:  /Users/chmy/git/android/googlesamples/android-MessagingService/Application/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:221: error: resource android:attr/fontStyle not found.
/Users/chmy/git/android/googlesamples/android-MessagingService/Application/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:222: error: resource android:attr/font not found.
/Users/chmy/git/android/googlesamples/android-MessagingService/Application/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:223: error: resource android:attr/fontWeight not found.
/Users/chmy/git/android/googlesamples/android-MessagingService/Application/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:224: error: resource android:attr/fontVariationSettings not found.
/Users/chmy/git/android/googlesamples/android-MessagingService/Application/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:225: error: resource android:attr/ttcIndex not found.
error: failed linking references.

Command: /Users/chmy/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.0-4818971-osx.jar/cc4633529fe8cee26cd686b6b28203cf/aapt2-3.2.0-4818971-osx/aapt2 link -I\
        /Users/chmy/Library/Android/sdk/platforms/android-24/android.jar\
        --manifest\
        /Users/chmy/git/android/googlesamples/android-MessagingService/Application/build/intermediates/merged_manifests/debug/processDebugManifest/merged/AndroidManifest.xml\
        -o\
        /Users/chmy/git/android/googlesamples/android-MessagingService/Application/build/intermediates/processed_res/debug/processDebugResources/out/resources-debug.ap_\
        -R\
        @/Users/chmy/git/android/googlesamples/android-MessagingService/Application/build/intermediates/incremental/processDebugResources/resources-list-for-resources-debug.ap_.txt\
        --auto-add-overlay\
        --java\
        /Users/chmy/git/android/googlesamples/android-MessagingService/Application/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r\
        --custom-package\
        com.example.android.messagingservice\
        -0\
        apk\
        --output-text-symbols\
        /Users/chmy/git/android/googlesamples/android-MessagingService/Application/build/intermediates/symbols/debug/R.txt\
        --no-version-vectors
Daemon:  AAPT2 aapt2-3.2.0-4818971-osx Daemon #0

there is a lot of talk on the web about adding a configuration to gradle.properties, but the addition is not solved.

solution: the compiled version is not configured correctly. Original version number:

android {
    //
    compileSdkVersion 24

    buildToolsVersion '28.0.3'

    defaultConfig {
        minSdkVersion 21
        targetSdkVersion 24

    }
...

after modification:

android {
    // 
    compileSdkVersion 28

    buildToolsVersion '28.0.3'

    defaultConfig {
        minSdkVersion 21
        targetSdkVersion 28

    }

compiles again, and the problem is resolved. This is the solution I came across, others are not met for the time being.

reproduced in: https://my.oschina.net/who7708/blog/2236811

Installation and use of XmR stak CPU

XMR stak – CPU install

xmr-stak-cpu is an open source software used for calculation of CPU , the following is recorded in the installation process

under ubuntu17.04

sudo apt-get -y install git
git clone https://github.com/fireice-uk/xmr-stak-cpu.git
sudo apt-get -y install libmicrohttpd-dev libssl-dev cmake build-essential
cd xmr-stak-cpu/

at this point you can select the proportion of contributors to donate
edit donate-level. H

After the

changes are complete, compile and install

cmake -DHWLOC_ENABLE=OFF .
make install

XMR stak – CPU use

edit XMR - stak - CPU/bin/config. TXT

cat /proc/cpuinfo | grep processor view total number of threads n

change cpu_threads_conf into the following content, threads quantity is about CPU total number of threads 2/3,
to use e5-2665 for example, a total of 0 161 threads, using 2 103 threads with the highest efficiency.

"cpu_threads_conf" :
[
   { "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 0 },
   { "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 1 },
   { "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 2 },
   { "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 3 },
   { "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 4 },
   { "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 5 },
   { "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 6 },
   { "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 7 },
   { "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 8 },
   { "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 9 },
],

if using nicehash, it is recommended to set "nicehash_nonce" : true,

change address and other information (nicehash for example)

"pool_address" : "cryptonight.hk.nicehash.com:3355",
"wallet_address" : "your-bitcoin-wallet-address.any-name-you-like",
"pool_password" : "x",

then, under xmr-stak-cpu/bin folder execute ./xmr-stak-cpu is ready to calculate
press h key display rate (the first few seconds may be 0, don't worry)

MEMORY ALLOC FAILED: mmap failed

may show that MEMORY ALLOC FAILED: mmap FAILED
problem does not need to be solved, because the measurement on the author's machine has no effect, but the following solution is still provided.
solution:

sudo sysctl -w vm.nr_hugepages=128

in addition, the /etc/security/limits the conf add

* soft memlock 262144
* hard memlock 262144

exit and log back in

background run

everything is in place, let the program run in the background
nohup./xmr-stak-cpu &
and then CTRL c exit

run top to see

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND     
25706 svr       20   0 1044224  20616   7136 S 998.7  0.3   8:42.80 xmr-stak-cpu
25720 svr       20   0   46076   4224   3464 R   0.3  0.1   0:00.23 top         
    1 root      20   0  205088   7436   5436 S   0.0  0.1   0:05.40 systemd  

The

program is running correctly in the background.

You need to resolve your current index first

A branch from A switch to another branch B, to pull switch B branch after the operation, because of the pull actually contains the fetch + the merge operation, when performing the merge operation, due to long time no out the pull of B branch/merge operation, the local treasuries and remote B B difference is very big in the subsidiary (and these differences is the development of other colleagues files), when the merge conflict, causing the B branch state for merging, actually refers to the failed to merge, Stuck in the merge state, and unable to perform pull operations. Instead of resolving the conflict, instead of executing checkout/switchto from the B branch and attempting to switchto another branch, the report is:
[plain] view plaincopy in CODE looks at the CODE slice that is descended to my CODE slice

… Java: needs merge
…… Java: needs merge
…… Java: needs merge
error: you need to resolve your current index first

>, googled for a long time, finally found the answer on stackoverflow, the question is: merge failed, due to conflicts, can:

1, execute merge again after conflicts;

2, back to merge

well, since the merge conflict is a colleague’s file, I don’t need to resolve conflicts, then back to merge, just change my file and push, run the following code:

git reset –merge

done!

by the way, could you stick the stackoverflow links:

http://stackoverflow.com/questions/6006737/git-merge-errors

Idea method of modifying git account and password

IDEA how to modify git account and password:
1, file-> settings-> passwords

2. Restart IDEA

3, perform a submit or update
when the submit or update is performed, idea will automatically prompt for the account and password as follows:

4, if the above can not be modified, please try the following way
solution: control panel -> User account -& GT; Manage your credentials

Error: failed to push some refs to ‘xxx’

modified part of the project today, and then pushed origin master to the remote warehouse with git, the following error was reported:

error: failed to push some refs to 'https://github.com/ZJyoung1997/JZShop.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

The reason is that the files in the remote warehouse are different from our local warehouse. For example, your remote warehouse has a file readme.md, but the local warehouse does not. mine is caused by having the readme.md file in the remote warehouse and not having it in the local warehouse. In addition, I usually use the association's computer to develop, and then use my own computer to develop after I return to the dormitory, which may also be the cause of this problem. In this case, the solution would be to clone the local repository directly and then clone it from the remote repository, but this would be too cumbersome, and the branch merge method

could be used

solution:
git pull --rebase origin master

The

git pull command is used to get and integrate (consolidate) from another repository or local branch, fetch updates to a branch on the remote host, and merge with the local specified branch.

if the following error is reported, you can also use the git pull command

fatal: 'master' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

with git pull origin master - allow - unrelated - nothing solution

Git pull undo misoperation

git pull undo error

originally wanted to merge the newpbft on github into the local newpbft branch. Since I did not check the current branch, I directly used the git pull origin newpbft, but the newpbft was merged into the master branch.

solution

1, run the git reflog command to view your history of changes, as follows:

fdb70fe HEAD@{0}: pull origin newpbft: Fast-forward
40a9a83 HEAD@{1}: checkout: moving from guan to master
b3fa4c3 HEAD@{2}: commit: copy from newpbft, first init
71bf0ec HEAD@{3}: checkout: moving from newpbft to guan
71bf0ec HEAD@{4}: commit: 1. add moveStore() to clean up certStore and blockStore.
1006d67 HEAD@{5}: commit: 1. Add PBFT branch to Puppeth.
fa3fb56 HEAD@{6}: commit: 1. change some errors about packages and vars
5f40fdc HEAD@{7}: checkout: moving from master to newpbft
40a9a83 HEAD@{8}: clone: from https://github.com/yeongchingtarn/geth-pbft.git

2, then use git reset --hard HEAD@{n}, (n is the reference to which you want to fall back) to fall back.

For example, in the figure above, git reset --hard 40a9a83

Python automatically generates the requirements file for the current project

python automatically generates the requirements file for the current project

there are several ways:

1. Use PIP freeze

< pre style=”margin: 0px 0px 15px; padding: 0px; font-family: “Courier New” ! important; font-size: 12px ! important; The line – height: 1.72222; color: inherit; white-space: pre; border-radius: 6px; overflow-wrap: break-word;” > pip freeze > requirements.txt< /pre>

this way is to list the packages in the entire environment, if it is a virtual environment. In general, we only need to export the current project’s requirement.txt, and pipreqs

is recommended
2. Use pipreqs

is a helpful tool that scans the project directory to automatically discover which libraries are used, automatically generates dependency listings, and only generates project-related dependencies to requirements. TXT

installation

< pre style=”margin: 0px 0px 15px; padding: 0px; font-family: “Courier New” ! important; font-size: 12px ! important; The line – height: 1.72222; color: inherit; white-space: pre; border-radius: 6px; overflow-wrap: break-word;” > pip install pipreqs< /pre>

Use

also easy to use pipreqs pathname
here goes directly to the project root directory, so it is./
error

File "c:\users\devtao\appdata\local\programs\python\python36-32\lib\site-packages\pipreqs\pipreqs.py", line 341, in init
    extra_ignore_dirs=extra_ignore_dirs)

  File "c:\users\devtao\appdata\local\programs\python\python36-32\lib\site-packages\pipreqs\pipreqs.py", line 75, in get_all_imports
    contents = f.read()

UnicodeDecodeError: 'gbk' codec can't decode byte 0xa6 in position 186: illegal multibyte sequence

UnicodeDecodeError: ‘GBK’ codec can’t decode byte 0xa6 in position 186: illegal multibyte sequence
directly modify line 407 of pipreqs.py, change encoding to utf-8, save, and run on pipreqs./
pipreqs.py path

C:\Users\linxiao\AppData\Local\Programs\Python\Python37\Lib\site-packages\pipreqs