问:
Find and print num of solutions to x1+x2+x3=num
I need to write a recusive function that recive an integer num and returns the number of solutions to the equation :x1 + x2 + x3 = num, where x1,x2,x3 are numbers between 1-10, the method should print all solutions.

For example if num=3 then the method will print 1+1+1 and will return 1.

if num=5 the method will return 6 and will print:

```<code>1 + 1 + 3
1 + 2 + 2
1 + 3 + 1
2 + 1 + 2
2 + 2 + 1
3 + 1 + 1
</code>```

if num<3 or num>30 the method will return 0.

The method should be recursive without using loops. Global variables are not allowed. Lists are also not allowed.

Here my code, it works fine but it also prints duplicates, for num=5 it prints:

```<code>3 + 1 + 1
2 + 2 + 1
2 + 1 + 2
2 + 2 + 1
1 + 3 + 1
1 + 2 + 2
2 + 1 + 2
1 + 2 + 2
1 + 1 + 3
</code>```

Here is my code:

```<code>public static void main(String[] args) {
    System.out.println("num of solutions: "+solutions(5));

}

public static int solutions(int num)
{

    if (num < 3 || num > 30)
        return 0;

    return solutions(num, 1, 1, 1);
}
private static int solutions(int num, int x1, int x2, int x3)
{
    if (x1 < 1 || x1 > 10 || x2 < 1 || x2 > 10||x3 < 1 || x3 > 10)
        return 0;
    if (x1 + x2 + x3 > num)
        return 0;
    if (x1 + x2 + x3 == num)
    {
        System.out.println(x1 + " + " + x2 + " + " + x3);
        return 1;
    }
    return solutions(num, x1 + 1, x2, x3) + solutions(num, x1, x2 + 1, x3) + solutions(num, x1, x2, x3 + 1);

}
</code>```

How do I get the desired output without duplicates?

答:
We can solve this problem using string. Declare one global string variable

```<code>static String str=""; // taken null intially
</code>```

Now, we can use this string str to store the sequence and to check whether it already comes before or not. This way we can keep track of the duplicate one and you will get your answer. I have attached my code as below.

```<code>private static int solutions(int num, int x1, int x2, int x3)
{
    if (x1 < 1 || x1 > 10 || x2 < 1 || x2 > 10||x3 < 1 || x3 > 10)
        return 0;
    if (x1 + x2 + x3 > num)
        return 0;
    if (x1 + x2 + x3 == num)
    {
        String s= String.valueOf(x1)+"+"+String.valueOf(x2)+"+"+String.valueOf(x2);
        if(!str.contains(s))
        {
            str=str+s+"\n";
            System.out.println(x1 + " + " + x2 + " + " + x3);
            return 1;
        }
    }
    return solutions(num, x1 + 1, x2, x3) + solutions(num, x1, x2 + 1, x3) + solutions(num, x1, x2, x3 + 1);

}
</code>```

Body:
I need to write a recusive function that recive an integer num and returns the number of solutions to the equation :x1 + x2 + x3 = num, where x1,x2,x3 are numbers between 1-10, the method should print all solutions.

For example if num=3 then the method will print 1+1+1 and will return 1.

if num=5 the method will return 6 and will print:

1 + 1 + 3
1 + 2 + 2
1 + 3 + 1
2 + 1 + 2
2 + 2 + 1
3 + 1 + 1

if num<3 or num>30 the method will return 0.

The method should be recursive without using loops. Global variables are not allowed. Lists are also not allowed.

Here my code, it works fine but it also prints duplicates, for num=5 it prints:

3 + 1 + 1
2 + 2 + 1
2 + 1 + 2
2 + 2 + 1
1 + 3 + 1
1 + 2 + 2
2 + 1 + 2
1 + 2 + 2
1 + 1 + 3

Here is my code:

public static void main(String[] args) {
    System.out.println("num of solutions: "+solutions(5));

}

public static int solutions(int num)
{

    if (num < 3 || num > 30)
        return 0;

    return solutions(num, 1, 1, 1);
}
private static int solutions(int num, int x1, int x2, int x3)
{
    if (x1 < 1 || x1 > 10 || x2 < 1 || x2 > 10||x3 < 1 || x3 > 10)
        return 0;
    if (x1 + x2 + x3 > num)
        return 0;
    if (x1 + x2 + x3 == num)
    {
        System.out.println(x1 + " + " + x2 + " + " + x3);
        return 1;
    }
    return solutions(num, x1 + 1, x2, x3) + solutions(num, x1, x2 + 1, x3) + solutions(num, x1, x2, x3 + 1);

}

How do I get the desired output without duplicates?

Body:
We can solve this problem using string. Declare one global string variable

static String str=""; // taken null intially

Now, we can use this string str to store the sequence and to check whether it already comes before or not. This way we can keep track of the duplicate one and you will get your answer. I have attached my code as below.

private static int solutions(int num, int x1, int x2, int x3)
{
    if (x1 < 1 || x1 > 10 || x2 < 1 || x2 > 10||x3 < 1 || x3 > 10)
        return 0;
    if (x1 + x2 + x3 > num)
        return 0;
    if (x1 + x2 + x3 == num)
    {
        String s= String.valueOf(x1)+"+"+String.valueOf(x2)+"+"+String.valueOf(x2);
        if(!str.contains(s))
        {
            str=str+s+"\n";
            System.out.println(x1 + " + " + x2 + " + " + x3);
            return 1;
        }
    }
    return solutions(num, x1 + 1, x2, x3) + solutions(num, x1, x2 + 1, x3) + solutions(num, x1, x2, x3 + 1);

}


来源: stackexchange

问:
Array of Integers to Arrays of Ranges
My Task:
I need to divide the Array into several Arrays of Arrays with the following properties:

every subarray is a range of continuous integer. As example [1,2,3,4,5] will be [[1,5]].

When there are no contiguous integer create a new subarray. As example [1,2,4,5] will be [[1,2], [4,5]]

Example:

If I have this Array of Integers - [0, 1, 5, 6, 3, 7]

Expected Result - [[0, 1], [3], [5, 7]]

I already tried this:

```<code>let array: [Int] = [0, 1, 3, 4, 5, 6, 7]

var group: [[Int]] = []
var temp: [Int] = [Int]()

for (index, element) in array.enumerated() {
    if index + 1 < array.count {
        let nextElement = array[index + 1]
        let step = nextElement - element

//        temp.append(element)

        if(step) == 1 { // Until it's in range
            temp.append(element)
        } else { // One-by-one
            temp.append(element)
            group.append(temp)

            temp = [Int]()
            group.append([nextElement])
        }
    } else {
        print(index)
    }
}

print(group)
</code>```

From my code, I get this result - [[0, 1], [3]]

答:
This is the best approach I found:</p>

```<code>let array: [Int] = [0, 1, 5, 6, 3, 7].sorted();

var group: [[Int]] = []
var temp: [Int] = [Int]()
var lastElement: Int = -1;
for (index, element) in array.enumerated() {
    if lastElement == -1 {
      temp.append(element);
    }
    else {
      if element - lastElement == 1 {
        temp.append(element);
      }
      else {
        group.append(temp);
        temp = [Int]();
        temp.append(element);
      }
    }
    lastElement = element;
}
if temp.count > 0 {
  group.append(temp);
}

print(group)
</code>```

ContentLicense: CC BY-SA 4.0

Title: Array of Integers to Arrays of Ranges

Body:
My Task:
I need to divide the Array into several Arrays of Arrays with the following properties:

every subarray is a range of continuous integer. As example [1,2,3,4,5] will be [[1,5]].

When there are no contiguous integer create a new subarray. As example [1,2,4,5] will be [[1,2], [4,5]]

Example:

If I have this Array of Integers - [0, 1, 5, 6, 3, 7]

Expected Result - [[0, 1], [3], [5, 7]]

I already tried this:

let array: [Int] = [0, 1, 3, 4, 5, 6, 7]

var group: [[Int]] = []
var temp: [Int] = [Int]()

for (index, element) in array.enumerated() {
    if index + 1 < array.count {
        let nextElement = array[index + 1]
        let step = nextElement - element

//        temp.append(element)

        if(step) == 1 { // Until it's in range
            temp.append(element)
        } else { // One-by-one
            temp.append(element)
            group.append(temp)

            temp = [Int]()
            group.append([nextElement])
        }
    } else {
        print(index)
    }
}

print(group)

From my code, I get this result - [[0, 1], [3]]

Body:
This is the best approach I found:

let array: [Int] = [0, 1, 5, 6, 3, 7].sorted();

var group: [[Int]] = []
var temp: [Int] = [Int]()
var lastElement: Int = -1;
for (index, element) in array.enumerated() {
    if lastElement == -1 {
      temp.append(element);
    }
    else {
      if element - lastElement == 1 {
        temp.append(element);
      }
      else {
        group.append(temp);
        temp = [Int]();
        temp.append(element);
      }
    }
    lastElement = element;
}
if temp.count > 0 {
  group.append(temp);
}

print(group)


问:
Job queue with job affinity
I am currently facing a problem for which I am pretty sure there is an official name, but I don't know what to search the web for. I hope that if I describe the problem and the solution I have in mind, somebody is able to tell me the name of the design pattern (if there is one that matches what I am going to describe).

Basically, what I want to have is a job queue: I have multiple clients that create jobs (publishers), and a number of workers that process these jobs (consumers). Now I want to distribute the jobs created by the publishers to the various consumers, which is basically doable using almost any message queue with load balancing across a queue, e.g. using RabbitMQ or even MQTT 5.

However, now things get complicated... every job refers to an external entity, let's say a user. What I want is that the jobs for a single user get processed in order, but for multiple users in parallel. I do not have the requirement that the jobs for user X always go to worker Y, since they should be processed sequentially anyway.

