问:
Kendo ListBox: Return dropped items in order
I am using two listboxes, connected with each other, that allow drag and drop between the two. While using the reorder code found in another thread fixes the issue with reordering items within the same list, it doesn't address the issue when dragging and dropping an item from one listbox to the other. I understand that is because this isn't a "reorder" action, it is a "drop" action. I've tried many different angles, like using the "add" event, but there is no "offset" property in the (e) object.

How can I accomplish the same thing, that is, keep the dropped item in the order it is visually dropped?

Here is my widget function with the reorder event that properly orders the items as they are displayed in the listBox (why this doesn't happen automatically is beyond me!). Remember, the reorder event only occurs when moving items within the same listBox, not when dragging an item from one listBox to another.

```<code>$("#myMenus").kendoListBox({
    draggable: true,
    connectWith: "baseMenus",
    dropSources: ["baseMenus"],
    add: function(e) {
        console.log('ADD');
        console.log(e);
    },
    reorder: function(e) {
        e.preventDefault();
        var dataSource = e.sender.dataSource;
        var dataItem = e.dataItems[0];
        var index = dataSource.indexOf(dataItem) + e.offset;
        dataSource.remove(dataItem);
        dataSource.insert(index, dataItem);
    },
});
</code>```

答:
I've managed to accomplish the same task, depending on the html hint that appears while dropping the item in the second listbox. I've modified your code with the solution.</p>

```<code>$("#myMenus").kendoListBox({
    draggable: true,
    connectWith: "baseMenus",
    dropSources: ["baseMenus"],
    add: function(e) {
        e.preventDefault();
        var dataSource = e.sender.dataSource;
        var dataItem = e.dataItems[0];
        var index = $('li.k-drop-hint').index();
        dataSource.insert(index, dataItem);
    },
    reorder: function(e) {
        e.preventDefault();
        var dataSource = e.sender.dataSource;
        var dataItem = e.dataItems[0];
        var index = dataSource.indexOf(dataItem) + e.offset;
        dataSource.remove(dataItem);
        dataSource.insert(index, dataItem);
    },
});
</code>```

Body:
I am using two listboxes, connected with each other, that allow drag and drop between the two. While using the reorder code found in another thread fixes the issue with reordering items within the same list, it doesn't address the issue when dragging and dropping an item from one listbox to the other. I understand that is because this isn't a "reorder" action, it is a "drop" action. I've tried many different angles, like using the "add" event, but there is no "offset" property in the (e) object.

How can I accomplish the same thing, that is, keep the dropped item in the order it is visually dropped?

Here is my widget function with the reorder event that properly orders the items as they are displayed in the listBox (why this doesn't happen automatically is beyond me!). Remember, the reorder event only occurs when moving items within the same listBox, not when dragging an item from one listBox to another.

$("#myMenus").kendoListBox({
    draggable: true,
    connectWith: "baseMenus",
    dropSources: ["baseMenus"],
    add: function(e) {
        console.log('ADD');
        console.log(e);
    },
    reorder: function(e) {
        e.preventDefault();
        var dataSource = e.sender.dataSource;
        var dataItem = e.dataItems[0];
        var index = dataSource.indexOf(dataItem) + e.offset;
        dataSource.remove(dataItem);
        dataSource.insert(index, dataItem);
    },
});

Body:
I've managed to accomplish the same task, depending on the html hint that appears while dropping the item in the second listbox. I've modified your code with the solution.

$("#myMenus").kendoListBox({
    draggable: true,
    connectWith: "baseMenus",
    dropSources: ["baseMenus"],
    add: function(e) {
        e.preventDefault();
        var dataSource = e.sender.dataSource;
        var dataItem = e.dataItems[0];
        var index = $('li.k-drop-hint').index();
        dataSource.insert(index, dataItem);
    },
    reorder: function(e) {
        e.preventDefault();
        var dataSource = e.sender.dataSource;
        var dataItem = e.dataItems[0];
        var index = dataSource.indexOf(dataItem) + e.offset;
        dataSource.remove(dataItem);
        dataSource.insert(index, dataItem);
    },
});


来源: stackexchange

问:
Serilog + serilog-sinks-elasticsearch +ElasticSearch Auth
I am far from being a Dev with any .net experience, but the dev team at work would like to use Serilog along with serilog-sinks-elasticsearch to push logs into my ELK stack.

Looking at the config for serilog-sinks-elasticsearch, there doesn't seem to be any way to send the creds require to write to the ElasticSearch Cluster.

Is this just a dumb ops person question or have I just missed the config somewhere?

Thanks

答:
I struggled to find a good solution for this too. Adding the username/password to the url definitely does work but somehow doesnt feel right.

This worked for me:

```<code>.WriteTo.Elasticsearch(new ElasticsearchSinkOptions(new Uri("https://your-deployment.westeurope.azure.elastic-cloud.com:9243"))
{
  ...,
  ModifyConnectionSettings = x => x.BasicAuthentication("elastic", "your-password"),
})
</code>```

ContentLicense: CC BY-SA 3.0

Body:
I struggled to find a good solution for this too. Adding the username/password to the url definitely does work but somehow doesnt feel right.

This worked for me:

.WriteTo.Elasticsearch(new ElasticsearchSinkOptions(new Uri("https://your-deployment.westeurope.azure.elastic-cloud.com:9243"))
{
  ...,
  ModifyConnectionSettings = x => x.BasicAuthentication("elastic", "your-password"),
})

ContentLicense: CC BY-SA 4.0


问:
how to make a fast pairwise Tanimoto distance function in R
I have a data.frame of items identified by an integer property ID, which is also the row number of the data.frame.

Each item has a vector of features FP associated to it. The elements of each FP are unique (within that FP). So for instance c(1,2,7) but never c(1,7,7).

The Tanimoto distance between any two ID's is defined as 1 minus the number of unique elements in the intersection of their FP's, divided by the number of unique elements in the union of their FP's.

I need to calculate such distances in the context of a 'maxmin' algorithm. See for instance this blog post.

The most important point to note is that I must NOT compute a full distance matrix (even with the best algorithms it would be unfeasible on the scale of datasets I am working with).

As explained in the above post, the strength of the iterative maxmin picker according to Roger Sayle's method is that one can avoid computing most of the pairwise distances, and instead calculate only the few relevant ones. Hence my question.

Here's what I could come up with so far:

```<code># make a random dataset

set.seed(1234567)
d <- sample(30:45, 1000, replace = T)
dd <- setNames(data.frame(do.call(rbind, sapply(d,function(n) list(sample(as.character(1:(45*2)), n, replace = F)), simplify = F))), "FP")
dd["ID"] <- 1:NROW(dd)

# define a pairwise distance function for ID's

distfun <- function(ID1,ID2) {
  FP1 <- dd$FP[[ID1]]
  FP2 <- dd$FP[[ID2]]
  int <- length(intersect(FP1,FP2))
  1 - int/(d[ID1]+d[ID2]-int)
}

# test performance of distance function

x <- sample(dd$ID, 200, replace = F)
y <- sample(dd$ID[!(dd$ID %in% x)], 200, replace = F)

pairwise.dist <- NULL

system.time(
  for(i in x) {
    for (j in y) {
      dij <- distfun(i,j)
      #pairwise.dist <- rbind(pairwise.dist,c(min(i,j),max(i,j),dij))
    }
  }
)
#   user  system elapsed
#   0.86    0.00    0.86
</code>```

Question 1 : do you think the distance function could be made faster?

I tried making a sparse matrix of the features (ddu.tab in the code below, where I omitted the denominator, which is trivial to compute from the intersection) and defining the distance function as vector operations, but that was much slower (a bit to my surprise, I must say).

```<code>ddu <- do.call(rbind, sapply(dd$ID, function(x) {data.frame("ID"=x, "FP"=dd$FP[[x]], stringsAsFactors = F)}, simplify = F))
ddu.tab <- xtabs(~ID+FP, ddu, sparse = T)
system.time(
  for(i in x) {
    for (j in y) {
      dij <- t(ddu.tab[i,]) %*% ddu.tab[j,]
      #pairwise.dist <- rbind(pairwise.dist,c(min(i,j),max(i,j),dij))
    }
  }
)
#   user  system elapsed
#  32.35    0.03   32.66
</code>```

Question 2 : actually less important than the distance calculation, but if anyone can advise... The update of pairwise.dist by rbind is (apparently) very costly. I don't know if I can do it differently (meaning not adding new elements at each iteration), because in the maxmin application the pairs of ID's whose distances are to be calculated are not known upfront like in this example, and pairwise.dist is continuously read and appended new elements.

Someone in the past suggested to me that lists may be better than matrices for read/write. If that is the case, I could write out pairwise.dist as a named list.

BTW, just FYI, in this specific example the full distance matrix is calculated quite fast:

```<code>system.time(ddu.dist <- dist(ddu.tab, method = "binary"))
#   user  system elapsed
#   0.61    0.00    0.61
</code>```

which seems to indicate that there is indeed a fast method to calculate binary distances.

If anyone could please advise and/or point me to relevant resources, it would be great.

Thanks!

答:
Not sure about speeding up the distance function itself, but you could replace your double loop, using the tidyverse, with

```<code>library(tidyverse)

results <- crossing(x = x, y = y) %>%             #all x,y combinations
  filter(x < y) %>%                               #remove duplicates
  mutate(pairwise.dist = map2_dbl(x, y, distfun)) #apply distance function
</code>```

Body:
I have a data.frame of items identified by an integer property ID, which is also the row number of the data.frame.

Each item has a vector of features FP associated to it. The elements of each FP are unique (within that FP). So for instance c(1,2,7) but never c(1,7,7).

The Tanimoto distance between any two ID's is defined as 1 minus the number of unique elements in the intersection of their FP's, divided by the number of unique elements in the union of their FP's.

I need to calculate such distances in the context of a 'maxmin' algorithm. See for instance this blog post.

The most important point to note is that I must NOT compute a full distance matrix (even with the best algorithms it would be unfeasible on the scale of datasets I am working with).

As explained in the above post, the strength of the iterative maxmin picker according to Roger Sayle's method is that one can avoid computing most of the pairwise distances, and instead calculate only the few relevant ones. Hence my question.

Here's what I could come up with so far:

# make a random dataset

set.seed(1234567)
d <- sample(30:45, 1000, replace = T)
dd <- setNames(data.frame(do.call(rbind, sapply(d,function(n) list(sample(as.character(1:(45*2)), n, replace = F)), simplify = F))), "FP")
dd["ID"] <- 1:NROW(dd)

# define a pairwise distance function for ID's

distfun <- function(ID1,ID2) {
  FP1 <- dd$FP[[ID1]]
  FP2 <- dd$FP[[ID2]]
  int <- length(intersect(FP1,FP2))
  1 - int/(d[ID1]+d[ID2]-int)
}

# test performance of distance function

x <- sample(dd$ID, 200, replace = F)
y <- sample(dd$ID[!(dd$ID %in% x)], 200, replace = F)

pairwise.dist <- NULL

system.time(
  for(i in x) {
    for (j in y) {
      dij <- distfun(i,j)
      #pairwise.dist <- rbind(pairwise.dist,c(min(i,j),max(i,j),dij))
    }
  }
)
#   user  system elapsed
#   0.86    0.00    0.86

Question 1 : do you think the distance function could be made faster?

I tried making a sparse matrix of the features (ddu.tab in the code below, where I omitted the denominator, which is trivial to compute from the intersection) and defining the distance function as vector operations, but that was much slower (a bit to my surprise, I must say).

ddu <- do.call(rbind, sapply(dd$ID, function(x) {data.frame("ID"=x, "FP"=dd$FP[[x]], stringsAsFactors = F)}, simplify = F))
ddu.tab <- xtabs(~ID+FP, ddu, sparse = T)
system.time(
  for(i in x) {
    for (j in y) {
      dij <- t(ddu.tab[i,]) %*% ddu.tab[j,]
      #pairwise.dist <- rbind(pairwise.dist,c(min(i,j),max(i,j),dij))
    }
  }
)
#   user  system elapsed
#  32.35    0.03   32.66

Question 2 : actually less important than the distance calculation, but if anyone can advise... The update of pairwise.dist by rbind is (apparently) very costly. I don't know if I can do it differently (meaning not adding new elements at each iteration), because in the maxmin application the pairs of ID's whose distances are to be calculated are not known upfront like in this example, and pairwise.dist is continuously read and appended new elements.

Someone in the past suggested to me that lists may be better than matrices for read/write. If that is the case, I could write out pairwise.dist as a named list.

BTW, just FYI, in this specific example the full distance matrix is calculated quite fast:

system.time(ddu.dist <- dist(ddu.tab, method = "binary"))
#   user  system elapsed
#   0.61    0.00    0.61

which seems to indicate that there is indeed a fast method to calculate binary distances.

If anyone could please advise and/or point me to relevant resources, it would be great.

Thanks!

Body:
Not sure about speeding up the distance function itself, but you could replace your double loop, using the tidyverse, with

library(tidyverse)

results <- crossing(x = x, y = y) %>%             #all x,y combinations
  filter(x < y) %>%                               #remove duplicates
  mutate(pairwise.dist = map2_dbl(x, y, distfun)) #apply distance function


问:
How to compare date variable with a given time?
I have an array with time values like 2020-02-17 10:00:00 AM.

I'm trying to write an if statement that executes when the time value is between two values.

```<code>If starttime(i) >= #10:00:00 AM# Then
    If starttime(i) < #10:30:00 AM# Then
</code>```

The first value in the array is 2020-02-17 10:00:00 AM and it passes the first line but not the second.

It passes the first line even if I write

```<code>If starttime(i) >= #10:10:00 AM# Then
</code>```

Why might this be?

答:
#10:00:00 AM# might look and read like a time literal value, it's not. VBA does not have any Time data type, this is a Date literal value, with an implicit date portion and a time part that says it's 10 AM.

Use the TimeValue function to strip the Date part and only work with times.

```<code>If starttime(i) >= #10:10:00 AM# Then
</code>```

That condition is always True, because the implicit Date part of the #10:10:00 AM# date literal is CDate(0), which is always going to be smaller than any other valid date value.

```<code>Debug.Print Year(#10:00:00 AM#), Month(#10:00:00 AM#), Day(#10:00:00 AM#)
 1899          12            30
</code>```

1899-12-30 is what 0 evaluates to as a date.

```<code>If TimeValue(starttime(i)) >= TimeValue(#10:00:00 AM#) Then
    If TimeValue(starttime(i)) < TimeValue(#10:30:00 AM#) Then
</code>```

Body:
I have an array with time values like 2020-02-17 10:00:00 AM.

I'm trying to write an if statement that executes when the time value is between two values.

If starttime(i) >= #10:00:00 AM# Then
    If starttime(i) < #10:30:00 AM# Then

The first value in the array is 2020-02-17 10:00:00 AM and it passes the first line but not the second.

It passes the first line even if I write

If starttime(i) >= #10:10:00 AM# Then

Why might this be?

Body:
#10:00:00 AM# might look and read like a time literal value, it's not. VBA does not have any Time data type, this is a Date literal value, with an implicit date portion and a time part that says it's 10 AM.

Use the TimeValue function to strip the Date part and only work with times.

If starttime(i) >= #10:10:00 AM# Then

That condition is always True, because the implicit Date part of the #10:10:00 AM# date literal is CDate(0), which is always going to be smaller than any other valid date value.

Debug.Print Year(#10:00:00 AM#), Month(#10:00:00 AM#), Day(#10:00:00 AM#)
 1899          12            30

1899-12-30 is what 0 evaluates to as a date.

If TimeValue(starttime(i)) >= TimeValue(#10:00:00 AM#) Then
    If TimeValue(starttime(i)) < TimeValue(#10:30:00 AM#) Then


问:
global variable become null when listener run
I try to send calendar date that I get from the activity and send it to fragment  recyclerView via bundle and I received the date correctly but when I press a checkbox and alert the fragment by listener the date value becomes null

this is the Viewholder code

```<code>    private class addStudentViewHolder extends RecyclerView.ViewHolder {
        private MaterialCheckBox checkBox;
        private MaterialTextView nameTv;
        private int id;
        private List<StudentAttendeesDataModel> models = new ArrayList<>();

        private addStudentViewHolder(View itemView) {
            super(itemView);
            checkBox = itemView.findViewById(R.id.take_attendees);
            nameTv = itemView.findViewById(R.id.person_name);
        }

    private void bind(int position) {
        final StudentDataModel dataModel = dataModels.get(position);
        nameTv.setText(dataModel.getName());
        checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                id = dataModel.getId();
                Toast.makeText(context, "in" + calendarDate, Toast.LENGTH_SHORT).show();
                if (isChecked) {
                    StudentAttendeesDataModel model = new StudentAttendeesDataModel(id, calendarDate, 1);
                    models.add(model);
                    mListener.onCheckedChanged(models);
                } else {
                    StudentAttendeesDataModel model = new StudentAttendeesDataModel(id, calendarDate, 0);
                    models.remove(model);
                    mListener.onCheckedChanged(models);
                }
            }
        });
    }
}
</code>```

and this is code in the fragment.

```<code>   @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            Bundle bundle = getArguments();
            if (bundle != null) {
                calendarDate = bundle.getString(DATE_CALENDAR_KEY);
            }
        }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View v = inflater.inflate(R.layout.fragment_student_recyclerview, container, false);
        RecyclerView recyclerView = v.findViewById(R.id.fragment_recyclerview);
        recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
        dataSource = new DataSource(getActivity());
        List<StudentDataModel> dataModels = new ArrayList<>();
        List<StudentAttendeesDataModel> data = dataSource.getStudentAttendenas();
        adapter = new AttendeesAdapter(2, data, getContext(), this);
        adapter.setOnCreateStudentData(dataModels);
        recyclerView.setAdapter(adapter);
        setHasOptionsMenu(true);
        return v;
    }

    @Override
    public void onResume() {
        super.onResume();
        List<StudentDataModel> dataModels = dataSource.getStudent();
        adapter.setStudentData(dataModels);
    }

    @Override
    public void onCheckedChanged(List<StudentAttendeesDataModel> models) {
        this.models = models;
    }
</code>```

the value becomes null exactly when I try to put it inside the adapter.

答: I solved the problem by make the variable static ):</p>

Body:
I try to send calendar date that I get from the activity and send it to fragment  recyclerView via bundle and I received the date correctly but when I press a checkbox and alert the fragment by listener the date value becomes null

this is the Viewholder code

    private class addStudentViewHolder extends RecyclerView.ViewHolder {
        private MaterialCheckBox checkBox;
        private MaterialTextView nameTv;
        private int id;
        private List<StudentAttendeesDataModel> models = new ArrayList<>();

        private addStudentViewHolder(View itemView) {
            super(itemView);
            checkBox = itemView.findViewById(R.id.take_attendees);
            nameTv = itemView.findViewById(R.id.person_name);
        }

    private void bind(int position) {
        final StudentDataModel dataModel = dataModels.get(position);
        nameTv.setText(dataModel.getName());
        checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                id = dataModel.getId();
                Toast.makeText(context, "in" + calendarDate, Toast.LENGTH_SHORT).show();
                if (isChecked) {
                    StudentAttendeesDataModel model = new StudentAttendeesDataModel(id, calendarDate, 1);
                    models.add(model);
                    mListener.onCheckedChanged(models);
                } else {
                    StudentAttendeesDataModel model = new StudentAttendeesDataModel(id, calendarDate, 0);
                    models.remove(model);
                    mListener.onCheckedChanged(models);
                }
            }
        });
    }
}

and this is code in the fragment.

   @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            Bundle bundle = getArguments();
            if (bundle != null) {
                calendarDate = bundle.getString(DATE_CALENDAR_KEY);
            }
        }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View v = inflater.inflate(R.layout.fragment_student_recyclerview, container, false);
        RecyclerView recyclerView = v.findViewById(R.id.fragment_recyclerview);
        recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
        dataSource = new DataSource(getActivity());
        List<StudentDataModel> dataModels = new ArrayList<>();
        List<StudentAttendeesDataModel> data = dataSource.getStudentAttendenas();
        adapter = new AttendeesAdapter(2, data, getContext(), this);
        adapter.setOnCreateStudentData(dataModels);
        recyclerView.setAdapter(adapter);
        setHasOptionsMenu(true);
        return v;
    }

    @Override
    public void onResume() {
        super.onResume();
        List<StudentDataModel> dataModels = dataSource.getStudent();
        adapter.setStudentData(dataModels);
    }

    @Override
    public void onCheckedChanged(List<StudentAttendeesDataModel> models) {
        this.models = models;
    }

