Description Resource Path Location Type Could not calculate build plan: Failure to transfer

1. Remove all failed downloads. Run the below command.

find ~/.m2 -name "*.lastUpdated" -exec grep -q "Could not transfer" {} \; -print -exec rm {} \;

2. Then right click on your project in eclipse and choose Run As -> Maven Clean and then Maven->"Update Project ...", make sure "Update Dependencies" is checked in the resulting dialog and click OK.

bash_profile from

export JAVA_HOME="$(/usr/libexec/java_home -v 1.8)"
export PATH=${PATH}:/usr/local/mysql/bin
export DROPBOX_HOME=${PATH}:/Users/gollv1/Dropbox

alias g='git '
alias gst='git status'
alias gc='git commit'
alias gco='git checkout'
alias gp='git pull'
alias gpm="git pull origin master"
alias gd='git diff'
alias gb='git branch'
alias gba='git branch -a'
alias del='git branch -d'
alias gdn='git diff --name-only'
alias db_synch='./gradlew syncUp -PrulesyncExclude='


alias acl='cd /Users/gollv1/Documents/factory/chrome\ factory/AutoClicks'
alias ssot='cd /Users/gollv1/Documents/SSOT/prpc-platform'
alias cpwd='pwd|pbcopy'


# Setting PATH for Python 3.6
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.6/bin:${PATH}"
export PATH

# [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
# if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
export PATH="/usr/local/opt/openssl/bin:$PATH"
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi

export PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH"

AJAX from vanilla javascript

function loadDoc() {
  var xhttp = new XMLHttpRequest();
  xhttp.onreadystatechange = function() {
    if (this.readyState == 4 && this.status == 200) {
     document.getElementById("demo").innerHTML = this.responseText;
    }
  };
  xhttp.open("GET""ajax_info.txt"true);
  xhttp.send();
}

How to set JAVA_HOME for Java permanently on Ubuntu Linux

You can set your JAVA_HOME in /etc/profile. But the preferred location for JAVA_HOME or any system variable is /etc/environment.

Open /etc/environment in any text editor like nano or gedit and add the following line:

JAVA_HOME="/usr/lib/jvm/open-jdk"

(java path could be different)

Use source to load the variables, by running this command:

source /etc/environment

Then check the variable, by running this command:

echo $JAVA_HOME

Update

Usually most linux systems source /etc/environment by default. If your system doesn't do that add the following line to ~/.bashrc

source /etc/environment

After that, run the below command to add the java_home to the path variable. 

export PATH="$PATH:$JAVA_HOME/bin"

If you want it permanent, then add the above line to ~/.profile

Now, running $ java -version would return your version.

Get element by part of Name or ID

Q: Get an elements if it's id matches + javascript

A:
document.querySelectorAll('input[id^="id_qtedje_"]');

document.querySelector('[id^="poll-"]').id;
The selector means: get an element where the attribute [id] begins with the string "poll-".

^ matches the start
* matches any position
$ matches the end

Unchecked runtime.lastError while running tabs.executeScript?

Q: Unchecked runtime.lastError while running tabs.executeScript: Cannot access contents of url "". Extension manifest must request permission to access this host ?

A:
chrome.tabs.executeScript(tabId, {
  //..
}, _=>{
  let e = chrome.runtime.lastError;
  if(e !== undefined){
    console.log(tabId, _, e);
  }
});

How can I get query string values in JavaScript?

function getParameterByName(name, url) {
    if (!url) url = window.location.href;
    name = name.replace(/[\[\]]/g, "\\$&");
    var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
        results = regex.exec(url);
    if (!results) return null;
    if (!results[2]) return '';
    return decodeURIComponent(results[2].replace(/\+/g, " "));
}
var foo = getParameterByName('foo');