Now I could solve this using RabbitMQ and its consistent hashing exchange, but then I have a data race when new workers enter the cluster, because RabbitMQ does not support re-locating the jobs that are already in a queue.

MQTT 5 does not support this either: Here this idea is known as "sticky shared subscriptions", but this is not official. It may be part of MQTT 6, or it may not. Who knows.

I have also taken a look at NSQ, NATS, and some other brokers. Most of them don't even support this very specific scenario, and those that do use consistent hashing, which has the previously mentioned data racing problem.

Now, the problem would be gone if the broker would not sort the jobs into queues, once the jobs arrive, but if it would track if a job for a specific user is already being processed: If so, it should delay all other jobs for this user, but all jobs for other users should still process. This is, AFAICS, not possible using RabbitMQ et al.

I am pretty sure that I am not the only person with a use case for that. I could e.g. think of users uploading videos to a video platform, and although uploaded videos are processed in parallel, all the videos uploaded by a single user are processed sequentially.

So, to cut a long story short: Is what I describe known under a common name? Something such as distributed job queue? Task dispatcher with task affinity? Or anything else? I have tried lots of terms, but didn't succeed. This may mean that there is no solution for this, but as said, it's hard to imagine that I'm the only person on the planet with this problem.

Any ideas what I could look for? And: Are there any tools that implement this? Any protocols?

PS: Just using a predefined routing key is not an option, since the user ids (which I just used as a made-up example here) are basically UUIDs, so there can be billions of it, so I need something more dynamic. Hence, consistent hashing is basically the correct approach, but as said, the distribution has to work piece by piece, not upfront, to avoid data races.

答:
Having a hard requirement of processing order per entity is challenging.

How long-running is each published task? If they are always very short, you could distribute tasks by hash and simply drain the worker pool of running jobs every time it changes shape without losing much productivity.

If they are longer-running, maybe that would be too slow. In that case you could also potentially have the workers take out atomic advisory locks from a fast central service (like Redis or something) for the user_id of each task they consume, for the duration of its execution. This service could also be separately scalable partitioned by user id ranges or what-have-you. If there is enough of a gap between receiving the task and the first side effects from its execution, the worker wouldn't even need to block on the success of taking the lock until it was about to commit, and thereby might not see significantly increased latency. Contention* could be rare: if you are already using some consistent hashing scheme on user_id to distribute work, they would be rare indeed, and still only occur when worker-pool topology changes. You should at least be using hashing distribution to guarantee that there are only two workers competing for the lock: the old one, and the new one.**

If granting the lock was serviced in first-come-first-serve order and locks are requested faster than worker-pool topology changes (that is, workers queue up for the locks as soon as they receive the job from the publisher), this could even give you pretty good guarantees about ordering even when topology changes quite rapidly.

Edits:

*I originally wrote "Failures"; not quite what I meant. The idea is that this lock service would pretty much never experience any locking contention unless the topology changed, since tasks for a given user would always be sent to the same worker normally.

**Another possibility: You could also give good guarantees with only a partial worker pool drain. Without user-level advisory locks, if you are using a consistent hashing scheme to distribute tasks and you can maintain a low water mark for the completion of dispatched tasks, you can defer starting tasks whose target worker is different than it would have been when the oldest currently executing task started (i.e., drain running tasks only for users whose assigned worker changed). It's a fair amount of extra complexity; if you can efficiently track the low water mark and you don't have a long tail of long-running tasks it might be a good option that allows you elide the lock service. However, at the time of writing it's not clear to me whether this would ever be cheaper than locks; low water marks aren't usually cheap to implement reliably, and the death of a worker at the wrong time could delay processing for the entire 1/N cohort that changed workers instead of just the users whose tasks were in-flight on the worker at the time it died.

Title: Job queue with job affinity


问:
JavaScript: Fade from one table body to another
I am filling my table using AJAX, I get the data returned as a JSON and I want to update my table with the new data.

That's easy, and I achieve it doing this:

```<code>var output= "";

        for (var i = 0; i < content.flights.length; i++) {
            output+= "<tr><td>";
            output+= content.flights[i].id;
            output+= "</td></tr>";
        }
document.getElementById("flights").tBodies[0].innerHTML = output;
</code>```

How can I fade between the two versions though? As in, when I have new data, how can I fade the text between the old and the new?

The basic requirement here is to add data in a nice way. If there is an even better solution, please don't hesitate to point me towards it!

Thanks for your help!

答:
Here is an example of how you can make a fade effect with css and fetching data from the server.

After you click on "Get new Data" at the bottom, a new request will be sent and the table will be reloaded

const fetchData = () => {
  fetch('https://jsonplaceholder.typicode.com/users')
  .then(response => response.json())
  .then(users => {
    var output= "";

    for (var i = 0; i < users.length; i++) {
        output+= "
";
        output+= users[i].name;
        output+= "
";
    }
    document.getElementById("table").tBodies[0].innerHTML = output;

    setTimeout(() => {
      document.getElementById("table").tBodies[0].classList.remove('fade-out');
    }, 400); // time for animation
})
}

document.getElementById('newDataBtn').addEventListener('click', function() {
    document.getElementById("table").tBodies[0].classList.add('fade-out');
    fetchData();
});

fetchData();```
<pre class="snippet-code-css lang-css prettyprint-override"><code>.t-body {
  opacity: 1;
  transition: opacity .5s;
}

.t-body.fade-out {
  opacity: 0;
  transition: opacity .5s;
}</code>```

  <button id="newDataBtn">Get new data</button>

```

Body:
I am filling my table using AJAX, I get the data returned as a JSON and I want to update my table with the new data.

That's easy, and I achieve it doing this:

var output= "";

        for (var i = 0; i < content.flights.length; i++) {
            output+= "
";
            output+= content.flights[i].id;
            output+= "
";
        }
document.getElementById("flights").tBodies[0].innerHTML = output;

How can I fade between the two versions though? As in, when I have new data, how can I fade the text between the old and the new?

The basic requirement here is to add data in a nice way. If there is an even better solution, please don't hesitate to point me towards it!

Thanks for your help!

Body:
Here is an example of how you can make a fade effect with css and fetching data from the server.

After you click on "Get new Data" at the bottom, a new request will be sent and the table will be reloaded

const fetchData = () => {
  fetch('https://jsonplaceholder.typicode.com/users')
  .then(response => response.json())
  .then(users => {
    var output= "";

    for (var i = 0; i < users.length; i++) {
        output+= "<tr><td>";
        output+= users[i].name;
        output+= "</td></tr>";
    }
    document.getElementById("table").tBodies[0].innerHTML = output;

    setTimeout(() => {
      document.getElementById("table").tBodies[0].classList.remove('fade-out');
    }, 400); // time for animation
})
}

document.getElementById('newDataBtn').addEventListener('click', function() {
    document.getElementById("table").tBodies[0].classList.add('fade-out');
    fetchData();
});

fetchData();

.t-body {
  opacity: 1;
  transition: opacity .5s;
}

.t-body.fade-out {
  opacity: 0;
  transition: opacity .5s;
}

<div id="root">

  <table id="table">
    <tbody class="t-body" id="tBody">
    </tbody>
  </table>

  <button id="newDataBtn">Get new data</button>

</div>


问:
Composing multiple images - direction needed
My customer wants to develop a feature in his Android application which allows the user to compose  images.  The idea is that he has a region of the page onto which he can drag and drop an image taken from the image library on the device, or even from the device's camera.  This image forms his background.  Onto that background, he wants to be able to drop another image from his library.  It should be possible to move, resize or even rotate this second image on the background of the first.  Once he's completed his composition - and this process might happen more than once - he wants to save the resulting composite image in a form which can be uploaded to a web application.

I need to research the techniques and technologies I need to be able to do this.  Any pointers, suggestions, or assistance would be very welcome.

Thanks

Peter Hornby

答:
For the interactive editing, I would keep track of the pictures, their coordinates and their rotations, and use the canvas drawing routines to render them in real time in your onDraw method.

Canvas#drawBitmap(Bitmap, Matrix, Paint) will allow you to pass a rotational matrix as you draw.

Bitmap.createBitmap(int, int, Bitmap.Config) (among other methods) will give you a "mutable" Bitmap, or one whose contents can be overwritten with new data. One of the Canvas constructors takes a Bitmap, allowing you to draw to your mutable bitmap in the same way as you do in your onDraw method. Then, you can save that bitmap to the SD card or upload it to your web server.

ContentLicense: CC BY-SA 3.0


问:
Storing date in dd-mm-yyyy format for react state with input type as date
I wanted it to get dd-mm-yyyy rather than yyyy-mm-dd while saving in state and sending it to firestore database, is there any solutions? </p>

```<code>
state = { date: '' }

handleChange = event => {
        this.setState({
            [event.target.name]: event.target.value
        })
    }

    <Step1
   handleChange={this.handleChange}
   date={this.state.date}
/>

<input
    className="form-control"
    id="Date"
    name="date"
    type="date"
    value={props.date}
    onChange={props.handleChange}
/>