the value becomes null exactly when I try to put it inside the adapter.


问:
I am compiling an e-commerce application, but I am getting the following errors in the gradle console
I am compiling an e-commerce application, but I am getting the following errors in the gradle console:

```<code> at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.accept(ExecuteActionsTaskExecuter.java:151)
 at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.accept(ExecuteActionsTaskExecuter.java:148)
 at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:191)
 at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:141)
 at org.gradle.api.internal.tasks.execution.ResolveBeforeExecutionStateTaskExecuter.execute(ResolveBeforeExecutionStateTaskExecuter.java:75)
 at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:62)
 at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:108)
 at org.gradle.api.internal.tasks.execution.ResolveBeforeExecutionOutputsTaskExecuter.execute(ResolveBeforeExecutionOutputsTaskExecuter.java:67)
 at org.gradle.api.internal.tasks.execution.ResolveAfterPreviousExecutionStateTaskExecuter.execute(ResolveAfterPreviousExecutionStateTaskExecuter.java:46)
 at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:94)
 at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
 at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:95)
 at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
 at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
 at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
 at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:73)
 at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
 at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:49)
 at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
 at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
 at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
 at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
 at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
 at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
 at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
 at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:49)
 at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:43)
 at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:355)
 at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:343)
 at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:336)
 at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:322)
 at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:134)
 at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:129)
 at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:202)
 at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:193)
 at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:129)
 at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
 at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
 at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
 at java.lang.Thread.run(Thread.java:748)
 Caused by: com.android.ide.common.workers.WorkerExecutorException: 1 exception was raised by workers:
 java.lang.RuntimeException: Duplicate class android.support.v4.app.INotificationSideChannel found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.app.INotificationSideChannel$Stub found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.app.INotificationSideChannel$Stub$Proxy found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.os.IResultReceiver found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.os.IResultReceiver$Stub found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.os.IResultReceiver$Stub$Proxy found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.os.ResultReceiver found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.os.ResultReceiver$1 found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.os.ResultReceiver$MyResultReceiver found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.os.ResultReceiver$MyRunnable found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)

 Go to the documentation to learn how to Fix dependency resolution errors.

 at com.android.ide.common.workers.ExecutorServiceAdapter.await(ExecutorServiceAdapter.kt:108)
 at com.android.build.gradle.internal.tasks.CheckDuplicateClassesDelegate.run(CheckDuplicateClassesDelegate.kt:67)
 at com.android.build.gradle.internal.tasks.CheckDuplicateClassesTask.doTaskAction(CheckDuplicateClassesTask.kt:61)
 at com.android.build.gradle.internal.tasks.NonIncrementalTask$taskAction$$inlined$recordTaskAction$1.invoke(AndroidVariantTask.kt:51)
 at com.android.build.gradle.internal.tasks.NonIncrementalTask$taskAction$$inlined$recordTaskAction$1.invoke(AndroidVariantTask.kt:31)
 at com.android.build.gradle.internal.tasks.Blocks.recordSpan(Blocks.java:91)
 at com.android.build.gradle.internal.tasks.NonIncrementalTask.taskAction(NonIncrementalTask.kt:34)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:498)
 at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:103)
 at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:48)
 at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:41)
 at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:28)
 at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:702)
 at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:669)
 at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$5.run(ExecuteActionsTaskExecuter.java:404)
 at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
 at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
 at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
 at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
 at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
 at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
 at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
 at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:393)
 at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:376)
 at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$200(ExecuteActionsTaskExecuter.java:80)
 at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:213)
 at org.gradle.internal.execution.steps.ExecuteStep.lambda$execute$1(ExecuteStep.java:33)
 at java.util.Optional.orElseGet(Optional.java:267)
 at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:33)
 at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:26)
 at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:58)
 at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:35)
 at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:48)
 at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:33)
 at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:39)
 at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:73)
 at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:54)
 at org.gradle.internal.execution.steps.CatchExceptionStep.execute(CatchExceptionStep.java:35)
 at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:51)
 at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:45)
 at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:31)
 at org.gradle.internal.execution.steps.CacheStep.executeWithoutCache(CacheStep.java:201)
 at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:70)
 at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:45)
 at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:49)
 at org.gradle.internal.execution.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:43)
 at org.gradle.internal.execution.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:32)
 at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:38)
 at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:24)
 at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:96)
 at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.java:89)
 at java.util.Optional.map(Optional.java:215)
 at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:54)
 at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:38)
 at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:77)
 at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:37)
 at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:36)
 at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:26)
 at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:90)
 at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:48)
 at org.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.java:33)
 at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:120)
 ... 38 more
 Caused by: java.util.concurrent.ExecutionException: java.lang.RuntimeException: Duplicate class android.support.v4.app.INotificationSideChannel found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.app.INotificationSideChannel$Stub found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.app.INotificationSideChannel$Stub$Proxy found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.os.IResultReceiver found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.os.IResultReceiver$Stub found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.os.IResultReceiver$Stub$Proxy found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.os.ResultReceiver found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.os.ResultReceiver$1 found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.os.ResultReceiver$MyResultReceiver found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.os.ResultReceiver$MyRunnable found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)

 Go to the documentation to learn how to Fix dependency resolution errors.
 at java.util.concurrent.ForkJoinTask.get(ForkJoinTask.java:1006)
 at com.android.ide.common.workers.ExecutorServiceAdapter.await(ExecutorServiceAdapter.kt:102)
 ... 102 more
 Caused by: java.lang.RuntimeException: Duplicate class android.support.v4.app.INotificationSideChannel found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.app.INotificationSideChannel$Stub found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.app.INotificationSideChannel$Stub$Proxy found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.os.IResultReceiver found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.os.IResultReceiver$Stub found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.os.IResultReceiver$Stub$Proxy found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.os.ResultReceiver found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.os.ResultReceiver$1 found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.os.ResultReceiver$MyResultReceiver found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.os.ResultReceiver$MyRunnable found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)

 Go to the documentation to learn how to Fix dependency resolution errors.
 at com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable.run(CheckDuplicateClassesDelegate.kt:128)
 at com.android.ide.common.workers.ExecutorServiceAdapter$submit$submission$1.run(ExecutorServiceAdapter.kt:68)
 at java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1386)
 at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
 at java.util.concurrent.ForkJoinTask.externalInterruptibleAwaitDone(ForkJoinTask.java:361)
 at java.util.concurrent.ForkJoinTask.get(ForkJoinTask.java:1001)
 ... 103 more

</code>```