</code>```

答:
For your case, you can do it in a one-liner</p>

```<code>date = date.split("-").reverse().join("-");
</code>```

Body:
I wanted it to get dd-mm-yyyy rather than yyyy-mm-dd while saving in state and sending it to firestore database, is there any solutions?

state = { date: '' }

handleChange = event => {
        this.setState({
            [event.target.name]: event.target.value
        })
    }

    <Step1
   handleChange={this.handleChange}
   date={this.state.date}
/>

<input
    className="form-control"
    id="Date"
    name="date"
    type="date"
    value={props.date}
    onChange={props.handleChange}
/>

Body:
For your case, you can do it in a one-liner

date = date.split("-").reverse().join("-");


问:
R function equivalent to Stata's "do" command that can run multiple programs at once?
I have multiple R script files that perform different types of modifications to my dataset for analysis. I'm continuously updating/adding new data to my dataset and re-running each individual program is somewhat arduous, so I'm wondering if there's an equivalent to Stata's "do" command that can run multiple R programs from one R program. For example, I have a Stata file that looks like:

```<code>do "\\filepath\filename.do"
do "\\filepath\filename.do"
do "\\filepath\filename.do"
do "\\filepath\filename.do"
do "\\filepath\filename.do"
</code>```

I'd like to be able to do the same thing in R that runs multiple R programs, like:

```<code>r function("filepath\filename.R")
r function("filepath\filename.R")
r function("filepath\filename.R")
r function("filepath\filename.R")
</code>```

I have searched for a solution to no avail, and perhaps I don't know the exact jargon for this type of command. Any suggestions would be greatly appreciated.

Thank you.

答:
If you are looking to do it from R, use can use:

```<code>source("path_to_file_1.R")
source("path_to_file_2.R")
</code>```

If from outside of R (e.g. a bash script, etc.)

```<code>Rscript path_to_file_1.R
Rscript path_to_file_2.R
</code>```

Body:
I have multiple R script files that perform different types of modifications to my dataset for analysis. I'm continuously updating/adding new data to my dataset and re-running each individual program is somewhat arduous, so I'm wondering if there's an equivalent to Stata's "do" command that can run multiple R programs from one R program. For example, I have a Stata file that looks like:

do "\\filepath\filename.do"
do "\\filepath\filename.do"
do "\\filepath\filename.do"
do "\\filepath\filename.do"
do "\\filepath\filename.do"

I'd like to be able to do the same thing in R that runs multiple R programs, like:

r function("filepath\filename.R")
r function("filepath\filename.R")
r function("filepath\filename.R")
r function("filepath\filename.R")

I have searched for a solution to no avail, and perhaps I don't know the exact jargon for this type of command. Any suggestions would be greatly appreciated.

Thank you.

Body:
If you are looking to do it from R, use can use:

source("path_to_file_1.R")
source("path_to_file_2.R")

If from outside of R (e.g. a bash script, etc.)

Rscript path_to_file_1.R
Rscript path_to_file_2.R


问:
Ansible mix roles and apt in one playbook
I am just starting out with Ansible and can not find any documentation that discusses using roles and apt in the same book. The playbook I have written is here

```<code>---
- hosts: apps
  become: yes
  tasks:
    - name: Install distutils
      apt:
        name: python3-distutils
        state: present
    - name: Run roles
      roles:
        - geerlingguy.git
        - mdklatt.python3
        - geerlingguy.nodejs

</code>```

but this gives me the error

```<code>ERROR! no action detected in task. This often indicates a misspelled module name, or incorrect module path.

The error appears to be in '/home/simon/ansible/playbooks/base_apps_server.yml': line 9, column 7, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

        state: present
    - name: Run roles
      ^ here

</code>```

答:
roles directive is not a module and can't be used inside a task. See Using Roles.

Either put roles before tasks

```<code>- hosts: apps
  become: yes
  roles:
    - geerlingguy.git
    - mdklatt.python3
    - geerlingguy.nodejs
  tasks:
    - name: Install distutils
      apt:
        name: python3-distutils
        state: present
</code>```

, or use include_role

```<code>- hosts: apps
  become: yes
  tasks:
    - name: Install distutils
      apt:
        name: python3-distutils
        state: present
    - name: Run role
      include_role:
        name: geerlingguy.git
    - name: Run role
      include_role:
        name: mdklatt.python3
    - name: Run role
      include_role:
        name: geerlingguy.nodejs