below my build.gradle

```<code>```
    buildscript {
repositories {
    maven { url 'https://plugins.gradle.org/m2/'}
}
dependencies {
    classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.12.3'
}
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'

repositories {
maven { url 'https://maven.google.com' }
}

apply plugin: 'com.android.application'

android {
compileSdkVersion 29
defaultConfig {
    applicationId 'br.com.coalaresolve.appvale'

    manifestPlaceholders = [onesignal_app_id: "ad359056-018a-4db5-ae4f-915e177adf87",
                            // Project number pulled from dashboard, local value is ignored.
                            onesignal_google_project_number: "REMOTE"]

    minSdkVersion 18
    targetSdkVersion 29
    versionCode 7
    versionName '3.1.0'
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
productFlavors {
}
compileOptions {
    sourceCompatibility = 1.8
    targetCompatibility = 1.6
}
buildToolsVersion = '28.0.3'
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.balysv:material-ripple:1.0.2'
implementation 'com.github.clans:fab:1.6.4'
implementation 'com.google.firebase:firebase-messaging:20.1.0'
implementation 'com.google.firebase:firebase-core:17.2.2'
implementation 'com.android.volley:volley:1.1.1'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.makeramen:roundedimageview:2.3.0'
implementation 'com.onesignal:OneSignal:3.12.6'
implementation 'com.karumi:dexter:6.0.2'
}

apply plugin: 'com.google.gms.google-services'
```

<p>Whenever I am going to compose this error it is presented to me, I have already installed AndroidStudio on another machine but it continues to present the error message, I no longer know what to do.</p>

<p><strong>New Error:</strong></p>

```org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:compileDebugJavaWithJavac'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.accept(ExecuteActionsTaskExecuter.java:151)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.accept(ExecuteActionsTaskExecuter.java:148)
at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:191)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:141)
at org.gradle.api.internal.tasks.execution.ResolveBeforeExecutionStateTaskExecuter.execute(ResolveBeforeExecutionStateTaskExecuter.java:75)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:62)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:108)
at org.gradle.api.internal.tasks.execution.ResolveBeforeExecutionOutputsTaskExecuter.execute(ResolveBeforeExecutionOutputsTaskExecuter.java:67)
at org.gradle.api.internal.tasks.execution.ResolveAfterPreviousExecutionStateTaskExecuter.execute(ResolveAfterPreviousExecutionStateTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:94)
at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:95)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:73)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:49)
...