</code>```

Body:
I am just starting out with Ansible and can not find any documentation that discusses using roles and apt in the same book. The playbook I have written is here

---
- hosts: apps
  become: yes
  tasks:
    - name: Install distutils
      apt:
        name: python3-distutils
        state: present
    - name: Run roles
      roles:
        - geerlingguy.git
        - mdklatt.python3
        - geerlingguy.nodejs

but this gives me the error

ERROR! no action detected in task. This often indicates a misspelled module name, or incorrect module path.

The error appears to be in '/home/simon/ansible/playbooks/base_apps_server.yml': line 9, column 7, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

        state: present
    - name: Run roles
      ^ here

Body:
roles directive is not a module and can't be used inside a task. See Using Roles.

Either put roles before tasks

- hosts: apps
  become: yes
  roles:
    - geerlingguy.git
    - mdklatt.python3
    - geerlingguy.nodejs
  tasks:
    - name: Install distutils
      apt:
        name: python3-distutils
        state: present

, or use include_role

- hosts: apps
  become: yes
  tasks:
    - name: Install distutils
      apt:
        name: python3-distutils
        state: present
    - name: Run role
      include_role:
        name: geerlingguy.git
    - name: Run role
      include_role:
        name: mdklatt.python3
    - name: Run role
      include_role:
        name: geerlingguy.nodejs


问:
VS Code error 22 when running Python file
I am trying to run a simple python code in Visual Studio Code. My launch.json looks like this :

```<code>{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python : Fichier actuel",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal"
        }
    ]
}
</code>```

Here is the full error :

```<code>D:\Me\Documents\MEGA\IPSA\Aéro 3\Optimisation différentiable\TP-Projet>cd "d:\Me\Documents\MEGA\IPSA\Aéro 3\Optimisation différentiable\TP-Projet" && cmd /C "set "PYTHONIOENCODING=UTF-8" && set "PYTHONUNBUFFERED=1" && "C:\Users\My Username\AppData\Local\Programs\Python\Python37\python.exe" """c:/Users/My Username/.vscode/extensions/ms-python.python-2019.5.17517/pythonFiles/ptvsd_launcher.py""" --default --client --host localhost --port 9975 "d:\Me\Documents\MEGA\IPSA\Aéro 3\Optimisation différentiable\TP-Projet\projet.py" "
C:\Users\My Username\AppData\Local\Programs\Python\Python37\python.exe: can't open file '"c:/Users/My Username/.vscode/extensions/ms-python.python-2019.5.17517/pythonFiles/ptvsd_launcher.py"': [Errno 22] Invalid argument
</code>```

The debugger doesn't start and an error message telling me the debugger doesn't respond appears. Did I do anything wrong ? Is it just a bug in how VS Code handles file paths ?

答: Also have spaces in my username and for now you only need to run, try to roll your python extension back to 2019.4.12954 to avoid.  It looks like a bug from 2019.5.17059.</p>

Body:
I am trying to run a simple python code in Visual Studio Code. My launch.json looks like this :

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python : Fichier actuel",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal"
        }
    ]
}

Here is the full error :

D:\Me\Documents\MEGA\IPSA\Aéro 3\Optimisation différentiable\TP-Projet>cd "d:\Me\Documents\MEGA\IPSA\Aéro 3\Optimisation différentiable\TP-Projet" && cmd /C "set "PYTHONIOENCODING=UTF-8" && set "PYTHONUNBUFFERED=1" && "C:\Users\My Username\AppData\Local\Programs\Python\Python37\python.exe" """c:/Users/My Username/.vscode/extensions/ms-python.python-2019.5.17517/pythonFiles/ptvsd_launcher.py""" --default --client --host localhost --port 9975 "d:\Me\Documents\MEGA\IPSA\Aéro 3\Optimisation différentiable\TP-Projet\projet.py" "
C:\Users\My Username\AppData\Local\Programs\Python\Python37\python.exe: can't open file '"c:/Users/My Username/.vscode/extensions/ms-python.python-2019.5.17517/pythonFiles/ptvsd_launcher.py"': [Errno 22] Invalid argument

The debugger doesn't start and an error message telling me the debugger doesn't respond appears. Did I do anything wrong ? Is it just a bug in how VS Code handles file paths ?


问:
Can't find a method declared in other java file
I'm Building a todo app, I declared methods in separate java file and when I wanna access them in another java file they are saying 'can't resolve the method'

You can see the whole project at https://github.com/RamcharanS/MyTODO_Be_Productive

Please Help me with this and if possible please check and give a small review on my code

Java file of Methods

```<code>package com.example.mytodo;

public class my_todo {
    String titledoes;
    String datedoes;
    String descdoes;
    String keydoes;

    public my_todo() {
    }

    public my_todo(String titledoes, String datedoes, String descdoes, String keydoes) {
        this.titledoes = titledoes;
        this.datedoes = datedoes;
        this.descdoes = descdoes;
        this.keydoes = keydoes;
    }

    public String getKeydoes() {
        return keydoes;
    }

    public void setKeydoes(String keydoes) {
        this.keydoes = keydoes;
    }

    public String getTitledoes() {
        return titledoes;
    }

    public void setTitledoes(String titledoes) {
        this.titledoes = titledoes;
    }

    public String getDatedoes() {
        return datedoes;
    }

    public void setDatedoes(String datedoes) {
        this.datedoes = datedoes;
    }

    public String getDescdoes() {
        return descdoes;
    }

    public void setDescdoes(String descdoes) {
        this.descdoes = descdoes;
    }
}

</code>```

This is the Java file Giving me Error
Method : getTitledoes() getDescdoes() getDatedoes()

```<code>package com.example.mytodo;

import android.content.Context;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.example.mytodo.R;

import org.w3c.dom.Text;

import java.util.ArrayList;

public class DoesAdapter extends RecyclerView.Adapter<DoesAdapter.MyViewHolder>{

    Context context;
    ArrayList myDoes;

    public DoesAdapter(Context c, ArrayList p) {
        context = c;
        myDoes = p;
    }

    @NonNull
    @Override
    public  MyViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i){
    return new MyViewHolder(LayoutInflater.from(context).inflate(R.layout.new_todo, viewGroup, false));
    }

    @Override
    public void onBindViewHolder(@NonNull MyViewHolder myViewHolder, int i){
        MyViewHolder.titledoes.setText(myDoes.get(i).getTitledoes());
        MyViewHolder.descdoes.setText(myDoes.get(i).getDescdoes());
        MyViewHolder.datedoes.setText(myDoes.get(i).getDatedoes());
    }

    @Override
    public int getItemCount(){
        return myDoes.size();
    }
    class MyViewHolder extends RecyclerView.ViewHolder {
        TextView titledoes, descdoes, datedoes;

        public MyViewHolder(@NonNull View itemView){
            super(itemView);
            titledoes = (TextView) itemView.findViewById(R.id.titledoes);
            descdoes = (TextView) itemView.findViewById(R.id.descdoes);
            datedoes = (TextView) itemView.findViewById(R.id.datedoes);
        }
    }

}

</code>```

答:
Create your list like this</p>

```<code>// modify your adapter class like this
  Context context;
 ArrayList<my_todo> myDoes;

public DoesAdapter(Context c, ArrayList<my_todo> p) {
    context = c;
    myDoes = p;
}

// create list in your activity
 ArrayList<my_todo> list=new ArrayList<>();
 list.add(new my_todo("title","date","desc","key"));

 // pass list  to adapter class
 new DoesAdapter(this,list);
</code>```

Body:
I'm Building a todo app, I declared methods in separate java file and when I wanna access them in another java file they are saying 'can't resolve the method'

You can see the whole project at https://github.com/RamcharanS/MyTODO_Be_Productive

Please Help me with this and if possible please check and give a small review on my code

Java file of Methods

package com.example.mytodo;

public class my_todo {
    String titledoes;
    String datedoes;
    String descdoes;
    String keydoes;

    public my_todo() {
    }

    public my_todo(String titledoes, String datedoes, String descdoes, String keydoes) {
        this.titledoes = titledoes;
        this.datedoes = datedoes;
        this.descdoes = descdoes;
        this.keydoes = keydoes;
    }

    public String getKeydoes() {
        return keydoes;
    }

    public void setKeydoes(String keydoes) {
        this.keydoes = keydoes;
    }

    public String getTitledoes() {
        return titledoes;
    }

    public void setTitledoes(String titledoes) {
        this.titledoes = titledoes;
    }

    public String getDatedoes() {
        return datedoes;
    }

    public void setDatedoes(String datedoes) {
        this.datedoes = datedoes;
    }

    public String getDescdoes() {
        return descdoes;
    }

    public void setDescdoes(String descdoes) {
        this.descdoes = descdoes;
    }
}

This is the Java file Giving me Error
Method : getTitledoes() getDescdoes() getDatedoes()

package com.example.mytodo;

import android.content.Context;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.example.mytodo.R;

import org.w3c.dom.Text;

import java.util.ArrayList;

public class DoesAdapter extends RecyclerView.Adapter<DoesAdapter.MyViewHolder>{

    Context context;
    ArrayList myDoes;

    public DoesAdapter(Context c, ArrayList p) {
        context = c;
        myDoes = p;
    }

    @NonNull
    @Override
    public  MyViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i){
    return new MyViewHolder(LayoutInflater.from(context).inflate(R.layout.new_todo, viewGroup, false));
    }

    @Override
    public void onBindViewHolder(@NonNull MyViewHolder myViewHolder, int i){
        MyViewHolder.titledoes.setText(myDoes.get(i).getTitledoes());
        MyViewHolder.descdoes.setText(myDoes.get(i).getDescdoes());
        MyViewHolder.datedoes.setText(myDoes.get(i).getDatedoes());
    }

    @Override
    public int getItemCount(){
        return myDoes.size();
    }
    class MyViewHolder extends RecyclerView.ViewHolder {
        TextView titledoes, descdoes, datedoes;

        public MyViewHolder(@NonNull View itemView){
            super(itemView);
            titledoes = (TextView) itemView.findViewById(R.id.titledoes);
            descdoes = (TextView) itemView.findViewById(R.id.descdoes);
            datedoes = (TextView) itemView.findViewById(R.id.datedoes);
        }
    }

}

Body:
Create your list like this

// modify your adapter class like this
  Context context;
 ArrayList<my_todo> myDoes;

public DoesAdapter(Context c, ArrayList<my_todo> p) {
    context = c;
    myDoes = p;
}

// create list in your activity
 ArrayList<my_todo> list=new ArrayList<>();
 list.add(new my_todo("title","date","desc","key"));

 // pass list  to adapter class
 new DoesAdapter(this,list);


问:
Scala Array map function documentation (PSSQ #1)
PSSQ stand for Possibly Stupid Scala Question :)

Getting to know Scala a little bit, and in the obligatory Hello World example (code below) the arguments to the main function is an array of strings.

```<code>object HelloWorld
{
    def main(args: Array[String]): Unit =
    {
        args.map((arg:String) => arg.toUpperCase());
        printf("%s %s!", "Hello", "World");
    }
}
</code>```

In the example, I'm using the map() function on the array. However, when I check the Scala API documentation, map() isn't listed as one of the functions available for Array. Is there some kind of magic going on, or am I missing something obvious in the API documentation?

答:
The simple answer: map is actually a method on the Traversable trait, which is included by Array.

The hard answer: Array doesn't really extend Traversable anymore (iirc), but when Traversable methods are called on an Array instance, there is an implicit conversion that happens in order to allow that to work.

Body:
PSSQ stand for Possibly Stupid Scala Question :)

Getting to know Scala a little bit, and in the obligatory Hello World example (code below) the arguments to the main function is an array of strings.

object HelloWorld
{
    def main(args: Array[String]): Unit =
    {
        args.map((arg:String) => arg.toUpperCase());
        printf("%s %s!", "Hello", "World");
    }
}

In the example, I'm using the map() function on the array. However, when I check the Scala API documentation, map() isn't listed as one of the functions available for Array. Is there some kind of magic going on, or am I missing something obvious in the API documentation?


问:
How to do a multi-table join in Django with aliases
Ok, i'm having some trouble understanding on Django does joining and aliasing.  I have four tables defined as such in my models: (i've removed un-pertinent columns)

```<code>class Field(models.Model):
    name = models.CharField(max_length=200, default='')

class Survey(models.Model):
    name = models.CharField(max_length=200, default='')

class Question(models.Model):
    text = models.CharField(max_length=200, default='')
    survey = models.ForeignKey(Survey)

class Answer(models.Model):
    question = models.ForeignKey(Question)
    field = models.ForeignKey(Field)
</code>```

Now I can write a very simple and easy to understand sql query to get exactly what I want. which would look like this:

```<code>SELECT s.id, s.name,
  q.id as q_id, q.text,
  f.id as f_id, f.name as answer
FROM "App_survey" s
JOIN "App_question" q
  ON q.survey_id = s.id
JOIN "App_answer" a
  ON a.question_id = q.id
JOIN "App_field" f
  ON a.field_id = f.id;
</code>```

But I can't for the life of me figure out how to do this using the orm.  I can't even get two tables joined and select the data from both let alone deal with the aliasing.  This is as far as I've gotten:

```<code>questions = Question.objects.prefetch_related('survey')
questions_dict = [{'form':x.name, 'id':x.id, 'question':x.text} for x in questions]
</code>```

This gives me a 'Question' object has no attribute 'name' error.

Note: this is postgres and python and I am new to both.

Update:  This is the final code which i used that works:

```<code>answers = Answer.objects.annotate(
    s_id=F('question__survey__id'),
    s_name=F('question__survey__name'),
    q_id=F('question__id'),
    text=F('question__text'),
    f_id=F('field__id'),
    answer=F('field__name')
)

surveys_dict = [{
    'id': x.s_id,
    'name':x.s_name,
    'q_id':x.q_id,
    'text':x.text,
    'f_id':x.f_id,
    'answer':x.answer
} for x in answers]
</code>```

thanks to both answerers, they were enlightening.

答:
You should use select_related(*fields), when you have ManyToOne relationship (This performs SQL JOINS).

```<code>questions = Question.objects.select_related('survey')
questions_dict = [{'form':x.survey.name, 'id':x.id, 'question':x.text} for x in questions]
</code>```

I think, this is what you need.

Body:
Ok, i'm having some trouble understanding on Django does joining and aliasing.  I have four tables defined as such in my models: (i've removed un-pertinent columns)

class Field(models.Model):
    name = models.CharField(max_length=200, default='')

class Survey(models.Model):
    name = models.CharField(max_length=200, default='')

class Question(models.Model):
    text = models.CharField(max_length=200, default='')
    survey = models.ForeignKey(Survey)

class Answer(models.Model):
    question = models.ForeignKey(Question)
    field = models.ForeignKey(Field)

Now I can write a very simple and easy to understand sql query to get exactly what I want. which would look like this:

SELECT s.id, s.name,
  q.id as q_id, q.text,
  f.id as f_id, f.name as answer
FROM "App_survey" s
JOIN "App_question" q
  ON q.survey_id = s.id
JOIN "App_answer" a
  ON a.question_id = q.id
JOIN "App_field" f
  ON a.field_id = f.id;

But I can't for the life of me figure out how to do this using the orm.  I can't even get two tables joined and select the data from both let alone deal with the aliasing.  This is as far as I've gotten:

questions = Question.objects.prefetch_related('survey')
questions_dict = [{'form':x.name, 'id':x.id, 'question':x.text} for x in questions]

This gives me a 'Question' object has no attribute 'name' error.

Note: this is postgres and python and I am new to both.

Update:  This is the final code which i used that works:

answers = Answer.objects.annotate(
    s_id=F('question__survey__id'),
    s_name=F('question__survey__name'),
    q_id=F('question__id'),
    text=F('question__text'),
    f_id=F('field__id'),
    answer=F('field__name')
)

surveys_dict = [{
    'id': x.s_id,
    'name':x.s_name,
    'q_id':x.q_id,
    'text':x.text,
    'f_id':x.f_id,
    'answer':x.answer
} for x in answers]

thanks to both answerers, they were enlightening.

Body:
You should use select_related(*fields), when you have ManyToOne relationship (This performs SQL JOINS).

questions = Question.objects.select_related('survey')
questions_dict = [{'form':x.survey.name, 'id':x.id, 'question':x.text} for x in questions]

I think, this is what you need.


问:
How to refactor method to replace OrganizationServiceProxy with IOrganizationService
I'm attempting to refactor my code so that I can unit test using fakexrmeasy.

As part of the suggested refactor mentioned here, I've attempted to pass IOrganizationService into all of my classes and methods. However, some of my classes use variables and methods that IOrganizationService doesn't have, such as Timeout. I'm trying to find a way to refactor to use IOrganizationService without losing functionality.

This is how it exists before refactoring.

```<code>class testClass () {

    public void testMethod(OrganizationServiceProxy service) {
        service.Timeout = new TimeSpan(0, 15, 0);
    }

}
</code>```

This is after the refactor.
I've tried casting IOrganizationService to OrganizationServiceProxy, but the faked service context can't handle this cast. An exception is thrown.

```<code>class testClass () {

    public void testMethod(IOrganizationService service) {
        var serviceProxy = (OrganizationServiceProxy) service; //This breaks when given a fake context
        service.Timeout = new TimeSpan(0, 15, 0);
    }

}
</code>```

I've tried using an IOrganizationServiceFactory, as suggested in this post. The problem is, factory.CreateOrganizationService() generates an IOrganizationService, not an OrganizationSeriviceProxy.

How can I refactor to use IOrganizationService instead of OrganizationServiceProxy without losing functionality? I'm guessing I might have to implement the IOrganizationService as an OrganizationServiceProxy somehow.

答:
I think there is an easy solution - if you don't need to mock the methods over OrganizationServiceProxy - just ignore those in unit testing context.

I.E. instead of

```<code>// This breaks when given a fake context
var serviceProxy = (OrganizationServiceProxy) service;
serviceProxy.Timeout = new TimeSpan(0, 15, 0);
</code>```

Do

```<code>var serviceProxy = service as (OrganizationServiceProxy);
// The serviceProxy is null so it is ignored when given a fake context
if (serviceProxy != null)
{
   serviceProxy.Timeout = new TimeSpan(0, 15, 0);
}
</code>```

Body:
I'm attempting to refactor my code so that I can unit test using fakexrmeasy.

As part of the suggested refactor mentioned here, I've attempted to pass IOrganizationService into all of my classes and methods. However, some of my classes use variables and methods that IOrganizationService doesn't have, such as Timeout. I'm trying to find a way to refactor to use IOrganizationService without losing functionality.

This is how it exists before refactoring.

class testClass () {

    public void testMethod(OrganizationServiceProxy service) {
        service.Timeout = new TimeSpan(0, 15, 0);
    }

}

This is after the refactor.
I've tried casting IOrganizationService to OrganizationServiceProxy, but the faked service context can't handle this cast. An exception is thrown.

class testClass () {

    public void testMethod(IOrganizationService service) {
        var serviceProxy = (OrganizationServiceProxy) service; //This breaks when given a fake context
        service.Timeout = new TimeSpan(0, 15, 0);
    }

}

I've tried using an IOrganizationServiceFactory, as suggested in this post. The problem is, factory.CreateOrganizationService() generates an IOrganizationService, not an OrganizationSeriviceProxy.

How can I refactor to use IOrganizationService instead of OrganizationServiceProxy without losing functionality? I'm guessing I might have to implement the IOrganizationService as an OrganizationServiceProxy somehow.

Body:
I think there is an easy solution - if you don't need to mock the methods over OrganizationServiceProxy - just ignore those in unit testing context.

I.E. instead of

// This breaks when given a fake context
var serviceProxy = (OrganizationServiceProxy) service;
serviceProxy.Timeout = new TimeSpan(0, 15, 0);

Do

var serviceProxy = service as (OrganizationServiceProxy);
// The serviceProxy is null so it is ignored when given a fake context
if (serviceProxy != null)
{
   serviceProxy.Timeout = new TimeSpan(0, 15, 0);
}


问:
Getting "Gradle sync failed: connection reset" in Android Studio
While creating a simple project in Android Studio, I am getting this error.

The log file for your reference:

```2018-08-13 10:56:47,583 [e-1024-b02]   INFO - e.project.sync.GradleSyncState - Started sync with Gradle for project 'My Application'.
2018-08-13 10:56:47,591 [e-1024-b02]   INFO - idea.project.IndexingSuspender - Consuming IndexingSuspender activation event: SYNC_STARTED
2018-08-13 10:56:47,591 [e-1024-b02]   INFO - idea.project.IndexingSuspender - Starting batch update for project: Project 'C:\Users\surya.s02\AndroidStudioProjects\MyApplication' My Application
2018-08-13 10:56:47,624 [thread 380]   INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from C:/Program Files/Android/Android Studio/jre
2018-08-13 10:56:47,631 [thread 380]   INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from C:/Program Files/Android/Android Studio/jre
2018-08-13 10:56:47,998 [thread 380]   INFO - xecution.GradleExecutionHelper - Passing command-line args to Gradle Tooling API: -Didea.version=3.1 -Djava.awt.headless=true -Pandroid.injected.build.model.only=true -Pandroid.injected.build.model.only.advanced=true -Pandroid.injected.invoked.from.ide=true -Pandroid.injected.build.model.only.versioned=3 -Pandroid.injected.studio.version=3.1.3.0 -Pandroid.builder.sdkDownload=false --init-script C:\Users\surya.s02\AppData\Local\Temp\ijinit.gradle
2018-08-13 10:58:35,124 [thread 380]   INFO - .project.GradleProjectResolver - Gradle project resolve error
org.gradle.tooling.BuildException: Could not run build action using Gradle distribution 'https://services.gradle.org/distributions/gradle-4.4-all.zip'.
    at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:51)
    at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:29)
    at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:41)
    at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:57)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
    at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:46)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
    at java.lang.Thread.run(Thread.java:745)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.gradle.internal.exceptions.LocationAwareException: A problem occurred configuring root project 'MyApplication'.
    at org.gradle.initialization.DefaultExceptionAnalyser.transform(DefaultExceptionAnalyser.java:74)
    at org.gradle.initialization.MultipleBuildFailuresExceptionAnalyser.transform(MultipleBuildFailuresExceptionAnalyser.java:47)
    at org.gradle.tooling.internal.provider.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:51)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:47)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30)
    at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:39)
    at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:25)
    at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:80)
    at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:53)
    at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:57)
    at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:32)
    at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36)
    at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25)
    at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43)
    at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29)
    at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:69)
    at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:30)
    at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:59)
    at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:44)
    at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:45)
    at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:30)
    at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
    at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
    at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
    at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:295)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: org.gradle.api.ProjectConfigurationException: A problem occurred configuring root project 'MyApplication'.
    at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.java:94)
    at org.gradle.configuration.project.LifecycleProjectEvaluator.doConfigure(LifecycleProjectEvaluator.java:66)
    at org.gradle.configuration.project.LifecycleProjectEvaluator.access$100(LifecycleProjectEvaluator.java:34)

Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':classpath'.
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.rethrowFailure(DefaultConfiguration.java:918)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.access$1600(DefaultConfiguration.java:116)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection.getFiles(DefaultConfiguration.java:892)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.getFiles(DefaultConfiguration.java:404)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration_Decorated.getFiles(Unknown Source)
    at org.gradle.api.internal.file.AbstractFileCollection.iterator(AbstractFileCollection.java:68)
    at org.gradle.internal.classpath.DefaultClassPath.<init>(DefaultClassPath.java:48)
    at org.gradle.api.internal.initialization.DefaultScriptClassPathResolver.resolveClassPath(DefaultScriptClassPathResolver.java:39)
    at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:26)
    at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:34)
    at org.gradle.configuration.project.LifecycleProjectEvaluator.doConfigure(LifecycleProjectEvaluator.java:64)
    ... 81 more
Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jre8:1.2.0.
Required by:
    project : > com.android.tools.build:gradle:3.1.3 > com.android.tools.build:gradle-core:3.1.3
    project : > com.android.tools.build:gradle:3.1.3 > com.android.tools.build:gradle-core:3.1.3 > com.android.tools.build:builder:3.1.3
    project : > com.android.tools.build:gradle:3.1.3 > com.android.tools.build:gradle-core:3.1.3 > com.android.tools.lint:lint-gradle-api:26.1.3
    project : > com.android.tools.build:gradle:3.1.3 > com.android.tools.build:gradle-core:3.1.3 > com.android.tools.build:gradle-api:3.1.3
    project : > com.android.tools.build:gradle:3.1.3 > com.android.tools.build:gradle-core:3.1.3 > com.android.databinding:compilerCommon:3.1.3
    project : > com.android.tools.build:gradle:3.1.3 > com.android.tools.build:gradle-core:3.1.3 > com.android.tools.build:builder:3.1.3 > com.android.tools:sdk-common:26.1.3
    project : > com.android.tools.build:gradle:3.1.3 > com.android.tools.build:gradle-core:3.1.3 > com.android.tools.build:builder:3.1.3 > com.android.tools.build:manifest-merger:26.1.3
    project : > com.android.tools.build:gradle:3.1.3 > com.android.tools.build:gradle-core:3.1.3 > com.android.tools.build:builder:3.1.3 > com.android.tools:sdklib:26.1.3 > com.android.tools:repository:26.1.3
    at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryChainComponentMetaDataResolver.resolveModule(RepositoryChainComponentMetaDataResolver.java:103)
    at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryChainComponentMetaDataResolver.resolve(RepositoryChainComponentMetaDataResolver.java:63)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.ComponentResolversChain$ComponentMetaDataResolverChain.resolve(ComponentResolversChain.java:93)
    at org.gradle.api.internal.artifacts.ivyservice.clientmodule.ClientModuleResolver.resolve(ClientModuleResolver.java:48)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.ComponentState.resolve(ComponentState.java:157)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.ComponentState.getMetaData(ComponentState.java:168)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.EdgeState.calculateTargetConfigurations(EdgeState.java:134)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.EdgeState.attachToTargetConfigurations(EdgeState.java:105)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder.attachToTargetRevisionsSerially(DependencyGraphBuilder.java:239)
    at org.gradle.internal.resource.BuildOperationFiringExternalResourceDecorator.withContentIfPresent(BuildOperationFiringExternalResourceDecorator.java:229)
    at org.gradle.internal.resource.transfer.DefaultCacheAwareExternalResourceAccessor.copyToCache(DefaultCacheAwareExternalResourceAccessor.java:199)
    ... 148 more
Caused by: java.net.SocketException: Connection reset
    at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:394)
    at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.upgrade(DefaultHttpClientConnectionOperator.java:185)
    at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.upgrade(PoolingHttpClientConnectionManager.java:369)
    at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:415)
    at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
    at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
    at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
    at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
    at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
    at org.gradle.internal.resource.transport.http.HttpClientHelper.performHttpRequest(HttpClientHelper.java:148)
    at org.gradle.internal.resource.transport.http.HttpClientHelper.performHttpRequest(HttpClientHelper.java:126)
    at org.gradle.internal.resource.transport.http.HttpClientHelper.executeGetOrHead(HttpClientHelper.java:103)
    at org.gradle.internal.resource.transport.http.HttpClientHelper.performRequest(HttpClientHelper.java:94)
    ... 163 more
2018-08-13 10:58:35,148 [thread 380]   WARN - nal.AbstractExternalSystemTask - Connection reset
com.intellij.openapi.externalSystem.model.ExternalSystemException: Connection reset
    at com.android.tools.idea.gradle.project.sync.idea.ProjectImportErrorHandler.getUserFriendlyError(ProjectImportErrorHandler.java:72)
    at com.android.tools.idea.gradle.project.sync.idea.AndroidGradleProjectResolver.getUserFriendlyError(AndroidGradleProjectResolver.java:436)
    at org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension.getUserFriendlyError(AbstractProjectResolverExtension.java:158)
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:943)
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:923)
    at org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.execute(GradleExecutionHelper.java:210)
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:140)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:165)
    at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:315)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.net.SocketException: Connection reset
    at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:394)
    at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.upgrade(DefaultHttpClientConnectionOperator.java:185)
    at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.upgrade(PoolingHttpClientConnectionManager.java:369)
    at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:415)
    at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
    at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
    at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
    at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
    at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
    at org.gradle.internal.resource.transport.http.HttpClientHelper.performHttpRequest(HttpClientHelper.java:148)
    at org.gradle.internal.resource.transport.http.HttpClientHelper.performHttpRequest(HttpClientHelper.java:126)
    at org.gradle.internal.resource.transport.http.HttpClientHelper.executeGetOrHead(HttpClientHelper.java:103)
    at org.gradle.internal.resource.transport.http.HttpClientHelper.performRequest(HttpClientHelper.java:94)
    at org.gradle.internal.resource.transport.http.HttpClientHelper.performRawGet(HttpClientHelper.java:80)
    at org.gradle.internal.resource.transport.http.HttpClientHelper.performGet(HttpClientHelper.java:84)
    at org.gradle.internal.resource.transport.http.HttpResourceAccessor.openResource(HttpResourceAccessor.java:43)
    at org.gradle.internal.resource.transport.http.HttpResourceAccessor.openResource(HttpResourceAccessor.java:29)
    at org.gradle.internal.resource.transfer.DefaultExternalResourceConnector.openResource(DefaultExternalResourceConnector.java:56)
    at org.gradle.internal.resource.transfer.ProgressLoggingExternalResourceAccessor.openResource(ProgressLoggingExternalResourceAccessor.java:36)
    at org.gradle.internal.resource.transfer.AccessorBackedExternalResource.withContentIfPresent(AccessorBackedExternalResource.java:130)
    at org.gradle.internal.resource.BuildOperationFiringExternalResourceDecorator$11.call(BuildOperationFiringExternalResourceDecorator.java:237)
    at org.gradle.internal.resource.BuildOperationFiringExternalResourceDecorator$11.call(BuildOperationFiringExternalResourceDecorator.java:229)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
    at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:82)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
    at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
    at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:295)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)

2018-08-13 10:58:35,174 [thread 380]   WARN - ect.sync.idea.ProjectSetUpTask - Connection reset
2018-08-13 10:58:35,175 [thread 380]   INFO - e.project.sync.GradleSyncState - Gradle sync failed: Connection reset

Consult IDE log for more details (Help | Show Log) (1m 47s 591ms)
2018-08-13 10:58:35,233 [e-1024-b02]   INFO - idea.project.IndexingSuspender - Consuming IndexingSuspender deactivation event: SYNC_FINISHED
2018-08-13 10:58:35,233 [e-1024-b02]   INFO - idea.project.IndexingSuspender - Finishing batch update for project: Project 'C:\Users\surya.s02\AndroidStudioProjects\MyApplication' My Application
2018-08-13 10:58:35,435 [thread 379]   INFO -       #com.jetbrains.cidr.lang - Clearing symbols finished in 0 s.
2018-08-13 10:58:35,436 [thread 379]   INFO -       #com.jetbrains.cidr.lang - Building symbols in FAST mode, 0 source files from total 0 project files
2018-08-13 10:58:35,446 [thread 379]   INFO -       #com.jetbrains.cidr.lang - Loading Module Maps finished in 0 s.
2018-08-13 10:58:35,450 [thread 379]   INFO -       #com.jetbrains.cidr.lang - Saving Module Maps finished in 0 s.
2018-08-13 10:58:35,451 [thread 379]   INFO -       #com.jetbrains.cidr.lang - Saving Module Maps finished in 0 s.
2018-08-13 10:58:35,451 [thread 379]   INFO -       #com.jetbrains.cidr.lang - Loaded 0 tables for 0 files (0 project files)
2018-08-13 10:58:35,463 [thread 379]   INFO -       #com.jetbrains.cidr.lang - Building symbols for 0 source files
2018-08-13 10:58:35,497 [thread 379]   INFO -       #com.jetbrains.cidr.lang - Building symbols for 0 unused headers
2018-08-13 10:58:35,497 [thread 379]   INFO -       #com.jetbrains.cidr.lang - Building symbols finished in 0 s.
2018-08-13 10:58:35,498 [thread 379]   INFO -       #com.jetbrains.cidr.lang - Saving modified symbols for 0 files (0 tables of total 0)
2018-08-13 10:58:35,498 [thread 379]   INFO -       #com.jetbrains.cidr.lang - Saving symbols finished in 0 s.
2018-08-13 11:04:22,331 [e-1024-b02]   INFO - ide.actions.ShowFilePathAction -
Exit code 1
```

答: Just  go to the .gradle folder in your Users/{username}/.gradle. Open gradle properties if there are proxy settings, comment them out and save it.(This problem might occur because Android studio does not automatically clear proxy cache settings). And Sync your project</p>

Body:
While creating a simple project in Android Studio, I am getting this error.

The log file for your reference:

2018-08-13 10:56:47,583 [e-1024-b02]   INFO - e.project.sync.GradleSyncState - Started sync with Gradle for project 'My Application'.
2018-08-13 10:56:47,591 [e-1024-b02]   INFO - idea.project.IndexingSuspender - Consuming IndexingSuspender activation event: SYNC_STARTED
2018-08-13 10:56:47,591 [e-1024-b02]   INFO - idea.project.IndexingSuspender - Starting batch update for project: Project 'C:\Users\surya.s02\AndroidStudioProjects\MyApplication' My Application
2018-08-13 10:56:47,624 [thread 380]   INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from C:/Program Files/Android/Android Studio/jre
2018-08-13 10:56:47,631 [thread 380]   INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from C:/Program Files/Android/Android Studio/jre
2018-08-13 10:56:47,998 [thread 380]   INFO - xecution.GradleExecutionHelper - Passing command-line args to Gradle Tooling API: -Didea.version=3.1 -Djava.awt.headless=true -Pandroid.injected.build.model.only=true -Pandroid.injected.build.model.only.advanced=true -Pandroid.injected.invoked.from.ide=true -Pandroid.injected.build.model.only.versioned=3 -Pandroid.injected.studio.version=3.1.3.0 -Pandroid.builder.sdkDownload=false --init-script C:\Users\surya.s02\AppData\Local\Temp\ijinit.gradle
2018-08-13 10:58:35,124 [thread 380]   INFO - .project.GradleProjectResolver - Gradle project resolve error
org.gradle.tooling.BuildException: Could not run build action using Gradle distribution 'https://services.gradle.org/distributions/gradle-4.4-all.zip'.
    at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:51)
    at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:29)
    at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:41)
    at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:57)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
    at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:46)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
    at java.lang.Thread.run(Thread.java:745)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.gradle.internal.exceptions.LocationAwareException: A problem occurred configuring root project 'MyApplication'.
    at org.gradle.initialization.DefaultExceptionAnalyser.transform(DefaultExceptionAnalyser.java:74)
    at org.gradle.initialization.MultipleBuildFailuresExceptionAnalyser.transform(MultipleBuildFailuresExceptionAnalyser.java:47)
    at org.gradle.tooling.internal.provider.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:51)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:47)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30)
    at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:39)
    at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:25)
    at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:80)
    at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:53)
    at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:57)
    at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:32)
    at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36)
    at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25)
    at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43)
    at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29)
    at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:69)
    at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:30)
    at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:59)
    at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:44)
    at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:45)
    at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:30)
    at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
    at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
    at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
    at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:295)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: org.gradle.api.ProjectConfigurationException: A problem occurred configuring root project 'MyApplication'.
    at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator.java:94)
    at org.gradle.configuration.project.LifecycleProjectEvaluator.doConfigure(LifecycleProjectEvaluator.java:66)
    at org.gradle.configuration.project.LifecycleProjectEvaluator.access$100(LifecycleProjectEvaluator.java:34)

Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':classpath'.
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.rethrowFailure(DefaultConfiguration.java:918)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.access$1600(DefaultConfiguration.java:116)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection.getFiles(DefaultConfiguration.java:892)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.getFiles(DefaultConfiguration.java:404)
    at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration_Decorated.getFiles(Unknown Source)
    at org.gradle.api.internal.file.AbstractFileCollection.iterator(AbstractFileCollection.java:68)
    at org.gradle.internal.classpath.DefaultClassPath.<init>(DefaultClassPath.java:48)
    at org.gradle.api.internal.initialization.DefaultScriptClassPathResolver.resolveClassPath(DefaultScriptClassPathResolver.java:39)
    at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:26)
    at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:34)
    at org.gradle.configuration.project.LifecycleProjectEvaluator.doConfigure(LifecycleProjectEvaluator.java:64)
    ... 81 more
Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jre8:1.2.0.
Required by:
    project : > com.android.tools.build:gradle:3.1.3 > com.android.tools.build:gradle-core:3.1.3
    project : > com.android.tools.build:gradle:3.1.3 > com.android.tools.build:gradle-core:3.1.3 > com.android.tools.build:builder:3.1.3
    project : > com.android.tools.build:gradle:3.1.3 > com.android.tools.build:gradle-core:3.1.3 > com.android.tools.lint:lint-gradle-api:26.1.3
    project : > com.android.tools.build:gradle:3.1.3 > com.android.tools.build:gradle-core:3.1.3 > com.android.tools.build:gradle-api:3.1.3
    project : > com.android.tools.build:gradle:3.1.3 > com.android.tools.build:gradle-core:3.1.3 > com.android.databinding:compilerCommon:3.1.3
    project : > com.android.tools.build:gradle:3.1.3 > com.android.tools.build:gradle-core:3.1.3 > com.android.tools.build:builder:3.1.3 > com.android.tools:sdk-common:26.1.3
    project : > com.android.tools.build:gradle:3.1.3 > com.android.tools.build:gradle-core:3.1.3 > com.android.tools.build:builder:3.1.3 > com.android.tools.build:manifest-merger:26.1.3
    project : > com.android.tools.build:gradle:3.1.3 > com.android.tools.build:gradle-core:3.1.3 > com.android.tools.build:builder:3.1.3 > com.android.tools:sdklib:26.1.3 > com.android.tools:repository:26.1.3
    at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryChainComponentMetaDataResolver.resolveModule(RepositoryChainComponentMetaDataResolver.java:103)
    at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryChainComponentMetaDataResolver.resolve(RepositoryChainComponentMetaDataResolver.java:63)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.ComponentResolversChain$ComponentMetaDataResolverChain.resolve(ComponentResolversChain.java:93)
    at org.gradle.api.internal.artifacts.ivyservice.clientmodule.ClientModuleResolver.resolve(ClientModuleResolver.java:48)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.ComponentState.resolve(ComponentState.java:157)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.ComponentState.getMetaData(ComponentState.java:168)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.EdgeState.calculateTargetConfigurations(EdgeState.java:134)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.EdgeState.attachToTargetConfigurations(EdgeState.java:105)
    at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder.attachToTargetRevisionsSerially(DependencyGraphBuilder.java:239)
    at org.gradle.internal.resource.BuildOperationFiringExternalResourceDecorator.withContentIfPresent(BuildOperationFiringExternalResourceDecorator.java:229)
    at org.gradle.internal.resource.transfer.DefaultCacheAwareExternalResourceAccessor.copyToCache(DefaultCacheAwareExternalResourceAccessor.java:199)
    ... 148 more
Caused by: java.net.SocketException: Connection reset
    at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:394)
    at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.upgrade(DefaultHttpClientConnectionOperator.java:185)
    at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.upgrade(PoolingHttpClientConnectionManager.java:369)
    at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:415)
    at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
    at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
    at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
    at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
    at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
    at org.gradle.internal.resource.transport.http.HttpClientHelper.performHttpRequest(HttpClientHelper.java:148)
    at org.gradle.internal.resource.transport.http.HttpClientHelper.performHttpRequest(HttpClientHelper.java:126)
    at org.gradle.internal.resource.transport.http.HttpClientHelper.executeGetOrHead(HttpClientHelper.java:103)
    at org.gradle.internal.resource.transport.http.HttpClientHelper.performRequest(HttpClientHelper.java:94)
    ... 163 more
2018-08-13 10:58:35,148 [thread 380]   WARN - nal.AbstractExternalSystemTask - Connection reset
com.intellij.openapi.externalSystem.model.ExternalSystemException: Connection reset
    at com.android.tools.idea.gradle.project.sync.idea.ProjectImportErrorHandler.getUserFriendlyError(ProjectImportErrorHandler.java:72)
    at com.android.tools.idea.gradle.project.sync.idea.AndroidGradleProjectResolver.getUserFriendlyError(AndroidGradleProjectResolver.java:436)
    at org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension.getUserFriendlyError(AbstractProjectResolverExtension.java:158)
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:943)
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:923)
    at org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.execute(GradleExecutionHelper.java:210)
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:140)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:165)
    at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:315)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.net.SocketException: Connection reset
    at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:394)
    at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.upgrade(DefaultHttpClientConnectionOperator.java:185)
    at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.upgrade(PoolingHttpClientConnectionManager.java:369)
    at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:415)
    at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
    at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
    at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
    at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
    at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
    at org.gradle.internal.resource.transport.http.HttpClientHelper.performHttpRequest(HttpClientHelper.java:148)
    at org.gradle.internal.resource.transport.http.HttpClientHelper.performHttpRequest(HttpClientHelper.java:126)
    at org.gradle.internal.resource.transport.http.HttpClientHelper.executeGetOrHead(HttpClientHelper.java:103)
    at org.gradle.internal.resource.transport.http.HttpClientHelper.performRequest(HttpClientHelper.java:94)
    at org.gradle.internal.resource.transport.http.HttpClientHelper.performRawGet(HttpClientHelper.java:80)
    at org.gradle.internal.resource.transport.http.HttpClientHelper.performGet(HttpClientHelper.java:84)
    at org.gradle.internal.resource.transport.http.HttpResourceAccessor.openResource(HttpResourceAccessor.java:43)
    at org.gradle.internal.resource.transport.http.HttpResourceAccessor.openResource(HttpResourceAccessor.java:29)
    at org.gradle.internal.resource.transfer.DefaultExternalResourceConnector.openResource(DefaultExternalResourceConnector.java:56)
    at org.gradle.internal.resource.transfer.ProgressLoggingExternalResourceAccessor.openResource(ProgressLoggingExternalResourceAccessor.java:36)
    at org.gradle.internal.resource.transfer.AccessorBackedExternalResource.withContentIfPresent(AccessorBackedExternalResource.java:130)
    at org.gradle.internal.resource.BuildOperationFiringExternalResourceDecorator$11.call(BuildOperationFiringExternalResourceDecorator.java:237)
    at org.gradle.internal.resource.BuildOperationFiringExternalResourceDecorator$11.call(BuildOperationFiringExternalResourceDecorator.java:229)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
    at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:82)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
    at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
    at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:295)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)

2018-08-13 10:58:35,174 [thread 380]   WARN - ect.sync.idea.ProjectSetUpTask - Connection reset
2018-08-13 10:58:35,175 [thread 380]   INFO - e.project.sync.GradleSyncState - Gradle sync failed: Connection reset

Consult IDE log for more details (Help | Show Log) (1m 47s 591ms)
2018-08-13 10:58:35,233 [e-1024-b02]   INFO - idea.project.IndexingSuspender - Consuming IndexingSuspender deactivation event: SYNC_FINISHED
2018-08-13 10:58:35,233 [e-1024-b02]   INFO - idea.project.IndexingSuspender - Finishing batch update for project: Project 'C:\Users\surya.s02\AndroidStudioProjects\MyApplication' My Application
2018-08-13 10:58:35,435 [thread 379]   INFO -       #com.jetbrains.cidr.lang - Clearing symbols finished in 0 s.
2018-08-13 10:58:35,436 [thread 379]   INFO -       #com.jetbrains.cidr.lang - Building symbols in FAST mode, 0 source files from total 0 project files
2018-08-13 10:58:35,446 [thread 379]   INFO -       #com.jetbrains.cidr.lang - Loading Module Maps finished in 0 s.
2018-08-13 10:58:35,450 [thread 379]   INFO -       #com.jetbrains.cidr.lang - Saving Module Maps finished in 0 s.
2018-08-13 10:58:35,451 [thread 379]   INFO -       #com.jetbrains.cidr.lang - Saving Module Maps finished in 0 s.
2018-08-13 10:58:35,451 [thread 379]   INFO -       #com.jetbrains.cidr.lang - Loaded 0 tables for 0 files (0 project files)
2018-08-13 10:58:35,463 [thread 379]   INFO -       #com.jetbrains.cidr.lang - Building symbols for 0 source files
2018-08-13 10:58:35,497 [thread 379]   INFO -       #com.jetbrains.cidr.lang - Building symbols for 0 unused headers
2018-08-13 10:58:35,497 [thread 379]   INFO -       #com.jetbrains.cidr.lang - Building symbols finished in 0 s.
2018-08-13 10:58:35,498 [thread 379]   INFO -       #com.jetbrains.cidr.lang - Saving modified symbols for 0 files (0 tables of total 0)
2018-08-13 10:58:35,498 [thread 379]   INFO -       #com.jetbrains.cidr.lang - Saving symbols finished in 0 s.
2018-08-13 11:04:22,331 [e-1024-b02]   INFO - ide.actions.ShowFilePathAction -
Exit code 1


问:
Is there a way my action work on my second site?
I created a multisite and have woocommerce set on both sites. I created an action hook on the functions.php which is working on the primary website but is not working on the second site on the network. I have various actions that are not working on the second site. Currently, the woocommerce is not network activated. I have tried network activating woocommerce but it still does not work.

Tried using

```<code>function forsitetwo() {
    if ( get_current_blog_id() === 2 ){

add_action( 'woocommerce_before_checkout_form', 'order_summary' );
        function order_summary() {
          echo '<div class="g-cols wpb_row type_default valign_top vc_inner  vc_custom_1549298472435" id="order_summary">
            <div class="vc_col-sm-12 wpb_column vc_column_container">
              <div class="vc_column-inner  vc_custom_1544731999039">
                <div class="wpb_wrapper">
                <h2 style="color: #ee2d63;text-align: left" class="vc_custom_heading">Summary of your order</h2>
                    <div class="wpb_text_column ">
                        <div class="wpb_wrapper">
                            <p>Thank you for choosing to advertise with Nuestra Vision. Please review your order and follow the prompts to complete your purchase. If you have any questions or concerns, please contact us at 1-888-688-8181 or through the chat window below.</p>
                      <p><input class="w-btn us-btn-style_1 icon_none" type="button" id="backto_btn" value="Back To Packages" onclick="history.back()"></p>
                        </div>
                    </div>
                </div>
              </div>
            </div>
          </div>';
        }

}
</code>```

I am expecting the custom summary to show up as it does on the primary website. This just one of the actions. I believe if I fix one then I will be able to fix the others

答:
Found the solution. So if you are using a multisite you want to access via FTP a folder called mu-plugins. There you would create a new php file and add your actions in that file. Now your actions should be working.

Reference: https://bjornjohansen.no/mu-plugins

Body:
I created a multisite and have woocommerce set on both sites. I created an action hook on the functions.php which is working on the primary website but is not working on the second site on the network. I have various actions that are not working on the second site. Currently, the woocommerce is not network activated. I have tried network activating woocommerce but it still does not work.

Tried using

function forsitetwo() {
    if ( get_current_blog_id() === 2 ){

add_action( 'woocommerce_before_checkout_form', 'order_summary' );
        function order_summary() {
          echo '

Summary of your order

Thank you for choosing to advertise with Nuestra Vision. Please review your order and follow the prompts to complete your purchase. If you have any questions or concerns, please contact us at 1-888-688-8181 or through the chat window below.

<input class="w-btn us-btn-style_1 icon_none" type="button" id="backto_btn" value="Back To Packages" onclick="history.back()">

';
        }

}

I am expecting the custom summary to show up as it does on the primary website. This just one of the actions. I believe if I fix one then I will be able to fix the others


问:
What's wrong in this loop?
I checked and i don't found errors:

```<code>$_SESSION['variable'] = 2
$preparado[1] = "Miguel";
$preparado[2] = "Carlos";
$segundo[1]= "Beltran";
$segundo[2] = "Sanz";

for($i = 1; $i <=$_SESSION['variable']; $i++){
  $listo[$i] = $preparado1[$i] . $segundo[1];
}

for($i = ($_SESSION['variable'] + 1) ; $i <= ($_SESSION['variable'] * 2); $i++){
  for($n = 1; $n <=$_SESSION['variable']; $n++){
    $listo[$i] = $preparado1[$n] . $segundo[2];
  }
}

for($i = 1;$i <=$_SESSION['variable'] * $_SESSION['extension']; $i++ ){
  echo   $final[$i] . "</br>";
}
</code>```

I  recibe this:

```<code>MiguelBeltran
CarlosBeltran
CarlosSanz
CarlosSanz
</code>```

But I should recibe this:

```<code>MiguelBeltran
CarlosBeltran
MiguelSanz
CarlosSanz
</code>```

Thanks!!

答:
I guess you intended </p>

```<code>$preparado[0] = "Miguel"; // rather than [1]
$preparado[1] = "Carlos";
</code>```

Title: What's wrong in this loop?

Body:
I checked and i don't found errors:

$_SESSION['variable'] = 2
$preparado[1] = "Miguel";
$preparado[2] = "Carlos";
$segundo[1]= "Beltran";
$segundo[2] = "Sanz";

for($i = 1; $i <=$_SESSION['variable']; $i++){
  $listo[$i] = $preparado1[$i] . $segundo[1];
}

for($i = ($_SESSION['variable'] + 1) ; $i <= ($_SESSION['variable'] * 2); $i++){
  for($n = 1; $n <=$_SESSION['variable']; $n++){
    $listo[$i] = $preparado1[$n] . $segundo[2];
  }
}

for($i = 1;$i <=$_SESSION['variable'] * $_SESSION['extension']; $i++ ){
  echo   $final[$i] . "
";
}

I  recibe this:

MiguelBeltran
CarlosBeltran
CarlosSanz
CarlosSanz

But I should recibe this:

MiguelBeltran
CarlosBeltran
MiguelSanz
CarlosSanz

Thanks!!

Body:
I guess you intended

$preparado[0] = "Miguel"; // rather than [1]
$preparado[1] = "Carlos";


答: Try declare your ArrayList myDoes as ArrayList<my_todo> myDoes and in your Adapter constructor parameter too. Only ArrayList you have an ArrayList of Object type.

Title: Can't find a method declared in other java file


问:
How to JOIN in geography columns using ST_CONTAINS in Big query
I have one BigQuery table with addresses including Lat/Lng and other BQ tables with working geom definitions imported from Census shapefiles. For each row in addresses table I am attempting to lookup which geom row contains it.

The following query were I look up an INDIVIDUAL lat/lng works fine:

```<code>SELECT SLDLST FROM `geographies.tl_2018_sldl_*` sldl WHERE ST_CONTAINS(sldl.geom, ST_GEOGPOINT(-95.221080, 38.974500));
</code>```

But when I attempt abstract into a join like

```<code>SELECT
  address_id,
  SLDLST
FROM `launchpad-239920.address_standardization.temp_delete_geo_match_sample` ssgolden
LEFT JOIN `geographies.tl_2018_sldl_*` sldl ON ST_CONTAINS(sldl.geom, ST_GEOGPOINT(ssgolden.longitude, ssgolden.latitude));
</code>```

I get an error:
"LEFT OUTER JOIN cannot be used without a condition that is an equality of fields from both sides of the join."

How do I restructure my join query to be able to extract the matching geography for each address?

答:
Below is for BigQuery Standard SQL

If you want to preserve not matching addresses in output  - you can use below

```<code>#standardSQL
WITH matched_addresses AS (
  SELECT
    address_id,
    SLDLST
  FROM `launchpad-239920.address_standardization.temp_delete_geo_match_sample` ssgolden
  JOIN `geographies.tl_2018_sldl_X` sldl
  ON ST_CONTAINS(sldl.geom, ST_GEOGPOINT(ssgolden.longitude, ssgolden.latitude))
)
SELECT * FROM matched_addresses UNION ALL
SELECT address_id, NULL
FROM `launchpad-239920.address_standardization.temp_delete_geo_match_sample`
WHERE NOT address_id IN (SELECT address_id FROM matched_addresses)
</code>```

but if you interested in only matched  - use below one

```<code>#standardSQL
WITH matched_addresses AS (
  SELECT
    address_id,
    SLDLST
  FROM `launchpad-239920.address_standardization.temp_delete_geo_match_sample` ssgolden
  JOIN `geographies.tl_2018_sldl_X` sldl
  ON ST_CONTAINS(sldl.geom, ST_GEOGPOINT(ssgolden.longitude, ssgolden.latitude))
)
SELECT * FROM matched_addresses
</code>```

Body:
I have one BigQuery table with addresses including Lat/Lng and other BQ tables with working geom definitions imported from Census shapefiles. For each row in addresses table I am attempting to lookup which geom row contains it.

The following query were I look up an INDIVIDUAL lat/lng works fine:

SELECT SLDLST FROM `geographies.tl_2018_sldl_*` sldl WHERE ST_CONTAINS(sldl.geom, ST_GEOGPOINT(-95.221080, 38.974500));

But when I attempt abstract into a join like

SELECT
  address_id,
  SLDLST
FROM `launchpad-239920.address_standardization.temp_delete_geo_match_sample` ssgolden
LEFT JOIN `geographies.tl_2018_sldl_*` sldl ON ST_CONTAINS(sldl.geom, ST_GEOGPOINT(ssgolden.longitude, ssgolden.latitude));

I get an error:
"LEFT OUTER JOIN cannot be used without a condition that is an equality of fields from both sides of the join."

How do I restructure my join query to be able to extract the matching geography for each address?

Body:
Below is for BigQuery Standard SQL

If you want to preserve not matching addresses in output  - you can use below

#standardSQL
WITH matched_addresses AS (
  SELECT
    address_id,
    SLDLST
  FROM `launchpad-239920.address_standardization.temp_delete_geo_match_sample` ssgolden
  JOIN `geographies.tl_2018_sldl_X` sldl
  ON ST_CONTAINS(sldl.geom, ST_GEOGPOINT(ssgolden.longitude, ssgolden.latitude))
)
SELECT * FROM matched_addresses UNION ALL
SELECT address_id, NULL
FROM `launchpad-239920.address_standardization.temp_delete_geo_match_sample`
WHERE NOT address_id IN (SELECT address_id FROM matched_addresses)

but if you interested in only matched  - use below one

#standardSQL
WITH matched_addresses AS (
  SELECT
    address_id,
    SLDLST
  FROM `launchpad-239920.address_standardization.temp_delete_geo_match_sample` ssgolden
  JOIN `geographies.tl_2018_sldl_X` sldl
  ON ST_CONTAINS(sldl.geom, ST_GEOGPOINT(ssgolden.longitude, ssgolden.latitude))
)
SELECT * FROM matched_addresses