Caused by: org.gradle.api.internal.tasks.compile.CompilationFailedException: Compilation failed; see the compiler error output for details.
at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:52)
at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:36)
at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.delegateAndHandleErrors(NormalizingJavaCompiler.java:100)
at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:52)
at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:38)
at org.gradle.api.internal.tasks.compile.AnnotationProcessorDiscoveringCompiler.execute(AnnotationProcessorDiscoveringCompiler.java:51)
at org.gradle.api.internal.tasks.compile.AnnotationProcessorDiscoveringCompiler.execute(AnnotationProcessorDiscoveringCompiler.java:37)
at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:39)
at org.gradle.api.internal.tasks.compile.incremental.IncrementalCompilerFactory$2.execute(IncrementalCompilerFactory.java:110)
at org.gradle.api.internal.tasks.compile.incremental.IncrementalCompilerFactory$2.execute(IncrementalCompilerFactory.java:106)
at org.gradle.api.internal.tasks.compile.incremental.IncrementalResultStoringCompiler.execute(IncrementalResultStoringCompiler.java:60)
at org.gradle.api.internal.tasks.compile.incremental.IncrementalResultStoringCompiler.execute(IncrementalResultStoringCompiler.java:44)
at org.gradle.api.internal.tasks.compile.CompileJavaBuildOperationReportingCompiler$2.call(CompileJavaBuildOperationReportingCompiler.java:59)
at org.gradle.api.internal.tasks.compile.CompileJavaBuildOperationReportingCompiler$2.call(CompileJavaBuildOperationReportingCompiler.java:51)

... 38 more
```

答:
Your error is

Duplicate class android.support.v4.app.INotificationSideChannel found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)

In order to solve it you should enable Jetifier in ur gradle.properties file

```<code>android.useAndroidX=true
android.enableJetifier=true
</code>```

Normally you should not have support library and androidx dependencies in one project

Jetifier will replace support dependency to equal androidx dependency automatically

Body:
I am compiling an e-commerce application, but I am getting the following errors in the gradle console:

 at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.accept(ExecuteActionsTaskExecuter.java:151)
 at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.accept(ExecuteActionsTaskExecuter.java:148)
 at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:191)
 at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:141)
 at org.gradle.api.internal.tasks.execution.ResolveBeforeExecutionStateTaskExecuter.execute(ResolveBeforeExecutionStateTaskExecuter.java:75)
 at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:62)
 at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:108)
 at org.gradle.api.internal.tasks.execution.ResolveBeforeExecutionOutputsTaskExecuter.execute(ResolveBeforeExecutionOutputsTaskExecuter.java:67)
 at org.gradle.api.internal.tasks.execution.ResolveAfterPreviousExecutionStateTaskExecuter.execute(ResolveAfterPreviousExecutionStateTaskExecuter.java:46)
 at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:94)
 at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
 at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:95)
 at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
 at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
 at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
 at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:73)
 at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
 at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:49)
 at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
 at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
 at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
 at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
 at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
 at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
 at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
 at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:49)
 at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:43)
 at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:355)
 at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:343)
 at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:336)
 at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:322)
 at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:134)
 at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:129)
 at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:202)
 at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:193)
 at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:129)
 at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
 at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
 at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
 at java.lang.Thread.run(Thread.java:748)
 Caused by: com.android.ide.common.workers.WorkerExecutorException: 1 exception was raised by workers:
 java.lang.RuntimeException: Duplicate class android.support.v4.app.INotificationSideChannel found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.app.INotificationSideChannel$Stub found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.app.INotificationSideChannel$Stub$Proxy found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.os.IResultReceiver found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.os.IResultReceiver$Stub found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.os.IResultReceiver$Stub$Proxy found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.os.ResultReceiver found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.os.ResultReceiver$1 found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.os.ResultReceiver$MyResultReceiver found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.os.ResultReceiver$MyRunnable found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)

 Go to the documentation to learn how to Fix dependency resolution errors.

 at com.android.ide.common.workers.ExecutorServiceAdapter.await(ExecutorServiceAdapter.kt:108)
 at com.android.build.gradle.internal.tasks.CheckDuplicateClassesDelegate.run(CheckDuplicateClassesDelegate.kt:67)
 at com.android.build.gradle.internal.tasks.CheckDuplicateClassesTask.doTaskAction(CheckDuplicateClassesTask.kt:61)
 at com.android.build.gradle.internal.tasks.NonIncrementalTask$taskAction$$inlined$recordTaskAction$1.invoke(AndroidVariantTask.kt:51)
 at com.android.build.gradle.internal.tasks.NonIncrementalTask$taskAction$$inlined$recordTaskAction$1.invoke(AndroidVariantTask.kt:31)
 at com.android.build.gradle.internal.tasks.Blocks.recordSpan(Blocks.java:91)
 at com.android.build.gradle.internal.tasks.NonIncrementalTask.taskAction(NonIncrementalTask.kt:34)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:498)
 at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:103)
 at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:48)
 at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:41)
 at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:28)
 at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:702)
 at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:669)
 at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$5.run(ExecuteActionsTaskExecuter.java:404)
 at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
 at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
 at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
 at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
 at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
 at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
 at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
 at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:393)
 at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:376)
 at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$200(ExecuteActionsTaskExecuter.java:80)
 at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:213)
 at org.gradle.internal.execution.steps.ExecuteStep.lambda$execute$1(ExecuteStep.java:33)
 at java.util.Optional.orElseGet(Optional.java:267)
 at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:33)
 at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:26)
 at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:58)
 at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:35)
 at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:48)
 at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:33)
 at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:39)
 at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:73)
 at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:54)
 at org.gradle.internal.execution.steps.CatchExceptionStep.execute(CatchExceptionStep.java:35)
 at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:51)
 at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:45)
 at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:31)
 at org.gradle.internal.execution.steps.CacheStep.executeWithoutCache(CacheStep.java:201)
 at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:70)
 at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:45)
 at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:49)
 at org.gradle.internal.execution.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:43)
 at org.gradle.internal.execution.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:32)
 at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:38)
 at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:24)
 at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:96)
 at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.java:89)
 at java.util.Optional.map(Optional.java:215)
 at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:54)
 at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:38)
 at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:77)
 at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:37)
 at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:36)
 at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:26)
 at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:90)
 at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:48)
 at org.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.java:33)
 at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:120)
 ... 38 more
 Caused by: java.util.concurrent.ExecutionException: java.lang.RuntimeException: Duplicate class android.support.v4.app.INotificationSideChannel found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.app.INotificationSideChannel$Stub found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.app.INotificationSideChannel$Stub$Proxy found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.os.IResultReceiver found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.os.IResultReceiver$Stub found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.os.IResultReceiver$Stub$Proxy found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.os.ResultReceiver found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.os.ResultReceiver$1 found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.os.ResultReceiver$MyResultReceiver found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.os.ResultReceiver$MyRunnable found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)

 Go to the documentation to learn how to Fix dependency resolution errors.
 at java.util.concurrent.ForkJoinTask.get(ForkJoinTask.java:1006)
 at com.android.ide.common.workers.ExecutorServiceAdapter.await(ExecutorServiceAdapter.kt:102)
 ... 102 more
 Caused by: java.lang.RuntimeException: Duplicate class android.support.v4.app.INotificationSideChannel found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.app.INotificationSideChannel$Stub found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.app.INotificationSideChannel$Stub$Proxy found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.os.IResultReceiver found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.os.IResultReceiver$Stub found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.os.IResultReceiver$Stub$Proxy found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.os.ResultReceiver found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.os.ResultReceiver$1 found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.os.ResultReceiver$MyResultReceiver found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)
 Duplicate class android.support.v4.os.ResultReceiver$MyRunnable found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)

 Go to the documentation to learn how to Fix dependency resolution errors.
 at com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable.run(CheckDuplicateClassesDelegate.kt:128)
 at com.android.ide.common.workers.ExecutorServiceAdapter$submit$submission$1.run(ExecutorServiceAdapter.kt:68)
 at java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1386)
 at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
 at java.util.concurrent.ForkJoinTask.externalInterruptibleAwaitDone(ForkJoinTask.java:361)
 at java.util.concurrent.ForkJoinTask.get(ForkJoinTask.java:1001)
 ... 103 more

below my build.gradle

    buildscript {
repositories {
    maven { url 'https://plugins.gradle.org/m2/'}
}
dependencies {
    classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.12.3'
}
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'

repositories {
maven { url 'https://maven.google.com' }
}

apply plugin: 'com.android.application'

android {
compileSdkVersion 29
defaultConfig {
    applicationId 'br.com.coalaresolve.appvale'

    manifestPlaceholders = [onesignal_app_id: "ad359056-018a-4db5-ae4f-915e177adf87",
                            // Project number pulled from dashboard, local value is ignored.
                            onesignal_google_project_number: "REMOTE"]

    minSdkVersion 18
    targetSdkVersion 29
    versionCode 7
    versionName '3.1.0'
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
productFlavors {
}
compileOptions {
    sourceCompatibility = 1.8
    targetCompatibility = 1.6
}
buildToolsVersion = '28.0.3'
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.balysv:material-ripple:1.0.2'
implementation 'com.github.clans:fab:1.6.4'
implementation 'com.google.firebase:firebase-messaging:20.1.0'
implementation 'com.google.firebase:firebase-core:17.2.2'
implementation 'com.android.volley:volley:1.1.1'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.makeramen:roundedimageview:2.3.0'
implementation 'com.onesignal:OneSignal:3.12.6'
implementation 'com.karumi:dexter:6.0.2'
}

apply plugin: 'com.google.gms.google-services'

Whenever I am going to compose this error it is presented to me, I have already installed AndroidStudio on another machine but it continues to present the error message, I no longer know what to do.

New Error:

org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:compileDebugJavaWithJavac'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.accept(ExecuteActionsTaskExecuter.java:151)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.accept(ExecuteActionsTaskExecuter.java:148)
at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:191)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:141)
at org.gradle.api.internal.tasks.execution.ResolveBeforeExecutionStateTaskExecuter.execute(ResolveBeforeExecutionStateTaskExecuter.java:75)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:62)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:108)
at org.gradle.api.internal.tasks.execution.ResolveBeforeExecutionOutputsTaskExecuter.execute(ResolveBeforeExecutionOutputsTaskExecuter.java:67)
at org.gradle.api.internal.tasks.execution.ResolveAfterPreviousExecutionStateTaskExecuter.execute(ResolveAfterPreviousExecutionStateTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:94)
at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:95)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:73)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:49)
...

Caused by: org.gradle.api.internal.tasks.compile.CompilationFailedException: Compilation failed; see the compiler error output for details.
at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:52)
at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:36)
at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.delegateAndHandleErrors(NormalizingJavaCompiler.java:100)
at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:52)
at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:38)
at org.gradle.api.internal.tasks.compile.AnnotationProcessorDiscoveringCompiler.execute(AnnotationProcessorDiscoveringCompiler.java:51)
at org.gradle.api.internal.tasks.compile.AnnotationProcessorDiscoveringCompiler.execute(AnnotationProcessorDiscoveringCompiler.java:37)
at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:39)
at org.gradle.api.internal.tasks.compile.incremental.IncrementalCompilerFactory$2.execute(IncrementalCompilerFactory.java:110)
at org.gradle.api.internal.tasks.compile.incremental.IncrementalCompilerFactory$2.execute(IncrementalCompilerFactory.java:106)
at org.gradle.api.internal.tasks.compile.incremental.IncrementalResultStoringCompiler.execute(IncrementalResultStoringCompiler.java:60)
at org.gradle.api.internal.tasks.compile.incremental.IncrementalResultStoringCompiler.execute(IncrementalResultStoringCompiler.java:44)
at org.gradle.api.internal.tasks.compile.CompileJavaBuildOperationReportingCompiler$2.call(CompileJavaBuildOperationReportingCompiler.java:59)
at org.gradle.api.internal.tasks.compile.CompileJavaBuildOperationReportingCompiler$2.call(CompileJavaBuildOperationReportingCompiler.java:51)

... 38 more

Body:
Your error is

Duplicate class android.support.v4.app.INotificationSideChannel found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-compat-26.0.0-runtime.jar (com.android.support:support-compat:26.0.0)

In order to solve it you should enable Jetifier in ur gradle.properties file

android.useAndroidX=true
android.enableJetifier=true

Normally you should not have support library and androidx dependencies in one project

Jetifier will replace support dependency to equal androidx dependency automatically


问:
How to do cache warmup in TYPO3
In another question, there is the recommendation to setup a cache_clearAtMidnight via TypoScript and do a subsequent cache warmup.

I would like to know how to do this cache warmup because I did not find a scheduler task to do it.

(Clearing the entire cache once a day seems excessive, but the cache warmup seems like a good idea to me in any case.)

答:
You can use this ext. Its simple wget wrapper but you can add it as Scheduler task.

https://github.com/visuellverstehen/t3fetch

Title: How to do cache warmup in TYPO3


问:
Deserialize JSON to List in C# in a console application
Error

Cannot deserialize the current JSON object (e.g. {"name":"value"})
  into type 'System.Collections.Generic.List`1[ConsoleApp1.Menu]'
  because the type requires a JSON array (e.g. [1,2,3]) to deserialize
  correctly. To fix this error either change the JSON to a JSON array
  (e.g. [1,2,3]) or change the deserialized type so that it is a normal
  .NET type (e.g. not a primitive type like integer, not a collection
  type like an array or List) that can be deserialized from a JSON
  object. JsonObjectAttribute can also be added to the type to force it
  to deserialize from a JSON object. Path 'Test', line 3, position 9.

Question

Why do I get this error?

At the end I want to achieve to write every menu item in the console. For now I am stuck with this error. How do I achieve a result (Output) like this:

```<code>ID: 1 Name: Frosted Pumpkin Bread
ID: 2 Name: Ground to Go
...
</code>```

The Console application

```<code>using System;
using System.Collections.Generic;
using System.Net;
using Newtonsoft.Json;

namespace ConsoleApp1
{
    public class MenuItem
    {
        public string ID { get; set; }
        public string Description { get; set; }
        public string Summary { get; set; }
        public string Name { get; set; }
        public string ImageFile { get; set; }
    }

    public class Menu
    {
        public List<MenuItem> Test { get; set; }
    }

    class Program
    {

        static void Main(string[] args)
        {
          var webclient = new WebClient();
          var json = webclient.DownloadString(@"C:\Users\devuser\source\repos\ConsoleApp1\ConsoleApp1\data.json");
          var model = JsonConvert.DeserializeObject<List<Menu>>(json);

            foreach (var item in model)
            {
                Console.WriteLine();
            }
        }
    }
}
</code>```

My JSON-File looks like this

```<code>
{

  "Test": [

    {
      "ID": "1",
      "Description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ut, tenetur natus doloremque laborum quos iste ipsum rerum obcaecati impedit odit illo dolorum ab tempora nihil dicta earum fugiat. Temporibus, voluptatibus. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ut, tenetur natus doloremque laborum quos iste ipsum rerum obcaecati impedit odit illo dolorum ab tempora nihil dicta earum fugiat. Temporibus, voluptatibus.",
      "Summary": "A seasonal delight we offer every autumn.  Pumpking bread with just a bit of spice, cream cheese frosting with just a hint of home.",
      "Name": "Frosted Pumpkin Bread",
      "ImageFile": "pumpkinbread.png"
    },
    {
      "ID": "2",
      "Description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ut, tenetur natus doloremque laborum quos iste ipsum rerum obcaecati impedit odit illo dolorum ab tempora nihil dicta earum fugiat. Temporibus, voluptatibus. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ut, tenetur natus doloremque laborum quos iste ipsum rerum obcaecati impedit odit illo dolorum ab tempora nihil dicta earum fugiat. Temporibus, voluptatibus.",
      "Summary": "Love our coffee? Take it with you so you never have to be without!",
      "Name": "Ground to Go",
      "ImageFile": "granola.png"
    },
    {
      "ID": "3",
      "Description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ut, tenetur natus doloremque laborum quos iste ipsum rerum obcaecati impedit odit illo dolorum ab tempora nihil dicta earum fugiat. Temporibus, voluptatibus. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ut, tenetur natus doloremque laborum quos iste ipsum rerum obcaecati impedit odit illo dolorum ab tempora nihil dicta earum fugiat. Temporibus, voluptatibus.",
      "Summary": "Do you prefer to grind your own coffee? No problem, we'll give you the beans.",
      "Name": "Bean there, done that!",
      "ImageFile": "beans.jpg"
    },
    {
      "ID": "4",
      "Description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ut, tenetur natus doloremque laborum quos iste ipsum rerum obcaecati impedit odit illo dolorum ab tempora nihil dicta earum fugiat. Temporibus, voluptatibus. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ut, tenetur natus doloremque laborum quos iste ipsum rerum obcaecati impedit odit illo dolorum ab tempora nihil dicta earum fugiat. Temporibus, voluptatibus.",
      "Summary": "They're just as round as donuts, but far more healthy! Freshly made every morning before sunrise.",
      "Name": "Fresh Bagels",
      "ImageFile": "bagel.png"
    },
    {
      "ID": "5",
      "Description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ut, tenetur natus doloremque laborum quos iste ipsum rerum obcaecati impedit odit illo dolorum ab tempora nihil dicta earum fugiat. Temporibus, voluptatibus. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ut, tenetur natus doloremque laborum quos iste ipsum rerum obcaecati impedit odit illo dolorum ab tempora nihil dicta earum fugiat. Temporibus, voluptatibus.",
      "Summary": "We've got strawberries, blueberries, apples, bananas - we could list them all, but we'd prefer you come take a look!",
      "Name": "Fresh Fruit",
      "ImageFile": "strawberries.png"
    }
  ]
}
</code>```

答:
THANX A LOT FOR YOUR ANSWERS!

Here is the working code!

```<code>using System;
using System.Collections.Generic;
using System.Net;
using Newtonsoft.Json;

namespace ConsoleApp1
{
    public class MenuItem
    {
        public string ID { get; set; }
        public string Description { get; set; }
        public string Summary { get; set; }
        public string Name { get; set; }
        public string ImageFile { get; set; }
    }

    public class Menu
    {
        public List<MenuItem> Test { get; set; }
    }

    class Program
    {

        static void Main(string[] args)
        {
          var webclient = new WebClient();
          var json = webclient.DownloadString(@"C:\Users\devuser\source\repos\ConsoleApp1\ConsoleApp1\data.json");
          var model = JsonConvert.DeserializeObject<Menu>(json);

            foreach (var item in model.Test)
            {
                Console.WriteLine("ID: "+item.ID+" "+"Name: "+item.Name);
            }
        }
    }
}
```
```

Body:
Error

Cannot deserialize the current JSON object (e.g. {"name":"value"})
  into type 'System.Collections.Generic.List`1[ConsoleApp1.Menu]'
  because the type requires a JSON array (e.g. [1,2,3]) to deserialize
  correctly. To fix this error either change the JSON to a JSON array
  (e.g. [1,2,3]) or change the deserialized type so that it is a normal
  .NET type (e.g. not a primitive type like integer, not a collection
  type like an array or List) that can be deserialized from a JSON
  object. JsonObjectAttribute can also be added to the type to force it
  to deserialize from a JSON object. Path 'Test', line 3, position 9.

Question

Why do I get this error?

At the end I want to achieve to write every menu item in the console. For now I am stuck with this error. How do I achieve a result (Output) like this:

ID: 1 Name: Frosted Pumpkin Bread
ID: 2 Name: Ground to Go
...

The Console application

using System;
using System.Collections.Generic;
using System.Net;
using Newtonsoft.Json;

namespace ConsoleApp1
{
    public class MenuItem
    {
        public string ID { get; set; }
        public string Description { get; set; }
        public string Summary { get; set; }
        public string Name { get; set; }
        public string ImageFile { get; set; }
    }

    public class Menu
    {
        public List<MenuItem> Test { get; set; }
    }

    class Program
    {

        static void Main(string[] args)
        {
          var webclient = new WebClient();
          var json = webclient.DownloadString(@"C:\Users\devuser\source\repos\ConsoleApp1\ConsoleApp1\data.json");
          var model = JsonConvert.DeserializeObject<List<Menu>>(json);

            foreach (var item in model)
            {
                Console.WriteLine();
            }
        }
    }
}

My JSON-File looks like this

{

  "Test": [

    {
      "ID": "1",
      "Description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ut, tenetur natus doloremque laborum quos iste ipsum rerum obcaecati impedit odit illo dolorum ab tempora nihil dicta earum fugiat. Temporibus, voluptatibus. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ut, tenetur natus doloremque laborum quos iste ipsum rerum obcaecati impedit odit illo dolorum ab tempora nihil dicta earum fugiat. Temporibus, voluptatibus.",
      "Summary": "A seasonal delight we offer every autumn.  Pumpking bread with just a bit of spice, cream cheese frosting with just a hint of home.",
      "Name": "Frosted Pumpkin Bread",
      "ImageFile": "pumpkinbread.png"
    },
    {
      "ID": "2",
      "Description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ut, tenetur natus doloremque laborum quos iste ipsum rerum obcaecati impedit odit illo dolorum ab tempora nihil dicta earum fugiat. Temporibus, voluptatibus. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ut, tenetur natus doloremque laborum quos iste ipsum rerum obcaecati impedit odit illo dolorum ab tempora nihil dicta earum fugiat. Temporibus, voluptatibus.",
      "Summary": "Love our coffee? Take it with you so you never have to be without!",
      "Name": "Ground to Go",
      "ImageFile": "granola.png"
    },
    {
      "ID": "3",
      "Description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ut, tenetur natus doloremque laborum quos iste ipsum rerum obcaecati impedit odit illo dolorum ab tempora nihil dicta earum fugiat. Temporibus, voluptatibus. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ut, tenetur natus doloremque laborum quos iste ipsum rerum obcaecati impedit odit illo dolorum ab tempora nihil dicta earum fugiat. Temporibus, voluptatibus.",
      "Summary": "Do you prefer to grind your own coffee? No problem, we'll give you the beans.",
      "Name": "Bean there, done that!",
      "ImageFile": "beans.jpg"
    },
    {
      "ID": "4",
      "Description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ut, tenetur natus doloremque laborum quos iste ipsum rerum obcaecati impedit odit illo dolorum ab tempora nihil dicta earum fugiat. Temporibus, voluptatibus. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ut, tenetur natus doloremque laborum quos iste ipsum rerum obcaecati impedit odit illo dolorum ab tempora nihil dicta earum fugiat. Temporibus, voluptatibus.",
      "Summary": "They're just as round as donuts, but far more healthy! Freshly made every morning before sunrise.",
      "Name": "Fresh Bagels",
      "ImageFile": "bagel.png"
    },
    {
      "ID": "5",
      "Description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ut, tenetur natus doloremque laborum quos iste ipsum rerum obcaecati impedit odit illo dolorum ab tempora nihil dicta earum fugiat. Temporibus, voluptatibus. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ut, tenetur natus doloremque laborum quos iste ipsum rerum obcaecati impedit odit illo dolorum ab tempora nihil dicta earum fugiat. Temporibus, voluptatibus.",
      "Summary": "We've got strawberries, blueberries, apples, bananas - we could list them all, but we'd prefer you come take a look!",
      "Name": "Fresh Fruit",
      "ImageFile": "strawberries.png"
    }
  ]
}

Body:
THANX A LOT FOR YOUR ANSWERS!

Here is the working code!

using System;
using System.Collections.Generic;
using System.Net;
using Newtonsoft.Json;

namespace ConsoleApp1
{
    public class MenuItem
    {
        public string ID { get; set; }
        public string Description { get; set; }
        public string Summary { get; set; }
        public string Name { get; set; }
        public string ImageFile { get; set; }
    }

    public class Menu
    {
        public List<MenuItem> Test { get; set; }
    }

    class Program
    {

        static void Main(string[] args)
        {
          var webclient = new WebClient();
          var json = webclient.DownloadString(@"C:\Users\devuser\source\repos\ConsoleApp1\ConsoleApp1\data.json");
          var model = JsonConvert.DeserializeObject<Menu>(json);

            foreach (var item in model.Test)
            {
                Console.WriteLine("ID: "+item.ID+" "+"Name: "+item.Name);
            }
        }
    }
}
```


问:
How would you programmatically test a file for viruses?
I want to programmatically test a file for viruses.

I'm aware of this thread, which didn't get a satisfactory answer in my opinion, but I'm not looking for an API here. Any kind of workaround to make it possible to test a file would be fine.

Of course, an API would probably be the best solution (I'm using .net on a Windows platform), but maybe it's possible to drop the file in the folder, and to then check whether I can still open it or if it's been quarantined by the antivirus software.

Has someone run into the same sort of situation?

答:
Platform?

Most Windows anti-virus provide shell integration (right click on a file in explorer to scan that file), which will either mean running an executable, DDE or COM. All of which provide an entry point to another program to call the same mechanism.

OwnerDisplayName: Brann

ContentLicense: CC BY-SA 2.5

LastEditorDisplayName: Svante

OwnerDisplayName: Richard


问:
Kusto - How to trim set of characters before a condition
I'm working on Azure App Insights, how do i Trim a string value ?

For Example: I have the customeDimension value for prop_Message as "Question: This is StackOverflow: Yes"

I want to trim everything before Yes and my result set should be "Yes"

Any suggestion?

I tried Trim() and Split(), Trim() requires a set of predefined string to be replaced and Split() just removes everything on the character count. In my case, the character count differs little bit.

答:
you could try something like this:</p>

```<code>datatable(customDimension:dynamic)
[
    dynamic({"prop_Message":"Question: This is StackOverflow: Yes"})
]
| parse customDimension.prop_Message with "Question:" * ":" result
</code>```

Body:
you could try something like this:

datatable(customDimension:dynamic)
[
    dynamic({"prop_Message":"Question: This is StackOverflow: Yes"})
]
| parse customDimension.prop_Message with "Question:" * ":" result


答:
Not sure if you're looking to split into an array instead of columns:

```<code>x <- strsplit(string, "/")
</code>```

Removing the backslash (escape character) for the "

```<code>gsub("\"", "", x[[1]])
</code>```

Title: How to divide this string into different columns, with certain criteria?

Body:
I need to separate in different columns the following string.

string = "H:Half-yearly/\"A:Outstanding - notional amounts\"/\"A:Total (all instruments)\"/\"B:Foreign exchange\"/\"5J:All countries (total)\"/\"A:Total (all counterparties)\"/\"5J:All countries (total)\"/\"A:Total (all sectors)\"/\"TO1:Total (all currencies)\"/\"USD:US dollar\"/\"A:Total (all maturities)\"/\"A:Total (all ratings)\"/\"3:Total (all methods)\"/\"C:Net - net\"/H:A:A:B:5J:A:5J:A:TO1:USD:A:A:3:C/19168639.500/19152273.382/16570931.333/16504473.647/17872834.161/18034192.743/18340526.000/18976252.550/20062793.085/21044051.427/24842918.967/27753186.875/28401867.500/30250361.915/32530354.232/31530866.590/38308896.039/41071533.056/47782829.500/55333816.999/61778797.231/51013377.932/49245196.366/49565196.793/53615697.500/57490500.198/64325378.832/63517357.370/66711084.080/66852981.078/71298569.378/67974223.786/71903681.455/73329825.600/69380854.616/66121018.427/75421500.092/70549837.635/77043460.796/74755778.576/84448087.669/80187033.245/87298666.811"

What I need to do is: everytime there is a / create a new column.

such for example: hello/world/it's feb 17 2020/12345 becomes a 4 column object with all this information inside the /.

I've tried this following code but it doesn't work because it says: "that the object string is not a character", but the object string is a character.

string = "H:Half-yearly/\"A:Outstanding - notional amounts\"/\"A:Total (all instruments)\"/\"B:Foreign exchange\"/\"5J:All countries (total)\"/\"A:Total (all counterparties)\"/\"5J:All countries (total)\"/\"A:Total (all sectors)\"/\"TO1:Total (all currencies)\"/\"USD:US dollar\"/\"A:Total (all maturities)\"/\"A:Total (all ratings)\"/\"3:Total (all methods)\"/\"C:Net - net\"/H:A:A:B:5J:A:5J:A:TO1:USD:A:A:3:C/19168639.500/19152273.382/16570931.333/16504473.647/17872834.161/18034192.743/18340526.000/18976252.550/20062793.085/21044051.427/24842918.967/27753186.875/28401867.500/30250361.915/32530354.232/31530866.590/38308896.039/41071533.056/47782829.500/55333816.999/61778797.231/51013377.932/49245196.366/49565196.793/53615697.500/57490500.198/64325378.832/63517357.370/66711084.080/66852981.078/71298569.378/67974223.786/71903681.455/73329825.600/69380854.616/66121018.427/75421500.092/70549837.635/77043460.796/74755778.576/84448087.669/80187033.245/87298666.811"
library(tidyr)
chr2cols = separate(string, sep = "/")
str(string)

How can I separate this string in more columns? Thank You

Body:
Not sure if you're looking to split into an array instead of columns:

x <- strsplit(string, "/")

Removing the backslash (escape character) for the "

gsub("\"", "", x[[1]])


问:
How to replace/add lines from one file to another file
I have a one file like below example and I have requirement to grep the lines which are starting with system_props(cat file1 | grep ^system_props)..

```<code>JAVA_HOME=`find "$AGENT_HOME/jre" -name release -type f 2>/dev/null | sed "s|/release||g"`

system_props="$system_props -sensu.controller.hostName=abc.nam.net"
system_props="$system_props -sensu.controller.port=8181"
system_props="$system_props -sensu.controller.node=Mcagent"

if [ -z "$JAVA_HOME" ]; then
   if [ -d "/opt/middleware" ]; then
      JAVA_HOME=`find /opt/middleware -type d -name jre 2>/dev/null | grep WebSphere | grep java | grep -v grep | sort | uniq`
   fi
fi
</code>```

I have another file called say file2 which having dummy content like below.

```<code>JAVA_HOME=`find "$AGENT_HOME/jre" -name release -type f 2>/dev/null | sed "s|/release||g"`

system_props="$system_props -sensu.controller.hostName=testhost.net"
system_props="$system_props -sensu.controller.port=8080"

if [ -z "$JAVA_HOME" ]; then
   if [ -d "/opt/middleware" ]; then
      JAVA_HOME=`find /opt/middleware -type d -name jre 2>/dev/null | grep WebSphere | grep java | grep -v grep | sort | uniq`
   fi
fi
</code>```

Now my requirement is to replace the content of cat file1 | grep ^system_props to cat file2 | grep ^system_props)

The expected output of the system_props lines should be added in the file2 which are in file1 under same sequence.

```<code>system_props="$system_props -sensu.controller.hostName=abc.nam.net"
system_props="$system_props -sensu.controller.port=8181"
system_props="$system_props -sensu.controller.node=Mcagent"
</code>```

答:
I gave this a go without looking at the existing answers and came up with roughly the same answer as Ravinder.

```<code>awk '
FNR == NR  {
  line[FNR] = $0
  next
}
/^system_props/  {
  if (!nocopy)
    for (x = 0 ; x < length(line) ; x++ )
      print line[x]
  nocopy=1
  next
}
{
  print
} '  <( grep ^system_props file1 )  file2
</code>```

Personally, I like Ravinder's solution better.   His count variable is the same as my nocopy variable.  And he uses a single variable to capture the system_props from the first file whereas I use an array.

Also, Ravinder is looking for "^system_props" lines within awk, whereas I relegate that responsibility to grep.  However, some may feel that the <( ) syntax I'm using for the grep may be unnecessarily complex.

I also noticed that Ravinder used an awk idiom of 1 to indicate always print which is equivalent to the what I spelled out with {print}.  I like Ravinder's approach because it's shorter (albeit perhaps less obvious to the reader).

Body:
I have a one file like below example and I have requirement to grep the lines which are starting with system_props(cat file1 | grep ^system_props)..

JAVA_HOME=`find "$AGENT_HOME/jre" -name release -type f 2>/dev/null | sed "s|/release||g"`

system_props="$system_props -sensu.controller.hostName=abc.nam.net"
system_props="$system_props -sensu.controller.port=8181"
system_props="$system_props -sensu.controller.node=Mcagent"

if [ -z "$JAVA_HOME" ]; then
   if [ -d "/opt/middleware" ]; then
      JAVA_HOME=`find /opt/middleware -type d -name jre 2>/dev/null | grep WebSphere | grep java | grep -v grep | sort | uniq`
   fi
fi

I have another file called say file2 which having dummy content like below.

JAVA_HOME=`find "$AGENT_HOME/jre" -name release -type f 2>/dev/null | sed "s|/release||g"`

system_props="$system_props -sensu.controller.hostName=testhost.net"
system_props="$system_props -sensu.controller.port=8080"

if [ -z "$JAVA_HOME" ]; then
   if [ -d "/opt/middleware" ]; then
      JAVA_HOME=`find /opt/middleware -type d -name jre 2>/dev/null | grep WebSphere | grep java | grep -v grep | sort | uniq`
   fi
fi

Now my requirement is to replace the content of cat file1 | grep ^system_props to cat file2 | grep ^system_props)

The expected output of the system_props lines should be added in the file2 which are in file1 under same sequence.

system_props="$system_props -sensu.controller.hostName=abc.nam.net"
system_props="$system_props -sensu.controller.port=8181"
system_props="$system_props -sensu.controller.node=Mcagent"

Body:
I gave this a go without looking at the existing answers and came up with roughly the same answer as Ravinder.

awk '
FNR == NR  {
  line[FNR] = $0
  next
}
/^system_props/  {
  if (!nocopy)
    for (x = 0 ; x < length(line) ; x++ )
      print line[x]
  nocopy=1
  next
}
{
  print
} '  <( grep ^system_props file1 )  file2

Personally, I like Ravinder's solution better.   His count variable is the same as my nocopy variable.  And he uses a single variable to capture the system_props from the first file whereas I use an array.

Also, Ravinder is looking for "^system_props" lines within awk, whereas I relegate that responsibility to grep.  However, some may feel that the <( ) syntax I'm using for the grep may be unnecessarily complex.

I also noticed that Ravinder used an awk idiom of 1 to indicate always print which is equivalent to the what I spelled out with {print}.  I like Ravinder's approach because it's shorter (albeit perhaps less obvious to the reader).


问:
java.lang.IllegalArgumentException: No more parsing elements
I have angularjs frontend and java backend, in development it works, but not in production,
same code, same database.
I get this error:

java.lang.IllegalArgumentException: No more parsing elements.

I noticed that in development some json fields are empty strings like "field" : "", but in production the same field is null like "filed" : null, and another field is an object like "field" : {}

Both development and production are debian linux, nginx 1.16.1, same angularjs code and java code.

What could make this happen?

答: Solved updating java version to jdk8u242-b08 in production server.</p>